Media Cleaner - Version 4.5.8

Version Description

  • Add: ACF Repeater support.
  • Update: Improve the code.
  • Fix: Debug logs weren't logging.
Download this release

Release Info

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

Code changes from version 4.5.7 to 4.5.8

Files changed (3) hide show
  1. media-cleaner.php +2 -2
  2. readme.txt +3 -2
  3. wpmc_scan.php +21 -1
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.5.7
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.5.7';
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.5.8
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.5.8';
31
 
32
  // Admin
33
  require( 'wpmc_admin.php' );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: TigrouMeow
3
  Tags: clean, delete, file, files, images, image, media, library, upload, clean, acf
4
  Requires at least: 4.2
5
  Tested up to: 4.9.4
6
- Stable tag: 4.5.7
7
 
8
  Clean your WordPress (broken media, unused media, files). It has its own trash and recovery features. Please read the description.
9
 
@@ -50,7 +50,8 @@ It re-creates the Media Cleaner table in the database. You will need to re-run t
50
 
51
  == Changelog ==
52
 
53
- = 4.5.7 =
 
54
  * Update: Improve the code.
55
  * Fix: Debug logs weren't logging.
56
 
3
  Tags: clean, delete, file, files, images, image, media, library, upload, clean, acf
4
  Requires at least: 4.2
5
  Tested up to: 4.9.4
6
+ Stable tag: 4.5.8
7
 
8
  Clean your WordPress (broken media, unused media, files). It has its own trash and recovery features. Please read the description.
9
 
50
 
51
  == Changelog ==
52
 
53
+ = 4.5.8 =
54
+ * Add: ACF Repeater support.
55
  * Update: Improve the code.
56
  * Fix: Debug logs weren't logging.
57
 
wpmc_scan.php CHANGED
@@ -142,18 +142,38 @@ class MeowApps_WPMC_Scan {
142
  $format = $field['return_format'];
143
  else if ( isset( $field['save_format'] ) )
144
  $format = $field['save_format'];
145
- if ( $field['type'] == 'image' && ( $format == 'array' || $format == 'object' ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  if ( !empty( $field['value']['id'] ) )
147
  array_push( $postmeta_images_acf_ids, $field['value']['id'] );
148
  if ( !empty( $field['value']['url'] ) )
149
  array_push( $postmeta_images_acf_urls, $this->core->wpmc_clean_url( $field['value']['url'] ) );
150
  }
 
151
  else if ( $field['type'] == 'image' && $format == 'id' && !empty( $field['value'] ) ) {
152
  array_push( $postmeta_images_acf_ids, $field['value'] );
153
  }
 
154
  else if ( $field['type'] == 'image' && $format == 'url' && !empty( $field['value'] ) ) {
155
  array_push( $postmeta_images_acf_urls, $this->core->wpmc_clean_url( $field['value'] ) );
156
  }
 
157
  else if ( $field['type'] == 'gallery' && !empty( $field['value'] ) ) {
158
  foreach ( $field['value'] as $media ) {
159
  if ( !empty( $media['id'] ) )
142
  $format = $field['return_format'];
143
  else if ( isset( $field['save_format'] ) )
144
  $format = $field['save_format'];
145
+
146
+ // ACF Repeater
147
+ if ( $field['type'] == 'repeater' ) {
148
+ if ( !empty( $field['value'] ) ) {
149
+ foreach ( $field['value'] as $subfields ) {
150
+ foreach ( $subfields as $subfield ) {
151
+ if ( $subfield['type'] == 'image' ) {
152
+ if ( !empty( $subfield['id'] ) )
153
+ array_push( $postmeta_images_acf_ids, $subfield['id'] );
154
+ if ( !empty( $subfield['url'] ) )
155
+ array_push( $postmeta_images_acf_urls, $this->core->wpmc_clean_url( $subfield['url'] ) );
156
+ }
157
+ }
158
+ }
159
+ }
160
+ }
161
+ // ACF Image ID and URL
162
+ else if ( $field['type'] == 'image' && ( $format == 'array' || $format == 'object' ) ) {
163
  if ( !empty( $field['value']['id'] ) )
164
  array_push( $postmeta_images_acf_ids, $field['value']['id'] );
165
  if ( !empty( $field['value']['url'] ) )
166
  array_push( $postmeta_images_acf_urls, $this->core->wpmc_clean_url( $field['value']['url'] ) );
167
  }
168
+ // ACF Image ID
169
  else if ( $field['type'] == 'image' && $format == 'id' && !empty( $field['value'] ) ) {
170
  array_push( $postmeta_images_acf_ids, $field['value'] );
171
  }
172
+ // ACF Image URL
173
  else if ( $field['type'] == 'image' && $format == 'url' && !empty( $field['value'] ) ) {
174
  array_push( $postmeta_images_acf_urls, $this->core->wpmc_clean_url( $field['value'] ) );
175
  }
176
+ // ACF Gallery
177
  else if ( $field['type'] == 'gallery' && !empty( $field['value'] ) ) {
178
  foreach ( $field['value'] as $media ) {
179
  if ( !empty( $media['id'] ) )