Version Description
- Improvement: Add an action hook before the enhanced JavaScript redirect
- Bug Fix: Security fix on the link attachment title
Download this release
Release Info
| Developer | supercleanse |
| Plugin | |
| Version | 3.9.3 |
| Comparing to | |
| See all releases | |
Code changes from version 3.9.2 to 3.9.3
- Helpers/Plugin_Constants.php +1 -1
- Models/Affiliate_Link.php +5 -5
- Models/Script_Loader.php +3 -3
- Models/Stats_Reporting.php +14 -12
- js/app/ta-settings.js +7 -3
- readme.txt +5 -1
- thirstyaffiliates.php +5 -5
- views/cpt/view-attach-images-metabox-single-image.php +1 -1
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.9.
|
| 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.9.3';
|
| 31 |
const TEXT_DOMAIN = 'thirstyaffiliates';
|
| 32 |
const THEME_TEMPLATE_PATH = 'thirstyaffiliates';
|
| 33 |
const META_DATA_PREFIX = '_ta_';
|
Models/Affiliate_Link.php
CHANGED
|
@@ -136,7 +136,7 @@ class Affiliate_Link {
|
|
| 136 |
|
| 137 |
/**
|
| 138 |
* List of deprecated properties.
|
| 139 |
-
*
|
| 140 |
* @since 3.3.1
|
| 141 |
* @access protected
|
| 142 |
* @var array
|
|
@@ -330,21 +330,21 @@ class Affiliate_Link {
|
|
| 330 |
|
| 331 |
/**
|
| 332 |
* Get redirect type
|
| 333 |
-
*
|
| 334 |
* @since 3.4.0
|
| 335 |
* @access public
|
| 336 |
-
*
|
| 337 |
* @param string $default Default redirect type.
|
| 338 |
* @return string Redirect type.
|
| 339 |
*/
|
| 340 |
public function get_redirect_type( $default = '' ) {
|
| 341 |
|
| 342 |
$redirect_type = $this->data[ 'redirect_type' ];
|
| 343 |
-
|
| 344 |
if ( $redirect_type === 'global' )
|
| 345 |
$redirect_type = get_option( 'ta_link_redirect_type' , $default );
|
| 346 |
elseif ( ! $redirect_type )
|
| 347 |
-
$redirect_type = $default ? $default :
|
| 348 |
|
| 349 |
return $redirect_type;
|
| 350 |
}
|
| 136 |
|
| 137 |
/**
|
| 138 |
* List of deprecated properties.
|
| 139 |
+
*
|
| 140 |
* @since 3.3.1
|
| 141 |
* @access protected
|
| 142 |
* @var array
|
| 330 |
|
| 331 |
/**
|
| 332 |
* Get redirect type
|
| 333 |
+
*
|
| 334 |
* @since 3.4.0
|
| 335 |
* @access public
|
| 336 |
+
*
|
| 337 |
* @param string $default Default redirect type.
|
| 338 |
* @return string Redirect type.
|
| 339 |
*/
|
| 340 |
public function get_redirect_type( $default = '' ) {
|
| 341 |
|
| 342 |
$redirect_type = $this->data[ 'redirect_type' ];
|
| 343 |
+
|
| 344 |
if ( $redirect_type === 'global' )
|
| 345 |
$redirect_type = get_option( 'ta_link_redirect_type' , $default );
|
| 346 |
elseif ( ! $redirect_type )
|
| 347 |
+
$redirect_type = $default ? $default : get_option( 'ta_link_redirect_type' );
|
| 348 |
|
| 349 |
return $redirect_type;
|
| 350 |
}
|
Models/Script_Loader.php
CHANGED
|
@@ -283,7 +283,7 @@ class Script_Loader implements Model_Interface {
|
|
| 283 |
|
| 284 |
/**
|
| 285 |
* Load scripts for WP Editor.
|
| 286 |
-
*
|
| 287 |
* @since 3.4.0
|
| 288 |
* @access public
|
| 289 |
*/
|
|
@@ -307,7 +307,7 @@ class Script_Loader implements Model_Interface {
|
|
| 307 |
|
| 308 |
/**
|
| 309 |
* Gutenberg backend scripts.
|
| 310 |
-
*
|
| 311 |
* @since 3.6
|
| 312 |
* @access public
|
| 313 |
*/
|
|
@@ -334,7 +334,7 @@ class Script_Loader implements Model_Interface {
|
|
| 334 |
$path = isset( $home_url[ 'path' ] ) ? $home_url[ 'path' ] : '';
|
| 335 |
$port = isset( $home_url[ 'port' ] ) ? ':' . $home_url[ 'port' ] : '';
|
| 336 |
|
| 337 |
-
return $scheme . $home_url[ 'host' ] . $port . $path;
|
| 338 |
}
|
| 339 |
|
| 340 |
/**
|
| 283 |
|
| 284 |
/**
|
| 285 |
* Load scripts for WP Editor.
|
| 286 |
+
*
|
| 287 |
* @since 3.4.0
|
| 288 |
* @access public
|
| 289 |
*/
|
| 307 |
|
| 308 |
/**
|
| 309 |
* Gutenberg backend scripts.
|
| 310 |
+
*
|
| 311 |
* @since 3.6
|
| 312 |
* @access public
|
| 313 |
*/
|
| 334 |
$path = isset( $home_url[ 'path' ] ) ? $home_url[ 'path' ] : '';
|
| 335 |
$port = isset( $home_url[ 'port' ] ) ? ':' . $home_url[ 'port' ] : '';
|
| 336 |
|
| 337 |
+
return apply_filters( 'ta_absolute_home_url', $scheme . $home_url[ 'host' ] . $port . $path );
|
| 338 |
}
|
| 339 |
|
| 340 |
/**
|
Models/Stats_Reporting.php
CHANGED
|
@@ -122,10 +122,10 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
|
|
| 122 |
|
| 123 |
/**
|
| 124 |
* Update $_browser_zone_str class property value.
|
| 125 |
-
*
|
| 126 |
* @since 3.3.3
|
| 127 |
* @access public
|
| 128 |
-
*
|
| 129 |
* @param string $timezone Timezone set on browser
|
| 130 |
*/
|
| 131 |
public function set_browser_zone_str( $timezone ) {
|
|
@@ -136,10 +136,10 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
|
|
| 136 |
|
| 137 |
/**
|
| 138 |
* Register admin interfaces.
|
| 139 |
-
*
|
| 140 |
* @since 3.3.2
|
| 141 |
* @access public
|
| 142 |
-
*
|
| 143 |
* @param array $interfaces List of admin interfaces.
|
| 144 |
* @return array Filtered list of admin interfaces.
|
| 145 |
*/
|
|
@@ -147,22 +147,22 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
|
|
| 147 |
|
| 148 |
$interfaces[ 'thirstylink_page_thirsty-reports' ] = apply_filters( 'ta_reports_admin_interface' , array(
|
| 149 |
'link_performance' => 'manage_options'
|
| 150 |
-
) );
|
| 151 |
|
| 152 |
return $interfaces;
|
| 153 |
}
|
| 154 |
|
| 155 |
/**
|
| 156 |
* Register admin interfaces.
|
| 157 |
-
*
|
| 158 |
* @since 3.3.2
|
| 159 |
* @access public
|
| 160 |
-
*
|
| 161 |
* @param array $interfaces List of menu items.
|
| 162 |
* @return array Filtered list of menu items.
|
| 163 |
*/
|
| 164 |
public function register_admin_menu_items( $menu_items ) {
|
| 165 |
-
|
| 166 |
$menu_items[ 'thirsty-reports' ] = 'manage_options';
|
| 167 |
return $menu_items;
|
| 168 |
}
|
|
@@ -308,9 +308,11 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
|
|
| 308 |
$thirstylink = new Affiliate_Link( $link_id );
|
| 309 |
$redirect_url = apply_filters( 'ta_filter_redirect_url' , $thirstylink->get_prop( 'destination_url' ) , $thirstylink , $query_string );
|
| 310 |
$redirect_type = $thirstylink->get_redirect_type();
|
| 311 |
-
|
| 312 |
$this->save_click_data( $thirstylink , $http_referer , $cloaked_url , $redirect_url , $redirect_type , $keyword );
|
| 313 |
|
|
|
|
|
|
|
| 314 |
// print actual affiliate link redirect url for enhanced javascript redirect support.
|
| 315 |
if ( get_option( 'ta_enable_javascript_frontend_redirect' ) == 'yes' )
|
| 316 |
echo $redirect_url;
|
|
@@ -563,7 +565,7 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
|
|
| 563 |
*
|
| 564 |
* @since 3.0.0
|
| 565 |
* @since 3.2.2 Access to the settings page will now be controlled by the plugin. see Bootstrap::admin_interface_visibility.
|
| 566 |
-
*
|
| 567 |
* @access public
|
| 568 |
*/
|
| 569 |
public function add_reports_submenu() {
|
|
@@ -769,7 +771,7 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
|
|
| 769 |
$start_date->setTime( 0 , 0 );
|
| 770 |
|
| 771 |
$start_date->setTimezone( $utc );
|
| 772 |
-
$end_date->setTimezone( $utc );
|
| 773 |
|
| 774 |
$raw_data = $this->get_link_performance_data( $start_date->format( 'Y-m-d H:i:s' ) , $end_date->format( 'Y-m-d H:i:s' ) , $link_ids );
|
| 775 |
|
|
@@ -1072,6 +1074,6 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
|
|
| 1072 |
add_action( 'before_delete_post' , array( $this , 'delete_stats_data_on_affiliate_link_deletion' ) , 10 );
|
| 1073 |
|
| 1074 |
add_filter( 'ta_admin_interfaces' , array( $this , 'register_admin_interfaces' ) );
|
| 1075 |
-
add_filter( 'ta_menu_items' , array( $this , 'register_admin_menu_items' ) );
|
| 1076 |
}
|
| 1077 |
}
|
| 122 |
|
| 123 |
/**
|
| 124 |
* Update $_browser_zone_str class property value.
|
| 125 |
+
*
|
| 126 |
* @since 3.3.3
|
| 127 |
* @access public
|
| 128 |
+
*
|
| 129 |
* @param string $timezone Timezone set on browser
|
| 130 |
*/
|
| 131 |
public function set_browser_zone_str( $timezone ) {
|
| 136 |
|
| 137 |
/**
|
| 138 |
* Register admin interfaces.
|
| 139 |
+
*
|
| 140 |
* @since 3.3.2
|
| 141 |
* @access public
|
| 142 |
+
*
|
| 143 |
* @param array $interfaces List of admin interfaces.
|
| 144 |
* @return array Filtered list of admin interfaces.
|
| 145 |
*/
|
| 147 |
|
| 148 |
$interfaces[ 'thirstylink_page_thirsty-reports' ] = apply_filters( 'ta_reports_admin_interface' , array(
|
| 149 |
'link_performance' => 'manage_options'
|
| 150 |
+
) );
|
| 151 |
|
| 152 |
return $interfaces;
|
| 153 |
}
|
| 154 |
|
| 155 |
/**
|
| 156 |
* Register admin interfaces.
|
| 157 |
+
*
|
| 158 |
* @since 3.3.2
|
| 159 |
* @access public
|
| 160 |
+
*
|
| 161 |
* @param array $interfaces List of menu items.
|
| 162 |
* @return array Filtered list of menu items.
|
| 163 |
*/
|
| 164 |
public function register_admin_menu_items( $menu_items ) {
|
| 165 |
+
|
| 166 |
$menu_items[ 'thirsty-reports' ] = 'manage_options';
|
| 167 |
return $menu_items;
|
| 168 |
}
|
| 308 |
$thirstylink = new Affiliate_Link( $link_id );
|
| 309 |
$redirect_url = apply_filters( 'ta_filter_redirect_url' , $thirstylink->get_prop( 'destination_url' ) , $thirstylink , $query_string );
|
| 310 |
$redirect_type = $thirstylink->get_redirect_type();
|
| 311 |
+
|
| 312 |
$this->save_click_data( $thirstylink , $http_referer , $cloaked_url , $redirect_url , $redirect_type , $keyword );
|
| 313 |
|
| 314 |
+
do_action( 'ta_before_link_redirect_ajax', $thirstylink, $redirect_url, $redirect_type );
|
| 315 |
+
|
| 316 |
// print actual affiliate link redirect url for enhanced javascript redirect support.
|
| 317 |
if ( get_option( 'ta_enable_javascript_frontend_redirect' ) == 'yes' )
|
| 318 |
echo $redirect_url;
|
| 565 |
*
|
| 566 |
* @since 3.0.0
|
| 567 |
* @since 3.2.2 Access to the settings page will now be controlled by the plugin. see Bootstrap::admin_interface_visibility.
|
| 568 |
+
*
|
| 569 |
* @access public
|
| 570 |
*/
|
| 571 |
public function add_reports_submenu() {
|
| 771 |
$start_date->setTime( 0 , 0 );
|
| 772 |
|
| 773 |
$start_date->setTimezone( $utc );
|
| 774 |
+
$end_date->setTimezone( $utc );
|
| 775 |
|
| 776 |
$raw_data = $this->get_link_performance_data( $start_date->format( 'Y-m-d H:i:s' ) , $end_date->format( 'Y-m-d H:i:s' ) , $link_ids );
|
| 777 |
|
| 1074 |
add_action( 'before_delete_post' , array( $this , 'delete_stats_data_on_affiliate_link_deletion' ) , 10 );
|
| 1075 |
|
| 1076 |
add_filter( 'ta_admin_interfaces' , array( $this , 'register_admin_interfaces' ) );
|
| 1077 |
+
add_filter( 'ta_menu_items' , array( $this , 'register_admin_menu_items' ) );
|
| 1078 |
}
|
| 1079 |
}
|
js/app/ta-settings.js
CHANGED
|
@@ -95,7 +95,11 @@ jQuery( document ).ready( function($){
|
|
| 95 |
} else {
|
| 96 |
|
| 97 |
$cat_select.prop( 'disabled' , true );
|
| 98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
$cat_select.prop( 'required' , false );
|
| 100 |
$cat_select_row.hide();
|
| 101 |
}
|
|
@@ -107,14 +111,14 @@ jQuery( document ).ready( function($){
|
|
| 107 |
|
| 108 |
/**
|
| 109 |
* Initialize block bots settings as a selectized textarea.
|
| 110 |
-
*
|
| 111 |
* @since 3.3.2
|
| 112 |
*/
|
| 113 |
blockBotsSettings : function() {
|
| 114 |
|
| 115 |
$settingsBlock.find( '#ta_blocked_bots' ).selectize({
|
| 116 |
plugins : [ 'restore_on_backspace' , 'remove_button' , 'drag_drop' ],
|
| 117 |
-
delimeter : ',',
|
| 118 |
persist : false,
|
| 119 |
create : function(input) {
|
| 120 |
return {
|
| 95 |
} else {
|
| 96 |
|
| 97 |
$cat_select.prop( 'disabled' , true );
|
| 98 |
+
|
| 99 |
+
if ( $cat_select[0].selectize ) {
|
| 100 |
+
$cat_select[0].selectize.destroy();
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
$cat_select.prop( 'required' , false );
|
| 104 |
$cat_select_row.hide();
|
| 105 |
}
|
| 111 |
|
| 112 |
/**
|
| 113 |
* Initialize block bots settings as a selectized textarea.
|
| 114 |
+
*
|
| 115 |
* @since 3.3.2
|
| 116 |
*/
|
| 117 |
blockBotsSettings : function() {
|
| 118 |
|
| 119 |
$settingsBlock.find( '#ta_blocked_bots' ).selectize({
|
| 120 |
plugins : [ 'restore_on_backspace' , 'remove_button' , 'drag_drop' ],
|
| 121 |
+
delimeter : ',',
|
| 122 |
persist : false,
|
| 123 |
create : function(input) {
|
| 124 |
return {
|
readme.txt
CHANGED
|
@@ -5,7 +5,7 @@ Tags: affiliate, link, affiliate link management, link cloaker, link redirect, s
|
|
| 5 |
Requires at least: 5.0
|
| 6 |
Requires PHP: 5.6
|
| 7 |
Tested up to: 5.4
|
| 8 |
-
Stable tag: 3.9.
|
| 9 |
License: GPLv2 or later
|
| 10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 11 |
|
|
@@ -159,6 +159,10 @@ See our [Knowledge Base](https://thirstyaffiliates.com/knowledge-base/?utm_sourc
|
|
| 159 |
|
| 160 |
== Changelog ==
|
| 161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
= 3.9.2 =
|
| 163 |
* Feature: Add X-Robots-Tag header to nofollow links
|
| 164 |
* Improvement: Add indexes to the plugin database columns
|
| 5 |
Requires at least: 5.0
|
| 6 |
Requires PHP: 5.6
|
| 7 |
Tested up to: 5.4
|
| 8 |
+
Stable tag: 3.9.3
|
| 9 |
License: GPLv2 or later
|
| 10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 11 |
|
| 159 |
|
| 160 |
== Changelog ==
|
| 161 |
|
| 162 |
+
= 3.9.3 =
|
| 163 |
+
* Improvement: Add an action hook before the enhanced JavaScript redirect
|
| 164 |
+
* Bug Fix: Security fix on the link attachment title
|
| 165 |
+
|
| 166 |
= 3.9.2 =
|
| 167 |
* Feature: Add X-Robots-Tag header to nofollow links
|
| 168 |
* Improvement: Add indexes to the plugin database columns
|
thirstyaffiliates.php
CHANGED
|
@@ -3,18 +3,18 @@
|
|
| 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.9.
|
| 7 |
-
* Author:
|
| 8 |
-
* Author URI: https://
|
| 9 |
* Requires at least: 4.5
|
| 10 |
-
* Tested up to: 5.
|
| 11 |
*
|
| 12 |
* Text Domain: thirstyaffiliates
|
| 13 |
* Domain Path: /languages/
|
| 14 |
*
|
| 15 |
* @package ThirstyAffiliates
|
| 16 |
* @category Core
|
| 17 |
-
* @author
|
| 18 |
*/
|
| 19 |
|
| 20 |
if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
| 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.9.3
|
| 7 |
+
* Author: ThirstyAffiliates
|
| 8 |
+
* Author URI: https://thirstyaffiliates.com/
|
| 9 |
* Requires at least: 4.5
|
| 10 |
+
* Tested up to: 5.4
|
| 11 |
*
|
| 12 |
* Text Domain: thirstyaffiliates
|
| 13 |
* Domain Path: /languages/
|
| 14 |
*
|
| 15 |
* @package ThirstyAffiliates
|
| 16 |
* @category Core
|
| 17 |
+
* @author Caseproof, LLC
|
| 18 |
*/
|
| 19 |
|
| 20 |
if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
views/cpt/view-attach-images-metabox-single-image.php
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
<div class="thirsty-attached-image">
|
| 4 |
<span class="thirsty-remove-img" title="<?php esc_attr_e( 'Remove This Image' , 'thirstyaffiliates' ); ?>" id="<?php echo esc_attr( $attachment_id ); ?>">×</span>
|
| 5 |
-
<a class="thirsty-img thickbox" href="<?php echo
|
| 6 |
<?php echo wp_get_attachment_image( $attachment_id , array( 100 , 100 ) ); ?>
|
| 7 |
</a>
|
| 8 |
</div>
|
| 2 |
|
| 3 |
<div class="thirsty-attached-image">
|
| 4 |
<span class="thirsty-remove-img" title="<?php esc_attr_e( 'Remove This Image' , 'thirstyaffiliates' ); ?>" id="<?php echo esc_attr( $attachment_id ); ?>">×</span>
|
| 5 |
+
<a class="thirsty-img thickbox" href="<?php echo esc_url( $img[0] ); ?>" rel="gallery-linkimgs" title="<?php echo esc_attr( sanitize_text_field( get_the_title( $attachment_id ) ) ); ?>">
|
| 6 |
<?php echo wp_get_attachment_image( $attachment_id , array( 100 , 100 ) ); ?>
|
| 7 |
</a>
|
| 8 |
</div>
|
