Media File Renamer - Version 4.5.2

Version Description

  • Update: Code cleaning, Youtube video.
  • Fix: Issue with updating the ALT field.
Download this release

Release Info

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

Code changes from version 4.5.0 to 4.5.2

Files changed (4) hide show
  1. common/admin.css +1 -1
  2. core.php +11 -6
  3. media-file-renamer.php +2 -2
  4. readme.txt +8 -10
common/admin.css CHANGED
@@ -134,7 +134,7 @@
134
  padding: 10px 10px;
135
  }
136
 
137
- .meow-box div.submit {
138
  text-align: right;
139
  margin: 10px -10px -10px -10px;
140
  padding: 7px 10px 10px 0px !important;
134
  padding: 10px 10px;
135
  }
136
 
137
+ .meow-box p.submit, .meow-box div.submit {
138
  text-align: right;
139
  margin: 10px -10px -10px -10px;
140
  padding: 7px 10px 10px 0px !important;
core.php CHANGED
@@ -15,6 +15,11 @@ class Meow_MFRH_Core {
15
  new Meow_MFRH_Updates( $this, $this->admin );
16
  load_plugin_textdomain( 'media-file-renamer', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
17
 
 
 
 
 
 
18
  // Those actions/filters are only for the admin screens
19
  if ( is_admin() ) {
20
  add_filter( 'attachment_fields_to_save', array( $this, 'attachment_fields_to_save' ), 20, 2 );
@@ -640,7 +645,7 @@ SQL;
640
  function move( $media, $newPath ) {
641
  $id = null;
642
  $post = null;
643
-
644
  // Check the arguments
645
  if ( is_numeric( $media ) ) {
646
  $id = $media;
@@ -716,9 +721,9 @@ SQL;
716
  if ( function_exists( 'wr2x_get_retina' ) ) {
717
  $wr2x_old_filepath = $this->str_replace( '.' . $old_ext, '@2x.' . $old_ext, $meta_old_filepath );
718
  $wr2x_new_filepath = $this->str_replace( '.' . $old_ext, '@2x.' . $old_ext, $meta_new_filepath );
719
- if ( file_exists( $wr2x_old_filepath )
720
  && ( ( !file_exists( $wr2x_new_filepath ) ) || is_writable( $wr2x_new_filepath ) ) ) {
721
-
722
  // Rename retina file
723
  if ( !$this->rename_file( $wr2x_old_filepath, $wr2x_new_filepath, $case_issue ) && !$force_rename ) {
724
  $this->log( "[!] Retina $wr2x_old_filepath -> $wr2x_new_filepath" );
@@ -903,9 +908,9 @@ SQL;
903
  if ( function_exists( 'wr2x_get_retina' ) ) {
904
  $wr2x_old_filepath = $this->str_replace( '.' . $old_ext, '@2x.' . $old_ext, $meta_old_filepath );
905
  $wr2x_new_filepath = $this->str_replace( '.' . $new_ext, '@2x.' . $new_ext, $meta_new_filepath );
906
- if ( file_exists( $wr2x_old_filepath )
907
  && ( ( !file_exists( $wr2x_new_filepath ) ) || is_writable( $wr2x_new_filepath ) ) ) {
908
-
909
  // Rename retina file
910
  if ( !$this->rename_file( $wr2x_old_filepath, $wr2x_new_filepath, $case_issue ) && !$force_rename ) {
911
  $this->log( "[!] Retina $wr2x_old_filepath -> $wr2x_new_filepath" );
@@ -991,7 +996,7 @@ SQL;
991
  }
992
 
993
  // HTTP REFERER set to the new media link
994
- if ( isset( $_REQUEST['_wp_original_http_referer'] ) &&
995
  strpos( $_REQUEST['_wp_original_http_referer'], '/wp-admin/' ) === false ) {
996
  $_REQUEST['_wp_original_http_referer'] = get_permalink( $id );
997
  }
15
  new Meow_MFRH_Updates( $this, $this->admin );
16
  load_plugin_textdomain( 'media-file-renamer', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
17
 
18
+ $method = apply_filters( 'mfrh_method', 'media_title' );
19
+
20
+ if ( $method === 'product_title' && class_exists( 'WooCommerce' ) )
21
+ include( 'plugins/woocommerce.php' );
22
+
23
  // Those actions/filters are only for the admin screens
24
  if ( is_admin() ) {
25
  add_filter( 'attachment_fields_to_save', array( $this, 'attachment_fields_to_save' ), 20, 2 );
645
  function move( $media, $newPath ) {
646
  $id = null;
647
  $post = null;
648
+
649
  // Check the arguments
650
  if ( is_numeric( $media ) ) {
651
  $id = $media;
721
  if ( function_exists( 'wr2x_get_retina' ) ) {
722
  $wr2x_old_filepath = $this->str_replace( '.' . $old_ext, '@2x.' . $old_ext, $meta_old_filepath );
723
  $wr2x_new_filepath = $this->str_replace( '.' . $old_ext, '@2x.' . $old_ext, $meta_new_filepath );
724
+ if ( file_exists( $wr2x_old_filepath )
725
  && ( ( !file_exists( $wr2x_new_filepath ) ) || is_writable( $wr2x_new_filepath ) ) ) {
726
+
727
  // Rename retina file
728
  if ( !$this->rename_file( $wr2x_old_filepath, $wr2x_new_filepath, $case_issue ) && !$force_rename ) {
729
  $this->log( "[!] Retina $wr2x_old_filepath -> $wr2x_new_filepath" );
908
  if ( function_exists( 'wr2x_get_retina' ) ) {
909
  $wr2x_old_filepath = $this->str_replace( '.' . $old_ext, '@2x.' . $old_ext, $meta_old_filepath );
910
  $wr2x_new_filepath = $this->str_replace( '.' . $new_ext, '@2x.' . $new_ext, $meta_new_filepath );
911
+ if ( file_exists( $wr2x_old_filepath )
912
  && ( ( !file_exists( $wr2x_new_filepath ) ) || is_writable( $wr2x_new_filepath ) ) ) {
913
+
914
  // Rename retina file
915
  if ( !$this->rename_file( $wr2x_old_filepath, $wr2x_new_filepath, $case_issue ) && !$force_rename ) {
916
  $this->log( "[!] Retina $wr2x_old_filepath -> $wr2x_new_filepath" );
996
  }
997
 
998
  // HTTP REFERER set to the new media link
999
+ if ( isset( $_REQUEST['_wp_original_http_referer'] ) &&
1000
  strpos( $_REQUEST['_wp_original_http_referer'], '/wp-admin/' ) === false ) {
1001
  $_REQUEST['_wp_original_http_referer'] = get_permalink( $id );
1002
  }
media-file-renamer.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Media File Renamer Auto
4
  Plugin URI: https://meowapps.com
5
  Description: Renames automatically the files depending on Media titles and updates the links.
6
- Version: 4.5.0
7
  Author: Jordy Meow
8
  Author URI: https://jordymeow.com
9
  Text Domain: media-file-renamer
@@ -32,7 +32,7 @@ require( 'helpers.php');
32
  if ( is_admin() || is_rest() ) {
33
 
34
  global $mfrh_version, $mfrh_core;
35
- $mfrh_version = '4.5.0';
36
 
37
  // Admin
38
  require( 'mfrh_admin.php');
3
  Plugin Name: Media File Renamer Auto
4
  Plugin URI: https://meowapps.com
5
  Description: Renames automatically the files depending on Media titles and updates the links.
6
+ Version: 4.5.2
7
  Author: Jordy Meow
8
  Author URI: https://jordymeow.com
9
  Text Domain: media-file-renamer
32
  if ( is_admin() || is_rest() ) {
33
 
34
  global $mfrh_version, $mfrh_core;
35
+ $mfrh_version = '4.5.2';
36
 
37
  // Admin
38
  require( 'mfrh_admin.php');
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: TigrouMeow, amekusa
3
  Tags: rename, seo, file, files, media, renamer
4
  Requires at least: 4.8
5
  Tested up to: 5.0
6
- Stable tag: 4.5.0
7
 
8
  Physically renames your files nicely for a cleaner system and for a better SEO. Please read the description.
9
 
@@ -11,24 +11,24 @@ Physically renames your files nicely for a cleaner system and for a better SEO.
11
 
12
  Media File Renamer Auto is a WordPress plugin that physically renames media files nicely for a cleaner system and for a better SEO. Please read this description.
13
 
14
- === IMPORTANT ===
15
  This is an *automatic* renamer based on the Media title. This plugin features were all meant to be automatic depending on the title of the Media. Manual Rename (and a few more features) were added two years later, in a Pro version. I add complex features based on requests usually in the Pro to be able to maintain the quality of the plugin and its support.
16
 
17
- === HOW IT WORKS ===
18
  The plugin automatically renames your media filenames depending on their titles. When files are renamed, the references to it are also updated (posts, pages, custom types and their metadata). A new column in the Media Library will display to you the new ideal filename and a button will allow you to rename it straight away. You can lock and unlock the renaming automatic process through little icons. There is also a little dashboard called File Renamer in Media that will help you rename all your files at once. Advanced users can change the way the files are renamed by using the plugin's filters (check the FAQ). There is also a LOCK option on every image to avoid the filename to be modified any further.
19
 
20
  [youtube https://youtu.be/RjaA-b3avxs]
21
 
22
- === PRO VERSION ===
23
  The [Pro Version](https://meowapps.com/media-file-renamer/) gives a few more features like manual renaming, renaming depending on the post the media is attached to or the content of the alternative text (ALT), logging of SQL queries and a few more options. A good process is to actually let the plugin do the renaming automatically (like in the free version) and to do manual renaming for the files that require fine tuning.
24
 
25
- === BE CAREFUL ===
26
  File renaming is a dangerous process. Before renaming everything automatically, try to rename a few files first and check carefully that all the references to those files have been properly updated on your website. WordPress has so many themes and plugins that this renaming process can't unfortunately cover all the cases, especially if other plugins are using unconventional ways. If references aren't updated properly, please write a nice post (not an angry one) in the support threads :) I will try my best to cover more and more special cases. In any case, always make a **backup** of your database and files before using a plugin that alter your install. For backup, I recommend use the excellent service called [BlogVault](https://meow.click/blogvault). Also, if your website seems broken after a few renames, try to **clear your cache**. The cached HTML will indeed not be linked to the new filenames.
27
 
28
- === FOR DEVELOPER ===
29
  The plugin can be tweaked and reference updates enhanced for your themes/plugins. Have a look [here](https://meowapps.com/media-file-renamer-faq/).
30
 
31
- === JUST TO MAKE SURE ===
32
  This plugin will not allow you to change the filename *manually* in its standard version. The [Pro Version](https://meowapps.com/media-file-renamer/) is required. If you are about to *write an angry review* because this feature is not available, at least, please *mention that you read the whole description*.
33
 
34
  This plugin works perfectly with WP Retina 2x, Polylang, WPML and many more. Is has been tested in Windows, Linux and OSX systems.
@@ -55,10 +55,8 @@ Check the FAQ on the official website, [here](https://meowapps.com/media-file-re
55
 
56
  == Changelog ==
57
 
58
- = 4.5.0 =
59
  * Update: Code cleaning, Youtube video.
60
-
61
- = 4.4.3 =
62
  * Fix: Issue with updating the ALT field.
63
 
64
  = 4.4.0 =
3
  Tags: rename, seo, file, files, media, renamer
4
  Requires at least: 4.8
5
  Tested up to: 5.0
6
+ Stable tag: 4.5.2
7
 
8
  Physically renames your files nicely for a cleaner system and for a better SEO. Please read the description.
9
 
11
 
12
  Media File Renamer Auto is a WordPress plugin that physically renames media files nicely for a cleaner system and for a better SEO. Please read this description.
13
 
14
+ === IMPORTANT ===
15
  This is an *automatic* renamer based on the Media title. This plugin features were all meant to be automatic depending on the title of the Media. Manual Rename (and a few more features) were added two years later, in a Pro version. I add complex features based on requests usually in the Pro to be able to maintain the quality of the plugin and its support.
16
 
17
+ === HOW IT WORKS ===
18
  The plugin automatically renames your media filenames depending on their titles. When files are renamed, the references to it are also updated (posts, pages, custom types and their metadata). A new column in the Media Library will display to you the new ideal filename and a button will allow you to rename it straight away. You can lock and unlock the renaming automatic process through little icons. There is also a little dashboard called File Renamer in Media that will help you rename all your files at once. Advanced users can change the way the files are renamed by using the plugin's filters (check the FAQ). There is also a LOCK option on every image to avoid the filename to be modified any further.
19
 
20
  [youtube https://youtu.be/RjaA-b3avxs]
21
 
22
+ === PRO VERSION ===
23
  The [Pro Version](https://meowapps.com/media-file-renamer/) gives a few more features like manual renaming, renaming depending on the post the media is attached to or the content of the alternative text (ALT), logging of SQL queries and a few more options. A good process is to actually let the plugin do the renaming automatically (like in the free version) and to do manual renaming for the files that require fine tuning.
24
 
25
+ === BE CAREFUL ===
26
  File renaming is a dangerous process. Before renaming everything automatically, try to rename a few files first and check carefully that all the references to those files have been properly updated on your website. WordPress has so many themes and plugins that this renaming process can't unfortunately cover all the cases, especially if other plugins are using unconventional ways. If references aren't updated properly, please write a nice post (not an angry one) in the support threads :) I will try my best to cover more and more special cases. In any case, always make a **backup** of your database and files before using a plugin that alter your install. For backup, I recommend use the excellent service called [BlogVault](https://meow.click/blogvault). Also, if your website seems broken after a few renames, try to **clear your cache**. The cached HTML will indeed not be linked to the new filenames.
27
 
28
+ === FOR DEVELOPER ===
29
  The plugin can be tweaked and reference updates enhanced for your themes/plugins. Have a look [here](https://meowapps.com/media-file-renamer-faq/).
30
 
31
+ === JUST TO MAKE SURE ===
32
  This plugin will not allow you to change the filename *manually* in its standard version. The [Pro Version](https://meowapps.com/media-file-renamer/) is required. If you are about to *write an angry review* because this feature is not available, at least, please *mention that you read the whole description*.
33
 
34
  This plugin works perfectly with WP Retina 2x, Polylang, WPML and many more. Is has been tested in Windows, Linux and OSX systems.
55
 
56
  == Changelog ==
57
 
58
+ = 4.5.2 =
59
  * Update: Code cleaning, Youtube video.
 
 
60
  * Fix: Issue with updating the ALT field.
61
 
62
  = 4.4.0 =