Gallery Custom Links - Version 1.2.4

Version Description

  • Fix: Avoid errors in the admin.
Download this release

Release Info

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

Code changes from version 1.2.3 to 1.2.4

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+CiAgICAuc3Qye2ZpbGw6IzgwNDYyNX0uc3Qze2ZpbGw6I2ZkYTk2MH0KICA8L3N0eWxlPgogIDxwYXRoIGQ9Ik03MiA3YTc2IDc2IDAgMCAxIDg0IDkxQTc1IDc1IDAgMSAxIDcyIDd6IiBmaWxsPSIjNGE2Yjhj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IDExLTgtMyA2LTEweiIvPgo8L3N2Zz4K';
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
  }
@@ -185,7 +200,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
185
  // Creates standard menu if it does NOT exist
186
  global $submenu;
187
  if ( !isset( $submenu[ 'meowapps-main-menu' ] ) ) {
188
- add_menu_page( 'Meow Apps', '<img style="width: 24px; margin-left: -30px; position: absolute; margin-top: -3px;" src="' . MeowApps_Admin::$logo . '" />Meow Apps', 'manage_options', 'meowapps-main-menu',
189
  array( $this, 'admin_meow_apps' ), '', 82 );
190
  add_submenu_page( 'meowapps-main-menu', __( 'Dashboard', 'meowapps' ),
191
  __( 'Dashboard', 'meowapps' ), 'manage_options',
@@ -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.4";
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 ( isset( $_GET['page'] ) && $_GET['page'] === 'meowapps-main-menu' ) {
27
+ add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 100000, 1 );
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
  }
200
  // Creates standard menu if it does NOT exist
201
  global $submenu;
202
  if ( !isset( $submenu[ 'meowapps-main-menu' ] ) ) {
203
+ add_menu_page( 'Meow Apps', '<img alt="Meow Apps" style="width: 24px; margin-left: -30px; position: absolute; margin-top: -3px;" src="' . MeowApps_Admin::$logo . '" />Meow Apps', 'manage_options', 'meowapps-main-menu',
204
  array( $this, 'admin_meow_apps' ), '', 82 );
205
  add_submenu_page( 'meowapps-main-menu', __( 'Dashboard', 'meowapps' ),
206
  __( 'Dashboard', 'meowapps' ), 'manage_options',
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
gallery_custom_links.php → gallery-custom-links.php RENAMED
@@ -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.3
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.3';
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.4
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.4';
27
 
28
  include "mgcl_admin.php";
29
  $mgcl_admin = new Meow_Gallery_Custom_Links_Admin( 'mgcl', __FILE__, 'gallery-custom-links' );
mgcl_core.php CHANGED
@@ -19,7 +19,7 @@ class Meow_Gallery_Custom_Links
19
  $this->parsingEngine = get_option( 'mgcl_parsing_engine', $this->parsingEngine );
20
  $this->enableLogs = get_option( 'mgcl_log', $this->enableLogs );
21
  if ( $this->isObMode ) {
22
- add_action( 'init', array( $this, 'start' ) );
23
  add_action( 'shutdown', array( $this, 'shutdown' ) );
24
  add_action( 'wp_footer', array( $this, 'unlink_lightboxes_script' ) ) ;
25
  }
19
  $this->parsingEngine = get_option( 'mgcl_parsing_engine', $this->parsingEngine );
20
  $this->enableLogs = get_option( 'mgcl_log', $this->enableLogs );
21
  if ( $this->isObMode ) {
22
+ add_action( 'template_redirect', array( $this, 'start' ) );
23
  add_action( 'shutdown', array( $this, 'shutdown' ) );
24
  add_action( 'wp_footer', array( $this, 'unlink_lightboxes_script' ) ) ;
25
  }
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: TigrouMeow
3
  Tags: custom, links, gallery, gutenberg
4
  Donate link: https://commerce.coinbase.com/checkout/d047546a-77a8-41c8-9ea9-4a950f61832f
5
  Requires at least: 5.0
6
- Tested up to: 5.2
7
  Requires PHP: 7.0
8
- Stable tag: 1.2.3
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,9 @@ Replace all the files. Nothing else to do.
42
 
43
  == Changelog ==
44
 
 
 
 
45
  = 1.2.3 =
46
  * Add: Label for CTA buttons.
47
  * Fix: Moved the position of the CTA buttons in the DOM.
3
  Tags: custom, links, gallery, gutenberg
4
  Donate link: https://commerce.coinbase.com/checkout/d047546a-77a8-41c8-9ea9-4a950f61832f
5
  Requires at least: 5.0
6
+ Tested up to: 5.3
7
  Requires PHP: 7.0
8
+ Stable tag: 1.2.4
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.4 =
46
+ * Fix: Avoid errors in the admin.
47
+
48
  = 1.2.3 =
49
  * Add: Label for CTA buttons.
50
  * Fix: Moved the position of the CTA buttons in the DOM.