Media File Renamer - Version 4.6.2

Version Description

  • Add: Doesn't show the button to the Dashboard if Auto is disabled.
  • Fix: Admin refreshed.
Download this release

Release Info

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

Code changes from version 4.5.9 to 4.6.2

Files changed (5) hide show
  1. common/admin.css +3 -4
  2. common/admin.php +105 -8
  3. media-file-renamer.php +2 -2
  4. mfrh_admin.php +12 -5
  5. readme.txt +6 -2
common/admin.css CHANGED
@@ -63,7 +63,7 @@
63
  .meow-box {
64
  box-sizing: border-box;
65
  border: 1px solid #e5e5e5;
66
- box-shadow: 2px 2px 1px rgba(0,0,0,.02);
67
  background: #fff;
68
  color: #444;
69
  margin-bottom: 15px;
@@ -80,13 +80,12 @@
80
  }
81
 
82
  .meow-box h3 {
83
- font-size: 13px;
84
- padding: 4px 12px;
85
  margin: 0;
86
  background: #3c3c3c;
87
  color: #ffffff;
88
  text-transform: uppercase;
89
- border-top-right-radius: 8px;
90
  /*border-bottom: 1px solid #eee;*/
91
  }
92
 
63
  .meow-box {
64
  box-sizing: border-box;
65
  border: 1px solid #e5e5e5;
66
+ box-shadow: 0px 3px 5px rgba(0, 0, 0, .1);
67
  background: #fff;
68
  color: #444;
69
  margin-bottom: 15px;
80
  }
81
 
82
  .meow-box h3 {
83
+ font-size: 14px;
84
+ padding: 10px 12px;
85
  margin: 0;
86
  background: #3c3c3c;
87
  color: #ffffff;
88
  text-transform: uppercase;
 
89
  /*border-bottom: 1px solid #eee;*/
90
  }
91
 
common/admin.php CHANGED
@@ -7,7 +7,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
7
  public static $logo = 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxIiB2aWV3Qm94PSIwIDAgMTY1IDE2NSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8c3R5bGU+CiAgICAuc3Qye2ZpbGw6IzgwNDYyNX0uc3Qze2ZpbGw6I2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sYXNzPSJzdDIiIGQ9Ik02MyA4Mmw5IDUtNiA5LTEwLTZjNSAwIDYtNCA3LTh6Ii8+CiAgPHBhdGggY2xhc3M9InN0MyIgZD0iTTcyIDg3bDMgMS0xIDExLTgtMyA2LTEweiIvPgo8L3N2Zz4K';
8
 
9
  public static $loaded = false;
10
- public static $admin_version = "2.0";
11
 
12
  public $prefix; // prefix used for actions, filters (mfrh)
13
  public $mainfile; // plugin main file (media-file-renamer.php)
@@ -21,6 +21,11 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
21
  add_action( 'admin_menu', array( $this, 'admin_menu_start' ) );
22
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
23
  add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );
 
 
 
 
 
24
  }
25
  MeowApps_Admin::$loaded = true;
26
  }
@@ -51,6 +56,16 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
51
  add_filter( 'edd_sl_api_request_verify_ssl', array( $this, 'request_verify_ssl' ), 10, 0 );
52
  }
53
 
 
 
 
 
 
 
 
 
 
 
54
  function request_verify_ssl() {
55
  return get_option( 'force_sslverify', false );
56
  }
@@ -390,13 +405,91 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
390
  </div>
391
  </div>
392
 
393
- <h2>Recommendations</h2>
394
- <div style="background: white; padding: 5px 15px 5px 15px; box-shadow: 2px 2px 1px rgba(0,0,0,.02);">
395
- <p>
396
- <?php _e( 'Too many WordPress installs are blown-up with useless and/or huge plugins, and bad practices. But that is because most users are overwhelmed by the diversity and immensity of the WordPress jungle. One rule of thumb is to keep your install the simplest as possible, with the least amount of plugins, in number and weight.', 'meowapps' )?>
397
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
398
  <p>
399
- <?php _e( 'Articles are kept being updated on the Meow Apps website, with all the latest recommendations. Please have a look and make your WordPress simpler, faster, better: ', 'meowapps' )?>
400
  <a href='https://meowapps.com/debugging-wordpress/' target='_blank'>
401
  How To Debug</a>,
402
  <a href='https://meowapps.com/seo-optimization/' target='_blank'>
@@ -452,7 +545,11 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
452
 
453
  <?php
454
  }
455
- echo "<br /><small style='color: lightgray;'>Meow Admin " . MeowApps_Admin::$admin_version . "</small></div>";
 
 
 
 
456
  }
