function recommendations() { $themes = Util_Theme::get_themes_by_key(); $current_theme = Util_Theme::get_current_theme_name(); $current_theme_key = array_search($current_theme, $themes); $theme_key = Util_Request::get_string('theme_key', $current_theme_key); $theme_name = isset($themes[$theme_key]) ? $themes[$theme_key] : $current_theme; $templates = Util_Theme::get_theme_templates($theme_name); $recommendations = $this->get_theme_recommendations($theme_name); list($js_groups, $css_groups) = $recommendations; $minify_js_groups = $this->_config->get_array('minify.js.groups'); $minify_css_groups = $this->_config->get_array('minify.css.groups'); $checked_js = array(); $checked_css = array(); $locations_js = array(); if (isset($minify_js_groups[$theme_key])) { foreach ((array) $minify_js_groups[$theme_key] as $template => $locations) { foreach ((array) $locations as $location => $config) { if (isset($config['files'])) { foreach ((array) $config['files'] as $file) { if (!isset($js_groups[$template]) || !in_array($file, $js_groups[$template])) { $js_groups[$template][] = $file; } $checked_js[$template][$file] = true; $locations_js[$template][$file] = $location; } } } } } if (isset($minify_css_groups[$theme_key])) { foreach ((array) $minify_css_groups[$theme_key] as $template => $locations) { foreach ((array) $locations as $location => $config) { if (isset($config['files'])) { foreach ((array) $config['files'] as $file) { if (!isset($css_groups[$template]) || !in_array($file, $css_groups[$template])) { $css_groups[$template][] = $file; } $checked_css[$template][$file] = true; } } } } } include W3TC_INC_DIR . '/lightbox/minify_recommendations.php'; }