wpsc_identify_advanced_cache()
Identify the advanced cache plugin used
Хуков нет.
Возвращает
Строку. The name of the advanced cache plugin, BOOST, WPSC or OTHER.
Использование
wpsc_identify_advanced_cache();
Код wpsc_identify_advanced_cache() wpsc identify advanced cache WPSCache 3.1.0
function wpsc_identify_advanced_cache() {
global $wpsc_advanced_cache_filename;
if ( ! file_exists( $wpsc_advanced_cache_filename ) ) {
return 'NONE';
}
$contents = file_get_contents( $wpsc_advanced_cache_filename ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
if ( false !== str_contains( $contents, 'Boost Cache Plugin' ) ) {
return 'BOOST';
}
if ( str_contains( $contents, 'WP SUPER CACHE 0.8.9.1' ) || str_contains( $contents, 'WP SUPER CACHE 1.2' ) ) {
return 'WPSC';
}
return 'OTHER';
}