Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/clover-online-orders/admin/includes/class-moo-coupons-list.php
+++ b/clover-online-orders/admin/includes/class-moo-coupons-list.php
@@ -79,13 +79,20 @@
$delete_nonce = wp_create_nonce( 'moo_delete_coupon' );
$title = '<strong>' . stripslashes($coupon['name']) . '</strong>';
+ // Sanitize reflected request values before building the row-action URLs.
+ // $paged must be an integer (absint blocks the reflected-XSS vector);
+ // $page is restricted to a slug; every href is additionally run through esc_url().
+ $page = isset($_REQUEST['page']) ? sanitize_key( $_REQUEST['page'] ) : '';
+ $paged = isset($_REQUEST['paged']) ? absint( $_REQUEST['paged'] ) : 0;
+ $code = urlencode( $coupon['code'] );
+
if($coupon['isEnabled']=="1")
- $actions['Disable'] = sprintf( '<a href="%s">Disable</a>', wp_nonce_url( admin_url('admin.php?page=' . ((isset($_REQUEST['page']))?sanitize_text_field($_REQUEST['page']):'') . '&paged=' . ((isset($_REQUEST['paged']))?intval($_REQUEST['paged']):'') . '&action=disable&coupon=' . urlencode($coupon['code'])), 'moo_disable_coupon_' . $coupon['code'] ) );
+ $actions['Disable'] = sprintf( '<a href="%s">Disable</a>', wp_nonce_url( admin_url( 'admin.php?page=' . $page . '&paged=' . $paged . '&action=disable&coupon=' . $code ), 'moo_disable_coupon_' . $coupon['code'] ) );
else
- $actions['Enable'] = sprintf( '<a href="%s">Enable</a>', wp_nonce_url( admin_url('admin.php?page=' . ((isset($_REQUEST['page']))?sanitize_text_field($_REQUEST['page']):'') . '&paged=' . ((isset($_REQUEST['paged']))?intval($_REQUEST['paged']):'') . '&action=enable&coupon=' . urlencode($coupon['code'])), 'moo_enable_coupon_' . $coupon['code'] ) );
+ $actions['Enable'] = sprintf( '<a href="%s">Enable</a>', wp_nonce_url( admin_url( 'admin.php?page=' . $page . '&paged=' . $paged . '&action=enable&coupon=' . $code ), 'moo_enable_coupon_' . $coupon['code'] ) );
- $actions['Edit'] = sprintf( '<a href="?page=%s&paged=%s&action=%s&coupon=%s">Edit</a>', ((isset($_REQUEST['page']))?$_REQUEST['page']:''), ((isset($_REQUEST['paged']))?sanitize_text_field($_REQUEST['paged']):''), 'edit_coupon',urlencode( $coupon['code']) );
- $actions['Delete'] = sprintf( '<a onclick="mooDeleteCoupon(event)" href="?page=%s&paged=%s&action=%s&coupon=%s&_wpnonce=%s">Delete</a>',((isset($_REQUEST['page']))?sanitize_text_field($_REQUEST['page']):''),((isset($_REQUEST['paged']))?$_REQUEST['paged']:''), 'delete',urlencode($coupon['code']), $delete_nonce );
+ $actions['Edit'] = sprintf( '<a href="%s">Edit</a>', esc_url( sprintf('?page=%s&paged=%s&action=%s&coupon=%s', $page, $paged, 'edit_coupon', $code) ) );
+ $actions['Delete'] = sprintf( '<a onclick="mooDeleteCoupon(event)" href="%s">Delete</a>', esc_url( sprintf('?page=%s&paged=%s&action=%s&coupon=%s&_wpnonce=%s', $page, $paged, 'delete', $code, $delete_nonce) ) );
return
sprintf( '%s',$title) . $this->row_actions( $actions );
--- a/clover-online-orders/admin/includes/class-moo-orders-list.php
+++ b/clover-online-orders/admin/includes/class-moo-orders-list.php
@@ -49,10 +49,12 @@
$title = $order["uuid"];
}
return
- sprintf( '<a href="?page=%s&action=%s&order_uuid=%s">%s</a>',
- ((isset($_REQUEST['page']))?sanitize_text_field($_REQUEST['page']):''),
- 'show_order_detail',
- $order['uuid'],
+ sprintf( '<a href="%s">%s</a>',
+ esc_url( sprintf( '?page=%s&action=%s&order_uuid=%s',
+ ((isset($_REQUEST['page']))?sanitize_key($_REQUEST['page']):''),
+ 'show_order_detail',
+ urlencode($order['uuid'])
+ ) ),
$title
);
}
--- a/clover-online-orders/admin/includes/class-moo-products-list.php
+++ b/clover-online-orders/admin/includes/class-moo-products-list.php
@@ -15,19 +15,19 @@
$this->api = new Moo_OnlineOrders_SooApi();
$this->itemsPageUrl = admin_url('admin.php?page=moo_items');
- /** Process bulk action */
- $this->process_bulk_action();
- $this->getAllCustomHours();
- $this->getAllImages();
- $this->placeholderImg = plugin_dir_url(dirname(__FILE__))."img/placeholder-150x150.png";
- $this->editIcon = plugin_dir_url(dirname(__FILE__))."img/edit-icon.png";
-
parent::__construct( array(
'singular' => __( 'Item',"moo_OnlineOrders"), //singular name of the listed records
'plural' => __( 'Items',"moo_OnlineOrders"), //plural name of the listed records
'ajax' => false //should this table support ajax?
) );
+
+ /** Process bulk action */
+ $this->process_bulk_action();
+ $this->getAllCustomHours();
+ $this->getAllImages();
+ $this->placeholderImg = plugin_dir_url(dirname(__FILE__))."img/placeholder-150x150.png";
+ $this->editIcon = plugin_dir_url(dirname(__FILE__))."img/edit-icon.png";
}
/**
* Retrieve item’s data from the database
@@ -434,6 +434,10 @@
$this->items = $this->get_items( $per_page, $current_page );
}
public function process_bulk_action() {
+ // Verify the bulk-action nonce before running any bulk action. Only checked
+ // when a bulk action is actually being processed so normal page loads (which
+ // carry no bulk nonce) are unaffected. The nonce name must match the one WP
+ // emits via wp_nonce_field('bulk-' . $this->_args['plural']) in the table form.
$action = $this->current_action();
$bulkActions = array( 'bulk-hide', 'bulk-show', 'bulk-enable-ot', 'bulk-disable-ot', 'bulk-feature', 'bulk-unfeature' );
if ( $action && in_array( $action, $bulkActions, true ) ) {
--- a/clover-online-orders/admin/moo-OnlineOrders-admin.php
+++ b/clover-online-orders/admin/moo-OnlineOrders-admin.php
@@ -940,6 +940,34 @@
<div class="fromToSection"></div>
<div>You can change this from the Holidays section or pause ordering on your POS.</div>
</div>
+ <div class="Moo_option-item" style="display: none">
+ <div class="moo-col-md-8">
+ <h4>Sync Clover Online Names and descriptions</h4>
+ </div>
+ <div class="moo-col-md-2">
+ <div class="soo-onoffswitch" title="Enable or disable the new checkout" style="float: right">
+ <input type="checkbox" name="sooApplePayFeature" id="sooApplePayFeature" class="soo-onoffswitch-checkbox" onchange="enableOrDisableApplePay()" <?php echo $isApplePayEnabled?'checked':''; ?> >
+ <label class="soo-onoffswitch-label" for="sooApplePayFeature">
+ <span class="soo-onoffswitch-inner"></span>
+ <span class="soo-onoffswitch-switch"></span>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="Moo_option-item" style="display: none">
+ <div class="moo-col-md-8">
+ <h4>Sync Clover Items Images</h4>
+ </div>
+ <div class="moo-col-md-2">
+ <div class="soo-onoffswitch" title="Enable or disable the new checkout" style="float: right">
+ <input type="checkbox" name="sooApplePayFeature" id="sooApplePayFeature" class="soo-onoffswitch-checkbox" onchange="enableOrDisableApplePay()" <?php echo $isApplePayEnabled?'checked':''; ?> >
+ <label class="soo-onoffswitch-label" for="sooApplePayFeature">
+ <span class="soo-onoffswitch-inner"></span>
+ <span class="soo-onoffswitch-switch"></span>
+ </label>
+ </div>
+ </div>
+ </div>
</div>
<div class="moo-col-md-2"></div>
</div>
@@ -1044,17 +1072,17 @@
<img width="80px" src="<?php echo plugin_dir_url(dirname(__FILE__))."admin/img/iconSooNew.svg";?>" alt=""/>
</div>
<div class="moo-col-md-8">
- <h3 style="margin-bottom: 5px"><?php _e("Settings Source","moo_OnlineOrders"); ?></h3>
+ <h3 style="margin-bottom: 5px"><?php _e("Enable Centralized Settings","moo_OnlineOrders"); ?></h3>
<div>
- <?php _e("Choose where checkout settings (hours, lead time, ASAP, scheduled orders, fraud tools) come from.", "moo_OnlineOrders"); ?>
+ <?php _e("Manage your settings from one central dashboard.", "moo_OnlineOrders"); ?>
<br>
- <strong><?php _e("Global Dashboard","moo_OnlineOrders"); ?></strong>: <?php _e("managed centrally for your business group.", "moo_OnlineOrders"); ?>
+ <strong><?php _e("On","moo_OnlineOrders"); ?></strong>: <?php _e("settings come from your central dashboard, so all the websites and apps for this location use the same settings. The matching options become read-only here.", "moo_OnlineOrders"); ?>
<br>
- <strong><?php _e("Customized","moo_OnlineOrders"); ?></strong>: <?php _e("managed locally in this plugin admin.", "moo_OnlineOrders"); ?>
+ <strong><?php _e("Off","moo_OnlineOrders"); ?></strong>: <?php _e("settings are managed right here in the plugin admin and apply to this website only.", "moo_OnlineOrders"); ?>
</div>
</div>
<div class="moo-col-md-2">
- <div class="soo-onoffswitch" title="<?php esc_attr_e('Use global dashboard settings', 'moo_OnlineOrders'); ?>" style="float: right;margin-top: 38px;margin-right: 20px;">
+ <div class="soo-onoffswitch" title="<?php esc_attr_e('Enable centralized settings', 'moo_OnlineOrders'); ?>" style="float: right;margin-top: 38px;margin-right: 20px;">
<input type="checkbox" name="sooSettingsSourceFeature" id="sooSettingsSourceFeature" class="soo-onoffswitch-checkbox" onchange="enableOrDisableGlobalSettings()" <?php echo $settingsSourceMode === 'global' ? 'checked' : ''; ?>>
<label class="soo-onoffswitch-label" for="sooSettingsSourceFeature">
<span class="soo-onoffswitch-inner"></span>
@@ -1222,34 +1250,6 @@
</div>
</div>
</div>
- <div class="Moo_option-item" style="display: none">
- <div class="moo-col-md-8">
- <h4>Sync Clover Online Names and descriptions</h4>
- </div>
- <div class="moo-col-md-2">
- <div class="soo-onoffswitch" title="Enable or disable the new checkout" style="float: right">
- <input type="checkbox" name="sooApplePayFeature" id="sooApplePayFeature" class="soo-onoffswitch-checkbox" onchange="enableOrDisableApplePay()" <?php echo $isApplePayEnabled?'checked':''; ?> >
- <label class="soo-onoffswitch-label" for="sooApplePayFeature">
- <span class="soo-onoffswitch-inner"></span>
- <span class="soo-onoffswitch-switch"></span>
- </label>
- </div>
- </div>
- </div>
- <div class="Moo_option-item" style="display: none">
- <div class="moo-col-md-8">
- <h4>Sync Clover Items Images</h4>
- </div>
- <div class="moo-col-md-2">
- <div class="soo-onoffswitch" title="Enable or disable the new checkout" style="float: right">
- <input type="checkbox" name="sooApplePayFeature" id="sooApplePayFeature" class="soo-onoffswitch-checkbox" onchange="enableOrDisableApplePay()" <?php echo $isApplePayEnabled?'checked':''; ?> >
- <label class="soo-onoffswitch-label" for="sooApplePayFeature">
- <span class="soo-onoffswitch-inner"></span>
- <span class="soo-onoffswitch-switch"></span>
- </label>
- </div>
- </div>
- </div>
</div>
<div id="mooAutoSyncDeactivated" class="Moo_option-item mooAutoSyncSection" style="display: none">
@@ -1306,15 +1306,11 @@
</div>
<div class="MooPanelItem">
<h3 style="font-size: 15px">Manual Sync "Use manual sync if changes have been made to your inventory and it hasn't synced"</h3>
- <div id="moo_progressbar_container"></div>
<div class="Moo_option-item">
<div class="button_center">
- <a href="#" onclick="MooPanel_UpdateItems(event)" class="button button-secondary"
- style="margin-left: 30px;" >Update all Items</a>
- <a href="#" onclick="MooPanel_UpdateCategories(event)" class="button button-secondary">Update Categories</a>
- <a href="#" onclick="MooPanel_UpdateModifiers(event)" class="button button-secondary">Update Modifiers</a>
- <a href="#" onclick="MooPanel_UpdateOrderTypes(event)" class="button button-secondary">Update Order Types</a>
- <a href="#" onclick="MooPanel_UpdateTaxes(event)" class="button button-secondary">Update Taxes</a>
+ <a href="#" onclick="MooPanel_SyncAll(event)" class="button button-secondary"
+ title="Syncs Items, Categories, Modifiers, Order Types & Taxes" style="margin-left: 30px;">Sync All</a>
+ <p class="description">Updates Items, Categories, Modifiers, Order Types & Taxes</p>
</div>
</div>
@@ -3573,7 +3569,7 @@
wp_register_style( 'moo-grid-css', plugin_dir_url(dirname(__FILE__)) . "public/css/dist/grid12.min.css", array(), $this->version);
wp_enqueue_style( 'moo-grid-css' );
- wp_enqueue_style( 'moo-OnlineOrders-admin-css', plugin_dir_url( __FILE__ ).'css/moo-OnlineOrders-admin.css', array(), $this->version, 'all');
+ wp_enqueue_style( 'moo-OnlineOrders-admin-css', plugin_dir_url( __FILE__ ).'css/moo-OnlineOrders-admin.css', array(), filemtime(plugin_dir_path(__FILE__).'css/moo-OnlineOrders-admin.css'), 'all');
wp_enqueue_style( 'moo-OnlineOrders-admin-small-devices-css', plugin_dir_url( __FILE__ ).'css/moo-OnlineOrders-admin-small-devices.css', array(), $this->version, 'only screen and (max-device-width: 1200px)');
wp_enqueue_style( 'moo-OnlineOrders-dashboard-css', plugin_dir_url( __FILE__ ).'css/moo-dashboard.css', array(), $this->version,'all');
@@ -3656,7 +3652,7 @@
//wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/moo-OnlineOrders-admin.js', array( 'jquery' ), $this->version, false );
wp_register_script('moo-google-map', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBv1TkdxvWkbFaDz2r0Yx7xvlNKe-2uyRc&libraries=drawing&geometry');
- wp_register_script('moo-publicAdmin-js', plugins_url( 'js/moo-OnlineOrders-admin.js', __FILE__ ),array('moo-google-map'), $this->version);
+ wp_register_script('moo-publicAdmin-js', plugins_url( 'js/moo-OnlineOrders-admin.js', __FILE__ ),array('moo-google-map'), filemtime(plugin_dir_path(__FILE__).'js/moo-OnlineOrders-admin.js'));
wp_add_inline_script(
'moo-publicAdmin-js',
'var sooGlobalModeActive = ' . (SooSettingsSource::current() === 'global' ? 'true' : 'false') . ';',
@@ -3669,7 +3665,7 @@
wp_register_script('moo-progressbar-js', plugins_url( 'js/progressbar.min.js', __FILE__ ));
wp_register_script('moo-map-js', plugins_url( 'js/moo_map.js', __FILE__ ),array('jquery'), $this->version);
- wp_register_script('moo-map-da', plugins_url( 'js/moo_map_da.js', __FILE__ ),array('jquery'), $this->version);
+ wp_register_script('moo-map-da', plugins_url( 'js/moo_map_da.js', __FILE__ ),array('jquery'), filemtime(plugin_dir_path(__FILE__).'js/moo_map_da.js'));
wp_register_script('moo-magnific-modal', plugin_dir_url(dirname(__FILE__))."public/js/dist/magnific.min.js",array('jquery'));
wp_enqueue_script('moo-magnific-modal');
--- a/clover-online-orders/includes/moo-OnlineOrders-activator.php
+++ b/clover-online-orders/includes/moo-OnlineOrders-activator.php
@@ -538,7 +538,7 @@
array("name"=>"custom_sa_content","value"=>""),
array("name"=>"custom_sa_title","value"=>""),
array("name"=>"custom_sa_onCheckoutPage","value"=>"off"),
- array("name"=>"copyrights","value"=>'Powered by <a href="https://wordpress.org/plugins/clover-online-orders/" target="_blank" title="Online Orders for Clover POS v 1.6.1">Smart Online Order</a>'),
+ array("name"=>"copyrights","value"=>'Powered by <a href="https://wordpress.org/plugins/clover-online-orders/" target="_blank" title="Online Orders for Clover POS v 1.6.2">Smart Online Order</a>'),
array("name"=>"default_style","value"=>"onePage"),
array("name"=>"track_stock","value"=>""),
array("name"=>"track_stock_hide_items","value"=>"off"),
--- a/clover-online-orders/includes/moo-OnlineOrders-helpers.php
+++ b/clover-online-orders/includes/moo-OnlineOrders-helpers.php
@@ -232,7 +232,7 @@
array("name"=>"custom_sa_content","value"=>""),
array("name"=>"custom_sa_title","value"=>""),
array("name"=>"custom_sa_onCheckoutPage","value"=>"off"),
- array("name"=>"copyrights","value"=>'Powered by <a href="https://wordpress.org/plugins/clover-online-orders/" target="_blank" title="Online Orders for Clover POS v 1.6.1">Smart Online Order</a>'),
+ array("name"=>"copyrights","value"=>'Powered by <a href="https://wordpress.org/plugins/clover-online-orders/" target="_blank" title="Online Orders for Clover POS v 1.6.2">Smart Online Order</a>'),
array("name"=>"default_style","value"=>"onePage"),
array("name"=>"track_stock","value"=>""),
array("name"=>"track_stock_hide_items","value"=>"off"),
--- a/clover-online-orders/includes/settings/SooDashboardSummary.php
+++ b/clover-online-orders/includes/settings/SooDashboardSummary.php
@@ -83,7 +83,7 @@
</div>
<div class="soo-dash-banner-actions">
<a href="<?php echo esc_url(add_query_arg('soo_refresh', time())); ?>" class="button"><?php _e('Refresh', 'moo_OnlineOrders'); ?></a>
- <a href="https://smartonlineorder.com/dashboard" target="_blank" class="button button-primary"><?php _e('Open Dashboard →', 'moo_OnlineOrders'); ?></a>
+ <a href="https://dashboard.smartonlineorder.com/" target="_blank" class="button button-primary"><?php _e('Open Dashboard →', 'moo_OnlineOrders'); ?></a>
</div>
</div>
<?php
--- a/clover-online-orders/includes/shortcodes/checkoutPage.php
+++ b/clover-online-orders/includes/shortcodes/checkoutPage.php
@@ -2558,7 +2558,7 @@
$this->enqueueSweetAlerts11Js();
//New Checkout JS
- wp_register_script('sooCheckoutScript', SOO_PLUGIN_URL . '/public/js/dist/sooCheckout.min.js', array('jquery','sooCloverSdk','SooSweetalerts'), SOO_VERSION);
+ wp_register_script('sooCheckoutScript', SOO_PLUGIN_URL . '/public/js/dist/sooCheckout.min.js', array('jquery','sooCloverSdk','SooSweetalerts'), filemtime(SOO_PLUGIN_PATH . '/public/js/dist/sooCheckout.min.js'));
wp_enqueue_script('sooCheckoutScript');
//Soo Auth Module
@@ -2573,7 +2573,7 @@
} else {
//Checkout JS
- wp_register_script('sooCheckoutScript', SOO_PLUGIN_URL . '/public/js/dist/moo_checkout.min.js', array('jquery','sooCloverSdk'), SOO_VERSION);
+ wp_register_script('sooCheckoutScript', SOO_PLUGIN_URL . '/public/js/dist/moo_checkout.min.js', array('jquery','sooCloverSdk'), filemtime(SOO_PLUGIN_PATH . '/public/js/dist/moo_checkout.min.js'));
wp_enqueue_script('sooCheckoutScript');
wp_register_script('moo-icheck-js', SOO_PLUGIN_URL . '/public/js/dist/icheck.min.js', array('jquery'), SOO_VERSION);
--- a/clover-online-orders/moo_OnlineOrders.php
+++ b/clover-online-orders/moo_OnlineOrders.php
@@ -16,7 +16,7 @@
* Plugin Name: Smart Online Order for Clover
* Plugin URI: https://www.zaytech.com
* Description: Start taking orders from your Wordpress website and have them sent to your Clover Station
- * Version: 1.6.1
+ * Version: 1.6.2
* Author: Zaytech
* Author URI: https://www.zaytech.com
* License: GPLv2 or later
@@ -37,7 +37,7 @@
define('SOO_PLUGIN_PATH', untrailingslashit(plugin_dir_path(__FILE__)));
define('SOO_ENV', 'PROD');
define('SOO_DEFAULT_CDN', false);
-define('SOO_VERSION', "1.6.1");
+define('SOO_VERSION', "1.6.2");
define('SOO_G_RECAPTCHA_URL', 'https://www.google.com/recaptcha/api/siteverify');
define('SOO_DEBUG', false);
--- a/clover-online-orders/public/moo-OnlineOrders-public.php
+++ b/clover-online-orders/public/moo-OnlineOrders-public.php
@@ -749,7 +749,7 @@
if (! current_user_can( 'manage_options' ) ){
return false;
}
- $page = sanitize_text_field($_POST['page']);
+ $page = isset($_POST['page']) ? sanitize_text_field($_POST['page']) : 0;
if($page < 0 || !is_numeric($page)) {
$page = 0;
}
@@ -1236,8 +1236,8 @@
if (! current_user_can( 'manage_options' ) ){
return false;
}
- $page = sanitize_text_field($_POST['page']);
- $per_page = sanitize_text_field($_POST['per_page']);
+ $page = isset($_POST['page']) ? sanitize_text_field($_POST['page']) : 0;
+ $per_page = isset($_POST['per_page']) ? sanitize_text_field($_POST['per_page']) : null;
if($page < 0 || !is_numeric($page)) {
$page = 0;