• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_core_updates函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_core_updates函数的典型用法代码示例。如果您正苦于以下问题:PHP get_core_updates函数的具体用法?PHP get_core_updates怎么用?PHP get_core_updates使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_core_updates函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: wp_get_update_data

 /**
  * 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;
 }
开发者ID:trepmal,项目名称:wp-hud,代码行数:25,代码来源:wp-hud.php


示例2: runUpgradeRequiredCheck

 /**
  * 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;
 }
开发者ID:julianbonilla,项目名称:three20.info,代码行数:28,代码来源:wpau_prelimcheck.class.php


示例3: get_preferred_from_update_core

/**
 * 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];
}
开发者ID:ShankarVellal,项目名称:WordPress,代码行数:13,代码来源:update.php


示例4: get_update_data

 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));
 }
开发者ID:omodev,项目名称:hooks,代码行数:20,代码来源:automatic-updater.php


示例5: getSiteStats

 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);
//.........这里部分代码省略.........
开发者ID:jexmex,项目名称:mainwp-child,代码行数:101,代码来源:class-mainwp-child.php


示例6: wpau_add_nag

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>";
        }
    }
}
开发者ID:julianbonilla,项目名称:three20.info,代码行数:49,代码来源:wordpress-automatic-upgrade.php


示例7: array

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');
开发者ID:realfluid,项目名称:umbaugh,代码行数:30,代码来源:menu.php


示例8: _wprp_upgrade_core

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;
}
开发者ID:phpwomen,项目名称:combell,代码行数:37,代码来源:plugin.php


示例9: wp_oracle_get_core_upgrade

 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));
 }
开发者ID:raqqun,项目名称:wordpress-oracle,代码行数:24,代码来源:class-wordpress-oracle-api-controllers.php


示例10: get_updates

 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)));
 }
开发者ID:aaronfrey,项目名称:PepperLillie-Cambridge,代码行数:84,代码来源:updates.php


示例11: wp_get_update_data

/**
 * 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);
}
开发者ID:AndreyLanko,项目名称:perevorot-prozorro-wp,代码行数:62,代码来源:update.php


示例12: get_core_updates

 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) {
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:31,代码来源:data.php


示例13: core_update_available_notification

 /**
  * 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);
     }
 }
开发者ID:bamadesigner,项目名称:rock-the-slackbot,代码行数:63,代码来源:hooks.php


示例14: et_builder_get_warnings

 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;
 }
开发者ID:pacificano,项目名称:pacificano,代码行数:59,代码来源:core.php


示例15: upgrade_screen


//.........这里部分代码省略.........
            }*/
        //  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');
开发者ID:foliovision,项目名称:businesspress,代码行数:67,代码来源:businesspress.php


示例16: list_plugin_updates

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-informat 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_core_vars函数代码示例发布时间:2022-05-15
下一篇:
PHP get_core_subsystems函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap