Plugin Directory

Changeset 3483392


Ignore:
Timestamp:
03/16/2026 04:32:49 AM (2 weeks ago)
Author:
htplugins
Message:

Update to version 1.5.3 from GitHub

Location:
wishsuite
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wishsuite/tags/1.5.3/includes/classes/Admin/Wishlist_Table_List.php

    r3314323 r3483392  
    2525    private $order_by;
    2626    private $order;
     27    private $total_items = 0;
    2728
    2829    public function __construct() {
     
    5657        ];
    5758        if($this->user_id === '') {
    58             $data = Manage_Data::instance()->getWishlist( $query_args )['items'];
     59            $result = Manage_Data::instance()->getWishlist( $query_args );
    5960        }
    6061        if($this->user_id && $this->user_id !== '') {
    6162            $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;
    6567    }
    6668   
     
    210212    function prepare_items(){
    211213        $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->order
    219         ];
    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         }
    230214
    231215        $this->set_pagination_args( [
    232             'total_items' => $total_items,
     216            'total_items' => $this->total_items,
    233217            'per_page'    => $this->limit
    234218        ] );
  • wishsuite/tags/1.5.3/includes/classes/Frontend/Manage_Wishlist.php

    r3385740 r3483392  
    3131
    3232    /**
     33     * Request-level cache for wishlist product IDs
     34     * @var array|null
     35     */
     36    private static $cached_wishlist = null;
     37
     38    /**
    3339     * [instance] Initializes a singleton instance
    3440     * @return [Manage_Wishlist]
     
    6066     */
    6167    public function add_product( $id ){
     68        self::$cached_wishlist = null;
    6269
    6370        $user_id = get_current_user_id();
     
    104111        }
    105112
     113        self::$cached_wishlist = null;
    106114        return $add_status;
    107115
     
    114122     */
    115123    public function remove_product( $id ){
     124        self::$cached_wishlist = null;
     125
    116126        $user_id = get_current_user_id();
    117127        $delete_status = false;
     
    155165        }
    156166
     167        self::$cached_wishlist = null;
    157168        return $delete_status;
    158169    }
     
    479490    public function get_wishlist_products(){
    480491
     492        if ( self::$cached_wishlist !== null ) {
     493            return self::$cached_wishlist;
     494        }
     495
    481496        if( is_user_logged_in() ){
    482497            $items = \WishSuite\Manage_Data::instance()->read();
     
    485500                $ids[] = $item['product_id'];
    486501            }
     502            self::$cached_wishlist = $ids;
    487503            return $ids;
    488504        }else{
    489505            $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();
    491506            if( isset( $_COOKIE[ $cookie_name ] ) && is_array( json_decode( wp_unslash( $_COOKIE[ $cookie_name ] ), true ) ) ){
    492                 return array_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 ) );
    493508            }else{
    494                 return array();
    495             }
     509                $result = array();
     510            }
     511            self::$cached_wishlist = $result;
     512            return $result;
    496513        }
    497514
     
    504521     */
    505522    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
    506528        $id = (string) $id;
    507529        $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 );
    513531    }
    514532
  • wishsuite/tags/1.5.3/includes/classes/Installer.php

    r3041632 r3483392  
    5050        }
    5151
    52         $schema = "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}wishsuite_list` (
     52        $schema = "CREATE TABLE `{$wpdb->prefix}wishsuite_list` (
    5353          `id` bigint( 20 ) unsigned NOT NULL AUTO_INCREMENT,
    5454          `user_id` bigint( 20 ) NULL DEFAULT NULL,
     
    5656          `quantity` int(11) NULL DEFAULT NULL,
    5757          `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`)
    5962        ) $charset_collate";
    6063
     
    6467
    6568        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        }
    66101    }
    67102
  • wishsuite/tags/1.5.3/includes/classes/Manage_Data.php

    r3083732 r3483392  
    2121        }
    2222        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';
    2345    }
    2446
     
    93115        $cache_key    = "all:$key:$last_changed";
    94116
     117        $orderby = $this->sanitize_orderby( $args['orderby'] );
     118        $order   = $this->sanitize_order( $args['order'] );
     119
    95120        $sql = $wpdb->prepare(
    96121            "SELECT * FROM {$wpdb->prefix}wishsuite_list
    97122            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']
    100125        );
    101126
     
    136161        $total_items = (int) $wpdb->get_var($total_items_sql);
    137162
     163        $orderby = $this->sanitize_orderby( $args['orderby'] );
     164        $order   = $this->sanitize_order( $args['order'] );
     165
    138166        $sql = $wpdb->prepare(
    139167            "SELECT *, COUNT(*) AS product_count
    140168            FROM {$wpdb->prefix}wishsuite_list AS wishlists
    141169            GROUP BY wishlists.product_id
    142             ORDER BY %s %s
     170            ORDER BY {$orderby} {$order}
    143171            LIMIT %d OFFSET %d",
    144             $args['orderby'], $args['order'], $args['limit'], $args['offset']
     172            $args['limit'], $args['offset']
    145173        );
    146174        $items = wp_cache_get( $cache_key, 'wishsuite' );
     
    181209        $total_items = (int) $wpdb->get_var($total_items_sql);
    182210
     211        $orderby = $this->sanitize_orderby( $args['orderby'] );
     212        $order   = $this->sanitize_order( $args['order'] );
     213
    183214        $sql = $wpdb->prepare(
    184215            "SELECT *, COUNT(*) AS product_count
    185216            FROM {$wpdb->prefix}wishsuite_list AS wishlists
    186217            GROUP BY wishlists.user_id
    187             ORDER BY %s %s
     218            ORDER BY {$orderby} {$order}
    188219            LIMIT %d OFFSET %d",
    189             $args['orderby'], $args['order'], $args['limit'], $args['offset']
     220            $args['limit'], $args['offset']
    190221        );
    191222        $items = wp_cache_get( $cache_key, 'wishsuite' );
     
    227258        $total_items = $wpdb->get_var($total_items_sql);
    228259
     260        $orderby = $this->sanitize_orderby( $args['orderby'] );
     261        $order   = $this->sanitize_order( $args['order'] );
     262
    229263        $sql = $wpdb->prepare(
    230264            "SELECT *
    231265            FROM {$wpdb->prefix}wishsuite_list AS wishlists
    232266            WHERE wishlists.user_id = %d
    233             ORDER BY %s %s
     267            ORDER BY {$orderby} {$order}
    234268            LIMIT %d OFFSET %d",
    235             $args['user_id'], $args['orderby'], $args['order'], $args['limit'], $args['offset']
     269            $args['user_id'], $args['limit'], $args['offset']
    236270        );
    237271        $items = wp_cache_get( $cache_key, 'wishsuite' );
  • wishsuite/tags/1.5.3/readme.txt

    r3419202 r3483392  
    44Requires at least: 5.0
    55Tested up to: 6.9
    6 Stable tag: 1.5.2
     6Stable tag: 1.5.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    106106
    107107== 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.
    108113
    109114= Version: 1.5.2 - Date: 2025-12-14 =
  • wishsuite/tags/1.5.3/wishsuite.php

    r3419202 r3483392  
    66 * Author: HasThemes
    77 * Author URI: https://hasthemes.com/
    8  * Version: 1.5.2
     8 * Version: 1.5.3
    99 * License: GPL2 or later
    1010 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2626     * @var string
    2727     */
    28     const version = '1.5.2';
     28    const version = '1.5.3';
    2929
    3030    /**
     
    5252        $this->includes();
    5353        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();
    5656        }
    5757        add_action( 'init', [ $this, 'i18n' ] );
     
    143143
    144144    /**
     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    /**
    145157     * Do stuff upon plugin activation
    146158     *
  • wishsuite/trunk/includes/classes/Admin/Wishlist_Table_List.php

    r3314323 r3483392  
    2525    private $order_by;
    2626    private $order;
     27    private $total_items = 0;
    2728
    2829    public function __construct() {
     
    5657        ];
    5758        if($this->user_id === '') {
    58             $data = Manage_Data::instance()->getWishlist( $query_args )['items'];
     59            $result = Manage_Data::instance()->getWishlist( $query_args );
    5960        }
    6061        if($this->user_id && $this->user_id !== '') {
    6162            $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;
    6567    }
    6668   
     
    210212    function prepare_items(){
    211213        $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->order
    219         ];
    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         }
    230214
    231215        $this->set_pagination_args( [
    232             'total_items' => $total_items,
     216            'total_items' => $this->total_items,
    233217            'per_page'    => $this->limit
    234218        ] );
  • wishsuite/trunk/includes/classes/Frontend/Manage_Wishlist.php

    r3385740 r3483392  
    3131
    3232    /**
     33     * Request-level cache for wishlist product IDs
     34     * @var array|null
     35     */
     36    private static $cached_wishlist = null;
     37
     38    /**
    3339     * [instance] Initializes a singleton instance
    3440     * @return [Manage_Wishlist]
     
    6066     */
    6167    public function add_product( $id ){
     68        self::$cached_wishlist = null;
    6269
    6370        $user_id = get_current_user_id();
     
    104111        }
    105112
     113        self::$cached_wishlist = null;
    106114        return $add_status;
    107115
     
    114122     */
    115123    public function remove_product( $id ){
     124        self::$cached_wishlist = null;
     125
    116126        $user_id = get_current_user_id();
    117127        $delete_status = false;
     
    155165        }
    156166
     167        self::$cached_wishlist = null;
    157168        return $delete_status;
    158169    }
     
    479490    public function get_wishlist_products(){
    480491
     492        if ( self::$cached_wishlist !== null ) {
     493            return self::$cached_wishlist;
     494        }
     495
    481496        if( is_user_logged_in() ){
    482497            $items = \WishSuite\Manage_Data::instance()->read();
     
    485500                $ids[] = $item['product_id'];
    486501            }
     502            self::$cached_wishlist = $ids;
    487503            return $ids;
    488504        }else{
    489505            $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();
    491506            if( isset( $_COOKIE[ $cookie_name ] ) && is_array( json_decode( wp_unslash( $_COOKIE[ $cookie_name ] ), true ) ) ){
    492                 return array_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 ) );
    493508            }else{
    494                 return array();
    495             }
     509                $result = array();
     510            }
     511            self::$cached_wishlist = $result;
     512            return $result;
    496513        }
    497514
     
    504521     */
    505522    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
    506528        $id = (string) $id;
    507529        $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 );
    513531    }
    514532
  • wishsuite/trunk/includes/classes/Installer.php

    r3041632 r3483392  
    5050        }
    5151
    52         $schema = "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}wishsuite_list` (
     52        $schema = "CREATE TABLE `{$wpdb->prefix}wishsuite_list` (
    5353          `id` bigint( 20 ) unsigned NOT NULL AUTO_INCREMENT,
    5454          `user_id` bigint( 20 ) NULL DEFAULT NULL,
     
    5656          `quantity` int(11) NULL DEFAULT NULL,
    5757          `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`)
    5962        ) $charset_collate";
    6063
     
    6467
    6568        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        }
    66101    }
    67102
  • wishsuite/trunk/includes/classes/Manage_Data.php

    r3083732 r3483392  
    2121        }
    2222        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';
    2345    }
    2446
     
    93115        $cache_key    = "all:$key:$last_changed";
    94116
     117        $orderby = $this->sanitize_orderby( $args['orderby'] );
     118        $order   = $this->sanitize_order( $args['order'] );
     119
    95120        $sql = $wpdb->prepare(
    96121            "SELECT * FROM {$wpdb->prefix}wishsuite_list
    97122            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']
    100125        );
    101126
     
    136161        $total_items = (int) $wpdb->get_var($total_items_sql);
    137162
     163        $orderby = $this->sanitize_orderby( $args['orderby'] );
     164        $order   = $this->sanitize_order( $args['order'] );
     165
    138166        $sql = $wpdb->prepare(
    139167            "SELECT *, COUNT(*) AS product_count
    140168            FROM {$wpdb->prefix}wishsuite_list AS wishlists
    141169            GROUP BY wishlists.product_id
    142             ORDER BY %s %s
     170            ORDER BY {$orderby} {$order}
    143171            LIMIT %d OFFSET %d",
    144             $args['orderby'], $args['order'], $args['limit'], $args['offset']
     172            $args['limit'], $args['offset']
    145173        );
    146174        $items = wp_cache_get( $cache_key, 'wishsuite' );
     
    181209        $total_items = (int) $wpdb->get_var($total_items_sql);
    182210
     211        $orderby = $this->sanitize_orderby( $args['orderby'] );
     212        $order   = $this->sanitize_order( $args['order'] );
     213
    183214        $sql = $wpdb->prepare(
    184215            "SELECT *, COUNT(*) AS product_count
    185216            FROM {$wpdb->prefix}wishsuite_list AS wishlists
    186217            GROUP BY wishlists.user_id
    187             ORDER BY %s %s
     218            ORDER BY {$orderby} {$order}
    188219            LIMIT %d OFFSET %d",
    189             $args['orderby'], $args['order'], $args['limit'], $args['offset']
     220            $args['limit'], $args['offset']
    190221        );
    191222        $items = wp_cache_get( $cache_key, 'wishsuite' );
     
    227258        $total_items = $wpdb->get_var($total_items_sql);
    228259
     260        $orderby = $this->sanitize_orderby( $args['orderby'] );
     261        $order   = $this->sanitize_order( $args['order'] );
     262
    229263        $sql = $wpdb->prepare(
    230264            "SELECT *
    231265            FROM {$wpdb->prefix}wishsuite_list AS wishlists
    232266            WHERE wishlists.user_id = %d
    233             ORDER BY %s %s
     267            ORDER BY {$orderby} {$order}
    234268            LIMIT %d OFFSET %d",
    235             $args['user_id'], $args['orderby'], $args['order'], $args['limit'], $args['offset']
     269            $args['user_id'], $args['limit'], $args['offset']
    236270        );
    237271        $items = wp_cache_get( $cache_key, 'wishsuite' );
  • wishsuite/trunk/readme.txt

    r3419202 r3483392  
    44Requires at least: 5.0
    55Tested up to: 6.9
    6 Stable tag: 1.5.2
     6Stable tag: 1.5.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    106106
    107107== 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.
    108113
    109114= Version: 1.5.2 - Date: 2025-12-14 =
  • wishsuite/trunk/wishsuite.php

    r3419202 r3483392  
    66 * Author: HasThemes
    77 * Author URI: https://hasthemes.com/
    8  * Version: 1.5.2
     8 * Version: 1.5.3
    99 * License: GPL2 or later
    1010 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2626     * @var string
    2727     */
    28     const version = '1.5.2';
     28    const version = '1.5.3';
    2929
    3030    /**
     
    5252        $this->includes();
    5353        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();
    5656        }
    5757        add_action( 'init', [ $this, 'i18n' ] );
     
    143143
    144144    /**
     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    /**
    145157     * Do stuff upon plugin activation
    146158     *
Note: See TracChangeset for help on using the changeset viewer.