$caching_plugin_list = array('wp-super-cache/wp-cache.php' => array('name' => 'WP super cache', 'status' => 'green'), 'w3-total-cache/w3-total-cache.php' => array('name' => 'W3 total cache (we recommend WP super cache)', 'status' => 'yellow'), 'wp-fastest-cache/wpFastestCache.php' => array('name' => 'WP Fastest Cache (we recommend WP super cache)', 'status' => 'yellow')); $active_plugins = get_option('active_plugins'); $caching_plugin = 'No caching plugin detected'; $caching_plugin_status = 'yellow'; foreach ($active_plugins as $active_plugin) { if (isset($caching_plugin_list[$active_plugin])) { $caching_plugin = $caching_plugin_list[$active_plugin]['name']; $caching_plugin_status = $caching_plugin_list[$active_plugin]['status']; break; } } td_system_status::add('WordPress and plugins', array('check_name' => 'Caching plugin', 'tooltip' => '', 'value' => $caching_plugin, 'status' => $caching_plugin_status)); td_system_status::render_tables(); // social counter cache $cache_content = get_option('td_social_api_v3_last_val', ''); td_system_status::render_social_cache($cache_content); ?> </div> <?php class td_system_status { static $system_status = array(); static function add($section, $status_array) {
function td_set_mobile_theme_settings() { $show_mobile_theme_status = true; $jetpack_mobile_version_is_active = false; $w3_total_cache_is_active = false; $td_mobile_theme_tooltip = ''; $td_mobile_theme_value = ''; $td_mobile_theme_status = ''; if (is_plugin_active('jetpack/jetpack.php')) { global $wp_filter; if (array_key_exists('setup_theme', $wp_filter)) { foreach ($wp_filter['setup_theme'] as $setup_theme_settings) { if (array_key_exists('jetpack_mobile_theme_setup', $setup_theme_settings)) { $jetpack_mobile_version_is_active = true; break; } } } } if (is_plugin_active('w3-total-cache/w3-total-cache.php')) { $w3_total_cache_is_active = true; } if (true === td_is_td_mobile_plugin_active()) { $td_mobile_theme_tooltip = 'The mobile version of the ' . TD_THEME_NAME; $td_mobile_theme_value = TD_THEME_NAME . ' mobile version'; $td_mobile_theme_status = 'green'; if (true === $jetpack_mobile_version_is_active) { $td_mobile_theme_tooltip = 'The mobile version of the ' . TD_THEME_NAME . ' can\'t be seen because the Jetpack mobile theme is still active. Please deactivate it'; $td_mobile_theme_value = 'Jetpack mobile version'; $td_mobile_theme_status = 'red'; } else { if (true === $w3_total_cache_is_active) { $td_mobile_theme_tooltip = 'The mobile version of the ' . TD_THEME_NAME . ' isn\'t compatible with the W3 Total Cache plugin. Use instead the WP Super Cache plugin'; $td_mobile_theme_status = 'red'; } } } else { if (true === $jetpack_mobile_version_is_active) { $td_mobile_theme_tooltip = 'Jetpack mobile theme is not fully compatible with ' . TD_THEME_NAME . '. For best results, activate the TAGDIV mobile plugin and use the ' . TD_THEME_NAME . ' mobile version'; $td_mobile_theme_value = 'Jetpack mobile version'; $td_mobile_theme_status = 'yellow'; } else { // we do not display any status information $show_mobile_theme_status = false; } } if (true === $show_mobile_theme_status) { td_system_status::add('Theme config', array('check_name' => 'Theme Mobile', 'tooltip' => $td_mobile_theme_tooltip, 'value' => $td_mobile_theme_value, 'status' => $td_mobile_theme_status)); } }