Changeset 3483392
- Timestamp:
- 03/16/2026 04:32:49 AM (2 weeks ago)
- Location:
- wishsuite
- Files:
-
- 12 edited
- 1 copied
-
tags/1.5.3 (copied) (copied from wishsuite/trunk)
-
tags/1.5.3/includes/classes/Admin/Wishlist_Table_List.php (modified) (3 diffs)
-
tags/1.5.3/includes/classes/Frontend/Manage_Wishlist.php (modified) (8 diffs)
-
tags/1.5.3/includes/classes/Installer.php (modified) (3 diffs)
-
tags/1.5.3/includes/classes/Manage_Data.php (modified) (5 diffs)
-
tags/1.5.3/readme.txt (modified) (2 diffs)
-
tags/1.5.3/wishsuite.php (modified) (4 diffs)
-
trunk/includes/classes/Admin/Wishlist_Table_List.php (modified) (3 diffs)
-
trunk/includes/classes/Frontend/Manage_Wishlist.php (modified) (8 diffs)
-
trunk/includes/classes/Installer.php (modified) (3 diffs)
-
trunk/includes/classes/Manage_Data.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wishsuite.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wishsuite/tags/1.5.3/includes/classes/Admin/Wishlist_Table_List.php
r3314323 r3483392 25 25 private $order_by; 26 26 private $order; 27 private $total_items = 0; 27 28 28 29 public function __construct() { … … 56 57 ]; 57 58 if($this->user_id === '') { 58 $ data = Manage_Data::instance()->getWishlist( $query_args )['items'];59 $result = Manage_Data::instance()->getWishlist( $query_args ); 59 60 } 60 61 if($this->user_id && $this->user_id !== '') { 61 62 $query_args = array_merge($query_args, ['user_id'=>$this->user_id]); 62 $data = Manage_Data::instance()->getWishlistByUserId( $query_args )['items']; 63 } 64 $this->items= $data; 63 $result = Manage_Data::instance()->getWishlistByUserId( $query_args ); 64 } 65 $this->items = $result['items'] ?? []; 66 $this->total_items = $result['total_items'] ?? 0; 65 67 } 66 68 … … 210 212 function prepare_items(){ 211 213 $this->_column_headers = array($this->get_columns(),array('id'),$this->get_sortable_columns()); 212 $total_items = 0;213 214 $query_args = [215 'limit'=>$this->limit,216 'offset'=>$this->offset,217 'orderby'=>$this->order_by,218 'order'=>$this->order219 ];220 221 if($this->user_id === '') {222 $result = Manage_Data::instance()->getWishlist( $query_args );223 $total_items = $result['total_items'];224 }225 if($this->user_id && $this->user_id !== '' ) {226 $query_args = array_merge($query_args, ['user_id'=>$this->user_id]);227 $result = Manage_Data::instance()->getWishlistByUserId( $query_args );228 $total_items = $result['total_items'];229 }230 214 231 215 $this->set_pagination_args( [ 232 'total_items' => $t otal_items,216 'total_items' => $this->total_items, 233 217 'per_page' => $this->limit 234 218 ] ); -
wishsuite/tags/1.5.3/includes/classes/Frontend/Manage_Wishlist.php
r3385740 r3483392 31 31 32 32 /** 33 * Request-level cache for wishlist product IDs 34 * @var array|null 35 */ 36 private static $cached_wishlist = null; 37 38 /** 33 39 * [instance] Initializes a singleton instance 34 40 * @return [Manage_Wishlist] … … 60 66 */ 61 67 public function add_product( $id ){ 68 self::$cached_wishlist = null; 62 69 63 70 $user_id = get_current_user_id(); … … 104 111 } 105 112 113 self::$cached_wishlist = null; 106 114 return $add_status; 107 115 … … 114 122 */ 115 123 public function remove_product( $id ){ 124 self::$cached_wishlist = null; 125 116 126 $user_id = get_current_user_id(); 117 127 $delete_status = false; … … 155 165 } 156 166 167 self::$cached_wishlist = null; 157 168 return $delete_status; 158 169 } … … 479 490 public function get_wishlist_products(){ 480 491 492 if ( self::$cached_wishlist !== null ) { 493 return self::$cached_wishlist; 494 } 495 481 496 if( is_user_logged_in() ){ 482 497 $items = \WishSuite\Manage_Data::instance()->read(); … … 485 500 $ids[] = $item['product_id']; 486 501 } 502 self::$cached_wishlist = $ids; 487 503 return $ids; 488 504 }else{ 489 505 $cookie_name = $this->get_cookie_name(); 490 // return isset( $_COOKIE[ $cookie_name ] ) ? array_map( 'sanitize_text_field', json_decode( wp_unslash( $_COOKIE[ $cookie_name ] ), true ) ) : array();491 506 if( isset( $_COOKIE[ $cookie_name ] ) && is_array( json_decode( wp_unslash( $_COOKIE[ $cookie_name ] ), true ) ) ){ 492 returnarray_map( 'sanitize_text_field', json_decode( wp_unslash( $_COOKIE[ $cookie_name ] ), true ) );507 $result = array_map( 'sanitize_text_field', json_decode( wp_unslash( $_COOKIE[ $cookie_name ] ), true ) ); 493 508 }else{ 494 return array(); 495 } 509 $result = array(); 510 } 511 self::$cached_wishlist = $result; 512 return $result; 496 513 } 497 514 … … 504 521 */ 505 522 public function is_product_in_wishlist( $id ) { 523 if ( is_user_logged_in() ) { 524 $item = \WishSuite\Manage_Data::instance()->read_single_item( get_current_user_id(), (int) $id ); 525 return ! empty( $item ); 526 } 527 506 528 $id = (string) $id; 507 529 $list = $this->get_wishlist_products(); 508 if ( is_array( $list ) ) { 509 return in_array( $id, $list, true ); 510 }else{ 511 return false; 512 } 530 return is_array( $list ) && in_array( $id, $list, true ); 513 531 } 514 532 -
wishsuite/tags/1.5.3/includes/classes/Installer.php
r3041632 r3483392 50 50 } 51 51 52 $schema = "CREATE TABLE IF NOT EXISTS`{$wpdb->prefix}wishsuite_list` (52 $schema = "CREATE TABLE `{$wpdb->prefix}wishsuite_list` ( 53 53 `id` bigint( 20 ) unsigned NOT NULL AUTO_INCREMENT, 54 54 `user_id` bigint( 20 ) NULL DEFAULT NULL, … … 56 56 `quantity` int(11) NULL DEFAULT NULL, 57 57 `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 58 PRIMARY KEY (`id`) 58 PRIMARY KEY (`id`), 59 KEY `idx_user_id` (`user_id`), 60 KEY `idx_product_id` (`product_id`), 61 KEY `idx_user_product` (`user_id`, `product_id`) 59 62 ) $charset_collate"; 60 63 … … 64 67 65 68 dbDelta( $schema ); 69 70 $this->maybe_add_indexes(); 71 } 72 73 /** 74 * Add missing indexes to the wishlist table via direct SQL. 75 * Handles existing installs where dbDelta may not have created indexes. 76 * 77 * @return void 78 */ 79 public function maybe_add_indexes() { 80 global $wpdb; 81 $table = $wpdb->prefix . 'wishsuite_list'; 82 83 if ( $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE %s", $table ) ) !== $table ) { 84 return; 85 } 86 87 $existing = $wpdb->get_results( "SHOW INDEX FROM `{$table}`", ARRAY_A ); 88 $existing_names = array_column( $existing, 'Key_name' ); 89 90 $indexes = [ 91 'idx_user_id' => '(`user_id`)', 92 'idx_product_id' => '(`product_id`)', 93 'idx_user_product' => '(`user_id`, `product_id`)', 94 ]; 95 96 foreach ( $indexes as $name => $columns ) { 97 if ( ! in_array( $name, $existing_names, true ) ) { 98 $wpdb->query( "ALTER TABLE `{$table}` ADD INDEX `{$name}` {$columns}" ); 99 } 100 } 66 101 } 67 102 -
wishsuite/tags/1.5.3/includes/classes/Manage_Data.php
r3083732 r3483392 21 21 } 22 22 return self::$_instance; 23 } 24 25 /** 26 * Sanitize orderby column against a whitelist. 27 * 28 * @param string $orderby 29 * @return string 30 */ 31 private function sanitize_orderby( $orderby ) { 32 $allowed = [ 'id', 'product_id', 'user_id', 'quantity', 'date_added' ]; 33 return in_array( $orderby, $allowed, true ) ? $orderby : 'id'; 34 } 35 36 /** 37 * Sanitize order direction. 38 * 39 * @param string $order 40 * @return string 41 */ 42 private function sanitize_order( $order ) { 43 $order = strtoupper( $order ); 44 return in_array( $order, [ 'ASC', 'DESC' ], true ) ? $order : 'ASC'; 23 45 } 24 46 … … 93 115 $cache_key = "all:$key:$last_changed"; 94 116 117 $orderby = $this->sanitize_orderby( $args['orderby'] ); 118 $order = $this->sanitize_order( $args['order'] ); 119 95 120 $sql = $wpdb->prepare( 96 121 "SELECT * FROM {$wpdb->prefix}wishsuite_list 97 122 WHERE user_id = %d 98 ORDER BY %s %s",99 $args['user_id'] , $args['orderby'], $args['order']123 ORDER BY {$orderby} {$order}", 124 $args['user_id'] 100 125 ); 101 126 … … 136 161 $total_items = (int) $wpdb->get_var($total_items_sql); 137 162 163 $orderby = $this->sanitize_orderby( $args['orderby'] ); 164 $order = $this->sanitize_order( $args['order'] ); 165 138 166 $sql = $wpdb->prepare( 139 167 "SELECT *, COUNT(*) AS product_count 140 168 FROM {$wpdb->prefix}wishsuite_list AS wishlists 141 169 GROUP BY wishlists.product_id 142 ORDER BY %s %s170 ORDER BY {$orderby} {$order} 143 171 LIMIT %d OFFSET %d", 144 $args[' orderby'], $args['order'], $args['limit'], $args['offset']172 $args['limit'], $args['offset'] 145 173 ); 146 174 $items = wp_cache_get( $cache_key, 'wishsuite' ); … … 181 209 $total_items = (int) $wpdb->get_var($total_items_sql); 182 210 211 $orderby = $this->sanitize_orderby( $args['orderby'] ); 212 $order = $this->sanitize_order( $args['order'] ); 213 183 214 $sql = $wpdb->prepare( 184 215 "SELECT *, COUNT(*) AS product_count 185 216 FROM {$wpdb->prefix}wishsuite_list AS wishlists 186 217 GROUP BY wishlists.user_id 187 ORDER BY %s %s218 ORDER BY {$orderby} {$order} 188 219 LIMIT %d OFFSET %d", 189 $args[' orderby'], $args['order'], $args['limit'], $args['offset']220 $args['limit'], $args['offset'] 190 221 ); 191 222 $items = wp_cache_get( $cache_key, 'wishsuite' ); … … 227 258 $total_items = $wpdb->get_var($total_items_sql); 228 259 260 $orderby = $this->sanitize_orderby( $args['orderby'] ); 261 $order = $this->sanitize_order( $args['order'] ); 262 229 263 $sql = $wpdb->prepare( 230 264 "SELECT * 231 265 FROM {$wpdb->prefix}wishsuite_list AS wishlists 232 266 WHERE wishlists.user_id = %d 233 ORDER BY %s %s267 ORDER BY {$orderby} {$order} 234 268 LIMIT %d OFFSET %d", 235 $args['user_id'], $args[' orderby'], $args['order'], $args['limit'], $args['offset']269 $args['user_id'], $args['limit'], $args['offset'] 236 270 ); 237 271 $items = wp_cache_get( $cache_key, 'wishsuite' ); -
wishsuite/tags/1.5.3/readme.txt
r3419202 r3483392 4 4 Requires at least: 5.0 5 5 Tested up to: 6.9 6 Stable tag: 1.5. 26 Stable tag: 1.5.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 106 106 107 107 == Changelog == 108 109 = Version: 1.5.3 - Date: 2026-03-16 = 110 * Improved: Request-level caching for wishlist queries. 111 * Improved: Optimized wishlist lookup for logged-in users. 112 * Fixed: SQL injection risk in ORDER BY clauses. 108 113 109 114 = Version: 1.5.2 - Date: 2025-12-14 = -
wishsuite/tags/1.5.3/wishsuite.php
r3419202 r3483392 6 6 * Author: HasThemes 7 7 * Author URI: https://hasthemes.com/ 8 * Version: 1.5. 28 * Version: 1.5.3 9 9 * License: GPL2 or later 10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 26 26 * @var string 27 27 */ 28 const version = '1.5. 2';28 const version = '1.5.3'; 29 29 30 30 /** … … 52 52 $this->includes(); 53 53 register_activation_hook( WISHSUITE_FILE, [ $this, 'activate' ] ); 54 if ( empty( get_option('wishsuite_version', '') ) ){55 $this-> activate();54 if ( version_compare( get_option( 'wishsuite_version', '' ), WISHSUITE_VERSION, '<' ) ) { 55 $this->maybe_upgrade(); 56 56 } 57 57 add_action( 'init', [ $this, 'i18n' ] ); … … 143 143 144 144 /** 145 * Run upgrade routines when the plugin version changes. 146 * Only updates the DB schema and version — no page creation or redirects. 147 * 148 * @return void 149 */ 150 public function maybe_upgrade() { 151 $installer = new WishSuite\Installer(); 152 $installer->create_tables(); 153 $installer->add_version(); 154 } 155 156 /** 145 157 * Do stuff upon plugin activation 146 158 * -
wishsuite/trunk/includes/classes/Admin/Wishlist_Table_List.php
r3314323 r3483392 25 25 private $order_by; 26 26 private $order; 27 private $total_items = 0; 27 28 28 29 public function __construct() { … … 56 57 ]; 57 58 if($this->user_id === '') { 58 $ data = Manage_Data::instance()->getWishlist( $query_args )['items'];59 $result = Manage_Data::instance()->getWishlist( $query_args ); 59 60 } 60 61 if($this->user_id && $this->user_id !== '') { 61 62 $query_args = array_merge($query_args, ['user_id'=>$this->user_id]); 62 $data = Manage_Data::instance()->getWishlistByUserId( $query_args )['items']; 63 } 64 $this->items= $data; 63 $result = Manage_Data::instance()->getWishlistByUserId( $query_args ); 64 } 65 $this->items = $result['items'] ?? []; 66 $this->total_items = $result['total_items'] ?? 0; 65 67 } 66 68 … … 210 212 function prepare_items(){ 211 213 $this->_column_headers = array($this->get_columns(),array('id'),$this->get_sortable_columns()); 212 $total_items = 0;213 214 $query_args = [215 'limit'=>$this->limit,216 'offset'=>$this->offset,217 'orderby'=>$this->order_by,218 'order'=>$this->order219 ];220 221 if($this->user_id === '') {222 $result = Manage_Data::instance()->getWishlist( $query_args );223 $total_items = $result['total_items'];224 }225 if($this->user_id && $this->user_id !== '' ) {226 $query_args = array_merge($query_args, ['user_id'=>$this->user_id]);227 $result = Manage_Data::instance()->getWishlistByUserId( $query_args );228 $total_items = $result['total_items'];229 }230 214 231 215 $this->set_pagination_args( [ 232 'total_items' => $t otal_items,216 'total_items' => $this->total_items, 233 217 'per_page' => $this->limit 234 218 ] ); -
wishsuite/trunk/includes/classes/Frontend/Manage_Wishlist.php
r3385740 r3483392 31 31 32 32 /** 33 * Request-level cache for wishlist product IDs 34 * @var array|null 35 */ 36 private static $cached_wishlist = null; 37 38 /** 33 39 * [instance] Initializes a singleton instance 34 40 * @return [Manage_Wishlist] … … 60 66 */ 61 67 public function add_product( $id ){ 68 self::$cached_wishlist = null; 62 69 63 70 $user_id = get_current_user_id(); … … 104 111 } 105 112 113 self::$cached_wishlist = null; 106 114 return $add_status; 107 115 … … 114 122 */ 115 123 public function remove_product( $id ){ 124 self::$cached_wishlist = null; 125 116 126 $user_id = get_current_user_id(); 117 127 $delete_status = false; … … 155 165 } 156 166 167 self::$cached_wishlist = null; 157 168 return $delete_status; 158 169 } … … 479 490 public function get_wishlist_products(){ 480 491 492 if ( self::$cached_wishlist !== null ) { 493 return self::$cached_wishlist; 494 } 495 481 496 if( is_user_logged_in() ){ 482 497 $items = \WishSuite\Manage_Data::instance()->read(); … … 485 500 $ids[] = $item['product_id']; 486 501 } 502 self::$cached_wishlist = $ids; 487 503 return $ids; 488 504 }else{ 489 505 $cookie_name = $this->get_cookie_name(); 490 // return isset( $_COOKIE[ $cookie_name ] ) ? array_map( 'sanitize_text_field', json_decode( wp_unslash( $_COOKIE[ $cookie_name ] ), true ) ) : array();491 506 if( isset( $_COOKIE[ $cookie_name ] ) && is_array( json_decode( wp_unslash( $_COOKIE[ $cookie_name ] ), true ) ) ){ 492 returnarray_map( 'sanitize_text_field', json_decode( wp_unslash( $_COOKIE[ $cookie_name ] ), true ) );507 $result = array_map( 'sanitize_text_field', json_decode( wp_unslash( $_COOKIE[ $cookie_name ] ), true ) ); 493 508 }else{ 494 return array(); 495 } 509 $result = array(); 510 } 511 self::$cached_wishlist = $result; 512 return $result; 496 513 } 497 514 … … 504 521 */ 505 522 public function is_product_in_wishlist( $id ) { 523 if ( is_user_logged_in() ) { 524 $item = \WishSuite\Manage_Data::instance()->read_single_item( get_current_user_id(), (int) $id ); 525 return ! empty( $item ); 526 } 527 506 528 $id = (string) $id; 507 529 $list = $this->get_wishlist_products(); 508 if ( is_array( $list ) ) { 509 return in_array( $id, $list, true ); 510 }else{ 511 return false; 512 } 530 return is_array( $list ) && in_array( $id, $list, true ); 513 531 } 514 532 -
wishsuite/trunk/includes/classes/Installer.php
r3041632 r3483392 50 50 } 51 51 52 $schema = "CREATE TABLE IF NOT EXISTS`{$wpdb->prefix}wishsuite_list` (52 $schema = "CREATE TABLE `{$wpdb->prefix}wishsuite_list` ( 53 53 `id` bigint( 20 ) unsigned NOT NULL AUTO_INCREMENT, 54 54 `user_id` bigint( 20 ) NULL DEFAULT NULL, … … 56 56 `quantity` int(11) NULL DEFAULT NULL, 57 57 `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 58 PRIMARY KEY (`id`) 58 PRIMARY KEY (`id`), 59 KEY `idx_user_id` (`user_id`), 60 KEY `idx_product_id` (`product_id`), 61 KEY `idx_user_product` (`user_id`, `product_id`) 59 62 ) $charset_collate"; 60 63 … … 64 67 65 68 dbDelta( $schema ); 69 70 $this->maybe_add_indexes(); 71 } 72 73 /** 74 * Add missing indexes to the wishlist table via direct SQL. 75 * Handles existing installs where dbDelta may not have created indexes. 76 * 77 * @return void 78 */ 79 public function maybe_add_indexes() { 80 global $wpdb; 81 $table = $wpdb->prefix . 'wishsuite_list'; 82 83 if ( $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE %s", $table ) ) !== $table ) { 84 return; 85 } 86 87 $existing = $wpdb->get_results( "SHOW INDEX FROM `{$table}`", ARRAY_A ); 88 $existing_names = array_column( $existing, 'Key_name' ); 89 90 $indexes = [ 91 'idx_user_id' => '(`user_id`)', 92 'idx_product_id' => '(`product_id`)', 93 'idx_user_product' => '(`user_id`, `product_id`)', 94 ]; 95 96 foreach ( $indexes as $name => $columns ) { 97 if ( ! in_array( $name, $existing_names, true ) ) { 98 $wpdb->query( "ALTER TABLE `{$table}` ADD INDEX `{$name}` {$columns}" ); 99 } 100 } 66 101 } 67 102 -
wishsuite/trunk/includes/classes/Manage_Data.php
r3083732 r3483392 21 21 } 22 22 return self::$_instance; 23 } 24 25 /** 26 * Sanitize orderby column against a whitelist. 27 * 28 * @param string $orderby 29 * @return string 30 */ 31 private function sanitize_orderby( $orderby ) { 32 $allowed = [ 'id', 'product_id', 'user_id', 'quantity', 'date_added' ]; 33 return in_array( $orderby, $allowed, true ) ? $orderby : 'id'; 34 } 35 36 /** 37 * Sanitize order direction. 38 * 39 * @param string $order 40 * @return string 41 */ 42 private function sanitize_order( $order ) { 43 $order = strtoupper( $order ); 44 return in_array( $order, [ 'ASC', 'DESC' ], true ) ? $order : 'ASC'; 23 45 } 24 46 … … 93 115 $cache_key = "all:$key:$last_changed"; 94 116 117 $orderby = $this->sanitize_orderby( $args['orderby'] ); 118 $order = $this->sanitize_order( $args['order'] ); 119 95 120 $sql = $wpdb->prepare( 96 121 "SELECT * FROM {$wpdb->prefix}wishsuite_list 97 122 WHERE user_id = %d 98 ORDER BY %s %s",99 $args['user_id'] , $args['orderby'], $args['order']123 ORDER BY {$orderby} {$order}", 124 $args['user_id'] 100 125 ); 101 126 … … 136 161 $total_items = (int) $wpdb->get_var($total_items_sql); 137 162 163 $orderby = $this->sanitize_orderby( $args['orderby'] ); 164 $order = $this->sanitize_order( $args['order'] ); 165 138 166 $sql = $wpdb->prepare( 139 167 "SELECT *, COUNT(*) AS product_count 140 168 FROM {$wpdb->prefix}wishsuite_list AS wishlists 141 169 GROUP BY wishlists.product_id 142 ORDER BY %s %s170 ORDER BY {$orderby} {$order} 143 171 LIMIT %d OFFSET %d", 144 $args[' orderby'], $args['order'], $args['limit'], $args['offset']172 $args['limit'], $args['offset'] 145 173 ); 146 174 $items = wp_cache_get( $cache_key, 'wishsuite' ); … … 181 209 $total_items = (int) $wpdb->get_var($total_items_sql); 182 210 211 $orderby = $this->sanitize_orderby( $args['orderby'] ); 212 $order = $this->sanitize_order( $args['order'] ); 213 183 214 $sql = $wpdb->prepare( 184 215 "SELECT *, COUNT(*) AS product_count 185 216 FROM {$wpdb->prefix}wishsuite_list AS wishlists 186 217 GROUP BY wishlists.user_id 187 ORDER BY %s %s218 ORDER BY {$orderby} {$order} 188 219 LIMIT %d OFFSET %d", 189 $args[' orderby'], $args['order'], $args['limit'], $args['offset']220 $args['limit'], $args['offset'] 190 221 ); 191 222 $items = wp_cache_get( $cache_key, 'wishsuite' ); … … 227 258 $total_items = $wpdb->get_var($total_items_sql); 228 259 260 $orderby = $this->sanitize_orderby( $args['orderby'] ); 261 $order = $this->sanitize_order( $args['order'] ); 262 229 263 $sql = $wpdb->prepare( 230 264 "SELECT * 231 265 FROM {$wpdb->prefix}wishsuite_list AS wishlists 232 266 WHERE wishlists.user_id = %d 233 ORDER BY %s %s267 ORDER BY {$orderby} {$order} 234 268 LIMIT %d OFFSET %d", 235 $args['user_id'], $args[' orderby'], $args['order'], $args['limit'], $args['offset']269 $args['user_id'], $args['limit'], $args['offset'] 236 270 ); 237 271 $items = wp_cache_get( $cache_key, 'wishsuite' ); -
wishsuite/trunk/readme.txt
r3419202 r3483392 4 4 Requires at least: 5.0 5 5 Tested up to: 6.9 6 Stable tag: 1.5. 26 Stable tag: 1.5.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 106 106 107 107 == Changelog == 108 109 = Version: 1.5.3 - Date: 2026-03-16 = 110 * Improved: Request-level caching for wishlist queries. 111 * Improved: Optimized wishlist lookup for logged-in users. 112 * Fixed: SQL injection risk in ORDER BY clauses. 108 113 109 114 = Version: 1.5.2 - Date: 2025-12-14 = -
wishsuite/trunk/wishsuite.php
r3419202 r3483392 6 6 * Author: HasThemes 7 7 * Author URI: https://hasthemes.com/ 8 * Version: 1.5. 28 * Version: 1.5.3 9 9 * License: GPL2 or later 10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 26 26 * @var string 27 27 */ 28 const version = '1.5. 2';28 const version = '1.5.3'; 29 29 30 30 /** … … 52 52 $this->includes(); 53 53 register_activation_hook( WISHSUITE_FILE, [ $this, 'activate' ] ); 54 if ( empty( get_option('wishsuite_version', '') ) ){55 $this-> activate();54 if ( version_compare( get_option( 'wishsuite_version', '' ), WISHSUITE_VERSION, '<' ) ) { 55 $this->maybe_upgrade(); 56 56 } 57 57 add_action( 'init', [ $this, 'i18n' ] ); … … 143 143 144 144 /** 145 * Run upgrade routines when the plugin version changes. 146 * Only updates the DB schema and version — no page creation or redirects. 147 * 148 * @return void 149 */ 150 public function maybe_upgrade() { 151 $installer = new WishSuite\Installer(); 152 $installer->create_tables(); 153 $installer->add_version(); 154 } 155 156 /** 145 157 * Do stuff upon plugin activation 146 158 *
Note: See TracChangeset
for help on using the changeset viewer.