Gallery Custom Links - Version 1.2.6

Version Description

  • Add: Because we love the W3C, the title has been added to the link.
  • Info: If you like the plugin, your reviews are welcome here :) Thank you!
Download this release

Release Info

Developer TigrouMeow
Plugin Icon 128x128 Gallery Custom Links
Version 1.2.6
Comparing to
See all releases

Code changes from version 1.2.5 to 1.2.6

common/admin.php CHANGED
@@ -7,7 +7,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
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.4";
11
 
12
  public $prefix; // prefix used for actions, filters (mfrh)
13
  public $mainfile; // plugin main file (media-file-renamer.php)
@@ -52,18 +52,19 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
52
  }
53
  }
54
  }
55
-
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() {
@@ -106,19 +107,28 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
106
  }
107
  $rating_date = get_option( $this->prefix . '_rating_date' );
108
  echo '<div class="notice notice-success" data-rating-date="' . date( 'Y-m-d', $rating_date ) . '">';
109
- echo '<p style="font-size: 100%;">You have been using <b>' . $this->nice_name_from_file( $this->mainfile ) . '</b> for some time now. Thank you! Could you kindly share your opinion with me, along with, maybe, features you would like to see implemented? Then, please <a style="font-weight: bold; color: #b926ff;" target="_blank" href="https://wordpress.org/support/plugin/' . $this->nice_short_url_from_file( $this->mainfile ) . '/reviews/?rate=5#new-post">write a little review</a>. That will also bring me joy and motivation, and I will get back to you :) <u>In the case you already have written a review</u>, please check again. Many reviews got removed from WordPress recently.';
 
 
 
 
 
 
110
  echo '<p>
111
  <form method="post" action="" style="float: right;">
112
  <input type="hidden" name="' . $this->prefix . '_never_remind_me" value="true">
113
- <input type="submit" name="submit" id="submit" class="button button-red" value="Never remind me!">
 
114
  </form>
115
  <form method="post" action="" style="float: right; margin-right: 10px;">
116
  <input type="hidden" name="' . $this->prefix . '_remind_me" value="true">
117
- <input type="submit" name="submit" id="submit" class="button button-primary" value="Remind me in a few weeks...">
 
118
  </form>
119
  <form method="post" action="" style="float: right; margin-right: 10px;">
120
  <input type="hidden" name="' . $this->prefix . '_did_it" value="true">
121
- <input type="submit" name="submit" id="submit" class="button button-primary" value="Yes, I did it!">
 
122
  </form>
123
  <div style="clear: both;"></div>
124
  </p>
@@ -154,11 +164,15 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
154
  return;
155
  }
156
  echo '<div class="error">';
157
- echo '<p>It looks like you are using the free version of the plugin (<b>' . $this->nice_name_from_file( $this->mainfile ) . '</b>) but a license for the Pro version was also found. The Pro version might have been replaced by the Free version during an update (might be caused by a temporarily issue). If it is the case, <b>please download it again</b> from the <a target="_blank" href="https://store.meowapps.com">Meow Store</a>. If you wish to continue using the free version and clear this message, click on this button.';
 
 
 
158
  echo '<p>
159
  <form method="post" action="">
160
  <input type="hidden" name="' . $this->prefix . '_reset_sub" value="true">
161
- <input type="submit" name="submit" id="submit" class="button" value="Remove the license">
 
162
  </form>
163
  </p>
164
  ';
@@ -202,19 +216,19 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
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',
207
  'meowapps-main-menu', array( $this, 'admin_meow_apps' ) );
208
  }
209
 
210
  add_settings_section( 'meowapps_common_settings', null, null, 'meowapps_common_settings-menu' );
211
- add_settings_field( 'meowapps_hide_meowapps', "Main Menu",
212
  array( $this, 'meowapps_hide_dashboard_callback' ),
213
  'meowapps_common_settings-menu', 'meowapps_common_settings' );
214
- add_settings_field( 'meowapps_force_sslverify', "SSL Verify",
215
  array( $this, 'meowapps_force_sslverify_callback' ),
216
  'meowapps_common_settings-menu', 'meowapps_common_settings' );
217
- // add_settings_field( 'meowapps_hide_ads', "Ads",
218
  // array( $this, 'meowapps_hide_ads_callback' ),
219
  // 'meowapps_common_settings-menu', 'meowapps_common_settings' );
220
  register_setting( 'meowapps_common_settings', 'force_sslverify' );
@@ -226,36 +240,42 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
226
  $value = get_option( 'meowapps_hide_ads', null );
227
  $html = '<input type="checkbox" id="meowapps_hide_ads" name="meowapps_hide_ads" value="1" ' .
228
  checked( 1, get_option( 'meowapps_hide_ads' ), false ) . '/>';
229
- $html .= __( '<label>Hide</label><br /><small>Doesn\'t display the ads.</small>', 'meowapps' );
230
- echo $html;
231
  }
232
 
233
  function meowapps_hide_dashboard_callback() {
234
  $value = get_option( 'meowapps_hide_meowapps', null );
235
  $html = '<input type="checkbox" id="meowapps_hide_meowapps" name="meowapps_hide_meowapps" value="1" ' .
236
  checked( 1, get_option( 'meowapps_hide_meowapps' ), false ) . '/>';
237
- $html .= __( '<label>Hide <b>Meow Apps</b> Menu</label><br /><small>Hide Meow Apps menu and all its components, for a cleaner admin. This option will be reset if a new Meow Apps plugin is installed. <b>Once activated, an option will be added in your General settings to display it again.</b></small>', 'meowapps' );
238
- echo $html;
239
  }
240
 
241
  function meowapps_force_sslverify_callback() {
242
  $value = get_option( 'force_sslverify', null );
243
  $html = '<input type="checkbox" id="force_sslverify" name="force_sslverify" value="1" ' .
244
  checked( 1, get_option( 'force_sslverify' ), false ) . '/>';
245
- $html .= __( '<label>Force</label><br /><small>Updates and licenses checks are usually made without checking SSL certificates and it is actually fine this way. But if you are intransigent when it comes to SSL matters, this option will force it.</small>', 'meowapps' );
246
- echo $html;
247
  }
248
 
249
  function display_serialkey_box( $url = "https://meowapps.com/" ) {
250
  $html = '<div class="meow-box">';
251
- $html .= '<h3 class="' . ( $this->is_registered( $this->prefix ) ? 'meow-bk-blue' : 'meow-bk-red' ) . '">Pro Version ' .
252
- ( $this->is_registered( $this->prefix ) ? '(enabled)' : '(disabled)' ) . '</h3>';
253
- $html .= '<div class="inside">';
 
 
254
  echo $html;
255
- $html = apply_filters( $this->prefix . '_meowapps_license_input', ( 'More information about the Pro version here:
256
- <a target="_blank" href="' . $url . '">' . $url . '</a>. If you actually bought the Pro version already, please remove the current plugin and download the Pro version from your account at the <a target="_blank" href="https://store.meowapps.com/account/downloads/">Meow Apps Store</a>.' ), $url );
257
- $html .= '</div>';
258
- $html .= '</div>';
 
 
 
 
259
  echo $html;
260
  }
261
 
@@ -271,7 +291,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
271
  $pluginpath = trailingslashit( plugin_dir_path( __FILE__ ) ) . '../../' . $plugin;
272
  if ( !file_exists( $pluginpath ) ) {
273
  $url = wp_nonce_url( "update.php?action=install-plugin&plugin=$plugin", "install-plugin_$plugin" );
274
- return "<a href='$url'><small><span class='' style='float: right;'>install</span></small></a>";
275
  }
276
  }
277
  else {
@@ -293,12 +313,12 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
293
  'activate-plugin_' . $plugin_file );
294
  return '<small><span style="color: black; float: right;">off
295
  (<a style="color: rgba(30,140,190,1); text-decoration: none;" href="' .
296
- $url . '">enable</a>)</span></small>';
297
  }
298
  }