457
 
458
  // HELPERS
7
  public static $logo = 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxIiB2aWV3Qm94PSIwIDAgMTY1IDE2NSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8c3R5bGU+CiAgICAuc3Qye2ZpbGw6IzgwNDYyNX0uc3Qze2ZpbGw6I2ZkYTk2MH0KICA8L3N0eWxlPgogIDxwYXRoIGQ9Ik03MiA3YTc2IDc2IDAgMCAxIDg0IDkxQTc1IDc1IDAgMSAxIDcyIDd6IiBmaWxsPSIjNGE2YjhjIi8+CiAgPHBhdGggZD0iTTQ4IDQ4YzIgNSAyIDEwIDUgMTQgNSA4IDEzIDE3IDIyIDIwbDEtMTBjMS0yIDMtMyA1LTNoMTNjMiAwIDQgMSA1IDNsMyA5IDQtMTBjMi0zIDYtMiA5LTJoMTFjMyAyIDMgNSAzIDhsMiAzN2MwIDMtMSA3LTQgOGgtMTJjLTIgMC0zLTItNS00LTEgMS0yIDMtNCAzLTUgMS05IDEtMTMtMS0zIDItNSAyLTkgMnMtOSAxLTEwLTNjLTItNC0xLTggMC0xMi04LTMtMTUtNy0yMi0xMi03LTctMTUtMTQtMjAtMjMtMy00LTUtOC01LTEzIDEtNCAzLTEwIDYtMTMgNC0zIDEyLTIgMTUgMnoiIGZpbGw9IiMxMDEwMTAiLz4KICA8cGF0aCBjbGFzcz0ic3QyIiBkPSJNNDMgNTFsNCAxMS02IDVoLTZjLTMtNS0zLTExIDAtMTYgMi0yIDYtMyA4IDB6Ii8+CiAgPHBhdGggY2xhc3M9InN0MyIgZD0iTTQ3IDYybDMgNmMwIDMgMCA0LTIgNnMtNCAyLTcgMmwtNi05aDZsNi01eiIvPgogIDxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik01MCA2OGw4IDljLTMgMy01IDYtOSA4bC04LTljMyAwIDUgMCA3LTJzMy0zIDItNnoiLz4KICA8cGF0aCBkPSJNODIgNzRoMTJsNSAxOCAzIDExIDgtMjloMTNsMiA0MmgtOGwtMS0yLTEtMzEtMTAgMzItNyAxLTktMzMtMSAyOS0xIDRoLThsMy00MnoiIGZpbGw9IiNmZmYiLz4KICA8cGF0aCBjbGFzcz0ic3QzIiBkPSJNNTggNzdsNSA1Yy0xIDQtMiA4LTcgOGwtNy01YzQtMiA2LTUgOS04eiIvPgogIDxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik02MyA4Mmw5IDUtNiA5LTEwLTZjNSAwIDYtNCA3LTh6Ii8+CiAgPHBhdGggY2xhc3M9InN0MyIgZD0iTTcyIDg3bDMgMS0xIDExLTgtMyA2LTEweiIvPgo8L3N2Zz4K';
8
 
9
  public static $loaded = false;
10
+ public static $admin_version = "2.3";
11
 
12
  public $prefix; // prefix used for actions, filters (mfrh)
13
  public $mainfile; // plugin main file (media-file-renamer.php)
21
  add_action( 'admin_menu', array( $this, 'admin_menu_start' ) );
22
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
23
  add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );
24
+ add_action( 'wp_ajax_meow_perf_load', array( $this, 'wp_ajax_meow_perf_load' ) );
25
+ add_action( 'wp_ajax_meow_file_check', array( $this, 'wp_ajax_meow_file_check' ) );
26
+ if ( $_GET['page'] === 'meowapps-main-menu' ) {
27
+ add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ) );
28
+ }
29
  }
30
  MeowApps_Admin::$loaded = true;
31
  }
56
  add_filter( 'edd_sl_api_request_verify_ssl', array( $this, 'request_verify_ssl' ), 10, 0 );
57
  }
58
 
59
+ function wp_ajax_meow_perf_load() {
60
+ return 'Did nothing but a blank request.';
61
+ }
62
+
63
+ function wp_ajax_meow_file_check() {
64
+ $tmpfile = wp_tempnam();
65
+ unlink( $tmpfile );
66
+ return "Created and deleted $tmpfile.";
67
+ }
68
+
69
  function request_verify_ssl() {
70
  return get_option( 'force_sslverify', false );
71
  }
405
  </div>
406
  </div>
407
 
