Shortlinks by Pretty Links – Best WordPress Link Tracking Plugin - Version 3.0.6

Version Description

  • Disable "enter" key on the Target URL field
  • Add copy to clipboard to the add/edit link page
  • Fix the incorrect message being display when updating a link
  • Redirect to the links list page after creating or updating a link
  • Add the ability to sort by Clicks to the links list table
Download this release

Release Info

Developer cartpauj
Plugin Icon 128x128 Shortlinks by Pretty Links – Best WordPress Link Tracking Plugin
Version 3.0.6
Comparing to
See all releases

Code changes from version 3.0.5 to 3.0.6

app/controllers/PrliAppController.php CHANGED
@@ -363,16 +363,23 @@ class PrliAppController extends PrliBaseController {
363
  );
364
 
365
  if($is_link_edit_page || $is_link_new_page) {
366
- global $prli_link, $post;
367
 
368
  $link_id = $prli_link->get_link_from_cpt($post->ID);
369
 
370
- $args = array( 'args' => array(
371
- 'id' => $link_id,
372
- 'action' => 'validate_pretty_link',
373
- 'security' => wp_create_nonce( 'validate_pretty_link' ),
374
- 'update' => __('Update', 'pretty-link') // Use default text domain
375
- ) );
 
 
 
 
 
 
 
376
 
377
  wp_enqueue_script( 'prli-link-form', PRLI_JS_URL . '/admin_link_form.js', array(), PRLI_VERSION);
378
  wp_localize_script( 'prli-link-form', 'PrliLinkValidation', $args );
363
  );
364
 
365
  if($is_link_edit_page || $is_link_new_page) {
366
+ global $prli_link, $post, $prli_blogurl;
367
 
368
  $link_id = $prli_link->get_link_from_cpt($post->ID);
369
 
370
+ $args = array(
371
+ 'args' => array(
372
+ 'id' => $link_id,
373
+ 'action' => 'validate_pretty_link',
374
+ 'security' => wp_create_nonce( 'validate_pretty_link' ),
375
+ 'update' => __('Update', 'pretty-link')
376
+ ),
377
+ 'copy_text' => __('Copy to Clipboard', 'pretty-link'),
378
+ 'copied_text' => __('Copied!', 'pretty-link'),
379
+ 'copy_error_text' => __('Oops, Copy Failed!', 'pretty-link'),
380
+ 'blogurl' => $prli_blogurl,
381
+ 'permalink_pre_slug_uri' => PrliUtils::get_permalink_pre_slug_uri()
382
+ );
383
 
384
  wp_enqueue_script( 'prli-link-form', PRLI_JS_URL . '/admin_link_form.js', array(), PRLI_VERSION);
385
  wp_localize_script( 'prli-link-form', 'PrliLinkValidation', $args );
app/controllers/PrliLinksController.php CHANGED
@@ -11,6 +11,8 @@ class PrliLinksController extends PrliBaseController {
11
  add_action( 'deleted_post', array($this, 'delete_cpt_link') );
12
  add_action( 'transition_post_status', array($this, 'transition_cpt_status'), 10, 3 );
13
  add_action( 'transition_post_status', array($this, 'transition_cpt_status'), 10, 3 );
 
 
14
  add_action( 'wp_ajax_validate_pretty_link', array($this,'ajax_validate_pretty_link') );
15
  add_action( 'wp_ajax_reset_pretty_link', array($this,'ajax_reset_pretty_link') );
16
  add_action( 'wp_ajax_prli_quick_create', array($this, 'ajax_quick_create'));
@@ -18,9 +20,12 @@ class PrliLinksController extends PrliBaseController {
18
  // Add slug and URL to search
19
  add_filter( 'posts_search', array($this, 'search_links_table') );
20
 
 
 
 
 
21
  // Legacy Groups Filter
22
  add_action( 'restrict_manage_posts', array($this,'filter_links_by_legacy_groups') );
23
- add_filter( 'posts_join', array($this,'join_links_to_posts') );
24
  add_filter( 'posts_where', array($this,'where_links_belong_to_legacy_group') );
25
 
26
  // Alter Quick Links Menu (subsubsub)
@@ -284,6 +289,41 @@ class PrliLinksController extends PrliBaseController {
284
  }
285
  }
286
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  public static function delete_cpt_link($post_id) {
288
  global $prli_link;
289
 
@@ -447,6 +487,7 @@ class PrliLinksController extends PrliBaseController {
447
  $columns['title'] = 'title';
448
  //$columns['slug'] = 'slug';
449
  $columns['target'] = 'target';
 
450
  $columns['date'] = 'date';
451
 
452
  return $columns;
@@ -642,8 +683,13 @@ class PrliLinksController extends PrliBaseController {
642
  wp_send_json_error(array('message' => __('An error occurred creating the link', 'pretty-link')));
643
  }
644
 
 
 
 
 
 
645
  wp_send_json_success([
646
- 'redirect' => esc_url_raw(sprintf(admin_url('post.php?post=%d&action=edit'), $link->link_cpt_id))
647
  ]);
648
  }
649
 
@@ -685,6 +731,43 @@ class PrliLinksController extends PrliBaseController {
685
  }
686
  }
687
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
688
  // Join for searching
689
  public function join_links_to_posts($join) {
690
  global $wpdb, $typenow;
@@ -765,6 +848,11 @@ class PrliLinksController extends PrliBaseController {
765
  li.url {$order}
766
  ";
767
  }
 
 
 
 
 
768
  }
769
 
770
  return $orderby;
11
  add_action( 'deleted_post', array($this, 'delete_cpt_link') );
12
  add_action( 'transition_post_status', array($this, 'transition_cpt_status'), 10, 3 );
13
  add_action( 'transition_post_status', array($this, 'transition_cpt_status'), 10, 3 );
14
+ add_filter( 'redirect_post_location', array($this, 'redirect_post_location'), 10, 2 );
15
+ add_action( 'admin_notices', array($this, 'link_saved_admin_notice') );
16
  add_action( 'wp_ajax_validate_pretty_link', array($this,'ajax_validate_pretty_link') );
17
  add_action( 'wp_ajax_reset_pretty_link', array($this,'ajax_reset_pretty_link') );
18
  add_action( 'wp_ajax_prli_quick_create', array($this, 'ajax_quick_create'));
20
  // Add slug and URL to search
21
  add_filter( 'posts_search', array($this, 'search_links_table') );
22
 
23
+ // Links table join
24
+ add_filter( 'posts_fields', array($this, 'add_clicks_to_select') );
25
+ add_filter( 'posts_join', array($this,'join_links_to_posts') );
26
+
27
  // Legacy Groups Filter
28
  add_action( 'restrict_manage_posts', array($this,'filter_links_by_legacy_groups') );
 
29
  add_filter( 'posts_where', array($this,'where_links_belong_to_legacy_group') );
30
 
31
  // Alter Quick Links Menu (subsubsub)
289
  }
290
  }