299
 
300
  function common_url( $file ) {
301
- die( "Meow Apps: The function common_url( \$file ) needs to be overriden." );
302
  // Normally, this should be used:
303
  // return plugin_dir_url( __FILE__ ) . ( '\/common\/' . $file );
304
  }
@@ -309,8 +329,8 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
309
 
310
  function plugins_loaded() {
311
  if ( isset( $_GET[ 'tool' ] ) && $_GET[ 'tool' ] == 'error_log' ) {
312
- $sec = "5";
313
- header( "Refresh: $sec;" );
314
  }
315
  }
316
 
@@ -318,7 +338,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
318
 
319
  echo '<div class="wrap meow-dashboard">';
320
  if ( isset( $_GET['tool'] ) && $_GET['tool'] == 'phpinfo' ) {
321
- echo "<a href=\"javascript:history.go(-1)\">< Go back</a><br /><br />";
322
  echo '<div id="phpinfo">';
323
  ob_start();
324
  phpinfo();
@@ -329,20 +349,25 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
329
  echo "</div>";
330
  }
331
  else if ( isset( $_GET['tool'] ) && $_GET['tool'] == 'error_log' ) {
332
- $log_msg = '=== MEOW APPS DEBUG (This is not an error) ===';
333
  if ( isset( $_POST['write_logs'] ) ) {
334
  error_log( $log_msg );
335
  }
336
  $errorpath = ini_get( 'error_log' );
337
- echo "<a href=\"javascript:history.go(-1)\">< Go back</a><br /><br />";
338
  echo '
339
  <form method="post">
340
  <input type="hidden" name="write_logs" value="true">
341
- <input class="button button-primary" type="submit" value="Write in the Error Logs">
342
  </form><br />';
343
  echo '<div id="error_log">';
344
  if ( file_exists( $errorpath ) ) {
345
- echo "Now (auto-reload every 5 seconds): [" . date( "d-M-Y H:i:s", time() ) . " UTC]<br /><br /><h2 style='margin: 0px;'>Errors (order by latest)</h2>";
 
 
 
 
 
346
  $errors = file_get_contents( $errorpath );
347
  $errors = explode( "\n", $errors );
348
  $errors = array_reverse( $errors );
@@ -350,7 +375,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
350
  echo $errors;
351
  }
352
  else {
353
- echo "The PHP Error Logs cannot be found. Please ask your hosting service for it.";
354
  }
355
  echo "</div>";
356
 
@@ -360,31 +385,30 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
360
  ?>
361
  <?php $this->display_title( 'Meow Apps' ); ?>
362
  <p>
363
- <?php _e( 'Meow Apps is run by Jordy Meow, a photographer and software developer living in Japan (and taking <a target="_blank" href="http://offbeatjapan.org">a lot of photos</a>). Meow Apps is a suite of plugins focusing on photography, imaging, optimization and it teams up with the best players in the community (other themes and plugins developers). For more information, please check <a href="http://meowapps.com" target="_blank">Meow Apps</a>.', 'meowapps' )
364
  ?>
365
  </p>
366
-
367
- <h2 style="margin-bottom: 0px; margin-top: 25px;">Featured Plugins</h2>
368
  <div class="meow-row meow-featured-plugins">
369
  <div class="meow-box meow-col meow-span_1_of_2">
370
  <ul class="">
371
  <li><img src='<?= $this->common_url( 'img/media-cleaner.jpg' ) ?>' />
372
  <a href='https://meowapps.com/plugin/media-cleaner/'><b>Media Cleaner</b></a>
373
  <?php echo $this->check_install( 'media-cleaner' ) ?><br />
374
- Detect the files which are not in use.</li>
375
  <li><img src='<?= $this->common_url( 'img/media-file-renamer.jpg' ) ?>' />
376
  <a href='https://meowapps.com/plugin/media-file-renamer/'><b>Media File Renamer</b></a>
377
- <?php echo $this->check_install( 'media-file-renamer' ) ?><br />
378
- For nicer filenames and a better SEO.</li>
379
  <li><img src='<?= $this->common_url( 'img/default.png' ) ?>' />
380
  <a href='https://meowapps.com/plugin/contact-form-block/'><b>Contact Form Block</b></a>
381
  <?php echo $this->check_install( 'contact-form-block' ) ?><br />
382
- A simpler, nicer, prettier contact form.</li>
383
- <!--li><img src='<?= $this->common_url( 'img/wp-retina-2x.jpg' ) ?>' />
384
- <a href='https://meowapps.com/plugin/wp-retina-2x/'><b>WP Retina 2x</b></a>
385
- <?php echo $this->check_install( 'wp-retina-2x' ) ?><br />
386
- The famous plugin that adds Retina support.</li-->
387
-
388
  </ul>
389
  </div>
390
  <div class="meow-box meow-col meow-span_1_of_2 ">
@@ -392,41 +416,63 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
392
  <li><img src='<?= $this->common_url( 'img/meow-gallery.jpg' ) ?>' />
393
  <a href='https://meowapps.com/plugin/meow-gallery/'><b>Meow Gallery</b></a>
394
  <?php echo $this->check_install( 'meow-gallery' ) ?><br />
395
- Beautiful but lightweight gallery with many layouts. The only one that allows you to uninstall it without losing anything.</li>
396
  <li><img src='<?= $this->common_url( 'img/meow-lightbox.jpg' ) ?>' />
397
  <a href='https://meowapps.com/plugin/meow-lightbox/'><b>Meow Lightbox</b></a>
398
  <?php echo $this->check_install( 'meow-lightbox' ) ?><br />
399
- Pretty and ultra-optimized Lightbox which can also display your EXIF data. You will love it.</li>
400
  <li><img src='<?= $this->common_url( 'img/wplr-sync.jpg' ) ?>' />
401
  <a href='https://meowapps.com/plugin/wplr-sync/'><b>WP/LR Sync</b></a>
402
  <?php echo $this->check_install( 'wplr-sync' ) ?><br />
403
- Synchronize your Lightroom to your WordPress. This plugin is loved by all the photographers using Lightroom and WordPress.</li>
 
 
 
 
404
  </ul>
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 ($) {
@@ -436,7 +482,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
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
 
@@ -455,7 +501,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
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
  });
@@ -472,8 +518,8 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
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
 
@@ -483,30 +529,31 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
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'>
496
- SEO Checklist & Optimization</a>,
497
  <a href='https://meowapps.com/clean-optimize-wordpress/' target='_blank'>
