Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/points-and-rewards-for-woocommerce/admin/class-points-rewards-for-woocommerce-admin.php
+++ b/points-and-rewards-for-woocommerce/admin/class-points-rewards-for-woocommerce-admin.php
@@ -128,6 +128,7 @@
return;
}
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Safe read-only page parameter check.
$page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
$is_settings_screen = ( 'wps-rwpr-setting' === $page ) || ( 'woocommerce_page_wps-rwpr-setting' === $screen->id );
@@ -248,9 +249,11 @@
);
// user report work.
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Safe read-only user report display.
if ( isset( $_GET['user_id'] ) ) {
- $user_id = ! empty( $_GET['user_id'] ) ? sanitize_text_field( wp_unslash( $_GET['user_id'] ) ) : '';
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Safe read-only user report display, already checked above.
+ $user_id = ! empty( $_GET['user_id'] ) ? sanitize_text_field( wp_unslash( $_GET['user_id'] ) ) : '';
$user_data = $this->wps_wpr_get_user_reports_data( $user_id );
// js for the multistep from.
$script_asset_path = WPS_RWPR_DIR_PATH . 'build/index.asset.php';
@@ -670,6 +673,9 @@
*/
public function wps_wpr_select_category() {
check_ajax_referer( 'wps-wpr-verify-nonce', 'wps_nonce' );
+ if ( ! current_user_can( 'manage_woocommerce' ) ) {
+ wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'points-and-rewards-for-woocommerce' ) );
+ }
$wps_wpr_categ_list = array();
if ( isset( $_POST['wps_wpr_categ_list'] ) && ! empty( $_POST['wps_wpr_categ_list'] ) ) {
$wps_wpr_categ_list = map_deep( wp_unslash( $_POST['wps_wpr_categ_list'] ), 'sanitize_text_field' );
@@ -1814,6 +1820,9 @@
public function wps_wpr_restrict_user_from_points_table() {
check_ajax_referer( 'wps-wpr-verify-nonce', 'wps_nonce' );
+ if ( ! current_user_can( 'manage_woocommerce' ) ) {
+ wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'points-and-rewards-for-woocommerce' ) );
+ }
$checked = ! empty( $_POST['checked'] ) ? sanitize_text_field( wp_unslash( $_POST['checked'] ) ) : 'no';
$user_id = ! empty( $_POST['user_id'] ) ? sanitize_text_field( wp_unslash( $_POST['user_id'] ) ) : 0;
if ( 'yes' === $checked ) {
@@ -2146,6 +2155,7 @@
*/
public function wps_update_points_of_users( $wps_user_email, $wps_user_points, $import_points_reason ) {
$user = get_user_by( 'email', $wps_user_email );
+ // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce verified in calling function (CSV import handler).
$wps_wpr_export_table_option = ! empty( $_POST['wps_wpr_export_table_option'] ) ? sanitize_text_field( wp_unslash( $_POST['wps_wpr_export_table_option'] ) ) : 'add';
if ( isset( $user ) ) {
@@ -2568,6 +2578,9 @@
public function wps_wpr_sync_points_on_klaviyo_call() {
check_ajax_referer( 'wps-wpr-verify-nonce', 'wps_nonce' );
+ if ( ! current_user_can( 'manage_woocommerce' ) ) {
+ wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'points-and-rewards-for-woocommerce' ) );
+ }
if ( isset( $_POST ) ) {
$per_user = ! empty( $_POST['per_user'] ) ? sanitize_text_field( wp_unslash( $_POST['per_user'] ) ) : 0;
@@ -2655,10 +2668,13 @@
* @return void
*/
public function wps_wpr_set_camp_heading_and_image() {
-
+
// Verify the nonce for security.
check_ajax_referer( 'wps-wpr-verify-nonce', 'wps_nonce' );
-
+ if ( ! current_user_can( 'manage_woocommerce' ) ) {
+ wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'points-and-rewards-for-woocommerce' ) );
+ }
+
// Sanitize the incoming values.
$banner_heading = isset( $_POST['banner_heading'] ) ? sanitize_text_field( wp_unslash( $_POST['banner_heading'] ) ) : '';
$banner_image = isset( $_POST['banner_image'] ) ? esc_url_raw( wp_unslash( $_POST['banner_image'] ) ) : '';
--- a/points-and-rewards-for-woocommerce/admin/partials/points-rewards-for-woocommerce-admin-display.php
+++ b/points-and-rewards-for-woocommerce/admin/partials/points-rewards-for-woocommerce-admin-display.php
@@ -81,6 +81,7 @@
$wps_wpr_setting_tab = apply_filters( 'wps_rwpr_add_setting_tab', $wps_wpr_setting_tab );
$wps_wpr_plugin_version = 'v' . REWARDEEM_WOOCOMMERCE_POINTS_REWARDS_VERSION;
$wps_wpr_plugin_name = apply_filters( 'wps_wpr_pro_plugin_name', /* translators: %s: org name */ sprintf( '%s <span>%s</span>', esc_html__( 'Points and Rewards for WooCommerce', 'points-and-rewards-for-woocommerce' ), esc_html( $wps_wpr_plugin_version ) ) );
+// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Safe read-only tab navigation parameter.
$wps_wpr_tabs = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : '';
// check if user is admin.
--- a/points-and-rewards-for-woocommerce/admin/partials/templates/wps-generral-settings2.php
+++ b/points-and-rewards-for-woocommerce/admin/partials/templates/wps-generral-settings2.php
@@ -320,8 +320,8 @@
'class' => 'text_points wps_wpr_new_woo_ver_style_text',
'desc' => apply_filters( 'wps_wpr_order_rewards_message_desc', __( 'Use these shortcodes to provide an appropriate message for your customers on his no. of [ORDER] and get rewards points [POINTS]', 'points-and-rewards-for-woocommerce' ) ),
'desc_tip' => __( 'Entered message will appears on Cart Page.', 'points-and-rewards-for-woocommerce' ),
- /* translators: 1: reward points, 2: number of orders. */
- 'default' => apply_filters( 'wps_wpr_order_rewards_message_default', __( 'Hurry up! You will get %s points if you place %s orders.', 'points-and-rewards-for-woocommerce' ) ),
+ /* translators: %1$s: reward points, %2$s: number of orders. */
+ 'default' => apply_filters( 'wps_wpr_order_rewards_message_default', __( 'Hurry up! You will get %1$s points if you place %2$s orders.', 'points-and-rewards-for-woocommerce' ) ),
),
array(
'type' => 'sectionend',
--- a/points-and-rewards-for-woocommerce/includes/class-points-rewards-for-woocommerce-talk-to-expert-form.php
+++ b/points-and-rewards-for-woocommerce/includes/class-points-rewards-for-woocommerce-talk-to-expert-form.php
@@ -631,9 +631,8 @@
return false;
}
- $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $table_name );
-
- return $table_name === (string) $wpdb->get_var( $query );
+ // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared
+ return $table_name === (string) $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table_name ) );
}
/**
@@ -653,9 +652,9 @@
$start_date = gmdate( 'Y-m-d H:i:s', strtotime( '-12 months' ) );
$sql = "SELECT COALESCE(SUM(total_sales), 0) FROM {$table_name} WHERE parent_id = 0 AND date_paid IS NOT NULL AND date_paid != '0000-00-00 00:00:00' AND date_paid >= %s AND status IN ({$placeholders})";
$args = array_merge( array( $sql, $start_date ), $paid_statuses );
- $query = call_user_func_array( array( $wpdb, 'prepare' ), $args );
- return (float) $wpdb->get_var( $query );
+ // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter -- Query properly prepared with placeholders, call_user_func_array used for dynamic parameter count.
+ return (float) $wpdb->get_var( call_user_func_array( array( $wpdb, 'prepare' ), $args ) );
}
/**
--- a/points-and-rewards-for-woocommerce/includes/class-points-rewards-for-woocommerce.php
+++ b/points-and-rewards-for-woocommerce/includes/class-points-rewards-for-woocommerce.php
@@ -83,7 +83,7 @@
$this->version = REWARDEEM_WOOCOMMERCE_POINTS_REWARDS_VERSION;
} else {
- $this->version = '2.10.0';
+ $this->version = '2.10.1';
}
$this->plugin_name = 'points-and-rewards-for-woocommerce';
@@ -290,6 +290,8 @@
$this->loader->add_action( 'woocommerce_blocks_enqueue_cart_block_scripts_after', $plugin_public, 'wps_wpr_woocommerce_before_cart_contents' );
$this->loader->add_filter( 'woocommerce_cart_totals_fee_html', $plugin_public, 'wps_wpr_woocommerce_cart_totals_fee_html', 10, 2 );
$this->loader->add_action( 'wp_ajax_wps_wpr_remove_cart_point', $plugin_public, 'wps_wpr_remove_cart_point' );
+ $this->loader->add_action( 'wp_ajax_wps_wpr_get_redemption_state', $plugin_public, 'wps_wpr_get_redemption_state' );
+ $this->loader->add_action( 'wp_ajax_nopriv_wps_wpr_get_redemption_state', $plugin_public, 'wps_wpr_get_redemption_state' );
/*Apply points on the cart sub total*/
$this->loader->add_filter( 'wc_get_template', $plugin_public, 'wps_overwrite_form_temp', 10, 2 );
// cart block change.
@@ -321,8 +323,8 @@
// custom_code.
$this->loader->add_action( 'wps_wpr_add_share_points', $plugin_public, 'wps_wpr_add_wallet_generation', 10, 1 );
+ // Security: Only allow authenticated users to convert points to wallet (removed nopriv hook).
$this->loader->add_action( 'wp_ajax_wps_wpr_generate_custom_wallet', $plugin_public, 'wps_wpr_generate_custom_wallet' );
- $this->loader->add_action( 'wp_ajax_nopriv_wps_wpr_generate_custom_wallet', $plugin_public, 'wps_wpr_generate_custom_wallet' );
// Paypal Issue Change start.
$this->loader->add_filter( 'woocommerce_get_shop_coupon_data', $plugin_public, 'wps_wpr_validate_virtual_coupon_for_points', PHP_INT_MAX, 2 );
--- a/points-and-rewards-for-woocommerce/includes/class-wpswings-onboarding-helper.php
+++ b/points-and-rewards-for-woocommerce/includes/class-wpswings-onboarding-helper.php
@@ -689,6 +689,9 @@
public function wps_wpr_send_onboarding_data() {
check_ajax_referer( 'wps_onboarding_nonce', 'nonce' );
+ if ( ! current_user_can( 'manage_woocommerce' ) ) {
+ wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'points-and-rewards-for-woocommerce' ) );
+ }
$form_data = ! empty( $_POST['form_data'] ) ? map_deep( json_decode( sanitize_text_field( wp_unslash( $_POST['form_data'] ) ) ), 'sanitize_text_field' ) : '';
$formatted_data = array();
--- a/points-and-rewards-for-woocommerce/points-rewards-for-woocommerce.php
+++ b/points-and-rewards-for-woocommerce/points-rewards-for-woocommerce.php
@@ -14,7 +14,7 @@
* @wordpress-plugin
* Plugin Name: Points and Rewards for WooCommerce
* Description: <code><strong>Points and Rewards for WooCommerce</strong></code> plugin allow merchants to reward their loyal customers with referral rewards points on store activities. <a href="https://wpswings.com/woocommerce-plugins/?utm_source=wpswings-shop-page&utm_medium=par-org-backend&utm_campaign=more-plugin" target="_blank"> Elevate your e-commerce store by exploring more on <strong> WP Swings </strong></a>
- * Version: 2.10.0
+ * Version: 2.10.1
* Author: WP Swings
* Author URI: https://wpswings.com/?utm_source=wpswings-par-official&utm_medium=par-org-backend&utm_campaign=official
* Plugin URI: https://wordpress.org/plugins/points-and-rewards-for-woocommerce/
@@ -23,9 +23,9 @@
* Requires Plugins: woocommerce
*
* WP Requires at least : 6.7.0
- * WP Tested up to : 6.9.4
+ * WP Tested up to : 7.0
* WC requires at least : 6.5.0
- * WC tested up to : 10.7.0
+ * WC tested up to : 10.9.3
* Requires PHP : 7.4
*
* License: GNU General Public License v3.0
--- a/points-and-rewards-for-woocommerce/public/class-points-rewards-for-woocommerce-public.php
+++ b/points-and-rewards-for-woocommerce/public/class-points-rewards-for-woocommerce-public.php
@@ -126,7 +126,8 @@
$wps_wpr_others_settings = get_option( 'wps_wpr_other_settings', array() );
$wps_wpr_choose_account_page_temp = ! empty( $wps_wpr_others_settings['wps_wpr_choose_account_page_temp'] ) ? $wps_wpr_others_settings['wps_wpr_choose_account_page_temp'] : '';
if ( 'temp_four' === $wps_wpr_choose_account_page_temp ) {
- wp_enqueue_style( 'wps-t4-fonts', 'https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@700&display=swap', array(), null );
+ // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion -- External Google Fonts resource, versioned by Google.
+ wp_enqueue_style( 'wps-t4-fonts', 'https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@700&display=swap', array(), null );
$t4_css_file = 'public/css/wps-wpr-template-four-points-tab.css';
wp_enqueue_style( 'wps-t4-points-tab', WPS_RWPR_DIR_URL . $t4_css_file, array( 'wps-account-page-design', 'wps-t4-fonts' ), $this->wps_wpr_get_asset_version( $t4_css_file ), 'all' );
}
@@ -2588,6 +2589,30 @@
}
/**
+ * AJAX handler to get current cart redemption state.
+ * Returns redeemed points from session to restore UI after page reload.
+ *
+ * @name wps_wpr_get_redemption_state
+ * @since 2.10.1
+ * @author WP Swings <webmaster@wpswings.com>
+ * @link https://www.wpswings.com/
+ */
+ public function wps_wpr_get_redemption_state() {
+ check_ajax_referer( 'wps-wpr-verify-nonce', 'wps_nonce' );
+
+ $redeemed_points = 0;
+ if ( WC()->session ) {
+ $redeemed_points = (int) WC()->session->get( 'wps_cart_points', 0 );
+ }
+
+ wp_send_json_success(
+ array(
+ 'redeemed_points' => $redeemed_points,
+ )
+ );
+ }
+
+ /**
* This function is used to allow customer can apply points during checkout.
*
* @name wps_overwrite_form_temp
@@ -3475,7 +3500,7 @@
<p class="wps-wpr_enter-points-wrap">
<input type="number" placeholder="<?php esc_html_e( 'Enter your points:', 'points-and-rewards-for-woocommerce' ); ?>" class="woocommerce-Input woocommerce-Input--number input-number" name="wps_custom_number" min="1" id="wps_custom_wallet_point_num" style="width: 160px;">
- <input type="button" name="wps_wpr_custom_wallet" id= "wps_wpr_custom_wallet" class="wps_wpr_custom_wallet button" value="<?php esc_html_e( 'Redeem to Wallet', 'points-and-rewards-for-woocommerce' ); ?>" data-id="<?php echo esc_html( $user_id ); ?>">
+ <input type="button" name="wps_wpr_custom_wallet" id= "wps_wpr_custom_wallet" class="wps_wpr_custom_wallet button" value="<?php esc_html_e( 'Redeem to Wallet', 'points-and-rewards-for-woocommerce' ); ?>">
</p>
</form>
</fieldset>
@@ -3495,17 +3520,32 @@
check_ajax_referer( 'wps-wpr-verify-nonce', 'wps_nonce' );
$response['result'] = false;
$response['message'] = 'Sorry ! Not Transfered';
- if ( isset( $_POST['user_id'] ) && ! empty( $_POST['user_id'] ) && isset( $_POST['points'] ) && ! empty( $_POST['points'] ) ) {
- /*Get the the user id*/
- $user_id = sanitize_text_field( wp_unslash( $_POST['user_id'] ) );
- $points = sanitize_text_field( wp_unslash( $_POST['points'] ) );
+
+ // Security fix: Verify user is logged in before processing.
+ if ( ! is_user_logged_in() ) {
+ wp_send_json_error( array( 'message' => esc_html__( 'Not authorized.', 'points-and-rewards-for-woocommerce' ) ) );
+ }
+
+ // Security fix: Always use the authenticated user's ID, ignore caller-supplied user_id.
+ $user_id = get_current_user_id();
+
+ if ( isset( $_POST['points'] ) && ! empty( $_POST['points'] ) ) {
+ $points = absint( wp_unslash( $_POST['points'] ) );
+
+ // Validate points value.
+ if ( empty( $points ) || $points <= 0 ) {
+ wp_send_json_error( array( 'message' => esc_html__( 'Invalid points value.', 'points-and-rewards-for-woocommerce' ) ) );
+ }
+
/*Get all user points*/
$get_points = (int) get_user_meta( $user_id, 'wps_wpr_points', true );
- if ( empty( $points ) ) {
- $response['result'] = false;
- $response['message'] = esc_html__( 'Sorry ! Not Transfered', 'points-and-rewards-for-woocommerce' );
+
+ // Verify user has enough points.
+ if ( $get_points < $points ) {
+ wp_send_json_error( array( 'message' => esc_html__( 'Insufficient points balance.', 'points-and-rewards-for-woocommerce' ) ) );
}
- if ( $get_points >= $points && ! empty( $points ) ) {
+
+ if ( $get_points >= $points && $points > 0 ) {
$wps_points_par_value_wallet = $this->wps_wpr_get_general_settings_num( 'wps_wpr_wallet_points_rate' );
$wps_currency_par_value_wallet = $this->wps_wpr_get_general_settings_num( 'wps_wpr_wallet_price_rate' );
@@ -3513,10 +3553,8 @@
$prev_wps_mpr_data = get_user_meta( $user_id, 'wps_wallet', true );
$total_data_wps_par = $prev_wps_mpr_data + $wps_wpr_wallet_roundoff;
- $new_update_points = $get_points - $points;
- $response['result'] = true;
- $response['message'] = esc_html__( 'successfully transfered', 'points-and-rewards-for-woocommerce' );
- $points_log = get_user_meta( $user_id, 'points_details', true );
+ $new_update_points = $get_points - $points;
+ $points_log = get_user_meta( $user_id, 'points_details', true );
$points_log = ! empty( $points_log ) && is_array( $points_log ) ? $points_log : array();
if ( isset( $points_log['points_deduct_wallet'] ) && ! empty( $points_log['points_deduct_wallet'] ) ) {
@@ -3547,22 +3585,29 @@
'order_id' => '',
'note' => 'Through Points and rewards',
);
- if ( class_exists( 'Wallet_System_For_Woocommerce' ) ) {
-
- $wps_par_wallet_payment_gateway = new Wallet_System_For_Woocommerce();
- update_user_meta( $user_id, 'wps_wallet', $total_data_wps_par );
- update_user_meta( $user_id, 'wps_wpr_points', $new_update_points );
- update_user_meta( $user_id, 'points_details', $points_log );
- $wps_par_wallet_payment_gateway->insert_transaction_data_in_table( $transaction_data );
- // send sms.
- wps_wpr_send_sms_org( $user_id, /* translators: %s: sms msg */ sprintf( esc_html__( 'Your points have been successfully converted and added to your wallet account. Your wallet balance is now %1$s, and your total remaining points are %2$s', 'points-and-rewards-for-woocommerce' ), $total_data_wps_par, $new_update_points ) );
- // send messages on whatsapp.
- wps_wpr_send_messages_on_whatsapp( $user_id, /* translators: %s: sms msg */ sprintf( esc_html__( 'Your points have been successfully converted and added to your wallet account. Your wallet balance is now %1$s, and your total remaining points are %2$s', 'points-and-rewards-for-woocommerce' ), $total_data_wps_par, $new_update_points ) );
+ // Verify wallet system is available.
+ if ( ! class_exists( 'Wallet_System_For_Woocommerce' ) ) {
+ wp_send_json_error( array( 'message' => esc_html__( 'Wallet system is not available.', 'points-and-rewards-for-woocommerce' ) ) );
}
+
+ // Process the conversion.
+ $wps_par_wallet_payment_gateway = new Wallet_System_For_Woocommerce();
+ update_user_meta( $user_id, 'wps_wallet', $total_data_wps_par );
+ update_user_meta( $user_id, 'wps_wpr_points', $new_update_points );
+ update_user_meta( $user_id, 'points_details', $points_log );
+ $wps_par_wallet_payment_gateway->insert_transaction_data_in_table( $transaction_data );
+
+ // Send notifications.
+ wps_wpr_send_sms_org( $user_id, /* translators: %s: sms msg */ sprintf( esc_html__( 'Your points have been successfully converted and added to your wallet account. Your wallet balance is now %1$s, and your total remaining points are %2$s', 'points-and-rewards-for-woocommerce' ), $total_data_wps_par, $new_update_points ) );
+ wps_wpr_send_messages_on_whatsapp( $user_id, /* translators: %s: sms msg */ sprintf( esc_html__( 'Your points have been successfully converted and added to your wallet account. Your wallet balance is now %1$s, and your total remaining points are %2$s', 'points-and-rewards-for-woocommerce' ), $total_data_wps_par, $new_update_points ) );
+
+ // Send success response.
+ wp_send_json_success( array( 'message' => esc_html__( 'Successfully transferred', 'points-and-rewards-for-woocommerce' ) ) );
}
}
- wp_send_json( $response );
- wp_die();
+
+ // If we reach here, something went wrong.
+ wp_send_json_error( array( 'message' => esc_html__( 'An error occurred during the transfer.', 'points-and-rewards-for-woocommerce' ) ) );
}
/**
--- a/points-and-rewards-for-woocommerce/public/partials/wps-wpr-points-log-template.php
+++ b/points-and-rewards-for-woocommerce/public/partials/wps-wpr-points-log-template.php
@@ -1593,4 +1593,4 @@
if ( $wps_t4_log_is_active ) {
echo '</div><!-- /.wps-t4-log-wrap -->';
}
-?>
+?>
No newline at end of file
--- a/points-and-rewards-for-woocommerce/public/partials/wps-wpr-template-four-points-tab.php
+++ b/points-and-rewards-for-woocommerce/public/partials/wps-wpr-template-four-points-tab.php
@@ -693,7 +693,12 @@
<span class="wps-t4-nr-dot"></span>
<div class="wps-t4-nr-body">
<strong><?php esc_html_e( 'Get Points via Payment Method', 'points-and-rewards-for-woocommerce' ); ?></strong>
- <p><?php printf( esc_html__( 'Earn %1$s reward points when you choose %2$s at checkout.', 'points-and-rewards-for-woocommerce' ), esc_html( $wps_wpr_payment_method_rewards_points ), $gateway ? esc_html( $gateway->get_title() ) : '' ); ?></p>
+ <p>
+ <?php
+ /* translators: %1$s: Number of reward points, %2$s: Payment method name */
+ printf( esc_html__( 'Earn %1$s reward points when you choose %2$s at checkout.', 'points-and-rewards-for-woocommerce' ), esc_html( $wps_wpr_payment_method_rewards_points ), $gateway ? esc_html( $gateway->get_title() ) : '' );
+ ?>
+ </p>
</div>
</div>
<?php
--- a/points-and-rewards-for-woocommerce/public/partials/wps-wpr-template-three-points-tab.php
+++ b/points-and-rewards-for-woocommerce/public/partials/wps-wpr-template-three-points-tab.php
@@ -196,20 +196,21 @@
<span class="wps_wpr_view_log">
<a href="<?php echo esc_url( wc_get_endpoint_url( 'view-log' ) ); ?>"><?php esc_html_e( 'View Point Log', 'points-and-rewards-for-woocommerce' ); ?></a>
</span>
- </div>
- <?php
- // show points expiration time.
- if ( ! empty( $wps_user_point_expiry ) && $get_points > 0 ) {
- if ( 1 === $wps_wpr_points_exp_onmyaccount ) {
+ <?php
+
+ // show points expiration time.
+ if ( ! empty( $wps_user_point_expiry ) && $get_points > 0 ) {
+ if ( 1 == $wps_wpr_points_exp_onmyaccount ) {
- $date_format = get_option( 'date_format' );
- $expirydate_format = date_i18n( $date_format, strtotime( $wps_user_point_expiry ) );
- ?>
+ $date_format = get_option( 'date_format' );
+ $expirydate_format = date_i18n( $date_format, strtotime( $wps_user_point_expiry ) );
+ ?>
<div class="wps_wpr_points_expiry"><?php echo esc_html__( 'Expiring On : ', 'points-and-rewards-for-woocommerce' ) . esc_html( $expirydate_format ); ?></div>
- <?php
+ <?php
+ }
}
- }
- ?>
+ ?>
+ </div>
</div>
</div>
@@ -673,6 +674,10 @@
}
?>
</div>
+ <!-- Coupon section tab details -->
+ <div class="wps-p_masd-item wps-p_masd-i-coupon">
+ <?php do_action( 'wps_wpr_add_coupon_generation', $user_id ); ?>
+ </div>
<!-- Claim section tab details -->
<div class="wps-p_masd-item wps-p_masd-i-claim">
<div class="wps-par_ma-notice par-notice-error">
@@ -793,6 +798,12 @@
do_action( 'wps_extend_point_tab_section', $user_id );
?>
</div>
+
+ <!-- Share Points hook -->
+ <div class="wps_wpr_share_points_section">
+ <?php do_action( 'wps_wpr_add_share_points', $user_id ); ?>
+ </div>
+
<?php do_action( 'wps_par_extra_template_data' ); ?>
</div>
</div>