291
 
292
+ /**
293
+ * Redirect to the links list after saving a link
294
+ *
295
+ * @param string $location
296
+ * @param int $post_id
297
+ * @return string
298
+ */
299
+ public function redirect_post_location($location, $post_id) {
300
+ if (get_post_type($post_id) == PrliLink::$cpt) {
301
+ $location = add_query_arg(array(
302
+ 'post_type' => PrliLink::$cpt,
303
+ 'message' => stripos($location, 'message=6') === false ? 1 : 6
304
+ ), admin_url('edit.php'));
305
+ }
306
+
307
+ return $location;
308
+ }
309
+
310
+ /**
311
+ * Add a message that the link has been created or updated after redirecting to the links list
312
+ */
313
+ public function link_saved_admin_notice() {
314
+ $screen = get_current_screen();
315
+
316
+ if ($screen instanceof WP_Screen && $screen->id == 'edit-pretty-link' && isset($_GET['message'])) {
317
+ $message = (int) $_GET['message'];
318
+
319
+ if ($message == 1) {
320
+ printf('<div class="notice notice-success is-dismissible"><p>%s</p></div>', esc_html__('Pretty Link updated.', 'pretty-link'));
321
+ } elseif ($message == 6) {
322
+ printf('<div class="notice notice-success is-dismissible"><p>%s</p></div>', esc_html__('Pretty Link created.', 'pretty-link'));
323
+ }
324
+ }
325
+ }
326
+
327
  public static function delete_cpt_link($post_id) {
328
  global $prli_link;
329
 
487
  $columns['title'] = 'title';
488
  //$columns['slug'] = 'slug';
489
  $columns['target'] = 'target';
490
+ $columns['clicks'] = array('clicks', true); // desc first
491
  $columns['date'] = 'date';
492
 
493
  return $columns;
683
  wp_send_json_error(array('message' => __('An error occurred creating the link', 'pretty-link')));
684
  }
685
 
686
+ $location = add_query_arg(array(
687
+ 'post_type' => PrliLink::$cpt,
688
+ 'message' => 6
689
+ ), admin_url('edit.php'));
690
+
691
  wp_send_json_success([
692
+ 'redirect' => esc_url_raw($location)
693
  ]);
694
  }
695
 
731
  }
732
  }
733
 
734
+ /**
735
+ * Add the link click stats to the SELECT part of the post query
736
+ *
737
+ * @param string $fields
738
+ * @return string
739
+ */
740
+ public function add_clicks_to_select($fields) {
741
+ global $typenow, $prli_click, $prli_options, $prli_link_meta;
742
+
743
+ if( $typenow == PrliLink::$cpt ) {
744
+ if($prli_options->extended_tracking != 'count') {
745
+ $op = $prli_click->get_exclude_where_clause( ' AND' );
746
+
747
+ $fields .= ",
748
+ (
749
+ SELECT COUNT(*)
750
+ FROM {$prli_click->table_name} AS cl
751
+ WHERE cl.link_id = li.id
752
+ {$op}
753
+ ) as clicks
754
+ ";
755
+ }
756
+ else {
757
+ $fields .= ",
758
+ (
759
+ SELECT lm.meta_value
760
+ FROM {$prli_link_meta->table_name} AS lm
761
+ WHERE lm.meta_key=\"static-clicks\"
762
+ AND lm.link_id=li.id LIMIT 1
763
+ ) as clicks
764
+ ";
765
+ }
766
+ }
767
+
768
+ return $fields;
769
+ }
770
+
771
  // Join for searching
772
  public function join_links_to_posts($join) {
773
  global $wpdb, $typenow;
848
  li.url {$order}
849
  ";
850
  }
851
+ elseif($_GET['orderby']=='clicks') {
852
+ $orderby = "
853
+ clicks {$order}
854
+ ";
855
+ }
856
  }
857
 
858
  return $orderby;
app/views/links/form_basic.php CHANGED
@@ -37,7 +37,7 @@
37
  ); ?>
38
  </th>
39
  <td>
