array (
'plugins' => (int) Number of plugin updates available.
'themes' => (int) Number of theme updates available.
'wordpress' => (int) Number of WordPress core updates available.
'translations' => (int) Number of translation updates available.
'total' => (int) Total of all available updates.
'wp_update_version' => (string) The latest available version of WordPress, only present if a WordPress update is needed.
)
public static get_updates ( ) : array | ||
리턴 | array |
public function test_sync_callable_whitelist() { // $this->setSyncClientDefaults(); $callables = array('wp_max_upload_size' => wp_max_upload_size(), 'is_main_network' => Jetpack::is_multi_network(), 'is_multi_site' => is_multisite(), 'main_network_site' => Jetpack_Sync_Functions::main_network_site_url(), 'single_user_site' => Jetpack::is_single_user_site(), 'updates' => Jetpack::get_updates(), 'home_url' => Jetpack_Sync_Functions::home_url(), 'site_url' => Jetpack_Sync_Functions::site_url(), 'has_file_system_write_access' => Jetpack_Sync_Functions::file_system_write_access(), 'is_version_controlled' => Jetpack_Sync_Functions::is_version_controlled(), 'taxonomies' => Jetpack_Sync_Functions::get_taxonomies(), 'post_types' => Jetpack_Sync_Functions::get_post_types(), 'post_type_features' => Jetpack_Sync_Functions::get_post_type_features(), 'rest_api_allowed_post_types' => Jetpack_Sync_Functions::rest_api_allowed_post_types(), 'rest_api_allowed_public_metadata' => Jetpack_Sync_Functions::rest_api_allowed_public_metadata(), 'sso_is_two_step_required' => Jetpack_SSO_Helpers::is_two_step_required(), 'sso_should_hide_login_form' => Jetpack_SSO_Helpers::should_hide_login_form(), 'sso_match_by_email' => Jetpack_SSO_Helpers::match_by_email(), 'sso_new_user_override' => Jetpack_SSO_Helpers::new_user_override(), 'sso_bypass_default_login_form' => Jetpack_SSO_Helpers::bypass_login_forward_wpcom(), 'wp_version' => Jetpack_Sync_Functions::wp_version(), 'get_plugins' => Jetpack_Sync_Functions::get_plugins(), 'active_modules' => Jetpack::get_active_modules(), 'hosting_provider' => Jetpack_Sync_Functions::get_hosting_provider(), 'locale' => get_locale(), 'site_icon_url' => Jetpack_Sync_Functions::site_icon_url()); if (is_multisite()) { $callables['network_name'] = Jetpack::network_name(); $callables['network_allow_new_registrations'] = Jetpack::network_allow_new_registrations(); $callables['network_add_new_users'] = Jetpack::network_add_new_users(); $callables['network_site_upload_space'] = Jetpack::network_site_upload_space(); $callables['network_upload_file_types'] = Jetpack::network_upload_file_types(); $callables['network_enable_administration_menus'] = Jetpack::network_enable_administration_menus(); } $this->sender->do_sync(); foreach ($callables as $name => $value) { // TODO: figure out why _sometimes_ the 'support' value of // the post_types value is being removed from the output if ($name === 'post_types') { continue; } $this->assertCallableIsSynced($name, $value); } $whitelist_keys = array_keys($this->callable_module->get_callable_whitelist()); $callables_keys = array_keys($callables); // Are we testing all the callables in the defaults? $whitelist_and_callable_keys_difference = array_diff($whitelist_keys, $callables_keys); $this->assertTrue(empty($whitelist_and_callable_keys_difference), 'Some whitelisted options don\'t have a test: ' . print_r($whitelist_and_callable_keys_difference, 1)); // Are there any duplicate keys? $unique_whitelist = array_unique($whitelist_keys); $this->assertEquals(count($unique_whitelist), count($whitelist_keys), 'The duplicate keys are: ' . print_r(array_diff_key($whitelist_keys, array_unique($whitelist_keys)), 1)); }
public static function refresh_update_data() { if (current_user_can('update_core') && current_user_can('update_plugins') && current_user_can('update_themes')) { /** * Fires whenever the amount of updates needed for a site changes. * Syncs an array that includes the number of theme, plugin, and core updates available, as well as the latest core version available. * * @since 3.7.0 * * @param string jetpack_updates * @param array Update counts calculated by Jetpack::get_updates */ do_action('add_option_jetpack_updates', 'jetpack_updates', Jetpack::get_updates()); } /** * Fires whenever the amount of updates needed for a site changes. * Syncs an array of core, theme, and plugin data, and which of each is out of date * * @since 3.7.0 * * @param string jetpack_update_details * @param array Update details calculated by Jetpack::get_update_details */ do_action('add_option_jetpack_update_details', 'jetpack_update_details', Jetpack::get_update_details()); }
protected function get_updates() { return (array) Jetpack::get_updates(); }