498
- Clean Up and Optimize</a>,
499
  <a href='https://meowapps.com/optimize-images-cdn/' target='_blank'>
500
- Optimize Images</a>,
501
  <a href='https://meowapps.com/best-hosting-services-wordpress/' target='_blank'>
502
  Best Hosting Services</a>.
503
  </p>
504
  </div>
505
 
506
- <h2 style="margin-bottom: 0px; margin-top: 25px;">Common Options & Tools</h2>
507
  <div class="meow-row">
508
  <div class="meow-box meow-col meow-span_2_of_3">
509
- <h3><span class="dashicons dashicons-admin-tools"></span> Common</h3>
510
  <div class="inside">
511
  <form method="post" action="options.php">
512
  <?php settings_fields( 'meowapps_common_settings' ); ?>
@@ -517,17 +564,17 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
517
  </div>
518
 
519
  <div class="meow-box meow-col meow-span_1_of_3">
520
- <h3><span class="dashicons dashicons-admin-tools"></span> Debug</h3>
521
  <div class="inside">
522
  <ul>
523
- <li><a href="?page=meowapps-main-menu&amp;tool=error_log">Display Error Log</a></li>
524
- <li><a href="?page=meowapps-main-menu&amp;tool=phpinfo">Display PHP Info</a></li>
525
  </ul>
526
  </div>
527
  </div>
528
 
529
  <div class="meow-box meow-col meow-span_1_of_3">
530
- <h3><span class="dashicons dashicons-admin-tools"></span> Post Types (used by this install)</h3>
531
  <div class="inside">
532
  <?php
533
  global $wpdb;
@@ -537,7 +584,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
537
  $result = array();
538
  foreach( $types as $type )
539
  array_push( $result, "{$type->type} ({$type->count})" );
540
- echo implode( $result, ', ' );
541
  ?>
542
  </div>
543
  </div>
@@ -548,8 +595,12 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
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
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.6";
11
 
12
  public $prefix; // prefix used for actions, filters (mfrh)
13
  public $mainfile; // plugin main file (media-file-renamer.php)
52
  }
53
  }
54
  }
55
+
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.', $this->domain );
61
  }
62
 
63
  function wp_ajax_meow_file_check() {
64
  $tmpfile = wp_tempnam();
65
  unlink( $tmpfile );
66
+ // translators: %s is a filename of an empty temporary file
67
+ return sprintf( __( 'Created and deleted %s', $this->domain ), $tmpfile );
68
  }
69
 
70
  function request_verify_ssl() {
107
  }
108
  $rating_date = get_option( $this->prefix . '_rating_date' );
109
  echo '<div class="notice notice-success" data-rating-date="' . date( 'Y-m-d', $rating_date ) . '">';
110
+ echo '<p style="font-size: 100%;">';
111
+ printf(
112
+ // translators: %1$s is a plugin nicename, %2$s is a short url (slug)
113
+ __( 'You have been using <b>%1$s</b> for some time now. Thank you! Could you kindly share your opinion with me, along with, maybe, features you would like to see implemented? Then, please <a style="font-weight: bold; color: #b926ff;" target="_blank" href="https://wordpress.org/support/plugin/%2$s/reviews/?rate=5#new-post">write a little review</a>. That will also bring me joy and motivation, and I will get back to you :) <u>In the case you already have written a review</u>, please check again. Many reviews got removed from WordPress recently.', $this->domain ),
114
+ $this->nice_name_from_file( $this->mainfile ),
115
+ $this->nice_short_url_from_file( $this->mainfile )
116
+ );
117
  echo '<p>
118
  <form method="post" action="" style="float: right;">
119
  <input type="hidden" name="' . $this->prefix . '_never_remind_me" value="true">
120
+ <input type="submit" name="submit" id="submit" class="button button-red" value="'
121
+ . __( 'Never remind me!', $this->domain ) . '">
122
  </form>
123
  <form method="post" action="" style="float: right; margin-right: 10px;">
124
  <input type="hidden" name="' . $this->prefix . '_remind_me" value="true">
125
+ <input type="submit" name="submit" id="submit" class="button button-primary" value="'
126
+ . __( 'Remind me in a few weeks...', $this->domain ) . '">
127
  </form>
128
  <form method="post" action="" style="float: right; margin-right: 10px;">
129
  <input type="hidden" name="' . $this->prefix . '_did_it" value="true">
130
+ <input type="submit" name="submit" id="submit" class="button button-primary" value="'
131
+ . __( 'Yes, I did it!', $this->domain ) . '">
132
  </form>
133
  <div style="clear: both;"></div>
134
  </p>
164
  return;
165
  }
166
  echo '<div class="error">';
167
+ printf(
168
+ // translators: %s is a plugin nicename
169
+ __( '<p>It looks like you are using the free version of the plugin (<b>%s</b>) but a license for the Pro version was also found. The Pro version might have been replaced by the Free version during an update (might be caused by a temporarily issue). If it is the case, <b>please download it again</b> from the <a target="_blank" href="https://store.meowapps.com">Meow Store</a>. If you wish to continue using the free version and clear this message, click on this button.', $this->domain ),
170
+ $this->nice_name_from_file( $this->mainfile ) );
171
  echo '<p>
172
  <form method="post" action="">
173
  <input type="hidden" name="' . $this->prefix . '_reset_sub" value="true">
174
+ <input type="submit" name="submit" id="submit" class="button" value="'
175
+ . __( 'Remove the license', $this->domain ) . '">
176
  </form>
177
  </p>
178
  ';
216
  if ( !isset( $submenu[ 'meowapps-main-menu' ] ) ) {
217
  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',
218
  array( $this, 'admin_meow_apps' ), '', 82 );
219
+ add_submenu_page( 'meowapps-main-menu', __( 'Dashboard', $this->domain ),
220
+ __( 'Dashboard', $this->domain ), 'manage_options',
221
  'meowapps-main-menu', array( $this, 'admin_meow_apps' ) );
222
  }
223
 
224
  add_settings_section( 'meowapps_common_settings', null, null, 'meowapps_common_settings-menu' );
225
+ add_settings_field( 'meowapps_hide_meowapps', __( 'Main Menu', $this->domain ),
226
  array( $this, 'meowapps_hide_dashboard_callback' ),
227
  'meowapps_common_settings-menu', 'meowapps_common_settings' );
228
+ add_settings_field( 'meowapps_force_sslverify', __( 'SSL Verify', $this->domain ),
229
  array( $this, 'meowapps_force_sslverify_callback' ),
230
  'meowapps_common_settings-menu', 'meowapps_common_settings' );
231
+ // add_settings_field( 'meowapps_hide_ads', __( 'Ads', $this->domain ),
232
  // array( $this, 'meowapps_hide_ads_callback' ),
233
  // 'meowapps_common_settings-menu', 'meowapps_common_settings' );
234
  register_setting( 'meowapps_common_settings', 'force_sslverify' );
240
  $value = get_option( 'meowapps_hide_ads', null );
241
  $html = '<input type="checkbox" id="meowapps_hide_ads" name="meowapps_hide_ads" value="1" ' .
242
  checked( 1, get_option( 'meowapps_hide_ads' ), false ) . '/>';
