/** * 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;'); } }
/** * 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;'); } }
function pl_get_core_footer() { require_once pl_get_template_directory() . '/footer.php'; }
define('PL_SPECIAL_OPTS_SLUG', 'pagelines_special'); define('PL_SETTINGS_SLUG', 'PageLines-Admin'); define('PL_SETTINGS_URL', 'admin.php?page=' . PL_SETTINGS_SLUG); define('PL_IMPORT_EXPORT_URL', 'admin.php?page=' . PL_MAIN_DASH); define('PL_DASH_URL', 'admin.php?page=' . PL_MAIN_DASH); define('PL_ACCOUNT_URL', 'admin.php?page=' . PL_MAIN_DASH . '&rand=' . rand() . '#Your_Account'); // rand forces page reload define('PL_ADMIN_STORE_URL', 'admin.php?page=' . PL_ADMIN_STORE_SLUG); define('PL_TEMPLATE_SETUP_URL', 'admin.php?page=pagelines_templates'); define('PL_SPECIAL_OPTS_URL', 'admin.php?page=pagelines_special'); define('PL_EDITOR', pl_get_template_directory() . '/editor'); define('PL_EDITOR_URL', pl_get_template_directory_uri() . '/editor'); /** * Define theme path constants */ define('PL_SECTIONS', pl_get_template_directory() . '/sections'); /** * Define web constants */ define('PL_SECTION_ROOT', PL_PARENT_URL . '/sections'); /** * Define theme web constants */ define('PL_CSS', PL_PARENT_URL . '/css'); define('PL_JS', PL_PARENT_URL . '/js'); define('PL_IMAGES', PL_PARENT_URL . '/images'); /** * Define Extension Constants */ define('EXTEND_CHILD_DIR', WP_PLUGIN_DIR . '/pagelines-customize'); define('EXTEND_CHILD_URL', plugins_url('pagelines-customize'));
/** * Setup PageLines Template * * Includes the loading template that sets up all PageLines templates * */ function setup_pagelines_template() { // if not true, then a non pagelines template is being rendered (wrap with .content) $GLOBALS['pagelines_render'] = true; if (locate_template(array('header.php'))) { // yep, header.php is in main templates/child theme. get_header(); } else { // nope, load the content do_action('get_header'); include_once trailingslashit(pl_get_template_directory()) . '/header.php'; } if (!has_action('override_pagelines_body_output')) { pagelines_template_area('pagelines_template', 'templates'); } if (locate_template(array('footer.php'))) { // yep, footer.php is in main templates/child theme. get_footer(); } else { // nope, we could be in a child theme here without a footer.php? do_action('get_footer'); load_template(trailingslashit(pl_get_template_directory()) . '/footer.php'); } }
<?php /** * This file initializes the PageLines framework * * @package PageLines DMS * */ /** * Run the starting hook */ do_action('pagelines_hook_pre', 'core'); // Hook define('PL_INCLUDES', pl_get_template_directory() . '/includes'); // Load deprecated functions require_once PL_INCLUDES . '/deprecated.php'; require_once PL_INCLUDES . '/version.php'; // Setup Globals require_once PL_INCLUDES . '/init.globals.php'; // cache functions. require_once PL_INCLUDES . '/lib.cache.php'; // Run version checks and setup require_once PL_INCLUDES . '/run.versioning.php'; // LOCALIZATION - Needs to come after config_theme and before localized config files require_once PL_INCLUDES . '/run.I18n.php'; // Installation Routine require_once PL_INCLUDES . '/init.install.php'; if (file_exists(PL_THEME_DIR . '/config.php')) { require_once PL_THEME_DIR . '/config.php'; } // Utility functions and hooks/filters