Plugin Directory

Changeset 3111209


Ignore:
Timestamp:
07/02/2024 01:31:21 PM (21 months ago)
Author:
EmranAhmed
Message:

Update to 2.1.1

Location:
woo-variation-swatches
Files:
62 added
11 edited

Legend:

Unmodified
Added
Removed
  • woo-variation-swatches/trunk/README.txt

    r3098501 r3111209  
    66Tested up to: 6.5
    77WC requires at least: 7.5
    8 WC tested up to: 8.9
    9 Stable tag: 2.1.0
     8WC tested up to: 9.0
     9Stable tag: 2.1.1
    1010License: GPLv3 or later
    1111License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    615615== Changelog ==
    616616
     617= 2.1.1 - 02-07-2024 =
     618
     619* Fixed: Attribute meta save issue.
     620* Update: WooCommerce 9.0+ Compatibility.
     621
    617622= 2.1.0 - 06-06-2024 =
    618623
  • woo-variation-swatches/trunk/assets/css/admin.css

    r3098501 r3111209  
    33 *
    44 * Author: Emran Ahmed ( emran.bd.08@gmail.com )
    5  * Date: 6/6/2024, 4:31:57 PM
     5 * Date: 7/2/2024, 7:27:48 PM
    66 * Released under the GPLv3 license.
    77 */
  • woo-variation-swatches/trunk/assets/css/frontend.css

    r3098501 r3111209  
    33 *
    44 * Author: Emran Ahmed ( emran.bd.08@gmail.com )
    5  * Date: 6/6/2024, 4:31:57 PM
     5 * Date: 7/2/2024, 7:27:48 PM
    66 * Released under the GPLv3 license.
    77 */
  • woo-variation-swatches/trunk/assets/js/admin.js

    r3098501 r3111209  
    33 *
    44 * Author: Emran Ahmed ( emran.bd.08@gmail.com )
    5  * Date: 6/6/2024, 4:31:57 PM
     5 * Date: 7/2/2024, 7:27:48 PM
    66 * Released under the GPLv3 license.
    77 */
  • woo-variation-swatches/trunk/assets/js/frontend.js

    r3098501 r3111209  
    33 *
    44 * Author: Emran Ahmed ( emran.bd.08@gmail.com )
    5  * Date: 6/6/2024, 4:31:57 PM
     5 * Date: 7/2/2024, 7:27:48 PM
    66 * Released under the GPLv3 license.
    77 */
  • woo-variation-swatches/trunk/assets/js/wp-color-picker-alpha.js

    r3098501 r3111209  
    33 *
    44 * Author: Emran Ahmed ( emran.bd.08@gmail.com )
    5  * Date: 6/6/2024, 4:31:57 PM
     5 * Date: 7/2/2024, 7:27:48 PM
    66 * Released under the GPLv3 license.
    77 */
  • woo-variation-swatches/trunk/changelog.txt

    r3098501 r3111209  
    11*** Variation Swatches for WooCommerce ***
     2
     32024-07-02 - version 2.1.1
     4
     5* Fixed - Attribute meta save issue.
     6* Added - WooCommerce 9.0+ Compatibility.
    27
    382024-06-06 - version 2.1.0
  • woo-variation-swatches/trunk/includes/class-woo-variation-swatches-term-meta.php

    r3098501 r3111209  
    1818            // add_action( 'create_term', array( $this, 'create_term' ), 5, 3 );
    1919
    20             add_action( 'delete_term', array( $this, 'delete_term' ), 5, 4 );
     20            add_action( 'delete_term', array( $this, 'delete_term' ), 5, 3 );
    2121
    2222            // Add form
     
    212212        }
    213213
    214         public function delete_term( $term_id, $tt_id, $taxonomy, $deleted_term ) {
     214        public function delete_term( $term_id, $tt_id, $taxonomy ) {
    215215            global $wpdb;
    216216
     
    229229        public function save( $term_id, $tt_id = '', $taxonomy = '' ) {
    230230            if ( $taxonomy === $this->taxonomy ) {
     231
     232                if ( !isset( $_POST['woo_variation_swatches_term_meta_nonce'] ) ) {
     233                    return;
     234                }
    231235
    232236                check_admin_referer('woo_variation_swatches_term_meta', 'woo_variation_swatches_term_meta_nonce');
  • woo-variation-swatches/trunk/includes/getwooplugins/class-getwooplugins-admin-menus.php

    r3098501 r3111209  
    136136         */
    137137        public function admin_menu() {
    138             global $menu;
    139138
    140139            $pages = $this->get_settings_pages();
     
    142141            if ( empty( $pages ) ) {
    143142                return;
    144             }
    145 
    146             if ( current_user_can( 'edit_theme_options' ) ) {
    147                 $menu[ '45.4' ] = array( // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
    148                     '',
    149                     'read',
    150                     'separator-getwooplugins',
    151                     '',
    152                     'wp-menu-separator getwooplugins'
    153                 );
    154143            }
    155144
     
    179168         */
    180169        public function settings_menu() {
    181 
    182             global $submenu, $menu;
    183170
    184171            $settings_page = add_submenu_page( 'getwooplugins', esc_html__( 'GetWooPlugins Settings', 'woo-variation-swatches' ), esc_html__( 'Home', 'woo-variation-swatches' ), 'manage_options', 'getwooplugins-settings', array(
  • woo-variation-swatches/trunk/languages/woo-variation-swatches.pot

    r3098501 r3111209  
    88"Content-Transfer-Encoding: 8bit\n"
    99"Language-Team: Emran Ahmed <emran.bd.08@gmail.com>\n"
    10 "POT-Creation-Date: 2024-06-06 10:31+0000\n"
     10"POT-Creation-Date: 2024-07-02 13:27+0000\n"
    1111"X-Poedit-Basepath: ..\n"
    1212"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
     
    727727msgstr ""
    728728
    729 #: ../includes/class-woo-variation-swatches-term-meta.php:401
     729#: ../includes/class-woo-variation-swatches-term-meta.php:405
    730730msgid "Upload / Add image"
    731731msgstr ""
    732732
    733 #: ../includes/class-woo-variation-swatches-term-meta.php:407
     733#: ../includes/class-woo-variation-swatches-term-meta.php:411
    734734msgid "Remove image"
    735735msgstr ""
     
    937937msgstr ""
    938938
    939 #: ../includes/getwooplugins/class-getwooplugins-admin-menus.php:156, ../includes/getwooplugins/class-getwooplugins-admin-menus.php:184
     939#: ../includes/getwooplugins/class-getwooplugins-admin-menus.php:145, ../includes/getwooplugins/class-getwooplugins-admin-menus.php:171
    940940msgid "GetWooPlugins Settings"
    941941msgstr ""
    942942
    943 #: ../includes/getwooplugins/class-getwooplugins-admin-menus.php:156
     943#: ../includes/getwooplugins/class-getwooplugins-admin-menus.php:145
    944944msgid "GetWooPlugins"
    945945msgstr ""
    946946
    947 #: ../includes/getwooplugins/class-getwooplugins-admin-menus.php:184
     947#: ../includes/getwooplugins/class-getwooplugins-admin-menus.php:171
    948948msgid "Home"
    949949msgstr ""
     
    997997msgstr ""
    998998
    999 #: ../woo-variation-swatches.php:60
     999#: ../woo-variation-swatches.php:65
    10001000msgid "<strong>Variation Swatches for WooCommerce</strong> is an add-on of "
    10011001msgstr ""
    10021002
    1003 #: ../woo-variation-swatches.php:62
     1003#: ../woo-variation-swatches.php:67
    10041004msgid "WooCommerce"
    10051005msgstr ""
    10061006
    10071007#. translators: %s: Pro Plugin Version
    1008 #: ../woo-variation-swatches.php:128
     1008#: ../woo-variation-swatches.php:140
    10091009msgid "You are running older version of \"Variation Swatches for WooCommerce - Pro\". Please upgrade to %s or upper and continue."
    10101010msgstr ""
     1011
     1012#. translators: %s: Pro Plugin Version
     1013#: ../woo-variation-swatches.php:158
     1014msgid "You are running older version of \"Variation Swatches for WooCommerce - Pro\". Please upgrade to %s or upper."
     1015msgstr ""
  • woo-variation-swatches/trunk/woo-variation-swatches.php

    r3098501 r3111209  
    55     * Description: Beautiful colors, images and buttons variation swatches for woocommerce product attributes. Requires WooCommerce 7.5+
    66     * Author: Emran Ahmed
    7      * Version: 2.1.0
     7     * Version: 2.1.1
    88     * Domain Path: /languages
    99     * Requires PHP: 7.4
     
    1111     * Tested up to: 6.5
    1212     * WC requires at least: 7.5
    13      * WC tested up to: 8.9
     13     * WC tested up to: 9.0
    1414     * Text Domain: woo-variation-swatches
    1515     * Author URI: https://getwooplugins.com/
     
    2222
    2323if ( ! defined( 'WOO_VARIATION_SWATCHES_PLUGIN_VERSION' ) ) {
    24     define( 'WOO_VARIATION_SWATCHES_PLUGIN_VERSION', '2.1.0' );
     24    define( 'WOO_VARIATION_SWATCHES_PLUGIN_VERSION', '2.1.1' );
    2525}
    2626
     
    3131if ( ! defined( 'WOO_VARIATION_SWATCHES_PLUGIN_FILE' ) ) {
    3232    define( 'WOO_VARIATION_SWATCHES_PLUGIN_FILE', __FILE__ );
     33}
     34
     35if ( ! defined( 'WOO_VARIATION_SWATCHES_MAYBE_PRO_PLUGIN_FILE' ) ) {
     36    $woo_variation_swatches_maybe_pro_plugin_file = sprintf('%s/woo-variation-swatches-pro/woo-variation-swatches-pro.php', wp_normalize_path( WP_PLUGIN_DIR ));
     37    define( 'WOO_VARIATION_SWATCHES_MAYBE_PRO_PLUGIN_FILE', $woo_variation_swatches_maybe_pro_plugin_file );
    3338}
    3439
     
    7681    }
    7782
    78     if ( function_exists( 'woo_variation_swatches_pro' ) ) {
     83    if ( function_exists( 'woo_variation_swatches_pro' ) && woo_variation_swatches_using_correct_pro_version() ) {
    7984        return woo_variation_swatches_pro();
    8085    }
     
    9095 * @return bool
    9196 */
    92 function woo_variation_swatches_using_correct_pro_version() {
     97function woo_variation_swatches_using_correct_pro_version(): bool {
    9398    return defined( 'WOO_VARIATION_SWATCHES_PRO_PLUGIN_VERSION' ) && ( version_compare( constant('WOO_VARIATION_SWATCHES_PRO_PLUGIN_VERSION'), constant( 'WOO_VARIATION_SWATCHES_MINIMUM_COMPATIBLE_PRO_PLUGIN_VERSION' ) ) >= 0 );
    9499}
     
    110115
    111116    if ( is_plugin_active( 'woo-variation-swatches-pro/woo-variation-swatches-pro.php' ) ) {
     117
     118        // Suppress "Plugin activated." notice.
     119        unset($_GET['activate']); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     120
     121        // Display notice why pro version cannot activate.
     122        add_action('admin_notices', 'woo_variation_swatches_deactivate_notice_pro');
    112123        // Deactivate the plugin silently, Prevent deactivation hooks from running.
    113124        deactivate_plugins( 'woo-variation-swatches-pro/woo-variation-swatches-pro.php', true );
     
    120131 * @return void
    121132 */
    122 function woo_variation_swatches_prevent_pro_active() {
     133function woo_variation_swatches_deactivate_notice_pro() {
    123134
    124135    if ( woo_variation_swatches_using_correct_pro_version() ) {
    125136        return;
    126137    }
     138
    127139    /* translators: %s: Pro Plugin Version */
    128     printf(esc_html__('You are running older version of "Variation Swatches for WooCommerce - Pro". Please upgrade to %s or upper and continue.', 'woo-variation-swatches'), esc_html(constant( 'WOO_VARIATION_SWATCHES_MINIMUM_COMPATIBLE_PRO_PLUGIN_VERSION' )));
    129     exit();
     140    $notice_text =  sprintf(esc_html__('You are running older version of "Variation Swatches for WooCommerce - Pro". Please upgrade to %s or upper and continue.', 'woo-variation-swatches'), esc_html(constant( 'WOO_VARIATION_SWATCHES_MINIMUM_COMPATIBLE_PRO_PLUGIN_VERSION' )));
     141
     142    printf( '<div class="%1$s"><p>%2$s</p></div>', 'notice notice-error', esc_html($notice_text) );
     143}
     144
     145/**
     146 * Show notice on plugin row.
     147 *
     148 * @param string $plugin_file Refer to {@see 'plugin_row_meta'} filter.
     149 * @param array  $plugin_data Refer to {@see 'plugin_row_meta'} filter.
     150 *
     151 * @return void
     152 */
     153function woo_variation_swatches_row_meta_notice_pro( string $plugin_file, array $plugin_data) {
     154    if ( plugin_basename( WOO_VARIATION_SWATCHES_MAYBE_PRO_PLUGIN_FILE ) === $plugin_file ) {
     155        $current_version = $plugin_data['Version'];
     156        if (  version_compare( $current_version, constant( 'WOO_VARIATION_SWATCHES_MINIMUM_COMPATIBLE_PRO_PLUGIN_VERSION' ), '<=' )  ) {
     157            /* translators: %s: Pro Plugin Version */
     158            $notice_text =   sprintf(esc_html__('You are running older version of "Variation Swatches for WooCommerce - Pro". Please upgrade to %s or upper.', 'woo-variation-swatches'), esc_html(constant( 'WOO_VARIATION_SWATCHES_MINIMUM_COMPATIBLE_PRO_PLUGIN_VERSION' )));
     159
     160            printf( '<p style="color: darkred"><span class="dashicons dashicons-warning"></span> <strong>%s</strong></p>', esc_html($notice_text) );
     161        }
     162    }
    130163}
    131164
     
    143176    add_action( 'before_woocommerce_init', 'woo_variation_swatches_hpos_compatibility' );
    144177    add_action( 'plugins_loaded', 'woo_variation_swatches_deactivate_pro', 9 );
    145     add_action( 'activate_woo-variation-swatches-pro/woo-variation-swatches-pro.php', 'woo_variation_swatches_prevent_pro_active' );
     178    add_action( 'after_plugin_row_meta', 'woo_variation_swatches_row_meta_notice_pro', 10, 2 );
    146179
Note: See TracChangeset for help on using the changeset viewer.