/** * 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 get_coreurl($atts) { return pl_get_template_directory_uri(); }
define('PL_ADMIN_IMAGES', PL_ADMIN_URI . '/images'); define('PL_ADMIN_ICONS', PL_ADMIN_IMAGES . '/icons'); define('PL_MAIN_DASH', 'PageLines-Admin'); define('PL_ADMIN_STORE_SLUG', 'pagelines_extend'); 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'); /**
function json_blob() { ob_start(); ?> <script> !function ($) { $.pl = { data: { list: <?php echo json_encode(pl_arrays_to_objects($this->sections_data)); ?> , local: <?php echo json_encode(pl_arrays_to_objects($this->current_page_data('local'))); ?> , type: <?php echo json_encode(pl_arrays_to_objects($this->current_page_data('type'))); ?> , global: <?php echo json_encode(pl_arrays_to_objects($this->current_page_data('global'))); ?> } , flags: { refreshOnSave: false , savingDialog: 'Saving' , refreshingDialog: 'Success! Reloading page' , layoutMode: '<?php echo $this->layout->get_layout_mode(); ?> ' , saving: false } , lang: function( args ){ var gt = new Gettext() return gt.gettext( args ) } , config: { userID: '<?php echo $this->get_user_id(); ?> ' , currentURL: '<?php echo $this->current_url(); ?> ' , siteURL: '<?php echo site_url(); ?> ' , nonce: '<?php echo wp_create_nonce("tgmpa-install"); ?> ' , pageTemplate: '<?php echo $this->page->template; ?> ' , templateMode: '<?php echo $this->page->template_mode(); ?> ' , pageID: '<?php echo $this->page->id; ?> ' , typeID: '<?php echo $this->page->typeid; ?> ' , pageTypeID: '<?php echo $this->page->type; ?> ' , pageTypeName: '<?php echo $this->page->type_name; ?> ' , devMode: <?php echo $this->get_dev_mode(); ?> , CacheKey: '<?php echo pl_get_cache_key(); ?> ' , isSpecial: '<?php echo $this->page->is_special(); ?> ' , isPro: <?php echo pl_is_wporg() ? "false\n" : "true\n"; ?> , opts: <?php echo json_encode(pl_arrays_to_objects($this->get_options_config())); ?> , settings: <?php echo json_encode(pl_arrays_to_objects($this->siteset->get_set('site'))); ?> , panels: <?php echo json_encode(pl_arrays_to_objects($this->get_panels_settings())); ?> , fonts: <?php echo json_encode(pl_arrays_to_objects($this->foundry->get_foundry())); ?> , menus: <?php echo json_encode(pl_arrays_to_objects($this->get_wp_menus())); ?> , extensions: <?php echo json_encode(pl_arrays_to_objects($this->extensions->get_list())); ?> , icons: <?php echo json_encode(pl_arrays_to_objects(pl_icon_array())); ?> , btns: <?php echo json_encode(pl_arrays_to_objects(pl_button_classes())); ?> , themes: <?php echo json_encode(pl_arrays_to_objects(pl_theme_classes())); ?> , imgSizes: <?php echo json_encode(pl_arrays_to_objects(pl_get_image_sizes())); ?> , animations: <?php echo json_encode(pl_arrays_to_objects(pl_animation_array())); ?> , taxes: <?php echo json_encode(pl_arrays_to_objects(pl_get_all_taxonomies())); ?> , urls: { adminURL: '<?php echo admin_url(); ?> ' , editPost: '<?php echo $this->edit_post_link(); ?> ' , menus: '<?php echo admin_url("nav-menus.php"); ?> ' , widgets: '<?php echo $this->edit_post_link(); ?> ' , CoreURL: '<?php echo pl_get_template_directory_uri(); ?> ' , ParentStyleSheetURL: '<?php echo get_template_directory_uri(); ?> ' , ChildStyleSheetURL: '<?php echo get_stylesheet_directory_uri(); ?> ' , siteURL: '<?php echo home_url(); ?> ' , mediaLibrary: '<?php echo pl_media_library_link(); ?> ' , mediaLibrary: '<?php echo pl_media_library_link(); ?> ' , mediaLibraryVideo: '<?php echo pl_media_library_link("video"); ?> ' , addMedia: '<?php echo admin_url("media-new.php"); ?> ' } <?php echo $this->json_blob_objects(); ?> } } }(window.jQuery); </script> <?php if (defined('PL_DEV') && PL_DEV) { pl_add_perform_data(ob_get_length(), __('Data Length', 'pagelines'), __('Characters', 'pagelines'), __('The total number of characters in the data blob. Watching size can be good to detect data leaks or other strange behavior.', 'pagelines')); } echo apply_filters('pl_data_blob', ob_get_clean()); }
function template($atts, $content) { return pl_get_template_directory_uri() . '/ui/images/'; }