Media Cleaner - Version 4.4.2

Version Description

  • Fix: Too many files were detected as used if WooCommerce was installed.
Download this release

Release Info

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

Code changes from version 4.4.0 to 4.4.2

Files changed (5) hide show
  1. common/admin.php +13 -1
  2. core.php +3 -0
  3. media-cleaner.php +2 -2
  4. readme.txt +4 -1
  5. wpmc_checkers.php +35 -23
common/admin.php CHANGED
@@ -191,9 +191,13 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
191
  add_settings_field( 'meowapps_hide_meowapps', "Main Menu",
192
  array( $this, 'meowapps_hide_dashboard_callback' ),
193
  'meowapps_common_settings-menu', 'meowapps_common_settings' );
 
 
 
194
  add_settings_field( 'meowapps_hide_ads', "Ads",
195
  array( $this, 'meowapps_hide_ads_callback' ),
196
  'meowapps_common_settings-menu', 'meowapps_common_settings' );
 
197
  register_setting( 'meowapps_common_settings', 'meowapps_hide_meowapps' );
198
  register_setting( 'meowapps_common_settings', 'meowapps_hide_ads' );
199
  }
@@ -210,7 +214,15 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
210
  $value = get_option( 'meowapps_hide_meowapps', null );
211
  $html = '<input type="checkbox" id="meowapps_hide_meowapps" name="meowapps_hide_meowapps" value="1" ' .
212
  checked( 1, get_option( 'meowapps_hide_meowapps' ), false ) . '/>';
213
- $html .= __( '<label>Hide <b>Meow Apps</b> Menu</label><br /><small>Hide Meow Apps menu and all its components, for a nicer an faster WordPress admin UI. An option will be added in Settings > General to display it again.</small>', 'meowapps' );
 
 
 
 
 
 
 
 
214
  echo $html;
215
  }
216
 
191
  add_settings_field( 'meowapps_hide_meowapps', "Main Menu",
192
  array( $this, 'meowapps_hide_dashboard_callback' ),
193
  'meowapps_common_settings-menu', 'meowapps_common_settings' );
194
+ add_settings_field( 'meowapps_force_sslverify', "SSL Verify",
195
+ array( $this, 'meowapps_force_sslverify_callback' ),
196
+ 'meowapps_common_settings-menu', 'meowapps_common_settings' );
197
  add_settings_field( 'meowapps_hide_ads', "Ads",
198
  array( $this, 'meowapps_hide_ads_callback' ),
199
  'meowapps_common_settings-menu', 'meowapps_common_settings' );
200
+ register_setting( 'meowapps_common_settings', 'force_sslverify' );
201
  register_setting( 'meowapps_common_settings', 'meowapps_hide_meowapps' );
202
  register_setting( 'meowapps_common_settings', 'meowapps_hide_ads' );
203
  }
214
  $value = get_option( 'meowapps_hide_meowapps', null );
215
  $html = '<input type="checkbox" id="meowapps_hide_meowapps" name="meowapps_hide_meowapps" value="1" ' .
216
  checked( 1, get_option( 'meowapps_hide_meowapps' ), false ) . '/>';
217
+ $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' );
218
+ echo $html;
219
+ }
220
+
221
+ function meowapps_force_sslverify_callback() {
222
+ $value = get_option( 'force_sslverify', null );
223
+ $html = '<input type="checkbox" id="force_sslverify" name="force_sslverify" value="1" ' .
224
+ checked( 1, get_option( 'force_sslverify' ), false ) . '/>';
225
+ $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' );
226
  echo $html;
227
  }
228
 
core.php CHANGED
@@ -354,6 +354,9 @@ class Meow_WPMC_Core {
354
  WHERE p.post_status != 'inherit'
355
  AND p.post_status != 'trash'
356
  AND p.post_type != 'attachment'
 
 
 
357
  AND p.post_type != 'revision'
358
  LIMIT %d, %d", $limit, $limitsize
359
  )
