Changeset 2557190
- Timestamp:
- 07/01/2021 06:20:06 PM (3 years ago)
- Location:
- affiliatewp-external-referral-links
- Files:
-
- 2 deleted
- 6 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
affiliatewp-external-referral-links/tags/1.1.1/affiliatewp-external-referral-links.php
r2556971 r2557190 6 6 * Author: Sandhills Development, LLC 7 7 * Author URI: https://sandhillsdev.com 8 * Version: 1.1 8 * Version: 1.1 9 9 * Text Domain: affiliatewp-external-referral-links 10 10 * … … 23 23 * @package AffiliateWP External Referral Links 24 24 * @category Core 25 * @version 1.1 25 * @version 1.1 26 26 */ 27 27 … … 53 53 54 54 /** 55 * Add-on requirements.56 *57 * @since 1.158 * @var array[]59 */60 protected $addon_requirements = array(61 // AffiliateWP.62 'affwp' => array(63 'minimum' => '2.6',64 'name' => 'AffiliateWP',65 'exists' => true,66 'current' => false,67 'checked' => false,68 'met' => false69 ),70 );71 72 /**73 55 * Bootstrap everything. 74 56 * … … 76 58 */ 77 59 public function bootstrap() { 78 if ( ! class_exists( 'Affiliate_WP' ) ) { 79 80 if ( ! class_exists( 'AffiliateWP_Activation' ) ) { 81 require_once 'includes/lib/affwp/class-affiliatewp-activation.php'; 82 } 83 84 // AffiliateWP activation 85 if ( ! class_exists( 'Affiliate_WP' ) ) { 86 $activation = new AffiliateWP_Activation( plugin_dir_path( __FILE__ ), basename( __FILE__ ) ); 87 $activation = $activation->run(); 88 } 89 } else { 90 \AffiliateWP_External_Referral_Links::instance( __FILE__ ); 91 } 60 \AffiliateWP_External_Referral_Links::instance( __FILE__ ); 92 61 } 93 62 … … 106 75 if ( class_exists( 'AffiliateWP_External_Referral_Links' ) ) { 107 76 108 $affwp_version = get_option( 'affwp_version' ); 109 110 if ( version_compare( $affwp_version, '2.7', '<' ) ) { 111 add_action( 'plugins_loaded', array( $this, 'bootstrap' ), 100 ); 112 } else { 113 add_action( 'affwp_plugins_loaded', array( $this, 'bootstrap' ), 100 ); 114 } 77 add_action( 'plugins_loaded', array( $this, 'bootstrap' ), 100 ); 115 78 116 79 // Register the activation hook. -
affiliatewp-external-referral-links/tags/1.1.1/includes/class-affiliatewp-external-referral-links.php
r2556971 r2557190 42 42 * @var string 43 43 */ 44 private $version = '1.1'; 44 private $version = '1.1.1'; 45 46 /** 47 * Is on Pantheon platform? 48 * 49 * @since 1.1.1 50 * @var bool 51 */ 52 public $is_pantheon = false; 45 53 46 54 /** … … 66 74 self::$instance->hooks(); 67 75 76 77 78 79 68 80 } 69 81 … … 156 168 add_filter( 'plugin_row_meta', array( $this, 'plugin_meta' ), null, 2 ); 157 169 158 // filter the custom cookie name.159 add_filter( 'affwp_get_cookie_name', array( $this, 'set_cookie_name' ), 10, 2 );160 161 170 } 162 171 … … 199 208 wp_enqueue_script( 'affwp-erl', AFFWP_ERL_PLUGIN_URL . 'assets/js/affwp-external-referral-links.min.js', array( 'jquery' ), $this->version ); 200 209 201 // get cookie name. 202 $affwp_version = defined( 'AFFILIATEWP_VERSION' ) ? AFFILIATEWP_VERSION : 'undefined'; 203 if ( version_compare( $affwp_version, '2.7.1', '>=' ) ) { 204 $cookie = affiliate_wp()->tracking->get_cookie_name( 'erl-affiliate' ); 205 } else { 206 $cookie = 'affwp_erl_id'; 210 $cookie = 'affwp_erl_id'; 211 212 if ( true === $this->is_pantheon ) { 213 $cookie = "wp_{$cookie}"; 207 214 } 208 215 … … 217 224 218 225 /** 219 * Sets the custom cookie name220 *221 * @param string $cookie_name The cookie name.222 * @param string $cookie_type The cookie type.223 * @return string The final cookie name.224 */225 public function set_cookie_name( $cookie_name, $cookie_type ) {226 if ( 'erl-affiliate' === $cookie_type ) {227 $cookie_name = 'affwp_erl_id';228 }229 230 return $cookie_name;231 }232 233 /**234 226 * Modify plugin metalinks 235 227 * -
affiliatewp-external-referral-links/tags/1.1.1/readme.txt
r2556971 r2557190 5 5 Tested up to: 5.7 6 6 Requires PHP: 5.6 7 Stable tag: 1.1 7 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 15 > This plugin was built to be used in conjunction with [AffiliateWP](https://affiliatewp.com/ "AffiliateWP") 2.6+.15 > This plugin was built to be used in conjunction with [AffiliateWP](https://affiliatewp.com/ "AffiliateWP"). 16 16 17 17 Like other affiliate plugins, AffiliateWP must be installed on the same domain as your e-commerce system (Easy Digital Downloads, WooCommerce etc) to properly track visits and referrals. … … 40 40 == Changelog == 41 41 42 43 44 45 42 46 = 1.1 = 43 47 * New: Enforce minimum dependency requirements checking -
affiliatewp-external-referral-links/trunk/affiliatewp-external-referral-links.php
r2556971 r2557190 6 6 * Author: Sandhills Development, LLC 7 7 * Author URI: https://sandhillsdev.com 8 * Version: 1.1 8 * Version: 1.1 9 9 * Text Domain: affiliatewp-external-referral-links 10 10 * … … 23 23 * @package AffiliateWP External Referral Links 24 24 * @category Core 25 * @version 1.1 25 * @version 1.1 26 26 */ 27 27 … … 53 53 54 54 /** 55 * Add-on requirements.56 *57 * @since 1.158 * @var array[]59 */60 protected $addon_requirements = array(61 // AffiliateWP.62 'affwp' => array(63 'minimum' => '2.6',64 'name' => 'AffiliateWP',65 'exists' => true,66 'current' => false,67 'checked' => false,68 'met' => false69 ),70 );71 72 /**73 55 * Bootstrap everything. 74 56 * … … 76 58 */ 77 59 public function bootstrap() { 78 if ( ! class_exists( 'Affiliate_WP' ) ) { 79 80 if ( ! class_exists( 'AffiliateWP_Activation' ) ) { 81 require_once 'includes/lib/affwp/class-affiliatewp-activation.php'; 82 } 83 84 // AffiliateWP activation 85 if ( ! class_exists( 'Affiliate_WP' ) ) { 86 $activation = new AffiliateWP_Activation( plugin_dir_path( __FILE__ ), basename( __FILE__ ) ); 87 $activation = $activation->run(); 88 } 89 } else { 90 \AffiliateWP_External_Referral_Links::instance( __FILE__ ); 91 } 60 \AffiliateWP_External_Referral_Links::instance( __FILE__ ); 92 61 } 93 62 … … 106 75 if ( class_exists( 'AffiliateWP_External_Referral_Links' ) ) { 107 76 108 $affwp_version = get_option( 'affwp_version' ); 109 110 if ( version_compare( $affwp_version, '2.7', '<' ) ) { 111 add_action( 'plugins_loaded', array( $this, 'bootstrap' ), 100 ); 112 } else { 113 add_action( 'affwp_plugins_loaded', array( $this, 'bootstrap' ), 100 ); 114 } 77 add_action( 'plugins_loaded', array( $this, 'bootstrap' ), 100 ); 115 78 116 79 // Register the activation hook. -
affiliatewp-external-referral-links/trunk/includes/class-affiliatewp-external-referral-links.php
r2556971 r2557190 42 42 * @var string 43 43 */ 44 private $version = '1.1'; 44 private $version = '1.1.1'; 45 46 /** 47 * Is on Pantheon platform? 48 * 49 * @since 1.1.1 50 * @var bool 51 */ 52 public $is_pantheon = false; 45 53 46 54 /** … … 66 74 self::$instance->hooks(); 67 75 76 77 78 79 68 80 } 69 81 … … 156 168 add_filter( 'plugin_row_meta', array( $this, 'plugin_meta' ), null, 2 ); 157 169 158 // filter the custom cookie name.159 add_filter( 'affwp_get_cookie_name', array( $this, 'set_cookie_name' ), 10, 2 );160 161 170 } 162 171 … … 199 208 wp_enqueue_script( 'affwp-erl', AFFWP_ERL_PLUGIN_URL . 'assets/js/affwp-external-referral-links.min.js', array( 'jquery' ), $this->version ); 200 209 201 // get cookie name. 202 $affwp_version = defined( 'AFFILIATEWP_VERSION' ) ? AFFILIATEWP_VERSION : 'undefined'; 203 if ( version_compare( $affwp_version, '2.7.1', '>=' ) ) { 204 $cookie = affiliate_wp()->tracking->get_cookie_name( 'erl-affiliate' ); 205 } else { 206 $cookie = 'affwp_erl_id'; 210 $cookie = 'affwp_erl_id'; 211 212 if ( true === $this->is_pantheon ) { 213 $cookie = "wp_{$cookie}"; 207 214 } 208 215 … … 217 224 218 225 /** 219 * Sets the custom cookie name220 *221 * @param string $cookie_name The cookie name.222 * @param string $cookie_type The cookie type.223 * @return string The final cookie name.224 */225 public function set_cookie_name( $cookie_name, $cookie_type ) {226 if ( 'erl-affiliate' === $cookie_type ) {227 $cookie_name = 'affwp_erl_id';228 }229 230 return $cookie_name;231 }232 233 /**234 226 * Modify plugin metalinks 235 227 * -
affiliatewp-external-referral-links/trunk/readme.txt
r2556971 r2557190 5 5 Tested up to: 5.7 6 6 Requires PHP: 5.6 7 Stable tag: 1.1 7 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 15 > This plugin was built to be used in conjunction with [AffiliateWP](https://affiliatewp.com/ "AffiliateWP") 2.6+.15 > This plugin was built to be used in conjunction with [AffiliateWP](https://affiliatewp.com/ "AffiliateWP"). 16 16 17 17 Like other affiliate plugins, AffiliateWP must be installed on the same domain as your e-commerce system (Easy Digital Downloads, WooCommerce etc) to properly track visits and referrals. … … 40 40 == Changelog == 41 41 42 43 44 45 42 46 = 1.1 = 43 47 * New: Enforce minimum dependency requirements checking
Note: See TracChangeset
for help on using the changeset viewer.