Plugin running wp-cron.php request?
-
I found the following code in the plugin after finding an unexpected wp-cron.php request (which was returned 403). Should this be disabled when WP_CRON is set to false? Isn’t there another/better way of doing this without creating a wp-cron request on the backend?
/** * Get the basic authentication check status. * * @return bool */ function mdd_basic_auth_check() { // Get any existing copy of our transient data if ( false === ( $request = get_transient( 'mdd_wp_cron_request' ) ) ) { // It wasn't there, so regenerate the data and save the transient $url = site_url( 'wp-cron.php?doing_wp_cron' ); $request = wp_remote_request( $url ); set_transient( 'mdd_wp_cron_request', $request, 12 * HOUR_IN_SECONDS ); } if ( is_wp_error( $request ) ) { return true; } if ( isset( $request['headers']['www-authenticate'] ) ) { return true; } if ( 401 === $request['response']['code'] ) { return true; } return false; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Plugin running wp-cron.php request?’ is closed to new replies.