<?php
/**
 * A pseudo-CRON daemon for scheduling WordPress tasks
 *
 * WP Cron is triggered when the site receives a visit. In the scenario
 * where a site may not receive enough visits to execute scheduled tasks
 * in a timely manner, this file can be called directly or via a server
 * CRON daemon for X number of times.
 *
 * Defining DISABLE_WP_CRON as true and calling this file directly are
 * mutually exclusive and the latter does not rely on the former to work.
 *
 * The HTTP request to this file will not slow down the visitor who happens to
 * visit when the cron job is needed to run.
 *
 * @package WordPress
 */

ignore_user_aborttrue );

/* Don't make the request block till we finish, if possible. */
if ( function_exists'fastcgi_finish_request' ) && version_comparephpversion(), '7.0.16''>=' ) ) {
    if ( ! 
headers_sent() ) {
        
header'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
        
header'Cache-Control: no-cache, must-revalidate, max-age=0' );
    }

    
fastcgi_finish_request();
}

if ( ! empty( 
$_POST ) || defined'DOING_AJAX' ) || defined'DOING_CRON' ) ) {
    die();
}

/**
 * Tell WordPress we are doing the CRON task.
 *
 * @var bool
 */
define'DOING_CRON'true );

if ( ! 
defined'ABSPATH' ) ) {
    
/** Set up WordPress environment */
    
require_once __DIR__ '/wp-load.php';
}

/**
 * Retrieves the cron lock.
 *
 * Returns the uncached `doing_cron` transient.
 *
 * @ignore
 * @since 3.3.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return string|false Value of the `doing_cron` transient, 0|false otherwise.
 */
function _get_cron_lock() {
    global 
$wpdb;

    
$value 0;
    if ( 
wp_using_ext_object_cache() ) {
        
/*
         * Skip local cache and force re-fetch of doing_cron transient
         * in case another process updated the cache.
         */
        
$value wp_cache_get'doing_cron''transient'true );
    } else {
        
$row $wpdb->get_row$wpdb->prepare"SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1"'_transient_doing_cron' ) );
        if ( 
is_object$row ) ) {
            
$value $row->option_value;
        }
    }

    return 
$value;
}

$crons wp_get_ready_cron_jobs();
if ( empty( 
$crons ) ) {
    die();
}

$gmt_time microtimetrue );

// The cron lock: a unix timestamp from when the cron was spawned.
$doing_cron_transient get_transient'doing_cron' );

// Use global $doing_wp_cron lock, otherwise use the GET lock. If no lock, try to grab a new lock.
if ( empty( $doing_wp_cron ) ) {
    if ( empty( 
$_GET['doing_wp_cron'] ) ) {
        
// Called from external script/job. Try setting a lock.
        
if ( $doing_cron_transient && ( $doing_cron_transient WP_CRON_LOCK_TIMEOUT $gmt_time ) ) {
            return;
        }
        
$doing_wp_cron        sprintf'%.22F'microtimetrue ) );
        
$doing_cron_transient $doing_wp_cron;
        
set_transient'doing_cron'$doing_wp_cron );
    } else {
        
$doing_wp_cron $_GET['doing_wp_cron'];
    }
}

/*
 * The cron lock (a unix timestamp set when the cron was spawned),
 * must match $doing_wp_cron (the "key").
 */
if ( $doing_cron_transient !== $doing_wp_cron ) {
    return;
}

foreach ( 
$crons as $timestamp => $cronhooks ) {
    if ( 
$timestamp $gmt_time ) {
        break;
    }

    foreach ( 
$cronhooks as $hook => $keys ) {

        foreach ( 
$keys as $k => $v ) {

            
$schedule $v['schedule'];

            if ( 
$schedule ) {
                
wp_reschedule_event$timestamp$schedule$hook$v['args'] );
            }

            
wp_unschedule_event$timestamp$hook$v['args'] );

            
/**
             * Fires scheduled events.
             *
             * @ignore
             * @since 2.1.0
             *
             * @param string $hook Name of the hook that was scheduled to be fired.
             * @param array  $args The arguments to be passed to the hook.
             */
            
do_action_ref_array$hook$v['args'] );

            
// If the hook ran too long and another cron process stole the lock, quit.
            
