当前位置: 首页>>代码示例>>PHP>>正文


PHP wp_get_active_network_plugins函数代码示例

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


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

示例1: get_plugins

 public function get_plugins($site_type, $filtered = true)
 {
     $cache_key = 'plugins-' . $filtered . '-' . $site_type;
     if (isset($this->cache[$cache_key])) {
         return $this->cache[$cache_key];
     }
     $args = array('website_type' => $site_type);
     $plugins = $this->make_api_call('plugins', One_And_One_Transience_Manager::CATALOG_PLUGINS . '_' . $site_type, $args);
     if ($plugins && $filtered) {
         $plugins_keys = array_keys((array) $plugins);
         $active_plugins = (array) get_option('active_plugins', array());
         $network_plugins = is_multisite() ? wp_get_active_network_plugins() : false;
         foreach ($active_plugins as $plugin) {
             $parts = explode('/', $plugin);
             if (in_array($parts[0], $plugins_keys)) {
                 unset($plugins->{$parts}[0]);
             }
         }
         if ($network_plugins) {
             foreach ($network_plugins as $plugin) {
                 $parts = explode('/', $plugin);
                 if (in_array($parts[0], $plugins_keys)) {
                     unset($plugins->{$parts}[0]);
                 }
             }
         }
     }
     // Store in cache so we don't need to do all this logic the next time
     $this->cache[$cache_key] = $plugins;
     return $plugins;
 }
开发者ID:afalconi,项目名称:YvetteChevalier,代码行数:31,代码来源:setup-tool-catalog.php

示例2: bp_is_installed

 /**
  * Determines whether or not BuddyPress is installed.
  *
  * @package s2Member\Utilities
  * @since 110720
  *
  * @param bool $query_active_plugins Optional. If true, this conditional will query active plugins too. Defaults to true if {@link s2Member\WS_PLUGIN__S2MEMBER_ONLY} is true, else false.
  * @return bool True if BuddyPress is installed, else false.
  */
 public static function bp_is_installed($query_active_plugins = NULL)
 {
     if (defined("BP_VERSION") && did_action("bp_core_loaded")) {
         return true;
     }
     /* Quickest/easiest way to determine. */
     /**/
     $s2o = defined("WS_PLUGIN__S2MEMBER_ONLY") && WS_PLUGIN__S2MEMBER_ONLY ? true : false;
     /**/
     if ($query_active_plugins = !isset($query_active_plugins) && $s2o ? true : $query_active_plugins) {
         $buddypress = "buddypress/bp-loader.php";
         /* BuddyPress. */
         /**/
         $active_plugins = is_multisite() ? wp_get_active_network_plugins() : array();
         $active_plugins = array_unique(array_merge($active_plugins, wp_get_active_and_valid_plugins()));
         /**/
         foreach ($active_plugins as $active_plugin) {
             /* Search. */
             if (plugin_basename($active_plugin) === $buddypress) {
                 return true;
             }
         }
         /* BuddyPress active. */
     }
     return false;
     /* Default return false. */
 }
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:36,代码来源:utils-conds.inc.php

示例3: get_plugins_with_prefix

 /**
  * Get list of active plugins with a given prefix in the plugin folder path.
  *
  * @param string|array $prefix Prefixes you want to retrieve.
  *
  * @return array List of plugins with prefix in path.
  */
 public static function get_plugins_with_prefix($prefix)
 {
     $full_list = wp_get_active_and_valid_plugins();
     if (is_multisite()) {
         $full_list = array_merge($full_list, wp_get_active_network_plugins());
     }
     $filtered_list = array();
     foreach ($full_list as $plugin) {
         $base = plugin_basename($plugin);
         if (0 === Tribe__Utils__Array::strpos($base, $prefix)) {
             $filtered_list[] = $plugin;
         }
     }
     return $filtered_list;
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:22,代码来源:Plugins.php

示例4: wp_get_active_and_valid_plugins

function wp_get_active_and_valid_plugins()
{
    $plugins = array();
    $active_plugins = (array) get_option('active_plugins', array());
    // Check for hacks file if the option is enabled
    if (get_option('hack_file') && file_exists(ABSPATH . 'my-hacks.php')) {
        _deprecated_file('my-hacks.php', '1.5');
        array_unshift($plugins, ABSPATH . 'my-hacks.php');
    }
    if (empty($active_plugins) || wp_installing()) {
        return $plugins;
    }
    $network_plugins = is_multisite() ? wp_get_active_network_plugins() : false;
    foreach ($active_plugins as $plugin) {
        if (!validate_file($plugin) && '.php' == substr($plugin, -4) && file_exists(WP_PLUGIN_DIR . '/' . $plugin) && (!$network_plugins || !in_array(WP_PLUGIN_DIR . '/' . $plugin, $network_plugins))) {
            $plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
        }
    }
    return $plugins;
}
开发者ID:AppItNetwork,项目名称:yii2-wordpress-themes,代码行数:20,代码来源:load.php

示例5: get_network_plugins

 /**
  * Lists any multisite network plugins.
  *
  * @return array
  */
 static function get_network_plugins()
 {
     $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;
         }
     }
     return $network_plugins;
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:27,代码来源:Support.php