40
- <textarea class="large-text" name="prli_url"><?php echo esc_textarea($values['url']); ?></textarea>
41
  </td>
42
  </tr>
43
  <tr>
@@ -50,7 +50,10 @@
50
  ); ?>
51
  </th>
52
  <td>
53
- <strong><?php global $prli_blogurl; echo esc_html($prli_blogurl); ?></strong>/<input type="text" name="slug" class="regular-text" value="<?php echo esc_attr($values['slug']); ?>" />
 
 
 
54
  </td>
55
  </tr>
56
  <tr>
37
  ); ?>
38
  </th>
39
  <td>
40
+ <textarea id="prli_url" class="large-text" name="prli_url"><?php echo esc_textarea($values['url']); ?></textarea>
41
  </td>
42
  </tr>
43
  <tr>
50
  ); ?>
51
  </th>
52
  <td>
53
+ <strong><?php global $prli_blogurl; echo esc_html($prli_blogurl); ?></strong>/<input type="text" id="prli_slug" name="slug" class="regular-text" value="<?php echo esc_attr($values['slug']); ?>" />
54
+ <span class="prli-clipboard prli-edit-link-clipboard">
55
+ <i class="pl-icon-clipboard"></i>
56
+ </span>
57
  </td>
58
  </tr>
59
  <tr>
