Пример #1
0
 private function _get_must_use_plugins()
 {
     if (!$this->plugins) {
         $this->plugins = get_mu_plugins();
     }
     return $this->plugins;
 }
Пример #2
0
 protected function status_all()
 {
     $this->mu_plugins = get_mu_plugins();
     $plugins = get_plugins();
     $plugins = array_merge($plugins, $this->mu_plugins);
     // Print the header
     WP_CLI::line('Installed plugins:');
     foreach ($plugins as $file => $plugin) {
         if (false === strpos($file, '/')) {
             $name = str_replace('.php', '', basename($file));
         } else {
             $name = dirname($file);
         }
         if ($this->get_update_status($file)) {
             $line = ' %yU%n';
         } else {
             $line = '  ';
         }
         $line .= $this->get_status($file) . " {$name}%n";
         WP_CLI::line($line);
     }
     // Print the footer
     WP_CLI::line();
     $legend = array('I' => 'Inactive', '%gA' => 'Active', '%cM' => 'Must Use');
     if (is_multisite()) {
         $legend['%bN'] = 'Network Active';
     }
     WP_CLI::legend($legend);
 }
Пример #3
0
 protected function get_all_items()
 {
     $items = $this->get_item_list();
     foreach (get_mu_plugins() as $file => $mu_plugin) {
         $items[$file] = array('name' => $this->get_name($file), 'status' => 'must-use', 'update' => false);
     }
     return $items;
 }
Пример #4
0
 private function updateCache()
 {
     require_once ABSPATH . 'wp-admin/includes/plugin.php';
     self::$autoPlugins = get_plugins(self::$relativePath);
     self::$muPlugins = get_mu_plugins();
     $plugins = array_diff_key(self::$autoPlugins, self::$muPlugins);
     $rebuild = !is_array(self::$cache['plugins']);
     self::$activated = $rebuild ? $plugins : array_diff_key($plugins, self::$cache['plugins']);
     self::$cache = ['plugins' => $plugins, 'count' => $this->countPlugins()];
     update_site_option('tagmeoAutoloader', self::$cache);
 }
 function get_plugins_info()
 {
     $plugins = $this->sitepress->get_wp_api()->get_plugins();
     $active_plugins = $this->sitepress->get_wp_api()->get_option('active_plugins');
     $active_plugins_info = array();
     foreach ($active_plugins as $plugin) {
         if (isset($plugins[$plugin])) {
             unset($plugins[$plugin]['Description']);
             $active_plugins_info[$plugin] = $plugins[$plugin];
         }
     }
     $mu_plugins = get_mu_plugins();
     $dropins = get_dropins();
     $output = array('active_plugins' => $active_plugins_info, 'mu_plugins' => $mu_plugins, 'dropins' => $dropins);
     return $output;
 }
 function get_plugins_info()
 {
     if (!function_exists('get_plugins')) {
         $admin_includes_path = str_replace(site_url('/', 'admin'), ABSPATH, admin_url('includes/', 'admin'));
         require_once $admin_includes_path . 'plugin.php';
     }
     $plugins = get_plugins();
     $active_plugins = get_option('active_plugins');
     $active_plugins_info = array();
     foreach ($active_plugins as $plugin) {
         if (isset($plugins[$plugin])) {
             unset($plugins[$plugin]['Description']);
             $active_plugins_info[$plugin] = $plugins[$plugin];
         }
     }
     $mu_plugins = get_mu_plugins();
     $dropins = get_dropins();
     $output = array('active_plugins' => $active_plugins_info, 'mu_plugins' => $mu_plugins, 'dropins' => $dropins);
     return $output;
 }
Пример #7
0
 /**
  * Get the status of one or all plugins
  *
  * @param array $args
  */
 function status($args = array(), $vars = array())
 {
     $this->mu_plugins = get_mu_plugins();
     if (empty($args)) {
         $this->list_plugins();
         return;
     }
     list($file, $name) = $this->parse_name($args, __FUNCTION__);
     $details = $this->get_details($file);
     $status = $this->get_status($file, true);
     $version = $details['Version'];
     if (WP_CLI::get_update_status($file, 'update_plugins')) {
         $version .= ' (%gUpdate available%n)';
     }
     WP_CLI::line('Plugin %9' . $name . '%n details:');
     WP_CLI::line('    Name: ' . $details['Name']);
     WP_CLI::line('    Status: ' . $status . '%n');
     WP_CLI::line('    Version: ' . $version);
     WP_CLI::line('    Author: ' . $details['Author']);
     WP_CLI::line('    Description: ' . $details['Description']);
 }