if ( _get_cron_lock() !== $doing_wp_cron ) {
                return;
            }
        }
    }
}

if ( 
_get_cron_lock() === $doing_wp_cron ) {
    
delete_transient'doing_cron' );
}

die();
File Manager

在线文件管理器

编号 名称 类型 大小 可读 可写 可执行 创建时间 修改时间 访问时间 操作
1 index.php 405B 2022-11-18 23:38:58 2020-02-06 16:03:10 2024-10-22 19:08:48 | | | | | |
2 wp-config.php 3.37KB 2022-11-18 23:38:58 2020-07-26 04:27:39 2024-10-22 19:08:48 | | | | | |
3 wp-links-opml.php 2.44KB 2022-11-18 23:38:58 2020-02-06 16:03:10 2024-10-20 17:48:32 | | | | | |
4 .htaccess 461B 2022-11-18 23:38:58 2020-09-26 20:23:15 2024-10-22 10:01:19 | | | | | |
5 error_log 846B 2022-11-18 23:38:58 2020-08-03 19:34:35 2024-09-30 06:55:15 | | | | | |
6 wp-blog-header.php 351B 2022-11-18 23:38:58 2020-02-06 16:03:10 2024-10-21 23:21:32 | | | | | |
7 wp-trackback.php 4.71KB 2022-11-01 08:20:30 2022-11-01 07:24:30 2024-10-23 01:24:52 | | | | | |
8 wp-login.php 46.75KB 2022-11-18 23:38:58 2020-02-10 13:20:04 2024-10-23 01:27:03 | | | | | |
9 wp-comments-post.php 2.28KB 2022-11-18 23:38:58 2020-06-03 05:56:10 2024-08-03 01:33:04 | | | | | |
10 wp-config-sample.php 2.84KB 2022-11-18 23:38:58 2020-02-06 16:03:10 2024-08-03 01:33:04 | | | | | |
11 wp-activate.php 6.75KB 2022-11-18 23:38:58 2020-02-06 16:03:10 2024-10-23 01:27:25 | | | | | |
12 wp-mail.php 8.25KB 2022-11-01 08:20:30 2022-11-01 07:21:27 2024-10-23 01:28:33 | | | | | |
13 wp-load.php 3.22KB 2022-11-18 23:38:58 2020-02-06 16:03:10 2024-10-22 19:08:48 | | | | | |
14 readme.html 7.11KB 2022-11-18 23:38:58 2020-10-31 00:58:44 2024-10-23 01:25:26 | | | | | |
15 license.txt 19.45KB 2022-11-18 23:38:58 2020-02-12 21:24:04 2024-10-23 01:20:49 | | | | | |
16 .htaccess.07122020.bak 462B 2022-11-18 23:38:58 2020-07-26 04:30:20 2024-10-23 01:20:44 | | | | | |
17 .htaccess.07272020.bak 462B 2022-11-18 23:38:58 2020-07-26 08:34:34 2024-10-23 01:21:16 | | | | | |
18 wp-settings.php 18.94KB 2022-11-18 23:38:58 2020-04-10 13:29:06 2024-10-21 23:21:32 | | | | | |
19 wp-signup.php 30.38KB 2022-11-18 23:38:58 2020-02-06 16:03:10 2024-10-07 13:26:42 | | | | | |
20 wp-cron.php 3.85KB 2022-11-18 23:38:58 2020-02-06 16:03:10 2024-10-23 01:29:43 | | | | | |
21 xmlrpc.php 3.06KB 2022-11-18 23:38:58 2020-02-06 16:03:10 2024-10-23 01:22:34 | | | | | |
22 .well-known 91B 2022-09-06 01:01:21 2020-07-25 23:12:03 2024-10-22 17:24:01 | | | | |
23 cgi-bin 0B 2022-09-06 01:01:21 2020-07-25 22:35:05 2024-10-22 17:24:01 | | | | |
24 wp-admin 7.5MB 2022-09-06 01:01:21 2022-09-02 22:48:29 2024-10-22 17:24:01 | | | | |
25 wp-includes 31.8MB 2022-11-01 09:02:32 2022-11-01 09:02:32 2024-10-22 17:24:02 | | | | |
26 wp-content 312.71MB 2022-09-06 01:01:21 2021-01-06 21:53:44 2024-10-22 17:24:02 | | | | |