243
+ $html .= __( '<label>Hide</label><br /><small>Doesn\'t display the ads.</small>', $this->domain );
244
+ echo $html;
245
  }
246
 
247
  function meowapps_hide_dashboard_callback() {
248
  $value = get_option( 'meowapps_hide_meowapps', null );
249
  $html = '<input type="checkbox" id="meowapps_hide_meowapps" name="meowapps_hide_meowapps" value="1" ' .
250
  checked( 1, get_option( 'meowapps_hide_meowapps' ), false ) . '/>';
251
+ $html .= __( '<label>Hide <b>Meow Apps</b> Menu</label><br /><small>Hide Meow Apps menu and all its components, for a cleaner admin. This option will be reset if a new Meow Apps plugin is installed. <b>Once activated, an option will be added in your General settings to display it again.</b></small>', $this->domain );
252
+ echo $html;
253
  }
254
 
255
  function meowapps_force_sslverify_callback() {
256
  $value = get_option( 'force_sslverify', null );
257
  $html = '<input type="checkbox" id="force_sslverify" name="force_sslverify" value="1" ' .
258
  checked( 1, get_option( 'force_sslverify' ), false ) . '/>';
259
+ $html .= __( '<label>Force</label><br /><small>Updates and licenses checks are usually made without checking SSL certificates and it is actually fine this way. But if you are intransigent when it comes to SSL matters, this option will force it.</small>', $this->domain );
260
+ echo $html;
261
  }
262
 
263
  function display_serialkey_box( $url = "https://meowapps.com/" ) {
264
  $html = '<div class="meow-box">';
265
+ $html .= '<h3 class="' . ( $this->is_registered( $this->prefix ) ? 'meow-bk-blue' : 'meow-bk-red' ) . '">'
266
+ . __( 'Pro Version', $this->domain ) . ' '
267
+ . ( $this->is_registered( $this->prefix ) ? __( '(enabled)', $this->domain ) : __( '(disabled)', $this->domain ) )
268
+ . '</h3>';
269
+ $html .= '<div class="inside">';
270
  echo $html;
271
+ $html = apply_filters(
272
+ $this->prefix . '_meowapps_license_input',
273
+ sprintf(
274
+ // translators: %1$s is a url attribute, %2$s is a url visible for user
275
+ __( 'More information about the Pro version here: <a target="_blank" href="%1$s">%2$s</a>. If you actually bought the Pro version already, please remove the current plugin and download the Pro version from your account at the <a target="_blank" href="https://store.meowapps.com/account/downloads/">Meow Apps Store</a>.', $this->domain ), $url, $url ),
276
+ $url );
277
+ $html .= '</div>';
278
+ $html .= '</div>';
279
  echo $html;
280
  }
281
 
291
  $pluginpath = trailingslashit( plugin_dir_path( __FILE__ ) ) . '../../' . $plugin;
292
  if ( !file_exists( $pluginpath ) ) {
293
  $url = wp_nonce_url( "update.php?action=install-plugin&plugin=$plugin", "install-plugin_$plugin" );
294
+ return "<a href='$url'><small><span class='' style='float: right;'>" . __( 'install', $this->domain ) . "</span></small></a>";
295
  }
296
  }
297
  else {
313
  'activate-plugin_' . $plugin_file );
314
  return '<small><span style="color: black; float: right;">off
315
  (<a style="color: rgba(30,140,190,1); text-decoration: none;" href="' .
316
+ $url . '">' . __( 'enable', $this->domain ) . '</a>)</span></small>';
317
  }
318
  }
319
 
320
  function common_url( $file ) {
321
+ die( __( "Meow Apps: The function common_url( \$file ) needs to be overriden.", $this->domain ) );
322
  // Normally, this should be used:
323
  // return plugin_dir_url( __FILE__ ) . ( '\/common\/' . $file );
324
  }
329
 
330
  function plugins_loaded() {
331
  if ( isset( $_GET[ 'tool' ] ) && $_GET[ 'tool' ] == 'error_log' ) {
332
+ $sec = "5";
333
+ header( "Refresh: $sec;" );
334
  }
335
  }
336
 
338
 
339
  echo '<div class="wrap meow-dashboard">';
340
  if ( isset( $_GET['tool'] ) && $_GET['tool'] == 'phpinfo' ) {
341
+ echo "<a href=\"javascript:history.go(-1)\">< ". __( 'Go back', $this->domain ) . "</a><br /><br />";
342
  echo '<div id="phpinfo">';
343
  ob_start();
344
  phpinfo();
349
  echo "</div>";
350
  }
