public function _replyToUpdateCacheItems() { if (null !== self::$_bUpdateCacheCalled) { return; } self::$_bUpdateCacheCalled = true; if (empty($this->arrExpiredTransientsRequestURIs)) { return; } // Perform multi-dimensional array_unique() // @deprecated As of v2.3.5 the request URI is set to the key, so it is already unique by default. // $this->arrExpiredTransientsRequestURIs = array_map( "unserialize", array_unique( array_map( "serialize", $this->arrExpiredTransientsRequestURIs ) ) ); $_iScheduled = 0; foreach ($this->arrExpiredTransientsRequestURIs as $_aExpiredCacheRequest) { /* the structure of $_aExpiredCacheRequest = array( 'URI' => the API request URI 'key' => the array key that holds the result. e.g. for search results, the 'statuses' key holds the fetched tweets. 'rate_limit_status_key' => the array holding the representation of the rate limit status dimensional key. */ // Check if the URI key holds a valid url. if (!filter_var($_aExpiredCacheRequest['URI'], FILTER_VALIDATE_URL)) { continue; } // Schedules the action to run in the background with WP Cron. // If already scheduled, skip. $_aArgs = array($_aExpiredCacheRequest); if (wp_next_scheduled('fetch_tweets_action_transient_renewal', $_aArgs)) { continue; } wp_schedule_single_event(time(), 'fetch_tweets_action_transient_renewal', $_aArgs); $_iScheduled++; } if (!$_iScheduled) { return; } // Call the background process. if ('intense' == $this->oOption->aOptions['cache_settings']['caching_mode']) { FetchTweets_Cron::see(); return; } wp_remote_get(site_url("/wp-cron.php"), array('timeout' => 0.01, 'sslverify' => false)); }