css/admin_shared.css CHANGED
@@ -323,3 +323,8 @@ p.prli-welcome-step img {
323
  .prli-position-relative {
324
  position: relative;
325
  }
 
 
 
 
 
323
  .prli-position-relative {
324
  position: relative;
325
  }
326
+
327
+ .prli-edit-link-clipboard {
328
+ font-size: 18px;
329
+ cursor: pointer;
330
+ }
css/prli-admin-links.css CHANGED
@@ -83,15 +83,15 @@
83
 
84
  .column-taxonomy-pretty-link-tag,
85
  .column-pro-pretty-link-tag {
86
- width: 10% !important;
87
  }
88
 
89
  .column-keywords {
90
- width: 15% !important;
91
  }
92
 
93
  .column-clicks {
94
- width: 5% !important;
95
  }
96
 
97
  .column-date {
83
 
84
  .column-taxonomy-pretty-link-tag,
85
  .column-pro-pretty-link-tag {
86
+ width: 8% !important;
87
  }
88
 
89
  .column-keywords {
90
+ width: 12% !important;
91
  }
92
 
93
  .column-clicks {
94
+ width: 10% !important;
95
  }
96
 
97
  .column-date {
i18n/pretty-link.pot CHANGED
@@ -2,22 +2,22 @@
2
  # This file is distributed under the same license as the Pretty Links plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Pretty Links 3.0.5\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/pretty-link\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2019-07-22T15:38:09-06:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.2.0\n"
15
  "X-Domain: pretty-link\n"
16
 
17
  #. Plugin Name of the plugin
18
  #: pro/app/views/links/prettybar.php:68
19
- #: app/controllers/PrliLinksController.php:49
20
- #: app/controllers/PrliLinksController.php:436
21
  msgid "Pretty Links"
22
  msgstr ""
23
 
@@ -64,7 +64,7 @@ msgstr ""
64
  #: app/models/PrliClick.php:256
65
  #: app/views/groups/list.php:81
66
  #: app/views/clicks/list.php:4
67
- #: app/controllers/PrliLinksController.php:434
68
  #: app/controllers/PrliAppController.php:115
69
  msgid "Clicks"
70
  msgstr ""
@@ -160,7 +160,7 @@ msgid "Digg"
160
  msgstr ""
161
 
162
  #: pro/app/models/PlpOptions.php:155
163
- #: app/controllers/PrliLinksController.php:551
164
  msgid "Email"
165
  msgstr ""
166
 
@@ -338,7 +338,7 @@ msgstr ""
338
  #: pro/app/views/links/form.php:38
339
  #: pro/app/views/links/form.php:73
340
  #: app/models/PrliClick.php:256
341
- #: app/controllers/PrliLinksController.php:435
342
  msgid "Date"
343
  msgstr ""
344
 
@@ -387,7 +387,7 @@ msgstr ""
387
 
388
  #: pro/app/views/links/form.php:133
389
  #: app/views/links/form_pro.php:30
390
- #: app/controllers/PrliLinksController.php:397
391
  msgid "Keywords"
392
  msgstr ""
393
 
@@ -828,7 +828,7 @@ msgstr ""
828
  #: pro/app/views/reports/edit.php:66
829
  #: app/views/options/form.php:999
830
  #: app/views/groups/edit.php:72
831
- #: app/controllers/PrliAppController.php:374
832
  msgid "Update"
833
  msgstr ""
834
 
@@ -859,7 +859,7 @@ msgstr ""
859
  #: pro/app/views/reports/list.php:20
860
  #: app/views/groups/list.php:24
861
  #: app/views/clicks/list.php:64
862
- #: app/controllers/PrliLinksController.php:547
863
  msgid "Reset"
864
  msgstr ""
865
 
@@ -2122,7 +2122,7 @@ msgid "New Link Category Name"
2122
  msgstr ""
2123
 
2124
  #: pro/app/controllers/PlpLinkCategoriesController.php:25
2125
- #: app/controllers/PrliLinksController.php:395
2126
  msgid "Categories"
2127
  msgstr ""
2128
 
@@ -2218,7 +2218,7 @@ msgid "Unauthorized"
2218
  msgstr ""
2219
 
2220
  #: pro/app/controllers/PlpPublicLinksController.php:37
2221
- #: app/controllers/PrliLinksController.php:617
2222
  msgid "Security check failed"
2223
  msgstr ""
2224
 
@@ -2273,7 +2273,7 @@ msgid "No Link Tags found."
2273
  msgstr ""
2274
 
2275
  #: pro/app/controllers/PlpLinkTagsController.php:29
2276
- #: app/controllers/PrliLinksController.php:396
2277
  msgid "Tags"
2278
  msgstr ""
2279
 
@@ -3327,9 +3327,9 @@ msgstr ""
3327
 
3328
  #: app/helpers/PrliAppHelper.php:20
3329
  #: app/views/links/form.php:30
3330
- #: app/controllers/PrliLinksController.php:408
3331
- #: app/controllers/PrliLinksController.php:414
3332
- #: app/controllers/PrliLinksController.php:420
3333
  msgid "Pro"
3334
  msgstr ""
3335
 
@@ -3449,7 +3449,7 @@ msgstr ""
3449
  #: app/views/links/form_basic.php:48
3450
  #: app/views/shared/tinymce_form_popup.php:78
3451
  #: app/views/widgets/widget.php:15
3452
- #: app/controllers/PrliLinksController.php:50
3453
  msgid "Pretty Link"
3454
  msgstr ""
3455
 
@@ -3615,12 +3615,12 @@ msgstr ""
3615
  msgid "This is how your pretty link will appear. You can edit the Pretty Link slug here."
3616
  msgstr ""
3617
 
3618
- #: app/views/links/form_basic.php:58
3619
  #: app/views/links/form_basic.php:61
 
3620
  msgid "Notes"
3621
  msgstr ""
3622
 
3623
- #: app/views/links/form_basic.php:62
3624
  msgid "This is a field where you can enter notes about a particular link. This notes field is mainly for your own link management needs. It isn't currently used anywhere on the front end."
3625
  msgstr ""
3626
 
@@ -4884,8 +4884,8 @@ msgid "An unknown error occurred."
4884
  msgstr ""
4885
 
4886
  #: app/controllers/PrliPopupController.php:93
4887
- #: app/controllers/PrliLinksController.php:362
4888
- #: app/controllers/PrliLinksController.php:595
4889
  msgid "Forbidden"
4890
  msgstr ""
4891
 
@@ -4914,114 +4914,122 @@ msgstr ""
4914
  msgid "Pretty Link ID must be set for successful update."
4915
  msgstr ""
4916
 
4917
- #: app/controllers/PrliLinksController.php:51
4918
  msgid "Add New Pretty Link"
4919
  msgstr ""
4920
 
4921
- #: app/controllers/PrliLinksController.php:52
4922
  msgid "Edit Pretty Link"
4923
  msgstr ""
4924
 
4925
- #: app/controllers/PrliLinksController.php:53
4926
  #: js/editor/components/link-editor/index.js:324
4927
  #: js/editor.js:12
4928
  msgid "New Pretty Link"
4929
  msgstr ""
4930
 
4931
- #: app/controllers/PrliLinksController.php:54
4932
  msgid "View Pretty Link"
4933
  msgstr ""
4934
 
4935
- #: app/controllers/PrliLinksController.php:55
4936
  msgid "Search Pretty Links"
4937
  msgstr ""
4938
 
4939
- #: app/controllers/PrliLinksController.php:56
4940
  msgid "No Pretty Links found"
4941
  msgstr ""
4942
 
4943
- #: app/controllers/PrliLinksController.php:57
4944
  msgid "No Pretty Links found in Trash"
4945
  msgstr ""
4946
 
4947
- #: app/controllers/PrliLinksController.php:58
4948
  msgid "Parent Pretty Link:"
4949
  msgstr ""
4950
 
4951
- #: app/controllers/PrliLinksController.php:119
4952
  msgid "Pretty Link Settings"
4953
  msgstr ""
4954
 
4955
- #: app/controllers/PrliLinksController.php:350
 
 
 
 
 
 
 
 
4956
  msgid "Pretty Link Cleanup Visitor Locks"
4957
  msgstr ""
4958
 
4959
- #: app/controllers/PrliLinksController.php:371
4960
  msgid "Success!"
4961
  msgstr ""
4962
 
4963
- #: app/controllers/PrliLinksController.php:373
4964
  msgid "Fix the following errors:"
4965
  msgstr ""
4966
 
4967
- #: app/controllers/PrliLinksController.php:409
4968
  msgid "Upgrade to a Pretty Links premium plan to get Link Categories"
4969
  msgstr ""
4970
 
4971
- #: app/controllers/PrliLinksController.php:415
4972
  msgid "Upgrade to a Pretty Links premium plan to get Link Tags"
4973
  msgstr ""
4974
 
4975
- #: app/controllers/PrliLinksController.php:421
4976
  msgid "Upgrade to a Pretty Links premium plan to get Keyword Replacements"
4977
  msgstr ""
4978
 
4979
- #: app/controllers/PrliLinksController.php:427
4980
  msgid "Settings"
4981
  msgstr ""
4982
 
4983
- #: app/controllers/PrliLinksController.php:428
4984
  msgid "Link Title"
4985
  msgstr ""
4986
 
4987
- #: app/controllers/PrliLinksController.php:430
4988
  msgid "Target"
4989
  msgstr ""
4990
 
4991
- #: app/controllers/PrliLinksController.php:550
4992
  msgid "Tweet"
4993
  msgstr ""
4994
 
4995
- #: app/controllers/PrliLinksController.php:552
4996
  msgid "Target &raquo;"
4997
  msgstr ""
4998
 
4999
- #: app/controllers/PrliLinksController.php:553
5000
  msgid "Pretty Link &raquo;"
5001
  msgstr ""
5002
 
5003
- #: app/controllers/PrliLinksController.php:575
5004
- #: app/controllers/PrliLinksController.php:576
5005
  msgid "View Split Test Report"
5006
  msgstr ""
5007
 
5008
- #: app/controllers/PrliLinksController.php:601
5009
  msgid "Your Pretty Link was Successfully Reset"
5010
  msgstr ""
5011
 
5012
- #: app/controllers/PrliLinksController.php:609
5013
  msgid "Bad request"
5014
  msgstr ""
5015
 
5016
- #: app/controllers/PrliLinksController.php:613
5017
  msgid "Insufficient permissions"
5018
  msgstr ""
5019
 
5020
- #: app/controllers/PrliLinksController.php:642
5021
  msgid "An error occurred creating the link"
5022
  msgstr ""
5023
 
5024
- #: app/controllers/PrliLinksController.php:674
5025
  msgid "All Groups (Legacy)"
5026
  msgstr ""
5027
 
@@ -5102,40 +5110,52 @@ msgstr ""
5102
  msgid "Buy"
5103
  msgstr ""
5104
 
5105
- #: app/controllers/PrliAppController.php:396
 
 
 
 
 
 
 
 
 
 
 
 
5106
  msgid "Are you sure you want to reset your Pretty Link? This will delete all of the statistical data about this Pretty Link in your database."
5107
  msgstr ""
5108
 
5109
  #. translators: %1$s: br tag, %2$s: open link tag, %3$s: close link tag
5110
- #: app/controllers/PrliAppController.php:501
5111
  msgid "You're almost done!%1$s%2$sFinish your Re-Install of Pretty Links Pro%3$s"
5112
  msgstr ""
5113
 
5114
- #: app/controllers/PrliAppController.php:516
5115
  msgid "Pretty Links Pro Successfully Uninstalled."
5116
  msgstr ""
5117
 
5118
- #: app/controllers/PrliAppController.php:565
5119
  msgid "Invalid server response"
5120
  msgstr ""
5121
 
5122
- #: app/controllers/PrliAppController.php:566
5123
  msgid "Ajax error"
5124
  msgstr ""
5125
 
5126
- #: app/controllers/PrliAppController.php:583
5127
  msgid "Pretty Link Quick Add"
5128
  msgstr ""
5129
 
5130
- #: app/controllers/PrliAppController.php:622
5131
  msgid "Your Pretty Links Pro installation isn't quite complete yet. %1$sAutomatically Upgrade to Enable Pretty Links Pro%2$s"
5132
  msgstr ""
5133
 
5134
- #: app/controllers/PrliAppController.php:643
5135
  msgid "Your Pretty Links Pro installation isn't quite complete yet.<br/>%1$sAutomatically Upgrade to Enable Pretty Links Pro%2$s"
5136
  msgstr ""
5137
 
5138
  #. translators: $1$s - Pretty Links plugin name; $2$s - WP.org review link; $3$s - WP.org review link.
5139
- #: app/controllers/PrliAppController.php:691
5140
  msgid "Enjoying %1$s? Please rate <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">&#9733;&#9733;&#9733;&#9733;&#9733;</a> on <a href=\"%3$s\" target=\"_blank\" rel=\"noopener\">WordPress.org</a> to help us spread the word. Thanks from the Pretty Links team!"
5141
  msgstr ""
2
  # This file is distributed under the same license as the Pretty Links plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Pretty Links 3.0.6\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/pretty-link\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2019-07-23T14:42:09-06:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.2.0\n"
15
  "X-Domain: pretty-link\n"
16
 
17
  #. Plugin Name of the plugin
18
  #: pro/app/views/links/prettybar.php:68
19
+ #: app/controllers/PrliLinksController.php:54
20
+ #: app/controllers/PrliLinksController.php:476
21
  msgid "Pretty Links"
22
  msgstr ""
23
 
64
  #: app/models/PrliClick.php:256
65
  #: app/views/groups/list.php:81
66
  #: app/views/clicks/list.php:4
67
+ #: app/controllers/PrliLinksController.php:474
68
  #: app/controllers/PrliAppController.php:115
69
  msgid "Clicks"
70
  msgstr ""
160
  msgstr ""
161
 
162
  #: pro/app/models/PlpOptions.php:155
163
+ #: app/controllers/PrliLinksController.php:592
164
  msgid "Email"
165
  msgstr ""
166
 
338
  #: pro/app/views/links/form.php:38
339
  #: pro/app/views/links/form.php:73
340
  #: app/models/PrliClick.php:256
341
+ #: app/controllers/PrliLinksController.php:475
342
  msgid "Date"
343
  msgstr ""
344
 
387
 
388
  #: pro/app/views/links/form.php:133
389
  #: app/views/links/form_pro.php:30
390
+ #: app/controllers/PrliLinksController.php:437
391
  msgid "Keywords"
392
  msgstr ""
393
 
828
  #: pro/app/views/reports/edit.php:66
829
  #: app/views/options/form.php:999
830
  #: app/views/groups/edit.php:72
831
+ #: app/controllers/PrliAppController.php:375
832
  msgid "Update"
833
  msgstr ""
834
 
859
  #: pro/app/views/reports/list.php:20
860
  #: app/views/groups/list.php:24
861
  #: app/views/clicks/list.php:64
862
+ #: app/controllers/PrliLinksController.php:588
863
  msgid "Reset"
864
  msgstr ""
865
 
2122
  msgstr ""
2123
 
2124
  #: pro/app/controllers/PlpLinkCategoriesController.php:25
2125
+ #: app/controllers/PrliLinksController.php:435
2126
  msgid "Categories"
2127
  msgstr ""
2128
 
2218
  msgstr ""
2219
 
2220
  #: pro/app/controllers/PlpPublicLinksController.php:37
2221
+ #: app/controllers/PrliLinksController.php:658
2222
  msgid "Security check failed"
2223
  msgstr ""
2224
 
2273
  msgstr ""
2274
 
2275
  #: pro/app/controllers/PlpLinkTagsController.php:29
2276
+ #: app/controllers/PrliLinksController.php:436
2277
  msgid "Tags"
2278
  msgstr ""
2279
 
3327
 
3328
  #: app/helpers/PrliAppHelper.php:20
3329
  #: app/views/links/form.php:30
3330
+ #: app/controllers/PrliLinksController.php:448
3331
+ #: app/controllers/PrliLinksController.php:454
3332
+ #: app/controllers/PrliLinksController.php:460
3333
  msgid "Pro"
3334
  msgstr ""
3335
 
3449
  #: app/views/links/form_basic.php:48
3450
  #: app/views/shared/tinymce_form_popup.php:78
3451
  #: app/views/widgets/widget.php:15
3452
+ #: app/controllers/PrliLinksController.php:55
3453
  msgid "Pretty Link"
3454
  msgstr ""
3455
 
3615
  msgid "This is how your pretty link will appear. You can edit the Pretty Link slug here."
3616
  msgstr ""
3617
 
 
3618
  #: app/views/links/form_basic.php:61
3619
+ #: app/views/links/form_basic.php:64
3620
  msgid "Notes"
3621
  msgstr ""
3622
 
3623
+ #: app/views/links/form_basic.php:65
3624
  msgid "This is a field where you can enter notes about a particular link. This notes field is mainly for your own link management needs. It isn't currently used anywhere on the front end."
3625
  msgstr ""
3626
 
4884
  msgstr ""
4885
 
4886
  #: app/controllers/PrliPopupController.php:93
4887
+ #: app/controllers/PrliLinksController.php:402
4888
+ #: app/controllers/PrliLinksController.php:636
4889
  msgid "Forbidden"
4890
  msgstr ""
4891
 
4914
  msgid "Pretty Link ID must be set for successful update."
4915
  msgstr ""
4916
 
4917
+ #: app/controllers/PrliLinksController.php:56
4918
  msgid "Add New Pretty Link"
4919
  msgstr ""
4920
 
4921
+ #: app/controllers/PrliLinksController.php:57
4922
  msgid "Edit Pretty Link"
4923
  msgstr ""
4924
 
4925
+ #: app/controllers/PrliLinksController.php:58
4926
  #: js/editor/components/link-editor/index.js:324
4927
  #: js/editor.js:12
4928
  msgid "New Pretty Link"
4929
  msgstr ""
4930
 
4931
+ #: app/controllers/PrliLinksController.php:59
4932
  msgid "View Pretty Link"
4933
  msgstr ""
4934
 
4935
+ #: app/controllers/PrliLinksController.php:60
4936
  msgid "Search Pretty Links"
4937
  msgstr ""
4938
 
4939
+ #: app/controllers/PrliLinksController.php:61
4940
  msgid "No Pretty Links found"
4941
  msgstr ""
4942
 
4943
+ #: app/controllers/PrliLinksController.php:62
4944
  msgid "No Pretty Links found in Trash"
4945
  msgstr ""
4946
 
4947
+ #: app/controllers/PrliLinksController.php:63
4948
  msgid "Parent Pretty Link:"
4949
  msgstr ""
4950
 
4951
+ #: app/controllers/PrliLinksController.php:124
4952
  msgid "Pretty Link Settings"
4953
  msgstr ""
4954
 
4955
+ #: app/controllers/PrliLinksController.php:320
4956
+ msgid "Pretty Link updated."
4957
+ msgstr ""
4958
+
4959
+ #: app/controllers/PrliLinksController.php:322
4960
+ msgid "Pretty Link created."
4961
+ msgstr ""
4962
+
4963
+ #: app/controllers/PrliLinksController.php:390
4964
  msgid "Pretty Link Cleanup Visitor Locks"
4965
  msgstr ""
4966
 
4967
+ #: app/controllers/PrliLinksController.php:411
4968
  msgid "Success!"
4969
  msgstr ""
4970
 
4971
+ #: app/controllers/PrliLinksController.php:413
4972
  msgid "Fix the following errors:"
4973
  msgstr ""
4974
 
4975
+ #: app/controllers/PrliLinksController.php:449
4976
  msgid "Upgrade to a Pretty Links premium plan to get Link Categories"
4977
  msgstr ""
4978
 
4979
+ #: app/controllers/PrliLinksController.php:455
4980
  msgid "Upgrade to a Pretty Links premium plan to get Link Tags"
4981
  msgstr ""
4982
 
4983
+ #: app/controllers/PrliLinksController.php:461
4984
  msgid "Upgrade to a Pretty Links premium plan to get Keyword Replacements"
4985
  msgstr ""
4986
 
4987
+ #: app/controllers/PrliLinksController.php:467
4988
  msgid "Settings"
4989
  msgstr ""
4990
 
4991
+ #: app/controllers/PrliLinksController.php:468
4992
  msgid "Link Title"
4993
  msgstr ""
4994
 
4995
+ #: app/controllers/PrliLinksController.php:470
4996
  msgid "Target"
4997
  msgstr ""
4998
 
4999
+ #: app/controllers/PrliLinksController.php:591
5000
  msgid "Tweet"
5001
  msgstr ""
5002
 
5003
+ #: app/controllers/PrliLinksController.php:593
5004
  msgid "Target &raquo;"
5005
  msgstr ""
5006
 
5007
+ #: app/controllers/PrliLinksController.php:594
5008
  msgid "Pretty Link &raquo;"
5009
  msgstr ""
5010
 
5011
+ #: app/controllers/PrliLinksController.php:616
5012
+ #: app/controllers/PrliLinksController.php:617
5013
  msgid "View Split Test Report"
5014
  msgstr ""
5015
 
5016
+ #: app/controllers/PrliLinksController.php:642
5017
  msgid "Your Pretty Link was Successfully Reset"
5018
  msgstr ""
5019
 
5020
+ #: app/controllers/PrliLinksController.php:650
5021
  msgid "Bad request"
5022
  msgstr ""
5023
 
5024
+ #: app/controllers/PrliLinksController.php:654
5025
  msgid "Insufficient permissions"
5026
  msgstr ""
5027
 
5028
+ #: app/controllers/PrliLinksController.php:683
5029
  msgid "An error occurred creating the link"
5030
  msgstr ""
5031
 
5032
+ #: app/controllers/PrliLinksController.php:720
5033
  msgid "All Groups (Legacy)"
5034
  msgstr ""
5035
 
5110
  msgid "Buy"
5111
  msgstr ""
5112
 
5113
+ #: app/controllers/PrliAppController.php:377
5114
+ msgid "Copy to Clipboard"
5115
+ msgstr ""
5116
+
5117
+ #: app/controllers/PrliAppController.php:378
5118
+ msgid "Copied!"
5119
+ msgstr ""
5120
+
5121
+ #: app/controllers/PrliAppController.php:379
5122
+ msgid "Oops, Copy Failed!"
5123
+ msgstr ""
5124
+
5125
+ #: app/controllers/PrliAppController.php:403
5126
  msgid "Are you sure you want to reset your Pretty Link? This will delete all of the statistical data about this Pretty Link in your database."
5127
  msgstr ""
5128
 
5129
  #. translators: %1$s: br tag, %2$s: open link tag, %3$s: close link tag
5130
+ #: app/controllers/PrliAppController.php:508
5131
  msgid "You're almost done!%1$s%2$sFinish your Re-Install of Pretty Links Pro%3$s"
5132
  msgstr ""
5133
 
5134
+ #: app/controllers/PrliAppController.php:523
5135
  msgid "Pretty Links Pro Successfully Uninstalled."
5136
  msgstr ""
5137
 
5138
+ #: app/controllers/PrliAppController.php:572
5139
  msgid "Invalid server response"
5140
  msgstr ""
5141
 
5142
+ #: app/controllers/PrliAppController.php:573
5143
  msgid "Ajax error"
5144
  msgstr ""
5145
 
5146
+ #: app/controllers/PrliAppController.php:590
5147
  msgid "Pretty Link Quick Add"
5148
  msgstr ""
5149
 
5150
+ #: app/controllers/PrliAppController.php:629
5151
  msgid "Your Pretty Links Pro installation isn't quite complete yet. %1$sAutomatically Upgrade to Enable Pretty Links Pro%2$s"
5152
  msgstr ""
5153
 
5154
+ #: app/controllers/PrliAppController.php:650
5155
  msgid "Your Pretty Links Pro installation isn't quite complete yet.<br/>%1$sAutomatically Upgrade to Enable Pretty Links Pro%2$s"
5156
  msgstr ""
5157
 
5158
  #. translators: $1$s - Pretty Links plugin name; $2$s - WP.org review link; $3$s - WP.org review link.
5159
+ #: app/controllers/PrliAppController.php:698
5160
  msgid "Enjoying %1$s? Please rate <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">&#9733;&#9733;&#9733;&#9733;&#9733;</a> on <a href=\"%3$s\" target=\"_blank\" rel=\"noopener\">WordPress.org</a> to help us spread the word. Thanks from the Pretty Links team!"
5161
  msgstr ""
js/admin_link_form.js CHANGED
@@ -47,7 +47,14 @@
47
  if(data.valid) {
48
  $('#pretty_link_errors').hide();
49
  $(form).triggerHandler('submit.edit-post');
50
- $(form).append('<input type="hidden" name="publish" value="Publish">');
 
 
 
 
 
 
 
51
  form.submit();
52
  }
53
  else {
@@ -62,5 +69,55 @@
62
  if (window.adminpage === 'post-new-php' && window.typenow === 'pretty-link') {
63
  $('#publish').val(PrliLinkValidation.args.update);
64
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  });
66
  })(jQuery);
47
  if(data.valid) {
48
  $('#pretty_link_errors').hide();
49
  $(form).triggerHandler('submit.edit-post');
50
+
51
+ // Trigger the correct actions and messages depending on whether we are publishing or updating a link
52
+ if ($('#publish').attr('name') === 'save') {
53
+ $(form).append('<input type="hidden" name="save" value="Update">');
54
+ } else {
55
+ $(form).append('<input type="hidden" name="publish" value="Publish">');
56
+ }
57
+
58
  form.submit();
59
  }
60
  else {
69
  if (window.adminpage === 'post-new-php' && window.typenow === 'pretty-link') {
70
  $('#publish').val(PrliLinkValidation.args.update);
71
  }
72
+
73
+ // Disable "enter" key on the Target URL field
74
+ $('#prli_url').on('keypress', function (e) {
75
+ if (e.keyCode === 13) {
76
+ e.preventDefault();
77
+ }
78
+ });
79
+
80
+ if ($.fn.tooltipster && window.ClipboardJS) {
81
+ var $el = $('.prli-edit-link-clipboard'),
82
+ copy_text = PrliLinkValidation.copy_text,
83
+ copied_text = PrliLinkValidation.copied_text,
84
+ copy_error_text = PrliLinkValidation.copy_error_text,
85
+ clipboard = new ClipboardJS($el[0], {
86
+ text: function () {
87
+ return PrliLinkValidation.blogurl + PrliLinkValidation.permalink_pre_slug_uri + $('#prli_slug').val();
88
+ }
89
+ }),
90
+ instance = $el
91
+ .tooltipster({
92
+ theme: 'tooltipster-borderless',
93
+ content: copy_text,
94
+ trigger: 'custom',
95
+ triggerClose: {
96
+ mouseleave: true,
97
+ touchleave: true
98
+ },
99
+ triggerOpen: {
100
+ mouseenter: true,
101
+ touchstart: true
102
+ }
103
+ })
104
+ .tooltipster('instance');
105
+
106
+ clipboard
107
+ .on('success', function(e) {
108
+ instance
109
+ .content(copied_text)
110
+ .one('after', function(){
111
+ instance.content(copy_text);
112
+ });
113
+ })
114
+ .on('error', function(e) {
115
+ instance
116
+ .content(copy_error_text)
117
+ .one('after', function(){
118
+ instance.content(copy_text);
119
+ });
120
+ });
121
+ }
122
  });