351
  else if ( isset( $_GET['tool'] ) && $_GET['tool'] == 'error_log' ) {
352
+ $log_msg = __( '=== MEOW APPS DEBUG (This is not an error) ===', $this->domain );
353
  if ( isset( $_POST['write_logs'] ) ) {
354
  error_log( $log_msg );
355
  }
356
  $errorpath = ini_get( 'error_log' );
357
+ echo "<a href=\"javascript:history.go(-1)\">< ". __( 'Go back', $this->domain ) . "</a><br /><br />";
358
  echo '
359
  <form method="post">
360
  <input type="hidden" name="write_logs" value="true">
361
+ <input class="button button-primary" type="submit" value=" ' . __( 'Write in the Error Logs', $this->domain ) . '">
362
  </form><br />';
363
  echo '<div id="error_log">';
364
  if ( file_exists( $errorpath ) ) {
365
+ printf(
366
+ // translators: %s is a preformatted timestamp
367
+ __( "Now (auto-reload every 5 seconds): [%s UTC]", $this->domain ),
368
+ date( "d-M-Y H:i:s", time() )
369
+ );
370
+ echo "<br /><br /><h2 style='margin: 0px;'>" . __( 'Errors (order by latest)', $this->domain ) . "</h2>";
371
  $errors = file_get_contents( $errorpath );
372
  $errors = explode( "\n", $errors );
373
  $errors = array_reverse( $errors );
375
  echo $errors;
376
  }
377
  else {
378
+ _e( "The PHP Error Logs cannot be found. Please ask your hosting service for it.", $this->domain );
379
  }
380
  echo "</div>";
381
 
385
  ?>
386
  <?php $this->display_title( 'Meow Apps' ); ?>
387
  <p>
388
+ <?php _e( 'Meow Apps is run by Jordy Meow, a photographer and software developer living in Japan (and taking <a target="_blank" href="http://offbeatjapan.org">a lot of photos</a>). Meow Apps is a suite of plugins focusing on photography, imaging, optimization and it teams up with the best players in the community (other themes and plugins developers). For more information, please check <a href="http://meowapps.com" target="_blank">Meow Apps</a>.', $this->domain )
389
  ?>
390
  </p>
391
+
392
+ <h2 style="margin-bottom: 0px; margin-top: 25px;"><?php _e( 'Recommended Meow Apps Plugins', $this->domain ); ?></h2>
393
  <div class="meow-row meow-featured-plugins">
394
  <div class="meow-box meow-col meow-span_1_of_2">
395
  <ul class="">
396
  <li><img src='<?= $this->common_url( 'img/media-cleaner.jpg' ) ?>' />
397
  <a href='https://meowapps.com/plugin/media-cleaner/'><b>Media Cleaner</b></a>
398
  <?php echo $this->check_install( 'media-cleaner' ) ?><br />
399
+ <?php _e( 'Very complex plugin which analyzes your WordPress deeply to find out which files are in use, or not. Then you can trash them, before deleting them permanently.', $this->domain ); ?></li>
400
  <li><img src='<?= $this->common_url( 'img/media-file-renamer.jpg' ) ?>' />
401
  <a href='https://meowapps.com/plugin/media-file-renamer/'><b>Media File Renamer</b></a>
402
+ <?php echo $this->check_install( 'media-file-renamer' ) ?><br />
403
+ <?php _e( 'The Renamer will help you in getting nicer filenames, a better SEO and well-organized files. Extremely popular.', $this->domain ); ?></li>
404
  <li><img src='<?= $this->common_url( 'img/default.png' ) ?>' />
405
  <a href='https://meowapps.com/plugin/contact-form-block/'><b>Contact Form Block</b></a>
406
  <?php echo $this->check_install( 'contact-form-block' ) ?><br />
407
+ <?php _e( 'A simpler, nicer, prettier contact form. If you simply want your visitors to get in touch with you, this very light plugin will make your life easier.', $this->domain ); ?></li>
408
+ <li><img src='<?= $this->common_url( 'img/default.png' ) ?>' />
409
+ <a href='https://meowapps.com/plugin/meow-analytics/'><b>Meow Analytics</b></a>
410
+ <?php echo $this->check_install( 'meow-analytics' ) ?><br />
411
+ <?php _e( 'Tired of those fat plugins which are messing-up with your install? Switch to Meow Analytics, it\'s extremely light and features a cute dashboard.', $this->domain ); ?></li>
 
412
  </ul>
413
  </div>
414
  <div class="meow-box meow-col meow-span_1_of_2 ">
416
  <li><img src='<?= $this->common_url( 'img/meow-gallery.jpg' ) ?>' />
417
  <a href='https://meowapps.com/plugin/meow-gallery/'><b>Meow Gallery</b></a>
418
  <?php echo $this->check_install( 'meow-gallery' ) ?><br />
419
+ <?php _e( 'Beautiful but lightweight gallery with many layouts. The only one that allows you to uninstall it without losing anything.', $this->domain ); ?></li>
420
  <li><img src='<?= $this->common_url( 'img/meow-lightbox.jpg' ) ?>' />
421
  <a href='https://meowapps.com/plugin/meow-lightbox/'><b>Meow Lightbox</b></a>
422
  <?php echo $this->check_install( 'meow-lightbox' ) ?><br />
423
+ <?php _e( 'A very smooth and fast Lightbox which will also display your EXIF data (camera, lens, etc). Try it, you will love it.', $this->domain ); ?></li>
424
  <li><img src='<?= $this->common_url( 'img/wplr-sync.jpg' ) ?>' />
425
  <a href='https://meowapps.com/plugin/wplr-sync/'><b>WP/LR Sync</b></a>
426
  <?php echo $this->check_install( 'wplr-sync' ) ?><br />
427
+ <?php _e( 'Synchronize your Lightroom to your WordPress. This plugin is loved by a huge community of photographers.', $this->domain ); ?></li>
428
+ <li><img src='<?= $this->common_url( 'img/wp-retina-2x.jpg' ) ?>' />
429
+ <a href='https://meowapps.com/plugin/wp-retina-2x/'><b>WP Retina 2x</b></a>
430
+ <?php echo $this->check_install( 'wp-retina-2x' ) ?><br />
431
+ <?php _e( 'Here is the very famous plugin that adds Retina support to any website.', $this->domain ); ?></li>
432
  </ul>
433
  </div>
434
  </div>
435
 
436
+ <h2><?php _e( 'WordPress Performance', $this->domain ); ?></h2>
437
  <div style="background: white; padding: 5px 15px 5px 15px; box-shadow: 2px 2px 1px rgba(0,0,0,.02); margin-bottom: 15px;">
438
+ <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>.', $this->domain ); ?></p>
439
  </div>
440
 
441
+ <div>
442
+
443
+ <div style="float: left; margin-right: 10px; text-align: center; padding: 10px; background: white; width: 200px; border: 1px solid #e2e2e2;">
444
+ <div style='font-size: 14px; line-height: 14px; margin-bottom: 20px;'><?php _e( 'Empty Request Time', $this->domain ); ?></div>
445
+ <div style='font-size: 32px; line-height: 32px; margin-bottom: 10px;' id='meow-perf-load-average'><?php _e( 'N/A', $this->domain ); ?></div>
446
+ <div style='font-size: 12px; line-height: 12px; margin-bottom: 20px;'><?php _e( 'Based on', $this->domain ); ?>
447
+ <span id='meow-perf-load-count'>0</span> <?php _e( 'request(s)', $this->domain ); ?>
448
+ </div>
449
+ <input type='submit' style='text-align: center; width: 100%;' id="meow-perf-reset" value="Reset" class="button button-primary">
450
  </div>
 
 
 
 
 
 
 
 
 
451
 
452
+ <div style="float: left; margin-right: 10px; text-align: center; padding: 10px; background: white; width: 200px; border: 1px solid #e2e2e2;">
453
+ <div style='font-size: 14px; line-height: 14px; margin-bottom: 20px;'><?php _e( 'File Operation Time', $this->domain ); ?></div>
454
+ <div style='font-size: 32px; line-height: 32px; margin-bottom: 10px;' id='meow-file-check-time'><?php _e( 'N/A', $this->domain ); ?></div>
455
+ <div style='font-size: 12px; line-height: 12px; margin-bottom: 20px;'><?php _e( 'Create temporary file and delete it.', $this->domain ); ?></div>
456
+ <input type='submit' style='text-align: center; width: 100%;' id="meow-file-check-start" value="<?php _e( 'Check', $this->domain ); ?>" class="button button-primary">
457
+ </div>
458
+
459
+ <div style="float: left; margin-right: 10px; text-align: center; padding: 10px; background: white; width: 200px; border: 1px solid #e2e2e2;">
460
+ <a target='_blank' href='https://kinsta.com/?kaid=MFROFDOOINML'>
461
+ <img style='height: 116px;' src='<?= $this->common_url( 'img/kinsta.png' ) ?>'>
462
+ <div>Meow's 2020 Favorite Hosting</div>
463
+ </a>
464
+ </div>
465
+
466
+ <div style="float: left; margin-right: 10px; text-align: center; padding: 10px; background: white; width: 200px; border: 1px solid #e2e2e2;">
467
+ <a target='_blank' href='https://tracking.maxcdn.com/rPK13'>
468
+ <img style='height: 116px;' src='<?= $this->common_url( 'img/stackpath.png' ) ?>'>
469
+ <div>Meow's 2020 Favorite CDN</div>
470
+ </a>
471
+ </div>
472
+
473
+ <div style="clear: both;"></div>
474
+
475
+ </div>
476
 
477
  <script>
478
  (function ($) {
482
  $('#meow-perf-reset').on('click', function () {
483
  calls = 0;
484
  times = [];
485
+ $('#meow-perf-load-average').text('<?php _e( "N/A", $this->domain ); ?>');
486
  $('#meow-perf-load-count').text('0');
487
  });
488
 
501
  times.push(time);
502
  var sum = times.reduce(function(a, b) { return a + b; });
503
  var avg = Math.ceil(sum / times.length);
504
+ $('#meow-perf-load-average').text(avg + ' <?php _e( "ms", $this->domain ); ?>');
505
  $('#meow-perf-load-count').text(calls);
506
  setTimeout(perfLoad, 5000);
507
  });
518
  }).done(function (response) {
519
  var end = new Date().getTime();
520
  var time = end - start;
521
+ $('#meow-file-check-time').text(time + ' <?php _e( "ms", $this->domain ); ?>');
522
+ $('#meow-file-check-start').text('<?php _e( "Check", $this->domain ); ?>');
523
  });
