Make WordPress Core

Changeset 11782


Ignore:
Timestamp:
08/06/2009 07:58:47 PM (15 years ago)
Author:
westi
Message:

Limit wp-mail blog by email checks to every 5 minutes. Fixes #7245 based on patches from lilyfan and Denis-de-Bernardy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-mail.php

    r11380 r11782  
    1414require_once( ABSPATH . WPINC . '/class-pop3.php' );
    1515
     16/** Only check at this interval for new messages. */
     17if ( !defined('WP_MAIL_INTERVAL') )
     18    define('WP_MAIL_INTERVAL', 500); // 5 minutes
     19
     20$last_checked = get_transient('mailserver_last_checked');
     21
     22if ( $last_checked )
     23    wp_die(__('Slow down cowboy, no need to check for new mails so often!'));
     24
     25set_transient('mailserver_last_checked', true, WP_MAIL_INTERVAL);
     26
    1627$time_difference = get_option('gmt_offset') * 3600;
    1728
     
    1930
    2031$pop3 = new POP3();
     32$count = 0;
    2133
    2234if ( ! $pop3->connect(get_option('mailserver_url'), get_option('mailserver_port') ) ||
Note: See TracChangeset for help on using the changeset viewer.