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

Version Description

Download this release

Release Info

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

Code changes from version 3.0.1 to 3.0.2

app/controllers/PrliAppController.php CHANGED
@@ -285,7 +285,7 @@ class PrliAppController extends PrliBaseController {
285
  PRLI_VENDOR_LIB_URL.'/fontello/css/pretty-link.css',
286
  array(), PRLI_VERSION );
287
 
288
- if (version_compare($wp_version, '5.2', '>=')) {
289
  wp_enqueue_script(
290
  'pretty-link-richtext-format',
291
  PRLI_JS_URL . '/editor.js',
@@ -421,6 +421,25 @@ class PrliAppController extends PrliBaseController {
421
  do_action('prli_load_admin_scripts', $hook, $page_vars);
422
  }
423
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
424
  public function parse_standalone_request() {
425
  if( !empty($_REQUEST['plugin']) and $_REQUEST['plugin'] == 'pretty-link' and
426
  !empty($_REQUEST['controller']) and !empty($_REQUEST['action']) ) {
285
  PRLI_VENDOR_LIB_URL.'/fontello/css/pretty-link.css',
286
  array(), PRLI_VERSION );
287
 
288
+ if ($this->should_enqueue_block_editor_scripts()) {
289
  wp_enqueue_script(
290
  'pretty-link-richtext-format',
291
  PRLI_JS_URL . '/editor.js',
421
  do_action('prli_load_admin_scripts', $hook, $page_vars);
422
  }
423
 
424
+ /**
425
+ * Should we enqueue the block editor scripts?
426
+ *
427
+ * @return bool
428
+ */
429
+ private function should_enqueue_block_editor_scripts() {
430
+ global $wp_version;
431
+
432
+ if (version_compare($wp_version, '5.2', '>=')) {
433
+ $screen = get_current_screen();
434
+
435
+ if ($screen instanceof WP_Screen && method_exists($screen, 'is_block_editor')) {
436
+ return $screen->is_block_editor();
437
+ }
438
+ }
439
+
440
+ return false;
441
+ }
442
+
443
  public function parse_standalone_request() {
444
  if( !empty($_REQUEST['plugin']) and $_REQUEST['plugin'] == 'pretty-link' and
445
  !empty($_REQUEST['controller']) and !empty($_REQUEST['action']) ) {
app/controllers/PrliLinksController.php CHANGED
@@ -250,6 +250,7 @@ class PrliLinksController extends PrliBaseController {
250
  $link_id = isset($_POST['link_id']) ? (int) $_POST['link_id'] : 0;
251
 
252
  $_POST['name'] = $_POST['post_title'];
 
253
  $_POST['link_cpt_id'] = $post->ID;
254
 
255
  if($link_id) {
@@ -360,6 +361,7 @@ class PrliLinksController extends PrliBaseController {
360
  }
361
 
362
  $id = isset($_POST['id']) ? (int) $_POST['id'] : 0;
 
363
  $errors = $prli_link->validate($_POST, $id);
364
 
365
  $errors = apply_filters('prli_validate_link', $errors);
250
  $link_id = isset($_POST['link_id']) ? (int) $_POST['link_id'] : 0;
251
 
252
  $_POST['name'] = $_POST['post_title'];
253
+ $_POST['url'] = isset($_POST['prli_url']) && is_string($_POST['prli_url']) ? $_POST['prli_url'] : '';
254
  $_POST['link_cpt_id'] = $post->ID;
255
 
256
  if($link_id) {
361
  }
362
 
363
  $id = isset($_POST['id']) ? (int) $_POST['id'] : 0;
364
+ $_POST['url'] = isset($_POST['prli_url']) && is_string($_POST['prli_url']) ? $_POST['prli_url'] : '';
365
  $errors = $prli_link->validate($_POST, $id);
366
 
367
  $errors = apply_filters('prli_validate_link', $errors);
app/controllers/PrliOnboardingController.php CHANGED
@@ -50,6 +50,7 @@ class PrliOnboardingController extends PrliBaseController {
50
  if ($onboard == 'welcome' || $onboard == 'update') {
51
  if (delete_option('prli_onboard')) {
52
  wp_cache_delete('alloptions', 'options');
 
53
  wp_redirect(admin_url("admin.php?page=pretty-link-{$onboard}"), 307);
54
  exit;
55
  }
50
  if ($onboard == 'welcome' || $onboard == 'update') {
51
  if (delete_option('prli_onboard')) {
52
  wp_cache_delete('alloptions', 'options');
53
+ nocache_headers();
54
  wp_redirect(admin_url("admin.php?page=pretty-link-{$onboard}"), 307);
55
  exit;
56
  }
app/views/links/form_basic.php CHANGED
@@ -37,7 +37,7 @@
37
  ); ?>
38
  </th>
39
  <td>
40
- <textarea class="large-text" name="url"><?php echo esc_textarea($values['url']); ?></textarea>
41
  </td>
42
  </tr>
43
  <tr>
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>
js/admin_link_form.js CHANGED
@@ -30,7 +30,7 @@
30
  $('.spinner').css('visibility','visible');
31
 
32
  var fields_to_validate = [
33
- 'url', 'redirect_type', 'slug', 'url_replacements', 'enable_expire', 'expire_type', 'expire_date',
34
  'expire_clicks', 'enable_expired_url', 'expired_url', 'dynamic_redirection', 'url_rotations[]',
35
  'target_url_weight', 'url_rotation_weights[]', 'prli_geo_url[]', 'prli_geo_countries[]', 'prli_tech_url[]',
36
  'prli_time_url[]', 'prli_time_start[]', 'prli_time_end[]', 'delay'
30
  $('.spinner').css('visibility','visible');
31
 
32
  var fields_to_validate = [
33
+ 'prli_url', 'redirect_type', 'slug', 'url_replacements', 'enable_expire', 'expire_type', 'expire_date',
34
  'expire_clicks', 'enable_expired_url', 'expired_url', 'dynamic_redirection', 'url_rotations[]',
35
  'target_url_weight', 'url_rotation_weights[]', 'prli_geo_url[]', 'prli_geo_countries[]', 'prli_tech_url[]',
36
  'prli_time_url[]', 'prli_time_start[]', 'prli_time_end[]', 'delay'
readme.txt CHANGED
@@ -64,7 +64,7 @@ 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.1 =
68
  * Fix issues when accessing the plugin as a non-administrator
69
  * Simplify the checks in is_slug_available
70
  * Add slug and url as searchable fields in the links list
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.1 ==
68
  * Fix issues when accessing the plugin as a non-administrator
69
  * Simplify the checks in is_slug_available
70
  * Add slug and url as searchable fields in the links list