123
  })(jQuery);
pretty-link.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Pretty Links
4
  Plugin URI: https://prettylinks.com/pl/plugin-uri
5
  Description: Shrink, track and share any URL on the Internet from your WordPress website!
6
- Version: 3.0.5
7
  Author: Blair Williams
8
  Author URI: http://blairwilliams.com
9
  Text Domain: pretty-link
3
  Plugin Name: Pretty Links
4
  Plugin URI: https://prettylinks.com/pl/plugin-uri
5
  Description: Shrink, track and share any URL on the Internet from your WordPress website!
6
+ Version: 3.0.6
7
  Author: Blair Williams
8
  Author URI: http://blairwilliams.com
9
  Text Domain: pretty-link
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://prettylinks.com
4
  Tags: links, link, url, urls, affiliate, affiliates, pretty, marketing, redirect, redirection, forward, plugin, twitter, tweet, rewrite, shorturl, hoplink, hop, shortlink, short, shorten, shortening, click, clicks, track, tracking, tiny, tinyurl, budurl, shrinking, domain, shrink, mask, masking, cloak, cloaking, slug, slugs, admin, administration, stats, statistics, stat, statistic, email, ajax, javascript, ui, csv, download, page, post, pages, posts, shortcode, seo, automation, widget, widgets, dashboard
