PluginProbe ʕ •ᴥ•ʔ
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.2.16
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.2.16
4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 3.8.0 4.0.0 4.0.1 4.1.0 4.1.1 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.3.1 4.4.0 4.4.1 4.5.0 4.5.1 3.2.2 trunk 0.7.0 1.8.9.10 1.8.9.7 1.8.9.8 1.8.9.9 1.9 1.9.1 2.0.1 2.1.0 2.1.1 2.2.0 2.2.1 2.2.10 2.2.11 2.2.12 2.2.13 2.2.2 2.2.3 2.2.4 2.2.6 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.18 3.0.19 3.0.2 3.0.3 3.0.4 3.0.5 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.2 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.17 3.2.18 3.2.19
wp-optimize / minify / class-wp-optimize-detect-minify-plugins.php
wp-optimize / minify Last commit date
class-wp-optimize-detect-minify-plugins.php 4 years ago class-wp-optimize-minify-admin.php 3 years ago class-wp-optimize-minify-cache-functions.php 3 years ago class-wp-optimize-minify-commands.php 2 years ago class-wp-optimize-minify-config.php 3 years ago class-wp-optimize-minify-fonts.php 3 years ago class-wp-optimize-minify-front-end.php 2 years ago class-wp-optimize-minify-functions.php 3 years ago class-wp-optimize-minify-load-url-task.php 3 years ago class-wp-optimize-minify-preloader.php 3 years ago class-wp-optimize-minify-print.php 2 years ago class-wp-optimize-minify.php 2 years ago
class-wp-optimize-detect-minify-plugins.php
80 lines
1 <?php
2
3 if (!defined('ABSPATH')) die('No direct access allowed');
4
5 class WP_Optimize_Detect_Minify_Plugins {
6
7 /**
8 * Detect list of active most popular WordPress minify plugins.
9 *
10 * @return array
11 */
12 public function get_active_minify_plugins() {
13
14 $active_minify_plugins = array();
15
16 foreach ($this->get_plugins() as $plugin_slug => $plugin_title) {
17 if ($this->is_plugin_active($plugin_slug) && $this->is_minify_active($plugin_slug)) {
18 $active_minify_plugins[$plugin_slug] = $plugin_title;
19 }
20 }
21
22 return $active_minify_plugins;
23 }
24
25 /**
26 * Get the plugins list
27 *
28 * @return array
29 */
30 protected function get_plugins() {
31 return array(
32 'w3-total-cache' => 'W3 Total Cache',
33 'autoptimize' => 'Autoptimize',
34 'fast-velocity-minify' => 'Fast Velocity Minify',
35 );
36 }
37
38 /**
39 * Check if $plugin is active.
40 *
41 * @param string $plugin - plugin slug
42 *
43 * @return bool
44 */
45 private function is_plugin_active($plugin) {
46 $status = WP_Optimize()->get_db_info()->get_plugin_status($plugin);
47
48 return $status['active'];
49 }
50
51 /**
52 * Check if minify feature is active
53 *
54 * @return bool
55 */
56 public function is_minify_active($plugin_slug) {
57 switch ($plugin_slug) {
58 case 'w3-total-cache':
59 return (function_exists('w3tc_config') && w3tc_config()->get_boolean('minify.enabled'));
60 case 'autoptimize':
61 return ('on' == get_option('autoptimize_js', false) || 'on' == get_option('autoptimize_css', false) || 'on' == get_option('autoptimize_html', false));
62 case 'fast-velocity-minify':
63 return true;
64 }
65 }
66
67 /**
68 * Instance of WP_Optimize_Detect_Minify_Plugins.
69 *
70 * @return WP_Optimize_Detect_Minify_Plugins
71 */
72 public static function get_instance() {
73 static $instance = null;
74 if (null === $instance) {
75 $instance = new self();
76 }
77 return $instance;
78 }
79 }
80