Not logged in. · Lost password · Registration disabled
Forum: Overview Files & Mods / Datein & Mods RSS
add option post_notification_max_exe
syfr12 #1
Member since Jan 2009 · 4 posts
Group memberships: Mitglieder
Show profile · Link to this post
Subject: add option post_notification_max_exe
         default max_execution_time is 30 seconds at most server site,
         it's too short,will caulse query sql be executed too much times
         For perfmonce ,give you a chance to  add the max_execution_time to greater number termporily;


1\ in install.php,add:
add_option('post_notification_max_exe', "6000" , 'Max Execute Time of Mail send script', 'no');
2\  in admin_settings.php ,
2.1: under then line :  <h4> <?php  _e('Technical', 'post_notification');  ?></h4>

    <tr class="alternate">
        <th style="text-align:right;padding-right:10px;"><?php _e('php max_execute_time when send mail:', 'post_notification'); ?></th>
        <td><input name="max_exe" type="text" id="max_exe" size="35" value="<?php  echo get_option('post_notification_max_exe'); ?>" /> <?php _e('seconds.', 'post_notification'); ?></td>
2.2: before the line : $p_pause = $_POST['pause'];
        $p_max_exe = $_POST['max_exe'];
            if($p_max_exe >= 0){
                update_option('post_notification_max_exe', $p_max_exe );
            } else {
                echo '<div class="error">' . __('php max_execute_time must be zero or greater.', 'post_notification') . '</div>';
        } else {
            echo '<div class="error">' . __('php max_execute_time must be a number.', 'post_notification') . '</div>';
3  in sendmail.php->function post_notification_send()    
  $max_exe = get_option('post_notification_max_exe');
  if ($max_exe > 0) {
Morty (Administrator) #2
User title: Author
Member since Jun 2007 · 928 posts
Group memberships: Administratoren, Mitglieder
Show profile · Link to this post
I'm not sure whether this extension makes too much sense for the following reasons:

Most hosters don't allow to increase max_execution_time and it's possible to blast out quite a few mails within 30 secs (> 100).

Also after sending each mail PN checks how much time is left until the execution time runs out. If less then 5 secs are left PN will continue sending mails with the next page load.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum