Media Cleaner - Version 5.5.4

Version Description

  • Update: Creates the DB tables automatically.
  • Add: Support for Revolution Slider.
  • Add: Support for WP Residence.
  • Add: Support for Avia Framework.
Download this release

Release Info

Developer TigrouMeow
Plugin Icon 128x128 Media Cleaner
Version 5.5.4
Comparing to
See all releases

Code changes from version 5.5.3 to 5.5.4

Files changed (6) hide show
  1. common/admin.php +8 -8
  2. core.php +2 -2
  3. engine.php +3 -12
  4. media-cleaner.php +2 -2
  5. readme.txt +10 -3
  6. views/menu-screen.php +26 -7
common/admin.php CHANGED
@@ -202,8 +202,8 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
202
  if ( !isset( $submenu[ 'meowapps-main-menu' ] ) ) {
203
  add_menu_page( 'Meow Apps', '<img alt="Meow Apps" style="width: 24px; margin-left: -30px; position: absolute; margin-top: -3px;" src="' . MeowApps_Admin::$logo . '" />Meow Apps', 'manage_options', 'meowapps-main-menu',
204
  array( $this, 'admin_meow_apps' ), '', 82 );
205
- add_submenu_page( 'meowapps-main-menu', __( 'Dashboard', 'meowapps' ),
206
- __( 'Dashboard', 'meowapps' ), 'manage_options',
207
  'meowapps-main-menu', array( $this, 'admin_meow_apps' ) );
208
  }
209
 
@@ -226,7 +226,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
226
  $value = get_option( 'meowapps_hide_ads', null );
227
  $html = '<input type="checkbox" id="meowapps_hide_ads" name="meowapps_hide_ads" value="1" ' .
228
  checked( 1, get_option( 'meowapps_hide_ads' ), false ) . '/>';
229
- $html .= __( '<label>Hide</label><br /><small>Doesn\'t display the ads.</small>', 'meowapps' );
230
  echo $html;
231
  }
232
 
@@ -234,7 +234,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
234
  $value = get_option( 'meowapps_hide_meowapps', null );
235
  $html = '<input type="checkbox" id="meowapps_hide_meowapps" name="meowapps_hide_meowapps" value="1" ' .
236
  checked( 1, get_option( 'meowapps_hide_meowapps' ), false ) . '/>';
237
- $html .= __( '<label>Hide <b>Meow Apps</b> Menu</label><br /><small>Hide Meow Apps menu and all its components, for a cleaner admin. This option will be reset if a new Meow Apps plugin is installed. <b>Once activated, an option will be added in your General settings to display it again.</b></small>', 'meowapps' );
238
  echo $html;
239
  }
240
 
@@ -242,7 +242,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
242
  $value = get_option( 'force_sslverify', null );
243
  $html = '<input type="checkbox" id="force_sslverify" name="force_sslverify" value="1" ' .
244
  checked( 1, get_option( 'force_sslverify' ), false ) . '/>';
245
- $html .= __( '<label>Force</label><br /><small>Updates and licenses checks are usually made without checking SSL certificates and it is actually fine this way. But if you are intransigent when it comes to SSL matters, this option will force it.</small>', 'meowapps' );
246
  echo $html;
247
  }
248
 
@@ -360,7 +360,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
360
  ?>
361
  <?php $this->display_title( 'Meow Apps' ); ?>
362
  <p>
363
- <?php _e( 'Meow Apps is run by Jordy Meow, a photographer and software developer living in Japan (and taking <a target="_blank" href="http://offbeatjapan.org">a lot of photos</a>). Meow Apps is a suite of plugins focusing on photography, imaging, optimization and it teams up with the best players in the community (other themes and plugins developers). For more information, please check <a href="http://meowapps.com" target="_blank">Meow Apps</a>.', 'meowapps' )
364
  ?>
365
  </p>
366
 
@@ -407,7 +407,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
407
 
408
  <h2>WordPress Performance & Recommendations</h2>
409
  <div style="background: white; padding: 5px 15px 5px 15px; box-shadow: 2px 2px 1px rgba(0,0,0,.02); margin-bottom: 15px;">
410
- <p><?php _e( 'The <b>Empty Request Time</b> helps you analyzing the raw performance of your install by giving you the average time it takes to run an empty request to your server. You can try to disable some plugins (or change their options) then and click on Reset to see how it influences the results. With <b>File Operation Time</b>, you will find out if your server is slow with files. An excellent install would have an Empty Request Time of less than 500 ms. Keep it absolutely under 2,000 ms. File Operation Time should take only a few milliseconds more than the Empty Request Time. For more information about this, <a href="https://meowapps.com/clean-optimize-wordpress/#Optimize_your_Empty_Request_Time" target="_blank">click here</a>.', 'meowapps' ); ?></p>
411
  </div>
412
 
413
  <div style="float: left; margin-right: 10px; text-align: center; padding: 10px; background: white; width: 200px; border: 1px solid #e2e2e2;">
@@ -489,7 +489,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
489
 
490
  <div style="background: white; padding: 5px 15px 5px 15px; box-shadow: 2px 2px 1px rgba(0,0,0,.02); margin-top: 15px;">
491
  <p>
492
- <?php _e( 'Too many WordPress installs are blown-up with useless and/or huge plugins, and bad practices. But that is because most users are overwhelmed by the diversity and immensity of the WordPress jungle. One rule of thumb is to keep your install the simplest as possible, with the least number of plugins (avoiding heavy ones too) and a good hosting service (avoid VPS except if you know exactly what you are doing). Articles are kept being updated on the Meow Apps website, with all the latest recommendations: ', 'meowapps' )?>
493
  <a href='https://meowapps.com/debugging-wordpress/' target='_blank'>
494
  How To Debug</a>,
495
  <a href='https://meowapps.com/seo-optimization/' target='_blank'>
202
  if ( !isset( $submenu[ 'meowapps-main-menu' ] ) ) {
203
  add_menu_page( 'Meow Apps', '<img alt="Meow Apps" style="width: 24px; margin-left: -30px; position: absolute; margin-top: -3px;" src="' . MeowApps_Admin::$logo . '" />Meow Apps', 'manage_options', 'meowapps-main-menu',
204
  array( $this, 'admin_meow_apps' ), '', 82 );
205
+ add_submenu_page( 'meowapps-main-menu', __( 'Dashboard', $this->domain ),
206
+ __( 'Dashboard', $this->domain ), 'manage_options',
207
  'meowapps-main-menu', array( $this, 'admin_meow_apps' ) );
208
  }
209
 
226
  $value = get_option( 'meowapps_hide_ads', null );
227
  $html = '<input type="checkbox" id="meowapps_hide_ads" name="meowapps_hide_ads" value="1" ' .
228
  checked( 1, get_option( 'meowapps_hide_ads' ), false ) . '/>';
229
+ $html .= __( '<label>Hide</label><br /><small>Doesn\'t display the ads.</small>', $this->domain );
230
  echo $html;
231
  }
232
 
234
  $value = get_option( 'meowapps_hide_meowapps', null );
235
  $html = '<input type="checkbox" id="meowapps_hide_meowapps" name="meowapps_hide_meowapps" value="1" ' .
236
  checked( 1, get_option( 'meowapps_hide_meowapps' ), false ) . '/>';
237
+ $html .= __( '<label>Hide <b>Meow Apps</b> Menu</label><br /><small>Hide Meow Apps menu and all its components, for a cleaner admin. This option will be reset if a new Meow Apps plugin is installed. <b>Once activated, an option will be added in your General settings to display it again.</b></small>', $this->domain );
238
  echo $html;
239
  }
240
 
242
  $value = get_option( 'force_sslverify', null );
243
  $html = '<input type="checkbox" id="force_sslverify" name="force_sslverify" value="1" ' .
244
  checked( 1, get_option( 'force_sslverify' ), false ) . '/>';
245
+ $html .= __( '<label>Force</label><br /><small>Updates and licenses checks are usually made without checking SSL certificates and it is actually fine this way. But if you are intransigent when it comes to SSL matters, this option will force it.</small>', $this->domain );
246
  echo $html;
247
  }
248
 
360
  ?>
361
  <?php $this->display_title( 'Meow Apps' ); ?>
362
  <p>
363
+ <?php _e( 'Meow Apps is run by Jordy Meow, a photographer and software developer living in Japan (and taking <a target="_blank" href="http://offbeatjapan.org">a lot of photos</a>). Meow Apps is a suite of plugins focusing on photography, imaging, optimization and it teams up with the best players in the community (other themes and plugins developers). For more information, please check <a href="http://meowapps.com" target="_blank">Meow Apps</a>.', $this->domain )
364
  ?>
365
  </p>
366
 
407
 
408
  <h2>WordPress Performance & Recommendations</h2>
409
  <div style="background: white; padding: 5px 15px 5px 15px; box-shadow: 2px 2px 1px rgba(0,0,0,.02); margin-bottom: 15px;">
410
+ <p><?php _e( 'The <b>Empty Request Time</b> helps you analyzing the raw performance of your install by giving you the average time it takes to run an empty request to your server. You can try to disable some plugins (or change their options) then and click on Reset to see how it influences the results. With <b>File Operation Time</b>, you will find out if your server is slow with files. An excellent install would have an Empty Request Time of less than 500 ms. Keep it absolutely under 2,000 ms. File Operation Time should take only a few milliseconds more than the Empty Request Time. For more information about this, <a href="https://meowapps.com/clean-optimize-wordpress/#Optimize_your_Empty_Request_Time" target="_blank">click here</a>.', $this->domain ); ?></p>
411
  </div>
412
 
413
  <div style="float: left; margin-right: 10px; text-align: center; padding: 10px; background: white; width: 200px; border: 1px solid #e2e2e2;">
489
 
490
  <div style="background: white; padding: 5px 15px 5px 15px; box-shadow: 2px 2px 1px rgba(0,0,0,.02); margin-top: 15px;">
491
  <p>
492
+ <?php _e( 'Too many WordPress installs are blown-up with useless and/or huge plugins, and bad practices. But that is because most users are overwhelmed by the diversity and immensity of the WordPress jungle. One rule of thumb is to keep your install the simplest as possible, with the least number of plugins (avoiding heavy ones too) and a good hosting service (avoid VPS except if you know exactly what you are doing). Articles are kept being updated on the Meow Apps website, with all the latest recommendations: ', $this->domain )?>
493
  <a href='https://meowapps.com/debugging-wordpress/' target='_blank'>
494
  How To Debug</a>,
495
  <a href='https://meowapps.com/seo-optimization/' target='_blank'>
core.php CHANGED
@@ -199,13 +199,13 @@ class Meow_WPMC_Core {
199
  if ( $iframe_html !== false ) {
200
  // Scan for links in the iframe
201
  $iframe_urls = $this->get_urls_from_html( $iframe_html ); // Recursion
202
- if ( !empty( $iframe_urls ) ) {
203
  $results = array_merge( $results, $iframe_urls );
204
  }
205
  }
206
  }
207
  else {
208
- //$err = 'ERROR: Failed to load iframe: ' . $iframe_src;
209
  //error_log( $err );
210
  $this->log( $err );
211
  }
199
  if ( $iframe_html !== false ) {
200
  // Scan for links in the iframe
201
  $iframe_urls = $this->get_urls_from_html( $iframe_html ); // Recursion
202
+ if ( !empty( $iframe_urls ) ) {
203
  $results = array_merge( $results, $iframe_urls );
204
  }
205
  }
206
  }
207
  else {
208
+ $err = 'ERROR: Failed to load iframe: ' . $iframe_src;
209
  //error_log( $err );
210
  $this->log( $err );
211
  }
engine.php CHANGED
@@ -39,18 +39,9 @@ class Meow_WPMC_Engine {
39
  // Maybe we could avoid to check more post_types.
40
  // SELECT post_type, COUNT(*) FROM `wp_posts` GROUP BY post_type
41
  $posts = $wpdb->get_col( $wpdb->prepare( "SELECT p.ID FROM $wpdb->posts p
42
- WHERE p.post_status != 'inherit'
43
- AND p.post_status != 'trash'
44
- AND p.post_status != 'auto-draft'
45
- AND p.post_type != 'attachment'
46
- AND p.post_type != 'shop_order'
47
- AND p.post_type != 'shop_order_refund'
48
- AND p.post_type != 'nav_menu_item'
49
- AND p.post_type != 'revision'
50
- AND p.post_type != 'auto-draft'
51
- AND p.post_type != 'wphb_minify_group'
52
- AND p.post_type != 'customize_changeset'
53
- AND p.post_type != 'oembed_cache'
54
  AND p.post_type NOT LIKE 'ml-slide%'
55
  AND p.post_type NOT LIKE '%acf-%'
56
  AND p.post_type NOT LIKE '%edd_%'
39
  // Maybe we could avoid to check more post_types.
40
  // SELECT post_type, COUNT(*) FROM `wp_posts` GROUP BY post_type
41
  $posts = $wpdb->get_col( $wpdb->prepare( "SELECT p.ID FROM $wpdb->posts p
42
+ WHERE p.post_status NOT IN ('inherit', 'trash', 'auto-draft')
43
+ AND p.post_type NOT IN ('attachment', 'shop_order', 'shop_order_refund', 'nav_menu_item', 'revision', 'auto-draft', 'wphb_minify_group', 'customize_changeset', 'oembed_cache', 'nf_sub')
44
+ AND p.post_type NOT LIKE 'dlssus_%'
 
 
 
 
 
 
 
 
 
45
  AND p.post_type NOT LIKE 'ml-slide%'
46
  AND p.post_type NOT LIKE '%acf-%'
47
  AND p.post_type NOT LIKE '%edd_%'
media-cleaner.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Media Cleaner
4
  Plugin URI: https://meowapps.com
5
  Description: Clean your Media Library, many options, trash system.
6
- Version: 5.5.3
7
  Author: Jordy Meow
8
  Author URI: https://meowapps.com
9
  Text Domain: media-cleaner
@@ -25,7 +25,7 @@ if ( is_admin() ) {
25
 
26
  global $wpmc_version;
27
  global $wpmc;
28
- $wpmc_version = '5.5.3';
29
 
30
  require __DIR__ . '/admin.php';
31
  require __DIR__ . '/core.php';
3
  Plugin Name: Media Cleaner
4
  Plugin URI: https://meowapps.com
5
  Description: Clean your Media Library, many options, trash system.
6
+ Version: 5.5.4
7
  Author: Jordy Meow
8
  Author URI: https://meowapps.com
9
  Text Domain: media-cleaner
25
 
26
  global $wpmc_version;
27
  global $wpmc;
28
+ $wpmc_version = '5.5.4';
29
 
30
  require __DIR__ . '/admin.php';
31
  require __DIR__ . '/core.php';
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://commerce.coinbase.com/checkout/d047546a-77a8-41c8-9ea9-4a95
5
  Requires at least: 4.8
6
  Tested up to: 5.3
7
  Requires PHP: 7.0
8
- Stable tag: 5.5.3
9
 
10
  Clean your WordPress from unused or broken media and files. It has its own trash system and recovery features. Please read the description.
11
 
@@ -44,8 +44,9 @@ With the Filesystem Analysis, [Media Cleaner Pro](https://meowapps.com/plugin/me
44
  - Beaver Builder
45
  - Brizy Builder
46
  - Oxygen Builder
47
- - WCFM MarketPlace
48
- - And more (Theme X, ZipList Recipe, UberMenu...)
 
49
 
50
  The Live Site option will analyze the online version of your website, which might enhance the accuracy of the Cleaner in edge-cases.
51
 
@@ -73,6 +74,12 @@ Better to be safe than sorry. This plugin deletes files! Therefore, backup is no
73
 
74
  == Changelog ==
75
 
 
 
 
 
 
 
76
  = 5.5.3 =
77
  * Add: Check the IDs of the standard galleries.
78
  * Add: Support for the ACF groups.
5
  Requires at least: 4.8
6
  Tested up to: 5.3
7
  Requires PHP: 7.0
8
+ Stable tag: 5.5.4
9
 
10
  Clean your WordPress from unused or broken media and files. It has its own trash system and recovery features. Please read the description.
11
 
44
  - Beaver Builder
45
  - Brizy Builder
46
  - Oxygen Builder
47
+ - Slider Revolution
48
+ - Avia Framework
49
+ - And more (Theme X, ZipList Recipe, WP Residence, WCFM MarketPlace, UberMenu...)
50
 
51
  The Live Site option will analyze the online version of your website, which might enhance the accuracy of the Cleaner in edge-cases.
52
 
74
 
75
  == Changelog ==
76
 
77
+ = 5.5.4 =
78
+ * Update: Creates the DB tables automatically.
79
+ * Add: Support for Revolution Slider.
80
+ * Add: Support for WP Residence.
81
+ * Add: Support for Avia Framework.
82
+
83
  = 5.5.3 =
84
  * Add: Check the IDs of the standard galleries.
85
  * Add: Support for the ACF groups.
views/menu-screen.php CHANGED
@@ -129,8 +129,18 @@
129
  $method = "";
130
  $table_scan = $wpdb->prefix . "mclean_scan";
131
  $table_refs = $wpdb->prefix . "mclean_refs";
132
- if ( strtolower( $wpdb->get_var( "SHOW TABLES LIKE '$table_scan'" ) ) != strtolower( $table_scan ) ||
133
- strtolower( $wpdb->get_var( "SHOW TABLES LIKE '$table_refs'" ) ) != strtolower( $table_refs ) ) {
 
 
 
 
 
 
 
 
 
 
134
  _e( "<div class='notice notice-error'><p><b>The database is not ready for Media Cleaner. The scan will not work.</b> Click on the <b>Reset</b> button, it re-creates the tables required by Media Cleaner. If this message still appear, contact the support.</p></div>", 'media-cleaner' );
135
  }
136
  else {
@@ -150,8 +160,8 @@
150
  }
151
 
152
  if ( !$admin->is_registered() ) {
153
- echo "<div class='notice notice-info'><p>";
154
- _e( "<b>.</b> This plugin is a lot of work so please consider <a target='_blank' href='//meowapps.com/plugin/media-cleaner'>Media Cleaner Pro</a> in order to receive support and to contribute in the evolution of it. Also, <a target='_blank' href='//meowapps.com/plugin/media-cleaner'>Media Cleaner Pro</a> version will also give you the option <b>to scan the physical files in your /uploads folder</b> and extra checks for the common Page Builders.", 'media-cleaner' );
155
  echo "</p></div>";
156
 
157
  $unsupported = array();
@@ -198,11 +208,20 @@
198
  if ( class_exists( 'WCFMmp' ) )
199
  array_push( $unsupported, 'WCFM Marketplace' );
200
 
 
 
 
 
 
 
 
 
 
201
  if ( !empty( $unsupported ) ) {
202
- echo "<div class='notice notice-warning'><p>";
203
- _e( "The following plugins have been detected: ", 'media-cleaner' );
204
  echo '<b>' . join( ', ', $unsupported ) . '</b>. ';
205
- _e( "Since they require additional checks, they are only fully supported in <a target='_blank' href='//meowapps.com/plugin/media-cleaner'>Media Cleaner Pro</a>.", 'media-cleaner' );
206
  echo "</p></div>";
207
  }
208
 
129
  $method = "";
130
  $table_scan = $wpdb->prefix . "mclean_scan";
131
  $table_refs = $wpdb->prefix . "mclean_refs";
132
+ $db_init = !(strtolower( $wpdb->get_var( "SHOW TABLES LIKE '$table_scan'" ) ) != strtolower( $table_scan )
133
+ ||strtolower( $wpdb->get_var( "SHOW TABLES LIKE '$table_refs'" ) ) != strtolower( $table_refs ));
134
+
135
+ // The DB for Media Cleaner does not exist. Let's create it.
136
+ if ( !$db_init ) {
137
+ wpmc_reset();
138
+ $db_init = !(strtolower( $wpdb->get_var( "SHOW TABLES LIKE '$table_scan'" ) ) != strtolower( $table_scan )
139
+ || strtolower( $wpdb->get_var( "SHOW TABLES LIKE '$table_refs'" ) ) != strtolower( $table_refs ));
140
+ }
141
+
142
+ // It still doesn't exist. Weird, something might have happened?
143
+ if ( !$db_init ) {
144
  _e( "<div class='notice notice-error'><p><b>The database is not ready for Media Cleaner. The scan will not work.</b> Click on the <b>Reset</b> button, it re-creates the tables required by Media Cleaner. If this message still appear, contact the support.</p></div>", 'media-cleaner' );
145
  }
146
  else {
160
  }
161
 
162
  if ( !$admin->is_registered() ) {
163
+ echo "<div class='notice notice-warning'><p>";
164
+ _e( "This plugin is a lot of work so please consider <a target='_blank' href='//meowapps.com/plugin/media-cleaner'>Media Cleaner Pro</a> in order to receive support and to contribute in the evolution of it. Also, <a target='_blank' href='//meowapps.com/plugin/media-cleaner'>Media Cleaner Pro</a> version will also give you the option <b>to scan the physical files in your /uploads folder</b> and extra checks for the common Page Builders.", 'media-cleaner' );
165
  echo "</p></div>";
166
 
167
  $unsupported = array();
208
  if ( class_exists( 'WCFMmp' ) )
209
  array_push( $unsupported, 'WCFM Marketplace' );
210
 
211
+ if ( class_exists( 'RevSliderFront' ) )
212
+ array_push( $unsupported, 'Revolution Slider' );
213
+
214
+ if ( defined( 'WPESTATE_PLUGIN_URL' ) )
215
+ array_push( $unsupported, 'WP Residence' );
216
+
217
+ if ( defined( 'AV_FRAMEWORK_VERSION' ) )
218
+ array_push( $unsupported, 'Avia Framework' );
219
+
220
  if ( !empty( $unsupported ) ) {
221
+ echo "<div class='notice notice-error'><p>";
222
+ _e( "<b>Important note about the following plugin(s): </b>", 'media-cleaner' );
223
  echo '<b>' . join( ', ', $unsupported ) . '</b>. ';
224
+ _e( "They require additional checks which are implemented in the <a target='_blank' href='//meowapps.com/plugin/media-cleaner'>Media Cleaner Pro</a>.", 'media-cleaner' );
225
  echo "</p></div>";
226
  }
227