Пример #8
0
 /**
  * Lists any "Must-use Plugins".
  *
  * @return array
  */
 static function get_mu_plugins()
 {
     $mu_plugins = array();
     if (function_exists('get_mu_plugins')) {
         $mu_plugins_raw = get_mu_plugins();
         foreach ($mu_plugins_raw as $k => $v) {
             $plugin = $v['Name'];
             if (!empty($v['Version'])) {
                 $plugin .= sprintf(' version %s', $v['Version']);
             }
             if (!empty($v['Author'])) {
                 $plugin .= sprintf(' by %s', $v['Author']);
             }
             if (!empty($v['AuthorURI'])) {
                 $plugin .= sprintf('(%s)', $v['AuthorURI']);
             }
             $mu_plugins[] = $plugin;
         }
     }
     return $mu_plugins;
 }
 /**
  * Returns an array with the installed plugins
  * @return array
  */
 private function get_installed_plugins()
 {
     if (!function_exists('get_plugins')) {
         require_once ABSPATH . 'wp-admin/includes/plugin.php';
     }
     $plugins = get_plugins();
     // add the MU plugin details if any
     $plugins['mu_plugins'] = get_mu_plugins();
     return $plugins;
 }
 /**
  * @covers ::get_mu_plugins
  */
 public function test_get_mu_plugins_should_ignore_files_without_php_extensions()
 {
     if (is_dir(WPMU_PLUGIN_DIR)) {
         $exists = true;
         $this->_back_up_mu_plugins();
     } else {
         $exists = false;
         mkdir(WPMU_PLUGIN_DIR);
     }
     $this->_create_plugin('<?php\\n//Test', 'foo.php', WPMU_PLUGIN_DIR);
     $this->_create_plugin('<?php\\n//Test 2', 'bar.txt', WPMU_PLUGIN_DIR);
     $found = get_mu_plugins();
     $this->assertEquals(array('foo.php'), array_keys($found));
     // Clean up.
     unlink(WPMU_PLUGIN_DIR . '/foo.php');
     unlink(WPMU_PLUGIN_DIR . '/bar.txt');
     if ($exists) {
         $this->_restore_mu_plugins();
     } else {
         rmdir(WPMU_PLUGIN_DIR);
     }
 }
    /**
     * Generate the debug information content.
     *
     * @since 1.2.0
     *
     * @return string
     */
    private function system_status()
    {
        if (!current_user_can('manage_options')) {
            return '';
        }
        global $wpdb;
        $theme_data = wp_get_theme();
        $theme = $theme_data->Name . ' ' . $theme_data->Version;
        ob_start();
        ?>

		### Begin Custom Post Type UI Debug Info ###

		Multisite:                <?php 
        echo is_multisite() ? 'Yes' . "\n" : 'No' . "\n";
        ?>

		SITE_URL:                 <?php 
        echo site_url() . "\n";
        ?>
		HOME_URL:                 <?php 
        echo home_url() . "\n";
        ?>

		WordPress Version:        <?php 
        echo get_bloginfo('version') . "\n";
        ?>
		Permalink Structure:      <?php 
        echo get_option('permalink_structure') . "\n";
        ?>
		Active Theme:             <?php 
        echo $theme . "\n";
        ?>

		Registered Post Types:    <?php 
        echo implode(', ', get_post_types('', 'names')) . "\n";
        ?>

		PHP Version:              <?php 
        echo PHP_VERSION . "\n";
        ?>
		MySQL Version:            <?php 
        echo $wpdb->db_version() . "\n";
        ?>
		Web Server Info:          <?php 
        echo $_SERVER['SERVER_SOFTWARE'] . "\n";
        ?>

		Show On Front:            <?php 
        echo get_option('show_on_front') . "\n";
        ?>
		Page On Front:            <?php 
        $id = get_option('page_on_front');
        echo get_the_title($id) . ' (#' . $id . ')' . "\n";
        ?>
		Page For Posts:           <?php 
        $id = get_option('page_for_posts');
        echo get_the_title($id) . ' (#' . $id . ')' . "\n";
        ?>

		WordPress Memory Limit:   <?php 
        echo $this->num_convt(WP_MEMORY_LIMIT) / 1024 . 'MB';
        echo "\n";
        ?>

		<?php 
        $plugins = get_plugins();
        $pg_count = count($plugins);
        echo 'TOTAL PLUGINS: ' . $pg_count . "\n\n";
        // MU plugins.
        $mu_plugins = get_mu_plugins();
        if ($mu_plugins) {
            echo "\t\t" . 'MU PLUGINS: (' . count($mu_plugins) . ')' . "\n\n";
            foreach ($mu_plugins as $mu_path => $mu_plugin) {
                echo "\t\t" . $mu_plugin['Name'] . ': ' . $mu_plugin['Version'] . "\n";
            }
        }
        // Standard plugins - active.
        echo "\n";
        $active = get_option('active_plugins', array());
        $ac_count = count($active);
        $ic_count = $pg_count - $ac_count;
        echo "\t\t" . 'ACTIVE PLUGINS: (' . $ac_count . ')' . "\n\n";
        foreach ($plugins as $plugin_path => $plugin) {
            // If the plugin isn't active, don't show it.
            if (!in_array($plugin_path, $active)) {
                continue;
            }
            echo "\t\t" . $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
        }
        // Standard plugins - inactive.
        echo "\n";
        echo "\t\t", 'INACTIVE PLUGINS: (' . $ic_count . ')' . "\n\n";
        foreach ($plugins as $plugin_path => $plugin) {
            // If the plugin isn't active, show it here.
            if (in_array($plugin_path, $active)) {
                continue;
            }
            echo "\t\t" . $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
        }
        // If multisite, grab network as well.
        if (is_multisite()) {
            $net_plugins = wp_get_active_network_plugins();
            $net_active = get_site_option('active_sitewide_plugins', array());
            echo "\n";
            echo 'NETWORK ACTIVE PLUGINS: (' . count($net_plugins) . ')' . "\n\n";
            foreach ($net_plugins as $plugin_path) {
                $plugin_base = plugin_basename($plugin_path);
                // If the plugin isn't active, don't show it.
                if (!array_key_exists($plugin_base, $net_active)) {
                    continue;
                }
                $plugin = get_plugin_data($plugin_path);
                echo $plugin['Name'] . ' :' . $plugin['Version'] . "\n";
            }
        }
        echo "\n";
        $cptui_post_types = cptui_get_post_type_data();
        echo "\t\t" . 'Post Types: ' . "\n";
        echo "\t\t" . esc_html(json_encode($cptui_post_types)) . "\n";
        echo "\n\n";
        $cptui_taxonomies = cptui_get_taxonomy_data();
        echo "\t\t" . 'Taxonomies: ' . "\n";
        echo "\t\t" . esc_html(json_encode($cptui_taxonomies)) . "\n";
        echo "\n";
        if (has_action('cptui_custom_debug_info')) {
            echo "\t\t" . 'EXTRA DEBUG INFO';
        }
        /**
         * Fires at the end of the debug info output.
         *
         * @since 1.3.0
         */
        do_action('cptui_custom_debug_info');
        echo "\n";
        ?>
		### End Debug Info ###
		<?php 
        return ob_get_clean();
    }
