Changeset 3252296
- Timestamp:
- 03/07/2025 06:07:07 PM (13 months ago)
- Location:
- cart-tracking-for-woocommerce/trunk
- Files:
-
- 3 edited
-
admin/admin.php (modified) (1 diff)
-
cart-tracking.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cart-tracking-for-woocommerce/trunk/admin/admin.php
r3229904 r3252296 155 155 // $req_order_by = sanitize_text_field($_REQUEST['orderby']); 156 156 // $req_order = sanitize_text_field($_REQUEST['order']); 157 // Define allowed column names and order directions 158 $allowed_columns = ['title', 'update_time', 'cart_total']; 159 // Add valid column names 160 $allowed_order = ['ASC', 'DESC']; 157 161 $req_order_by = ( isset( $_REQUEST['orderby'] ) ? sanitize_text_field( $_REQUEST['orderby'] ) : '' ); 158 162 $req_order = ( isset( $_REQUEST['order'] ) ? sanitize_text_field( $_REQUEST['order'] ) : '' ); 159 $orderby = ( !empty( $req_order_by) ? $req_order_by : 'carts.id' );163 $orderby = ( in_array( $req_order_by, $allowed_columns ) ? $req_order_by : 'carts.id' ); 160 164 //If no sort, default to title 161 165 if ( $orderby === 'title' ) { 162 166 $orderby = 'carts.id'; 163 167 } 164 $order = ( !empty( $req_order ) ? $req_order : 'DESC' );168 $order = ( in_array( $req_order, $allowed_order ) ? $req_order : 'DESC' ); 165 169 // $sql = $wpdb->prepare("SELECT carts.id AS id, update_time, cart_total, GROUP_CONCAT(posts.post_title SEPARATOR ' ') AS products 166 170 // FROM {$wpdb->prefix}cart_tracking_wc_cart AS carts JOIN {$wpdb->prefix}cart_tracking_wc AS products ON carts.id = products.cart_number -
cart-tracking-for-woocommerce/trunk/cart-tracking.php
r3229904 r3252296 5 5 * Plugin URI: https://wpsimpleplugins.wordpress.com/ 6 6 * Description: Keep track of what people are adding or removing from their cart. See top added/removed products. 7 * Version: 1.0.1 67 * Version: 1.0.17 8 8 * Author: Simple Plugins 9 9 * Author URI: https://wpsimpleplugins.wordpress.com/ -
cart-tracking-for-woocommerce/trunk/readme.txt
r3229904 r3252296 4 4 Requires at least: 4.0 5 5 Tested up to: 6.7 6 Stable tag: 1.0.1 66 Stable tag: 1.0.17 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.