cache(); if ( !file_exists(__FILE__) ) { $this->removeHooks(); $this->updateChecker->removeHooks(); return; } //Sanity check and limitation to relevant types. if ( !is_array($upgradeInfo) || !isset($upgradeInfo['type'], $upgradeInfo['action']) || 'update' !== $upgradeInfo['action'] || !in_array($upgradeInfo['type'], array('plugin', 'theme')) ) { return; } //Filter out notifications of upgrades that should have no bearing upon whether or not our //current info is up-to-date. if ( is_a($this->updateChecker, 'Puc_v4p13_Theme_UpdateChecker') ) { if ( 'theme' !== $upgradeInfo['type'] || !isset($upgradeInfo['themes']) ) { return; } //Letting too many things going through for checks is not a real problem, so we compare widely. if ( !in_array( strtolower($this->updateChecker->directoryName), array_map('strtolower', $upgradeInfo['themes']) ) ) { return; } } if ( is_a($this->updateChecker, 'Puc_v4p13_Plugin_UpdateChecker') ) { if ( 'plugin' !== $upgradeInfo['type'] || !isset($upgradeInfo['plugins']) ) { return; } //Themes pass in directory names in the information array, but plugins use the relative plugin path. if ( !in_array( strtolower($this->updateChecker->directoryName), array_map('dirname', array_map('strtolower', $upgradeInfo['plugins'])) ) ) { return; } } $this->maybeCheckForUpdates(); } /** * Check for updates if the configured check interval has already elapsed. * Will use a shorter check interval on certain admin pages like "Dashboard -> Updates" or when doing cron. * * You can override the default behaviour by using the "puc_check_now-$slug" filter. * The filter callback will be passed three parameters: * - Current decision. TRUE = check updates now, FALSE = don't check now. * - Last check time as a Unix timestamp. * - Configured check period in hours. * Return TRUE to check for updates immediately, or FALSE to cancel. * * This method is declared public because it's a hook callback. Calling it directly is not recommended. */ public function maybeCheckForUpdates() { if ( empty($this->checkPeriod) ){ return; } $state = $this->updateChecker->getUpdateState(); $shouldCheck = ($state->timeSinceLastCheck() >= $this->getEffectiveCheckPeriod()); //Let plugin authors substitute their own algorithm. $shouldCheck = apply_filters( $this->updateChecker->getUniqueName('check_now'), $shouldCheck, $state->getLastCheck(), $this->checkPeriod ); if ( $shouldCheck ) { $this->updateChecker->checkForUpdates(); } } /** * Calculate the actual check period based on the current status and environment. * * @return int Check period in seconds. */ protected function getEffectiveCheckPeriod() { $currentFilter = current_filter(); if ( in_array($currentFilter, array('load-update-core.php', 'upgrader_process_complete')) ) { //Check more often when the user visits "Dashboard -> Updates" or does a bulk update. $period = 60; } else if ( in_array($currentFilter, $this->hourlyCheckHooks) ) { //Also check more often on /wp-admin/update.php and the "Plugins" or "Themes" page. $period = 3600; } else if ( $this->throttleRedundantChecks && ($this->updateChecker->getUpdate() !== null) ) { //Check less frequently if it's already known that an update is available. $period = $this->throttledCheckPeriod * 3600; } else if ( defined('DOING_CRON') && constant('DOING_CRON') ) { //WordPress cron schedules are not exact, so lets do an update check even //if slightly less than $checkPeriod hours have elapsed since the last check. $cronFuzziness = 20 * 60; $period = $this->checkPeriod * 3600 - $cronFuzziness; } else { $period = $this->checkPeriod * 3600; } return $period; } /** * Add our custom schedule to the array of Cron schedules used by WP. * * @param array $schedules * @return array */ public function _addCustomSchedule($schedules) { if ( $this->checkPeriod && ($this->checkPeriod > 0) ){ $scheduleName = 'every' . $this->checkPeriod . 'hours'; $schedules[$scheduleName] = array( 'interval' => $this->checkPeriod * 3600, 'display' => sprintf('Every %d hours', $this->checkPeriod), ); } return $schedules; } /** * Remove the scheduled cron event that the library uses to check for updates. * * @return void */ public function removeUpdaterCron() { wp_clear_scheduled_hook($this->cronHook); } /** * Get the name of the update checker's WP-cron hook. Mostly useful for debugging. * * @return string */ public function getCronHookName() { return $this->cronHook; } /** * Remove most hooks added by the scheduler. */ public function removeHooks() { remove_filter('cron_schedules', array($this, '_addCustomSchedule')); remove_action('admin_init', array($this, 'maybeCheckForUpdates')); remove_action('load-update-core.php', array($this, 'maybeCheckForUpdates')); if ( $this->cronHook !== null ) { remove_action($this->cronHook, array($this, 'maybeCheckForUpdates')); } if ( !empty($this->hourlyCheckHooks) ) { foreach ($this->hourlyCheckHooks as $hook) { remove_action($hook, array($this, 'maybeCheckForUpdates')); } } } } endif;
Fatal error: Uncaught Error: Class 'Puc_v4p13_Scheduler' not found in /home/sportuga/public_html/wp-content/plugins/dynamic-content-for-elementor/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p13/Plugin/UpdateChecker.php:81 Stack trace: #0 /home/sportuga/public_html/wp-content/plugins/dynamic-content-for-elementor/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p13/UpdateChecker.php(91): Puc_v4p13_Plugin_UpdateChecker->createScheduler(12) #1 /home/sportuga/public_html/wp-content/plugins/dynamic-content-for-elementor/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p13/Plugin/UpdateChecker.php(59): Puc_v4p13_UpdateChecker->__construct('https://license...', 'dynamic-content...', 'dynamic-content...', 12, '') #2 /home/sportuga/public_html/wp-content/plugins/dynamic-content-for-elementor/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p13/Factory.php(121): Puc_v4p13_Plugin_UpdateChecker->__construct('https://license...', '/home/sportuga/...', 'dynamic-content...', 12, '', '') #3 /home/sportuga/public_html/wp-content/plugins/ in /home/sportuga/public_html/wp-content/plugins/dynamic-content-for-elementor/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p13/Plugin/UpdateChecker.php on line 81