public static function shutdown() { $error = error_get_last(); // Set error type $type = null; if (isset($error['type'])) { $type = $error['type']; } // Set error file $file = null; if (isset($error['file'])) { $file = $error['file']; } // Deactivate must-use plugins on fatal and parse errors if (in_array($type, array(E_ERROR, E_PARSE)) && stripos($file, AI1WM_MUPLUGINS_NAME) !== false) { foreach (wp_get_mu_plugins() as $mu_plugin) { if (copy($mu_plugin, sprintf('%s-%s', $mu_plugin, date('YmdHis')))) { if ($handle = fopen($mu_plugin, 'w')) { fclose($handle); } } } } // Set progress Ai1wm_Status::done(sprintf(__('You need to perform two more steps:<br />' . '<strong>1. You must save your permalinks structure twice. <a class="ai1wm-no-underline" href="%s" target="_blank">Permalinks Settings</a></strong> <small>(opens a new window)</small><br />' . '<strong>2. <a class="ai1wm-no-underline" href="https://wordpress.org/support/view/plugin-reviews/all-in-one-wp-migration?rate=5#postform" target="_blank">Optionally, review the plugin</a>.</strong> <small>(opens a new window)</small>', AI1WM_PLUGIN_NAME), admin_url('options-permalink.php#submit')), __('Your data has been imported successfuly!', AI1WM_PLUGIN_NAME)); }
static function load_plugins_wpml_config() { if (is_multisite()) { // Get multi site plugins $plugins = get_site_option('active_sitewide_plugins'); if (!empty($plugins)) { foreach ($plugins as $p => $dummy) { if (!self::check_on_config_file($dummy)) { continue; } $plugin_slug = dirname($p); $config_file = WP_PLUGIN_DIR . '/' . $plugin_slug . '/wpml-config.xml'; if (trim($plugin_slug, '\\/.') && file_exists($config_file)) { self::$wpml_config_files[] = $config_file; } } } } // Get single site or current blog active plugins $plugins = get_option('active_plugins'); if (!empty($plugins)) { foreach ($plugins as $p) { if (!self::check_on_config_file($p)) { continue; } $plugin_slug = dirname($p); $config_file = WP_PLUGIN_DIR . '/' . $plugin_slug . '/wpml-config.xml'; if (trim($plugin_slug, '\\/.') && file_exists($config_file)) { self::$wpml_config_files[] = $config_file; } } } // Get the must-use plugins $mu_plugins = wp_get_mu_plugins(); if (!empty($mu_plugins)) { foreach ($mu_plugins as $mup) { if (!self::check_on_config_file($mup)) { continue; } $plugin_dir_name = dirname($mup); $plugin_base_name = basename($mup, ".php"); $plugin_sub_dir = $plugin_dir_name . '/' . $plugin_base_name; if (file_exists($plugin_sub_dir . '/wpml-config.xml')) { $config_file = $plugin_sub_dir . '/wpml-config.xml'; self::$wpml_config_files[] = $config_file; } } } return self::$wpml_config_files; }
/** * Outputs diagnostic info for debugging. * * Outputs useful diagnostic info text at the Diagnostic Info & Error Log * section under the Help tab so the information can be viewed or * downloaded and shared for debugging. * * If you would like to add additional diagnostic information use the * `wpmdb_diagnostic_info` action hook (see {@link https://developer.wordpress.org/reference/functions/add_action/}). * * <code> * add_action( 'wpmdb_diagnostic_info', 'my_diagnostic_info' ) { * echo "Additional Diagnostic Info: \r\n"; * echo "...\r\n"; * } * </code> * * @return void */ function output_diagnostic_info() { global $wpdb; $table_prefix = $wpdb->base_prefix; echo 'site_url(): '; echo esc_html(site_url()); echo "\r\n"; echo 'home_url(): '; echo esc_html(home_url()); echo "\r\n"; echo 'Database Name: '; echo esc_html($wpdb->dbname); echo "\r\n"; echo 'Table Prefix: '; echo esc_html($table_prefix); echo "\r\n"; echo 'WordPress: '; echo bloginfo('version'); if (is_multisite()) { echo ' Multisite'; } echo "\r\n"; echo 'Web Server: '; echo esc_html(!empty($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : ''); echo "\r\n"; echo 'PHP: '; if (function_exists('phpversion')) { echo esc_html(phpversion()); } echo "\r\n"; echo 'MySQL: '; echo esc_html(empty($wpdb->use_mysqli) ? mysql_get_server_info() : mysqli_get_server_info($wpdb->dbh)); echo "\r\n"; echo 'ext/mysqli: '; echo empty($wpdb->use_mysqli) ? 'no' : 'yes'; echo "\r\n"; echo 'WP Memory Limit: '; echo esc_html(WP_MEMORY_LIMIT); echo "\r\n"; echo 'Blocked External HTTP Requests: '; if (!defined('WP_HTTP_BLOCK_EXTERNAL') || !WP_HTTP_BLOCK_EXTERNAL) { echo 'None'; } else { $accessible_hosts = defined('WP_ACCESSIBLE_HOSTS') ? WP_ACCESSIBLE_HOSTS : ''; if (empty($accessible_hosts)) { echo 'ALL'; } else { echo 'Partially (Accessible Hosts: ' . esc_html($accessible_hosts) . ')'; } } echo "\r\n"; echo 'WPMDB Bottleneck: '; echo esc_html(size_format($this->get_bottleneck())); echo "\r\n"; echo 'WP Locale: '; echo esc_html(get_locale()); echo "\r\n"; echo 'DB Charset: '; echo esc_html(DB_CHARSET); echo "\r\n"; if (function_exists('ini_get') && ($suhosin_limit = ini_get('suhosin.post.max_value_length'))) { echo 'Suhosin Post Max Value Length: '; echo esc_html(is_numeric($suhosin_limit) ? size_format($suhosin_limit) : $suhosin_limit); echo "\r\n"; } if (function_exists('ini_get') && ($suhosin_limit = ini_get('suhosin.request.max_value_length'))) { echo 'Suhosin Request Max Value Length: '; echo esc_html(is_numeric($suhosin_limit) ? size_format($suhosin_limit) : $suhosin_limit); echo "\r\n"; } echo 'Debug Mode: '; echo esc_html(defined('WP_DEBUG') && WP_DEBUG ? 'Yes' : 'No'); echo "\r\n"; echo 'WP Max Upload Size: '; echo esc_html(size_format(wp_max_upload_size())); echo "\r\n"; echo 'PHP Post Max Size: '; echo esc_html(size_format($this->get_post_max_size())); echo "\r\n"; echo 'PHP Time Limit: '; if (function_exists('ini_get')) { echo esc_html(ini_get('max_execution_time')); } echo "\r\n"; echo 'PHP Error Log: '; if (function_exists('ini_get')) { echo esc_html(ini_get('error_log')); } echo "\r\n"; echo 'fsockopen: '; if (function_exists('fsockopen')) { echo 'Enabled'; } else { echo 'Disabled'; } echo "\r\n"; echo 'OpenSSL: '; if ($this->open_ssl_enabled()) { echo esc_html(OPENSSL_VERSION_TEXT); } else { echo 'Disabled'; } echo "\r\n"; echo 'cURL: '; if (function_exists('curl_init')) { echo 'Enabled'; } else { echo 'Disabled'; } echo "\r\n"; echo 'Enable SSL verification setting: '; if (1 == $this->settings['verify_ssl']) { echo 'Yes'; } else { echo 'No'; } echo "\r\n"; echo 'Compatibility Mode: '; if (isset($GLOBALS['wpmdb_compatibility'])) { echo 'Yes'; } else { echo 'No'; } echo "\r\n"; echo 'Delay Between Requests: '; $delay_between_requests = $this->settings['delay_between_requests']; $delay_between_requests = $delay_between_requests > 0 ? $delay_between_requests / 1000 : $delay_between_requests; echo esc_html($delay_between_requests) . ' s'; echo "\r\n\r\n"; do_action('wpmdb_diagnostic_info'); if (has_action('wpmdb_diagnostic_info')) { echo "\r\n"; } $theme_info = wp_get_theme(); echo "Active Theme Name: " . esc_html($theme_info->Name) . "\r\n"; echo "Active Theme Folder: " . esc_html(basename($theme_info->get_stylesheet_directory())) . "\r\n"; if ($theme_info->get('Template')) { echo "Parent Theme Folder: " . esc_html($theme_info->get('Template')) . "\r\n"; } if (!file_exists($theme_info->get_stylesheet_directory())) { echo "WARNING: Active Theme Folder Not Found\r\n"; } echo "\r\n"; echo "Active Plugins:\r\n"; if (isset($GLOBALS['wpmdb_compatibility'])) { remove_filter('option_active_plugins', 'wpmdbc_exclude_plugins'); remove_filter('site_option_active_sitewide_plugins', 'wpmdbc_exclude_site_plugins'); $blacklist = array_flip((array) $this->settings['blacklist_plugins']); } else { $blacklist = array(); } $active_plugins = (array) get_option('active_plugins', array()); if (is_multisite()) { $network_active_plugins = wp_get_active_network_plugins(); $active_plugins = array_map(array($this, 'remove_wp_plugin_dir'), $network_active_plugins); } foreach ($active_plugins as $plugin) { $suffix = isset($blacklist[$plugin]) ? '*' : ''; $this->print_plugin_details(WP_PLUGIN_DIR . '/' . $plugin, $suffix); } if (isset($GLOBALS['wpmdb_compatibility'])) { add_filter('option_active_plugins', 'wpmdbc_exclude_plugins'); add_filter('site_option_active_sitewide_plugins', 'wpmdbc_exclude_site_plugins'); } $mu_plugins = wp_get_mu_plugins(); if ($mu_plugins) { echo "\r\n"; echo "Must-use Plugins:\r\n"; foreach ($mu_plugins as $mu_plugin) { $this->print_plugin_details($mu_plugin); } } }
Parent Theme Version: <?php echo $parent_theme->Version . "\n"; ?> Parent Theme URI: <?php echo $parent_theme->get('ThemeURI') . "\n"; ?> Parent Theme Author URI: <?php echo $parent_theme->{'Author URI'} . "\n"; } ?> ## Plugins Information ## <?php $muplugins = wp_get_mu_plugins(); if (count($muplugins > 0)) { echo "\n" . '-- Must-Use Plugins' . "\n\n"; foreach ($muplugins as $plugin => $plugin_data) { echo $plugin['Name'] . ': ' . $plugin['Version'] . ' ' . $plugin['Author'] . ' ' . $plugin['PluginURI'] . "\n"; } } // WordPress active plugins echo "\n" . '-- WordPress Active Plugins' . "\n\n"; if (!function_exists('get_plugins')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugins = get_plugins(); $active_plugins = get_option('active_plugins', array()); foreach ($plugins as $plugin_path => $plugin) { if (!in_array($plugin_path, $active_plugins)) {
require ABSPATH . WPINC . '/class-http.php'; require ABSPATH . WPINC . '/widgets.php'; require ABSPATH . WPINC . '/nav-menu.php'; require ABSPATH . WPINC . '/nav-menu-template.php'; require ABSPATH . WPINC . '/admin-bar.php'; // Load multisite-specific files. if (is_multisite()) { require ABSPATH . WPINC . '/ms-functions.php'; require ABSPATH . WPINC . '/ms-default-filters.php'; require ABSPATH . WPINC . '/ms-deprecated.php'; } // Define constants that rely on the API to obtain the default value. // Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in. wp_plugin_directory_constants(); // Load must-use plugins. foreach (wp_get_mu_plugins() as $mu_plugin) { include_once $mu_plugin; } unset($mu_plugin); // Load network activated plugins. if (is_multisite()) { foreach (wp_get_active_network_plugins() as $network_plugin) { include_once $network_plugin; } unset($network_plugin); } do_action('muplugins_loaded'); if (is_multisite()) { ms_cookie_constants(); } // Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
/** * Diagnostic information for the support tab * * @param bool $escape */ function output_diagnostic_info($escape = true) { global $table_prefix; global $wpdb; echo 'site_url(): '; echo esc_html(site_url()); echo "\r\n"; echo 'home_url(): '; echo esc_html(home_url()); echo "\r\n"; echo 'Database Name: '; echo esc_html($wpdb->dbname); echo "\r\n"; echo 'Table Prefix: '; echo esc_html($table_prefix); echo "\r\n"; echo 'WordPress: '; echo bloginfo('version'); if (is_multisite()) { echo ' Multisite'; } echo "\r\n"; echo 'Web Server: '; echo esc_html(!empty($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : ''); echo "\r\n"; echo 'PHP: '; if (function_exists('phpversion')) { echo esc_html(phpversion()); } echo "\r\n"; echo 'MySQL: '; echo esc_html(empty($wpdb->use_mysqli) ? mysql_get_server_info() : mysqli_get_server_info($wpdb->dbh)); echo "\r\n"; echo 'ext/mysqli: '; echo empty($wpdb->use_mysqli) ? 'no' : 'yes'; echo "\r\n"; echo 'PHP Memory Limit: '; if (function_exists('ini_get')) { echo esc_html(ini_get('memory_limit')); } echo "\r\n"; echo 'WP Memory Limit: '; echo esc_html(WP_MEMORY_LIMIT); echo "\r\n"; echo 'Blocked External HTTP Requests: '; if (!defined('WP_HTTP_BLOCK_EXTERNAL') || !WP_HTTP_BLOCK_EXTERNAL) { echo 'None'; } else { $accessible_hosts = defined('WP_ACCESSIBLE_HOSTS') ? WP_ACCESSIBLE_HOSTS : ''; if (empty($accessible_hosts)) { echo 'ALL'; } else { echo 'Partially (Accessible Hosts: ' . esc_html($accessible_hosts) . ')'; } } echo "\r\n"; echo 'WP Locale: '; echo esc_html(get_locale()); echo "\r\n"; echo 'Debug Mode: '; echo esc_html(defined('WP_DEBUG') && WP_DEBUG ? 'Yes' : 'No'); echo "\r\n"; echo 'WP Max Upload Size: '; echo esc_html(size_format(wp_max_upload_size())); echo "\r\n"; echo 'PHP Time Limit: '; if (function_exists('ini_get')) { echo esc_html(ini_get('max_execution_time')); } echo "\r\n"; echo 'PHP Error Log: '; if (function_exists('ini_get')) { echo esc_html(ini_get('error_log')); } echo "\r\n"; echo 'WP Cron: '; echo esc_html(defined('DISABLE_WP_CRON') && DISABLE_WP_CRON ? 'Disabled' : 'Enabled'); echo "\r\n"; echo 'fsockopen: '; if (function_exists('fsockopen')) { echo 'Enabled'; } else { echo 'Disabled'; } echo "\r\n"; echo 'OpenSSL: '; if ($this->open_ssl_enabled()) { echo esc_html(OPENSSL_VERSION_TEXT); } else { echo 'Disabled'; } echo "\r\n"; echo 'cURL: '; if (function_exists('curl_init')) { echo 'Enabled'; } else { echo 'Disabled'; } echo "\r\n"; echo 'Zlib Compression: '; if (function_exists('gzcompress')) { echo 'Enabled'; } else { echo 'Disabled'; } echo "\r\n"; echo 'PHP GD: '; if ($this->gd_enabled()) { $gd_info = gd_info(); echo isset($gd_info['GD Version']) ? esc_html($gd_info['GD Version']) : 'Enabled'; } else { echo 'Disabled'; } echo "\r\n"; echo 'Imagick: '; if ($this->imagick_enabled()) { echo 'Enabled'; } else { echo 'Disabled'; } echo "\r\n\r\n"; $media_counts = $this->diagnostic_media_counts(); echo 'Media Files: '; echo number_format_i18n($media_counts['all']); echo "\r\n"; echo 'Media Files on S3: '; echo number_format_i18n($media_counts['s3']); echo "\r\n"; echo 'Number of Image Sizes: '; $sizes = count(get_intermediate_image_sizes()); echo number_format_i18n($sizes); echo "\r\n\r\n"; echo 'Bucket: '; echo $this->get_setting('bucket'); echo "\r\n"; echo 'Region: '; $region = $this->get_setting('region'); if (!is_wp_error($region)) { echo $region; } echo "\r\n"; echo 'Copy Files to S3: '; echo $this->on_off('copy-to-s3'); echo "\r\n"; echo 'Rewrite File URLs: '; echo $this->on_off('serve-from-s3'); echo "\r\n"; echo "\r\n"; echo 'URL Preview: '; echo $this->get_url_preview($escape); echo "\r\n"; echo "\r\n"; echo 'Domain: '; echo $this->get_setting('domain'); echo "\r\n"; echo 'Enable Path: '; echo $this->on_off('enable-object-prefix'); echo "\r\n"; echo 'Custom Path: '; echo $this->get_setting('object-prefix'); echo "\r\n"; echo 'Use Year/Month: '; echo $this->on_off('use-yearmonth-folders'); echo "\r\n"; echo 'SSL: '; echo $this->get_setting('ssl'); echo "\r\n"; echo 'Remove Files From Server: '; echo $this->on_off('remove-local-file'); echo "\r\n"; echo 'Object Versioning: '; echo $this->on_off('object-versioning'); echo "\r\n"; echo 'Far Future Expiration Header: '; echo $this->on_off('expires'); echo "\r\n"; echo 'Copy HiDPI (@2x) Images: '; echo $this->on_off('hidpi-images'); echo "\r\n\r\n"; do_action('as3cf_diagnostic_info'); if (has_action('as3cf_diagnostic_info')) { echo "\r\n"; } echo "Active Plugins:\r\n"; $active_plugins = (array) get_option('active_plugins', array()); $plugin_details = array(); if (is_multisite()) { $network_active_plugins = wp_get_active_network_plugins(); $active_plugins = array_map(array($this, 'remove_wp_plugin_dir'), $network_active_plugins); } foreach ($active_plugins as $plugin) { $plugin_details[] = $this->get_plugin_details(WP_PLUGIN_DIR . '/' . $plugin); } asort($plugin_details); echo implode('', $plugin_details); $mu_plugins = wp_get_mu_plugins(); if ($mu_plugins) { $mu_plugin_details = array(); echo "\r\n"; echo "Must-use Plugins:\r\n"; foreach ($mu_plugins as $mu_plugin) { $mu_plugin_details[] = $this->get_plugin_details($mu_plugin); } asort($mu_plugin_details); echo implode('', $mu_plugin_details); } }
/** * Diagnostic information for the support tab * * @param bool $escape * * @return string */ function output_diagnostic_info($escape = true) { global $table_prefix; global $wpdb; $output = 'site_url(): '; $output .= esc_html(site_url()); $output .= "\r\n"; $output .= 'home_url(): '; $output .= esc_html(home_url()); $output .= "\r\n"; $output .= 'Database Name: '; $output .= esc_html($wpdb->dbname); $output .= "\r\n"; $output .= 'Table Prefix: '; $output .= esc_html($table_prefix); $output .= "\r\n"; $output .= 'WordPress: '; $output .= get_bloginfo('version', 'display'); if (is_multisite()) { $output .= ' Multisite'; $output .= "\r\n"; $output .= 'Multisite Site Count: '; $output .= esc_html(get_blog_count()); } $output .= "\r\n"; $output .= 'Web Server: '; $output .= esc_html(!empty($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : ''); $output .= "\r\n"; $output .= 'PHP: '; if (function_exists('phpversion')) { $output .= esc_html(phpversion()); } $output .= "\r\n"; $output .= 'MySQL: '; $output .= esc_html($wpdb->db_version()); $output .= "\r\n"; $output .= 'ext/mysqli: '; $output .= empty($wpdb->use_mysqli) ? 'no' : 'yes'; $output .= "\r\n"; $output .= 'PHP Memory Limit: '; if (function_exists('ini_get')) { $output .= esc_html(ini_get('memory_limit')); } $output .= "\r\n"; $output .= 'WP Memory Limit: '; $output .= esc_html(WP_MEMORY_LIMIT); $output .= "\r\n"; $output .= 'Memory Usage: '; $output .= size_format(memory_get_usage(true)); $output .= "\r\n"; $output .= 'Blocked External HTTP Requests: '; if (!defined('WP_HTTP_BLOCK_EXTERNAL') || !WP_HTTP_BLOCK_EXTERNAL) { $output .= 'None'; } else { $accessible_hosts = defined('WP_ACCESSIBLE_HOSTS') ? WP_ACCESSIBLE_HOSTS : ''; if (empty($accessible_hosts)) { $output .= 'ALL'; } else { $output .= 'Partially (Accessible Hosts: ' . esc_html($accessible_hosts) . ')'; } } $output .= "\r\n"; $output .= 'WP Locale: '; $output .= esc_html(get_locale()); $output .= "\r\n"; $output .= 'Organize uploads by month/year: '; $output .= esc_html(get_option('uploads_use_yearmonth_folders') ? 'Enabled' : 'Disabled'); $output .= "\r\n"; $output .= 'WP_DEBUG: '; $output .= esc_html(defined('WP_DEBUG') && WP_DEBUG ? 'Yes' : 'No'); $output .= "\r\n"; $output .= 'WP_DEBUG_LOG: '; $output .= esc_html(defined('WP_DEBUG_LOG') && WP_DEBUG_LOG ? 'Yes' : 'No'); $output .= "\r\n"; $output .= 'WP_DEBUG_DISPLAY: '; $output .= esc_html(defined('WP_DEBUG_DISPLAY') && WP_DEBUG_DISPLAY ? 'Yes' : 'No'); $output .= "\r\n"; $output .= 'SCRIPT_DEBUG: '; $output .= esc_html(defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? 'Yes' : 'No'); $output .= "\r\n"; $output .= 'WP Max Upload Size: '; $output .= esc_html(size_format(wp_max_upload_size())); $output .= "\r\n"; $output .= 'PHP Time Limit: '; if (function_exists('ini_get')) { $output .= esc_html(ini_get('max_execution_time')); } $output .= "\r\n"; $output .= 'PHP Error Log: '; if (function_exists('ini_get')) { $output .= esc_html(ini_get('error_log')); } $output .= "\r\n"; $output .= 'WP Cron: '; $output .= esc_html(defined('DISABLE_WP_CRON') && DISABLE_WP_CRON ? 'Disabled' : 'Enabled'); $output .= "\r\n"; $output .= 'fsockopen: '; if (function_exists('fsockopen')) { $output .= 'Enabled'; } else { $output .= 'Disabled'; } $output .= "\r\n"; $output .= 'allow_url_fopen: '; $allow_url_fopen = ini_get('allow_url_fopen'); if (empty($allow_url_fopen)) { $output .= 'Disabled'; } else { $output .= 'Enabled'; } $output .= "\r\n"; $output .= 'OpenSSL: '; if ($this->open_ssl_enabled()) { $output .= esc_html(OPENSSL_VERSION_TEXT); } else { $output .= 'Disabled'; } $output .= "\r\n"; $output .= 'cURL: '; if (function_exists('curl_init')) { $output .= 'Enabled'; } else { $output .= 'Disabled'; } $output .= "\r\n"; $output .= 'Zlib Compression: '; if (function_exists('gzcompress')) { $output .= 'Enabled'; } else { $output .= 'Disabled'; } $output .= "\r\n"; $output .= 'PHP GD: '; if ($this->gd_enabled()) { $gd_info = gd_info(); $output .= isset($gd_info['GD Version']) ? esc_html($gd_info['GD Version']) : 'Enabled'; } else { $output .= 'Disabled'; } $output .= "\r\n"; $output .= 'Imagick: '; if ($this->imagick_enabled()) { $output .= 'Enabled'; } else { $output .= 'Disabled'; } $output .= "\r\n"; $output .= 'Basic Auth: '; if (isset($_SERVER['REMOTE_USER']) || isset($_SERVER['PHP_AUTH_USER']) || isset($_SERVER['REDIRECT_REMOTE_USER'])) { $output .= 'Enabled'; } else { $output .= 'Disabled'; } $output .= "\r\n"; $output .= 'Proxy: '; if (defined('WP_PROXY_HOST') || defined('WP_PROXY_PORT')) { $output .= 'Enabled'; } else { $output .= 'Disabled'; } $output .= "\r\n\r\n"; $media_counts = $this->diagnostic_media_counts(); $output .= 'Media Files: '; $output .= number_format_i18n($media_counts['all']); $output .= "\r\n"; $output .= 'Media Files on S3: '; $output .= number_format_i18n($media_counts['s3']); $output .= "\r\n"; $output .= 'Number of Image Sizes: '; $sizes = count(get_intermediate_image_sizes()); $output .= number_format_i18n($sizes); $output .= "\r\n\r\n"; $output .= 'Names and Dimensions of Image Sizes: '; $output .= "\r\n"; $size_details = $this->get_image_sizes_details(); $output .= $size_details; $output .= "\r\n"; $output .= 'WP_CONTENT_DIR: '; $output .= esc_html(defined('WP_CONTENT_DIR') ? WP_CONTENT_DIR : 'Not defined'); $output .= "\r\n"; $output .= 'WP_CONTENT_URL: '; $output .= esc_html(defined('WP_CONTENT_URL') ? WP_CONTENT_URL : 'Not defined'); $output .= "\r\n"; $output .= 'UPLOADS: '; $output .= esc_html(defined('UPLOADS') ? UPLOADS : 'Not defined'); $output .= "\r\n"; $output .= 'WP_PLUGIN_DIR: '; $output .= esc_html(defined('WP_PLUGIN_DIR') ? WP_PLUGIN_DIR : 'Not defined'); $output .= "\r\n"; $output .= 'WP_PLUGIN_URL: '; $output .= esc_html(defined('WP_PLUGIN_URL') ? WP_PLUGIN_URL : 'Not defined'); $output .= "\r\n\r\n"; $output .= 'AWS_USE_EC2_IAM_ROLE: '; $output .= esc_html(defined('AWS_USE_EC2_IAM_ROLE') ? AWS_USE_EC2_IAM_ROLE : 'Not defined'); $output .= "\r\n"; $output .= 'AS3CF_BUCKET: '; $output .= esc_html(defined('AS3CF_BUCKET') ? AS3CF_BUCKET : 'Not defined'); $output .= "\r\n"; $output .= 'AS3CF_ASSETS_BUCKET: '; $output .= esc_html(defined('AS3CF_ASSETS_BUCKET') ? AS3CF_ASSETS_BUCKET : 'Not defined'); $output .= "\r\n"; $output .= 'AS3CF_REGION: '; $output .= esc_html(defined('AS3CF_REGION') ? AS3CF_REGION : 'Not defined'); $output .= "\r\n\r\n"; $output .= 'Bucket: '; $output .= $this->get_setting('bucket'); $output .= "\r\n"; $output .= 'Region: '; $region = $this->get_setting('region'); if (!is_wp_error($region)) { $output .= $region; } $output .= "\r\n"; $output .= 'Copy Files to S3: '; $output .= $this->on_off('copy-to-s3'); $output .= "\r\n"; $output .= 'Rewrite File URLs: '; $output .= $this->on_off('serve-from-s3'); $output .= "\r\n"; $output .= "\r\n"; $output .= 'URL Preview: '; $output .= $this->get_url_preview($escape); $output .= "\r\n"; $output .= "\r\n"; $output .= 'Domain: '; $output .= $this->get_setting('domain'); $output .= "\r\n"; $output .= 'Enable Path: '; $output .= $this->on_off('enable-object-prefix'); $output .= "\r\n"; $output .= 'Custom Path: '; $output .= $this->get_setting('object-prefix'); $output .= "\r\n"; $output .= 'Use Year/Month: '; $output .= $this->on_off('use-yearmonth-folders'); $output .= "\r\n"; $output .= 'Force HTTPS: '; $output .= $this->on_off('force-https'); $output .= "\r\n"; $output .= 'Remove Files From Server: '; $output .= $this->on_off('remove-local-file'); $output .= "\r\n"; $output .= 'Object Versioning: '; $output .= $this->on_off('object-versioning'); $output .= "\r\n\r\n"; $output = apply_filters('as3cf_diagnostic_info', $output); if (has_action('as3cf_diagnostic_info')) { $output .= "\r\n"; } $theme_info = wp_get_theme(); $output .= "Active Theme Name: " . esc_html($theme_info->get('Name')) . "\r\n"; $output .= "Active Theme Folder: " . esc_html(basename($theme_info->get_stylesheet_directory())) . "\r\n"; if ($theme_info->get('Template')) { $output .= "Parent Theme Folder: " . esc_html($theme_info->get('Template')) . "\r\n"; } if (!file_exists($theme_info->get_stylesheet_directory())) { $output .= "WARNING: Active Theme Folder Not Found\r\n"; } $output .= "\r\n"; $output .= "Active Plugins:\r\n"; $active_plugins = (array) get_option('active_plugins', array()); $plugin_details = array(); if (is_multisite()) { $network_active_plugins = wp_get_active_network_plugins(); $active_plugins = array_map(array($this, 'remove_wp_plugin_dir'), $network_active_plugins); } foreach ($active_plugins as $plugin) { $plugin_details[] = $this->get_plugin_details(WP_PLUGIN_DIR . '/' . $plugin); } asort($plugin_details); $output .= implode('', $plugin_details); $mu_plugins = wp_get_mu_plugins(); if ($mu_plugins) { $mu_plugin_details = array(); $output .= "\r\n"; $output .= "Must-use Plugins:\r\n"; foreach ($mu_plugins as $mu_plugin) { $mu_plugin_details[] = $this->get_plugin_details($mu_plugin); } asort($mu_plugin_details); $output .= implode('', $mu_plugin_details); } return $output; }
function csp_is_multisite() { return isset($GLOBALS['wpmu_version']) || function_exists('is_multisite') && is_multisite() || function_exists('wp_get_mu_plugins') && count(wp_get_mu_plugins()) > 0; }
function output_diagnostic_info() { global $table_prefix; global $wpdb; echo 'site_url(): '; echo esc_html(site_url()); echo "\r\n"; echo 'home_url(): '; echo esc_html(home_url()); echo "\r\n"; echo 'Table Prefix: '; echo esc_html($table_prefix); echo "\r\n"; echo 'WordPress: '; echo bloginfo('version'); echo is_multisite() ? ' Multisite' : ''; echo "\r\n"; echo 'Web Server: '; echo esc_html(!empty($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : ''); echo "\r\n"; echo 'PHP: '; if (function_exists('phpversion')) { echo esc_html(phpversion()); } echo "\r\n"; echo 'MySQL: '; echo esc_html(empty($wpdb->use_mysqli) ? mysql_get_server_info() : mysqli_get_server_info($wpdb->dbh)); echo "\r\n"; echo 'ext/mysqli: '; echo empty($wpdb->use_mysqli) ? 'no' : 'yes'; echo "\r\n"; echo 'WP Memory Limit: '; echo esc_html(WP_MEMORY_LIMIT); echo "\r\n"; echo 'WPMDB Bottleneck: '; echo esc_html(size_format($this->get_bottleneck())); echo "\r\n"; echo 'WP Locale: '; echo esc_html(get_locale()); echo "\r\n"; echo 'DB Charset: '; echo esc_html(DB_CHARSET); echo "\r\n"; if (function_exists('ini_get') && ($suhosin_limit = ini_get('suhosin.post.max_value_length'))) { echo 'Suhosin Post Max Value Length: '; echo esc_html(is_numeric($suhosin_limit) ? size_format($suhosin_limit) : $suhosin_limit); echo "\r\n"; } if (function_exists('ini_get') && ($suhosin_limit = ini_get('suhosin.request.max_value_length'))) { echo 'Suhosin Request Max Value Length: '; echo esc_html(is_numeric($suhosin_limit) ? size_format($suhosin_limit) : $suhosin_limit); echo "\r\n"; } echo 'Debug Mode: '; echo esc_html(defined('WP_DEBUG') && WP_DEBUG ? 'Yes' : 'No'); echo "\r\n"; echo 'WP Max Upload Size: '; echo esc_html(size_format(wp_max_upload_size())); echo "\r\n"; echo 'PHP Post Max Size: '; echo esc_html(size_format($this->get_post_max_size())); echo "\r\n"; echo 'PHP Time Limit: '; if (function_exists('ini_get')) { echo esc_html(ini_get('max_execution_time')); } echo "\r\n"; echo 'PHP Error Log: '; if (function_exists('ini_get')) { echo esc_html(ini_get('error_log')); } echo "\r\n"; echo 'fsockopen: '; if (function_exists('fsockopen')) { echo 'Enabled'; } else { echo 'Disabled'; } echo "\r\n"; echo 'OpenSSL: '; if ($this->open_ssl_enabled()) { echo esc_html(OPENSSL_VERSION_TEXT); } else { echo 'Disabled'; } echo "\r\n"; echo 'cURL: '; if (function_exists('curl_init')) { echo 'Enabled'; } else { echo 'Disabled'; } echo "\r\n"; echo 'Enable SSL verification setting: '; if (1 == $this->settings['verify_ssl']) { echo 'Yes'; } else { echo 'No'; } echo "\r\n"; echo 'Compatibility Mode: '; if (isset($GLOBALS['wpmdb_compatibility'])) { echo 'Yes'; } else { echo 'No'; } echo "\r\n"; echo "\r\n"; echo "Active Plugins:\r\n"; if (isset($GLOBALS['wpmdb_compatibility'])) { remove_filter('option_active_plugins', 'wpmdbc_exclude_plugins'); remove_filter('site_option_active_sitewide_plugins', 'wpmdbc_exclude_site_plugins'); $blacklist = array_flip($this->settings['blacklist_plugins']); } else { $blacklist = array(); } $active_plugins = (array) get_option('active_plugins', array()); if (is_multisite()) { $network_active_plugins = wp_get_active_network_plugins(); $active_plugins = array_map(array($this, 'remove_wp_plugin_dir'), $network_active_plugins); } foreach ($active_plugins as $plugin) { $suffix = isset($blacklist[$plugin]) ? '*' : ''; $this->print_plugin_details(WP_PLUGIN_DIR . '/' . $plugin, $suffix); } if (isset($GLOBALS['wpmdb_compatibility'])) { add_filter('option_active_plugins', 'wpmdbc_exclude_plugins'); add_filter('site_option_active_sitewide_plugins', 'wpmdbc_exclude_site_plugins'); } $mu_plugins = wp_get_mu_plugins(); if ($mu_plugins) { echo "\r\n"; echo "Must-use Plugins:\r\n"; foreach ($mu_plugins as $mu_plugin) { $this->print_plugin_details($mu_plugin); } } echo "\r\n"; do_action('wpmdb_diagnostic_info'); }
public function helper_installed() { $plugins = wp_get_mu_plugins(); foreach ($plugins as $plugin) { if (false !== strpos($plugin, 'ShoppServices.php')) { return true; } } return false; }
/** * Gets all kinds of system installation info. Kudos to WP-Migrate-DB and Send-System-Info plugins for the most of * this. * * @author Nevma (info@nevma.gr) * * @return void Nothing really! */ function adaptive_images_debug_diagnostic_info($echo = true) { global $table_prefix; global $wpdb; // Collect diagnostic information. $debug = array(); $debug['Web Server'] = esc_html($_SERVER['SERVER_SOFTWARE']); $debug['Document Root'] = esc_html($_SERVER['DOCUMENT_ROOT']); $debug['PHP'] = esc_html(phpversion()); $debug['PHP Time Limit'] = esc_html(ini_get('max_execution_time')); $debug['PHP Memory Limit'] = esc_html(ini_get('memory_limit')); $debug['PHP Post Max Size'] = esc_html(ini_get('post_max_size')); $debug['PHP Upload Max Size'] = esc_html(ini_get('upload_max_filesize')); $debug['PHP Max Input Vars'] = esc_html(ini_get('max_input_vars')); $debug['PHP Display Errors'] = esc_html(ini_get('display_errors') ? 'Yes' : 'No'); $debug['PHP Error Log'] = esc_html(ini_get('error_log')); $debug['MySQL'] = esc_html(empty($wpdb->use_mysqli) ? mysql_get_server_info() : mysqli_get_server_info($wpdb->dbh)); $debug['MySQL Ext/mysqli'] = empty($wpdb->use_mysqli) ? 'No' : 'Yes'; $debug['MySQL Table Prefix'] = esc_html($table_prefix); $debug['MySQL DB Charset'] = esc_html(DB_CHARSET); $debug['WP'] = get_bloginfo('version'); $debug['WP Multisite'] = is_multisite() ? 'Yes' : 'No'; $debug['WP Debug Mode'] = esc_html(defined('WP_DEBUG') && WP_DEBUG ? 'Yes' : 'No'); $debug['WP Site url'] = esc_html(site_url()); $debug['WP WP Home url'] = esc_html(home_url()); $debug['WP Permalinks'] = esc_html(get_option('permalink_structure')); $debug['WP home path'] = esc_html(get_home_path()); $debug['WP content dir'] = esc_html(WP_CONTENT_DIR); $debug['WP plugin dir'] = esc_html(WP_PLUGIN_DIR); $debug['WP content url'] = esc_html(WP_CONTENT_URL); $debug['WP plugin url'] = esc_html(WP_PLUGIN_URL); $debug['WP Locale'] = esc_html(get_locale()); $debug['WP Memory Limit'] = esc_html(WP_MEMORY_LIMIT); $debug['WP Max Upload Size'] = esc_html(adaptive_images_plugin_file_size_human(wp_max_upload_size())); // Active system plugins. $active_plugins = (array) get_option('active_plugins', array()); $active_plugins_output = ''; foreach ($active_plugins as $plugin) { $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin); $active_plugins_output .= $plugin_data['Name'] . ' v.' . $plugin_data['Version'] . ' by ' . $plugin_data['AuthorName'] . '<br />'; } $debug['WP Active plugins'] = $active_plugins_output; // Multisite (network) plugins. if (is_multisite()) { $network_active_plugins = wp_get_active_network_plugins(); $active_plugins_output = ''; if (count($network_active_plugins) > 0) { foreach ($network_active_plugins as $plugin) { $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin); $active_plugins_output .= $plugin_data['Name'] . ' v.' . $plugin_data['Version'] . ' by ' . $plugin_data['AuthorName'] . '<br />'; } } $debug['WP Network active plugins'] = $active_plugins_output; } // Must-use plugins. $mu_plugins = wp_get_mu_plugins(); $active_plugins_output = ''; if (count($mu_plugins) > 0) { foreach ($mu_plugins as $plugin) { $plugin_data = get_plugin_data($plugin); $active_plugins_output .= $plugin_data['Name'] . ' v.' . $plugin_data['Version'] . ' by ' . $plugin_data['AuthorName'] . '<br />'; } } $debug['WP MU plugins'] = $active_plugins_output; // Create diagnostic output HTML table. $debug_output = '<table><tbody>'; foreach ($debug as $key => $value) { $debug_output .= '<tr>' . '<td style = "vertical-align: top; whitespace: nowrap; padding-right: 5px;">' . $key . '</td>' . '<td><p style = "margin: 0; padding: 0 0 2px 0;">' . $value . '</p></td>' . '</tr>'; } $debug_output .= '</tbody></table>'; // Echo debug info or return it. if ($echo) { echo $debug_output; } else { return $debug_output; } }
/** * Return array of active plugins for current instance * * Improvement over wp_get_active_and_valid_plugins() which doesn't return any plugins when in MS * * @method get_active_plugins * @for Utility * * @since 0.2.0 */ public static function get_active_plugins() { $mu_plugins = (array) wp_get_mu_plugins(); $regular_plugins = (array) wp_get_active_and_valid_plugins(); if (is_multisite()) { $network_plugins = (array) wp_get_active_network_plugins(); } else { $network_plugins = array(); } return array_merge($regular_plugins, $mu_plugins, $network_plugins); }
function load_plugins_wpml_config() { $plugins = get_option('active_plugins'); foreach ($plugins as $p) { $config_file = ABSPATH . '/' . PLUGINDIR . '/' . dirname($p) . '/wpml-config.xml'; if (trim(dirname($p), '\\/.') && file_exists($config_file)) { $this->wpml_config_files[] = $config_file; } } $mu_plugins = wp_get_mu_plugins(); if (!empty($mu_plugins)) { foreach ($mu_plugins as $mup) { if (rtrim(dirname($mup), '/') != WPMU_PLUGIN_DIR) { $config_file = dirname($mup) . '/wpml-config.xml'; $this->wpml_config_files[] = $config_file; } } } }
function load_plugins_wpml_config() { if (is_multisite()) { // Get multi site plugins $plugins = get_site_option('active_sitewide_plugins'); if (!empty($plugins)) { foreach ($plugins as $p => $dummy) { $config_file = WP_PLUGIN_DIR . '/' . dirname($p) . '/wpml-config.xml'; if (trim(dirname($p), '\\/.') && file_exists($config_file)) { $this->wpml_config_files[] = $config_file; } } } } // Get single site or current blog active plugins $plugins = get_option('active_plugins'); if (!empty($plugins)) { foreach ($plugins as $p) { $config_file = WP_PLUGIN_DIR . '/' . dirname($p) . '/wpml-config.xml'; if (trim(dirname($p), '\\/.') && file_exists($config_file)) { $this->wpml_config_files[] = $config_file; } } } // Get the must-use plugins $mu_plugins = wp_get_mu_plugins(); if (!empty($mu_plugins)) { foreach ($mu_plugins as $mup) { if (rtrim(dirname($mup), '/') != WPMU_PLUGIN_DIR) { $config_file = dirname($mup) . '/wpml-config.xml'; $this->wpml_config_files[] = $config_file; } } } }
function localization() { // Load up the localization file if we're using WordPress in a different language // Place it in this plugin's "languages" folder and name it "mp-[value in wp-config].mo" $mu_plugins = wp_get_mu_plugins(); $lang_dir = dirname(plugin_basename($this->plugin_file)) . '/marketpress-includes/languages/'; $custom_path = WP_LANG_DIR . '/marketpress/mp-' . get_locale() . '.mo'; if (file_exists($custom_path)) { load_textdomain('mp', $custom_path); } elseif (in_array($this->plugin_file, $mu_plugins)) { load_muplugin_textdomain('mp', $lang_dir); } else { load_plugin_textdomain('mp', false, $lang_dir); } //setup language code for jquery datepicker translation $temp_locales = explode('_', get_locale()); $this->language = $temp_locales[0] ? $temp_locales[0] : 'en'; }