524
  };
525
 
529
  });
530
 
531
  setTimeout(perfLoad, 1500);
532
+
533
  })(jQuery);
534
  </script>
535
 
536
+ <h2><?php _e( 'WordPress Recommendations', $this->domain ); ?></h2>
537
  <div style="background: white; padding: 5px 15px 5px 15px; box-shadow: 2px 2px 1px rgba(0,0,0,.02); margin-top: 15px;">
538
  <p>
539
+ <?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: ', $this->domain )?>
540
  <a href='https://meowapps.com/debugging-wordpress/' target='_blank'>
541
+ How To Debug</a>,
542
  <a href='https://meowapps.com/seo-optimization/' target='_blank'>
543
+ SEO Checklist & Optimization</a>,
544
  <a href='https://meowapps.com/clean-optimize-wordpress/' target='_blank'>
545
+ Clean Up and Optimize</a>,
546
  <a href='https://meowapps.com/optimize-images-cdn/' target='_blank'>
547
+ Optimize Images</a>,
548
  <a href='https://meowapps.com/best-hosting-services-wordpress/' target='_blank'>
549
  Best Hosting Services</a>.
550
  </p>
551
  </div>
552
 
553
+ <h2 style="margin-bottom: 0px; margin-top: 25px;"><?php _e( 'Common Options & Tools', $this->domain ); ?></h2>
554
  <div class="meow-row">
555
  <div class="meow-box meow-col meow-span_2_of_3">
556
+ <h3><span class="dashicons dashicons-admin-tools"></span> <?php _e( 'Common', $this->domain ); ?></h3>
557
  <div class="inside">
558
  <form method="post" action="options.php">
559
  <?php settings_fields( 'meowapps_common_settings' ); ?>
564
  </div>
565
 
566
  <div class="meow-box meow-col meow-span_1_of_3">
567
+ <h3><span class="dashicons dashicons-admin-tools"></span> <?php _e( 'Debug', $this->domain ); ?></h3>
568
  <div class="inside">
569
  <ul>
570
+ <li><a href="?page=meowapps-main-menu&amp;tool=error_log"><?php _e( 'Display Error Log', $this->domain ); ?></a></li>
571
+ <li><a href="?page=meowapps-main-menu&amp;tool=phpinfo"><?php _e( 'Display PHP Info', $this->domain ); ?></a></li>
572
  </ul>
573
  </div>
574
  </div>
575
 
576
  <div class="meow-box meow-col meow-span_1_of_3">
577
+ <h3><span class="dashicons dashicons-admin-tools"></span> <?php _e( 'Post Types (used by this install)', $this->domain ); ?></h3>
578
  <div class="inside">
579
  <?php
580
  global $wpdb;
584
  $result = array();
585
  foreach( $types as $type )
586
  array_push( $result, "{$type->type} ({$type->count})" );
587
+ echo implode( ', ', $result );
588
  ?>
589
  </div>
590
  </div>
595
  }
596
 
597
  function admin_footer_text( $current ) {
598
+ return sprintf(
599
+ // translators: %1$s is the version of the interface; %2$s is a file path.
600
+ __( 'Thanks for using <a href="https://meowapps.com">Meow Apps</a>! This is the Meow Admin %1$s <br /><i>Loaded from %2$s </i>', $this->domain ),
601
+ MeowApps_Admin::$admin_version,
602
+ __FILE__
603
+ );
604
  }
605
 
606
  // HELPERS
common/img/default.png CHANGED
Binary file
common/img/kinsta.png ADDED
Binary file
common/img/media-cleaner.jpg CHANGED
Binary file
common/img/media-file-renamer.jpg CHANGED
Binary file
common/img/meow-gallery.jpg CHANGED
Binary file
common/img/meow-lightbox.jpg CHANGED
Binary file
common/img/meowapps.png CHANGED
Binary file
common/img/stackpath.png ADDED
Binary file
common/img/wp-retina-2x.jpg CHANGED
Binary file
common/img/wplr-sync.jpg CHANGED
Binary file
gallery-custom-links.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Gallery Custom Links
4
  Plugin URI: https://meowapps.com
5
  Description: Gallery Custom Links allows you to link images from galleries to a specified URL. Tested with WordPress Gallery, Gutenberg, the Meow Gallery and others.
6
- Version: 1.2.5
7
  Author: Jordy Meow
8
  Author URI: https://meowapps.com
9
  Text Domain: gallery-custom-links
@@ -23,7 +23,7 @@ if ( class_exists( 'Meow_Gallery_Custom_Links' ) ) {
23
  }
24
 
25
  global $mgcl_version;
26
- $mgcl_version = '1.2.5';
27
 
28
  include "mgcl_admin.php";
29
  $mgcl_admin = new Meow_Gallery_Custom_Links_Admin( 'mgcl', __FILE__, 'gallery-custom-links' );
3
  Plugin Name: Gallery Custom Links
4
  Plugin URI: https://meowapps.com
5
  Description: Gallery Custom Links allows you to link images from galleries to a specified URL. Tested with WordPress Gallery, Gutenberg, the Meow Gallery and others.
6
+ Version: 1.2.6
7
  Author: Jordy Meow
8
  Author URI: https://meowapps.com
9
  Text Domain: gallery-custom-links
23
  }
24
 
25
  global $mgcl_version;
26
+ $mgcl_version = '1.2.6';
27
 
28
  include "mgcl_admin.php";
29
  $mgcl_admin = new Meow_Gallery_Custom_Links_Admin( 'mgcl', __FILE__, 'gallery-custom-links' );
mgcl_admin.php CHANGED
@@ -39,20 +39,20 @@ class Meow_Gallery_Custom_Links_Admin extends MeowApps_Admin { // extends MeowAp
39
  '</option>
40
  </select>'
41
  );
 
42
  $rel_value = get_post_meta( $post->ID, '_gallery_link_rel', true );
43
  $fields['gallery_link_rel'] = array(
44
  'label' => __( 'Link Rel', 'gallery-custom-links' ),
45
- 'input' => 'html',
46
- 'html' => '
47
- <select class="widefat" name="attachments[' . $post->ID . '][gallery_link_rel]" id="attachments[' . $post->ID . '][gallery_link_rel]">
48
- <option value=""' . ( $rel_value == '' ? ' selected="selected"' : '' ) . '>' .
49
- __( 'None', 'gallery-custom-links' ) .
50
- '</option>
51
- <option value="nofollow"' . ( $rel_value == 'nofollow' ? ' selected="selected"' : '' ) . '>' .
52
- __( 'No Follow', 'gallery-custom-links' ) .
53
- '</option>
54
- </select>'
55
- );
56
  return $fields;
