Title: Plugin running wp-cron.php request?
Last modified: May 15, 2022

---

# Plugin running wp-cron.php request?

 *  Resolved [therealgilles](https://wordpress.org/support/users/chamois_blanc/)
 * (@chamois_blanc)
 * [4 years ago](https://wordpress.org/support/topic/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)

 *  Plugin Author [cornershop](https://wordpress.org/support/users/cornershop/)
 * (@cornershop)
 * [4 years ago](https://wordpress.org/support/topic/plugin-running-wp-cron-php-request/#post-15671024)
 * Hello and thank you for your post! The purpose of this code is to detect whether
   a site uses HTTP basic authentication, which is a type of password protection.
 * Sites that do use this need special configuration in order for WordPress’s cron
   system (which MDD uses for indexing and bulk smart deletion) to function properly.
   If you’re getting a 403 status response for that request to wp-cron.php, that’s
   a sign that your site probably does use HTTP basic authentication.
 * We recommend that you install & configure this plugin: [https://wordpress.org/plugins/wp-cron-http-auth/](https://wordpress.org/plugins/wp-cron-http-auth/)
   
   but please let us know if you have any additional questions.
 *  Thread Starter [therealgilles](https://wordpress.org/support/users/chamois_blanc/)
 * (@chamois_blanc)
 * [4 years ago](https://wordpress.org/support/topic/plugin-running-wp-cron-php-request/#post-15676237)
 * Thank you for the reply, that’s an interesting use case. My site does not use
   HTTP basic authentication. The request is blocked by modsec rules. I run wp-cron
   using PHP on my server using crontab.
 * Is it possible to provide a way to disable this “feature”? I do not need extra
   wp-cron requests on my server coming from plugins.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Plugin running wp-cron.php request?’ is closed to new replies.

 * ![](https://ps.w.org/media-deduper/assets/icon-256x256.png?rev=1682001)
 * [Media Deduper](https://wordpress.org/plugins/media-deduper/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-deduper/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-deduper/)
 * [Active Topics](https://wordpress.org/support/plugin/media-deduper/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-deduper/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-deduper/reviews/)

## Tags

 * [cron](https://wordpress.org/support/topic-tag/cron/)
 * [request](https://wordpress.org/support/topic-tag/request/)
 * [unauthorized](https://wordpress.org/support/topic-tag/unauthorized/)

 * 2 replies
 * 2 participants
 * Last reply from: [therealgilles](https://wordpress.org/support/users/chamois_blanc/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/plugin-running-wp-cron-php-request/#post-15676237)
 * Status: resolved