function pagelines_check_updater($note)
{
    // check for updater...
    $slug = 'pagelines-updater';
    $message = '';
    if (!pl_check_updater_exists()) {
        // need to install...
        $install_url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $slug), 'install-plugin_' . $slug);
        $message = sprintf('<a class="btn btn-mini btn-warning" href="%s" class="icon icon-download"></i> %s</a> %s', esc_url($install_url), __('Install the PageLines Updater plugin', 'pagelines'), __('to activate this site and get updates for your PageLines themes and plugins.', 'pagelines'));
    } else {
        // must be installed..maybe its not active?
        include_once ABSPATH . 'wp-admin/includes/plugin.php';
        if (!is_plugin_active('pagelines-updater/pagelines-updater.php')) {
            $activate_url = 'plugins.php?action=activate&plugin=' . urlencode('pagelines-updater/pagelines-updater.php') . '&plugin_status=all&paged=1&s&_wpnonce=' . urlencode(wp_create_nonce('activate-plugin_pagelines-updater/pagelines-updater.php'));
            $message = '<a href="' . esc_url(self_admin_url($activate_url)) . '">Activate the PageLines Updater plugin</a> to activate your site and get updates for your PageLines themes and plugins.';
        } else {
            if (!pl_is_activated()) {
                $url = 'index.php?page=pagelines_updater';
                $message = '<a href="' . esc_url(self_admin_url($url)) . '">Add your key now</a> to activate this site and get updates for your PageLines themes and plugins.';
            }
        }
    }
    if ($message) {
        ob_start();
        ?>
		<div class="editor-alert alert">		
		  	<p>
			<?php 
        echo $message;
        ?>
			</p>
		</div>
		<?php 
        $note .= ob_get_clean();
    }
    return $note;
}
示例#2
0
 /**
  * Debug tests.
  * @return array Test results.
  */
 function wp_debug_info()
 {
     global $wpdb, $wp_version, $platform_build;
     // Set data & variables first
     $uploads = wp_upload_dir();
     // Get user role
     $current_user = wp_get_current_user();
     $user_roles = $current_user->roles;
     $user_role = array_shift($user_roles);
     // Format data for processing by a template
     $this->debug_info[] = array('title' => 'WordPress Version', 'value' => $wp_version);
     $this->debug_info[] = array('title' => 'WordPress Debug', 'value' => defined('WP_DEBUG') && WP_DEBUG ? 'Enabled' : 'Disabled');
     $this->debug_info[] = array('title' => 'Multisite Enabled', 'value' => is_multisite() ? 'Yes' : 'No');
     $this->debug_info[] = array('title' => 'Current Role', 'value' => $user_role);
     $this->debug_info[] = array('title' => 'Framework Path', 'value' => '<kbd>' . pl_get_template_directory() . '</kbd>');
     $this->debug_info[] = array('title' => 'Framework URI', 'value' => '<kbd>' . pl_get_template_directory_uri() . '</kbd>');
     $this->debug_info[] = array('title' => 'Framework Version', 'value' => PL_CORE_VERSION);
     $this->debug_info[] = array('title' => 'PHP Version', 'value' => floatval(phpversion()));
     $this->debug_info[] = array('title' => 'Child theme', 'value' => get_template_directory() != get_stylesheet_directory() ? 'Yes' : '', 'extra' => get_stylesheet_directory() . '<br />' . get_stylesheet_directory_uri());
     $this->debug_info[] = array('title' => 'PHP Safe Mode', 'value' => (bool) ini_get('safe_mode') ? 'Yes! Deprecated as of PHP 5.3 and removed in PHP 5.4' : '');
     $this->debug_info[] = array('title' => 'PHP Open basedir restriction', 'value' => (bool) ini_get('open_basedir') ? 'Yes! This can cause issues if it is not setup correctly' : '', 'extra' => ini_get('open_basedir'));
     $this->debug_info[] = array('title' => 'PHP Register Globals', 'value' => (bool) ini_get('register_globals') ? 'Yes! Deprecated as of PHP 5.3 and removed in PHP 5.4' : '');
     $this->debug_info[] = array('title' => 'PHP Magic Quotes gpc', 'value' => (bool) ini_get('magic_quotes_gpc') ? 'Yes! Deprecated as of PHP 5.3 and removed in PHP 5.4' : '');
     $this->debug_info[] = array('title' => 'PHP memory', 'value' => intval(ini_get('memory_limit')));
     $this->debug_info[] = array('title' => 'Mysql version', 'value' => version_compare($wpdb->get_var("SELECT VERSION() AS version"), '6') < 0 ? $wpdb->get_var("SELECT VERSION() AS version") : '');
     $this->debug_info[] = array('title' => 'PHP type', 'value' => php_sapi_name());
     $processUser = !function_exists('posix_geteuid') || !function_exists('posix_getpwuid') ? 'posix functions are disabled on this host!' : posix_getpwuid(posix_geteuid());
     if (is_array($processUser)) {
         $processUser = $processUser['name'];
     }
     $this->debug_info[] = array('title' => 'PHP User', 'value' => $processUser);
     $this->debug_info[] = array('title' => 'OS', 'value' => PHP_OS);
     $status = get_option('dms_activation');
     if (pl_is_activated() && isset($status['email'])) {
         $this->debug_info[] = array('title' => 'Licence OK', 'value' => $status['email'], 'extra' => '');
     }
     $this->debug_info[] = array('title' => 'Installed Plugins', 'value' => $this->debug_get_plugins(), 'level' => false);
     if (get_theme_mod('less_last_error')) {
         $this->debug_info[] = array('title' => 'DMS Internal Warning', 'value' => 'Less Subsystem', 'extra' => get_theme_mod('less_last_error'), 'style' => 'color:red;');
     }
 }