354
  WHERE p.post_status != 'inherit'
355
  AND p.post_status != 'trash'
356
  AND p.post_type != 'attachment'
357
+ AND p.post_type != 'shop_order'
358
+ AND p.post_type != 'shop_order_refund'
359
+ AND p.post_type != 'nav_menu_item'
360
  AND p.post_type != 'revision'
361
  LIMIT %d, %d", $limit, $limitsize
362
  )
media-cleaner.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Media Cleaner
4
  Plugin URI: http://meowapps.com
5
  Description: Clean your Media Library, many options, trash system.
6
- Version: 4.4.0
7
  Author: Jordy Meow
8
  Author URI: http://meowapps.com
9
  Text Domain: media-cleaner
@@ -27,7 +27,7 @@ if ( class_exists( 'Meow_WPMC_Core' ) ) {
27
  if ( is_admin() ) {
28
 
29
  global $wpmc_version;
30
- $wpmc_version = '4.4.0';
31
 
32
  // Admin
33
  require( 'wpmc_admin.php' );
3
  Plugin Name: Media Cleaner
4
  Plugin URI: http://meowapps.com
5
  Description: Clean your Media Library, many options, trash system.
6
+ Version: 4.4.2
7
  Author: Jordy Meow
8
  Author URI: http://meowapps.com
9
  Text Domain: media-cleaner
27
  if ( is_admin() ) {
28
 
29
  global $wpmc_version;
30
+ $wpmc_version = '4.4.2';
31
 
32
  // Admin
33
  require( 'wpmc_admin.php' );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: TigrouMeow
3
  Tags: management, admin, file, files, images, image, media, library, upload, clean, cleaning
4
  Requires at least: 4.2
5
  Tested up to: 4.9
6
- Stable tag: 4.4.0
7
 
8
  Clean your Media Library and Uploads directory. It has an internal trash and recovery features. Please read the description.
9
 
@@ -50,6 +50,9 @@ It re-creates the Media Cleaner table in the database. You will need to re-run t
50
 
51
  == Changelog ==
52
 
 
 
 
53
  = 4.4.0 =
54
  * Info: This is a MAJOR UPDATE both in term of optimization and detection. Keep my motivation up and give a good review to the plugin here: https://wordpress.org/support/plugin/media-cleaner/reviews/?rate=5#new-post. That helps me a lot.
55
  * Update: Meta Data analysis is now cached, so much faster.
3
  Tags: management, admin, file, files, images, image, media, library, upload, clean, cleaning
4
  Requires at least: 4.2
5
  Tested up to: 4.9
6
+ Stable tag: 4.4.2
7
 
8
  Clean your Media Library and Uploads directory. It has an internal trash and recovery features. Please read the description.
9
 
50
 
51
  == Changelog ==
52
 
53
+ = 4.4.2 =
54
+ * Fix: Too many files were detected as used if WooCommerce was installed.
55
+
56
  = 4.4.0 =
57
  * Info: This is a MAJOR UPDATE both in term of optimization and detection. Keep my motivation up and give a good review to the plugin here: https://wordpress.org/support/plugin/media-cleaner/reviews/?rate=5#new-post. That helps me a lot.
58
  * Update: Meta Data analysis is now cached, so much faster.
wpmc_checkers.php CHANGED
@@ -39,36 +39,48 @@ class Meow_WPMC_Checkers {
39
  $url = $pinfo['dirname'] . '/' . $pinfo['filename'] .
40
  ( isset( $pinfo['extension'] ) ? ( '.' . $pinfo['extension'] ) : '' );
41
 
42
- // Galleries in Visual Composer (WPBakery)
43
- if ( class_exists( 'Vc_Manager' ) ) {
44
- $galleries_images_vc = get_transient( "wpmc_galleries_images_visualcomposer" );
45
- if ( is_array( $galleries_images_vc ) && in_array( $mediaId, $galleries_images_vc ) ) {
46
- $this->core->log( "Media {$mediaId} found in a Visual Composer gallery" );
47
- $this->core->last_analysis = "GALLERY";
48
- return true;
 
 
 
 
 
 
 
49
  }
50
- }
51
 
52
- // Galleries in Fusion Builder (Avada Theme)
53
- if ( function_exists( 'fusion_builder_map' ) ) {
54
- $galleries_images_fb = get_transient( "wpmc_galleries_images_fusionbuilder" );
55
- if ( is_array( $galleries_images_fb ) && in_array( $mediaId, $galleries_images_fb ) ) {
56
- $this->core->log( "Media {$mediaId} found in post_content (Fusion Builder)" );
57
- $this->core->last_analysis = "GALLERY";
58
- return true;
 
59
  }
60
- }
61
 
62
- // Check in WooCommerce Galleries
63
- if ( class_exists( 'WooCommerce' ) ) {
64
- $galleries_images_wc = get_transient( "wpmc_galleries_images_woocommerce" );
65
- if ( is_array( $galleries_images_wc ) && in_array( $mediaId, $galleries_images_wc ) ) {
66
- $this->core->log( "Media {$mediaId} found in a WooCommerce gallery" );
67
- $this->core->last_analysis = "GALLERY";
68
- return true;
 
69
  }
 
70
  }
71
 
 
 
 
 
72
  // Check in standard WP Galleries (URLS)
73
  $galleries_images = get_transient( "wpmc_galleries_images" );
74
  if ( is_array( $galleries_images ) && in_array( $file, $galleries_images ) ) {
39
  $url = $pinfo['dirname'] . '/' . $pinfo['filename'] .
40
  ( isset( $pinfo['extension'] ) ? ( '.' . $pinfo['extension'] ) : '' );
41
 
42
+ /***************************************************************************
43
+ SEARCH BASED ON MEDIA ID
44
+ ***************************************************************************/
45
+
46
+ if ( $mediaId > 0 ) {
47
+
48
+ // Galleries in Visual Composer (WPBakery)
49
+ if ( class_exists( 'Vc_Manager' ) ) {
50
+ $galleries_images_vc = get_transient( "wpmc_galleries_images_visualcomposer" );
51
+ if ( is_array( $galleries_images_vc ) && in_array( $mediaId, $galleries_images_vc ) ) {
52
+ $this->core->log( "Media {$mediaId} found in a Visual Composer gallery" );
53
+ $this->core->last_analysis = "GALLERY";
54
+ return true;
55
+ }
56
  }
 
57
 
58
+ // Galleries in Fusion Builder (Avada Theme)
59
+ if ( function_exists( 'fusion_builder_map' ) ) {
60
+ $galleries_images_fb = get_transient( "wpmc_galleries_images_fusionbuilder" );
61
+ if ( is_array( $galleries_images_fb ) && in_array( $mediaId, $galleries_images_fb ) ) {
62
+ $this->core->log( "Media {$mediaId} found in post_content (Fusion Builder)" );
63
+ $this->core->last_analysis = "GALLERY";
64
+ return true;
65
+ }
66
  }
 
67
 
68
+ // Check in WooCommerce Galleries
69
+ if ( class_exists( 'WooCommerce' ) ) {
70
+ $galleries_images_wc = get_transient( "wpmc_galleries_images_woocommerce" );
71
+ if ( is_array( $galleries_images_wc ) && in_array( $mediaId, $galleries_images_wc ) ) {
72
+ $this->core->log( "Media {$mediaId} found in a WooCommerce gallery" );
73
+ $this->core->last_analysis = "GALLERY";
74
+ return true;
75
+ }
76
  }
77
+
78
  }
79
 
80
+ /***************************************************************************
81
+ SEARCH BASED ON FILE
82
+ ***************************************************************************/
83
+
84
  // Check in standard WP Galleries (URLS)
85
  $galleries_images = get_transient( "wpmc_galleries_images" );
86
  if ( is_array( $galleries_images ) && in_array( $file, $galleries_images ) ) {