";
//main tab
if($pmsm_tab == 'main') {
//title bar
echo "
";
echo "
" . __('Script Manager', 'perfmatters') . " ";
echo "
" . __('Manage scripts loading on the current page.', 'perfmatters') . "
";
echo "
";
//load master array
global $master_array;
$master_array = perfmatters_script_manager_load_master_array();
//print scripts
foreach($master_array['resources'] as $category => $groups) {
echo '
';
if(!empty($groups)) {
echo "
" . $category . " ";
if($category != "misc") {
echo "
";
foreach($groups as $group => $details) {
echo "
";
echo "
";
echo "
" . (!empty($details['name']) ? $details['name'] : "") . " ";
//Status
echo "
";
if(!empty($details['size'])) {
echo "" . __('Total size', 'perfmatters') . ": " . round($details['size'] / 1024, 1) . " KB ";
}
perfmatters_script_manager_print_status($category, $group);
echo "
";
echo "
";
$assets = !empty($details['assets']) ? $details['assets'] : false;
perfmatters_script_manager_print_section($category, $group, $assets);
echo "
";
}
echo "
";
}
else {
if(!empty($groups['assets'])) {
perfmatters_script_manager_print_section($category, $category, $groups['assets']);
}
}
}
echo '
';
}
//loading wrapper
echo "
";
if(function_exists('is_amp_endpoint') && is_amp_endpoint()) {
echo "" . __('The Script Manager does not support AMP pages.', 'perfmatters') . " ";
}
else {
echo "" . __('Loading Scripts', 'perfmatters') . " ";
}
echo "
";
}
//global view tab
elseif($pmsm_tab == 'global') {
include('script_manager_global.php');
}
//settings tab
elseif($pmsm_tab == 'settings') {
//title bar
echo "
";
echo "
" . __('Settings', 'perfmatters') . " ";
echo "
" . __('View and manage all of your Script Manager settings.', 'perfmatters') . "
";
echo "
";
//settings container
echo "
";
echo "
";
echo "
";
echo "";
echo "";
echo "" . perfmatters_title(__('Display Archives', 'perfmatters'), 'separate_archives') . " ";
echo "";
$args = array(
'id' => 'separate_archives',
'option' => 'perfmatters_script_manager_settings'
);
perfmatters_print_input($args);
echo "" . __('Add WordPress archives to your Script Manager selection options. Archive posts will no longer be grouped with their post type.', 'perfmatters') . "
";
echo " ";
echo " ";
echo "";
echo "" . perfmatters_title(__('Display Dependencies', 'perfmatters'), 'separate_archives') . " ";
echo "";
$args = array(
'id' => 'dependencies',
'option' => 'perfmatters_script_manager_settings'
);
perfmatters_print_input($args);
echo "" . __('Show dependencies for each script.', 'perfmatters') . "
";
echo " ";
echo " ";
echo "";
echo "" . perfmatters_title(__('Testing Mode', 'perfmatters'), 'testing_mode') . " ";
echo "";
$args = array(
'id' => 'testing_mode',
'option' => 'perfmatters_script_manager_settings'
);
perfmatters_print_input($args);
echo "";
echo " ";
echo " ";
echo "";
echo "" . perfmatters_title(__('MU Mode', 'perfmatters'), 'mu_mode') . " ";
echo "";
$args = array(
'id' => 'mu_mode',
'option' => 'perfmatters_script_manager_settings'
);
perfmatters_print_input($args);
echo "" . __('Must-use (MU) mode requires elevated permissions and a file to be copied into the mu-plugins directory. This gives you more control and the ability to disable plugin queries, inline CSS, etc.', 'perfmatters') . '
' . __('View Documentation', 'perfmatters') . ' ' . "
";
echo "" . __('Warning', 'perfmatters') . ": " . __('Any previous plugin-level disables will now disable the entire plugin. Please review your existing Script Manager configuration before enabling this option.', 'perfmatters') . "
";
//mu plugin file check
if(!empty($perfmatters_script_manager_settings['mu_mode'])) {
if(file_exists(WPMU_PLUGIN_DIR . "/perfmatters_mu.php")) {
//$mu_plugins = get_mu_plugins();
if(!function_exists('get_plugin_data')) {
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
}
//get plugin data
$mu_plugin_data = get_plugin_data(WPMU_PLUGIN_DIR . "/perfmatters_mu.php");
if(empty($mu_plugin_data['Version']) || !defined('PERFMATTERS_VERSION') || ($mu_plugin_data['Version'] != PERFMATTERS_VERSION)) {
$mu_message = __("MU plugin version mismatch.", 'perfmatters');
$mu_class = "pmsm-mu-mismatch";
}
else {
$mu_message = __("MU plugin installed.", 'perfmatters');
$mu_class = "pmsm-mu-found";
}
}
else {
$mu_message = __("MU plugin file not found.", 'perfmatters');
$mu_class = "pmsm-mu-missing";
}
echo "" . $mu_message . "
";
}
echo " ";
echo " ";
echo "";
echo "" . perfmatters_title(__('Hide Disclaimer', 'perfmatters'), 'hide_disclaimer') . " ";
echo "";
$args = array(
'id' => 'hide_disclaimer',
'option' => 'perfmatters_script_manager_settings'
);
perfmatters_print_input($args);
echo "" . __('Hide the disclaimer message box across all Script Manager views.', 'perfmatters') . "
";
echo " ";
echo " ";
echo "";
echo "" . perfmatters_title(__('Reset Script Manager', 'perfmatters'), 'reset_script_manager') . " ";
echo "";
//Reset Form
echo "";
echo " ";
echo "
";
echo "";
echo "" . __('Remove and reset all of your existing Script Manager settings.', 'perfmatters') . " ";
echo "
";
echo " ";
echo " ";
echo " ";
echo "
";
//Nonce
wp_nonce_field('perfmatter_script_manager_save_settings', 'perfmatters_script_manager_settings_nonce');
echo "
";
}
echo "
";
//toolbar
echo "