Changeset 3083885
- Timestamp:
- 05/09/2024 11:16:52 AM (22 months ago)
- Location:
- clickwhale
- Files:
-
- 14 edited
- 1 copied
-
tags/2.1.3 (copied) (copied from clickwhale/trunk)
-
tags/2.1.3/clickwhale.php (modified) (3 diffs)
-
tags/2.1.3/includes/Clickwhale_Activator.php (modified) (1 diff)
-
tags/2.1.3/includes/admin/links/Clickwhale_Link_Edit.php (modified) (4 diffs)
-
tags/2.1.3/includes/front/tracking/Clickwhale_Click_Track.php (modified) (5 diffs)
-
tags/2.1.3/includes/front/tracking/Clickwhale_Parser.php (modified) (1 diff)
-
tags/2.1.3/includes/front/tracking/Clickwhale_Visitor_Track.php (modified) (1 diff)
-
tags/2.1.3/readme.txt (modified) (2 diffs)
-
trunk/clickwhale.php (modified) (3 diffs)
-
trunk/includes/Clickwhale_Activator.php (modified) (1 diff)
-
trunk/includes/admin/links/Clickwhale_Link_Edit.php (modified) (4 diffs)
-
trunk/includes/front/tracking/Clickwhale_Click_Track.php (modified) (5 diffs)
-
trunk/includes/front/tracking/Clickwhale_Parser.php (modified) (1 diff)
-
trunk/includes/front/tracking/Clickwhale_Visitor_Track.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
clickwhale/tags/2.1.3/clickwhale.php
r3078528 r3083885 10 10 * Plugin URI: https://clickwhale.pro 11 11 * Description: Link Manager, Link Shortener and Click Tracker for Affiliate Links & Link Pages. 12 * Version: 2.1. 212 * Version: 2.1.3 13 13 * Requires at least: 5.0 14 14 * Requires PHP: 7.4 … … 31 31 * Current plugin version. 32 32 */ 33 define( 'CLICKWHALE_VERSION', '2.1. 2' );33 define( 'CLICKWHALE_VERSION', '2.1.3' ); 34 34 define( 'CLICKWHALE_NAME', 'clickwhale' ); 35 35 /** … … 65 65 'public_key' => 'pk_07a5633bd94c00467e7e58c200504', 66 66 'is_premium' => false, 67 'premium_suffix' => ' Pro',67 'premium_suffix' => '(Pro)', 68 68 'has_addons' => false, 69 69 'has_paid_plans' => true, -
clickwhale/tags/2.1.3/includes/Clickwhale_Activator.php
r3040533 r3083885 212 212 ); 213 213 } 214 215 /* @since 2.1.3 */ 216 if ( version_compare( CLICKWHALE_VERSION, '2.1.3', '>=' ) && 217 ! get_option( 'clickwhale_updated_links_table_url_column' ) 218 ){ 219 $query = $wpdb->query( "ALTER TABLE {$wpdb->prefix}clickwhale_links MODIFY COLUMN url varchar(1000) DEFAULT '' NOT NULL" ); 220 221 if ( $query ) { 222 add_option( 'clickwhale_updated_links_table_url_column', CLICKWHALE_VERSION ); 223 } 224 } 214 225 } 215 226 -
clickwhale/tags/2.1.3/includes/admin/links/Clickwhale_Link_Edit.php
r3070750 r3083885 11 11 class Clickwhale_Link_Edit extends Clickwhale_Instance_Edit { 12 12 13 public function __construct() { 13 /** 14 * @var string 15 */ 16 private $links_table; 17 18 public function __construct() { 14 19 parent::__construct( 'links', 'link' ); 20 21 $this->links_table = Helper::get_db_table_name( $this->instance_plural ); 15 22 } 16 23 … … 53 60 global $wpdb; 54 61 55 $links_table = Helper::get_db_table_name( $this->instance_plural ); 56 $item = array_intersect_key( $_POST, $this->get_defaults() ); 57 62 /* @since 2.1.3 */ 63 if ( version_compare( CLICKWHALE_VERSION, '2.1.3', '>=' ) && 64 ! get_option( 'clickwhale_updated_links_table_url_column' ) 65 ){ 66 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 67 $query = $wpdb->query( "ALTER TABLE $this->links_table MODIFY COLUMN url varchar(1000) DEFAULT '' NOT NULL" ); 68 69 if ( $query ) { 70 add_option( 'clickwhale_updated_links_table_url_column', CLICKWHALE_VERSION ); 71 } 72 } 73 74 $item = array_intersect_key( $_POST, $this->get_defaults() ); 58 75 $item['categories'] = isset( $item['categories'] ) ? implode( ',', $item['categories'] ) : ''; 59 76 $item['nofollow'] = isset( $item['nofollow'] ); … … 66 83 if ( Links_Helper::get_by_id( intval( $item['id'] ) ) ) { 67 84 $wpdb->update( 68 $links_table,85 $this->links_table, 69 86 $item, 70 87 array( 'id' => $item['id'] ) … … 74 91 } else { 75 92 $wpdb->insert( 76 $links_table,93 $this->links_table, 77 94 $item 78 95 ); -
clickwhale/tags/2.1.3/includes/front/tracking/Clickwhale_Click_Track.php
r3040533 r3083885 2 2 namespace clickwhale\includes\front\tracking; 3 3 4 use clickwhale\includes\front\tracking\Clickwhale_Visitor_Track;5 4 use clickwhale\includes\helpers\Linkpages_Helper; 6 5 … … 17 16 */ 18 17 protected $link_id; 19 protected $linkage_id;20 18 protected $user; 21 19 protected $visitor; … … 43 41 } 44 42 45 private function get_linkpage_id() {43 private function get_linkpage_id(): int { 46 44 $url = strtolower( $this->get_link_referer() ); 47 45 … … 54 52 $result = Linkpages_Helper::get_by_slug( $url ); 55 53 56 return $result['id'] ;54 return $result['id'] ?? 0; 57 55 } 58 56 … … 65 63 $item['link_id'] = ! $this->is_custom ? $this->link_id : 0; 66 64 $item['custom_link_id'] = $this->is_custom ? $this->link_id : ''; 67 $item['linkpage_id'] = $this->get_linkpage_id() ? $this->get_linkpage_id() : 0;65 $item['linkpage_id'] = $this->get_linkpage_id(); 68 66 $item['visitor_id'] = $visitor_id; 69 67 $item['referer'] = $this->get_link_referer(); -
clickwhale/tags/2.1.3/includes/front/tracking/Clickwhale_Parser.php
r3040533 r3083885 5 5 exit; 6 6 } 7 8 use clickwhale\includes\front\tracking\{9 Clickwhale_Bot,10 Clickwhale_Device,11 Clickwhale_OS12 };13 7 14 8 class Clickwhale_Parser { -
clickwhale/tags/2.1.3/includes/front/tracking/Clickwhale_Visitor_Track.php
r3070750 r3083885 2 2 namespace clickwhale\includes\front\tracking; 3 3 4 use clickwhale\includes\admin\Clickwhale_Settings;5 4 use clickwhale\includes\admin\Clickwhale_WP_User; 6 use clickwhale\includes\Clickwhale;7 use clickwhale\includes\front\tracking\Clickwhale_Parser;8 5 use clickwhale\includes\helpers\Helper; 9 6 -
clickwhale/tags/2.1.3/readme.txt
r3078528 r3083885 6 6 Requires PHP: 7.4.0 7 7 Tested up to: 6.5 8 Stable tag: 2.1. 28 Stable tag: 2.1.3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 115 115 116 116 == Changelog == 117 = Version 2.1.3 (9th May 2024) = 118 * Fix: Fixed issue when long links were not stored to DB 119 * Fix: Fixed "Trying to access array offset on value of type null" PHP warning 120 * Info: WordPress v6.5.3 compatibility 121 117 122 = Version 2.1.2 (29th April 2024) = 118 123 * New: Added "Upgrade to PRO" sidebar for admin pages -
clickwhale/trunk/clickwhale.php
r3078528 r3083885 10 10 * Plugin URI: https://clickwhale.pro 11 11 * Description: Link Manager, Link Shortener and Click Tracker for Affiliate Links & Link Pages. 12 * Version: 2.1. 212 * Version: 2.1.3 13 13 * Requires at least: 5.0 14 14 * Requires PHP: 7.4 … … 31 31 * Current plugin version. 32 32 */ 33 define( 'CLICKWHALE_VERSION', '2.1. 2' );33 define( 'CLICKWHALE_VERSION', '2.1.3' ); 34 34 define( 'CLICKWHALE_NAME', 'clickwhale' ); 35 35 /** … … 65 65 'public_key' => 'pk_07a5633bd94c00467e7e58c200504', 66 66 'is_premium' => false, 67 'premium_suffix' => ' Pro',67 'premium_suffix' => '(Pro)', 68 68 'has_addons' => false, 69 69 'has_paid_plans' => true, -
clickwhale/trunk/includes/Clickwhale_Activator.php
r3040533 r3083885 212 212 ); 213 213 } 214 215 /* @since 2.1.3 */ 216 if ( version_compare( CLICKWHALE_VERSION, '2.1.3', '>=' ) && 217 ! get_option( 'clickwhale_updated_links_table_url_column' ) 218 ){ 219 $query = $wpdb->query( "ALTER TABLE {$wpdb->prefix}clickwhale_links MODIFY COLUMN url varchar(1000) DEFAULT '' NOT NULL" ); 220 221 if ( $query ) { 222 add_option( 'clickwhale_updated_links_table_url_column', CLICKWHALE_VERSION ); 223 } 224 } 214 225 } 215 226 -
clickwhale/trunk/includes/admin/links/Clickwhale_Link_Edit.php
r3070750 r3083885 11 11 class Clickwhale_Link_Edit extends Clickwhale_Instance_Edit { 12 12 13 public function __construct() { 13 /** 14 * @var string 15 */ 16 private $links_table; 17 18 public function __construct() { 14 19 parent::__construct( 'links', 'link' ); 20 21 $this->links_table = Helper::get_db_table_name( $this->instance_plural ); 15 22 } 16 23 … … 53 60 global $wpdb; 54 61 55 $links_table = Helper::get_db_table_name( $this->instance_plural ); 56 $item = array_intersect_key( $_POST, $this->get_defaults() ); 57 62 /* @since 2.1.3 */ 63 if ( version_compare( CLICKWHALE_VERSION, '2.1.3', '>=' ) && 64 ! get_option( 'clickwhale_updated_links_table_url_column' ) 65 ){ 66 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 67 $query = $wpdb->query( "ALTER TABLE $this->links_table MODIFY COLUMN url varchar(1000) DEFAULT '' NOT NULL" ); 68 69 if ( $query ) { 70 add_option( 'clickwhale_updated_links_table_url_column', CLICKWHALE_VERSION ); 71 } 72 } 73 74 $item = array_intersect_key( $_POST, $this->get_defaults() ); 58 75 $item['categories'] = isset( $item['categories'] ) ? implode( ',', $item['categories'] ) : ''; 59 76 $item['nofollow'] = isset( $item['nofollow'] ); … … 66 83 if ( Links_Helper::get_by_id( intval( $item['id'] ) ) ) { 67 84 $wpdb->update( 68 $links_table,85 $this->links_table, 69 86 $item, 70 87 array( 'id' => $item['id'] ) … … 74 91 } else { 75 92 $wpdb->insert( 76 $links_table,93 $this->links_table, 77 94 $item 78 95 ); -
clickwhale/trunk/includes/front/tracking/Clickwhale_Click_Track.php
r3040533 r3083885 2 2 namespace clickwhale\includes\front\tracking; 3 3 4 use clickwhale\includes\front\tracking\Clickwhale_Visitor_Track;5 4 use clickwhale\includes\helpers\Linkpages_Helper; 6 5 … … 17 16 */ 18 17 protected $link_id; 19 protected $linkage_id;20 18 protected $user; 21 19 protected $visitor; … … 43 41 } 44 42 45 private function get_linkpage_id() {43 private function get_linkpage_id(): int { 46 44 $url = strtolower( $this->get_link_referer() ); 47 45 … … 54 52 $result = Linkpages_Helper::get_by_slug( $url ); 55 53 56 return $result['id'] ;54 return $result['id'] ?? 0; 57 55 } 58 56 … … 65 63 $item['link_id'] = ! $this->is_custom ? $this->link_id : 0; 66 64 $item['custom_link_id'] = $this->is_custom ? $this->link_id : ''; 67 $item['linkpage_id'] = $this->get_linkpage_id() ? $this->get_linkpage_id() : 0;65 $item['linkpage_id'] = $this->get_linkpage_id(); 68 66 $item['visitor_id'] = $visitor_id; 69 67 $item['referer'] = $this->get_link_referer(); -
clickwhale/trunk/includes/front/tracking/Clickwhale_Parser.php
r3040533 r3083885 5 5 exit; 6 6 } 7 8 use clickwhale\includes\front\tracking\{9 Clickwhale_Bot,10 Clickwhale_Device,11 Clickwhale_OS12 };13 7 14 8 class Clickwhale_Parser { -
clickwhale/trunk/includes/front/tracking/Clickwhale_Visitor_Track.php
r3070750 r3083885 2 2 namespace clickwhale\includes\front\tracking; 3 3 4 use clickwhale\includes\admin\Clickwhale_Settings;5 4 use clickwhale\includes\admin\Clickwhale_WP_User; 6 use clickwhale\includes\Clickwhale;7 use clickwhale\includes\front\tracking\Clickwhale_Parser;8 5 use clickwhale\includes\helpers\Helper; 9 6 -
clickwhale/trunk/readme.txt
r3078528 r3083885 6 6 Requires PHP: 7.4.0 7 7 Tested up to: 6.5 8 Stable tag: 2.1. 28 Stable tag: 2.1.3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 115 115 116 116 == Changelog == 117 = Version 2.1.3 (9th May 2024) = 118 * Fix: Fixed issue when long links were not stored to DB 119 * Fix: Fixed "Trying to access array offset on value of type null" PHP warning 120 * Info: WordPress v6.5.3 compatibility 121 117 122 = Version 2.1.2 (29th April 2024) = 118 123 * New: Added "Upgrade to PRO" sidebar for admin pages
Note: See TracChangeset
for help on using the changeset viewer.