57
  }
58
 
@@ -63,6 +63,9 @@ class Meow_Gallery_Custom_Links_Admin extends MeowApps_Admin { // extends MeowAp
63
  update_post_meta( $post['ID'], '_gallery_link_target', $attachment['gallery_link_target'] );
64
  if ( isset( $attachment['gallery_link_rel'] ) )
65
  update_post_meta( $post['ID'], '_gallery_link_rel', $attachment['gallery_link_rel'] );
 
 
 
66
  return $post;
67
  }
68
 
39
  '</option>
40
  </select>'
41
  );
42
+ // XXXX: Custom modification to add "noopener noreferrer" als REL-option, Christoph Letmaier, 14.01.2020
43
  $rel_value = get_post_meta( $post->ID, '_gallery_link_rel', true );
44
  $fields['gallery_link_rel'] = array(
45
  'label' => __( 'Link Rel', 'gallery-custom-links' ),
46
+ 'input' => 'text',
47
+ 'value' => get_post_meta( $post->ID, '_gallery_link_rel', true )
48
+ );
49
+ // XXXX: Custom code for new aria-label field, Christoph Letmaier, 14.01.2020
50
+ $fields['gallery_link_aria'] = array(
51
+ 'label' => __( 'Arial Label', 'gallery-custom-links' ),
52
+ 'input' => 'text',
53
+ 'value' => get_post_meta( $post->ID, '_gallery_link_aria', true )
54
+ );
55
+
 
56
  return $fields;
57
  }
58
 
63
  update_post_meta( $post['ID'], '_gallery_link_target', $attachment['gallery_link_target'] );
64
  if ( isset( $attachment['gallery_link_rel'] ) )
65
  update_post_meta( $post['ID'], '_gallery_link_rel', $attachment['gallery_link_rel'] );
66
+ // XXXX: Custom code for saving _gallery_link_aria, Christoph Letmaier, 14.01.2020
67
+ if ( isset( $attachment['gallery_link_aria'] ) )
68
+ update_post_meta( $post['ID'], '_gallery_link_aria', $attachment['gallery_link_aria'] );
69
  return $post;
70
  }
71
 
mgcl_core.php CHANGED
@@ -126,17 +126,21 @@ class Meow_Gallery_Custom_Links
126
  if ( !empty( $url ) ) {
127
  $target = get_post_meta( $mediaId, '_gallery_link_target', true );
128
  $rel = get_post_meta( $mediaId, '_gallery_link_rel', true );
 
 
129
  if ( empty( $target ) )
130
  $target = '_self';
131
  $parent = $element->parent();
132
  if ( $this->enableLogs ) {
133
  error_log( 'Linker: Found Media ' . $mediaId . ' (URL: ' . $url . ')' );
134
  }
135
- $handled = apply_filters( 'mgcl_linkers', false, $element, $parent, $mediaId, $url, $rel, $target );
 
136
  if ( !$handled ) {
137
  include_once( "mgcl_linker.php" );
138
  $linker = new Meow_Gallery_Custom_Links_Linker( $this );
139
- $linker->linker( $element, $parent, $mediaId, $url, $rel, $target );
 
140
  }
141
  return true;
142
  }
@@ -181,7 +185,10 @@ class Meow_Gallery_Custom_Links
181
  function shutdown() {
182
  if ( !$this->isEnabled )
183
  return;
184
- @ob_end_flush();
 
 
 
185
  }
186
 