Пример #12
0
 protected function get_all_items()
 {
     $items = $this->get_item_list();
     foreach (get_mu_plugins() as $file => $mu_plugin) {
         $mu_version = '';
         if (!empty($mu_plugin['Version'])) {
             $mu_version = $mu_plugin['Version'];
         }
         $items[$file] = array('name' => Utils\get_plugin_name($file), 'status' => 'must-use', 'update' => false, 'update_version' => NULL, 'update_package' => NULL, 'version' => $mu_version, 'update_id' => '', 'title' => '', 'description' => '');
     }
     return $items;
 }
 function prepare_items()
 {
     global $status, $plugins, $totals, $page, $orderby, $order, $s;
     wp_reset_vars(array('orderby', 'order', 's'));
     $plugins = array('all' => apply_filters('all_plugins', get_plugins()), 'search' => array(), 'active' => array(), 'inactive' => array(), 'recently_activated' => array(), 'upgrade' => array(), 'mustuse' => array(), 'dropins' => array());
     $screen = get_current_screen();
     if (!is_multisite() || $screen->is_network && current_user_can('manage_network_plugins')) {
         if (apply_filters('show_advanced_plugins', true, 'mustuse')) {
             $plugins['mustuse'] = get_mu_plugins();
         }
         if (apply_filters('show_advanced_plugins', true, 'dropins')) {
             $plugins['dropins'] = get_dropins();
         }
         $current = get_site_transient('update_plugins');
         foreach ((array) $plugins['all'] as $plugin_file => $plugin_data) {
             if (isset($current->response[$plugin_file])) {
                 $plugins['upgrade'][$plugin_file] = $plugin_data;
             }
         }
     }
     set_transient('plugin_slugs', array_keys($plugins['all']), 86400);
     $recently_activated = get_option('recently_activated', array());
     $one_week = 7 * 24 * 60 * 60;
     foreach ($recently_activated as $key => $time) {
         if ($time + $one_week < time()) {
             unset($recently_activated[$key]);
         }
     }
     update_option('recently_activated', $recently_activated);
     foreach ((array) $plugins['all'] as $plugin_file => $plugin_data) {
         // Filter into individual sections
         if (is_multisite() && is_network_only_plugin($plugin_file) && !$screen->is_network) {
             unset($plugins['all'][$plugin_file]);
         } elseif (is_plugin_active_for_network($plugin_file) && !$screen->is_network) {
             unset($plugins['all'][$plugin_file]);
         } elseif (is_multisite() && is_network_only_plugin($plugin_file) && !current_user_can('manage_network_plugins')) {
             $plugins['network'][$plugin_file] = $plugin_data;
         } elseif (!$screen->is_network && is_plugin_active($plugin_file) || $screen->is_network && is_plugin_active_for_network($plugin_file)) {
             $plugins['active'][$plugin_file] = $plugin_data;
         } else {
             if (!$screen->is_network && isset($recently_activated[$plugin_file])) {
                 // Was the plugin recently activated?
                 $plugins['recently_activated'][$plugin_file] = $plugin_data;
             }
             $plugins['inactive'][$plugin_file] = $plugin_data;
         }
     }
     if (!current_user_can('update_plugins')) {
         $plugins['upgrade'] = array();
     }
     if ($s) {
         $status = 'search';
         $plugins['search'] = array_filter($plugins['all'], array(&$this, '_search_callback'));
     }
     $totals = array();
     foreach ($plugins as $type => $list) {
         $totals[$type] = count($list);
     }
     if (empty($plugins[$status]) && !in_array($status, array('all', 'search'))) {
         $status = 'all';
     }
     $this->items = array();
     foreach ($plugins[$status] as $plugin_file => $plugin_data) {
         // Translate, Don't Apply Markup, Sanitize HTML
         $this->items[$plugin_file] = _get_plugin_data_markup_translate($plugin_file, $plugin_data, false, true);
     }
     $total_this_page = $totals[$status];
     if ($orderby) {
         $orderby = ucfirst($orderby);
         $order = strtoupper($order);
         uasort($this->items, array(&$this, '_order_callback'));
     }
     $plugins_per_page = $this->get_items_per_page(str_replace('-', '_', $screen->id . '_per_page'));
     $start = ($page - 1) * $plugins_per_page;
     if ($total_this_page > $plugins_per_page) {
         $this->items = array_slice($this->items, $start, $plugins_per_page);
     }
     $this->set_pagination_args(array('total_items' => $total_this_page, 'per_page' => $plugins_per_page));
 }
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

<?php 
?>
</th>
				<th><?php 
esc_html_e('Description', 'it-l10n-backupbuddy');
?>
</th>
				<th><?php 
esc_html_e('Plugin Type', 'it-l10n-backupbuddy');
?>
</th>
			</tr>
		</tfoot>
		<tbody id="pb_reorder">
			<?php 