408
+ <h2>WordPress Performance & Recommendations</h2>
409
+ <div style="background: white; padding: 5px 15px 5px 15px; box-shadow: 2px 2px 1px rgba(0,0,0,.02); margin-bottom: 15px;">
410
+ <p><?php _e( 'The <b>Empty Request Time</b> helps you analyzing the raw performance of your install by giving you the average time it takes to run an empty request to your server. You can try to disable some plugins (or change their options) then and click on Reset to see how it influences the results. With <b>File Operation Time</b>, you will find out if your server is slow with files. An excellent install would have an Empty Request Time of less than 500 ms. Keep it absolutely under 2,000 ms. File Operation Time should take only a few milliseconds more than the Empty Request Time. For more information about this, <a href="https://meowapps.com/clean-optimize-wordpress/#Optimize_your_Empty_Request_Time" target="_blank">click here</a>.', 'meowapps' ); ?></p>
411
+ </div>
412
+
413
+ <div style="float: left; margin-right: 10px; text-align: center; padding: 10px; background: white; width: 200px; border: 1px solid #e2e2e2;">
414
+ <div style='font-size: 14px; line-height: 14px; margin-bottom: 20px;'>Empty Request Time</div>
415
+ <div style='font-size: 32px; line-height: 32px; margin-bottom: 10px;' id='meow-perf-load-average'>N/A</div>
416
+ <div style='font-size: 12px; line-height: 12px; margin-bottom: 20px;'>Based on
417
+ <span id='meow-perf-load-count'>0</span> request(s)
418
+ </div>
419
+ <input type='submit' style='text-align: center; width: 100%;' id="meow-perf-reset" value="Reset" class="button button-primary">
420
+ </div>
421
+
422
+ <div style="float: left; margin-right: 10px; text-align: center; padding: 10px; background: white; width: 200px; border: 1px solid #e2e2e2;">
423
+ <div style='font-size: 14px; line-height: 14px; margin-bottom: 20px;'>File Operation Time</div>
424
+ <div style='font-size: 32px; line-height: 32px; margin-bottom: 10px;' id='meow-file-check-time'>N/A</div>
425
+ <div style='font-size: 12px; line-height: 12px; margin-bottom: 20px;'>Create temporary file and delete it.</div>
426
+ <input type='submit' style='text-align: center; width: 100%;' id="meow-file-check-start" value="Check" class="button button-primary">
427
+ </div>
428
+
429
+ <div style="clear: both;"></div>
430
+
431
+ <script>
432
+ (function ($) {
433
+ var calls = 0;
434
+ var times = [];
435
+
436
+ $('#meow-perf-reset').on('click', function () {
437
+ calls = 0;
438
+ times = [];
439
+ $('#meow-perf-load-average').text('N/A');
440
+ $('#meow-perf-load-count').text('0');
441
+ });
442
+
443
+ function perfLoad() {
444
+ var start = new Date().getTime();
445
+ $.ajax(ajaxurl, {
446
+ method: 'post',
447
+ dataType: 'json',
448
+ data: {
449
+ action: 'meow_perf_load',
450
+ }
451
+ }).done(function (response) {
452
+ var end = new Date().getTime();
453
+ var time = end - start;
454
+ calls++;
455
+ times.push(time);
456
+ var sum = times.reduce(function(a, b) { return a + b; });
457
+ var avg = Math.ceil(sum / times.length);
458
+ $('#meow-perf-load-average').text(avg + ' ms');
459
+ $('#meow-perf-load-count').text(calls);
460
+ setTimeout(perfLoad, 5000);
461
+ });
462
+ };
463
+
464
+ function perfFile() {
465
+ var start = new Date().getTime();
466
+ $.ajax(ajaxurl, {
467
+ method: 'post',
468
+ dataType: 'json',
469
+ data: {
470
+ action: 'meow_file_check',
471
+ }
472
+ }).done(function (response) {
473
+ var end = new Date().getTime();
474
+ var time = end - start;
475
+ $('#meow-file-check-time').text(time + ' ms');
476
+ $('#meow-file-check-start').text('Check');
477
+ });
478
+ };
479
+
480
+ $('#meow-file-check-start').on('click', function () {
481
+ $('#meow-file-check-start').text('...');
482
+ perfFile();
483
+ });
484
+
485
+ setTimeout(perfLoad, 1500);
486
+
487
+ })(jQuery);
488
+ </script>
489
+
490
+ <div style="background: white; padding: 5px 15px 5px 15px; box-shadow: 2px 2px 1px rgba(0,0,0,.02); margin-top: 15px;">
491
  <p>
