Media File Renamer - Version 3.5.8

Version Description

  • Add: New button "Lock All"
  • Fix: Button "Unlock All and Rename" was not really unlocking everything.
Download this release

Release Info

Developer TigrouMeow
Plugin Icon 128x128 Media File Renamer
Version 3.5.8
Comparing to
See all releases

Code changes from version 3.5.6 to 3.5.8

Files changed (3) hide show
  1. core.php +22 -3
  2. media-file-renamer.php +2 -2
  3. readme.txt +5 -1
core.php CHANGED
@@ -158,7 +158,7 @@ class Meow_MFRH_Core {
158
  mfrh_process_next();
159
  }
160
  else {
161
- jQuery('#mfrh_progression').html("<?php echo __( "Done. Please <a href='javascript:history.go(0)'>refresh</a> this page.", 'media-file-renamer' ); ?>");
162
  }
163
  });
164
  }
@@ -195,6 +195,10 @@ class Meow_MFRH_Core {
195
  $idsToRemove = $wpdb->get_col( "SELECT m.post_id FROM wp_postmeta m WHERE m.meta_key = '_manual_file_renaming' and m.meta_value = 1" );
196
  $ids = array_values( array_diff( $ids, $idsToRemove ) );
197
  }
 
 
 
 
198
  $reply = array();
199
  $reply['ids'] = $ids;
200
  $reply['total'] = count( $ids );
@@ -423,6 +427,17 @@ class Meow_MFRH_Core {
423
  echo '<p></p>';
424
  global $wpdb;
425
 
 
 
 
 
 
 
 
 
 
 
 
426
  $checkFiles = null;
427
  if ( isset( $_GET ) && isset( $_GET['mfrh_scancheck'] ) )
428
  $checkFiles = $this->check_text();
@@ -461,9 +476,13 @@ class Meow_MFRH_Core {
461
  <?php echo sprintf( __( "Rename ALL [%d]", 'media-file-renamer' ), $all_media - $manual_media ); ?>
462
  </a>
463
  <a onclick='mfrh_rename_media(true)' id='mfrh_unlock_rename_all_images' class='button-primary'
464
- style='margin-right: 10px;'><span class="dashicons dashicons-controls-play" style="position: relative; top: 3px; left: -2px;"></span>
465
  <?php echo sprintf( __( "Unlock ALL & Rename [%d]", 'media-file-renamer' ), $all_media ); ?>
466
  </a>
 
 
 
 
467
  <span id='mfrh_progression'></span>
468
 
469
  <?php if ( get_option( 'mfrh_flagging' ) ): ?>
@@ -503,7 +522,7 @@ class Meow_MFRH_Core {
503
  }
504
  else if ( isset( $_GET['mfrh_scancheck'] ) && ( $checkFiles == null || count( $checkFiles ) < 1 ) ) {
505
  ?><tr><td colspan='4'><div style='width: 100%; margin-top: 15px; margin-bottom: 15px; text-align: center;'>
506
- <div style='margin-top: 15px;'><?php _e( 'There are no issues. Cool!<br />Let\'s go visit <a target="_blank" href=\'http://jordymeow.com\'>The Offbeat Guide of Japan</a> :)', 'media-file-renamer' ); ?></div>
507
  </div></td><?php
508
  }
509
  else if ( $checkFiles == null ) {
158
  mfrh_process_next();
159
  }
160
  else {
161
+ jQuery('#mfrh_progression').html("<?php echo __( "Done. Please <a href='?page=rename_media_files'>refresh</a> this page.", 'media-file-renamer' ); ?>");
162
  }
163
  });
164
  }
195
  $idsToRemove = $wpdb->get_col( "SELECT m.post_id FROM wp_postmeta m WHERE m.meta_key = '_manual_file_renaming' and m.meta_value = 1" );
196
  $ids = array_values( array_diff( $ids, $idsToRemove ) );
197
  }
198
+ else {
199
+ // We rename all, so we should unlock everything.
200
+ $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_manual_file_renaming'" );
201
+ }
202
  $reply = array();
203
  $reply['ids'] = $ids;
204
  $reply['total'] = count( $ids );
427
  echo '<p></p>';
428
  global $wpdb;
429
 
430
+ if ( isset( $_GET ) && isset( $_GET['mfrh_lockall'] ) ) {
431
+ $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_manual_file_renaming'" );
432
+ $wpdb->query( "INSERT INTO $wpdb->postmeta (meta_key, meta_value, post_id)
433
+ SELECT '_manual_file_renaming', 1, p.ID
434
+ FROM $wpdb->posts p WHERE p.post_status = 'inherit' AND p.post_type = 'attachment'"
435
+ );
436
+ echo '<div class="updated"><p>';
437
+ echo __( 'All the media files are now locked.', 'media-file-renamer' );
438
+ echo '</p></div>';
439
+ }
440
+
441
  $checkFiles = null;