5
  Requires at least: 5.1
6
  Tested up to: 5.2.2
7
- Stable tag: 3.0.5
8
 
9
  Shrink, beautify, track, manage and share any URL on or off of your WordPress website. Create links that look how you want using your own domain name!
10
 
@@ -64,6 +64,13 @@ http://blairwilliams.com/w7a
64
  3. Make sure you have changed your permalink Common Settings in Settings -> Permalinks away from "Default" to something else. I prefer using custom and then "/%year%/%month%/%postname%/" for the simplest possible URL slugs with the best performance.
65
 
66
  == Changelog ==
 
 
 
 
 
 
 
67
  = 3.0.5 =
68
  * Fix description conflict with the WP Product Review plugin
69
  * Avoid menu position conflicts
4
  Tags: links, link, url, urls, affiliate, affiliates, pretty, marketing, redirect, redirection, forward, plugin, twitter, tweet, rewrite, shorturl, hoplink, hop, shortlink, short, shorten, shortening, click, clicks, track, tracking, tiny, tinyurl, budurl, shrinking, domain, shrink, mask, masking, cloak, cloaking, slug, slugs, admin, administration, stats, statistics, stat, statistic, email, ajax, javascript, ui, csv, download, page, post, pages, posts, shortcode, seo, automation, widget, widgets, dashboard
5
  Requires at least: 5.1
6
  Tested up to: 5.2.2
7
+ Stable tag: 3.0.6
8
 
9
  Shrink, beautify, track, manage and share any URL on or off of your WordPress website. Create links that look how you want using your own domain name!
10
 
64
  3. Make sure you have changed your permalink Common Settings in Settings -> Permalinks away from "Default" to something else. I prefer using custom and then "/%year%/%month%/%postname%/" for the simplest possible URL slugs with the best performance.
65
 
66
  == Changelog ==
67
+ = 3.0.6 =
68
+ * Disable "enter" key on the Target URL field
69
+ * Add copy to clipboard to the add/edit link page
70
+ * Fix the incorrect message being display when updating a link
71
+ * Redirect to the links list page after creating or updating a link
72
+ * Add the ability to sort by Clicks to the links list table
73
+
74
  = 3.0.5 =
75
  * Fix description conflict with the WP Product Review plugin
76
  * Avoid menu position conflicts