示例#3
0
function pagelines_check_dms_plugin($note)
{
    if (pl_is_activated() && !pl_has_dms_plugin() && is_super_admin()) {
        ob_start();
        ?>

			<div class="editor-alert alert">
				
			  	<strong><i class="icon icon-cogs"></i> <?php 
        _e('Install DMS Utilities', 'pagelines');
        ?>
			  	</strong><p><?php 
        _e('Your site is "Pro activated" but we have detected that the DMS Pro Tools plugin is not activated. Grab this plugin if you have not installed it yet on <a href="http://www.pagelines.com/my-account" >PageLines.com &rarr; My-Account</a>.', 'pagelines');
        ?>
			  	</p>

			</div>

			<?php 
        $note .= ob_get_clean();
    }
    return $note;
}
示例#4
0
 /**
  * Debug tests.
  * @return array Test results.
  */
 function wp_debug_info()
 {
     global $wpdb, $wp_version, $platform_build;
     // Set data & variables first
     $uploads = wp_upload_dir();
     // Get user role
     $current_user = wp_get_current_user();
     $user_roles = $current_user->roles;
     $user_role = array_shift($user_roles);
     // Format data for processing by a template
     $this->debug_info[] = array('title' => 'WordPress Version', 'value' => $wp_version);
     $this->debug_info[] = array('title' => 'WordPress Debug', 'value' => defined('WP_DEBUG') && WP_DEBUG ? 'Enabled' : 'Disabled');
     $this->debug_info[] = array('title' => 'Multisite Enabled', 'value' => is_multisite() ? 'Yes' : 'No');
     $this->debug_info[] = array('title' => 'Current Role', 'value' => $user_role);
     $this->debug_info[] = array('title' => 'Framework Path', 'value' => '<kbd>' . pl_get_template_directory() . '</kbd>');
     $this->debug_info[] = array('title' => 'Framework URI', 'value' => '<kbd>' . pl_get_template_directory_uri() . '</kbd>');
     $this->debug_info[] = array('title' => 'Framework Version', 'value' => PL_CORE_VERSION);
     $this->debug_info[] = array('title' => 'PHP Version', 'value' => floatval(phpversion()));
     $this->debug_info[] = array('title' => 'Child theme', 'value' => get_template_directory() != get_stylesheet_directory() ? 'Yes' : '', 'extra' => get_stylesheet_directory() . '<br />' . get_stylesheet_directory_uri());
     $this->debug_info[] = array('title' => 'PHP Safe Mode', 'value' => (bool) ini_get('safe_mode') ? 'Yes! Deprecated as of PHP 5.3 and removed in PHP 5.4' : '');
     $this->debug_info[] = array('title' => 'PHP Open basedir restriction', 'value' => (bool) ini_get('open_basedir') ? 'This can cause issues with uploads if it is not setup correctly' : '', 'extra' => ini_get('open_basedir'));
     $this->debug_info[] = array('title' => 'WP_DEBUG', 'value' => defined('WP_DEBUG') && WP_DEBUG ? 'Yes' : 'No');
     $this->debug_info[] = array('title' => 'WP memory limit', 'value' => size_format($this->let_to_num(WP_MEMORY_LIMIT)));
     $this->debug_info[] = array('title' => 'WP MAX memory limit', 'value' => size_format($this->let_to_num(WP_MAX_MEMORY_LIMIT)));
     $this->debug_info[] = array('title' => 'PHP memory limit', 'value' => size_format($this->let_to_num(ini_get('memory_limit'))));
     $this->debug_info[] = array('title' => 'Mysql version', 'value' => $wpdb->db_version());
     $this->debug_info[] = array('title' => 'WP Max Upload Size', 'value' => size_format(wp_max_upload_size()));
     $this->debug_info[] = array('title' => 'PHP POST Max Size', 'value' => size_format($this->let_to_num(ini_get('post_max_size'))));
     $this->debug_info[] = array('title' => 'PHP Max Execution Time', 'value' => ini_get('max_execution_time') . 's');
     $this->debug_info[] = array('title' => 'PHP type', 'value' => php_sapi_name());
     $this->debug_info[] = array('title' => 'WebServer software', 'value' => esc_html($_SERVER['SERVER_SOFTWARE']));
     $processUser = !function_exists('posix_geteuid') || !function_exists('posix_getpwuid') ? 'Posix functions are disabled on this host. Not necessarily a problem, but if the user needs FTP/SFTP to install plugins/themes then creating CSS files might be an issue.' : posix_getpwuid(posix_geteuid());
     if (is_array($processUser)) {
         $processUser = $processUser['name'];
     }
     $this->debug_info[] = array('title' => 'PHP User', 'value' => $processUser);
     $this->debug_info[] = array('title' => 'OS', 'value' => PHP_OS);
     $status = get_option('dms_activation');
     if (pl_is_activated() && isset($status['email'])) {
         $this->debug_info[] = array('title' => 'Licence OK', 'value' => $status['email'], 'extra' => '');
     }
     $this->debug_info[] = array('title' => 'Installed Plugins', 'value' => $this->debug_get_plugins(), 'level' => false);
     if (get_theme_mod('less_last_error')) {
         $this->debug_info[] = array('title' => 'DMS Internal Warning', 'value' => 'Less Subsystem', 'extra' => get_theme_mod('less_last_error'), 'style' => 'color:red;');
     }
 }