442
  if ( isset( $_GET ) && isset( $_GET['mfrh_scancheck'] ) )
443
  $checkFiles = $this->check_text();
476
  <?php echo sprintf( __( "Rename ALL [%d]", 'media-file-renamer' ), $all_media - $manual_media ); ?>
477
  </a>
478
  <a onclick='mfrh_rename_media(true)' id='mfrh_unlock_rename_all_images' class='button-primary'
479
+ style='margin-right: 0px;'><span class="dashicons dashicons-controls-play" style="position: relative; top: 3px; left: -2px;"></span>
480
  <?php echo sprintf( __( "Unlock ALL & Rename [%d]", 'media-file-renamer' ), $all_media ); ?>
481
  </a>
482
+ <a href="?page=rename_media_files&mfrh_lockall" id='mfrh_lock_all_images' class='button-primary'
483
+ style='margin-right: 10px;'><span class="dashicons dashicons-controls-play" style="position: relative; top: 3px; left: -2px;"></span>
484
+ <?php echo sprintf( __( "Lock ALL [%d]", 'media-file-renamer' ), $all_media ); ?>
485
+ </a>
486
  <span id='mfrh_progression'></span>
487
 
488
  <?php if ( get_option( 'mfrh_flagging' ) ): ?>
522
  }
523
  else if ( isset( $_GET['mfrh_scancheck'] ) && ( $checkFiles == null || count( $checkFiles ) < 1 ) ) {
524
  ?><tr><td colspan='4'><div style='width: 100%; margin-top: 15px; margin-bottom: 15px; text-align: center;'>
525
+ <div style='margin-top: 15px;'><?php _e( 'There are no issues. Cool!<br />Let\'s go visit <a target="_blank" href=\'http://offbeatjapan.org\'>The Offbeat Guide of Japan</a> :)', 'media-file-renamer' ); ?></div>
526
  </div></td><?php
527
  }
528
  else if ( $checkFiles == null ) {
media-file-renamer.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Media File Renamer
4
  Plugin URI: http://meowapps.com
5
  Description: Auto-rename the files when titles are modified and update and the references (links). Manual Rename is a Pro option. Please read the description.
6
- Version: 3.5.6
7
  Author: Jordy Meow
8
  Author URI: http://meowapps.com
9
  Text Domain: media-file-renamer
@@ -21,7 +21,7 @@ Originally developed for two of my websites:
21
  if ( is_admin() ) {
22
 
23
  global $mfrh_version;
24
- $mfrh_version = '3.5.6';
25
 
26
  // Admin
27
  require( 'mfrh_admin.php');
3
  Plugin Name: Media File Renamer
4
  Plugin URI: http://meowapps.com
5
  Description: Auto-rename the files when titles are modified and update and the references (links). Manual Rename is a Pro option. Please read the description.
6
+ Version: 3.5.8
7
  Author: Jordy Meow
8
  Author URI: http://meowapps.com
9
  Text Domain: media-file-renamer
21
  if ( is_admin() ) {
22
 
23
  global $mfrh_version;
24
+ $mfrh_version = '3.5.8';
25
 
26
  // Admin
27
  require( 'mfrh_admin.php');
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: TigrouMeow
3
  Tags: rename, file, media, management, image, renamer, wpml, wp-retina-2x
4
  Requires at least: 4.2
5
  Tested up to: 4.8
6
- Stable tag: 3.5.6
7
 
8
  Automatically rename files depending on Media titles dynamically + update links. Pro version has many more options. Check the description :)
9
 
@@ -100,6 +100,10 @@ You are welcome to create plugins using Media File Renamer using special rules f
100
 
101
  == Changelog ==
102
 
 
 
 
 
103
  = 3.5.6 =
104
  * Fix: Sometimes numbered files were renamed something like abc-2-2.jpg.
105
  * Update: Rename with lowercase to avoid issues.
3
  Tags: rename, file, media, management, image, renamer, wpml, wp-retina-2x
4
  Requires at least: 4.2
5
  Tested up to: 4.8
6
+ Stable tag: 3.5.8
7
 
8
  Automatically rename files depending on Media titles dynamically + update links. Pro version has many more options. Check the description :)
9
 
100
 
101
  == Changelog ==
102
 
103
+ = 3.5.8 =
104
+ * Add: New button "Lock All"
105
+ * Fix: Button "Unlock All and Rename" was not really unlocking everything.
106
+
107
  = 3.5.6 =
108
  * Fix: Sometimes numbered files were renamed something like abc-2-2.jpg.
109
  * Update: Rename with lowercase to avoid issues.