Media Cleaner - Version 5.5.3

Version Description

  • Add: Check the IDs of the standard galleries.
  • Add: Support for the ACF groups.
  • Add: Support for the ACF fields for taxonomies.
Download this release

Release Info

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

Code changes from version 5.5.2 to 5.5.3

Files changed (4) hide show
  1. common/admin.php +1 -1
  2. media-cleaner.php +2 -2
  3. parsers/common.php +18 -0
  4. readme.txt +6 -1
common/admin.php CHANGED
@@ -200,7 +200,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
200
  // Creates standard menu if it does NOT exist
201
  global $submenu;
202
  if ( !isset( $submenu[ 'meowapps-main-menu' ] ) ) {
203
- add_menu_page( 'Meow Apps', '<img 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',
200
  // Creates standard menu if it does NOT exist
201
  global $submenu;
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',
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.2
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.2';
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.3
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.3';
29
 
30
  require __DIR__ . '/admin.php';
31
  require __DIR__ . '/core.php';
parsers/common.php CHANGED
@@ -73,6 +73,22 @@ class MeowApps_WPMC_Parser {
73
  $wpmc->add_reference_url( $widgets_urls, 'WIDGET' );
74
  }
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  public function scan_post( $html, $id ) {
77
  global $wpmc;
78
  $posts_images_urls = array();
@@ -96,6 +112,8 @@ class MeowApps_WPMC_Parser {
96
  $posts_images_ids = array_merge( $posts_images_ids, $res[1] );
97
 
98
  // Standard WP Gallery
 
 
99
  $galleries = get_post_galleries_images( $id );
100
  foreach ( $galleries as $gallery ) {
101
  foreach ( $gallery as $image ) {
73
  $wpmc->add_reference_url( $widgets_urls, 'WIDGET' );
74
  }
75
 
76
+ public function get_post_galleries_ids( $id ) {
77
+ global $post;
78
+ $content_post = get_post( $id );
79
+ $content = $content_post->post_content;
80
+ $ids = array();
81
+ if ( preg_match_all('/\[gallery.*ids=.(.*).\]/', $content, $foundArrayIds ) ) {
82
+ if ( $foundArrayIds ) {
83
+ foreach ( $foundArrayIds[1] as $foundIds ) {
84
+ $newIds = explode( ',', $foundIds );
85
+ $ids = array_merge( $ids, $newIds );
86
+ }
87
+ }
88
+ }
89
+ return $ids;
90
+ }
91
+
92
  public function scan_post( $html, $id ) {
93
  global $wpmc;
94
  $posts_images_urls = array();
112
  $posts_images_ids = array_merge( $posts_images_ids, $res[1] );
113
 
114
  // Standard WP Gallery
115
+ $ids = $this->get_post_galleries_ids( $id );
116
+ $posts_images_ids = array_merge( $posts_images_ids, $ids );
117
  $galleries = get_post_galleries_images( $id );
118
  foreach ( $galleries as $gallery ) {
119
  foreach ( $gallery as $image ) {
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.2
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
 
@@ -73,6 +73,11 @@ Better to be safe than sorry. This plugin deletes files! Therefore, backup is no
73
 
74
  == Changelog ==
75
 
 
 
 
 
 
76
  = 5.5.2 =
77
  * Update: Better support for WPBakery.
78
  * Fix: Issue with the URLs pointing at the plugin's tutorial page.
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
 
73
 
74
  == Changelog ==
75
 
76
+ = 5.5.3 =
77
+ * Add: Check the IDs of the standard galleries.
78
+ * Add: Support for the ACF groups.
79
+ * Add: Support for the ACF fields for taxonomies.
80
+
81
  = 5.5.2 =
82
  * Update: Better support for WPBakery.
83
  * Fix: Issue with the URLs pointing at the plugin's tutorial page.