//Get MU Plugins
foreach (get_mu_plugins() as $file => $meta) {
    $description = !empty($meta['Description']) ? $meta['Description'] : '';
    $name = !empty($meta['Name']) ? $meta['Name'] : $file;
    ?>
			<tr>
				<th scope="row" class="check-column"><input type="checkbox" name="items[mu][]" class="entries" value="<?php 
    echo esc_attr($file);
    ?>
" /></th>
				<td><?php 
    echo esc_html($name);
    ?>
</td>
				<td><?php 
    echo esc_html($description);
    ?>
Пример #16
0
 public function getMustUsePlugins()
 {
     if (!function_exists('get_mu_plugins')) {
         require_once $this->getConstant('ABSPATH') . 'wp-admin/includes/plugin.php';
     }
     return get_mu_plugins();
 }
Пример #17
0
		<!-- First callout cell -->
		<td class="p3-callout">
			<div class="p3-callout-outer-wrapper qtip-tip total-plugins-tip" title="<?php 
esc_attr_e('Total number of active plugins, including must-use plugins, on your site.', 'p3-profiler');
?>
">
				<div class="p3-callout-inner-wrapper">
					<div class="p3-callout-caption total-plugins-caption"><?php 
_e('Total Plugins:', 'p3-profiler');
?>
</div>
					<div class="p3-callout-data total-plugins-data">
						<?php 
// Get the total number of plugins
$active_plugins = count(get_mu_plugins());
foreach (get_plugins() as $plugin => $junk) {
    if (is_plugin_active($plugin)) {
        $active_plugins++;
    }
}
echo $active_plugins;
?>
					</div>
					<div class="p3-callout-caption total-plugins-info">(<?php 
_e('currently active', 'p3-profiler');
?>
)</div>
				</div>
			</div>
		</td>
Пример #18
0
/**
 * 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
    if (get_bloginfo('version') < '3.4') {
        $theme_data = get_theme_data(get_stylesheet_directory() . '/style.css');
        $theme = $theme_data['Name'] . ' ' . $theme_data['Version'];
    } else {
        $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";
    }
    // 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);
    }
    // Must-use plugins
    $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;
        }
        $return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\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;
        }
        $return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\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;
            }
            $plugin = get_plugin_data($plugin_path);
            $return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\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;
}
Пример #19
0
 public function get_plugin_settings()
 {
     return array('active_plugins' => $this->get_active_plugins(), 'mu_plugins' => wp_list_pluck(get_mu_plugins(), 'Name'));
 }
 function get_plugins()
 {
     $active_plugins = wp_get_active_and_valid_plugins();
     $mu_plugins = get_mu_plugins();
     $output = array();
     if (is_array($active_plugins)) {
         foreach ($active_plugins as $plugins_key => $plugin) {
             $data = get_plugin_data($plugin, false, false);
             $slug = explode('/', plugin_basename($plugin));
             $slug = str_replace('.php', '', $slug[1]);
             $output[$slug] = $data['Version'];
         }
     }
     if (is_array($mu_plugins)) {
         foreach ($mu_plugins as $plugins_key => $plugin) {
             $slug = str_replace('.php', '', $plugins_key);
             $output[$slug] = '1.0.0';
         }
     }
     return $output;
 }
Пример #21
0
/**
* This function gets the content that is in the system info
* 
* @return return $qmn_sys_info This variable contains all of the system info from the admins server. 
* @since 4.4.0
*/
function qmn_get_system_info()
{
    global $wpdb;
    $qmn_sys_info = "";
    $theme_data = wp_get_theme();
    $theme = $theme_data->Name . ' ' . $theme_data->Version;
    $qmn_sys_info .= "<h3>Site Information</h3><br />";
    $qmn_sys_info .= "Site URL: " . site_url() . "<br />";
    $qmn_sys_info .= "Home URL: " . home_url() . "<br />";
    $qmn_sys_info .= "Multisite: " . (is_multisite() ? 'Yes' : 'No') . "<br />";
    $qmn_sys_info .= "<h3>WordPress Information</h3><br />";
    $qmn_sys_info .= "Version: " . get_bloginfo('version') . "<br />";
    $qmn_sys_info .= "Language: " . (defined('WPLANG') && WPLANG ? WPLANG : 'en_US') . "<br />";
    $qmn_sys_info .= "Active Theme: " . $theme . "<br />";
    $qmn_sys_info .= "Debug Mode: " . (defined('WP_DEBUG') ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set') . "<br />";
    $qmn_sys_info .= "Memory Limit: " . WP_MEMORY_LIMIT . "<br />";
    $qmn_sys_info .= "<h3>Plugins Information</h3><br />";
    $qmn_plugin_mu = get_mu_plugins();
    if (count($qmn_plugin_mu > 0)) {
        $qmn_sys_info .= "<h4>Must Use</h4><br />";
        foreach ($qmn_plugin_mu as $plugin => $plugin_data) {
            $qmn_sys_info .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "<br />";
        }
    }
    $qmn_sys_info .= "<h4>Active</h4><br />";
    $plugins = get_plugins();
    $active_plugins = get_option('active_plugins', array());
    foreach ($plugins as $plugin_path => $plugin) {
        if (!in_array($plugin_path, $active_plugins)) {
            continue;
        }
        $qmn_sys_info .= $plugin['Name'] . ': ' . $plugin['Version'] . "<br />";
    }
    $qmn_sys_info .= "<h4>Inactive</h4><br />";
    foreach ($plugins as $plugin_path => $plugin) {
        if (in_array($plugin_path, $active_plugins)) {
            continue;
        }
        $qmn_sys_info .= $plugin['Name'] . ': ' . $plugin['Version'] . "<br />";
    }
    $qmn_sys_info .= "<h3>Server Information</h3><br />";
    $qmn_sys_info .= "PHP : " . PHP_VERSION . "<br />";
    $qmn_sys_info .= "MySQL : " . $wpdb->db_version() . "<br />";
    $qmn_sys_info .= "Webserver : " . $_SERVER['SERVER_SOFTWARE'] . "<br />";
    $mlw_stat_total_quiz = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_quizzes LIMIT 1");
    $mlw_stat_total_active_quiz = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_quizzes WHERE deleted=0 LIMIT 1");
    $mlw_stat_total_questions = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_questions LIMIT 1");
    $mlw_stat_total_active_questions = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_questions WHERE deleted=0 LIMIT 1");
    $qmn_sys_info .= "<h3>QMN Information</h3><br />";
    $qmn_sys_info .= "Total Quizzes : " . $mlw_stat_total_quiz . "<br />";
    $qmn_sys_info .= "Total Active Quizzes : " . $mlw_stat_total_active_quiz . "<br />";
    $qmn_sys_info .= "Total Questions : " . $mlw_stat_total_questions . "<br />";
    $qmn_sys_info .= "Total Active Questions : " . $mlw_stat_total_active_questions . "<br />";
    return $qmn_sys_info;
}
Пример #22
0
?>
</h2>

<?php 
$all_plugins = apply_filters('all_plugins', get_plugins());
$search_plugins = array();
$active_plugins = array();
$inactive_plugins = array();
$recent_plugins = array();
$recently_activated = get_option('recently_activated', array());
$upgrade_plugins = array();
$network_plugins = array();
$mustuse_plugins = $dropins_plugins = array();
if (!is_multisite() || current_user_can('manage_network_plugins')) {
    if (apply_filters('show_advanced_plugins', true, 'mustuse')) {
        $mustuse_plugins = get_mu_plugins();
    }
    if (apply_filters('show_advanced_plugins', true, 'dropins')) {
        $dropins_plugins = get_dropins();
    }
}
set_transient('plugin_slugs', array_keys($all_plugins), 86400);
// Clean out any plugins which were deactivated over a week ago.
foreach ($recently_activated as $key => $time) {
    if ($time + 7 * 24 * 60 * 60 < time()) {
        //1 week
        unset($recently_activated[$key]);
    }
}
if ($recently_activated != get_option('recently_activated')) {
    //If array changed, update it.
Пример #23
0
 /**
  * Collect system information for support
  *
  * @return array of system data for support
  */
 public function getSupportStats()
 {
     $user = wp_get_current_user();
     $plugins = array();
     if (function_exists('get_plugin_data')) {
         $plugins_raw = wp_get_active_and_valid_plugins();
         foreach ($plugins_raw as $k => $v) {
             $plugin_details = get_plugin_data($v);
             $plugin = $plugin_details['Name'];
             if (!empty($plugin_details['Version'])) {
                 $plugin .= sprintf(' version %s', $plugin_details['Version']);
             }
             if (!empty($plugin_details['Author'])) {
                 $plugin .= sprintf(' by %s', $plugin_details['Author']);
             }
             if (!empty($plugin_details['AuthorURI'])) {
                 $plugin .= sprintf('(%s)', $plugin_details['AuthorURI']);
             }
             $plugins[] = $plugin;
         }
     }
     $network_plugins = array();
     if (is_multisite() && function_exists('get_plugin_data')) {
         $plugins_raw = wp_get_active_network_plugins();
         foreach ($plugins_raw as $k => $v) {
             $plugin_details = get_plugin_data($v);
             $plugin = $plugin_details['Name'];
             if (!empty($plugin_details['Version'])) {
                 $plugin .= sprintf(' version %s', $plugin_details['Version']);
             }
             if (!empty($plugin_details['Author'])) {
                 $plugin .= sprintf(' by %s', $plugin_details['Author']);
             }
             if (!empty($plugin_details['AuthorURI'])) {
                 $plugin .= sprintf('(%s)', $plugin_details['AuthorURI']);
             }
             $network_plugins[] = $plugin;
         }
     }
     $mu_plugins = array();
     if (function_exists('get_mu_plugins')) {
         $mu_plugins_raw = get_mu_plugins();
         foreach ($mu_plugins_raw as $k => $v) {
             $plugin = $v['Name'];
             if (!empty($v['Version'])) {
                 $plugin .= sprintf(' version %s', $v['Version']);
             }
             if (!empty($v['Author'])) {
                 $plugin .= sprintf(' by %s', $v['Author']);
             }
             if (!empty($v['AuthorURI'])) {
                 $plugin .= sprintf('(%s)', $v['AuthorURI']);
             }
             $mu_plugins[] = $plugin;
         }
     }
     $keys = apply_filters('tribe-pue-install-keys', array());
     $systeminfo = array('url' => 'http://' . $_SERVER['HTTP_HOST'], 'name' => $user->display_name, 'email' => $user->user_email, 'install keys' => $keys, 'WordPress version' => get_bloginfo('version'), 'PHP version' => phpversion(), 'plugins' => $plugins, 'network plugins' => $network_plugins, 'mu plugins' => $mu_plugins, 'theme' => wp_get_theme()->get('Name'), 'multisite' => is_multisite(), 'settings' => Tribe__Events__Main::getOptions(), 'WordPress timezone' => get_option('timezone_string', __('Unknown or not set', 'the-events-calendar')), 'server timezone' => date_default_timezone_get());
     if ($this->rewrite_rules_purged) {
         $systeminfo['rewrite rules purged'] = __('Rewrite rules were purged on load of this help page. Chances are there is a rewrite rule flush occurring in a plugin or theme!', 'the-events-calendar');
     }
     $systeminfo = apply_filters('tribe-events-pro-support', $systeminfo);
     return $systeminfo;
 }
Пример #24
0
 public function create_zip($create_from_dir, $whichone, $backup_file_basename, $index, $first_linked_index = false)
 {
     // Note: $create_from_dir can be an array or a string
     @set_time_limit(UPDRAFTPLUS_SET_TIME_LIMIT);
     $original_index = $index;
     $this->index = $index;
     $this->first_linked_index = false === $first_linked_index ? 0 : $first_linked_index;
     $this->whichone = $whichone;
     global $updraftplus;
     $this->zip_split_every = max((int) $updraftplus->jobdata_get('split_every'), UPDRAFTPLUS_SPLIT_MIN) * 1048576;
     if ('others' != $whichone) {
         $updraftplus->log("Beginning creation of dump of {$whichone} (split every: " . round($this->zip_split_every / 1048576, 1) . " MB)");
     }
     if (is_string($create_from_dir) && !file_exists($create_from_dir)) {
         $flag_error = true;
         $updraftplus->log("Does not exist: {$create_from_dir}");
         if ('mu-plugins' == $whichone) {
             if (!function_exists('get_mu_plugins')) {
                 require_once ABSPATH . 'wp-admin/includes/plugin.php';
             }
             $mu_plugins = get_mu_plugins();
             if (count($mu_plugins) == 0) {
                 $updraftplus->log("There appear to be no mu-plugins to back up. Will not raise an error.");
                 $flag_error = false;
             }
         }
         if ($flag_error) {
             $updraftplus->log(sprintf(__("%s - could not back this entity up; the corresponding directory does not exist (%s)", 'updraftplus'), $whichone, $create_from_dir), 'error');
         }
         return false;
     }
     $itext = empty($index) ? '' : $index + 1;
     $base_path = $backup_file_basename . '-' . $whichone . $itext . '.zip';
     $full_path = $this->updraft_dir . '/' . $base_path;
     $time_now = time();
     # This is compatible with filenames which indicate increments, as it is looking only for the current increment
     if (file_exists($full_path)) {
         # Gather any further files that may also exist
         $files_existing = array();
         while (file_exists($full_path)) {
             $files_existing[] = $base_path;
             $time_mod = (int) @filemtime($full_path);
             $updraftplus->log($base_path . ": this file has already been created (age: " . round($time_now - $time_mod, 1) . " s)");
             if ($time_mod > 100 && $time_now - $time_mod < 30) {
                 $updraftplus->terminate_due_to_activity($base_path, $time_now, $time_mod);
             }
             $index++;
             # This is compatible with filenames which indicate increments, as it is looking only for the current increment
             $base_path = $backup_file_basename . '-' . $whichone . ($index + 1) . '.zip';
             $full_path = $this->updraft_dir . '/' . $base_path;
         }
     }
     // Temporary file, to be able to detect actual completion (upon which, it is renamed)
     // New (Jun-13) - be more aggressive in removing temporary files from earlier attempts - anything >=600 seconds old of this kind
     $updraftplus->clean_temporary_files('_' . $updraftplus->nonce . "-{$whichone}", 600);
     // Firstly, make sure that the temporary file is not already being written to - which can happen if a resumption takes place whilst an old run is still active
     $zip_name = $full_path . '.tmp';
     $time_mod = (int) @filemtime($zip_name);
     if (file_exists($zip_name) && $time_mod > 100 && $time_now - $time_mod < 30) {
         $updraftplus->terminate_due_to_activity($zip_name, $time_now, $time_mod);
     }
     if (file_exists($zip_name)) {
         $updraftplus->log("File exists ({$zip_name}), but was apparently not modified within the last 30 seconds, so we assume that any previous run has now terminated (time_mod={$time_mod}, time_now={$time_now}, diff=" . ($time_now - $time_mod) . ")");
     }
     // Now, check for other forms of temporary file, which would indicate that some activity is going on (even if it hasn't made it into the main zip file yet)
     // Note: this doesn't catch PclZip temporary files
     $d = dir($this->updraft_dir);
     $match = '_' . $updraftplus->nonce . "-" . $whichone;
     while (false !== ($e = $d->read())) {
         if ('.' == $e || '..' == $e || !is_file($this->updraft_dir . '/' . $e)) {
             continue;
         }
         $ziparchive_match = preg_match("/{$match}([0-9]+)?\\.zip\\.tmp\\.([A-Za-z0-9]){6}?\$/i", $e);
         $binzip_match = preg_match("/^zi([A-Za-z0-9]){6}\$/", $e);
         $pclzip_match = preg_match("/^pclzip-[a-z0-9]+.tmp\$/", $e);
         if ($time_now - filemtime($this->updraft_dir . '/' . $e) < 30 && ($ziparchive_match || 0 != $updraftplus->current_resumption && ($binzip_match || $pclzip_match))) {
             $updraftplus->terminate_due_to_activity($this->updraft_dir . '/' . $e, $time_now, filemtime($this->updraft_dir . '/' . $e));
         }
     }
     @$d->close();
     clearstatcache();
     if (isset($files_existing)) {
         # Because of zip-splitting, the mere fact that files exist is not enough to indicate that the entity is finished. For that, we need to also see that no subsequent file has been started.
         # Q. What if the previous runner died in between zips, and it is our job to start the next one? A. The next temporary file is created before finishing the former zip, so we are safe (and we are also safe-guarded by the updated value of the index being stored in the database).
         return $files_existing;
     }
     $this->log_account_space();
     $this->zip_microtime_start = microtime(true);
     # The paths in the zip should then begin with '$whichone', having removed WP_CONTENT_DIR from the front
     $zipcode = $this->make_zipfile($create_from_dir, $backup_file_basename, $whichone);
     if ($zipcode !== true) {
         $updraftplus->log("ERROR: Zip failure: Could not create {$whichone} zip (" . $this->index . " / {$index})");
         $updraftplus->log(sprintf(__("Could not create %s zip. Consult the log file for more information.", 'updraftplus'), $whichone), 'error');
         # The caller is required to update $index from $this->index
         return false;
     } else {
         $itext = empty($this->index) ? '' : $this->index + 1;
         $full_path = $this->updraft_dir . '/' . $backup_file_basename . '-' . $whichone . $itext . '.zip';
         if (file_exists($full_path . '.tmp')) {
             if (@filesize($full_path . '.tmp') === 0) {
                 $updraftplus->log("Did not create {$whichone} zip (" . $this->index . ") - not needed");
                 @unlink($full_path . '.tmp');
             } else {
                 $sha = sha1_file($full_path . '.tmp');
                 $updraftplus->jobdata_set('sha1-' . $whichone . $this->index, $sha);
                 @rename($full_path . '.tmp', $full_path);
                 $timetaken = max(microtime(true) - $this->zip_microtime_start, 1.0E-6);
                 $kbsize = filesize($full_path) / 1024;
                 $rate = round($kbsize / $timetaken, 1);
                 $updraftplus->log("Created {$whichone} zip (" . $this->index . ") - " . round($kbsize, 1) . " KB in " . round($timetaken, 1) . " s ({$rate} KB/s) (SHA1 checksum: {$sha})");
                 // We can now remove any left-over temporary files from this job
             }
         } elseif ($this->index > $original_index) {
             $updraftplus->log("Did not create {$whichone} zip (" . $this->index . ") - not needed (2)");
             # Added 12-Feb-2014 (to help multiple morefiles)
             $this->index--;
         } else {
             $updraftplus->log("Looked-for {$whichone} zip (" . $this->index . ") was not found (" . basename($full_path) . ".tmp)", 'warning');
         }
         $updraftplus->clean_temporary_files('_' . $updraftplus->nonce . "-{$whichone}", 0);
     }
     // Remove cache list files as well, if there are any
     $updraftplus->clean_temporary_files('_' . $updraftplus->nonce . "-{$whichone}", 0, true);
     # Create the results array to send back (just the new ones, not any prior ones)
     $files_existing = array();
     $res_index = 0;
     for ($i = $original_index; $i <= $this->index; $i++) {
         $itext = empty($i) ? '' : $i + 1;
         $full_path = $this->updraft_dir . '/' . $backup_file_basename . '-' . $whichone . $itext . '.zip';
         if (file_exists($full_path)) {
             $files_existing[$res_index] = $backup_file_basename . '-' . $whichone . $itext . '.zip';
         }
         $res_index++;
     }
     return $files_existing;
 }
Пример #25
0
/**
 * Get system info
 *
 * @since       1.0
 * @access      public
 * @global      object $wpdb        Used to query the database using the WordPress Database API
 * @global      array  $gmb_options Array of all Maps Builder options
 * @return      string $return A string containing the info to output
 */
function gmb_tools_sysinfo_get()
{
    global $wpdb, $gmb_options;
    if (!class_exists('Browser')) {
        require_once GMB_PLUGIN_PATH . 'includes/libraries/browser.php';
    }
    $browser = new Browser();
    // Get theme info
    if (get_bloginfo('version') < '3.4') {
        $theme_data = get_theme_data(get_stylesheet_directory() . '/style.css');
        $theme = $theme_data['Name'] . ' ' . $theme_data['Version'];
    } else {
        $theme_data = wp_get_theme();
        $theme = $theme_data->Name . ' ' . $theme_data->Version;
    }
    // Try to identify the hosting provider
    $host = gmb_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('gmb_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('gmb_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('gmb_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";
    }
    // Make sure wp_remote_post() is working
    $request['cmd'] = '_notify-validate';
    $params = array('sslverify' => false, 'timeout' => 60, 'user-agent' => 'Maps Builder/' . GMB_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";
    $return .= 'Admin AJAX:               ' . (gmb_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('gmb_sysinfo_after_wordpress_config', $return);
    // GMB configuration
    $return .= "\n" . '-- Maps Builder Configuration' . "\n\n";
    $return .= 'Version:                  ' . GMB_VERSION . "\n";
    $return .= 'Upgraded From:            ' . get_option('gmb_version_upgraded_from', 'None') . "\n";
    $return = apply_filters('gmb_sysinfo_after_gmb_config', $return);
    // Must-use plugins
    $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('gmb_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;
        }
        $return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
    }
    $return = apply_filters('gmb_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;
        }
        $return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
    }
    $return = apply_filters('gmb_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;
            }
            $plugin = get_plugin_data($plugin_path);
            $return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
        }
        $return = apply_filters('gmb_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('gmb_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('gmb_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('gmb_sysinfo_after_php_ext', $return);
    // 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('gmb_sysinfo_after_session_config', $return);
    $return .= "\n" . '### End System Info ###';
    return $return;
}
 /**
  * Collect system information for support
  *
  * @return array of system data for support
  * @author Peter Chester
  */
 public static function getSupportStats()
 {
     $user = wp_get_current_user();
     $plugins = array();
     if (function_exists('get_plugin_data')) {
         $plugins_raw = wp_get_active_and_valid_plugins();
         foreach ($plugins_raw as $k => $v) {
             $plugin_details = get_plugin_data($v);
             $plugin = $plugin_details['Name'];
             if (!empty($plugin_details['Version'])) {
                 $plugin .= sprintf(' version %s', $plugin_details['Version']);
             }
             if (!empty($plugin_details['Author'])) {
                 $plugin .= sprintf(' by %s', $plugin_details['Author']);
             }
             if (!empty($plugin_details['AuthorURI'])) {
                 $plugin .= sprintf('(%s)', $plugin_details['AuthorURI']);
             }
             $plugins[] = $plugin;
         }
     }
     $network_plugins = array();
     if (is_multisite() && function_exists('get_plugin_data')) {
         $plugins_raw = wp_get_active_network_plugins();
         foreach ($plugins_raw as $k => $v) {
             $plugin_details = get_plugin_data($v);
             $plugin = $plugin_details['Name'];
             if (!empty($plugin_details['Version'])) {
                 $plugin .= sprintf(' version %s', $plugin_details['Version']);
             }
             if (!empty($plugin_details['Author'])) {
                 $plugin .= sprintf(' by %s', $plugin_details['Author']);
             }
             if (!empty($plugin_details['AuthorURI'])) {
                 $plugin .= sprintf('(%s)', $plugin_details['AuthorURI']);
             }
             $network_plugins[] = $plugin;
         }
     }
     $mu_plugins = array();
     if (function_exists('get_mu_plugins')) {
         $mu_plugins_raw = get_mu_plugins();
         foreach ($mu_plugins_raw as $k => $v) {
             $plugin = $v['Name'];
             if (!empty($v['Version'])) {
                 $plugin .= sprintf(' version %s', $v['Version']);
             }
             if (!empty($v['Author'])) {
                 $plugin .= sprintf(' by %s', $v['Author']);
             }
             if (!empty($v['AuthorURI'])) {
                 $plugin .= sprintf('(%s)', $v['AuthorURI']);
             }
             $mu_plugins[] = $plugin;
         }
     }
     $keys = apply_filters('tribe-pue-install-keys', array());
     $systeminfo = array('url' => 'http://' . $_SERVER["HTTP_HOST"], 'name' => $user->display_name, 'email' => $user->user_email, 'install keys' => $keys, 'WordPress version' => get_bloginfo('version'), 'PHP version' => phpversion(), 'plugins' => $plugins, 'network plugins' => $network_plugins, 'mu plugins' => $mu_plugins, 'theme' => wp_get_theme()->get('Name'), 'multisite' => is_multisite(), 'settings' => TribeEvents::getOptions());
     $systeminfo = apply_filters('tribe-events-pro-support', $systeminfo);
     return $systeminfo;
 }
 public function prepare_items()
 {
     global $status, $plugins, $totals, $page, $orderby, $order, $s;
     wp_reset_vars(array('orderby', 'order', 's'));
     /**
      * Filter the full array of plugins to list in the Plugins list table.
      *
      * @since 3.0.0
      *
      * @see get_plugins()
      *
      * @param array $plugins An array of plugins to display in the list table.
      */
     $plugins = array('all' => apply_filters('all_plugins', get_plugins()), 'search' => array(), 'active' => array(), 'inactive' => array(), 'recently_activated' => array(), 'upgrade' => array(), 'mustuse' => array(), 'dropins' => array());
     $screen = $this->screen;
     if (!is_multisite() || $screen->in_admin('network') && current_user_can('manage_network_plugins')) {
         /**
          * Filter whether to display the advanced plugins list table.
          *
          * There are two types of advanced plugins - must-use and drop-ins -
          * which can be used in a single site or Multisite network.
          *
          * The $type parameter allows you to differentiate between the type of advanced
          * plugins to filter the display of. Contexts include 'mustuse' and 'dropins'.
          *
          * @since 3.0.0
          *
          * @param bool   $show Whether to show the advanced plugins for the specified
          *                     plugin type. Default true.
          * @param string $type The plugin type. Accepts 'mustuse', 'dropins'.
          */
         if (apply_filters('show_advanced_plugins', true, 'mustuse')) {
             $plugins['mustuse'] = get_mu_plugins();
         }
         /** This action is documented in wp-admin/includes/class-wp-plugins-list-table.php */
         if (apply_filters('show_advanced_plugins', true, 'dropins')) {
             $plugins['dropins'] = get_dropins();
         }
         if (current_user_can('update_plugins')) {
             $current = get_site_transient('update_plugins');
             foreach ((array) $plugins['all'] as $plugin_file => $plugin_data) {
                 if (isset($current->response[$plugin_file])) {
                     $plugins['all'][$plugin_file]['update'] = true;
                     $plugins['upgrade'][$plugin_file] = $plugins['all'][$plugin_file];
                 }
             }
         }
     }
     set_transient('plugin_slugs', array_keys($plugins['all']), DAY_IN_SECONDS);
     if (!$screen->in_admin('network')) {
         $recently_activated = get_option('recently_activated', array());
         foreach ($recently_activated as $key => $time) {
             if ($time + WEEK_IN_SECONDS < time()) {
                 unset($recently_activated[$key]);
             }
         }
         update_option('recently_activated', $recently_activated);
     }
     $plugin_info = get_site_transient('update_plugins');
     foreach ((array) $plugins['all'] as $plugin_file => $plugin_data) {
         // Extra info if known. array_merge() ensures $plugin_data has precedence if keys collide.
         if (isset($plugin_info->response[$plugin_file])) {
             $plugins['all'][$plugin_file] = $plugin_data = array_merge((array) $plugin_info->response[$plugin_file], $plugin_data);
         } elseif (isset($plugin_info->no_update[$plugin_file])) {
             $plugins['all'][$plugin_file] = $plugin_data = array_merge((array) $plugin_info->no_update[$plugin_file], $plugin_data);
         }
         // Filter into individual sections
         if (is_multisite() && !$screen->in_admin('network') && is_network_only_plugin($plugin_file) && !is_plugin_active($plugin_file)) {
             // On the non-network screen, filter out network-only plugins as long as they're not individually activated
             unset($plugins['all'][$plugin_file]);
         } elseif (!$screen->in_admin('network') && is_plugin_active_for_network($plugin_file)) {
             // On the non-network screen, filter out network activated plugins
             unset($plugins['all'][$plugin_file]);
         } elseif (!$screen->in_admin('network') && is_plugin_active($plugin_file) || $screen->in_admin('network') && is_plugin_active_for_network($plugin_file)) {
             // On the non-network screen, populate the active list with plugins that are individually activated
             // On the network-admin screen, populate the active list with plugins that are network activated
             $plugins['active'][$plugin_file] = $plugin_data;
         } else {
             if (!$screen->in_admin('network') && isset($recently_activated[$plugin_file])) {
                 // On the non-network screen, populate the recently activated list with plugins that have been recently activated
                 $plugins['recently_activated'][$plugin_file] = $plugin_data;
             }
             // Populate the inactive list with plugins that aren't activated
             $plugins['inactive'][$plugin_file] = $plugin_data;
         }
     }
     if ($s) {
         $status = 'search';
         $plugins['search'] = array_filter($plugins['all'], array($this, '_search_callback'));
     }
     $totals = array();
     foreach ($plugins as $type => $list) {
         $totals[$type] = count($list);
     }
     if (empty($plugins[$status]) && !in_array($status, array('all', 'search'))) {
         $status = 'all';
     }
     $this->items = array();
     foreach ($plugins[$status] as $plugin_file => $plugin_data) {
         // Translate, Don't Apply Markup, Sanitize HTML
         $this->items[$plugin_file] = _get_plugin_data_markup_translate($plugin_file, $plugin_data, false, true);
     }
     $total_this_page = $totals[$status];
     if ($orderby) {
         $orderby = ucfirst($orderby);
         $order = strtoupper($order);
         uasort($this->items, array($this, '_order_callback'));
     }
     $plugins_per_page = $this->get_items_per_page(str_replace('-', '_', $screen->id . '_per_page'), 999);
     $start = ($page - 1) * $plugins_per_page;
     if ($total_this_page > $plugins_per_page) {
         $this->items = array_slice($this->items, $start, $plugins_per_page);
     }
     $this->set_pagination_args(array('total_items' => $total_this_page, 'per_page' => $plugins_per_page));
 }
Пример #28
0
 function get_plugins()
 {
     if (false === ($result = get_transient('sk_' . SK_CACHE_PREFIX . '_get_plugins'))) {
         $active_plugins = wp_get_active_and_valid_plugins();
         $mu_plugins = get_mu_plugins();
         $result = array();
         if (is_array($active_plugins)) {
             foreach ($active_plugins as $plugins_key => $plugin) {
                 $data = get_plugin_data($plugin, false, false);
                 $slug = explode('/', plugin_basename($plugin));
                 $slug = str_replace('.php', '', $slug[1]);
                 if ($data['Version']) {
                     $result[$slug] = $data['Version'];
                 } else {
                     $result[$slug] = '1.0.0';
                 }
             }
         }
         if (is_array($mu_plugins)) {
             foreach ($mu_plugins as $plugins_key => $plugin) {
                 $data = get_plugin_data(WPMU_PLUGIN_DIR . '/' . $plugins_key, false, false);
                 $slug = explode('/', plugin_basename($plugins_key));
                 $slug = str_replace('.php', '', $slug[0]);
                 if ($data['Version']) {
                     $result[$slug] = $data['Version'];
                 } else {
                     $result[$slug] = '1.0.0';
                 }
             }
         }
         if (is_multisite()) {
             $plugins = get_site_option('active_sitewide_plugins');
             foreach ($plugins as $plugins_key => $plugin) {
                 $data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugins_key, false, false);
                 $slug = explode('/', plugin_basename($plugins_key));
                 $slug = str_replace('.php', '', $slug[1]);
                 if ($data['Version']) {
                     $result[$slug] = $data['Version'];
                 } else {
                     $result[$slug] = '1.0.0';
                 }
             }
         }
         set_transient('sk_' . SK_CACHE_PREFIX . '_get_plugins', $result, $this->cache_time);
     }
     return $result;
 }
<?php

$diagnostic = new wfDiagnostic();
$plugins = get_plugins();
$activePlugins = array_flip(get_option('active_plugins'));
$activeNetworkPlugins = is_multisite() ? array_flip(wp_get_active_network_plugins()) : array();
$muPlugins = get_mu_plugins();
$themes = wp_get_themes();
$currentTheme = wp_get_theme();
$cols = 3;
$w = new wfConfig();
?>

<div class="wrap wordfence">
	<?php 
require 'menuHeader.php';
?>
	<h2 id="wfHeading">
		Diagnostics
	</h2>
	<br clear="both"/>
	
	<?php 
$rightRail = new wfView('marketing/rightrail', array('additionalClasses' => 'wordfenceRightRailDiagnostics'));
echo $rightRail;
?>

	<form id="wfConfigForm">
		<table class="wf-table"<?php 
echo !empty($inEmail) ? ' border=1' : '';
?>
Пример #30
0
 /**
  * Get system information.
  *
  * Based on a function from Easy Digital Downloads by Pippin Williamson
  *
  * @link https://github.com/easydigitaldownloads/easy-digital-downloads/blob/master/includes/admin/tools.php#L470
  * @since 1.2.3
  * @return string
  */
 public function get_system_info()
 {
     global $wpdb;
     // Get theme info
     $theme_data = wp_get_theme();
     $theme = $theme_data->Name . ' ' . $theme_data->Version;
     $return = '### Begin System Info ###' . "\n\n";
     // WPForms info
     $activated = get_option('wpforms_activated', array());
     $return .= '-- WPForms Info' . "\n\n";
     if (!empty($activated['pro'])) {
         $date = $activated['pro'] + get_option('gmt_offset') * 3600;
         $return .= 'Pro:                      ' . date_i18n(__('M j, Y @ g:ia'), $date) . "\n";
     }
     if (!empty($activated['lite'])) {
         $date = $activated['lite'] + get_option('gmt_offset') * 3600;
         $return .= 'Lite:                     ' . date_i18n(__('M j, Y @ g:ia'), $date) . "\n";
     }
     // Now 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";
     // Make sure wp_remote_post() is working
     /*
     $request['cmd'] = '_notify-validate';
     $params = array(
     	'sslverify'     => false,
     	'timeout'       => 60,
     	'user-agent'    => 'WPForms/' . WPFORMS_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";
     $return .= 'WP_DEBUG:                 ' . (defined('WP_DEBUG') ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set') . "\n";
     $return .= 'WPFORMS_DEBUG:            ' . (defined('WPFORMS_DEBUG') ? WPFORMS_DEBUG ? 'Enabled' : 'Disabled' : 'Not set') . "\n";
     $return .= 'Memory Limit:             ' . WP_MEMORY_LIMIT . "\n";
     $return .= 'Registered Post Stati:    ' . implode(', ', get_post_stati()) . "\n";
     // @todo WPForms configuration/specific details
     $return .= "\n" . '-- WordPress Uploads/Constants' . "\n\n";
     $return .= 'WP_CONTENT_DIR:           ' . (defined('WP_CONTENT_DIR') ? WP_CONTENT_DIR ? WP_CONTENT_DIR : 'Disabled' : 'Not set') . "\n";
     $return .= 'WP_CONTENT_URL:           ' . (defined('WP_CONTENT_URL') ? WP_CONTENT_URL ? WP_CONTENT_URL : 'Disabled' : 'Not set') . "\n";
     $return .= 'UPLOADS:                  ' . (defined('UPLOADS') ? UPLOADS ? UPLOADS : 'Disabled' : 'Not set') . "\n";
     $uploads_dir = wp_upload_dir();
     $return .= 'wp_uploads_dir() path:    ' . $uploads_dir['path'] . "\n";
     $return .= 'wp_uploads_dir() url:     ' . $uploads_dir['url'] . "\n";
     $return .= 'wp_uploads_dir() basedir: ' . $uploads_dir['basedir'] . "\n";
     $return .= 'wp_uploads_dir() baseurl: ' . $uploads_dir['baseurl'] . "\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 && !empty($muplugins)) {
         $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 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";
     // 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";
     // 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;
 }