Changeset 3728143
- Timestamp:
- 10/05/2026 05:52:42 AM (2 weeks ago)
- Location:
- markettier-pricing-for-woocommerce
- Files:
-
- 2 added
- 14 edited
- 1 copied
-
tags/1.0.2 (copied) (copied from markettier-pricing-for-woocommerce/trunk )
-
tags/1.0.2/CHANGELOG.md (modified) (1 diff)
-
tags/1.0.2/admin/class-settings.php (modified) (3 diffs)
-
tags/1.0.2/admin/views/settings-page.php (modified) (2 diffs)
-
tags/1.0.2/admin/views/tab-style.php (added)
-
tags/1.0.2/assets/js/admin.js (modified) (1 diff)
-
tags/1.0.2/market-tier-pricing.php (modified) (2 diffs)
-
tags/1.0.2/public/class-country-selector.php (modified) (2 diffs)
-
tags/1.0.2/readme.txt (modified) (2 diffs)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/admin/class-settings.php (modified) (3 diffs)
-
trunk/admin/views/settings-page.php (modified) (2 diffs)
-
trunk/admin/views/tab-style.php (added)
-
trunk/assets/js/admin.js (modified) (1 diff)
-
trunk/market-tier-pricing.php (modified) (2 diffs)
-
trunk/public/class-country-selector.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
markettier-pricing-for-woocommerce/tags/1.0.2/CHANGELOG.md
r3724584 r3728143 4 4 5 5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 7 ## [1.0.2] - 2026-10-05 8 9 ### Fixed 10 - **Site-Wide Country Selection Consistency**: 11 - Ensured consistent browsing country resolution across Home, Shop, category, and single product pages. 12 - Verified priority order so explicit visitor choice persists deterministically across pages. 13 - Retained strict checkout authority without regressions to WooCommerce native tax and shipping. 14 - **Copy Shortcode Button**: 15 - Added robust fallback to `document.execCommand('copy')` with hidden textarea when modern asynchronous Clipboard API is unavailable (e.g. non-HTTPS/local environments or older browsers). 16 - **Frontend Country Selector Label**: 17 - Removed visible "Country" text from `[markprfo_country_selector]` output for clean, minimal layout presentation while preserving accessible attributes (`aria-label`). 18 19 ### Added 20 - **Style Admin Settings Tab**: 21 - Added dedicated "Style" tab under WooCommerce > MarketTier Pricing. 22 - Provided Custom CSS editor field with secure CSS sanitization (`wp_strip_all_tags`). 23 - Added CSS selectors reference guide for theme styling and selector overrides (`.markprfo-country-selector`, `.markprfo-country-select`, `.markprfo-country-selector-spinner`, `.markprfo-country-selector-label`). 6 24 7 25 ## [1.0.1] - 2026-10-02 -
markettier-pricing-for-woocommerce/tags/1.0.2/admin/class-settings.php
r3724584 r3728143 29 29 'general' => __( 'General', 'markettier-pricing-for-woocommerce' ), 30 30 'currency' => __( 'Currency & Rates', 'markettier-pricing-for-woocommerce' ), 31 'style' => __( 'Style', 'markettier-pricing-for-woocommerce' ), 31 32 'diagnostics' => __( 'Diagnostics', 'markettier-pricing-for-woocommerce' ), 32 33 'howto' => __( 'How to Use', 'markettier-pricing-for-woocommerce' ), … … 60 61 } elseif ( 'save_currency' === $action ) { 61 62 self::save_currency(); 63 } elseif ( 'save_style' === $action ) { 64 self::save_style(); 62 65 } 63 66 } … … 280 283 exit; 281 284 } 285 286 /** 287 * Save custom CSS style settings. 288 */ 289 protected static function save_style() { 290 $custom_css = isset( $_POST['markprfo_custom_css'] ) ? wp_unslash( $_POST['markprfo_custom_css'] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized 291 292 // Sanitize CSS: strip HTML tags and scripts, preserving valid CSS characters and selectors. 293 $sanitized_css = wp_strip_all_tags( $custom_css ); 294 295 update_option( 'markprfo_custom_css', $sanitized_css ); 296 297 wp_safe_redirect( add_query_arg( array( 'page' => 'markprfo_settings', 'tab' => 'style', 'message' => 'style_saved' ), admin_url( 'admin.php' ) ) ); 298 exit; 299 } 282 300 } -
markettier-pricing-for-woocommerce/tags/1.0.2/admin/views/settings-page.php
r3724584 r3728143 9 9 <h1><?php esc_html_e( 'MarketTier Pricing for WooCommerce', 'markettier-pricing-for-woocommerce' ); ?></h1> 10 10 11 <?php if ( 'saved' === $message || 'market_saved' === $message || 'currency_saved' === $message ) : ?>11 <?php if ( 'saved' === $message || 'market_saved' === $message || 'currency_saved' === $message || 'style_saved' === $message ) : ?> 12 12 <div class="notice notice-success is-dismissible"> 13 13 <p><?php esc_html_e( 'Settings updated successfully.', 'markettier-pricing-for-woocommerce' ); ?></p> … … 36 36 include MARKPRFO_PLUGIN_DIR . 'admin/views/tab-currency.php'; 37 37 break; 38 case 'style': 39 include MARKPRFO_PLUGIN_DIR . 'admin/views/tab-style.php'; 40 break; 38 41 case 'diagnostics': 39 42 include MARKPRFO_PLUGIN_DIR . 'admin/views/tab-diagnostics.php'; -
markettier-pricing-for-woocommerce/tags/1.0.2/assets/js/admin.js
r3724584 r3728143 238 238 $( document ).on( 'click', '.markprfo-howto-copy-btn', function ( e ) { 239 239 e.preventDefault(); 240 var $btn = $( this ); 241 var targetId = $btn.data( 'copy-target' ); 242 var text = $( '#' + targetId ).text(); 240 var $btn = $( this ); 241 var targetId = $btn.data( 'copy-target' ); 242 var text = $( '#' + targetId ).text().trim(); 243 244 if ( ! text ) { 245 return; 246 } 247 248 function showSuccess() { 249 var origText = $btn.text(); 250 $btn.text( 'Copied!' ).prop( 'disabled', true ); 251 setTimeout( function () { 252 $btn.text( origText ).prop( 'disabled', false ); 253 }, 2000 ); 254 } 243 255 244 256 if ( navigator.clipboard && navigator.clipboard.writeText ) { 245 257 navigator.clipboard.writeText( text ).then( function () { 246 var origText = $btn.text(); 247 $btn.text( 'Copied!' ).prop( 'disabled', true ); 248 setTimeout( function () { 249 $btn.text( origText ).prop( 'disabled', false ); 250 }, 2000 ); 258 showSuccess(); 259 } ).catch( function () { 260 fallbackCopy( text, showSuccess ); 251 261 } ); 252 } 253 } ); 262 } else { 263 fallbackCopy( text, showSuccess ); 264 } 265 } ); 266 } 267 268 function fallbackCopy( text, callback ) { 269 var $temp = $( '<textarea>' ); 270 $( 'body' ).append( $temp ); 271 $temp.val( text ).select(); 272 try { 273 var successful = document.execCommand( 'copy' ); 274 if ( successful && typeof callback === 'function' ) { 275 callback(); 276 } 277 } catch ( err ) { 278 // Fail silently or handle error if needed. 279 } 280 $temp.remove(); 254 281 } 255 282 -
markettier-pricing-for-woocommerce/tags/1.0.2/market-tier-pricing.php
r3724584 r3728143 3 3 * Plugin Name: MarketTier Pricing for WooCommerce 4 4 * Description: Set country and regional prices for WooCommerce products with market-based pricing, currencies, checkout rules, and variations. 5 * Version: 1.0. 15 * Version: 1.0.2 6 6 * Author: habibnoori 7 7 * Author URI: https://habib.wpminner.com/ … … 25 25 // Plugin version constant. 26 26 if ( ! defined( 'MARKPRFO_VERSION' ) ) { 27 define( 'MARKPRFO_VERSION', '1.0. 1' );27 define( 'MARKPRFO_VERSION', '1.0.2' ); 28 28 } 29 29 -
markettier-pricing-for-woocommerce/tags/1.0.2/public/class-country-selector.php
r3724584 r3728143 47 47 $atts = shortcode_atts( 48 48 array( 49 'label' => __( 'Country', 'markettier-pricing-for-woocommerce' ),49 'label' => '', 50 50 'class' => '', 51 51 ), … … 142 142 ); 143 143 144 $custom_css = get_option( 'markprfo_custom_css', '' ); 145 if ( ! empty( $custom_css ) && is_string( $custom_css ) ) { 146 wp_add_inline_style( 'markprfo-country-selector-css', $custom_css ); 147 } 148 144 149 wp_enqueue_script( 145 150 'markprfo-country-selector-js', -
markettier-pricing-for-woocommerce/tags/1.0.2/readme.txt
r3724584 r3728143 4 4 Requires at least: 6.4 5 5 Tested up to: 7.1 6 Stable tag: 1.0. 16 Stable tag: 1.0.2 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 164 164 == Changelog == 165 165 166 = 1.0.2 = 167 * Fixed site-wide country selection consistency and switching across Home, Shop, and category pages. 168 * Fixed the Copy Shortcode button in the admin How to Use guide with clipboard and legacy execCommand fallback. 169 * Added Style admin tab with Custom CSS textarea and full selector reference guide. 170 * Removed visible "Country" label text from the frontend country selector dropdown while preserving accessible markup. 171 166 172 = 1.0.1 = 167 173 * Added a persistent country selector shortcode for market-based storefront pricing. -
markettier-pricing-for-woocommerce/trunk/CHANGELOG.md
r3724584 r3728143 4 4 5 5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 7 ## [1.0.2] - 2026-10-05 8 9 ### Fixed 10 - **Site-Wide Country Selection Consistency**: 11 - Ensured consistent browsing country resolution across Home, Shop, category, and single product pages. 12 - Verified priority order so explicit visitor choice persists deterministically across pages. 13 - Retained strict checkout authority without regressions to WooCommerce native tax and shipping. 14 - **Copy Shortcode Button**: 15 - Added robust fallback to `document.execCommand('copy')` with hidden textarea when modern asynchronous Clipboard API is unavailable (e.g. non-HTTPS/local environments or older browsers). 16 - **Frontend Country Selector Label**: 17 - Removed visible "Country" text from `[markprfo_country_selector]` output for clean, minimal layout presentation while preserving accessible attributes (`aria-label`). 18 19 ### Added 20 - **Style Admin Settings Tab**: 21 - Added dedicated "Style" tab under WooCommerce > MarketTier Pricing. 22 - Provided Custom CSS editor field with secure CSS sanitization (`wp_strip_all_tags`). 23 - Added CSS selectors reference guide for theme styling and selector overrides (`.markprfo-country-selector`, `.markprfo-country-select`, `.markprfo-country-selector-spinner`, `.markprfo-country-selector-label`). 6 24 7 25 ## [1.0.1] - 2026-10-02 -
markettier-pricing-for-woocommerce/trunk/admin/class-settings.php
r3724584 r3728143 29 29 'general' => __( 'General', 'markettier-pricing-for-woocommerce' ), 30 30 'currency' => __( 'Currency & Rates', 'markettier-pricing-for-woocommerce' ), 31 'style' => __( 'Style', 'markettier-pricing-for-woocommerce' ), 31 32 'diagnostics' => __( 'Diagnostics', 'markettier-pricing-for-woocommerce' ), 32 33 'howto' => __( 'How to Use', 'markettier-pricing-for-woocommerce' ), … … 60 61 } elseif ( 'save_currency' === $action ) { 61 62 self::save_currency(); 63 } elseif ( 'save_style' === $action ) { 64 self::save_style(); 62 65 } 63 66 } … … 280 283 exit; 281 284 } 285 286 /** 287 * Save custom CSS style settings. 288 */ 289 protected static function save_style() { 290 $custom_css = isset( $_POST['markprfo_custom_css'] ) ? wp_unslash( $_POST['markprfo_custom_css'] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized 291 292 // Sanitize CSS: strip HTML tags and scripts, preserving valid CSS characters and selectors. 293 $sanitized_css = wp_strip_all_tags( $custom_css ); 294 295 update_option( 'markprfo_custom_css', $sanitized_css ); 296 297 wp_safe_redirect( add_query_arg( array( 'page' => 'markprfo_settings', 'tab' => 'style', 'message' => 'style_saved' ), admin_url( 'admin.php' ) ) ); 298 exit; 299 } 282 300 } -
markettier-pricing-for-woocommerce/trunk/admin/views/settings-page.php
r3724584 r3728143 9 9 <h1><?php esc_html_e( 'MarketTier Pricing for WooCommerce', 'markettier-pricing-for-woocommerce' ); ?></h1> 10 10 11 <?php if ( 'saved' === $message || 'market_saved' === $message || 'currency_saved' === $message ) : ?>11 <?php if ( 'saved' === $message || 'market_saved' === $message || 'currency_saved' === $message || 'style_saved' === $message ) : ?> 12 12 <div class="notice notice-success is-dismissible"> 13 13 <p><?php esc_html_e( 'Settings updated successfully.', 'markettier-pricing-for-woocommerce' ); ?></p> … … 36 36 include MARKPRFO_PLUGIN_DIR . 'admin/views/tab-currency.php'; 37 37 break; 38 case 'style': 39 include MARKPRFO_PLUGIN_DIR . 'admin/views/tab-style.php'; 40 break; 38 41 case 'diagnostics': 39 42 include MARKPRFO_PLUGIN_DIR . 'admin/views/tab-diagnostics.php'; -
markettier-pricing-for-woocommerce/trunk/assets/js/admin.js
r3724584 r3728143 238 238 $( document ).on( 'click', '.markprfo-howto-copy-btn', function ( e ) { 239 239 e.preventDefault(); 240 var $btn = $( this ); 241 var targetId = $btn.data( 'copy-target' ); 242 var text = $( '#' + targetId ).text(); 240 var $btn = $( this ); 241 var targetId = $btn.data( 'copy-target' ); 242 var text = $( '#' + targetId ).text().trim(); 243 244 if ( ! text ) { 245 return; 246 } 247 248 function showSuccess() { 249 var origText = $btn.text(); 250 $btn.text( 'Copied!' ).prop( 'disabled', true ); 251 setTimeout( function () { 252 $btn.text( origText ).prop( 'disabled', false ); 253 }, 2000 ); 254 } 243 255 244 256 if ( navigator.clipboard && navigator.clipboard.writeText ) { 245 257 navigator.clipboard.writeText( text ).then( function () { 246 var origText = $btn.text(); 247 $btn.text( 'Copied!' ).prop( 'disabled', true ); 248 setTimeout( function () { 249 $btn.text( origText ).prop( 'disabled', false ); 250 }, 2000 ); 258 showSuccess(); 259 } ).catch( function () { 260 fallbackCopy( text, showSuccess ); 251 261 } ); 252 } 253 } ); 262 } else { 263 fallbackCopy( text, showSuccess ); 264 } 265 } ); 266 } 267 268 function fallbackCopy( text, callback ) { 269 var $temp = $( '<textarea>' ); 270 $( 'body' ).append( $temp ); 271 $temp.val( text ).select(); 272 try { 273 var successful = document.execCommand( 'copy' ); 274 if ( successful && typeof callback === 'function' ) { 275 callback(); 276 } 277 } catch ( err ) { 278 // Fail silently or handle error if needed. 279 } 280 $temp.remove(); 254 281 } 255 282 -
markettier-pricing-for-woocommerce/trunk/market-tier-pricing.php
r3724584 r3728143 3 3 * Plugin Name: MarketTier Pricing for WooCommerce 4 4 * Description: Set country and regional prices for WooCommerce products with market-based pricing, currencies, checkout rules, and variations. 5 * Version: 1.0. 15 * Version: 1.0.2 6 6 * Author: habibnoori 7 7 * Author URI: https://habib.wpminner.com/ … … 25 25 // Plugin version constant. 26 26 if ( ! defined( 'MARKPRFO_VERSION' ) ) { 27 define( 'MARKPRFO_VERSION', '1.0. 1' );27 define( 'MARKPRFO_VERSION', '1.0.2' ); 28 28 } 29 29 -
markettier-pricing-for-woocommerce/trunk/public/class-country-selector.php
r3724584 r3728143 47 47 $atts = shortcode_atts( 48 48 array( 49 'label' => __( 'Country', 'markettier-pricing-for-woocommerce' ),49 'label' => '', 50 50 'class' => '', 51 51 ), … … 142 142 ); 143 143 144 $custom_css = get_option( 'markprfo_custom_css', '' ); 145 if ( ! empty( $custom_css ) && is_string( $custom_css ) ) { 146 wp_add_inline_style( 'markprfo-country-selector-css', $custom_css ); 147 } 148 144 149 wp_enqueue_script( 145 150 'markprfo-country-selector-js', -
markettier-pricing-for-woocommerce/trunk/readme.txt
r3724584 r3728143 4 4 Requires at least: 6.4 5 5 Tested up to: 7.1 6 Stable tag: 1.0. 16 Stable tag: 1.0.2 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 164 164 == Changelog == 165 165 166 = 1.0.2 = 167 * Fixed site-wide country selection consistency and switching across Home, Shop, and category pages. 168 * Fixed the Copy Shortcode button in the admin How to Use guide with clipboard and legacy execCommand fallback. 169 * Added Style admin tab with Custom CSS textarea and full selector reference guide. 170 * Removed visible "Country" label text from the frontend country selector dropdown while preserving accessible markup. 171 166 172 = 1.0.1 = 167 173 * Added a persistent country selector shortcode for market-based storefront pricing.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)