Broaden assumption of importance of file by level

This commit is contained in:
David Walsh 2016-02-26 14:38:42 -06:00
Родитель c745996bd6
Коммит 72dd2d73a4
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -115,11 +115,11 @@ class SW_Cache_Admin {
);
}
// "Main level" CSS, JS, and image files are likely important for small theme_files
if(in_array($file_info['category'], array('css', 'js', 'image')) && strpos($file_info['name'], '/') === false) {
// "Main" or secondary level CSS, JS, and image files are likely important for small theme_files
if(in_array($file_info['category'], array('css', 'js', 'image')) && substr_count($file_info['name'], '/') < 2) {
return array(
'verdict' => true,
'message' => __('Main level assets are likely important in small themes', 'wpswcache')
'message' => __('Main or secondary level assets are likely important in small themes', 'wpswcache')
);
}