187
  function unlink_lightboxes_script() {
126
  if ( !empty( $url ) ) {
127
  $target = get_post_meta( $mediaId, '_gallery_link_target', true );
128
  $rel = get_post_meta( $mediaId, '_gallery_link_rel', true );
129
+ // XXXX: Custom code for fetching _gallery_link_aria, Christoph Letmaier, 14.01.2020
130
+ $aria = get_post_meta( $mediaId, '_gallery_link_aria', true );
131
  if ( empty( $target ) )
132
  $target = '_self';
133
  $parent = $element->parent();
134
  if ( $this->enableLogs ) {
135
  error_log( 'Linker: Found Media ' . $mediaId . ' (URL: ' . $url . ')' );
136
  }
137
+ // XXXX: Custom code with $aria Christoph Letmaier, 14.01.2020
138
+ $handled = apply_filters( 'mgcl_linkers', false, $element, $parent, $mediaId, $url, $rel, $aria, $target );
139
  if ( !$handled ) {
140
  include_once( "mgcl_linker.php" );
141
  $linker = new Meow_Gallery_Custom_Links_Linker( $this );
142
+ // XXXX: Custom code with $aria Christoph Letmaier, 14.01.2020
143
+ $linker->linker( $element, $parent, $mediaId, $url, $rel, $aria, $target );
144
  }
145
  return true;
146
  }
185
  function shutdown() {
186
  if ( !$this->isEnabled )
187
  return;
188
+ // SUPPORT: https://wordpress.org/support/topic/shutdown-function-flush-output-buffer/
189
+ while ( ob_get_level() > 0 ) {
190
+ ob_end_flush();
191
+ }
192
  }
193
 
194
  function unlink_lightboxes_script() {
mgcl_linker.php CHANGED
@@ -7,8 +7,10 @@ class Meow_Gallery_Custom_Links_Linker {
7
  //add_filter( 'mgcl_linkers', array( $this, 'linker' ), 100, 6 );
8
  }
9
 
10
- function linker( $element, $parent, $mediaId, $url, $rel, $target ) {
 
11
  // Let's look for the closest link tag enclosing the image
 
12
  $potentialLinkNode = $parent;
13
  $maxDepth = 5;
14
  do {
@@ -23,18 +25,28 @@ class Meow_Gallery_Custom_Links_Linker {
23
  $class = $potentialLinkNode->{'class'};
24
  $class = empty( $class ) ? 'custom-link no-lightbox' : ( $class . ' custom-link no-lightbox' );
25
  $potentialLinkNode->{'class'} = $class;
 
26
  $potentialLinkNode->{'onclick'} = 'event.stopPropagation()';
27
- $potentialLinkNode->{'target'} = $target;
28
- $potentialLinkNode->{'rel'} = $rel;
 
 
 
 
29
  }
30
  else {
31
  $potentialLinkNode->attr( 'href', $url );
32
  $class = $potentialLinkNode->attr( 'class' );
33
  $class = empty( $class ) ? 'custom-link no-lightbox' : ( $class . ' custom-link no-lightbox' );
34
  $potentialLinkNode->attr( 'class', $class );
 
35
  $potentialLinkNode->attr( 'onclick', 'event.stopPropagation()' );
36
- $potentialLinkNode->attr( 'target', $target );
37
- $potentialLinkNode->attr( 'rel', $rel );
 
 
 
 
38
  }
39
  return true;
40
  }
@@ -50,19 +62,22 @@ class Meow_Gallery_Custom_Links_Linker {
50
  error_log( 'Linker: Will embed the IMG tag.' );
51
  }
52
  if ( $this->core->parsingEngine === 'HtmlDomParser' ) {
53
- $element->outertext = '<a href="' . $url . '" class="custom-link no-lightbox" onclick="event.stopPropagation()" target="' .
54
- $target . '" rel="' . $rel . '">' . $element . '</a>';
55
  }
56
  else {
57
  if ( $parent->tag === 'figure' )
58
- $parent = $parent->parent();
59
  $a = new DiDom\Element('a');
60
  $a->attr( 'href', $url );
61
  $a->attr( 'class', 'custom-link no-lightbox' );
62
  $a->attr( 'onclick', 'event.stopPropagation()' );
63
  $a->attr( 'target', $target );
64
  $a->attr( 'rel', $rel );
 
 
65
  $a->appendChild( $parent->children() );
 
66
  foreach( $parent->children() as $img ) {
67
  $img->remove();
68
  }
7
  //add_filter( 'mgcl_linkers', array( $this, 'linker' ), 100, 6 );
8
  }
9
 
10
+ // XXXX: Custom code with $aria, Christoph Letmaier, 14.01.2020
11
+ function linker( $element, $parent, $mediaId, $url, $rel, $aria, $target ) {
12
  // Let's look for the closest link tag enclosing the image
13
+ $title = get_the_title( $mediaId );
14
  $potentialLinkNode = $parent;
15
  $maxDepth = 5;
16
  do {
25
  $class = $potentialLinkNode->{'class'};
26
  $class = empty( $class ) ? 'custom-link no-lightbox' : ( $class . ' custom-link no-lightbox' );
27
  $potentialLinkNode->{'class'} = $class;
28
+ $potentialLinkNode->{'title'} = $title;
29
  $potentialLinkNode->{'onclick'} = 'event.stopPropagation()';
30
+ if ( !empty( $target ) )
31
+ $potentialLinkNode->{'target'} = $target;
32
+ if ( !empty( $rel ) )
33
+ $potentialLinkNode->{'rel'} = $rel;
34
+ if ( !empty( $aria ) )
35
+ $potentialLinkNode->{'aria-label'} = $aria;
36
  }
37
  else {
38
  $potentialLinkNode->attr( 'href', $url );
39
  $class = $potentialLinkNode->attr( 'class' );
40
  $class = empty( $class ) ? 'custom-link no-lightbox' : ( $class . ' custom-link no-lightbox' );
41
  $potentialLinkNode->attr( 'class', $class );
42
+ $potentialLinkNode->attr( 'title', $title );
43
  $potentialLinkNode->attr( 'onclick', 'event.stopPropagation()' );
44
+ if ( !empty( $target ) )
45
+ $potentialLinkNode->attr( 'target', $target );
46
+ if ( !empty( $rel ) )
47
+ $potentialLinkNode->attr( 'rel', $rel );
48
+ if ( !empty( $aria ) )
49
+ $potentialLinkNode->attr{'aria-label'} = $aria;
50
  }
51
  return true;
52
  }
62
  error_log( 'Linker: Will embed the IMG tag.' );
63
  }
64
  if ( $this->core->parsingEngine === 'HtmlDomParser' ) {
65
+ // XXXX: Custom code with $aria, Christoph Letmaier, 22.01.2020
66
+ $element->outertext = '<a href="' . $url . '" class="custom-link no-lightbox" title="' . $title . '" aria-label="' . $aria . '" onclick="event.stopPropagation()" target="' . $target . '" rel="' . $rel . '">' . $element . '</a>';
67
  }
68
  else {
69
  if ( $parent->tag === 'figure' )
70
+ $parent = $parent->parent();
71
  $a = new DiDom\Element('a');
72
  $a->attr( 'href', $url );
73
  $a->attr( 'class', 'custom-link no-lightbox' );
74
  $a->attr( 'onclick', 'event.stopPropagation()' );
75
  $a->attr( 'target', $target );
76
  $a->attr( 'rel', $rel );
77
+ // XXXX: Custom code with $aria, Christoph Letmaier, 22.01.2020
78
+ $a->attr( 'aria-label', $aria );
79
  $a->appendChild( $parent->children() );
80
+
81
  foreach( $parent->children() as $img ) {
82
  $img->remove();
83
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://commerce.coinbase.com/checkout/d047546a-77a8-41c8-9ea9-4a95
5
  Requires at least: 5.0
6
  Tested up to: 5.3
7
  Requires PHP: 7.0
8
- Stable tag: 1.2.5
9
 
10
  Gallery Custom Links allows you to link images from galleries to a specified URL. Tested with WordPress Gallery, Gutenberg, the Meow Gallery and others.
11
 
@@ -42,6 +42,10 @@ Replace all the files. Nothing else to do.
42
 
43
  == Changelog ==
44
 
 
 
 
 
45
  = 1.2.5 =
46
  * Fix: Avoid errors in the admin.
47
  * Fix: Add another way to resolve the image ID if none found (https://wordpress.org/support/topic/issue-with-page-links-on-images/), let's see how it goes.
@@ -54,7 +58,6 @@ Replace all the files. Nothing else to do.
54
  * Add: CTA Buttons for Meow Gallery, Native Galleries and Gutenberg Galleries.
55
  * Add: Filter to... filter which images are actually managed by the plugin :)
56
  * Fix: Hopefully, the Reusable Blocks aren't broken anymore in the editor (I couldn't replicate the bug on this new version).
57
- * Info: If you like the plugin, your reviews are welcome [here](https://wordpress.org/support/plugin/gallery-custom-links/reviews/?rate=5#new-post) :) Thank you!
58
 
59
  = 1.2.0 =
60
  * Add: This was asked to me a lot, so I have adding the settings in order to change the parameters of the plugin easily. It will be much easier to make it faster now.
5
  Requires at least: 5.0
6
  Tested up to: 5.3
7
  Requires PHP: 7.0
8
+ Stable tag: 1.2.6
9
 
10
  Gallery Custom Links allows you to link images from galleries to a specified URL. Tested with WordPress Gallery, Gutenberg, the Meow Gallery and others.
11
 
42
 
43
  == Changelog ==
44
 
45
+ = 1.2.6 =
46
+ * Add: Because we love the W3C, the title has been added to the link.
47
+ * Info: If you like the plugin, your reviews are welcome [here](https://wordpress.org/support/plugin/gallery-custom-links/reviews/?rate=5#new-post) :) Thank you!
48
+
49
  = 1.2.5 =
50
  * Fix: Avoid errors in the admin.
51
  * Fix: Add another way to resolve the image ID if none found (https://wordpress.org/support/topic/issue-with-page-links-on-images/), let's see how it goes.
58
  * Add: CTA Buttons for Meow Gallery, Native Galleries and Gutenberg Galleries.
59
  * Add: Filter to... filter which images are actually managed by the plugin :)
60
  * Fix: Hopefully, the Reusable Blocks aren't broken anymore in the editor (I couldn't replicate the bug on this new version).
 
61
 
62
  = 1.2.0 =
63
  * Add: This was asked to me a lot, so I have adding the settings in order to change the parameters of the plugin easily. It will be much easier to make it faster now.