Plugin Directory

Changeset 3371696


Ignore:
Timestamp:
10/02/2025 10:02:18 AM (5 months ago)
Author:
wcboost
Message:

Upload code of version 1.0.9

Location:
wcboost-products-compare/trunk
Files:
1 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • wcboost-products-compare/trunk/includes/admin/notices.php

    r3322266 r3371696  
    66 */
    77namespace WCBoost\ProductsCompare\Admin;
     8
     9defined( 'ABSPATH' ) || exit;
    810
    911use WCBoost\ProductsCompare\Plugin;
  • wcboost-products-compare/trunk/includes/admin/settings.php

    r3122349 r3371696  
    11<?php
     2/**
     3 * Manage settings for the plugin.
     4 */
     5
    26namespace WCBoost\ProductsCompare\Admin;
     7
     8defined( 'ABSPATH' ) || exit;
    39
    410/**
  • wcboost-products-compare/trunk/includes/ajax-handler.php

    r3322266 r3371696  
    11<?php
     2/**
     3 * Handle AJAX actions.
     4 */
     5
    26namespace WCBoost\ProductsCompare;
    37
    4 use MailPoet\AdminPages\Pages\Help;
     8defined( 'ABSPATH' ) || exit;
    59
     10/**
     11 * Ajax handler class.
     12 */
    613class Ajax_Handler {
    714
  • wcboost-products-compare/trunk/includes/analytics/data.php

    r3122349 r3371696  
    11<?php
     2/**
     3 * Analytics usage data.
     4 */
     5
    26namespace WCBoost\ProductsCompare\Analytics;
     7
     8defined( 'ABSPATH' ) || exit;
    39
    410/**
  • wcboost-products-compare/trunk/includes/analytics/tracker.php

    r3322266 r3371696  
    11<?php
    2 namespace WCBoost\ProductsCompare\Analytics;
    3 
    4 use WCBoost\ProductsCompare\Analytics\Data;
    5 
    62/**
    73 * Monitor comparison data
     4 */
     5
     6namespace WCBoost\ProductsCompare\Analytics;
     7
     8defined( 'ABSPATH' ) || exit;
     9
     10use WCBoost\ProductsCompare\Analytics\Data;
     11
     12/**
     13 * Tracker class
    814 */
    915class Tracker {
  • wcboost-products-compare/trunk/includes/compare-list.php

    r3127006 r3371696  
    11<?php
     2/**
     3 * Compare products list
     4 */
    25namespace WCBoost\ProductsCompare;
    36
  • wcboost-products-compare/trunk/includes/compatibility.php

    r2824094 r3371696  
    33 * Compatible with other plugins/themes
    44 */
     5
    56namespace WCBoost\ProductsCompare;
    67
  • wcboost-products-compare/trunk/includes/customizer.php

    r3322266 r3371696  
    11<?php
     2/**
     3 * Handle Customizer settings for plugin.
     4 */
     5
    26namespace WCBoost\ProductsCompare;
    37
  • wcboost-products-compare/trunk/includes/form-handler.php

    r3322266 r3371696  
    11<?php
     2/**
     3 * Handle form actions.
     4 */
     5
    26namespace WCBoost\ProductsCompare;
    37
    4 use Exception;
     8defined( 'ABSPATH' ) || exit;
    59
    610/**
  • wcboost-products-compare/trunk/includes/frontend.php

    r3322266 r3371696  
    11<?php
     2/**
     3 * Handle frontend actions.
     4 */
     5
    26namespace WCBoost\ProductsCompare;
     7
     8defined( 'ABSPATH' ) || exit;
    39
    410use WCBoost\ProductsCompare\Helper;
     
    6773
    6874        // Compare bar.
    69         if ( get_option( 'wcboost_products_compare_bar' ) && ! Helper::is_compare_page() ) {
     75        if ( get_option( 'wcboost_products_compare_bar' ) && ! Helper::is_compare_page() && Helper::can_user_view_site() ) {
    7076            add_action( 'wp_footer', [ $this, 'compare_bar' ] );
    7177        }
  • wcboost-products-compare/trunk/includes/helper.php

    r3322266 r3371696  
    11<?php
     2/**
     3 * Helper functions for the plugin.
     4 */
     5
    26namespace WCBoost\ProductsCompare;
     7
     8defined( 'ABSPATH' ) || exit;
    39
    410/**
     
    2026
    2127        return is_page( $page_id );
     28    }
     29
     30    /**
     31     * Check if current user can view the site (not restricted by WooCommerce Coming Soon mode).
     32     *
     33     * @since 1.0.9
     34     *
     35     * @return bool True if user can view the site, false if restricted by coming soon mode.
     36     */
     37    public static function can_user_view_site() {
     38        // If WooCommerce's Coming Soon classes don't exist, assume site is viewable
     39        if ( ! class_exists( 'Automattic\WooCommerce\Internal\ComingSoon\ComingSoonHelper' ) ) {
     40            return true;
     41        }
     42
     43        // Check if Launch Your Store feature is enabled
     44        if ( class_exists( 'Automattic\WooCommerce\Admin\Features\Features' ) ) {
     45            if ( ! \Automattic\WooCommerce\Admin\Features\Features::is_enabled( 'launch-your-store' ) ) {
     46                return true;
     47            }
     48        }
     49
     50        // Initialize coming soon helper
     51        $coming_soon_helper = wc_get_container()->get( \Automattic\WooCommerce\Internal\ComingSoon\ComingSoonHelper::class );
     52
     53        // If site is live, everyone can view
     54        if ( $coming_soon_helper->is_site_live() ) {
     55            return true;
     56        }
     57
     58        // Administrators and shop managers can always view
     59        if ( current_user_can( 'manage_woocommerce' ) ) {
     60            return true;
     61        }
     62
     63        // Check if the current page is in coming soon mode
     64        if ( ! $coming_soon_helper->is_current_page_coming_soon() ) {
     65            return true;
     66        }
     67
     68        // Check for coming soon exclusion filter
     69        if ( apply_filters( 'woocommerce_coming_soon_exclude', false ) ) {
     70            return true;
     71        }
     72
     73        // Check private link access
     74        if ( get_option( 'woocommerce_private_link' ) === 'yes' ) {
     75            $share_key = get_option( 'woocommerce_share_key' );
     76
     77            // Check URL parameter
     78            // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     79            if ( isset( $_GET['woo-share'] ) && $share_key === $_GET['woo-share'] ) {
     80                return true;
     81            }
     82
     83            // Check cookie
     84            // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
     85            if ( isset( $_COOKIE['woo-share'] ) && $share_key === wp_unslash( $_COOKIE['woo-share'] ) ) {
     86                return true;
     87            }
     88        }
     89
     90        // User is restricted by coming soon mode
     91        return false;
    2292    }
    2393
  • wcboost-products-compare/trunk/includes/install.php

    r3122349 r3371696  
    11<?php
    22/**
    3  * Install plugin
     3 * Handle plugin installation.
    44 */
     5
    56namespace WCBoost\ProductsCompare;
    67
  • wcboost-products-compare/trunk/includes/plugin.php

    r3322266 r3371696  
    11<?php
     2/**
     3 * Main plugin class
     4 */
     5
    26namespace WCBoost\ProductsCompare;
     7
     8defined( 'ABSPATH' ) || exit;
    39
    410/**
  • wcboost-products-compare/trunk/includes/shortcodes.php

    r3322266 r3371696  
    11<?php
     2/**
     3 * Products compare shortcodes
     4 */
     5
    26namespace WCBoost\ProductsCompare;
    37
     8defined( 'ABSPATH' ) || exit;
     9
    410use WCBoost\ProductsCompare\Analytics\Data;
    5 
    6 defined( 'ABSPATH' ) || exit;
    711
    812/**
  • wcboost-products-compare/trunk/includes/widgets/products-compare.php

    r3322266 r3371696  
    11<?php
     2/**
     3 * Classic widget for products compare.
     4 */
     5
    26namespace WCBoost\ProductsCompare\Widget;
    37
  • wcboost-products-compare/trunk/languages/wcboost-products-compare.pot

    r3322266 r3371696  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WCBoost - Products Compare 1.0.8\n"
     5"Project-Id-Version: WCBoost - Products Compare 1.0.9\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wcboost-products-compare\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-07-02T11:07:06+00:00\n"
     12"POT-Creation-Date: 2025-10-02T09:48:21+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.10.0\n"
     
    3232#. Author of the plugin
    3333#: wcboost-products-compare.php
    34 #: includes/customizer.php:196
     34#: includes/customizer.php:200
    3535msgid "WCBoost"
    3636msgstr ""
     
    4242
    4343#. translators: %s Theme name
    44 #: includes/admin/notices.php:91
     44#: includes/admin/notices.php:93
    4545msgid "<strong>Your theme (%s) contains outdated copies of some template files of WBoost - Products Compare.</strong> These files may need updating to ensure they are compatible with the current version of WCBoost - Products Compare."
    4646msgstr ""
    4747
    48 #: includes/admin/settings.php:31
    49 #: includes/customizer.php:46
    50 #: includes/widgets/products-compare.php:26
    51 #: includes/widgets/products-compare.php:33
     48#: includes/admin/settings.php:37
     49#: includes/customizer.php:50
     50#: includes/widgets/products-compare.php:30
     51#: includes/widgets/products-compare.php:37
    5252msgid "Products Compare"
    5353msgstr ""
    5454
    55 #: includes/admin/settings.php:37
     55#: includes/admin/settings.php:43
    5656msgid "Compare page"
    5757msgstr ""
    5858
    59 #: includes/admin/settings.php:38
     59#: includes/admin/settings.php:44
    6060msgid "Page content: [wcboost_compare]"
    6161msgstr ""
    6262
    63 #: includes/admin/settings.php:50
     63#: includes/admin/settings.php:56
    6464msgid "Added to compare behaviour"
    6565msgstr ""
    6666
    67 #: includes/admin/settings.php:55
     67#: includes/admin/settings.php:61
    6868msgid "No additional action"
    6969msgstr ""
    7070
    71 #: includes/admin/settings.php:56
     71#: includes/admin/settings.php:62
    7272msgid "Redirect to the compare page"
    7373msgstr ""
    7474
    75 #: includes/admin/settings.php:57
    76 #: includes/admin/settings.php:69
    77 #: includes/widgets/products-compare.php:97
     75#: includes/admin/settings.php:63
     76#: includes/admin/settings.php:75
     77#: includes/widgets/products-compare.php:101
    7878msgid "Open the compare popup"
    7979msgstr ""
    8080
    81 #: includes/admin/settings.php:61
     81#: includes/admin/settings.php:67
    8282msgid "Existing products behaviour"
    8383msgstr ""
    8484
    85 #: includes/admin/settings.php:62
     85#: includes/admin/settings.php:68
    8686msgid "Select how the button work with products that are already in the compare list"
    8787msgstr ""
    8888
    89 #: includes/admin/settings.php:67
     89#: includes/admin/settings.php:73
    9090msgid "Remove from the compare list"
    9191msgstr ""
    9292
    93 #: includes/admin/settings.php:68
     93#: includes/admin/settings.php:74
    9494msgid "View the compare page"
    9595msgstr ""
    9696
    97 #: includes/admin/settings.php:70
     97#: includes/admin/settings.php:76
    9898msgid "Hide the button"
    9999msgstr ""
    100100
    101 #: includes/admin/settings.php:74
     101#: includes/admin/settings.php:80
    102102msgid "AJAX Loading"
    103103msgstr ""
    104104
    105 #: includes/admin/settings.php:75
     105#: includes/admin/settings.php:81
    106106msgid "Load the list and buttons via AJAX to bypass the cache"
    107107msgstr ""
    108108
    109 #: includes/admin/settings.php:81
     109#: includes/admin/settings.php:87
    110110msgid "Comparision data tracking"
    111111msgstr ""
    112112
    113 #: includes/admin/settings.php:82
     113#: includes/admin/settings.php:88
    114114msgid "Monitor user comparison statistics."
    115115msgstr ""
    116116
    117 #: includes/admin/settings.php:83
     117#: includes/admin/settings.php:89
    118118msgid "This data gives insights into product performance, user interests, and is used to calculate similar products. Enabling this option may add additional meta data to products."
    119119msgstr ""
    120120
    121121#. translators: %s: product name
    122 #: includes/ajax-handler.php:50
    123 #: includes/form-handler.php:45
     122#: includes/ajax-handler.php:57
     123#: includes/form-handler.php:49
    124124msgid "%s has been added to the compare list"
    125125msgstr ""
    126126
    127 #: includes/customizer.php:71
     127#: includes/customizer.php:75
    128128msgid "Button icon"
    129129msgstr ""
    130130
    131 #: includes/customizer.php:75
     131#: includes/customizer.php:79
    132132msgid "No icon"
    133133msgstr ""
    134134
    135 #: includes/customizer.php:76
     135#: includes/customizer.php:80
    136136msgid "Arrows"
    137137msgstr ""
    138138
    139 #: includes/customizer.php:77
     139#: includes/customizer.php:81
    140140msgid "Plus"
    141141msgstr ""
    142142
    143 #: includes/customizer.php:78
     143#: includes/customizer.php:82
    144144msgid "Checkbox"
    145145msgstr ""
    146146
    147 #: includes/customizer.php:79
     147#: includes/customizer.php:83
    148148msgid "Code compare"
    149149msgstr ""
    150150
    151 #: includes/customizer.php:87
    152 #: includes/form-handler.php:52
    153 #: includes/helper.php:109
     151#: includes/customizer.php:91
     152#: includes/form-handler.php:56
     153#: includes/helper.php:179
    154154#: templates/loop/add-to-compare.php:28
    155155#: templates/single-product/add-to-compare.php:28
     
    157157msgstr ""
    158158
    159 #: includes/customizer.php:96
    160 #: includes/helper.php:110
     159#: includes/customizer.php:100
     160#: includes/helper.php:180
    161161msgid "Remove compare"
    162162msgstr ""
    163163
    164 #: includes/customizer.php:105
    165 #: includes/helper.php:111
     164#: includes/customizer.php:109
     165#: includes/helper.php:181
    166166msgid "Browse compare"
    167167msgstr ""
    168168
    169 #: includes/customizer.php:114
     169#: includes/customizer.php:118
    170170msgid "Button text"
    171171msgstr ""
    172172
    173 #: includes/customizer.php:115
     173#: includes/customizer.php:119
    174174msgid "Button add"
    175175msgstr ""
    176176
    177 #: includes/customizer.php:124
     177#: includes/customizer.php:128
    178178msgid "Button remove"
    179179msgstr ""
    180180
    181 #: includes/customizer.php:133
     181#: includes/customizer.php:137
    182182msgid "Button view"
    183183msgstr ""
    184184
    185 #: includes/customizer.php:151
     185#: includes/customizer.php:155
    186186msgid "Compare Bar"
    187187msgstr ""
    188188
    189 #: includes/customizer.php:152
     189#: includes/customizer.php:156
    190190msgid "Display a bar of comparing products"
    191191msgstr ""
    192192
    193 #: includes/customizer.php:156
     193#: includes/customizer.php:160
    194194msgid "Disable"
    195195msgstr ""
    196196
    197 #: includes/customizer.php:157
     197#: includes/customizer.php:161
    198198msgid "Display at bottom"
    199199msgstr ""
    200200
    201 #: includes/customizer.php:174
     201#: includes/customizer.php:178
    202202msgid "Bar button behavior"
    203203msgstr ""
    204204
    205 #: includes/customizer.php:178
     205#: includes/customizer.php:182
    206206msgid "Open compare page"
    207207msgstr ""
    208208
    209 #: includes/customizer.php:179
     209#: includes/customizer.php:183
    210210msgid "Open the compage popup"
    211211msgstr ""
    212212
    213 #: includes/form-handler.php:49
     213#: includes/form-handler.php:53
    214214msgid "Continue shopping"
    215215msgstr ""
    216216
    217217#. translators: %s: product name
    218 #: includes/form-handler.php:68
     218#: includes/form-handler.php:72
    219219msgid "%s was added to the compare list"
    220220msgstr ""
    221221
    222222#. translators: %s: product name
    223 #: includes/form-handler.php:93
     223#: includes/form-handler.php:97
    224224msgid "%s is removed from the compare list."
    225225msgstr ""
    226226
    227 #: includes/form-handler.php:101
     227#: includes/form-handler.php:105
    228228msgid "Failed to remove the product from the compare list"
    229229msgstr ""
    230230
    231 #: includes/form-handler.php:128
     231#: includes/form-handler.php:132
    232232msgid "The compare list is emptied"
    233233msgstr ""
    234234
    235235#. translators: %s Product name
    236 #: includes/frontend.php:207
     236#: includes/frontend.php:213
    237237msgid "Compare %s"
    238238msgstr ""
    239239
    240240#. translators: %s Product name
    241 #: includes/frontend.php:227
     241#: includes/frontend.php:233
    242242msgid "Remove %s from the compare list"
    243243msgstr ""
    244244
    245 #: includes/frontend.php:233
    246245#: includes/frontend.php:239
     246#: includes/frontend.php:245
    247247msgid "Open the compare list"
    248248msgstr ""
    249249
    250 #: includes/frontend.php:373
     250#: includes/frontend.php:379
    251251msgid "Clear list"
    252252msgstr ""
    253253
    254 #: includes/frontend.php:423
    255 #: includes/frontend.php:469
     254#: includes/frontend.php:429
     255#: includes/frontend.php:475
    256256msgid "Compare products"
    257257msgstr ""
    258258
    259 #: includes/frontend.php:436
     259#: includes/frontend.php:442
    260260msgid "Close"
    261261msgstr ""
    262262
    263 #: includes/frontend.php:467
     263#: includes/frontend.php:473
    264264msgid "View compared products"
    265265msgstr ""
    266266
    267 #: includes/frontend.php:514
     267#: includes/frontend.php:520
    268268msgid "Rating"
    269269msgstr ""
    270270
    271 #: includes/frontend.php:515
     271#: includes/frontend.php:521
    272272msgid "Price"
    273273msgstr ""
    274274
    275 #: includes/frontend.php:516
     275#: includes/frontend.php:522
    276276msgid "Availability"
    277277msgstr ""
    278278
    279 #: includes/frontend.php:517
     279#: includes/frontend.php:523
    280280msgid "SKU"
    281281msgstr ""
    282282
    283 #: includes/frontend.php:518
     283#: includes/frontend.php:524
    284284msgid "Dimensions"
    285285msgstr ""
    286286
    287 #: includes/frontend.php:519
     287#: includes/frontend.php:525
    288288msgid "Weight"
    289289msgstr ""
    290290
    291 #: includes/frontend.php:624
     291#: includes/frontend.php:630
    292292msgid "Remove this item"
    293293msgstr ""
    294294
    295 #: includes/frontend.php:660
     295#: includes/frontend.php:666
    296296msgid "In stock"
    297297msgstr ""
    298298
    299 #: includes/frontend.php:665
    300 #: includes/frontend.php:672
    301 #: includes/frontend.php:680
     299#: includes/frontend.php:671
     300#: includes/frontend.php:678
     301#: includes/frontend.php:686
    302302msgid "N/A"
    303303msgstr ""
    304304
    305 #: includes/install.php:71
     305#: includes/install.php:72
    306306msgctxt "Page slug"
    307307msgid "compare"
    308308msgstr ""
    309309
    310 #: includes/install.php:73
     310#: includes/install.php:74
    311311msgctxt "Page title"
    312312msgid "Compare"
    313313msgstr ""
    314314
    315 #: includes/install.php:99
     315#: includes/install.php:100
    316316msgid "View documentation"
    317317msgstr ""
    318318
    319 #: includes/install.php:99
     319#: includes/install.php:100
    320320msgid "Docs"
    321321msgstr ""
    322322
    323 #: includes/install.php:100
     323#: includes/install.php:101
    324324msgid "Visit community forums"
    325325msgstr ""
    326326
    327 #: includes/install.php:100
     327#: includes/install.php:101
    328328msgid "Community support"
    329329msgstr ""
    330330
    331 #: includes/plugin.php:41
    332 #: includes/plugin.php:48
     331#: includes/plugin.php:47
     332#: includes/plugin.php:54
    333333msgid "Foul!"
    334334msgstr ""
    335335
    336 #: includes/widgets/products-compare.php:36
     336#: includes/widgets/products-compare.php:40
    337337msgid "Displays the compare list"
    338338msgstr ""
    339339
    340 #: includes/widgets/products-compare.php:84
     340#: includes/widgets/products-compare.php:88
    341341msgid "Title:"
    342342msgstr ""
    343343
    344 #: includes/widgets/products-compare.php:90
     344#: includes/widgets/products-compare.php:94
    345345msgid "Hide if the compare list empty"
    346346msgstr ""
    347347
    348 #: includes/widgets/products-compare.php:94
     348#: includes/widgets/products-compare.php:98
    349349msgid "Compare button behaviour"
    350350msgstr ""
    351351
    352 #: includes/widgets/products-compare.php:96
     352#: includes/widgets/products-compare.php:100
    353353msgid "Open the compare page"
    354354msgstr ""
  • wcboost-products-compare/trunk/readme.txt

    r3322266 r3371696  
    33Tags: woocommerce, compare, product, product compare, woocommerce compare
    44Tested up to: 6.8
    5 Stable tag: 1.0.8
     5Stable tag: 1.0.9
    66Requires PHP: 7.0
    77Requires at least: 4.5
    8 WC requires at least: 3.0.0
    9 WC tested up to: 9.9
     8WC requires at least: 3.0
     9WC tested up to: 10.2
    1010License: GPLv3
    1111License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    111111== Changelog ==
    112112
     113= 1.0.9 =
     114* Fixed - Do not show the compare bar if the user is restricted by coming soon mode.
     115
    113116= 1.0.8 =
    114117* New - Adds 'hide_empty_attributes' option to the shortcode.
  • wcboost-products-compare/trunk/wcboost-products-compare.php

    r3322266 r3371696  
    55 * Plugin URI: https://wcboost.com/plugin/woocommerce-products-compare/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
    66 * Author: WCBoost
    7  * Version: 1.0.8
     7 * Version: 1.0.9
    88 * Author URI: https://wcboost.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
    99 * Text Domain: wcboost-products-compare
     
    2020}
    2121
    22 define( 'WCBOOST_PRODUCTS_COMPARE_VERSION', '1.0.8' );
     22define( 'WCBOOST_PRODUCTS_COMPARE_VERSION', '1.0.9' );
    2323define( 'WCBOOST_PRODUCTS_COMPARE_FILE', __FILE__ );
    2424define( 'WCBOOST_PRODUCTS_COMPARE_FREE', plugin_basename( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.