ThirstyAffiliates Affiliate Link Manager - Version 3.3.0

Version Description

  • Feature: Introduce Enhanced JS Redirect Feature
  • Bug Fix: Link Fixer: When a link has been inserted with category in url, and it is removed in the backend, link won't be detected
  • Bug Fix: Link Fixer: make sure the fetched ID via url_to_postid function for a given link is of "thirstylink" post type
Download this release

Release Info

Developer jkohlbach
Plugin Icon 128x128 ThirstyAffiliates Affiliate Link Manager
Version 3.3.0
Comparing to
See all releases

Code changes from version 3.2.4 to 3.3.0

Helpers/Plugin_Constants.php CHANGED
@@ -27,7 +27,7 @@ class Plugin_Constants {
27
// Plugin configuration constants
28
const TOKEN = 'ta';
29
const INSTALLED_VERSION = 'ta_installed_version';
30
- const VERSION = '3.2.4';
31
const TEXT_DOMAIN = 'thirstyaffiliates';
32
const THEME_TEMPLATE_PATH = 'thirstyaffiliates';
33
const META_DATA_PREFIX = '_ta_';
27
// Plugin configuration constants
28
const TOKEN = 'ta';
29
const INSTALLED_VERSION = 'ta_installed_version';
30
+ const VERSION = '3.3.0';
31
const TEXT_DOMAIN = 'thirstyaffiliates';
32
const THEME_TEMPLATE_PATH = 'thirstyaffiliates';
33
const META_DATA_PREFIX = '_ta_';
Models/Link_Fixer.php CHANGED
@@ -115,6 +115,7 @@ class Link_Fixer implements Model_Interface , Initiable_Interface {
115
*
116
* @since 3.0.0
117
* @since 3.2.4 Make sure that link fixer runs using the default language set on WPML when it is active.
118
* @access public
119
*
120
* @global SitePress $sitepress WPML main plugin object.
@@ -139,21 +140,21 @@ class Link_Fixer implements Model_Interface , Initiable_Interface {
139
$href = esc_url_raw( $link[ 'href' ] );
140
$class = isset( $link[ 'class' ] ) ? sanitize_text_field( $link[ 'class' ] ) : '';
141
$key = (int) sanitize_text_field( $link[ 'key' ] );
142
- $link_id = url_to_postid( $href );
143
144
$thirstylink = new Affiliate_Link( $link_id );
145
146
- if ( ! $thirstylink->get_id() )
147
continue;
148
149
- $class = str_replace( 'thirstylinkimg' , 'thirstylink' , $class );
150
- $class .= ( get_option( 'ta_disable_thirsty_link_class' ) !== "yes" && strpos( $class , 'thirstylink' ) === false ) ? ' thirstylink' : '';
151
- $href = ( $thirstylink->is( 'uncloak_link' ) ) ? apply_filters( 'ta_uncloak_link_url' , $thirstylink->get_prop( 'destination_url' ) , $thirstylink ) : $thirstylink->get_prop( 'permalink' );
152
- $rel = $thirstylink->is( 'no_follow' ) ? 'nofollow' : '';
153
- $rel .= ' ' . $thirstylink->get_prop( 'rel_tags' );
154
- $target = $thirstylink->is( 'new_window' ) ? '_blank' : '';
155
- $title = get_option( 'ta_disable_title_attribute' ) != 'yes' ? esc_attr( str_replace( '"' , '' , $thirstylink->get_prop( 'name' ) ) ) : '';
156
- $title = str_replace( ''' , '\'' , $title );
157
158
if ( $link[ 'is_image' ] )
159
$class = str_replace( 'thirstylink' , 'thirstylinkimg' , $class );
@@ -165,13 +166,44 @@ class Link_Fixer implements Model_Interface , Initiable_Interface {
165
'href' => esc_url_raw( $href ),
166
'rel' => esc_attr( trim( $rel ) ),
167
'target' => esc_attr( $target ),
168
- 'title' => $title
169
);
170
}
171
172
return $data;
173
}
174
175
/**
176
* Ajax link fixer.
177
*
115
*
116
* @since 3.0.0
117
* @since 3.2.4 Make sure that link fixer runs using the default language set on WPML when it is active.
118
+ * @since 3.3.0 Add data-nojs attribute support.
119
* @access public
120
*
121
* @global SitePress $sitepress WPML main plugin object.
140
$href = esc_url_raw( $link[ 'href' ] );
141
$class = isset( $link[ 'class' ] ) ? sanitize_text_field( $link[ 'class' ] ) : '';
142
$key = (int) sanitize_text_field( $link[ 'key' ] );
143
+ $link_id = $this->url_to_affiliate_link_id( $href );
144
145
$thirstylink = new Affiliate_Link( $link_id );
146
147
+ if ( ! $thirstylink->get_id() || get_post_type( $link_id ) !== Plugin_Constants::AFFILIATE_LINKS_CPT )
148
continue;
149
150
+ $class = str_replace( 'thirstylinkimg' , 'thirstylink' , $class );
151
+ $class .= ( get_option( 'ta_disable_thirsty_link_class' ) !== "yes" && strpos( $class , 'thirstylink' ) === false ) ? ' thirstylink' : '';
152
+ $href = ( $thirstylink->is( 'uncloak_link' ) ) ? apply_filters( 'ta_uncloak_link_url' , $thirstylink->get_prop( 'destination_url' ) , $thirstylink ) : $thirstylink->get_prop( 'permalink' );
153
+ $rel = $thirstylink->is( 'no_follow' ) ? 'nofollow' : '';
154
+ $rel .= ' ' . $thirstylink->get_prop( 'rel_tags' );
155
+ $target = $thirstylink->is( 'new_window' ) ? '_blank' : '';
156
+ $title = get_option( 'ta_disable_title_attribute' ) != 'yes' ? esc_attr( str_replace( '"' , '' , $thirstylink->get_prop( 'name' ) ) ) : '';
157
+ $title = str_replace( ''' , '\'' , $title );
158
159
if ( $link[ 'is_image' ] )
160
$class = str_replace( 'thirstylink' , 'thirstylinkimg' , $class );
166
'href' => esc_url_raw( $href ),
167
'rel' => esc_attr( trim( $rel ) ),
168
'target' => esc_attr( $target ),
169
+ 'title' => $title,
170
+ 'nojs' => apply_filters( 'ta_nojs_redirect_attribute' , false , $thirstylink )
171
);
172
}
173
174
return $data;
175
}
176
177
+ /**
178
+ * Get the ID from a given affiliate link URL (replaces url_to_postid function).
179
+ *
180
+ * @since 3.3.0
181
+ * @access private
182
+ *
183
+ * @param string $href Affilaite link cloaked URL.
184
+ * @return int Affiliate link ID.
185
+ */
186
+ private function url_to_affiliate_link_id( $href ) {
187
+
188
+ global $wpdb;
189
+
190
+ $link_parts = explode( "/" , $href );
191
+ $link_prefix = $this->_helper_functions->get_thirstylink_link_prefix();
192
+ $cpt_slug = esc_sql( Plugin_Constants::AFFILIATE_LINKS_CPT );
193
+
194
+ // get the key of the link prefix in the url from the $link_parts variable.
195
+ $key = (int) array_search( $link_prefix , $link_parts );
196
+
197
+ // get the slug from the $link_parts variable based on the position of the link prefix's key.
198
+ // if $key + 2 exists, this means that the link has a category slug in it, so we fetch $key + 2, otherwise we fetch $key + 1 (no category slug).
199
+ $slug = esc_sql( isset( $link_parts[ $key + 2 ] ) && $link_parts[ $key + 2 ] ? $link_parts[ $key + 2 ] : $link_parts[ $key + 1 ] );
200
+
201
+ // fetch the ID based on the post type and slug.
202
+ $id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE post_type = '$cpt_slug' AND post_name = '$slug'" );
203
+
204
+ return $id ? absint( $id ) : 0;
205
+ }
206
+
207
/**
208
* Ajax link fixer.
209
*
Models/Link_Picker.php CHANGED
@@ -235,7 +235,7 @@ class Link_Picker implements Model_Interface {
235
data-href="' . esc_url( $thirstylink->get_prop( 'permalink' ) ) . '"
236
data-rel="' . trim( esc_attr( $rel ) ) . '"
237
data-target="' . esc_attr( $target ) . '"
238
- data-other-atts="' . esc_attr( $other_atts ) . '">
239
<span class="name">' . mb_strimwidth( $thirstylink->get_prop( 'name' ) , 0 , 44 , "..." ) . '</span>
240
<span class="slug">[' . mb_strimwidth( $thirstylink->get_prop( 'slug' ) , 0 , 35 , "..." ) . ']</span>
241
<span class="actions">
235
data-href="' . esc_url( $thirstylink->get_prop( 'permalink' ) ) . '"
236
data-rel="' . trim( esc_attr( $rel ) ) . '"
237
data-target="' . esc_attr( $target ) . '"
238
+ data-other-atts="' . $other_atts . '">
239
<span class="name">' . mb_strimwidth( $thirstylink->get_prop( 'name' ) , 0 , 44 , "..." ) . '</span>
240
<span class="slug">[' . mb_strimwidth( $thirstylink->get_prop( 'slug' ) , 0 , 35 , "..." ) . ']</span>
241
<span class="actions">
Models/Marketing.php CHANGED
@@ -280,7 +280,7 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
280
$( '.ta_tapro_admin_notice' ).on( 'click' , '.notice-dismiss' , function() {
281
$.ajax( ajaxurl , {
282
type: 'POST',
283
- data: { action: 'ta_dismiss_tapro_admin_notice' }
284
} );
285
} );
286
} )( jQuery );
@@ -289,18 +289,35 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
289
}
290
291
/**
292
- * Set SHOW_TAPRO_NOTICE option to "no" when the TA Pro admin notice is dismissed.
293
*
294
- * @since 3.0.0
295
* @access public
296
*/
297
- public function ajax_dismiss_tapro_admin_notice() {
298
299
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
300
- $response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'rwcdplm' ) );
301
else {
302
303
- update_option( Plugin_Constants::SHOW_TAPRO_NOTICE , 'no' );
304
$response = array( 'status' => 'success' );
305
}
306
@@ -345,9 +362,143 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
345
346
}
347
348
349
350
351
/*
352
|--------------------------------------------------------------------------
353
| Fulfill Implemented Interface Contracts
@@ -377,8 +528,10 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
377
*/
378
public function initialize() {
379
380
- add_action( 'wp_ajax_ta_request_review_response' , array( $this , 'ajax_request_review_response' ) );
381
add_action( 'wp_ajax_ta_dismiss_tapro_admin_notice' , array( $this , 'ajax_dismiss_tapro_admin_notice' ) );
382
383
}
384
@@ -395,9 +548,11 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
395
add_action( Plugin_Constants::CRON_TAPRO_NOTICE , array( $this , 'flag_show_tapro_notice' ) );
396
add_action( 'admin_notices' , array( $this , 'show_review_request_notice' ) );
397
add_action( 'admin_notices' , array( $this , 'show_tapro_admin_notice' ) );
398
add_action( 'admin_menu' , array( $this , 'add_pro_features_menu_link' ) , 20 );
399
add_action( 'admin_head', array( $this , 'add_pro_features_menu_link_target' ) );
400
-
401
}
402
403
}
280
$( '.ta_tapro_admin_notice' ).on( 'click' , '.notice-dismiss' , function() {
281
$.ajax( ajaxurl , {
282
type: 'POST',
283
+ data: { action: 'ta_dismiss_marketing_notice' , notice : 'tapro_notice' }
284
} );
285
} );
286
} )( jQuery );
289
}
290
291
/**
292
+ * AJAX dismiss marketing notice.
293
*
294
+ * @since 3.2.5
295
* @access public
296
*/
297
+ public function ajax_dismiss_marketing_notice() {
298
299
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
300
+ $response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
301
+ elseif ( ! isset( $_POST[ 'notice' ] ) )
302
+ $response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
303
else {
304
305
+ $notice = sanitize_text_field( $_POST[ 'notice' ] );
306
+
307
+ switch( $notice ) {
308
+
309
+ case 'tapro_notice' :
310
+ $option = Plugin_Constants::SHOW_TAPRO_NOTICE;
311
+ break;
312
+ case 'enable_js_redirect_notice' :
313
+ $option = 'ta_show_enable_js_redirect_notice';
314
+ break;
315
+ default :
316
+ $option = apply_filters( 'ta_dismiss_marketing_notice_option' , null );
317
+ break;
318
+ }
319
+
320
+ if ( $option ) update_option( $option , 'no' );
321
$response = array( 'status' => 'success' );
322
}
323
362
363
}
364
365
+ /**
366
+ * Display enable js redirect notice.
367
+ *
368
+ * @since 3.3.0
369
+ * @access public
370
+ */
371
+ public function display_enable_js_redirect_notice() {
372
+
373
+ $screen = get_current_screen();
374
+
375
+ $post_type = get_post_type();
376
+ if ( !$post_type && isset( $_GET[ 'post_type' ] ) )
377
+ $post_type = $_GET[ 'post_type' ];
378
+
379
+ if ( ! is_admin() || ! current_user_can( 'manage_options' ) || $post_type !== Plugin_Constants::AFFILIATE_LINKS_CPT || get_option( 'ta_show_enable_js_redirect_notice' , 'yes' ) !== 'yes' )
380
+ return;
381
+
382
+ ?>
383
+ <div class="notice notice-error is-dismissible ta_enable_javascript_redirect_notice">
384
+ <?php
385
+ echo _e( "<h4>Enable Enhanced Javascript Redirect</h4>
386
+ <p>ThirstyAffiliates version 3.2.5 introduces a new method of redirecting via javascript which will only run on your website's frontend.
387
+ We've added this so the plugin can provide more accurate tracking data of your affiliate link clicks.
388
+ This feature is turned on automatically for <strong>new installs</strong>, but for this install we would like to give you the choice of enabling the feature or not.</p>" , 'thirstyaffiliates' );
389
+ ?>
390
+ <p>
391
+ <button type="button" class="button-primary" id="ta_enable_js_redirect_trigger">
392
+ <?php _e( 'Enable enhanced javascript redirect feature' , 'thirstyaffiliates' ); ?>
393
+ </button>
394
+ </p>
395
+ </div>
396
+ <script type="text/javascript">
397
+ ( function( $ ) {
398
+
399
+ // dismiss notice.
400
+ $( '.ta_enable_javascript_redirect_notice' ).on( 'click' , '.notice-dismiss' , function() {
401
+ $.ajax( ajaxurl , {
402
+ type: 'POST',
403
+ data: { action: 'ta_dismiss_marketing_notice' , notice : 'enable_js_redirect_notice' }
404
+ } );
405
+ } );
406
+
407
+ // trigger enable enhanced javascript redirect feature
408
+ $( '.ta_enable_javascript_redirect_notice' ).on( 'click' , '#ta_enable_js_redirect_trigger' , function() {
409
+ $( '.ta_enable_javascript_redirect_notice .notice-dismiss' ).trigger( 'click' );
410
+ $.ajax( ajaxurl , {
411
+ type: 'POST',
412
+ data: { action: 'ta_enable_js_redirect' }
413
+ } );
414
+ } );
415
+
416
+ } )( jQuery );
417
+ </script>
418
+ <?php
419
+ }
420
+
421
+ /**
422
+ * Hide Enable JS redirect setting notice when setting value is changed.
423
+ *
424
+ * @since 3.3.0
425
+ * @access public
426
+ *
427
+ * @param string $value Option value.
428
+ * @return string Filtered option value.
429
+ */
430
+ public function hide_notice_on_enable_js_redirect_setting_change( $value ) {
431
+
432
+ update_option( 'ta_show_enable_js_redirect_notice' , 'no' );
433
+ return $value;
434
+ }
435
+
436
+ /**
437
+ * AJAX enable JS redirect setting.
438
+ *
439
+ * @since 3.2.5
440
+ * @access public
441
+ */
442
+ public function ajax_enable_js_redirect() {
443
+
444
+ if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
445
+ $response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
446
+ elseif ( ! current_user_can( 'manage_options' ) )
447
+ $response = array( 'status' => 'fail' , 'error_msg' => __( 'You are not allowed to do this.' , 'thirstyaffiliates' ) );
448
+ else {
449
450
+ update_option( 'ta_enable_javascript_frontend_redirect' , 'yes' );
451
+ $response = array( 'status' => 'success' );
452
+ }
453
454
+ @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
455
+ echo wp_json_encode( $response );
456
+ wp_die();
457
+ }
458
459
+ /**
460
+ * Add advanced feautures marketing metabox in the sidebar.
461
+ *
462
+ * @since 3.3.0
463
+ * @access public
464
+ *
465
+ * @param array $metabox TA registered metaboxes.
466
+ * @return array Filtered TA registered metaboxes.
467
+ */
468
+ public function add_advanced_features_marketing_metabox( $metaboxes ) {
469
+
470
+ if ( ! $this->_helper_functions->is_plugin_active( 'thirstyaffiliates-pro/thirstyaffiliates-pro.php' ) ) {
471
+
472
+ $metaboxes[] = array(
473
+ 'id' => 'ta-advanced-features-metabox',
474
+ 'title' => __( 'Advanced Features', 'thirstyaffiliates' ),
475
+ 'cb' => array( $this , 'advanced_features_marketing_metabox_cb' ),
476
+ 'sort' => 40,
477
+ 'priority' => 'default'
478
+ );
479
+ }
480
+
481
+ return $metaboxes;
482
+ }
483
+
484
+ /**
485
+ * Display "Advanced Features" metabox
486
+ *
487
+ * @since 3.3.0
488
+ * @access public
489
+ *
490
+ * @param WP_Post $post Affiliate link WP_Post object.
491
+ */
492
+ public function advanced_features_marketing_metabox_cb( $post ) {
493
+
494
+ $url = esc_url( 'https://thirstyaffiliates.com/pricing/?utm_source=Free%20Plugin&utm_medium=Pro&utm_campaign=Sidebar' );
495
+ $img = esc_url( $this->_constants->IMAGES_ROOT_URL() . 'sidebar.jpg' );
496
+ echo '<a href="' . $url . '" target="_blank"><img src="' . $img . '"></a>';
497
+ }
498
+
499
+
500
+
501
+
502
/*
503
|--------------------------------------------------------------------------
504
| Fulfill Implemented Interface Contracts
528
*/
529
public function initialize() {
530
531
+ add_action( 'wp_ajax_ta_request_review_response' , array( $this , 'ajax_request_review_response' ) );
532
add_action( 'wp_ajax_ta_dismiss_tapro_admin_notice' , array( $this , 'ajax_dismiss_tapro_admin_notice' ) );
533
+ add_action( 'wp_ajax_ta_dismiss_marketing_notice' , array( $this , 'ajax_dismiss_marketing_notice' ) );
534
+ add_action( 'wp_ajax_ta_enable_js_redirect' , array( $this , 'ajax_enable_js_redirect' ) );
535
536
}
537
548
add_action( Plugin_Constants::CRON_TAPRO_NOTICE , array( $this , 'flag_show_tapro_notice' ) );
549
add_action( 'admin_notices' , array( $this , 'show_review_request_notice' ) );
550
add_action( 'admin_notices' , array( $this , 'show_tapro_admin_notice' ) );
551
+ add_action( 'admin_notices' , array( $this , 'display_enable_js_redirect_notice' ) );
552
add_action( 'admin_menu' , array( $this , 'add_pro_features_menu_link' ) , 20 );
553
add_action( 'admin_head', array( $this , 'add_pro_features_menu_link_target' ) );
554
+ add_filter( 'option_ta_enable_javascript_frontend_redirect' , array( $this , 'hide_notice_on_enable_js_redirect_setting_change' ) );
555
+ add_filter( 'ta_register_side_metaboxes' , array( $this , 'add_advanced_features_marketing_metabox' ) );
556
}
557
558
}
Models/Rewrites_Redirection.php CHANGED
@@ -219,7 +219,7 @@ class Rewrites_Redirection implements Model_Interface , Deactivatable_Interface
219
220
global $post , $wp_query;
221
222
- if ( ! is_object( $post ) || $post->post_type != Plugin_Constants::AFFILIATE_LINKS_CPT )
223
return;
224
225
$thirstylink = $this->get_thirstylink_post( $post->ID );
219
220
global $post , $wp_query;
221
222
+ if ( is_admin() || ! is_object( $post ) || $post->post_type != Plugin_Constants::AFFILIATE_LINKS_CPT )
223
return;
224
225
$thirstylink = $this->get_thirstylink_post( $post->ID );
Models/Script_Loader.php CHANGED
@@ -263,6 +263,7 @@ class Script_Loader implements Model_Interface {
263
* Load frontend js and css scripts.
264
*
265
* @since 3.0.0
266
* @access public
267
*/
268
public function load_frontend_scripts() {
@@ -274,12 +275,13 @@ class Script_Loader implements Model_Interface {
274
// load main frontend script that holds the link fixer and stat record JS code
275
wp_enqueue_script( 'ta_main_js' , $this->_constants->JS_ROOT_URL() . 'app/ta.js' , array() , Plugin_Constants::VERSION , true );
276
wp_localize_script( 'ta_main_js' , 'thirsty_global_vars' , array(
277
- 'home_url' => $this->_get_absolute_home_url( true ),
278
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
279
- 'link_fixer_enabled' => get_option( 'ta_enable_link_fixer' , 'yes' ),
280
- 'link_prefix' => $this->_helper_functions->get_thirstylink_link_prefix(),
281
- 'link_prefixes' => maybe_unserialize( get_option( 'ta_used_link_prefixes' ) ),
282
- 'post_id' => isset( $post->ID ) ? $post->ID : 0,
283
'disable_thirstylink_class' => get_option( 'ta_disable_thirsty_link_class' )
284
) );
285
}
263
* Load frontend js and css scripts.
264
*
265
* @since 3.0.0
266
+ * @since 3.3.0 Add enable JS redirect TA global var.
267
* @access public
268
*/
269
public function load_frontend_scripts() {
275
// load main frontend script that holds the link fixer and stat record JS code
276
wp_enqueue_script( 'ta_main_js' , $this->_constants->JS_ROOT_URL() . 'app/ta.js' , array() , Plugin_Constants::VERSION , true );
277
wp_localize_script( 'ta_main_js' , 'thirsty_global_vars' , array(
278
+ 'home_url' => $this->_get_absolute_home_url( true ),
279
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
280
+ 'link_fixer_enabled' => get_option( 'ta_enable_link_fixer' , 'yes' ),
281
+ 'link_prefix' => $this->_helper_functions->get_thirstylink_link_prefix(),
282
+ 'link_prefixes' => maybe_unserialize( get_option( 'ta_used_link_prefixes' ) ),
283
+ 'post_id' => isset( $post->ID ) ? $post->ID : 0,
284
+ 'enable_js_redirect' => get_option( 'ta_enable_javascript_frontend_redirect' ),
285
'disable_thirstylink_class' => get_option( 'ta_disable_thirsty_link_class' )
286
) );
287
}
Models/Settings.php CHANGED
@@ -301,9 +301,16 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
301
302
array(
303
'id' => 'ta_browser_no_cache_301_redirect',
304
- 'title' => __( "Don't cache 301 redirects?" , 'thirstyaffiliates' ),
305
'desc' => __( "By default, browsers caches the 301 redirects. Enabling this option will tell the browser not to cache 301 redirects. Be aware that it is still up to the browser if it will cache it or not." , 'thirstyaffiliates' ),
306
'type' => 'toggle'
307
)
308
309
) ),
@@ -354,7 +361,7 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
354
355
array(
356
'id' => 'ta_link_redirect_type',
357
- 'title' => __( 'Link Redirect Type' , 'thirstyaffiliates' ),
358
'desc' => __( "This is the type of redirect ThirstyAffiliates will use to redirect the user to your affiliate link." , 'thirstyaffiliates' ),
359
'type' => 'radio',
360
'options' => $this->_constants->REDIRECT_TYPES(),
@@ -363,7 +370,7 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
363
364
array(
365
'id' => 'ta_no_follow',
366
- 'title' => __( 'Use no follow on links?' , 'thirstyaffiliates' ),
367
'desc' => __( "Add the nofollow attribute to links so search engines don't index them." , 'thirstyaffiliates' ),
368
'type' => 'select',
369
'options' => $toggle_cat_options,
@@ -373,7 +380,7 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
373
374
array(
375
'id' => 'ta_no_follow_category',
376
- 'title' => __( 'No follow categories' , 'thirstyaffiliates' ),
377
'desc' => __( "The links assigned to the selected category will be set as \"no follow\"." , 'thirstyaffiliates' ),
378
'type' => 'multiselect',
379
'options' => $all_categories,
@@ -1894,6 +1901,9 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
1894
update_option( 'ta_link_prefix' , 'recommends' );
1895
update_option( 'ta_link_prefix_custom' , '' );
1896
update_option( 'ta_used_link_prefixes' , array( 'recommends' ) );
1897
update_option( 'ta_settings_initialized' , 'yes' );
1898
}
1899
}
301
302
array(
303
'id' => 'ta_browser_no_cache_301_redirect',
304
+ 'title' => __( "Don't cache 301 redirects? (server side redirects)" , 'thirstyaffiliates' ),
305
'desc' => __( "By default, browsers caches the 301 redirects. Enabling this option will tell the browser not to cache 301 redirects. Be aware that it is still up to the browser if it will cache it or not." , 'thirstyaffiliates' ),
306
'type' => 'toggle'
307
+ ),
308
+
309
+ array(
310
+ 'id' => 'ta_enable_javascript_frontend_redirect',
311
+ 'title' => __( "Enable Enhanced Javascript Redirect on Frontend" , 'thirstyaffiliates' ),
312
+ 'desc' => __( "By default affiliate links are redirected on the server side. Enabling this will set all affiliate links to be redirected via javascript on your website's frontend. This will then improve the accuracy of the link performance report." , 'thirstyaffiliates' ),
313
+ 'type' => 'toggle'
314
)
315
316
) ),
361
362
array(
363
'id' => 'ta_link_redirect_type',
364
+ 'title' => __( 'Link Redirect Type (server side redirects)' , 'thirstyaffiliates' ),
365
'desc' => __( "This is the type of redirect ThirstyAffiliates will use to redirect the user to your affiliate link." , 'thirstyaffiliates' ),
366
'type' => 'radio',
367
'options' => $this->_constants->REDIRECT_TYPES(),
370
371
array(
372
'id' => 'ta_no_follow',
373
+ 'title' => __( 'Use no follow on links? (server side redirects)' , 'thirstyaffiliates' ),
374
'desc' => __( "Add the nofollow attribute to links so search engines don't index them." , 'thirstyaffiliates' ),
375
'type' => 'select',
376
'options' => $toggle_cat_options,
380
381
array(
382
'id' => 'ta_no_follow_category',
383
+ 'title' => __( 'No follow categories (server side redirects)' , 'thirstyaffiliates' ),
384
'desc' => __( "The links assigned to the selected category will be set as \"no follow\"." , 'thirstyaffiliates' ),
385
'type' => 'multiselect',
386
'options' => $all_categories,
1901
update_option( 'ta_link_prefix' , 'recommends' );
1902
update_option( 'ta_link_prefix_custom' , '' );
1903
update_option( 'ta_used_link_prefixes' , array( 'recommends' ) );
1904
+ update_option( 'ta_enable_javascript_frontend_redirect' , 'yes' );
1905
+ update_option( 'ta_show_enable_js_redirect_notice' , 'no' );
1906
+ update_option( 'ta_dismiss_marketing_notice_option' , 'no' );
1907
update_option( 'ta_settings_initialized' , 'yes' );
1908
}
1909
}
Models/Shortcodes.php CHANGED
@@ -140,6 +140,7 @@ class Shortcodes implements Model_Interface {
140
* example: [thirstylink ids="10,15,18,20"]Affiliate Link[/thirstylink]
141
*
142
* @since 3.0.0
143
* @access public
144
*
145
* @param array $atts Shortcode attributes.
@@ -229,6 +230,10 @@ class Shortcodes implements Model_Interface {
229
if ( $uncloak_link )
230
$link_attributes[ 'data-linkid' ] = $link_id;
231
232
// allow the ability to add custom link attributes
233
$link_attributes = apply_filters( 'ta_link_insert_extend_data_attributes' , $link_attributes , $thirstylink , $post_id );
234
140
* example: [thirstylink ids="10,15,18,20"]Affiliate Link[/thirstylink]
141
*
142
* @since 3.0.0
143
+ * @since 3.3.0 Add data-nojs attribute support.
144
* @access public
145
*
146
* @param array $atts Shortcode attributes.
230
if ( $uncloak_link )
231
$link_attributes[ 'data-linkid' ] = $link_id;
232
233
+ // tag links as "nojs" to disable JS redirect for them.
234
+ if ( get_option( 'ta_enable_javascript_frontend_redirect' ) == 'yes' )
235
+ $link_attributes[ 'data-nojs' ] = apply_filters( 'ta_nojs_redirect_attribute' , false , $thirstylink );
236
+
237
// allow the ability to add custom link attributes
238
$link_attributes = apply_filters( 'ta_link_insert_extend_data_attributes' , $link_attributes , $thirstylink , $post_id );
239
Models/Stats_Reporting.php CHANGED
@@ -201,6 +201,7 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
201
*
202
* @since 3.0.0
203
* @since 3.1.0 Passed additional 2 parameters: $redirect_url and $redirect type. Updated save_click_data function call to include new required arguments.
204
* @access public
205
*
206
* @param Affiliate_Link $thirstylink Affiliate link object.
@@ -209,13 +210,23 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
209
*/
210
public function save_click_data_on_redirect( $thirstylink , $redirect_url , $redirect_type ) {
211
212
$link_id = $thirstylink->get_id();
213
$http_referer = isset( $_SERVER[ 'HTTP_REFERER' ] ) ? $_SERVER[ 'HTTP_REFERER' ] : '';
214
$query_string = isset( $_SERVER[ 'QUERY_STRING' ] ) ? $_SERVER[ 'QUERY_STRING' ] : '';
215
$cloaked_url = $query_string ? $thirstylink->get_prop( 'permalink' ) . '?' . $query_string : $thirstylink->get_prop( 'permalink' );
216
217
// if the refferer is from an external site, then record stat.
218
- if ( ! $http_referer || ! strrpos( 'x' . $http_referer , home_url() ) )
219
$this->save_click_data( $thirstylink , $http_referer , $cloaked_url , $redirect_url , $redirect_type );
220
}
221
@@ -225,6 +236,7 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
225
* @since 3.0.0
226
* @since 3.1.0 Updated save_click_data function call to include new required arguments.
227
* @since 3.2.0 Updated save_click_data function call to include keyword argument.
228
* @access public
229
*/
230
public function ajax_save_click_data_on_redirect() {
@@ -245,8 +257,12 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
245
$thirstylink = new Affiliate_Link( $link_id );
246
$redirect_url = apply_filters( 'ta_filter_redirect_url' , $thirstylink->get_prop( 'destination_url' ) , $thirstylink );
247
$redirect_type = $thirstylink->get_prop( 'redirect_type' );
248
-
249
$this->save_click_data( $thirstylink , $http_referer , $cloaked_url , $redirect_url , $redirect_type , $keyword );
250
}
251
252
wp_die();
201
*
202
* @since 3.0.0
203
* @since 3.1.0 Passed additional 2 parameters: $redirect_url and $redirect type. Updated save_click_data function call to include new required arguments.
204
+ * @since 3.3.0 If enhanced javascript redirect in frontend is enabled, then all server redirects are allowed (with this, stats links clicked via "open new tab" will be saved).
205
* @access public
206
*
207
* @param Affiliate_Link $thirstylink Affiliate link object.
210
*/
211
public function save_click_data_on_redirect( $thirstylink , $redirect_url , $redirect_type ) {
212
213
+ // make sure that this is only runs on the frontend and not on the backend.
214
+ if ( is_admin() ) return;
215
+
216
$link_id = $thirstylink->get_id();
217
$http_referer = isset( $_SERVER[ 'HTTP_REFERER' ] ) ? $_SERVER[ 'HTTP_REFERER' ] : '';
218
$query_string = isset( $_SERVER[ 'QUERY_STRING' ] ) ? $_SERVER[ 'QUERY_STRING' ] : '';
219
$cloaked_url = $query_string ? $thirstylink->get_prop( 'permalink' ) . '?' . $query_string : $thirstylink->get_prop( 'permalink' );
220
221
+ $same_site = $http_referer && strrpos( 'x' . $http_referer , home_url() );
222
+ $admin_referrer = $http_referer && strrpos( 'x' . $http_referer , admin_url() );
223
+ $js_redirect_enabled = get_option( 'ta_enable_javascript_frontend_redirect' ) == 'yes';
224
+
225
+ // NOTE: this fixes a bug reported on TA-250
226
+ if ( $http_referer == $cloaked_url || $admin_referrer ) return;
227
+
228
// if the refferer is from an external site, then record stat.
229
+ if ( ( $same_site && $js_redirect_enabled ) || ! $same_site )
230
$this->save_click_data( $thirstylink , $http_referer , $cloaked_url , $redirect_url , $redirect_type );
231
}
232
236
* @since 3.0.0
237
* @since 3.1.0 Updated save_click_data function call to include new required arguments.
238
* @since 3.2.0 Updated save_click_data function call to include keyword argument.
239
+ * @since 3.3.0 print actual affiliate link redirect url for ehanced javascript redirect support.
240
* @access public
241
*/
242
public function ajax_save_click_data_on_redirect() {
257
$thirstylink = new Affiliate_Link( $link_id );
258
$redirect_url = apply_filters( 'ta_filter_redirect_url' , $thirstylink->get_prop( 'destination_url' ) , $thirstylink );
259
$redirect_type = $thirstylink->get_prop( 'redirect_type' );
260
+
261
$this->save_click_data( $thirstylink , $http_referer , $cloaked_url , $redirect_url , $redirect_type , $keyword );
262
+
263
+ // print actual affiliate link redirect url for enhanced javascript redirect support.
264
+ if ( get_option( 'ta_enable_javascript_frontend_redirect' ) == 'yes' )
265
+ echo $redirect_url;
266
}
267
268
wp_die();
images/sidebar.jpg ADDED
Binary file
js/app/affiliate_link_page/dist/affiliate-link-page.css CHANGED
@@ -1 +1 @@
1
- label.info-label{margin:0 10px 5px 0;display:inline-block}label.info-label .tooltip{display:inline-block;width:12px;height:12px;position:relative;top:1px;text-align:center;font-size:9px;font-family:Verdana;background-size:12px 12px;background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTguMS4xLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDkyIDkyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA5MiA5MjsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8Zz4KCTxwYXRoIGQ9Ik00NS4zODYsMC4wMDRDMTkuOTgzLDAuMzQ0LTAuMzMzLDIxLjIxNSwwLjAwNSw0Ni42MTljMC4zNCwyNS4zOTMsMjEuMjA5LDQ1LjcxNSw0Ni42MTEsNDUuMzc3ICAgYzI1LjM5OC0wLjM0Miw0NS43MTgtMjEuMjEzLDQ1LjM4LTQ2LjYxNUM5MS42NTYsMTkuOTg2LDcwLjc4Ni0wLjMzNSw0NS4zODYsMC4wMDR6IE00NS4yNSw3NGwtMC4yNTQtMC4wMDQgICBjLTMuOTEyLTAuMTE2LTYuNjctMi45OTgtNi41NTktNi44NTJjMC4xMDktMy43ODgsMi45MzQtNi41MzgsNi43MTctNi41MzhsMC4yMjcsMC4wMDRjNC4wMjEsMC4xMTksNi43NDgsMi45NzIsNi42MzUsNi45MzcgICBDNTEuOTA0LDcxLjM0Niw0OS4xMjMsNzQsNDUuMjUsNzR6IE02MS43MDUsNDEuMzQxYy0wLjkyLDEuMzA3LTIuOTQzLDIuOTMtNS40OTIsNC45MTZsLTIuODA3LDEuOTM4ICAgYy0xLjU0MSwxLjE5OC0yLjQ3MSwyLjMyNS0yLjgyLDMuNDM0Yy0wLjI3NSwwLjg3My0wLjQxLDEuMTA0LTAuNDM0LDIuODhsLTAuMDA0LDAuNDUxSDM5LjQzbDAuMDMxLTAuOTA3ICAgYzAuMTMxLTMuNzI4LDAuMjIzLTUuOTIxLDEuNzY4LTcuNzMzYzIuNDI0LTIuODQ2LDcuNzcxLTYuMjg5LDcuOTk4LTYuNDM1YzAuNzY2LTAuNTc3LDEuNDEyLTEuMjM0LDEuODkzLTEuOTM2ICAgYzEuMTI1LTEuNTUxLDEuNjIzLTIuNzcyLDEuNjIzLTMuOTcyYzAtMS42NjUtMC40OTQtMy4yMDUtMS40NzEtNC41NzZjLTAuOTM5LTEuMzIzLTIuNzIzLTEuOTkzLTUuMzAzLTEuOTkzICAgYy0yLjU1OSwwLTQuMzExLDAuODEyLTUuMzU5LDIuNDc4Yy0xLjA3OCwxLjcxMy0xLjYyMywzLjUxMi0xLjYyMyw1LjM1djAuNDU3SDI3LjkzNmwwLjAyLTAuNDc3ICAgYzAuMjg1LTYuNzY5LDIuNzAxLTExLjY0Myw3LjE3OC0xNC40ODdDMzcuOTQ3LDE4LjkxOCw0MS40NDcsMTgsNDUuNTMxLDE4YzUuMzQ2LDAsOS44NTksMS4yOTksMTMuNDEyLDMuODYxICAgYzMuNiwyLjU5Niw1LjQyNiw2LjQ4NCw1LjQyNiwxMS41NTZDNjQuMzY5LDM2LjI1NCw2My40NzMsMzguOTE5LDYxLjcwNSw0MS4zNDF6IiBmaWxsPSIjNzU3NTc1Ii8+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}label.info-label.block{display:block}.ta-form-input{height:31px;font-size:14px;border:1px solid #dfdfdf;width:100%;margin:0 0 5px;padding:5px}.clearfix:after{content:"";clear:both;display:table}.ta-input-description{color:#909090;padding-left:2px;font-style:italic;font-size:10px}div#edit-slug-box{padding-left:0}.submitdelete{color:red;font-weight:400;text-decoration:underline;margin-left:5px}#thirsty_image_holder{background:#fff;overflow:hidden;padding:0 0 20px;margin:10px 0 0;border:1px solid #dfdfdf;text-align:center}#thirsty_image_holder .thirsty-attached-image{position:relative;border:1px solid #eee;padding:5px;margin-left:20px;margin-top:20px;float:left}#thirsty_image_holder .thirsty-remove-img{position:absolute;top:-8px;right:-8px;background:#c00;color:#fff;font-size:16px;font-weight:700;line-height:.7em;padding:2px 3px 4px;border-radius:50px;cursor:pointer}#ta_upload_insert_img,#ta_upload_media_manager{margin-top:5px}#ta_upload_insert_img a{text-decoration:none}.wp-media-buttons-icon:before{content:"\F104";font-family:dashicons;font-size:12px}.attachments-browser .media-toolbar-secondary{width:300px;max-width:300px}.attachments-browser .media-toolbar-primary{width:200px;max-width:200px}#ta-inserted-link-scanner-metabox .inside{position:relative;overflow:hidden}#ta-inserted-link-scanner-metabox .inside .overlay{display:none;position:absolute;top:0;left:0;background-repeat:no-repeat;background-position:50%;background-color:hsla(0,0%,100%,.64);width:100%;height:1000px;z-index:10}.scanned-inserted-status{margin-bottom:15px}.scanned-inserted-status:after{content:"";display:table;clear:both}.scanned-inserted-status #inserted-link-scan-trigger{float:left;margin-right:8px}.scanned-inserted-status .last-scanned{float:left;margin-top:5px}.inserted-into-table table{width:100%;border:1px solid #dadada;border-collapse:collapse}.inserted-into-table table tr td,.inserted-into-table table tr th{border-bottom:1px solid #dadada;padding:5px 10px;margin:0}.inserted-into-table table tr .id{width:50px}.inserted-into-table table tr .post-type{width:100px}.inserted-into-table table tr .actions{text-align:right;width:60px}.inserted-into-table table tr .actions a{text-decoration:none;color:#2c3e50}.inserted-into-table table tr .actions a.view{color:#0085ba}.inserted-into-table table tr .actions a:hover{opacity:.7}
1
+ label.info-label{margin:0 10px 5px 0;display:inline-block}label.info-label .tooltip{display:inline-block;width:12px;height:12px;position:relative;top:1px;text-align:center;font-size:9px;font-family:Verdana;background-size:12px 12px;background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTguMS4xLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDkyIDkyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA5MiA5MjsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8Zz4KCTxwYXRoIGQ9Ik00NS4zODYsMC4wMDRDMTkuOTgzLDAuMzQ0LTAuMzMzLDIxLjIxNSwwLjAwNSw0Ni42MTljMC4zNCwyNS4zOTMsMjEuMjA5LDQ1LjcxNSw0Ni42MTEsNDUuMzc3ICAgYzI1LjM5OC0wLjM0Miw0NS43MTgtMjEuMjEzLDQ1LjM4LTQ2LjYxNUM5MS42NTYsMTkuOTg2LDcwLjc4Ni0wLjMzNSw0NS4zODYsMC4wMDR6IE00NS4yNSw3NGwtMC4yNTQtMC4wMDQgICBjLTMuOTEyLTAuMTE2LTYuNjctMi45OTgtNi41NTktNi44NTJjMC4xMDktMy43ODgsMi45MzQtNi41MzgsNi43MTctNi41MzhsMC4yMjcsMC4wMDRjNC4wMjEsMC4xMTksNi43NDgsMi45NzIsNi42MzUsNi45MzcgICBDNTEuOTA0LDcxLjM0Niw0OS4xMjMsNzQsNDUuMjUsNzR6IE02MS43MDUsNDEuMzQxYy0wLjkyLDEuMzA3LTIuOTQzLDIuOTMtNS40OTIsNC45MTZsLTIuODA3LDEuOTM4ICAgYy0xLjU0MSwxLjE5OC0yLjQ3MSwyLjMyNS0yLjgyLDMuNDM0Yy0wLjI3NSwwLjg3My0wLjQxLDEuMTA0LTAuNDM0LDIuODhsLTAuMDA0LDAuNDUxSDM5LjQzbDAuMDMxLTAuOTA3ICAgYzAuMTMxLTMuNzI4LDAuMjIzLTUuOTIxLDEuNzY4LTcuNzMzYzIuNDI0LTIuODQ2LDcuNzcxLTYuMjg5LDcuOTk4LTYuNDM1YzAuNzY2LTAuNTc3LDEuNDEyLTEuMjM0LDEuODkzLTEuOTM2ICAgYzEuMTI1LTEuNTUxLDEuNjIzLTIuNzcyLDEuNjIzLTMuOTcyYzAtMS42NjUtMC40OTQtMy4yMDUtMS40NzEtNC41NzZjLTAuOTM5LTEuMzIzLTIuNzIzLTEuOTkzLTUuMzAzLTEuOTkzICAgYy0yLjU1OSwwLTQuMzExLDAuODEyLTUuMzU5LDIuNDc4Yy0xLjA3OCwxLjcxMy0xLjYyMywzLjUxMi0xLjYyMyw1LjM1djAuNDU3SDI3LjkzNmwwLjAyLTAuNDc3ICAgYzAuMjg1LTYuNzY5LDIuNzAxLTExLjY0Myw3LjE3OC0xNC40ODdDMzcuOTQ3LDE4LjkxOCw0MS40NDcsMTgsNDUuNTMxLDE4YzUuMzQ2LDAsOS44NTksMS4yOTksMTMuNDEyLDMuODYxICAgYzMuNiwyLjU5Niw1LjQyNiw2LjQ4NCw1LjQyNiwxMS41NTZDNjQuMzY5LDM2LjI1NCw2My40NzMsMzguOTE5LDYxLjcwNSw0MS4zNDF6IiBmaWxsPSIjNzU3NTc1Ii8+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}label.info-label.block{display:block}.ta-form-input{height:31px;font-size:14px;border:1px solid #dfdfdf;width:100%;margin:0 0 5px;padding:5px}.clearfix:after{content:"";clear:both;display:table}.ta-input-description{color:#909090;padding-left:2px;font-style:italic;font-size:10px}div#edit-slug-box{padding-left:0}.submitdelete{color:red;font-weight:400;text-decoration:underline;margin-left:5px}#ta-advanced-features-metabox .inside{margin:0;padding:0}#ta-advanced-features-metabox .inside img{float:left}#ta-advanced-features-metabox .inside:after{content:"";clear:both;display:table}#thirsty_image_holder{background:#fff;overflow:hidden;padding:0 0 20px;margin:10px 0 0;border:1px solid #dfdfdf;text-align:center}#thirsty_image_holder .thirsty-attached-image{position:relative;border:1px solid #eee;padding:5px;margin-left:20px;margin-top:20px;float:left}#thirsty_image_holder .thirsty-remove-img{position:absolute;top:-8px;right:-8px;background:#c00;color:#fff;font-size:16px;font-weight:700;line-height:.7em;padding:2px 3px 4px;border-radius:50px;cursor:pointer}#ta_upload_insert_img,#ta_upload_media_manager{margin-top:5px}#ta_upload_insert_img a{text-decoration:none}.wp-media-buttons-icon:before{content:"\F104";font-family:dashicons;font-size:12px}.attachments-browser .media-toolbar-secondary{width:300px;max-width:300px}.attachments-browser .media-toolbar-primary{width:200px;max-width:200px}#ta-inserted-link-scanner-metabox .inside{position:relative;overflow:hidden}#ta-inserted-link-scanner-metabox .inside .overlay{display:none;position:absolute;top:0;left:0;background-repeat:no-repeat;background-position:50%;background-color:hsla(0,0%,100%,.64);width:100%;height:1000px;z-index:10}.scanned-inserted-status{margin-bottom:15px}.scanned-inserted-status:after{content:"";display:table;clear:both}.scanned-inserted-status #inserted-link-scan-trigger{float:left;margin-right:8px}.scanned-inserted-status .last-scanned{float:left;margin-top:5px}.inserted-into-table table{width:100%;border:1px solid #dadada;border-collapse:collapse}.inserted-into-table table tr td,.inserted-into-table table tr th{border-bottom:1px solid #dadada;padding:5px 10px;margin:0}.inserted-into-table table tr .id{width:50px}.inserted-into-table table tr .post-type{width:100px}.inserted-into-table table tr .actions{text-align:right;width:60px}.inserted-into-table table tr .actions a{text-decoration:none;color:#2c3e50}.inserted-into-table table tr .actions a.view{color:#0085ba}.inserted-into-table table tr .actions a:hover{opacity:.7}
js/app/ta.js CHANGED
@@ -12,10 +12,7 @@ jQuery( document ).ready( function($) {
12
recordLinkStatEvents : function() {
13
14
// record link on normal click
15
- $( 'body' ).on( 'click' , 'a' , function(e) {
16
- thirstyFunctions.recordLinkStat( $(this) );
17
- });
18
-
19
},
20
21
/**
@@ -23,13 +20,23 @@ jQuery( document ).ready( function($) {
23
*
24
* @since 3.0.0
25
* @since 3.2.0 Removed event trigger. Added keyword variable in the AJAX trigger.
26
*/
27
- recordLinkStat : function( $link ) {
28
29
- var href = $link.attr( 'href' ),
30
linkID = $link.data( 'linkid' ),
31
keyword = $link.text(),
32
- imgsrc;
33
34
// get image filename and use it as keyword.
35
if ( ! keyword && $link.find( 'img' ).length ) {
@@ -40,12 +47,31 @@ jQuery( document ).ready( function($) {
40
41
if ( thirstyFunctions.isThirstyLink( href ) || linkID ) {
42
43
$.post( thirsty_global_vars.ajax_url , {
44
action : 'ta_click_data_redirect',
45
href : href,
46
page : window.location.href,
47
link_id : linkID,
48
keyword : keyword
49
} );
50
}
51
},
@@ -77,6 +103,7 @@ jQuery( document ).ready( function($) {
77
* Function to check if the loaded link is a ThirstyAffiliates link or not.
78
*
79
* @since 3.0.0
80
*/
81
linkFixer : function() {
82
@@ -146,6 +173,10 @@ jQuery( document ).ready( function($) {
146
.prop( 'target' , response.data[ x ][ 'target' ] )
147
.attr( 'data-linkid' , response.data[ x ][ 'link_id' ] );
148
149
}
150
}
151
}, 'json' );
12
recordLinkStatEvents : function() {
13
14
// record link on normal click
15
+ $( 'body' ).on( 'click' , 'a' , thirstyFunctions.recordLinkStat );
16
},
17
18
/**
20
*
21
* @since 3.0.0
22
* @since 3.2.0 Removed event trigger. Added keyword variable in the AJAX trigger.
23
+ * @since 3.3.0 Add javascript redirect feature.
24
*/
25
+ recordLinkStat : function( e ) {
26
27
+ var $link = $(this),
28
+ href = $link.attr( 'href' ),
29
linkID = $link.data( 'linkid' ),
30
keyword = $link.text(),
31
+ imgsrc,
32
+ newWindow;
33
+
34
+ // prevent duplicate clicks.
35
+ if ( $link.data( "clicked" ) ) {
36
+ e.preventDefault();
37
+ return;
38
+ }
39
+ $link.data( "clicked" , true );
40
41
// get image filename and use it as keyword.
42
if ( ! keyword && $link.find( 'img' ).length ) {
47
48
if ( thirstyFunctions.isThirstyLink( href ) || linkID ) {
49
50
+ if ( thirsty_global_vars.enable_js_redirect === 'yes' && $link.data( 'nojs' ) != true ) {
51
+
52
+ e.preventDefault();
53
+
54
+ if ( $link.prop( 'target' ) == '_blank' )
55
+ newWindow = window.open( '' , '_blank' );
56
+ }
57
+
58
$.post( thirsty_global_vars.ajax_url , {
59
action : 'ta_click_data_redirect',
60
href : href,
61
page : window.location.href,
62
link_id : linkID,
63
keyword : keyword
64
+ } , function( redirect_url ) {
65
+
66
+ $link.data( "clicked" , false );
67
+
68
+ if ( thirsty_global_vars.enable_js_redirect !== 'yes' || $link.data( 'nojs' ) == true )
69
+ return;
70
+
71
+ if ( newWindow )
72
+ newWindow.location.href = redirect_url ? redirect_url : href;
73
+ else
74
+ window.location.href = redirect_url ? redirect_url : href;
75
} );
76
}
77
},
103
* Function to check if the loaded link is a ThirstyAffiliates link or not.
104
*
105
* @since 3.0.0
106
+ * @since 3.3.0 Add data-nojs attribute support.
107
*/
108
linkFixer : function() {
109
173
.prop( 'target' , response.data[ x ][ 'target' ] )
174
.attr( 'data-linkid' , response.data[ x ][ 'link_id' ] );
175
176
+ // tag links as "nojs" to disable JS redirect for them.
177
+ if ( thirsty_global_vars.enable_js_redirect === 'yes' )
178
+ $( $allLinks[ key ] ).attr( 'data-nojs' , response.data[ x ][ 'nojs' ] );
179
+
180
}
181
}
182
}, 'json' );
js/lib/thirstymce/editor-plugin.js CHANGED
@@ -216,6 +216,7 @@
216
target : target,
217
'data-wplink-edit': null,
218
'data-thirstylink-edit' : null,
219
};
220
221
if ( typeof other_atts == 'object' && Object.keys( other_atts ).length > 0 ) {
216
target : target,
217
'data-wplink-edit': null,
218
'data-thirstylink-edit' : null,
219
+ 'data-mce-bogus' : null,
220
};
221
222
if ( typeof other_atts == 'object' && Object.keys( other_atts ).length > 0 ) {
languages/thirstyaffiliates.pot CHANGED
@@ -2,7 +2,7 @@
2
msgid ""
3
msgstr ""
4
"Project-Id-Version: ThirstyAffiliates\n"
5
- "POT-Creation-Date: 2018-02-26 10:54+0800\n"
6
"PO-Revision-Date: 2016-04-29 07:38+0800\n"
7
"Last-Translator: \n"
8
"Language-Team: Rymera Web Co <support@thirstyaffiliates.com>\n"
@@ -40,11 +40,11 @@ msgstr ""
40
#: Models/Affiliate_Link_Attachment.php:130
41
#: Models/Affiliate_Link_Attachment.php:200 Models/Affiliate_Links_CPT.php:857
42
#: Models/Affiliate_Links_CPT.php:882 Models/Guided_Tour.php:313
43
- #: Models/Link_Fixer.php:184 Models/Link_Fixer.php:186
44
#: Models/Link_Picker.php:279 Models/Link_Picker.php:337
45
#: Models/Link_Picker.php:457 Models/Marketing.php:175 Models/Marketing.php:300
46
- #: Models/Settings.php:1736 Models/Settings.php:1784
47
- #: Models/Stats_Reporting.php:335 Models/Stats_Reporting.php:380
48
msgid "Invalid AJAX call"
49
msgstr ""
50
@@ -52,7 +52,8 @@ msgstr ""
52
#: Models/Affiliate_Link_Attachment.php:202 Models/Affiliate_Links_CPT.php:859
53
#: Models/Affiliate_Links_CPT.php:884 Models/Link_Picker.php:281
54
#: Models/Link_Picker.php:339 Models/Link_Picker.php:459
55
- #: Models/Stats_Reporting.php:337 Models/Stats_Reporting.php:382
56
msgid "Missing required post data"
57
msgstr ""
58
@@ -258,7 +259,7 @@ msgstr ""
258
msgid "Show Link Categories"
259
msgstr ""
260
261
- #: Models/Bootstrap.php:389 Models/Settings.php:674
262
msgid "Settings"
263
msgstr ""
264
@@ -369,7 +370,7 @@ msgstr ""
369
msgid "No affiliate links found"
370
msgstr ""
371
372
- #: Models/Marketing.php:177 Models/Settings.php:1786
373
msgid "Required parameter not passed"
374
msgstr ""
375
@@ -420,6 +421,26 @@ msgid ""
420
" <p><a href=\"%s\" target=\"_blank\">Check out the ThristyAffiliates Pro features here →</a></p>"
421
msgstr ""
422
423
#: Models/Migration.php:284
424
msgid "Invalid AJAX Call."
425
msgstr ""
@@ -608,326 +629,334 @@ msgid "months (Automatically clean the statistics database records older than a
608
msgstr ""
609
610
#: Models/Settings.php:304
611
- msgid "Don't cache 301 redirects?"
612
msgstr ""
613
614
#: Models/Settings.php:305
615
msgid "By default, browsers caches the 301 redirects. Enabling this option will tell the browser not to cache 301 redirects. Be aware that it is still up to the browser if it will cache it or not."
616
msgstr ""
617
618
- #: Models/Settings.php:314
619
msgid "Link Prefix"
620
msgstr ""
621
622
- #: Models/Settings.php:315
623
#, php-format
624
msgid "The prefix that comes before your cloaked link's slug. <br>eg. %s/<strong>recommends</strong>/your-affiliate-link-name.<br><br><b>Warning :</b> Changing this setting after you've used links in a post could break those links. Be careful!"
625
msgstr ""
626
627
- #: Models/Settings.php:343
628
msgid "Custom Link Prefix"
629
msgstr ""
630
631
- #: Models/Settings.php:344
632
msgid "Enter your preferred link prefix."
633
msgstr ""
634
635
- #: Models/Settings.php:350
636
msgid "Link Category in URL?"
637
msgstr ""
638
639
- #: Models/Settings.php:351
640
#, php-format
641
msgid "Shows the primary selected category in the url. eg. %s/recommends/<strong>link-category</strong>/your-affiliate-link-name.<br><br><b>Warning :</b> Changing this setting after you've used links in a post could break those links. Be careful!"
642
msgstr ""
643
644
- #: Models/Settings.php:357
645
- msgid "Link Redirect Type"
646
msgstr ""
647
648
- #: Models/Settings.php:358
649
msgid "This is the type of redirect ThirstyAffiliates will use to redirect the user to your affiliate link."
650
msgstr ""
651
652
- #: Models/Settings.php:366
653
- msgid "Use no follow on links?"
654
msgstr ""
655
656
- #: Models/Settings.php:367
657
msgid "Add the nofollow attribute to links so search engines don't index them."
658
msgstr ""
659
660
- #: Models/Settings.php:376
661
- msgid "No follow categories"
662
msgstr ""
663
664
- #: Models/Settings.php:377
665
msgid "The links assigned to the selected category will be set as \"no follow\"."
666
msgstr ""
667
668
- #: Models/Settings.php:381 Models/Settings.php:403 Models/Settings.php:425
669
- #: Models/Settings.php:459
670
msgid "Select category..."
671
msgstr ""
672
673
- #: Models/Settings.php:388
674
msgid "Open links in new window?"
675
msgstr ""
676
677
- #: Models/Settings.php:389
678
msgid "Make links open in a new browser tab by default."
679
msgstr ""
680
681
- #: Models/Settings.php:398
682
msgid "New window categories"
683
msgstr ""
684
685
- #: Models/Settings.php:399
686
msgid "The links assigned to the selected category will be set as \"new window\"."
687
msgstr ""
688
689
- #: Models/Settings.php:410
690
msgid "Pass query strings to destination url?"
691
msgstr ""
692
693
- #: Models/Settings.php:411
694
msgid "Enabling this option will pass all of the query strings present after the cloaked url to the destination url automatically when redirecting."
695
msgstr ""
696
697
- #: Models/Settings.php:420
698
msgid "Pass query strings categories"
699
msgstr ""
700
701
- #: Models/Settings.php:421
702
msgid "The links assigned to the selected category will be set as \"pass query strings\"."
703
msgstr ""
704
705
- #: Models/Settings.php:432
706
msgid "Additional rel attribute tags"
707
msgstr ""
708
709
- #: Models/Settings.php:433
710
msgid "Allows you to add extra tags into the rel= attribute when links are inserted."
711
msgstr ""
712
713
- #: Models/Settings.php:439
714
msgid "Disable ThirstyAffiliates CSS classes?"
715
msgstr ""
716
717
- #: Models/Settings.php:440
718
msgid "To help with styling a CSS class called \"thirstylink\" is added links on insertion.<br>Likewise the \"thirstylinkimg\" class is added to images when using the image insertion type. This option disables the addition these CSS classes."
719
msgstr ""
720
721
- #: Models/Settings.php:446
722
msgid "Disable title attribute on link insertion?"
723
msgstr ""
724
725
- #: Models/Settings.php:447
726
msgid "Links are automatically output with a title html attribute (by default this shows the title of the affiliate link).<br>This option disables the output of the title attribute on your links."
727
msgstr ""
728
729
- #: Models/Settings.php:453
730
msgid "Select Category to Uncloak"
731
msgstr ""
732
733
- #: Models/Settings.php:454
734
msgid "The links assigned to the selected category will be uncloaked."
735
msgstr ""
736
737
- #: Models/Settings.php:468
738
msgid "Statistics"
739
msgstr ""
740
741
- #: Models/Settings.php:469
742
msgid "When enabled, ThirstyAffiliates will collect click statistics information about visitors that click on your affiliate links. Also adds a new Reports section."
743
msgstr ""
744
745
- #: Models/Settings.php:476
746
msgid "Link Fixer"
747
msgstr ""
748
749
- #: Models/Settings.php:477
750
msgid "Link Fixer is a tiny piece of javascript code that runs on the frontend of your site to fix any outdated/broken affiliate links it detects. It's cache-friendly and runs after page load so it doesn't affect the rendering of content. Changed the settings on your site recently? Enabling Link Fixer means you don't need to update all your previously inserted affiliate links one by one – your visitors will never see an out of date affiliate link again."
751
msgstr ""
752
753
- #: Models/Settings.php:484
754
msgid "Uncloak Links"
755
msgstr ""
756
757
- #: Models/Settings.php:485
758
msgid "Uncloak Links is a feature to allow uncloaking of specific links on your site. It replaces the cloaked url with the actual destination url which is important for compatibility with some affiliate program with stricter terms (such as Amazon Associates). Once enabled, you will see a new Uncloak Link checkbox on the affiliate link edit screen. It also introduces a new setting under the Links tab for uncloaking whole categories.<br><br><b>Warning : </b>For this feature to work, the <strong>Link Fixer</strong> module needs to be turned on."
759
msgstr ""
760
761
- #: Models/Settings.php:495
762
msgid "Import Global Settings"
763
msgstr ""
764
765
- #: Models/Settings.php:497
766
msgid "Paste settings string here..."
767
msgstr ""
768
769
- #: Models/Settings.php:502
770
msgid "Export Global Settings"
771
msgstr ""
772
773
- #: Models/Settings.php:511 Models/Settings.php:519
774
msgid "Knowledge Base"
775
msgstr ""
776
777
- #: Models/Settings.php:516
778
msgid "Documentation"
779
msgstr ""
780
781
- #: Models/Settings.php:520
782
msgid "Guides, troubleshooting, FAQ and more."
783
msgstr ""
784
785
- #: Models/Settings.php:525
786
msgid "Our Blog"
787
msgstr ""
788
789
- #: Models/Settings.php:528
790
msgid "ThirstyAffiliates Blog"
791
msgstr ""
792
793
- #: Models/Settings.php:529
794
msgid "Learn & grow your affiliate marketing – covering increasing sales, generating traffic, optimising your affiliate marketing, interviews & case studies."
795
msgstr ""
796
797
- #: Models/Settings.php:534
798
msgid "Join the Community"
799
msgstr ""
800
801
- #: Models/Settings.php:541
802
msgid "Other Utilities"
803
msgstr ""
804
805
- #: Models/Settings.php:546
806
msgid "Migrate Old Data"
807
msgstr ""
808
809
- #: Models/Settings.php:548
810
msgid "Migrate old ThirstyAffiliates version 2 data to new version 3 data model."
811
msgstr ""
812
813
- #: Models/Settings.php:673 Models/Settings.php:693
814
msgid "ThirstyAffiliates Settings"
815
msgstr ""
816
817
- #: Models/Settings.php:706
818
msgid "Pro Features →"
819
msgstr ""
820
821
- #: Models/Settings.php:824
822
msgid "Save Changes"
823
msgstr ""
824
825
- #: Models/Settings.php:1300
826
msgid "Key"
827
msgstr ""
828
829
- #: Models/Settings.php:1301
830
msgid "Value"
831
msgstr ""
832
833
- #: Models/Settings.php:1424
834
msgid "Another application is currently processing the database. Please wait for this to complete."
835
msgstr ""
836
837
- #: Models/Settings.php:1434
838
msgid "Migrate"
839
msgstr ""
840
841
- #: Models/Settings.php:1437
842
msgid "Migrating data. Please wait..."
843
msgstr ""
844
845
- #: Models/Settings.php:1468
846
msgid "Like us on Facebook"
847
msgstr ""
848
849
- #: Models/Settings.php:1472
850
msgid "Follow us on Twitter"
851
msgstr ""
852
853
- #: Models/Settings.php:1476
854
msgid "Follow us on Linkedin"
855
msgstr ""
856
857
- #: Models/Settings.php:1479
858
msgid "Join Our Affiliate Program"
859
msgstr ""
860
861
- #: Models/Settings.php:1480
862
#, php-format
863
msgid "(up to 30% commisions)"
864
msgstr ""
865
866
- #: Models/Settings.php:1513
867
msgid "Copy"
868
msgstr ""
869
870
- #: Models/Settings.php:1550
871
msgid "Import Settings"
872
msgstr ""
873
874
- #: Models/Settings.php:1765
875
msgid "Unauthorized operation. Only authorized accounts can access global plugin settings string"
876
msgstr ""
877
878
- #: Models/Settings.php:1794
879
msgid "Settings successfully imported"
880
msgstr ""
881
882
- #: Models/Settings.php:1816
883
msgid "Unauthorized operation. Only authorized accounts can import settings"
884
msgstr ""
885
886
- #: Models/Settings.php:1821
887
msgid "Invalid global settings string"
888
msgstr ""
889
890
- #: Models/Shortcodes.php:250
891
msgid "SHORTCODE ERROR: ThirstyAffiliates did not detect a valid link id, please check your short code!"
892
msgstr ""
893
894
- #: Models/Stats_Reporting.php:350
895
msgid "Selected affiliate link is invalid"
896
msgstr ""
897
898
- #: Models/Stats_Reporting.php:474
899
msgid "Link Overview"
900
msgstr ""
901
902
- #: Models/Stats_Reporting.php:475
903
msgid "Link Overview Report"
904
msgstr ""
905
906
- #: Models/Stats_Reporting.php:476
907
msgid "Total clicks on affiliate links over a given period."
908
msgstr ""
909
910
- #: Models/Stats_Reporting.php:502
911
msgid "ThirstyAffiliates Reports"
912
msgstr ""
913
914
- #: Models/Stats_Reporting.php:503
915
msgid "Reports"
916
msgstr ""
917
918
- #: Models/Stats_Reporting.php:581
919
msgid "Year"
920
msgstr ""
921
922
- #: Models/Stats_Reporting.php:582
923
msgid "Last Month"
924
msgstr ""
925
926
- #: Models/Stats_Reporting.php:583
927
msgid "This Month"
928
msgstr ""
929
930
- #: Models/Stats_Reporting.php:584
931
msgid "Last 7 Days"
932
msgstr ""
933
@@ -990,8 +1019,7 @@ msgid "Post Type"
990
msgstr ""
991
992
#: views/cpt/view-link-options-metabox.php:7
993
- #: views/linkpicker/quick-add-affiliate-link.php:50
994
- msgid "No follow this link?"
995
msgstr ""
996
997
#: views/cpt/view-link-options-metabox.php:8
@@ -1034,7 +1062,7 @@ msgid "Uncloaks the link when loaded on the frontend."
1034
msgstr ""
1035
1036
#: views/cpt/view-link-options-metabox.php:57
1037
- msgid "Redirect type:"
1038
msgstr ""
1039
1040
#: views/cpt/view-link-options-metabox.php:58
@@ -1124,6 +1152,10 @@ msgstr ""
1124
msgid "Redirect Type:"
1125
msgstr ""
1126
1127
#: views/linkpicker/quick-add-affiliate-link.php:74
1128
msgid "Select categories..."
1129
msgstr ""
2
msgid ""
3
msgstr ""
4
"Project-Id-Version: ThirstyAffiliates\n"
5
+ "POT-Creation-Date: 2018-04-05 11:42+0800\n"
6
"PO-Revision-Date: 2016-04-29 07:38+0800\n"
7
"Last-Translator: \n"
8
"Language-Team: Rymera Web Co <support@thirstyaffiliates.com>\n"
40
#: Models/Affiliate_Link_Attachment.php:130
41
#: Models/Affiliate_Link_Attachment.php:200 Models/Affiliate_Links_CPT.php:857
42
#: Models/Affiliate_Links_CPT.php:882 Models/Guided_Tour.php:313
43
+ #: Models/Link_Fixer.php:216 Models/Link_Fixer.php:218
44
#: Models/Link_Picker.php:279 Models/Link_Picker.php:337
45
#: Models/Link_Picker.php:457 Models/Marketing.php:175 Models/Marketing.php:300
46
+ #: Models/Marketing.php:445 Models/Settings.php:1743 Models/Settings.php:1791
47
+ #: Models/Stats_Reporting.php:351 Models/Stats_Reporting.php:396
48
msgid "Invalid AJAX call"
49
msgstr ""
50
52
#: Models/Affiliate_Link_Attachment.php:202 Models/Affiliate_Links_CPT.php:859
53
#: Models/Affiliate_Links_CPT.php:884 Models/Link_Picker.php:281
54
#: Models/Link_Picker.php:339 Models/Link_Picker.php:459
55
+ #: Models/Marketing.php:302 Models/Stats_Reporting.php:353
56
+ #: Models/Stats_Reporting.php:398
57
msgid "Missing required post data"
58
msgstr ""
59
259
msgid "Show Link Categories"
260
msgstr ""
261
262
+ #: Models/Bootstrap.php:389 Models/Settings.php:681
263
msgid "Settings"
264
msgstr ""
265
370
msgid "No affiliate links found"
371
msgstr ""
372
373
+ #: Models/Marketing.php:177 Models/Settings.php:1793
374
msgid "Required parameter not passed"
375
msgstr ""
376
421
" <p><a href=\"%s\" target=\"_blank\">Check out the ThristyAffiliates Pro features here →</a></p>"
422
msgstr ""
423
424
+ #: Models/Marketing.php:385
425
+ msgid ""
426
+ "<h4>Enable Enhanced Javascript Redirect</h4>\n"
427
+ " <p>ThirstyAffiliates version 3.2.5 introduces a new method of redirecting via javascript which will only run on your website's frontend.\n"
428
+ " We've added this so the plugin can provide more accurate tracking data of your affiliate link clicks.\n"
429
+ " This feature is turned on automatically for <strong>new installs</strong>, but for this install we would like to give you the choice of enabling the feature or not.</p>"
430
+ msgstr ""
431
+
432
+ #: Models/Marketing.php:392
433
+ msgid "Enable enhanced javascript redirect feature"
434
+ msgstr ""
435
+
436
+ #: Models/Marketing.php:447
437
+ msgid "You are not allowed to do this."
438
+ msgstr ""
439
+
440
+ #: Models/Marketing.php:474
441
+ msgid "Advanced Features"
442
+ msgstr ""
443
+
444
#: Models/Migration.php:284
445
msgid "Invalid AJAX Call."
446
msgstr ""
629
msgstr ""
630
631
#: Models/Settings.php:304
632
+ msgid "Don't cache 301 redirects? (server side redirects)"
633
msgstr ""
634
635
#: Models/Settings.php:305
636
msgid "By default, browsers caches the 301 redirects. Enabling this option will tell the browser not to cache 301 redirects. Be aware that it is still up to the browser if it will cache it or not."
637
msgstr ""
638
639
+ #: Models/Settings.php:311
640
+ msgid "Enable Enhanced Javascript Redirect on Frontend"
641
+ msgstr ""
642
+
643
+ #: Models/Settings.php:312
644
+ msgid "By default affiliate links are redirected on the server side. Enabling this will set all affiliate links to be redirected via javascript on your website's frontend. This will then improve the accuracy of the link performance report."
645
+ msgstr ""
646
+
647
+ #: Models/Settings.php:321
648
msgid "Link Prefix"
649
msgstr ""
650
651
+ #: Models/Settings.php:322
652
#, php-format
653
msgid "The prefix that comes before your cloaked link's slug. <br>eg. %s/<strong>recommends</strong>/your-affiliate-link-name.<br><br><b>Warning :</b> Changing this setting after you've used links in a post could break those links. Be careful!"
654
msgstr ""
655
656
+ #: Models/Settings.php:350
657
msgid "Custom Link Prefix"
658
msgstr ""
659
660
+ #: Models/Settings.php:351
661
msgid "Enter your preferred link prefix."
662
msgstr ""
663
664
+ #: Models/Settings.php:357
665
msgid "Link Category in URL?"
666
msgstr ""
667
668
+ #: Models/Settings.php:358
669
#, php-format
670
msgid "Shows the primary selected category in the url. eg. %s/recommends/<strong>link-category</strong>/your-affiliate-link-name.<br><br><b>Warning :</b> Changing this setting after you've used links in a post could break those links. Be careful!"
671
msgstr ""
672
673
+ #: Models/Settings.php:364
674
+ msgid "Link Redirect Type (server side redirects)"
675
msgstr ""
676
677
+ #: Models/Settings.php:365
678
msgid "This is the type of redirect ThirstyAffiliates will use to redirect the user to your affiliate link."
679
msgstr ""
680
681
+ #: Models/Settings.php:373
682
+ msgid "Use no follow on links? (server side redirects)"
683
msgstr ""
684
685
+ #: Models/Settings.php:374
686
msgid "Add the nofollow attribute to links so search engines don't index them."
687
msgstr ""
688
689
+ #: Models/Settings.php:383
690
+ msgid "No follow categories (server side redirects)"
691
msgstr ""
692
693
+ #: Models/Settings.php:384
694
msgid "The links assigned to the selected category will be set as \"no follow\"."
695
msgstr ""
696
697
+ #: Models/Settings.php:388 Models/Settings.php:410 Models/Settings.php:432
698
+ #: Models/Settings.php:466
699
msgid "Select category..."
700
msgstr ""
701
702
+ #: Models/Settings.php:395
703
msgid "Open links in new window?"
704
msgstr ""
705
706
+ #: Models/Settings.php:396
707
msgid "Make links open in a new browser tab by default."
708
msgstr ""
709
710
+ #: Models/Settings.php:405
711
msgid "New window categories"
712
msgstr ""
713
714
+ #: Models/Settings.php:406
715
msgid "The links assigned to the selected category will be set as \"new window\"."
716
msgstr ""
717
718
+ #: Models/Settings.php:417
719
msgid "Pass query strings to destination url?"
720
msgstr ""
721
722
+ #: Models/Settings.php:418
723
msgid "Enabling this option will pass all of the query strings present after the cloaked url to the destination url automatically when redirecting."
724
msgstr ""
725
726
+ #: Models/Settings.php:427
727
msgid "Pass query strings categories"
728
msgstr ""
729
730
+ #: Models/Settings.php:428
731
msgid "The links assigned to the selected category will be set as \"pass query strings\"."
732
msgstr ""
733
734
+ #: Models/Settings.php:439
735
msgid "Additional rel attribute tags"
736
msgstr ""
737
738
+ #: Models/Settings.php:440
739
msgid "Allows you to add extra tags into the rel= attribute when links are inserted."
740
msgstr ""
741
742
+ #: Models/Settings.php:446
743
msgid "Disable ThirstyAffiliates CSS classes?"
744
msgstr ""
745
746
+ #: Models/Settings.php:447
747
msgid "To help with styling a CSS class called \"thirstylink\" is added links on insertion.<br>Likewise the \"thirstylinkimg\" class is added to images when using the image insertion type. This option disables the addition these CSS classes."
748
msgstr ""
749
750
+ #: Models/Settings.php:453
751
msgid "Disable title attribute on link insertion?"
752
msgstr ""
753
754
+ #: Models/Settings.php:454
755
msgid "Links are automatically output with a title html attribute (by default this shows the title of the affiliate link).<br>This option disables the output of the title attribute on your links."
756
msgstr ""
757
758
+ #: Models/Settings.php:460
759
msgid "Select Category to Uncloak"
760
msgstr ""
761
762
+ #: Models/Settings.php:461
763
msgid "The links assigned to the selected category will be uncloaked."
764
msgstr ""
765
766
+ #: Models/Settings.php:475
767
msgid "Statistics"
768
msgstr ""
769
770
+ #: Models/Settings.php:476
771
msgid "When enabled, ThirstyAffiliates will collect click statistics information about visitors that click on your affiliate links. Also adds a new Reports section."
772
msgstr ""
773
774
+ #: Models/Settings.php:483
775
msgid "Link Fixer"
776
msgstr ""
777
778
+ #: Models/Settings.php:484
779
msgid "Link Fixer is a tiny piece of javascript code that runs on the frontend of your site to fix any outdated/broken affiliate links it detects. It's cache-friendly and runs after page load so it doesn't affect the rendering of content. Changed the settings on your site recently? Enabling Link Fixer means you don't need to update all your previously inserted affiliate links one by one – your visitors will never see an out of date affiliate link again."
780
msgstr ""
781
782
+ #: Models/Settings.php:491
783
msgid "Uncloak Links"
784
msgstr ""
785
786
+ #: Models/Settings.php:492
787
msgid "Uncloak Links is a feature to allow uncloaking of specific links on your site. It replaces the cloaked url with the actual destination url which is important for compatibility with some affiliate program with stricter terms (such as Amazon Associates). Once enabled, you will see a new Uncloak Link checkbox on the affiliate link edit screen. It also introduces a new setting under the Links tab for uncloaking whole categories.<br><br><b>Warning : </b>For this feature to work, the <strong>Link Fixer</strong> module needs to be turned on."
788
msgstr ""
789
790
+ #: Models/Settings.php:502
791
msgid "Import Global Settings"
792
msgstr ""
793
794
+ #: Models/Settings.php:504
795
msgid "Paste settings string here..."
796
msgstr ""
797
798
+ #: Models/Settings.php:509
799
msgid "Export Global Settings"
800
msgstr ""
801
802
+ #: Models/Settings.php:518 Models/Settings.php:526
803
msgid "Knowledge Base"
804
msgstr ""
805
806
+ #: Models/Settings.php:523
807
msgid "Documentation"
808
msgstr ""
809
810
+ #: Models/Settings.php:527
811
msgid "Guides, troubleshooting, FAQ and more."
812
msgstr ""
813
814
+ #: Models/Settings.php:532
815
msgid "Our Blog"
816
msgstr ""
817
818
+ #: Models/Settings.php:535
819
msgid "ThirstyAffiliates Blog"
820
msgstr ""
821
822
+ #: Models/Settings.php:536
823
msgid "Learn & grow your affiliate marketing – covering increasing sales, generating traffic, optimising your affiliate marketing, interviews & case studies."
824
msgstr ""
825
826
+ #: Models/Settings.php:541
827
msgid "Join the Community"
828
msgstr ""
829
830
+ #: Models/Settings.php:548
831
msgid "Other Utilities"
832
msgstr ""
833
834
+ #: Models/Settings.php:553
835
msgid "Migrate Old Data"
836
msgstr ""
837
838
+ #: Models/Settings.php:555
839
msgid "Migrate old ThirstyAffiliates version 2 data to new version 3 data model."
840
msgstr ""
841
842
+ #: Models/Settings.php:680 Models/Settings.php:700
843
msgid "ThirstyAffiliates Settings"
844
msgstr ""
845
846
+ #: Models/Settings.php:713
847
msgid "Pro Features →"
848
msgstr ""
849
850
+ #: Models/Settings.php:831
851
msgid "Save Changes"
852
msgstr ""
853
854
+ #: Models/Settings.php:1307
855
msgid "Key"
856
msgstr ""
857
858
+ #: Models/Settings.php:1308
859
msgid "Value"
860
msgstr ""
861
862
+ #: Models/Settings.php:1431
863
msgid "Another application is currently processing the database. Please wait for this to complete."
864
msgstr ""
865
866
+ #: Models/Settings.php:1441
867
msgid "Migrate"
868
msgstr ""
869
870
+ #: Models/Settings.php:1444
871
msgid "Migrating data. Please wait..."
872
msgstr ""
873
874
+ #: Models/Settings.php:1475
875
msgid "Like us on Facebook"
876
msgstr ""
877
878
+ #: Models/Settings.php:1479
879
msgid "Follow us on Twitter"
880
msgstr ""
881
882
+ #: Models/Settings.php:1483
883
msgid "Follow us on Linkedin"
884
msgstr ""
885
886
+ #: Models/Settings.php:1486
887
msgid "Join Our Affiliate Program"
888
msgstr ""
889
890
+ #: Models/Settings.php:1487
891
#, php-format
892
msgid "(up to 30% commisions)"
893
msgstr ""
894
895
+ #: Models/Settings.php:1520
896
msgid "Copy"
897
msgstr ""
898
899
+ #: Models/Settings.php:1557
900
msgid "Import Settings"
901
msgstr ""
902
903
+ #: Models/Settings.php:1772
904
msgid "Unauthorized operation. Only authorized accounts can access global plugin settings string"
905
msgstr ""
906
907
+ #: Models/Settings.php:1801
908
msgid "Settings successfully imported"
909
msgstr ""
910
911
+ #: Models/Settings.php:1823
912
msgid "Unauthorized operation. Only authorized accounts can import settings"
913
msgstr ""
914
915
+ #: Models/Settings.php:1828
916
msgid "Invalid global settings string"
917
msgstr ""
918
919
+ #: Models/Shortcodes.php:255
920
msgid "SHORTCODE ERROR: ThirstyAffiliates did not detect a valid link id, please check your short code!"
921
msgstr ""
922
923
+ #: Models/Stats_Reporting.php:366
924
msgid "Selected affiliate link is invalid"
925
msgstr ""
926
927
+ #: Models/Stats_Reporting.php:490
928
msgid "Link Overview"
929
msgstr ""
930
931
+ #: Models/Stats_Reporting.php:491
932
msgid "Link Overview Report"
933
msgstr ""
934
935
+ #: Models/Stats_Reporting.php:492
936
msgid "Total clicks on affiliate links over a given period."
937
msgstr ""
938
939
+ #: Models/Stats_Reporting.php:518
940
msgid "ThirstyAffiliates Reports"
941
msgstr ""
942
943
+ #: Models/Stats_Reporting.php:519
944
msgid "Reports"
945
msgstr ""
946
947
+ #: Models/Stats_Reporting.php:597
948
msgid "Year"
949
msgstr ""
950
951
+ #: Models/Stats_Reporting.php:598
952
msgid "Last Month"
953
msgstr ""
954
955
+ #: Models/Stats_Reporting.php:599
956
msgid "This Month"
957
msgstr ""
958
959
+ #: Models/Stats_Reporting.php:600
960
msgid "Last 7 Days"
961
msgstr ""
962
1019
msgstr ""
1020
1021
#: views/cpt/view-link-options-metabox.php:7
1022
+ msgid "No follow this link? (server side redirects)"
1023
msgstr ""
1024
1025
#: views/cpt/view-link-options-metabox.php:8
1062
msgstr ""
1063
1064
#: views/cpt/view-link-options-metabox.php:57
1065
+ msgid "Redirect type (server side redirects):"
1066
msgstr ""
1067
1068
#: views/cpt/view-link-options-metabox.php:58
1152
msgid "Redirect Type:"
1153
msgstr ""
1154
1155
+ #: views/linkpicker/quick-add-affiliate-link.php:50
1156
+ msgid "No follow this link?"
1157
+ msgstr ""
1158
+
1159
#: views/linkpicker/quick-add-affiliate-link.php:74
1160
msgid "Select categories..."
1161
msgstr ""
readme.txt CHANGED
@@ -2,10 +2,10 @@
2
Contributors: jkohlbach, RymeraWebCo
3
Donate link:
4
Tags: affiliate, link, affiliate link management, link cloaker, link redirect, shortlink, thirstyaffiliates, thirsty affiliates
5
- Requires at least: 3.4
6
Requires PHP: 5.6
7
Tested up to: 4.9.4
8
- Stable tag: 3.2.4
9
License: GPLv2 or later
10
License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
@@ -159,6 +159,11 @@ See our [Knowledge Base](https://thirstyaffiliates.com/knowledge-base/?utm_sourc
159
160
== Changelog ==
161
162
= 3.2.4 =
163
* Bug Fix: Issues with link fixer for sub-directory installs and with WPML translation
164
2
Contributors: jkohlbach, RymeraWebCo
3
Donate link:
4
Tags: affiliate, link, affiliate link management, link cloaker, link redirect, shortlink, thirstyaffiliates, thirsty affiliates
5
+ Requires at least: 4.3
6
Requires PHP: 5.6
7
Tested up to: 4.9.4
8
+ Stable tag: 3.3.0
9
License: GPLv2 or later
10
License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
159
160
== Changelog ==
161
162
+ = 3.3.0 =
163
+ * Feature: Introduce Enhanced JS Redirect Feature
164
+ * Bug Fix: Link Fixer: When a link has been inserted with category in url, and it is removed in the backend, link won't be detected
165
+ * Bug Fix: Link Fixer: make sure the fetched ID via url_to_postid function for a given link is of "thirstylink" post type
166
+
167
= 3.2.4 =
168
* Bug Fix: Issues with link fixer for sub-directory installs and with WPML translation
169
thirstyaffiliates.php CHANGED
@@ -3,7 +3,7 @@
3
* Plugin Name: ThirstyAffiliates
4
* Plugin URI: http://thirstyaffiliates.com/
5
* Description: ThirstyAffiliates is a revolution in affiliate link management. Collect, collate and store your affiliate links for use in your posts and pages.
6
- * Version: 3.2.4
7
* Author: Rymera Web Co
8
* Author URI: https://rymera.com.au/
9
* Requires at least: 4.4.2
3
* Plugin Name: ThirstyAffiliates
4
* Plugin URI: http://thirstyaffiliates.com/
5
* Description: ThirstyAffiliates is a revolution in affiliate link management. Collect, collate and store your affiliate links for use in your posts and pages.
6
+ * Version: 3.3.0
7
* Author: Rymera Web Co
8
* Author URI: https://rymera.com.au/
9
* Requires at least: 4.4.2
views/cpt/view-link-options-metabox.php CHANGED
@@ -4,7 +4,7 @@ wp_nonce_field( 'thirsty_affiliates_cpt_nonce', '_thirstyaffiliates_nonce' ); ?>
4
5
<p>
6
<label class="info-label block" for="ta_no_follow">
7
- <?php _e( 'No follow this link?' , 'thirstyaffiliates' ); ?>
8
<span class="tooltip" data-tip="<?php esc_attr_e( 'Adds the rel="nofollow" tag so search engines don\'t pass link juice.' , 'thirstyaffiliates' ); ?>"></span>
9
</label>
10
<select id="ta_no_follow" name="ta_no_follow">
@@ -54,7 +54,7 @@ wp_nonce_field( 'thirsty_affiliates_cpt_nonce', '_thirstyaffiliates_nonce' ); ?>
54
55
<p>
56
<label class="info-label block" for="ta_redirect_type">
57
- <?php _e( 'Redirect type:' , 'thirstyaffiliates' ); ?>
58
<span class="tooltip" data-tip="<?php esc_attr_e( 'Override the default redirection type for this link.' , 'thirstyaffiliates' ); ?>"></span>
59
</label>
60
<select id="ta_redirect_type" name="ta_redirect_type">
4
5
<p>
6
<label class="info-label block" for="ta_no_follow">
7
+ <?php _e( 'No follow this link? (server side redirects)' , 'thirstyaffiliates' ); ?>
8
<span class="tooltip" data-tip="<?php esc_attr_e( 'Adds the rel="nofollow" tag so search engines don\'t pass link juice.' , 'thirstyaffiliates' ); ?>"></span>
9
</label>
10
<select id="ta_no_follow" name="ta_no_follow">
54
55
<p>
56
<label class="info-label block" for="ta_redirect_type">
57
+ <?php _e( 'Redirect type (server side redirects):' , 'thirstyaffiliates' ); ?>
58
<span class="tooltip" data-tip="<?php esc_attr_e( 'Override the default redirection type for this link.' , 'thirstyaffiliates' ); ?>"></span>
59
</label>
60
<select id="ta_redirect_type" name="ta_redirect_type">