492
+ <?php _e( 'Too many WordPress installs are blown-up with useless and/or huge plugins, and bad practices. But that is because most users are overwhelmed by the diversity and immensity of the WordPress jungle. One rule of thumb is to keep your install the simplest as possible, with the least number of plugins (avoiding heavy ones too) and a good hosting service (avoid VPS except if you know exactly what you are doing). Articles are kept being updated on the Meow Apps website, with all the latest recommendations: ', 'meowapps' )?>
493
  <a href='https://meowapps.com/debugging-wordpress/' target='_blank'>
494
  How To Debug</a>,
495
  <a href='https://meowapps.com/seo-optimization/' target='_blank'>
545
 
546
  <?php
547
  }
548
+ }
549
+
550
+ function admin_footer_text( $current ) {
551
+ return "Thanks for using <a href='https://meowapps.com'>Meow Apps</a>! This is the Meow Admin " .
552
+ MeowApps_Admin::$admin_version . ". <br /><i>Loaded from " . __FILE__ . "</i>";
553
  }
554
 
555
  // HELPERS
media-file-renamer.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Media File Renamer (Auto Rename)
4
  Plugin URI: https://meowapps.com
5
  Description: Renames automatically the files depending on Media titles and updates the links.
6
- Version: 4.5.9
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.9';
36
 
37
  // Admin
38
  require( 'mfrh_admin.php');
3
  Plugin Name: Media File Renamer (Auto Rename)
4
  Plugin URI: https://meowapps.com
5
  Description: Renames automatically the files depending on Media titles and updates the links.
6
+ Version: 4.6.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.6.2';
36
 
37
  // Admin
38
  require( 'mfrh_admin.php');
mfrh_admin.php CHANGED
@@ -172,11 +172,18 @@ class Meow_MFRH_Admin extends MeowApps_Admin {
172
  '<a target="_blank" href="https://meowapps.com/media-file-renamer/">' . esc_html__( 'tutorial', 'media-file-renamer' ) . '</a>'
173
  );
174
  ?>
175
- <p class="submit">
176
- <a class="button button-primary" href="upload.php?page=rename_media_files">
177
- <?php esc_html_e( "Access the Renamer Dashboard", 'media-file-renamer' ); ?>
178
- </a>
179
- </p>
 
 
 
 
 
 
 
180
  </div>
181
  </div>
182
  </div>
172
  '<a target="_blank" href="https://meowapps.com/media-file-renamer/">' . esc_html__( 'tutorial', 'media-file-renamer' ) . '</a>'
173
  );
174
  ?>
175
+ <?php
176
+ $method = apply_filters( 'mfrh_method', 'media_title' );
177
+ if ( $method != 'none' ) {
178
+ ?>
179
+ <p class="submit">
180
+ <a class="button button-primary" href="upload.php?page=rename_media_files">
181
+ <?php esc_html_e( "Access the Renamer Dashboard", 'media-file-renamer' ); ?>
182
+ </a>
183
+ </p>
184
+ <?php
185
+ }
186
+ ?>
187
  </div>
188
  </div>
189
  </div>
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: TigrouMeow, amekusa
3
  Tags: rename, seo, file, files, media, renamer, optimize, library
4
  Donate link: https://commerce.coinbase.com/checkout/d047546a-77a8-41c8-9ea9-4a950f61832f
5
  Requires at least: 4.8
6
- Tested up to: 5.2
7
  Requires PHP: 7.0
8
- Stable tag: 4.5.9
9
 
10
  Physically renames your files nicely for a cleaner system and for a better SEO. Please read the description.
11
 
@@ -57,6 +57,10 @@ Check the FAQ on the official website, [here](https://meowapps.com/media-file-re
57
 
58
  == Changelog ==
59
 
 
 
 
 
60
  = 4.5.9 =
61
  * Fix: Column wasn't displayed when manual enabled and automatic disabled.
62
 
3
  Tags: rename, seo, file, files, media, renamer, optimize, library
4
  Donate link: https://commerce.coinbase.com/checkout/d047546a-77a8-41c8-9ea9-4a950f61832f
5
  Requires at least: 4.8
6
+ Tested up to: 5.3
7
  Requires PHP: 7.0
8
+ Stable tag: 4.6.2
9
 
10
  Physically renames your files nicely for a cleaner system and for a better SEO. Please read the description.
11
 
57
 
58
  == Changelog ==
59
 
60
+ = 4.6.2 =
61
+ * Add: Doesn't show the button to the Dashboard if Auto is disabled.
62
+ * Fix: Admin refreshed.
63
+
64
  = 4.5.9 =
65
  * Fix: Column wasn't displayed when manual enabled and automatic disabled.
66