示例6: is_yoast_enabled

 public static function is_yoast_enabled()
 {
     // Assume it's not enabled unless we can prove otherwise...
     $enabled = false;
     // Is Yoast WordPress SEO plugin is enabled this single site? (not network-wide)
     $active_plugins = get_option('active_plugins');
     if (in_array("wordpress-seo/wp-seo.php", $active_plugins)) {
         return true;
     }
     if (function_exists('wp_get_active_network_plugins')) {
         // Is Yoast WordPress SEO plugin is enabled Network-wide?
         $plugins = wp_get_active_network_plugins();
         foreach ($plugins as $key => $plugin) {
             // cut the last 24 char off each plugin
             $plugin_name = substr($plugin, -24);
             // check if it's Yoast plugin
             if ($plugin_name == 'wordpress-seo/wp-seo.php') {
                 $enabled = true;
             }
         }
     }
     return $enabled;
 }
开发者ID:lytranuit,项目名称:wordpress,代码行数:23,代码来源:meta-tags.php

示例7: msa_get_system_info

/**
 * Get the information about this wordpress install
 *
 * @access public
 * @return string $output The HTMl output.
 */
function msa_get_system_info()
{
    global $wp_version;
    if (get_bloginfo('version') < '3.4') {
        $theme_data = get_theme_data(get_stylesheet_directory() . '/style.css');
    } else {
        $theme_data = wp_get_theme();
    }
    $white_space = '                              ';
    $plugins = get_plugins();
    $active_plugins = get_option('active_plugins', array());
    $inactive_plugins_data = array();
    $active_plugins_data = array();
    $network_activated_plugins_data = array();
    foreach ($plugins as $plugin_path => $plugin) {
        if (!in_array($plugin_path, $active_plugins, true)) {
            $inactive_plugins_data[] = $plugin['Name'] . ': ' . $plugin['Version'];
        } else {
            $active_plugins_data[] = $plugin['Name'] . ': ' . $plugin['Version'];
        }
    }
    if (is_multisite()) {
        $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);
            $network_activated_plugins_data[] = $plugin['Name'] . ' :' . $plugin['Version'];
        }
    }
    $web_server_info = '';
    if (isset($_SERVER['SERVER_SOFTWARE'])) {
        // Input var okay.
        $web_server_info = sanitize_text_field(wp_unslash($_SERVER['SERVER_SOFTWARE']));
        // Input var okay.
    }
    return array(array(array('name' => 'Site URL', 'value' => site_url()), array('name' => 'Home URL', 'value' => home_url()), array('name' => 'Admin URL', 'value' => admin_url())), array(array('name' => 'WordPress Version', 'value' => $wp_version), array('name' => 'Permalink Structure', 'value' => get_option('permalink_structure')), array('name' => 'WP_DEBUG', 'value' => defined('WP_DEBUG') ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set'), array('name' => 'Registered Post Stati', 'value' => implode("\n" . $white_space, get_post_stati())), array('name' => 'Active Plugins', 'value' => implode("\n" . $white_space, $active_plugins_data)), array('name' => 'Inactive Plugins', 'value' => implode("\n" . $white_space, $inactive_plugins_data)), array('name' => 'Network Activated Plugins', 'value' => implode("\n" . $white_space, $network_activated_plugins_data))), array(array('name' => 'My Site Audit Version', 'value' => MY_SITE_AUDIT_VERSION)), array(array('name' => 'PHP Version', 'value' => PHP_VERSION), array('name' => 'Web Server Info', 'value' => $web_server_info), array('name' => 'WordPress Memory Limit', 'value' => WP_MEMORY_LIMIT), array('name' => 'PHP Safe Mode', 'value' => ini_get('safe_mode') ? __('Yes', 'msa') : __('No', 'msa')), array('name' => 'PHP Memory Limit', 'value' => ini_get('memory_limit')), array('name' => 'PHP Upload Max Size', 'value' => ini_get('upload_max_filesize')), array('name' => 'PHP Post Max Size', 'value' => ini_get('post_max_size')), array('name' => 'PHP Upload Max File-size', 'value' => ini_get('upload_max_filesize')), array('name' => 'PHP Time Limit', 'value' => ini_get('max_execution_time')), array('name' => 'PHP Max Input Vars', 'value' => ini_get('max_input_vars')), array('name' => 'PHP Arg Separator', 'value' => ini_get('arg_separator.output')), array('name' => 'PHP Allow URL File Open', 'value' => ini_get('allow_url_fopen') ? __('Yes', 'msa') : __('No', 'msa'))));
}
开发者ID:99robots,项目名称:my-site-audit,代码行数:47,代码来源:system-info.php

示例8: _getNetworkActivePlugins

 private function _getNetworkActivePlugins()
 {
     if (!is_multisite()) {
         return '';
     }
     $_aPluginList = array();
     $_aActivePlugins = get_site_option('active_sitewide_plugins', array());
     foreach (wp_get_active_network_plugins() as $_sPluginPath) {
         if (!array_key_exists(plugin_basename($_sPluginPath), $_aActivePlugins)) {
             continue;
         }
         $_aPlugin = get_plugin_data($_sPluginPath);
         $_aPluginList[] = '    ' . $_aPlugin['Name'] . ' :' . $_aPlugin['Version'];
     }
     return implode(PHP_EOL, $_aPluginList);
 }
开发者ID:szepeviktor,项目名称:admin-page-framework,代码行数:16,代码来源:AdminPageFramework_FieldType_system.php

示例9: wfDiagnostic

<?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' : '';
?>
开发者ID:GafaMX,项目名称:operaciondespierta.org,代码行数:31,代码来源:menu_diagnostic.php

示例10: foreach

        continue;
    }
    echo $plugin['Name'] . ': ' . $plugin['Version'] . ' ' . $plugin['Author'] . ' ' . $plugin['PluginURI'] . "\n";
}
// WordPress inactive plugins
echo "\n" . '-- WordPress Inactive Plugins' . "\n\n";
foreach ($plugins as $plugin_path => $plugin) {
    if (in_array($plugin_path, $active_plugins)) {
        continue;
    }
    echo $plugin['Name'] . ': ' . $plugin['Version'] . ' ' . $plugin['Author'] . ' ' . $plugin['PluginURI'] . "\n";
}
if (is_multisite()) {
    // WordPress Multisite active plugins
    echo "\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);
        echo $plugin['Name'] . ': ' . $plugin['Version'] . ' ' . $plugin['Author'] . ' ' . $plugin['PluginURI'] . "\n";
    }
}
?>

