Changeset 3450833
- Timestamp:
- 01/31/2026 06:01:59 AM (2 months ago)
- Location:
- advwl-wishlist-for-woocommerce
- Files:
-
- 41 added
- 9 edited
-
tags/1.0.2 (added)
-
tags/1.0.2/advwl-wishlist-for-woocommerce.php (added)
-
tags/1.0.2/includes (added)
-
tags/1.0.2/includes/admin (added)
-
tags/1.0.2/includes/admin/css (added)
-
tags/1.0.2/includes/admin/css/advwl-admin.css (added)
-
tags/1.0.2/includes/admin/image (added)
-
tags/1.0.2/includes/admin/image/copy.png (added)
-
tags/1.0.2/includes/admin/image/facebook.png (added)
-
tags/1.0.2/includes/admin/image/gmail.png (added)
-
tags/1.0.2/includes/admin/image/heart.png (added)
-
tags/1.0.2/includes/admin/image/pinterest.png (added)
-
tags/1.0.2/includes/admin/image/twitter.png (added)
-
tags/1.0.2/includes/admin/image/whatsapp.png (added)
-
tags/1.0.2/includes/admin/inc (added)
-
tags/1.0.2/includes/admin/inc/advwl-add-to-wishlist.php (added)
-
tags/1.0.2/includes/admin/inc/advwl-general.php (added)
-
tags/1.0.2/includes/admin/inc/advwl-wishlist-page-opt.php (added)
-
tags/1.0.2/includes/admin/inc/functions (added)
-
tags/1.0.2/includes/admin/inc/functions/advwl-functions.php (added)
-
tags/1.0.2/includes/admin/js (added)
-
tags/1.0.2/includes/admin/js/advwl-admin.js (added)
-
tags/1.0.2/includes/advwl-activation.php (added)
-
tags/1.0.2/includes/advwl-deactivation.php (added)
-
tags/1.0.2/includes/public (added)
-
tags/1.0.2/includes/public/css (added)
-
tags/1.0.2/includes/public/css/advwl-all.css (added)
-
tags/1.0.2/includes/public/css/advwl-frontend.css (added)
-
tags/1.0.2/includes/public/inc (added)
-
tags/1.0.2/includes/public/inc/advwl-functions.php (added)
-
tags/1.0.2/includes/public/inc/advwl-shortcode.php (added)
-
tags/1.0.2/includes/public/js (added)
-
tags/1.0.2/includes/public/js/advwl-frontend.js (added)
-
tags/1.0.2/includes/public/webfonts (added)
-
tags/1.0.2/includes/public/webfonts/fa-brands-400.woff2 (added)
-
tags/1.0.2/includes/public/webfonts/fa-regular-400.woff2 (added)
-
tags/1.0.2/includes/public/webfonts/fa-solid-900.woff2 (added)
-
tags/1.0.2/includes/public/webfonts/fa-v4compatibility.woff2 (added)
-
tags/1.0.2/languages (added)
-
tags/1.0.2/readme.txt (added)
-
tags/1.0.2/uninstall.php (added)
-
trunk/advwl-wishlist-for-woocommerce.php (modified) (2 diffs)
-
trunk/includes/admin/inc/advwl-add-to-wishlist.php (modified) (5 diffs)
-
trunk/includes/admin/inc/advwl-general.php (modified) (2 diffs)
-
trunk/includes/admin/inc/advwl-wishlist-page-opt.php (modified) (1 diff)
-
trunk/includes/admin/inc/functions/advwl-functions.php (modified) (6 diffs)
-
trunk/includes/public/css/advwl-frontend.css (modified) (1 diff)
-
trunk/includes/public/inc/advwl-functions.php (modified) (10 diffs)
-
trunk/includes/public/js/advwl-frontend.js (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advwl-wishlist-for-woocommerce/trunk/advwl-wishlist-for-woocommerce.php
r3421271 r3450833 3 3 * Plugin Name: Advanced Wishlist & Share – Save Products for Later 4 4 * Description: You can add products in wishlist for future use using this plugin. 5 * Version: 1.0. 15 * Version: 1.0.2 6 6 * Author: Kirtikumar Solanki 7 7 * Author URI: https://profiles.wordpress.org/solankisoftware/ … … 30 30 define( 'ADVWL_PUBLIC_CSS', ADVWL_URL . 'includes/public/css/' ); 31 31 define( 'ADVWL_PREFIX', 'advwl-wishlist-for-woocommerce' ); 32 define( 'ADVWL_FVERSION', '1.0. 1' );32 define( 'ADVWL_FVERSION', '1.0.2' ); 33 33 define( 'ADVWL_LOAD_FREE', plugin_basename( __FILE__ ) ); 34 34 -
advwl-wishlist-for-woocommerce/trunk/includes/admin/inc/advwl-add-to-wishlist.php
r3342068 r3450833 4 4 if(isset($_POST['advwl_add_wishlist_panel'])){ 5 5 6 // ✅Verify nonce6 // Verify nonce 7 7 if ( ! isset( $_POST['advwl_add_wishlist_panel'] ) || 8 8 ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['advwl_add_wishlist_panel'] ) ), 'advwl_add_wishlist_action' ) ) { … … 30 30 $advwl_btn_text = sanitize_text_field( wp_unslash( $_POST['advwl_btn_text'] ) ); 31 31 } else { 32 $advwl_btn_text = sanitize_text_field(' Add to Wishlist');32 $advwl_btn_text = sanitize_text_field(''); 33 33 } 34 34 … … 36 36 $advwl_btn_view_text = sanitize_text_field( wp_unslash( $_POST['advwl_btn_view_text'] ) ); 37 37 } else { 38 $advwl_btn_view_text = sanitize_text_field(' View Wishlist');38 $advwl_btn_view_text = sanitize_text_field(''); 39 39 } 40 40 … … 42 42 $advwl_btn_remove_text = sanitize_text_field( wp_unslash( $_POST['advwl_btn_remove_text'] ) ); 43 43 } else { 44 $advwl_btn_remove_text = sanitize_text_field(' Remove From List');44 $advwl_btn_remove_text = sanitize_text_field(''); 45 45 } 46 46 … … 48 48 $advwl_btn_already_in = sanitize_text_field( wp_unslash( $_POST['advwl_btn_already_in'] ) ); 49 49 } else { 50 $advwl_btn_already_in = sanitize_text_field(' Already In Wishlist');50 $advwl_btn_already_in = sanitize_text_field(''); 51 51 } 52 52 -
advwl-wishlist-for-woocommerce/trunk/includes/admin/inc/advwl-general.php
r3342068 r3450833 4 4 if ( isset( $_POST['advwl_plugin_status'] ) || isset( $_POST['advwl_general_panel'] ) ) { 5 5 6 // ✅Verify nonce6 // Verify nonce 7 7 if ( ! isset( $_POST['advwl_general_panel'] ) || 8 8 ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['advwl_general_panel'] ) ), 'advwl_general_panel_action' ) ) { … … 12 12 $advwl_success = esc_html__( 'Successfully settings saved.', 'advwl-wishlist-for-woocommerce' ); 13 13 14 // ✅Sanitize input14 // Sanitize input 15 15 $advwl_plugin_status = ! empty( $_POST['advwl_plugin_status'] ) ? '1' : '0'; 16 16 -
advwl-wishlist-for-woocommerce/trunk/includes/admin/inc/advwl-wishlist-page-opt.php
r3342068 r3450833 4 4 if(isset($_POST['advwl_wishlist_opt_panel'])){ 5 5 6 // ✅Verify nonce matching the form6 // Verify nonce matching the form 7 7 if ( ! isset( $_POST['advwl_wishlist_opt_panel'] ) || 8 8 ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['advwl_wishlist_opt_panel'] ) ), 'advwl_wishlist_opt_action' ) ) { -
advwl-wishlist-for-woocommerce/trunk/includes/admin/inc/functions/advwl-functions.php
r3387905 r3450833 19 19 function advwl_upload_file() { 20 20 21 // ✅Verify nonce for security21 // Verify nonce for security 22 22 if ( ! isset( $_POST['security'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['security'] ) ), 'advwl-form' ) ) { 23 23 wp_send_json_error( [ 'message' => __( 'Security check failed.', 'advwl-wishlist-for-woocommerce' ) ] ); 24 24 } 25 25 26 // ✅Validate file input26 // Validate file input 27 27 if ( ! isset( $_FILES['advwl_icon'] ) || ! isset( $_POST['advwl_option_name'] ) ) { 28 28 wp_send_json_error( [ 'message' => __( 'Invalid request.', 'advwl-wishlist-for-woocommerce' ) ] ); 29 29 } 30 30 31 // ✅Sanitize option name31 // Sanitize option name 32 32 $advwl_opt_name = sanitize_text_field( wp_unslash( $_POST['advwl_option_name'] ) ); 33 33 34 // ✅Sanitize and validate file data34 // Sanitize and validate file data 35 35 $advwl_file_data = $_FILES['advwl_icon']; 36 36 $advwl_file_name = sanitize_file_name( $advwl_file_data['name'] ); … … 40 40 $advwl_file_size = absint( $advwl_file_data['size'] ); 41 41 42 // ✅Validate upload errors42 // Validate upload errors 43 43 if ( $advwl_file_error !== UPLOAD_ERR_OK ) { 44 44 wp_send_json_error( [ 'message' => __( 'File upload error.', 'advwl-wishlist-for-woocommerce' ) ] ); 45 45 } 46 46 47 // ✅Validate file type47 // Validate file type 48 48 $allowed_types = [ 'image/jpeg', 'image/png', 'image/gif', 'image/svg+xml' ]; 49 49 if ( ! in_array( $advwl_file_type, $allowed_types, true ) ) { … … 51 51 } 52 52 53 // ✅Validate file size (2MB limit example)53 // Validate file size (2MB limit example) 54 54 if ( $advwl_file_size > 2 * 1024 * 1024 ) { 55 55 wp_send_json_error( [ 'message' => __( 'File size exceeds 2MB limit.', 'advwl-wishlist-for-woocommerce' ) ] ); 56 56 } 57 57 58 // ✅Handle upload58 // Handle upload 59 59 $advwl_upload = wp_upload_bits( $advwl_file_name, null, file_get_contents( $advwl_file_tmp_name ) ); 60 60 if ( ! empty( $advwl_upload['error'] ) ) { … … 62 62 } 63 63 64 // ✅Sanitize URL64 // Sanitize URL 65 65 $advwl_file_url = esc_url_raw( $advwl_upload['url'] ); 66 66 67 // ✅Save option securely67 // Save option securely 68 68 update_option( $advwl_opt_name, $advwl_file_url ); 69 69 70 // ✅Return escaped URL in JSON70 // Return escaped URL in JSON 71 71 wp_send_json_success( [ 'file_url' => esc_url( $advwl_file_url ) ] ); 72 72 } … … 749 749 $product_id = $product->get_id(); 750 750 751 // ✅Use cache to prevent repeated DB calls751 // Use cache to prevent repeated DB calls 752 752 $cache_key = 'advwl_wishlist_count_' . $product_id; 753 753 $wishlist_count = wp_cache_get( $cache_key, 'advwl_wishlist' ); 754 754 755 755 if ( false === $wishlist_count ) { 756 // ✅Call get_var() directly with prepare756 // Call get_var() directly with prepare 757 757 $wishlist_count = (int) $wpdb->get_var( 758 758 $wpdb->prepare( … … 762 762 ); 763 763 764 // ✅Store in object cache764 // Store in object cache 765 765 wp_cache_set( $cache_key, $wishlist_count, 'advwl_wishlist', 3600 ); 766 766 } -
advwl-wishlist-for-woocommerce/trunk/includes/public/css/advwl-frontend.css
r3342068 r3450833 31 31 max-width: 40px; /* Resize huge icons */ 32 32 height: auto; 33 } 34 .advwl-link-text i{ 35 margin-right:13px; 36 } 37 38 /* Center wishlist button on product images */ 39 .products li.product .woocommerce-LoopProduct-link { 40 position: relative; 41 display: block; 42 } 43 .products li.product .advwl-on-image { 44 position: absolute; 45 top: 50%; 46 left: 50%; 47 transform: translate(-50%, -50%); 48 z-index: 9; 49 } 50 .single-product .woocommerce-product-gallery { 51 position: relative; 52 } 53 .single-product .woocommerce-product-gallery .advwl-on-image { 54 position: absolute; 55 top: 50%; 56 left: 50%; 57 transform: translate(-50%, -50%); 58 z-index: 9; 33 59 } 34 60 -
advwl-wishlist-for-woocommerce/trunk/includes/public/inc/advwl-functions.php
r3343715 r3450833 49 49 break; 50 50 case sanitize_text_field('advwl_btn_archive_top'): 51 add_action( 'woocommerce_before_shop_loop_item ', 'advwl_add_to_btn_html', 10);51 add_action( 'woocommerce_before_shop_loop_item_title', 'advwl_add_to_btn_html', 11); 52 52 break; 53 53 } … … 70 70 break; 71 71 case sanitize_text_field('advwl_btn_on_image'): 72 add_action( 'woocommerce_ before_single_product_summary', 'advwl_add_to_btn_html', 21);72 add_action( 'woocommerce_product_thumbnails', 'advwl_add_to_btn_html', 11); 73 73 break; 74 74 } … … 204 204 ); 205 205 206 $position_class = ''; 207 if ( is_product() && advwl_get_option( 'advwl_btn_position' ) === 'advwl_btn_on_image' ) { 208 $position_class = ' advwl-on-image'; 209 } elseif ( ( is_shop() || is_product_category() || is_product_tag() || is_product_taxonomy() ) 210 && advwl_get_option( 'advwl_btn_archive_position' ) === 'advwl_btn_archive_top' ) { 211 $position_class = ' advwl-on-image'; 212 } 213 206 214 // Button wrapper 207 $advwl_btn_html = '<div class="advwl-add-to-wishlist-wrap "215 $advwl_btn_html = '<div class="advwl-add-to-wishlist-wrap' . esc_attr( $position_class ) . '" 208 216 data-product-id="' . esc_attr( $product_id ) . '" 209 217 data-product-type="' . esc_attr( $product_type ) . '" … … 233 241 global $wpdb; 234 242 235 // ✅Verify nonce243 // Verify nonce 236 244 if ( ! isset($_POST['security']) || ! wp_verify_nonce( sanitize_text_field( wp_unslash($_POST['security']) ), 'advwl_add_to_wishlist_nonce' ) ) { 237 245 wp_send_json_error( array( 'message' => __( 'Invalid request.', 'advwl-wishlist-for-woocommerce' ) ) ); … … 286 294 function advwl_remove_from_wishlist() { 287 295 288 // ✅Verify nonce296 // Verify nonce 289 297 if ( empty( $_POST['security'] ) || 290 298 ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['security'] ) ), 'advwl_remove_from_wishlist_nonce' ) ) { … … 317 325 'temp_user_data' => sanitize_text_field( $temp_data ), 318 326 ), 319 array( '%d', '%d', '%s' ) // ✅Added format for extra security327 array( '%d', '%d', '%s' ) // Added format for extra security 320 328 ); 321 329 } else { … … 326 334 'prod_id' => $product_id, 327 335 ), 328 array( '%d', '%d' ) // ✅Added format336 array( '%d', '%d' ) // Added format 329 337 ); 330 338 } … … 352 360 function advwl_view_wishlist() { 353 361 354 // ✅Verify nonce362 // Verify nonce 355 363 if ( empty( $_POST['security'] ) || 356 364 ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['security'] ) ), 'advwl_view_wishlist_nonce' ) ) { … … 387 395 $wishlist_user_id = absint( base64_decode( sanitize_text_field( wp_unslash( $_GET['advwl_wishlist'] ) ) ) ); 388 396 389 // ✅Verify nonce397 // Verify nonce 390 398 if ( ! isset( $_GET['advwl_nonce'] ) || 391 399 ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['advwl_nonce'] ) ), 'advwl_view_wishlist_' . $wishlist_user_id ) ) { … … 568 576 if ( ! function_exists( 'advwl_add_to_cart_action' ) ) { 569 577 function advwl_add_to_cart_action() { 570 // ✅Manual nonce verification578 // Manual nonce verification 571 579 if ( empty( $_POST['security'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['security'] ) ), 'advwl_add_to_cart_nonce' ) ) { 572 580 wp_send_json_error( [ -
advwl-wishlist-for-woocommerce/trunk/includes/public/js/advwl-frontend.js
r3343715 r3450833 36 36 action: 'advwl_add_to_wishlist_action', 37 37 product_id: product_id, 38 security: advwl_addto_wishlist.nonce // ✅send nonce38 security: advwl_addto_wishlist.nonce // send nonce 39 39 }, 40 40 success: function(response){ … … 91 91 action: 'advwl_remove_from_wishlist', 92 92 product_id: product_id, 93 security: advwl_params.nonce_remove // ✅Send nonce93 security: advwl_params.nonce_remove // Send nonce 94 94 }, 95 95 success: function(response) { 96 96 if (response.success) { 97 var remove_data = response.data; // ✅get data object97 var remove_data = response.data; // get data object 98 98 var remove_row = remove_data.remove_row; 99 99 … … 122 122 type: 'POST', 123 123 url: advwl_view_wishlist.ajax_url, 124 dataType: 'json', // ✅Ensure JSON object is returned124 dataType: 'json', // Ensure JSON object is returned 125 125 data: { 126 126 action: 'advwl_view_wishlist', … … 155 155 }, 156 156 success: function(response){ 157 // ✅Access data from response.data157 // Access data from response.data 158 158 var remove_row = response.data.remove_row; 159 159 var message = response.data.message; … … 194 194 action: 'advwl_add_to_cart_action', 195 195 product_id: product_id, 196 security: advwl_params.nonce_addtocart // ✅Use the localized nonce196 security: advwl_params.nonce_addtocart // Use the localized nonce 197 197 }, 198 198 success: function(response){ -
advwl-wishlist-for-woocommerce/trunk/readme.txt
r3443444 r3450833 4 4 Tags: wishlist, save for later, product wishlist, favorite products 5 5 Requires at least: 5.0 6 Tested up to: 6.9 6 Tested up to: 6.9 7 7 Requires PHP: 7.0 8 Stable tag: 1.0. 18 Stable tag: 1.0.2 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 100 100 101 101 == Changelog == 102 = 1.0.2 = 103 * Fixed front side view wishlist redirect page not found issue 104 * Fixed On image top view button issue 105 * Removed default text issue when its blank save 102 106 103 107 = 1.0.1 =
Note: See TracChangeset
for help on using the changeset viewer.