Ejemplo n.º 1
0
function debug_menu()
{
    global $wp_filter;
    echo "<div class=\"wrap\">";
    $datetime = get_option('date_format') . ' @ ' . get_option('time_format');
    echo "<p>Current Server time is: \r\n";
    echo "<strong>" . gmdate($datetime, current_time('timestamp', 1)) . "</strong></p>\r\n";
    echo "<p>Current Blog time is: \r\n";
    echo "<strong>" . gmdate($datetime, current_time('timestamp')) . "</strong></p>\r\n";
    echo "<p>Current Blog offset is: \r\n";
    echo get_option('gmt_offset') . "\r\n";
    echo "<pre>";
    cron_jobs();
    echo "</pre>";
    echo "Current Subscribe 2 Options are:";
    echo "<pre>";
    print_r(get_option('subscribe2_options'));
    echo "</pre>";
    echo "</div>";
    include ABSPATH . 'wp-admin/admin-footer.php';
    // just to be sure
    die;
}
Ejemplo n.º 2
0
if (is_cron_calling()) {
    $status_changed = false;
    $status = json_decode(file_get_contents(cron_status_file()), true);
    if (empty($status)) {
        $status = array();
        $status['webhook_last_time'] = 0;
        $status_changed = true;
    }
    //每5分钟,执行webhook处理检查
    if (time() - $status['webhook_last_time'] >= 60 * 3) {
        $status['webhook_last_time'] = time();
        $status_changed = true;
        shell_exec('php -q ' . dirname(__FILE__) . '/webhook.php crontab > /dev/null 2>/dev/null &');
    }
    //执行各个数据表设置的webhook网址
    $jobs = cron_jobs();
    foreach ($jobs as $job) {
        if (!array_key_exists('key', $job)) {
            continue;
        }
        $key = $job['key'];
        $url = $job['url'];
        $minutes = $job['minutes'];
        if (!array_key_exists($key, $status)) {
            $new_status = array();
            $new_status['url'] = $url;
            $new_status['minutes'] = $minutes;
            $new_status['last_check_time'] = 0;
            $status[$key] = $new_status;
        }
        $status_item =& $status[$key];