Ticket #7372: 7372.diff
| File 7372.diff, 1.8 KB (added by ryan, 4 years ago) |
|---|
-
wp-includes/update.php
90 90 if ( !function_exists('fsockopen') || defined('WP_INSTALLING') ) 91 91 return false; 92 92 93 $current = get_option( 'update_plugins' );94 95 $time_not_changed = isset( $current->last_checked ) && 43200 > ( time() - $current->last_checked );96 97 93 // If running blog-side, bail unless we've not checked in the last 12 hours 98 if ( !function_exists( 'get_plugins' ) ) { 99 if ( $time_not_changed ) 100 return false; 94 if ( !function_exists( 'get_plugins' ) ) 101 95 require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 102 }103 96 104 97 $plugins = get_plugins(); 105 98 $active = get_option( 'active_plugins' ); 99 $current = get_option( 'update_plugins' ); 106 100 107 101 $new_option = ''; 108 102 $new_option->last_checked = time(); … … 160 154 161 155 update_option( 'update_plugins', $new_option ); 162 156 } 163 if ( defined( 'WP_ADMIN' ) && WP_ADMIN )164 add_action( 'admin_init', 'wp_update_plugins' );165 else166 add_action( 'init', 'wp_update_plugins' );167 157 158 add_action( 'load-plugins.php', 'wp_update_plugins' ); 159 add_action( 'wp_update_plugins', 'wp_update_plugins' ); 160 161 if ( !wp_next_scheduled('wp_update_plugins') ) 162 wp_schedule_event(time(), '5min', 'wp_update_plugins'); 163 168 164 ?> -
wp-admin/includes/plugin.php
99 99 function get_plugins($plugin_folder = '') { 100 100 101 101 if ( ! $cache_plugins = wp_cache_get('plugins', 'plugins') ) 102 $cache d_plugins = array();102 $cache_plugins = array(); 103 103 104 104 if ( isset($cache_plugins[ $plugin_folder ]) ) 105 105 return $cache_plugins[ $plugin_folder ];