## Server Environment ##

Server Info:              <?php 
开发者ID:jonmunson,项目名称:Simple-System-Status-for-WordPress,代码行数:31,代码来源:output.php

示例11: wp_plugin_directory_constants

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().
wp_cookie_constants();
// Define and enforce our SSL constants
wp_ssl_constants();
// Create common globals.
require ABSPATH . WPINC . '/vars.php';
// Make taxonomies and posts available to plugins and themes.
开发者ID:openify,项目名称:wordpress-composer,代码行数:31,代码来源:wp-settings.php

示例12: tc_config_infos

        function tc_config_infos()
        {
            global $wpdb;
            ?>
<div class="wrap">
<h3><?php 
            _e('System Informations', 'customizr');
            ?>
</h3>
<h4 style="text-align: left"><?php 
            _e('Please include the following informations when posting support requests', 'customizr');
            ?>
</h4>
<textarea readonly="readonly" onclick="this.focus();this.select()" id="system-info-textarea" name="tc-sysinfo" title="<?php 
            _e('To copy the system infos, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'customizr');
            ?>
" style="width: 800px;min-height: 800px;font-family: Menlo,Monaco,monospace;background: 0 0;white-space: pre;overflow: auto;display:block;">
<?php 
            do_action('__system_config_before');
            ?>
# SITE_URL:                 <?php 
            echo site_url() . "\n";
            ?>
# HOME_URL:                 <?php 
            echo home_url() . "\n";
            ?>
# IS MULTISITE :            <?php 
            echo is_multisite() ? 'Yes' . "\n" : 'No' . "\n";
            ?>

# THEME | VERSION :         <?php 
            printf('%1$s | v%2$s', TC___::$theme_name, CUSTOMIZR_VER) . "\n";
            ?>
# WP VERSION :              <?php 
            echo get_bloginfo('version') . "\n";
            ?>
# PERMALINK STRUCTURE :     <?php 
            echo get_option('permalink_structure') . "\n";
            ?>

# ACTIVE PLUGINS :
<?php 
            $plugins = get_plugins();
            $active_plugins = get_option('active_plugins', array());
            foreach ($plugins as $plugin_path => $plugin) {
                // If the plugin isn't active, don't show it.
                if (!in_array($plugin_path, $active_plugins)) {
                    continue;
                }
                echo $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
            }
            if (is_multisite()) {
                ?>
#  NETWORK ACTIVE PLUGINS:
<?php 
                $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 the plugin isn't active, don't show it.
                    if (!array_key_exists($plugin_base, $active_plugins)) {
                        continue;
                    }
                    $plugin = get_plugin_data($plugin_path);
                    echo $plugin['Name'] . ' :' . $plugin['Version'] . "\n";
                }
            }
            //GET MYSQL VERSION
            global $wpdb;
            $mysql_ver = !empty($wpdb->use_mysqli) && $wpdb->use_mysqli ? @mysqli_get_server_info($wpdb->dbh) : @mysql_get_server_info();
            ?>

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

WordPress Memory Limit:   <?php 
            echo $this->tc_let_to_num(WP_MEMORY_LIMIT) / 1024 . "MB";
            echo "\n";
            ?>
PHP Safe Mode:            <?php 
            echo ini_get('safe_mode') ? "Yes" : "No\n";
            ?>
PHP Memory Limit:         <?php 
            echo ini_get('memory_limit') . "\n";
            ?>
PHP Upload Max Size:      <?php 
            echo ini_get('upload_max_filesize') . "\n";
            ?>
PHP Post Max Size:        <?php 
            echo ini_get('post_max_size') . "\n";
            ?>
PHP Upload Max Filesize:  <?php 
            echo ini_get('upload_max_filesize') . "\n";
//.........这里部分代码省略.........
开发者ID:cumbach,项目名称:ParadataChrisUmbach,代码行数:101,代码来源:class-fire-admin_page.php

示例13: system_status


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

示例14: get_system_info


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

示例15: fes_system_info_page

    function fes_system_info_page()
    {
        global $wpdb, $fes_settings;
        ?>
	<div class="wrap">
		<style>#system-info-textarea { width: 800px; height: 400px; font-family: Menlo, Monaco, monospace; background: none; white-space: pre; overflow: auto; display: block; }
</style>
		<h2><?php 
        _e('EDD Frontend Submissions Debugging Information', 'edd_fes');
        ?>
</h2><br/>
		<form action="<?php 
        echo esc_url(admin_url('edit.php?post_type=download&page=edd-system-info'));
        ?>
" method="post" dir="ltr">
			<textarea readonly="readonly" onclick="this.focus();this.select()" id="system-info-textarea" name="fes-sysinfo" title="<?php 
        _e('To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'edd');
        ?>
">
### Begin EDD Frontend Submissions Debugging Information ###

## Please include this information when posting support requests regarding FES ##

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

Dashboard URL:                 <?php 
        echo get_permalink(EDD_FES()->helper->get_option('fes-vendor-dashboard-page', false)) . "\n";
        ?>
FES Version:                 <?php 
        echo fes_plugin_version . "\n";
        ?>
FES Plugin Name:                 <?php 
        echo fes_plugin_name . "\n";
        ?>
FES File Name:                 <?php 
        echo fes_plugin_file . "\n";
        ?>
FES Plugin Path:                 <?php 
        echo fes_plugin_dir . "\n";
        ?>
FES Plugin Url:                 <?php 
        echo fes_plugin_url . "\n";
        ?>
FES Assets Url:                 <?php 
        echo fes_assets_url . "\n";
        print_r(array_filter($fes_settings));
        $posts = get_posts(array('post_type' => 'fes-forms', 'posts_per_page' => -1));
        foreach ($posts as $post) {
            echo $post->id;
            echo get_the_title($post->id);
            print_r(get_post_meta($post->id, 'fes-form', false));
        }
        ?>

FES TEMPLATES:

<?php 
        // Show templates that have been copied to the theme's fes_templates dir
        $dir = get_stylesheet_directory() . '/fes_templates/*';
        if (!empty($dir)) {
            foreach (glob($dir) as $file) {
                echo "Filename: " . basename($file) . "\n";
            }
        } else {
            echo 'No overrides found';
        }
        ?>

PLUGINS:
<?php 
        $plugins = get_plugins();
        ksort($plugins);
        foreach ($plugins as $plugin_file => $plugin_data) {
            echo $plugin_data['Title'] . "\r\n" . $plugin_data['Version'] . "\r\n";
            if (is_plugin_active($plugin_file)) {
                echo 'Active';
            } else {
                echo 'Inactive';
            }
            echo "\r\n" . $plugin_data['PluginURI'] . "\r\n\r\n";
        }
        if (is_multisite()) {
            ?>

NETWORK ACTIVE PLUGINS:

<?php 
            $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 the plugin isn't active, don't show it.
                if (!array_key_exists($plugin_base, $active_plugins)) {
                    continue;
                }
//.........这里部分代码省略.........
开发者ID:nguyenthai2010,项目名称:ngocshop,代码行数:101,代码来源:class-menu.php


注:本文中的wp_get_active_network_plugins函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。