Changeset 3327071
- Timestamp:
- 07/13/2025 04:10:09 PM (9 months ago)
- Location:
- racar-clear-cart-for-woocommerce
- Files:
-
- 31 added
- 7 edited
-
tags/2.1.5 (added)
-
tags/2.1.5/css (added)
-
tags/2.1.5/css/rccwoo-stylesheet.css (added)
-
tags/2.1.5/includes (added)
-
tags/2.1.5/includes/admin (added)
-
tags/2.1.5/includes/admin/class-rccwoo_Action_List.php (added)
-
tags/2.1.5/includes/admin/class-rccwoo_Admin_Options.php (added)
-
tags/2.1.5/includes/admin/css (added)
-
tags/2.1.5/includes/admin/css/rccwoo-admin-style.css (added)
-
tags/2.1.5/includes/admin/js (added)
-
tags/2.1.5/includes/admin/js/rccwoo-admin-javascript.js (added)
-
tags/2.1.5/includes/admin/views (added)
-
tags/2.1.5/includes/admin/views/html-notice-missing-woocommerce.php (added)
-
tags/2.1.5/includes/class-rccwoo-plugin.php (added)
-
tags/2.1.5/includes/rccwoo-functions.php (added)
-
tags/2.1.5/includes/views (added)
-
tags/2.1.5/includes/views/class-racar-clear-cart-button.php (added)
-
tags/2.1.5/js (added)
-
tags/2.1.5/js/rccwoo-javascript.js (added)
-
tags/2.1.5/languages (added)
-
tags/2.1.5/languages/racar-clear-cart-for-woocommerce-es_ES.l10n.php (added)
-
tags/2.1.5/languages/racar-clear-cart-for-woocommerce-es_ES.mo (added)
-
tags/2.1.5/languages/racar-clear-cart-for-woocommerce-es_ES.po (added)
-
tags/2.1.5/languages/racar-clear-cart-for-woocommerce-pt_BR.l10n.php (added)
-
tags/2.1.5/languages/racar-clear-cart-for-woocommerce-pt_BR.mo (added)
-
tags/2.1.5/languages/racar-clear-cart-for-woocommerce-pt_BR.po (added)
-
tags/2.1.5/languages/racar-clear-cart-for-woocommerce.pot (added)
-
tags/2.1.5/license.txt (added)
-
tags/2.1.5/racar-clear-cart-for-woocommerce.php (added)
-
tags/2.1.5/readme.txt (added)
-
tags/2.1.5/uninstall.php (added)
-
trunk/includes/admin/class-rccwoo_Action_List.php (modified) (1 diff)
-
trunk/includes/admin/class-rccwoo_Admin_Options.php (modified) (9 diffs)
-
trunk/includes/class-rccwoo-plugin.php (modified) (1 diff)
-
trunk/includes/rccwoo-functions.php (modified) (3 diffs)
-
trunk/includes/views/class-racar-clear-cart-button.php (modified) (4 diffs)
-
trunk/racar-clear-cart-for-woocommerce.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
racar-clear-cart-for-woocommerce/trunk/includes/admin/class-rccwoo_Action_List.php
r2887889 r3327071 52 52 } 53 53 } 54 function start_action_links() {54 function rccwoo_start_action_links() { 55 55 $action_links = new rccwoo_Action_List(); 56 56 } 57 start_action_links();57 rccwoo_start_action_links(); -
racar-clear-cart-for-woocommerce/trunk/includes/admin/class-rccwoo_Admin_Options.php
r3325229 r3327071 289 289 // if( isset( $input['rccwoo_background'] ) ) { 290 290 // $background = trim( $input['rccwoo_background'] ); 291 // $background = strip_tags( stripslashes( $background ) );291 // $background = wp_strip_all_tags( stripslashes( $background ) ); 292 292 // if( FALSE === $this->check_color( $background ) ) { 293 293 // // Set the error message … … 301 301 if( isset( $input['rccwoo_background'] ) AND ! empty( $input['rccwoo_background'] ) ) { 302 302 $background = trim( $input['rccwoo_background'] ); 303 $background = strip_tags( stripslashes( $background ) );303 $background = wp_strip_all_tags( stripslashes( $background ) ); 304 304 $bg_color = ''; 305 305 if( '#' != $background[0]) { … … 311 311 if( isset( $input['rccwoo_background_hover_color'] ) AND ! empty( $input['rccwoo_background_hover_color'] ) ) { 312 312 $background = trim( $input['rccwoo_background_hover_color'] ); 313 $background = strip_tags( stripslashes( $background ) );313 $background = wp_strip_all_tags( stripslashes( $background ) ); 314 314 $bg_color = ''; 315 315 if( '#' != $background[0]) { … … 321 321 if( isset( $input['rccwoo_text_color'] ) AND ! empty( $input['rccwoo_text_color'] ) ) { 322 322 $textcolor = trim( $input['rccwoo_text_color'] ); 323 $textcolor = strip_tags( stripslashes( $textcolor ) );323 $textcolor = wp_strip_all_tags( stripslashes( $textcolor ) ); 324 324 $txt_color = ''; 325 325 if( '#' != $textcolor[0]) { … … 331 331 if( isset( $input['rccwoo_hover_text_color'] ) AND ! empty( $input['rccwoo_hover_text_color'] ) ) { 332 332 $textcolor = trim( $input['rccwoo_hover_text_color'] ); 333 $textcolor = strip_tags( stripslashes( $textcolor ) );333 $textcolor = wp_strip_all_tags( stripslashes( $textcolor ) ); 334 334 $txt_color = ''; 335 335 if( '#' != $textcolor[0]) { … … 358 358 */ 359 359 public function plugin_settings_section_callback() { 360 echo __( 'Enter your preferences below:', 'racar-clear-cart-for-woocommerce' );360 echo esc_html__( 'Enter your preferences below:', 'racar-clear-cart-for-woocommerce' ); 361 361 } 362 362 … … 371 371 '<input type="text" id="button-text" name="rccwoo_settings[rccwoo_button_text]" value="%s" placeholder="%s" />', 372 372 isset( $this->options['rccwoo_button_text'] ) ? esc_attr( $this->options['rccwoo_button_text']) : '' , 373 __('Clear Cart','racar-clear-cart-for-woocommerce')373 esc_html__( 'Clear Cart','racar-clear-cart-for-woocommerce' ) 374 374 ); 375 375 } … … 379 379 '<input type="text" id="confirm-text" name="rccwoo_settings[rccwoo_confirm_text]" value="%s" placeholder="%s" />', 380 380 isset( $this->options['rccwoo_confirm_text'] ) ? esc_attr( $this->options['rccwoo_confirm_text']) : '' , 381 __('Are you sure you wish to clear your shopping cart?','racar-clear-cart-for-woocommerce')381 esc_html__( 'Are you sure you wish to clear your shopping cart?','racar-clear-cart-for-woocommerce' ) 382 382 ); 383 383 } … … 466 466 '<input type="text" id="button-css-classes" name="rccwoo_settings[rccwoo_redirection_url]" value="%s" placeholder="%s"/>', 467 467 isset( $this->options['rccwoo_redirection_url'] ) ? esc_attr( $this->options['rccwoo_redirection_url']) : '', 468 __( 'https://mysite.com/shop' , 'racar-clear-cart-for-woocommerce' )469 ); 470 echo '<div>'. __('Leave blank to keep customer in cart page after cart deletion' , 'racar-clear-cart-for-woocommerce' ) . '</div>';468 esc_html__( 'https://mysite.com/shop' , 'racar-clear-cart-for-woocommerce' ) 469 ); 470 echo '<div>'. esc_html__('Leave blank to keep customer in cart page after cart deletion' , 'racar-clear-cart-for-woocommerce' ) . '</div>'; 471 471 } 472 472 -
racar-clear-cart-for-woocommerce/trunk/includes/class-rccwoo-plugin.php
r2891545 r3327071 142 142 */ 143 143 public static function woocommerce_clear_cart_url() { 144 if( ! isset( $_REQUEST['clear-cart'] ) ) { 145 return; 146 } 147 148 $nonce_field_name = '_wpnonce_racar_clear_cart'; // Nome do campo oculto do nonce 149 $nonce_action_name = 'racar_clear_cart_nonce'; // Nome da ação do nonce 150 151 if( ! isset( $_REQUEST[ $nonce_field_name ] ) OR ! wp_verify_nonce( sanitize_key( $_REQUEST[ $nonce_field_name ] ), $nonce_action_name ) ) { 152 wp_die( 'Invalid Request', 'Security Fail', array( 'response' => 403 ) ); 153 } 154 144 155 global $woocommerce; 145 156 $options = get_option( 'rccwoo_settings' ); 146 if( isset( $_REQUEST['clear-cart'] ) ) { 147 $woocommerce->cart->empty_cart(); 148 if( isset( $options['rccwoo_redirection_url'] ) ) { 149 wp_redirect( $options['rccwoo_redirection_url'] , 302 , 'Shop Clear Cart' ); 150 } 157 $woocommerce->cart->empty_cart(); 158 if( isset( $options['rccwoo_redirection_url'] ) AND ! empty( $options['rccwoo_redirection_url'] ) ) { 159 wp_safe_redirect( $options['rccwoo_redirection_url'] , 302 , 'Shop Clear Cart' ); 160 exit; 151 161 } 152 162 } -
racar-clear-cart-for-woocommerce/trunk/includes/rccwoo-functions.php
r2887889 r3327071 15 15 if( ! function_exists('rccwoo_script_file') ) { 16 16 function rccwoo_script_file() { 17 global $rccwoo_VERSION; 17 18 global $rccwoo_NOME_JAVASCRIPT; 18 19 global $rccwoo_DIR_JAVASCRIPT; 19 20 global $rccwoo_EXT_JAVASCRIPT; 20 wp_register_script( $rccwoo_NOME_JAVASCRIPT, plugins_url( $rccwoo_DIR_JAVASCRIPT.$rccwoo_NOME_JAVASCRIPT.$rccwoo_EXT_JAVASCRIPT, __FILE__ ) );21 wp_register_script( $rccwoo_NOME_JAVASCRIPT, plugins_url( $rccwoo_DIR_JAVASCRIPT.$rccwoo_NOME_JAVASCRIPT.$rccwoo_EXT_JAVASCRIPT, __FILE__ ), array(), $rccwoo_VERSION, true ); 21 22 wp_enqueue_script( $rccwoo_NOME_JAVASCRIPT ); 22 23 } … … 25 26 if( ! function_exists('rccwoo_style_file') ) { 26 27 function rccwoo_style_file() { 28 global $rccwoo_VERSION; 27 29 global $rccwoo_NOME_STYLESHEET; 28 30 global $rccwoo_DIR_STYLESHEET; 29 31 global $rccwoo_EXT_STYLESHEET; 30 32 // Respects SSL, Style.css is relative to the current file 31 wp_register_style( $rccwoo_NOME_STYLESHEET, plugins_url( $rccwoo_DIR_STYLESHEET.$rccwoo_NOME_STYLESHEET.$rccwoo_EXT_STYLESHEET, __FILE__ ) );33 wp_register_style( $rccwoo_NOME_STYLESHEET, plugins_url( $rccwoo_DIR_STYLESHEET.$rccwoo_NOME_STYLESHEET.$rccwoo_EXT_STYLESHEET, __FILE__ ), array(), $rccwoo_VERSION, 'all' ); 32 34 wp_enqueue_style( $rccwoo_NOME_STYLESHEET ); 33 35 } … … 69 71 * 70 72 * @since 1.0.0 73 * @removed 2.1.6 71 74 */ 72 function rccwoo_load_textdomain() { 73 global $rccwoo_basename; 74 $textdomain_loaded = load_plugin_textdomain( 'racar-clear-cart-for-woocommerce', false, basename( dirname( __DIR__ ) ) . '/languages' ); 75 } 76 77 78 79 80 ?> 75 // function rccwoo_load_textdomain() { 76 // global $rccwoo_basename; 77 // $textdomain_loaded = load_plugin_textdomain( 'racar-clear-cart-for-woocommerce', false, basename( dirname( __DIR__ ) ) . '/languages' ); 78 // } -
racar-clear-cart-for-woocommerce/trunk/includes/views/class-racar-clear-cart-button.php
r2887889 r3327071 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) exit; 3 2 4 if( ! class_exists( 'RACAR_Clear_Cart_Button' ) ) { 3 5 class RACAR_Clear_Cart_Button { … … 21 23 //trace( '$css_classes 0' ); 22 24 //trace( $css_classes ); 23 if( isset( $this->options["rccwoo_radiobox_1"] ) ) {25 if( isset( $this->options["rccwoo_radiobox_1"] ) ) { 24 26 $float_option = 'float:' . $this->options["rccwoo_radiobox_1"] . ';'; 25 27 } … … 59 61 button[name="clear-cart"]:hover{<?php echo esc_html( $button_bg_hover_color ); echo esc_html( $button_hover_text_color );?>} 60 62 </style> 63 64 <?php echo wp_kses( wp_nonce_field( 'racar_clear_cart_nonce', '_wpnonce_racar_clear_cart' ), $allowed_html ); ?> 61 65 62 66 <button type="submit" style="<?php echo esc_html( $float_option ); echo esc_html( $button_bg_color ); echo esc_html( $button_text_color ); echo esc_html( $fall_out_style_option );?>" onclick='return confirm("<?php echo esc_html( $confirm_text );?>");' <?php if( ! empty( $css_classes ) ) echo 'class="' . esc_html( $css_classes ) . '"';?> id="clear-cart" name="clear-cart" value="<?php echo esc_html( $button_text );?>"><?php echo esc_html( $button_text );?></button> … … 67 71 } 68 72 69 function add_button_to_cart_page() {73 function rccwoo_add_button_to_cart_page() { 70 74 $button = new RACAR_Clear_Cart_Button(); 71 75 } 72 add_button_to_cart_page();76 rccwoo_add_button_to_cart_page(); -
racar-clear-cart-for-woocommerce/trunk/racar-clear-cart-for-woocommerce.php
r3325229 r3327071 4 4 * Plugin URI: https://github.com/rafacarvalhido/racar-clear-cart-woo 5 5 * Description: This plugin adds a convenient button to empty the shopping cart. Clear the entire cart with one click. 6 * Version: 2.1. 56 * Version: 2.1.6 7 7 * Author: Rafa Carvalhido 8 8 * Author URI: https://profissionalwp.dev.br/blog/contato/rafa-carvalhido/ 9 9 * Text Domain: racar-clear-cart-for-woocommerce 10 10 * Domain Path: /languages 11 * Requires at least: 4.9 .812 * Tested up to: 6.8 .111 * Requires at least: 4.9 12 * Tested up to: 6.8 13 13 * WC requires at least: 3.0.0 14 14 * WC tested up to: 9.9.5 … … 52 52 add_action( 'plugins_loaded', array( 'rccwoo_Plugin', 'init' ) ); 53 53 } 54 55 add_action( 'before_woocommerce_init', function() { 56 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { 57 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); 58 } 59 } ); 54 60 55 61 /*=========================================================================*/ … … 58 64 $rccwoo_basename = plugin_basename(__FILE__);//racar-clear-cart-for-woocommerce/racar-clear-cart-for-woocommerce.php 59 65 60 $rccwoo_VERSION = '2.1. 4';66 $rccwoo_VERSION = '2.1.6'; 61 67 62 68 $rccwoo_NOME_STYLESHEET = 'rccwoo-stylesheet'; … … 109 115 * 110 116 * @since 1.0.0 117 * @removed 2.1.6 111 118 */ 112 function rccwoo_load_textdomain() { 113 $textdomain_loaded = load_plugin_textdomain( 'racar-clear-cart-for-woocommerce', false, basename( dirname( __FILE__ ) ) . '/languages' ); 114 } 115 add_action( 'init', 'rccwoo_load_textdomain' ); 116 ?> 119 // function rccwoo_load_textdomain() { 120 // $textdomain_loaded = load_plugin_textdomain( 'racar-clear-cart-for-woocommerce', false, basename( dirname( __FILE__ ) ) . '/languages' ); 121 // } 122 // add_action( 'init', 'rccwoo_load_textdomain' ); -
racar-clear-cart-for-woocommerce/trunk/readme.txt
r3325229 r3327071 3 3 Donate link: https://www.paypal.me/RafaCarvalhido 4 4 Tags: empty cart, clear cart, cart, woo commerce, woocommerce 5 Requires at least: 4.9 .86 Tested up to: 6.8 .17 Stable tag: 2.1. 55 Requires at least: 4.9 6 Tested up to: 6.8 7 Stable tag: 2.1.6 8 8 WC tested up to: 9.9.5 9 9 Requires Plugins: woocommerce … … 117 117 118 118 == Changelog == 119 = 2.1.6 - 2025-07-13 = 120 * Update - Changed readme.txt as per Wordpress.org rules 121 * Update - Changed the name of 2 functions adding the prefix rccwoo_ 122 * Update - Removed load_text_domain function 123 * Update - Activated compatibility with Woo's High-Performance Order Storage (HPOS) 124 * Fix - Escaped some echoed terms on Admin Options 125 * Fix - Added a nonce to the button action 126 * Fix - Removed closing tags in 2 files 127 128 119 129 = 2.1.5 - 2025-07-09 = 120 130 * Update - Tested on latest and greatest -> WP 6.8.1 and WC 9.9.5
Note: See TracChangeset
for help on using the changeset viewer.