diff --git a/assets/js/page-views.js b/assets/js/page-views.js
new file mode 100644
index 0000000000..fa6aafebd4
--- /dev/null
+++ b/assets/js/page-views.js
@@ -0,0 +1,32 @@
+/*
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
+ * This devtool is neither made for production nor for readable output files.
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
+ * or disable the default devtool with "devtool: false".
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
+ */
+/******/ (() => { // webpackBootstrap
+/******/ var __webpack_modules__ = ({
+
+/***/ "./assets/src/js/page-views.js":
+/*!*************************************!*\
+ !*** ./assets/src/js/page-views.js ***!
+ \*************************************/
+/***/ (() => {
+
+eval("/* global dokanPageViewsParams */\n\njQuery(document).ready(function ($) {\n if (!localStorage) {\n return;\n }\n if (!window.dokanPageViewsParams) {\n return;\n }\n\n // Get today's date in the format of YYYY-MM-DD\n let newDate = new Date().toISOString().slice(0, 10);\n let dokanPageViewCount = JSON.parse(localStorage.getItem(\"dokan_pageview_count\"));\n\n // If there is no data in local storage or today's date is not same as the date in local storage.\n if (dokanPageViewCount === null || dokanPageViewCount.today && dokanPageViewCount.today !== newDate) {\n dokanPageViewCount = {\n \"today\": newDate,\n \"post_ids\": []\n };\n }\n\n // If the post id is not in the local storage, then send the ajax request.\n if (!dokanPageViewCount.post_ids.includes(window.dokanPageViewsParams.post_id)) {\n $.post(window.dokanPageViewsParams.ajax_url, {\n action: \"dokan_pageview\",\n _ajax_nonce: window.dokanPageViewsParams.nonce,\n post_id: window.dokanPageViewsParams.post_id\n });\n\n // Add the post id to the local storage.\n dokanPageViewCount.post_ids.push(window.dokanPageViewsParams.post_id);\n localStorage.setItem(\"dokan_pageview_count\", JSON.stringify(dokanPageViewCount));\n }\n});\n\n//# sourceURL=webpack://dokan/./assets/src/js/page-views.js?");
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/
+/******/ // startup
+/******/ // Load entry module and return exports
+/******/ // This entry module can't be inlined because the eval devtool is used.
+/******/ var __webpack_exports__ = {};
+/******/ __webpack_modules__["./assets/src/js/page-views.js"]();
+/******/
+/******/ })()
+;
\ No newline at end of file
diff --git a/assets/src/js/page-views.js b/assets/src/js/page-views.js
new file mode 100644
index 0000000000..9cba7aa6cd
--- /dev/null
+++ b/assets/src/js/page-views.js
@@ -0,0 +1,33 @@
+/* global dokanPageViewsParams */
+
+jQuery( document ).ready( function( $ ) {
+ if( ! localStorage ) {
+ return;
+ }
+
+ if ( ! window.dokanPageViewsParams ) {
+ return;
+ }
+
+ // Get today's date in the format of YYYY-MM-DD
+ let newDate = new Date().toISOString().slice(0, 10);
+ let dokanPageViewCount = JSON.parse(localStorage.getItem("dokan_pageview_count"));
+
+ // If there is no data in local storage or today's date is not same as the date in local storage.
+ if ( dokanPageViewCount === null || ( dokanPageViewCount.today && dokanPageViewCount.today !== newDate ) ) {
+ dokanPageViewCount = { "today": newDate, "post_ids": [] };
+ }
+
+ // If the post id is not in the local storage, then send the ajax request.
+ if ( ! dokanPageViewCount.post_ids.includes( window.dokanPageViewsParams.post_id ) ) {
+ $.post( window.dokanPageViewsParams.ajax_url, {
+ action: "dokan_pageview",
+ _ajax_nonce: window.dokanPageViewsParams.nonce,
+ post_id: window.dokanPageViewsParams.post_id,
+ } );
+
+ // Add the post id to the local storage.
+ dokanPageViewCount.post_ids.push( window.dokanPageViewsParams.post_id );
+ localStorage.setItem( "dokan_pageview_count", JSON.stringify( dokanPageViewCount ) );
+ }
+} );
diff --git a/includes/Admin/Hooks.php b/includes/Admin/Hooks.php
index 0543fd0b55..6c17da500c 100644
--- a/includes/Admin/Hooks.php
+++ b/includes/Admin/Hooks.php
@@ -96,7 +96,7 @@ class="dokan_product_author_override"
data-minimum_input_length="0"
data-data=''
>
-
+
@@ -732,9 +732,15 @@ public function dokan_setup_withdraw_save() {
$options = get_option( 'dokan_withdraw', [] );
$options['withdraw_methods'] = ! empty( $_POST['withdraw_methods'] ) ? wc_clean( wp_unslash( $_POST['withdraw_methods'] ) ) : [];
- $options['withdraw_limit'] = ! empty( $_POST['withdraw_limit'] ) ? (float) wc_format_decimal( sanitize_text_field( wp_unslash( $_POST['withdraw_limit'] ) ) ) < 0 ? 0 : wc_format_decimal( sanitize_text_field( wp_unslash( $_POST['withdraw_limit'] ) ) ) : 0;
$options['withdraw_order_status'] = ! empty( $_POST['withdraw_order_status'] ) ? wc_clean( wp_unslash( $_POST['withdraw_order_status'] ) ) : [];
+ if ( ! empty( $_POST['withdraw_limit'] ) ) {
+ $input_limit = sanitize_text_field( wp_unslash( $_POST['withdraw_limit'] ) );
+ $options['withdraw_limit'] = is_numeric( $input_limit ) && $input_limit >= 0 ? wc_format_decimal( $input_limit ) : 0;
+ } else {
+ $options['withdraw_limit'] = 0;
+ }
+
/**
* Filter dokan_withdraw options before saving in setup wizard
*
diff --git a/includes/Admin/SetupWizardNoWC.php b/includes/Admin/SetupWizardNoWC.php
index 71f1a1e10a..3c15210fe9 100644
--- a/includes/Admin/SetupWizardNoWC.php
+++ b/includes/Admin/SetupWizardNoWC.php
@@ -129,7 +129,7 @@ public function install_woocommerce() {
delete_transient( '_wc_activation_redirect' );
if ( is_wp_error( $installed ) ) {
- wp_die( $installed->get_error_message(), __( 'Error installing WooCommerce plugin', 'dokan-lite' ) );
+ wp_die( esc_html( $installed->get_error_message() ), esc_html__( 'Error installing WooCommerce plugin', 'dokan-lite' ) );
}
set_transient( 'dokan_setup_wizard_no_wc', true, 15 * MINUTE_IN_SECONDS );
diff --git a/includes/Ajax.php b/includes/Ajax.php
index 7b983a18f7..b7f93a7c52 100755
--- a/includes/Ajax.php
+++ b/includes/Ajax.php
@@ -265,8 +265,8 @@ public function grant_access_to_download() {
include dirname( __DIR__ ) . '/templates/orders/order-download-permission-html.php';
- $loop ++;
- $file_count ++;
+ ++$loop;
+ ++$file_count;
}
}
}
@@ -414,7 +414,7 @@ public function add_order_note() {
echo 'customer-note';
}
echo '">
';
- echo wpautop( wptexturize( $note ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( wpautop( wptexturize( $note ) ) );
echo '
' . esc_html__( 'Delete note', 'dokan-lite' ) . '
';
echo '';
}
@@ -484,7 +484,7 @@ public function add_shipping_tracking_info() {
echo '
';
- echo wpautop( wptexturize( $ship_info ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( wpautop( wptexturize( $ship_info ) ) );
echo '
' . esc_html__( 'Delete', 'dokan-lite' ) . '
';
echo '';
@@ -692,6 +692,7 @@ public function dokan_json_search_products_tags() {
$drop_down_tags = apply_filters(
'dokan_search_product_tags_for_vendor_products', [
+ 'taxonomy' => 'product_tag',
'name__like' => $name,
'hide_empty' => 0,
'orderby' => 'name',
@@ -701,7 +702,7 @@ public function dokan_json_search_products_tags() {
]
);
- $product_tags = get_terms( 'product_tag', $drop_down_tags );
+ $product_tags = get_terms( $drop_down_tags );
if ( $product_tags ) {
foreach ( $product_tags as $pro_term ) {
diff --git a/includes/Customizer/HeadingControl.php b/includes/Customizer/HeadingControl.php
index f8514a0da6..8d03622e32 100644
--- a/includes/Customizer/HeadingControl.php
+++ b/includes/Customizer/HeadingControl.php
@@ -28,7 +28,9 @@ protected function render_content() {
description ) ) { ?>
-
description; ?>
+
+ description ); ?>
+
id ) . esc_attr( $value ); ?>">
diff --git a/includes/Order/Admin/Hooks.php b/includes/Order/Admin/Hooks.php
index 1fc7e739bf..1e8631127c 100644
--- a/includes/Order/Admin/Hooks.php
+++ b/includes/Order/Admin/Hooks.php
@@ -158,7 +158,7 @@ public function shop_order_custom_columns( $col, $post_id ) {
}
if ( ! empty( $output ) ) {
- echo apply_filters( "dokan_manage_shop_order_custom_columns_{$col}", $output, $order );
+ echo wp_kses_post( apply_filters( "dokan_manage_shop_order_custom_columns_{$col}", $output, $order ) );
}
}
@@ -168,15 +168,15 @@ public function shop_order_custom_columns( $col, $post_id ) {
* @since 3.8.0 Moved from includes/Admin/Hooks.php file
* @since 3.8.0 Rewritten for HPOS
*
- * @param string[] $classes An array of post class names.
- * @param string[] $class An array of additional class names added to the post.
+ * @param string[] $classes An array of post class names.
+ * @param string[] $css_class An array of additional class names added to the post.
* @param int $post_id The post ID.
*
* @global WP_Post $post
*
* @return array
*/
- public function admin_shop_order_row_classes( $classes, $class, $post_id ) {
+ public function admin_shop_order_row_classes( $classes, $css_class, $post_id ) {
if ( ! OrderUtil::is_order( $post_id ) ) {
return $classes;
}
diff --git a/includes/PageViews.php b/includes/PageViews.php
index 028e9bca28..b20390887d 100755
--- a/includes/PageViews.php
+++ b/includes/PageViews.php
@@ -3,83 +3,84 @@
namespace WeDevs\Dokan;
/**
- * Pageviews - for counting product post views.
+ * Page views - for counting product post views.
*/
class PageViews {
- private $meta_key = 'pageview';
-
- public function __construct() {
- /* Registers the entry views extension scripts if we're on the correct page. */
- add_action( 'template_redirect', array( $this, 'load_views' ), 25 );
-
- /* Add the entry views AJAX actions to the appropriate hooks. */
- add_action( 'wp_ajax_dokan_pageview', array( $this, 'update_ajax' ) );
- add_action( 'wp_ajax_nopriv_dokan_pageview', array( $this, 'update_ajax' ) );
- }
-
- public function load_scripts() {
- $nonce = wp_create_nonce( 'dokan_pageview' );
-
- echo '';
- }
-
- public function load_views() {
- if ( is_singular( 'product' ) ) {
- global $post;
-
- if ( $post->post_author !== dokan_get_current_user_id() ) {
- wp_enqueue_script( 'jquery' );
- add_action( 'wp_footer', array( $this, 'load_scripts' ) );
- }
- }
- }
-
- public function update_view( $post_id = '' ) {
- if ( ! empty( $post_id ) ) {
- $old_views = get_post_meta( $post_id, $this->meta_key, true );
- $new_views = absint( $old_views ) + 1;
-
- update_post_meta( $post_id, $this->meta_key, $new_views, $old_views );
- $seller_id = get_post_field( 'post_author', $post_id );
- Cache::delete( "pageview_{$seller_id}" );
- }
- }
-
- public function update_ajax() {
- check_ajax_referer( 'dokan_pageview' );
-
- if ( isset( $_POST['post_id'] ) ) {
- $post_id = absint( $_POST['post_id'] );
- }
-
- if ( ! empty( $post_id ) ) {
- $this->update_view( $post_id );
- }
-
- wp_die();
- }
-
+ private $meta_key = 'pageview';
+
+ public function __construct() {
+ /* Registers the entry views extension scripts if we're on the correct page. */
+ add_action( 'template_redirect', array( $this, 'load_views' ), 25 );
+
+ /* Add the entry views AJAX actions to the appropriate hooks. */
+ add_action( 'wp_ajax_dokan_pageview', array( $this, 'update_ajax' ) );
+ add_action( 'wp_ajax_nopriv_dokan_pageview', array( $this, 'update_ajax' ) );
+ }
+
+ /**
+ * Load the scripts
+ *
+ * @return void
+ */
+ public function load_scripts() {
+ wp_enqueue_script( 'dokan-page-views', DOKAN_PLUGIN_ASSEST . '/js/page-views.js', array( 'jquery' ), DOKAN_PLUGIN_VERSION, true );
+ wp_localize_script(
+ 'dokan-page-views',
+ 'dokanPageViewsParams',
+ array(
+ 'nonce' => wp_create_nonce( 'dokan_pageview' ),
+ 'post_id' => get_the_ID(),
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
+ )
+ );
+ }
+
+ public function load_views() {
+ if ( is_singular( 'product' ) ) {
+ global $post;
+
+ if ( dokan_get_current_user_id() !== $post->post_author ) {
+ wp_enqueue_script( 'jquery' );
+ add_action( 'wp_footer', array( $this, 'load_scripts' ) );
+ }
+ }
+ }
+
+ /**
+ * Update the view count
+ *
+ * @param int $post_id The post ID
+ *
+ * @return void
+ */
+ public function update_view( $post_id = '' ) {
+ if ( ! empty( $post_id ) ) {
+ $old_views = get_post_meta( $post_id, $this->meta_key, true );
+ $new_views = absint( $old_views ) + 1;
+
+ update_post_meta( $post_id, $this->meta_key, $new_views, $old_views );
+ $seller_id = get_post_field( 'post_author', $post_id );
+ Cache::delete( "pageview_{$seller_id}" );
+ }
+ }
+
+ /**
+ * Update the view count via AJAX
+ *
+ * @return void
+ */
+ public function update_ajax() {
+ check_ajax_referer( 'dokan_pageview' );
+
+ if ( isset( $_POST['post_id'] ) ) {
+ $post_id = absint( $_POST['post_id'] );
+ }
+
+ if ( ! empty( $post_id ) ) {
+ $this->update_view( $post_id );
+ }
+
+ wp_die();
+ }
}
diff --git a/includes/REST/ProductController.php b/includes/REST/ProductController.php
index fbbd5df543..ee78d383e0 100644
--- a/includes/REST/ProductController.php
+++ b/includes/REST/ProductController.php
@@ -1197,24 +1197,24 @@ protected function prepare_object_for_database( $request, $creating = false ) {
/**
* Prepare links for the request.
*
- * @param WC_Data $object Object data.
- * @param WP_REST_Request $request Request object.
+ * @param WC_Data $data_object Object data.
+ * @param WP_REST_Request $request Request object.
*
- * @return array Links for the given post.
+ * @return array Links for the given post.
*/
- protected function prepare_links( $object, $request ) {
+ protected function prepare_links( $data_object, $request ) {
$links = [
'self' => [
- 'href' => rest_url( sprintf( '/%s/%s/%d', $this->namespace, $this->base, $object->get_id() ) ),
+ 'href' => rest_url( sprintf( '/%s/%s/%d', $this->namespace, $this->base, $data_object->get_id() ) ),
],
'collection' => [
'href' => rest_url( sprintf( '/%s/%s', $this->namespace, $this->base ) ),
],
];
- if ( $object->get_parent_id() ) {
+ if ( $data_object->get_parent_id() ) {
$links['up'] = [
- 'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $object->get_parent_id() ) ),
+ 'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $data_object->get_parent_id() ) ),
];
}
@@ -1343,9 +1343,7 @@ protected function get_attribute_taxonomy_name( $slug, $product ) {
// Taxonomy attribute name.
if ( $attribute->is_taxonomy() ) {
- $taxonomy = $attribute->get_taxonomy_object();
-
- return $taxonomy->attribute_label;
+ return $attribute->get_taxonomy_object()->attribute_label;
}
// Custom product attribute name.
@@ -1398,7 +1396,9 @@ protected function get_attribute_options( $product_id, $attribute ) {
'fields' => 'names',
]
);
- } elseif ( isset( $attribute['value'] ) ) {
+ }
+
+ if ( isset( $attribute['value'] ) ) {
return array_map( 'trim', explode( '|', $attribute['value'] ) );
}
@@ -1505,7 +1505,8 @@ protected function set_product_images( $product, $images ) {
if ( is_wp_error( $upload ) ) {
if ( ! apply_filters( 'woocommerce_rest_suppress_image_upload_error', false, $upload, $product->get_id(), $images ) ) {
- throw new WC_REST_Exception( 'woocommerce_product_image_upload_error', $upload->get_error_message(), 400 );
+ dokan_log( 'Error uploading image: ' . $upload->get_error_message() );
+ throw new WC_REST_Exception( 'woocommerce_product_image_upload_error', esc_html( $upload->get_error_message() ), 400 );
} else {
continue;
}
@@ -1514,9 +1515,9 @@ protected function set_product_images( $product, $images ) {
$attachment_id = wc_rest_set_uploaded_image_as_attachment( $upload, $product->get_id() );
}
- if ( ! wp_attachment_is_image( $attachment_id ) ) {
+ if ( $attachment_id && ! wp_attachment_is_image( $attachment_id ) ) {
/* translators: %s: attachment id */
- throw new WC_REST_Exception( 'woocommerce_product_invalid_image_id', sprintf( __( '#%s is an invalid image ID.', 'dokan-lite' ), $attachment_id ), 400 );
+ throw new WC_REST_Exception( 'woocommerce_product_invalid_image_id', sprintf( esc_html__( '#%s is an invalid image ID.', 'dokan-lite' ), esc_html( $attachment_id ) ), 400 );
}
if ( isset( $image['position'] ) && 0 === absint( $image['position'] ) ) {
@@ -2308,5 +2309,4 @@ public function get_item_schema() {
return $this->add_additional_fields_schema( $schema );
}
-
}
diff --git a/includes/ReverseWithdrawal/ReverseWithdrawal.php b/includes/ReverseWithdrawal/ReverseWithdrawal.php
index a7139ba0da..4d4ff4d32c 100644
--- a/includes/ReverseWithdrawal/ReverseWithdrawal.php
+++ b/includes/ReverseWithdrawal/ReverseWithdrawal.php
@@ -28,7 +28,7 @@ class ReverseWithdrawal {
*/
public function __clone() {
$message = ' Backtrace: ' . wp_debug_backtrace_summary();
- _doing_it_wrong( __METHOD__, $message . esc_html__( 'Cloning is forbidden.', 'dokan-lite' ), DOKAN_PLUGIN_VERSION );
+ _doing_it_wrong( __METHOD__, $message . esc_html__( 'Cloning is forbidden.', 'dokan-lite' ), DOKAN_PLUGIN_VERSION ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
@@ -38,7 +38,7 @@ public function __clone() {
*/
public function __wakeup() {
$message = ' Backtrace: ' . wp_debug_backtrace_summary();
- _doing_it_wrong( __METHOD__, $message . esc_html__( 'Unserializing instances of this class is forbidden.', 'dokan-lite' ), DOKAN_PLUGIN_VERSION );
+ _doing_it_wrong( __METHOD__, $message . esc_html__( 'Unserializing instances of this class is forbidden.', 'dokan-lite' ), DOKAN_PLUGIN_VERSION ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
diff --git a/includes/Traits/ChainableContainer.php b/includes/Traits/ChainableContainer.php
index 2b0d3a8288..55a39f7130 100644
--- a/includes/Traits/ChainableContainer.php
+++ b/includes/Traits/ChainableContainer.php
@@ -18,7 +18,7 @@ trait ChainableContainer {
*/
public function __clone() {
$message = ' Backtrace: ' . wp_debug_backtrace_summary();
- _doing_it_wrong( __METHOD__, $message . esc_html__( 'Cloning is forbidden.', 'dokan-lite' ), DOKAN_PLUGIN_VERSION );
+ _doing_it_wrong( __METHOD__, $message . esc_html__( 'Cloning is forbidden.', 'dokan-lite' ), DOKAN_PLUGIN_VERSION ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
@@ -28,7 +28,7 @@ public function __clone() {
*/
public function __wakeup() {
$message = ' Backtrace: ' . wp_debug_backtrace_summary();
- _doing_it_wrong( __METHOD__, $message . esc_html__( 'Unserializing instances of this class is forbidden.', 'dokan-lite' ), DOKAN_PLUGIN_VERSION );
+ _doing_it_wrong( __METHOD__, $message . esc_html__( 'Unserializing instances of this class is forbidden.', 'dokan-lite' ), DOKAN_PLUGIN_VERSION ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
diff --git a/includes/Widgets/BestSellingProducts.php b/includes/Widgets/BestSellingProducts.php
index a6963e1327..b519d6b515 100755
--- a/includes/Widgets/BestSellingProducts.php
+++ b/includes/Widgets/BestSellingProducts.php
@@ -37,9 +37,10 @@ public function widget( $args, $instance ) {
$r = dokan_get_best_selling_products( $no_of_product, $vendor_id, $paged, $hide_outofstock );
- echo $args['before_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['before_widget'] );
+
if ( ! empty( $title ) ) {
- echo $args['before_title'] . $title . $args['after_title']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] );
}
dokan_get_template_part(
@@ -49,7 +50,7 @@ public function widget( $args, $instance ) {
)
);
- echo $args['after_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['after_widget'] );
wp_reset_postdata();
}
diff --git a/includes/Widgets/FilterByAttributes.php b/includes/Widgets/FilterByAttributes.php
index 09978cab34..1045290d1b 100755
--- a/includes/Widgets/FilterByAttributes.php
+++ b/includes/Widgets/FilterByAttributes.php
@@ -38,9 +38,9 @@ public function widget( $args, $instance ) {
// load frontend script
wp_enqueue_script( 'dokan-frontend' );
- $taxonomy = $this->get_instance_taxonomy( $instance );
- $seller_id = empty( $seller_id ) ? get_query_var( 'author' ) : $seller_id;
- $vendor = dokan()->vendor->get( $seller_id );
+ $taxonomy = $this->get_instance_taxonomy( $instance );
+ $seller_id = empty( $seller_id ) ? get_query_var( 'author' ) : $seller_id;
+ $vendor = dokan()->vendor->get( $seller_id );
if ( ! $vendor instanceof Vendor ) {
return;
@@ -54,16 +54,17 @@ public function widget( $args, $instance ) {
$title = isset( $instance['title'] ) ? apply_filters( 'widget_title', $instance['title'] ) : '';
$query_type = isset( $instance['query_type'] ) ? apply_filters( 'widget_query_type', $instance['query_type'] ) : '';
- echo $args['before_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['before_widget'] );
+
if ( ! empty( $title ) ) {
- echo $args['before_title'] . $title . $args['after_title']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] );
}
$seller_id = empty( $seller_id ) ? get_query_var( 'author' ) : $seller_id;
dokan_store_term_menu_list( $seller_id, $taxonomy, $query_type );
- echo $args['after_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['after_widget'] );
wp_reset_postdata();
}
@@ -110,7 +111,7 @@ public function form( $instance ) {
-
+
$option_value ) : ?>
>
@@ -118,7 +119,7 @@ public function form( $instance ) {
-
+
$option_value ) : ?>
>
@@ -177,5 +178,4 @@ protected function get_instance_taxonomy( $instance ) {
return '';
}
-
}
diff --git a/includes/Widgets/ProductCategoryMenu.php b/includes/Widgets/ProductCategoryMenu.php
index 11e9f4e951..e5c2a0dcd1 100755
--- a/includes/Widgets/ProductCategoryMenu.php
+++ b/includes/Widgets/ProductCategoryMenu.php
@@ -23,8 +23,8 @@ public function __construct() {
/**
* Outputs the HTML for this widget.
*
- * @param array An array of standard parameters for widgets in this theme
- * @param array An array of settings for this widget instance
+ * @param array $args An array of standard parameters for widgets in this theme
+ * @param array $instance An array of settings for this widget instance
* @return void Echoes it's output
**/
public function widget( $args, $instance ) {
@@ -33,41 +33,42 @@ public function widget( $args, $instance ) {
$title = isset( $instance['title'] ) ? apply_filters( 'widget_title', $instance['title'] ) : '';
- echo $args['before_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['before_widget'] );
if ( ! empty( $title ) ) {
- echo $args['before_title'] . $title . $args['after_title']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] );
}
?>
'product_cat',
'hide_empty' => false,
'orderby' => 'name',
'depth' => 3,
)
);
- $categories = get_terms( 'product_cat', $term_args );
+ $categories = get_terms( $term_args );
$walker = new CategoryWalker();
echo '
';
- echo call_user_func_array( array( &$walker, 'walk' ), array( $categories, 0, array() ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( call_user_func_array( array( &$walker, 'walk' ), array( $categories, 0, array() ) ) );
echo ' ';
?>
__( 'Store Product Category', 'dokan-lite' ),
@@ -43,12 +43,12 @@ public function widget( $args, $instance ) {
$seller_id = (int) get_query_var( 'author' );
if ( ! empty( $title ) ) {
- echo $args['before_title'] . $title . $args['after_title']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] );
}
dokan_store_category_menu( $seller_id, $title );
- echo $args['after_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['after_widget'] );
}
do_action( 'dokan_widget_store_categories_render', $args, $instance, $this );
@@ -58,8 +58,8 @@ public function widget( $args, $instance ) {
* Deals with the settings when they are saved by the admin. Here is
* where any validation should be dealt with.
*
- * @param array An array of new settings as submitted by the admin
- * @param array An array of the previous settings
+ * @param array $new_instance An array of new settings as submitted by the admin
+ * @param array $old_instance An array of the previous settings
* @return array The validated and (if necessary) amended settings
**/
public function update( $new_instance, $old_instance ) {
@@ -72,7 +72,7 @@ public function update( $new_instance, $old_instance ) {
/**
* Displays the form for this widget on the Widgets page of the WP Admin area.
*
- * @param array An array of the current settings for this widget
+ * @param array $instance An array of the current settings for this widget
* @return void Echoes it's output
**/
public function form( $instance ) {
diff --git a/includes/Widgets/StoreContactForm.php b/includes/Widgets/StoreContactForm.php
index d8d1289e7a..f9d3d1e77d 100755
--- a/includes/Widgets/StoreContactForm.php
+++ b/includes/Widgets/StoreContactForm.php
@@ -29,8 +29,8 @@ public function __construct() {
/**
* Outputs the HTML for this widget.
*
- * @param array An array of standard parameters for widgets in this theme
- * @param array An array of settings for this widget instance
+ * @param array $args An array of standard parameters for widgets in this theme
+ * @param array $instance An array of settings for this widget instance
*
* @return void Echoes it's output
**/
@@ -59,10 +59,10 @@ public function widget( $args, $instance ) {
$store_info = dokan_get_store_info( $seller_id );
- echo $args['before_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['before_widget'] );
if ( ! empty( $title ) ) {
- echo $args['before_title'] . $title . $args['after_title']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] );
}
$username = '';
@@ -83,7 +83,7 @@ public function widget( $args, $instance ) {
)
);
- echo $args['after_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['after_widget'] );
}
do_action( 'dokan_widget_store_contact_form_render', $args, $instance, $this );
@@ -93,13 +93,12 @@ public function widget( $args, $instance ) {
* Deals with the settings when they are saved by the admin. Here is
* where any validation should be dealt with.
*
- * @param array An array of new settings as submitted by the admin
- * @param array An array of the previous settings
+ * @param array $new_instance An array of new settings as submitted by the admin
+ * @param array $old_instance An array of the previous settings
*
* @return array The validated and (if necessary) amended settings
*/
public function update( $new_instance, $old_instance ) {
-
// update logic goes here
$updated_instance = $new_instance;
return $updated_instance;
@@ -108,7 +107,7 @@ public function update( $new_instance, $old_instance ) {
/**
* Displays the form for this widget on the Widgets page of the WP Admin area.
*
- * @param array An array of the current settings for this widget
+ * @param array $instance An array of the current settings for this widget
*
* @return void Echoes it's output
*/
diff --git a/includes/Widgets/StoreLocation.php b/includes/Widgets/StoreLocation.php
index b60ddcaed7..d54ab21730 100755
--- a/includes/Widgets/StoreLocation.php
+++ b/includes/Widgets/StoreLocation.php
@@ -50,10 +50,10 @@ public function widget( $args, $instance ) {
return;
}
- echo $args['before_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['before_widget'] );
if ( ! empty( $title ) ) {
- echo $args['before_title'] . $title . $args['after_title']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] );
}
do_action( 'dokan_store_widget_before_map', $store_info );
@@ -66,7 +66,7 @@ public function widget( $args, $instance ) {
do_action( 'dokan_store_widget_after_map', $store_info );
- echo $args['after_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['after_widget'] );
}
do_action( 'dokan_widget_store_location_render', $args, $instance, $this );
@@ -76,8 +76,8 @@ public function widget( $args, $instance ) {
* Deals with the settings when they are saved by the admin. Here is
* where any validation should be dealt with.
*
- * @param array An array of new settings as submitted by the admin
- * @param array An array of the previous settings
+ * @param array $new_instance array of new settings as submitted by the admin
+ * @param array $old_instance array of the previous settings
*
* @return array The validated and (if necessary) amended settings
*/
@@ -91,7 +91,7 @@ public function update( $new_instance, $old_instance ) {
/**
* Displays the form for this widget on the Widgets page of the WP Admin area.
*
- * @param array An array of the current settings for this widget
+ * @param array $instance array of the current settings for this widget
*
* @return void Echoes it's output
*/
diff --git a/includes/Widgets/StoreOpenClose.php b/includes/Widgets/StoreOpenClose.php
index 122e7b66e3..ffdf3a2f48 100644
--- a/includes/Widgets/StoreOpenClose.php
+++ b/includes/Widgets/StoreOpenClose.php
@@ -28,8 +28,8 @@ public function __construct() {
/**
* Outputs the HTML for this widget.
*
- * @param array An array of standard parameters for widgets in this theme
- * @param array An array of settings for this widget instance
+ * @param array $args array of standard parameters for widgets in this theme
+ * @param array $instance An array of settings for this widget instance
*
* @return void Echoes it's output
**/
@@ -61,10 +61,10 @@ public function widget( $args, $instance ) {
return;
}
- echo $args['before_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['before_widget'] );
if ( ! empty( $title ) ) {
- echo $args['before_title'] . $title . $args['after_title']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] );
}
dokan_get_template_part(
@@ -75,7 +75,7 @@ public function widget( $args, $instance ) {
]
);
- echo $args['after_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['after_widget'] );
}
do_action( 'dokan_widget_store_open_close_render', $args, $instance, $this );
@@ -85,8 +85,8 @@ public function widget( $args, $instance ) {
* Deals with the settings when they are saved by the admin. Here is
* where any validation should be dealt with.
*
- * @param array An array of new settings as submitted by the admin
- * @param array An array of the previous settings
+ * @param array $new_instance array of new settings as submitted by the admin
+ * @param array $old_instance array of the previous settings
*
* @return array The validated and (if necessary) amended settings
*/
@@ -100,7 +100,7 @@ public function update( $new_instance, $old_instance ) {
/**
* Displays the form for this widget on the Widgets page of the WP Admin area.
*
- * @param array An array of the current settings for this widget
+ * @param array $instance array of the current settings for this widget
*
* @return void Echoes it's output
*/
diff --git a/includes/Widgets/TopratedProducts.php b/includes/Widgets/TopratedProducts.php
index b70580be27..693f0c95af 100755
--- a/includes/Widgets/TopratedProducts.php
+++ b/includes/Widgets/TopratedProducts.php
@@ -34,9 +34,10 @@ public function widget( $args, $instance ) {
$r = dokan_get_top_rated_products( $no_of_product );
- echo $args['before_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['before_widget'] );
+
if ( ! empty( $title ) ) {
- echo $args['before_title'] . $title . $args['after_title']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] );
}
dokan_get_template_part(
@@ -46,7 +47,7 @@ public function widget( $args, $instance ) {
)
);
- echo $args['after_widget']; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( $args['after_widget'] );
wp_reset_postdata();
}
@@ -103,5 +104,4 @@ public function update( $new_instance, $old_instance ) {
$instance['show_rating'] = ( ! empty( $new_instance['show_rating'] ) ) ? sanitize_text_field( $new_instance['show_rating'] ) : '';
return $instance;
}
-
-} // class Dokan best selling product widget
+}
diff --git a/includes/functions.php b/includes/functions.php
index 1636bd171d..ff96872e08 100755
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -106,11 +106,7 @@ function dokan_is_product_author( $product_id = 0 ) {
$author = get_post_field( 'post_author', $product_id );
}
- if ( absint( $author ) === apply_filters( 'dokan_is_product_author', dokan_get_current_user_id(), $product_id ) ) {
- return true;
- }
-
- return false;
+ return absint( $author ) === apply_filters( 'dokan_is_product_author', dokan_get_current_user_id(), $product_id );
}
/**
@@ -136,11 +132,7 @@ function dokan_is_store_page() {
* @return bool
*/
function dokan_is_product_edit_page() {
- if ( get_query_var( 'edit' ) && is_singular( 'product' ) ) {
- return true;
- }
-
- return false;
+ return get_query_var( 'edit' ) && is_singular( 'product' );
}
/**
@@ -288,6 +280,7 @@ function dokan_count_stock_posts( $post_type, $user_id, $stock_type, $exclude_pr
$exclude_product_types_text = "'" . implode( "', '", esc_sql( $exclude_product_types ) ) . "'";
if ( ! $results ) {
+ // @codingStandardsIgnoreStart
$results = $wpdb->get_results(
$wpdb->prepare(
"SELECT p.post_status, COUNT( * ) AS num_posts
@@ -309,6 +302,7 @@ function dokan_count_stock_posts( $post_type, $user_id, $stock_type, $exclude_pr
),
ARRAY_A
);
+ // @codingStandardsIgnoreEnd
}
$post_status = array_keys( dokan_get_post_status() );
@@ -838,7 +832,7 @@ function dokan_get_post_status_label_class( $status = '' ) {
*
* @param string $status
*
- * @return string
+ * @return array
*/
function dokan_get_product_types( $status = '' ) {
$types = apply_filters(
@@ -1095,11 +1089,11 @@ function dokan_admin_product_columns( $columns ) {
*
* @param string $option settings field name
* @param string $section the section name this field belongs to
- * @param string $default default text if it's not found
+ * @param string $default_value default text if it's not found
*
* @return mixed
*/
-function dokan_get_option( $option, $section, $default = '' ) {
+function dokan_get_option( $option, $section, $default_value = '' ) {
[ $option, $section ] = dokan_admin_settings_rearrange_map( $option, $section );
$options = get_option( $section );
@@ -1108,7 +1102,7 @@ function dokan_get_option( $option, $section, $default = '' ) {
return $options[ $option ];
}
- return $default;
+ return $default_value;
}
/**
@@ -1154,11 +1148,7 @@ function dokan_is_seller_enabled( $user_id ): bool {
function dokan_is_seller_trusted( $user_id ) {
$publishing = get_user_meta( $user_id, 'dokan_publishing', true );
- if ( $publishing === 'yes' ) {
- return true;
- }
-
- return false;
+ return $publishing === 'yes';
}
/**
@@ -1199,7 +1189,11 @@ function dokan_get_store_url( $user_id ) {
function dokan_get_current_page_url() {
global $wp;
- return add_query_arg( $_SERVER['QUERY_STRING'], '', home_url( $wp->request ) );
+ if ( ! empty( $_SERVER['QUERY_STRING'] ) ) {
+ return add_query_arg( wc_clean( wp_unslash( $_SERVER['QUERY_STRING'] ) ), '', home_url( $wp->request ) );
+ }
+
+ return home_url( $wp->request );
}
/**
@@ -1210,11 +1204,7 @@ function dokan_get_current_page_url() {
* @return bool
*/
function dokan_is_store_review_page() {
- if ( get_query_var( 'store_review' ) === 'true' ) {
- return true;
- }
-
- return false;
+ return get_query_var( 'store_review' ) === 'true';
}
/**
@@ -1481,7 +1471,7 @@ function dokan_get_percentage_of( $this_period = 0, $last_period = 0 ) {
$this_period = intval( $this_period );
$last_period = intval( $last_period );
- if ( 0 === $this_period && 0 === $last_period || $this_period === $last_period ) {
+ if ( ( 0 === $this_period && 0 === $last_period ) || $this_period === $last_period ) {
$class = 'up';
} elseif ( 0 === $this_period ) {
$parcent = $last_period * 100;
@@ -2394,7 +2384,8 @@ function dokan_get_social_profile_fields() {
*
* @since 2.3
*
- * @param bool verified
+ * @param bool $verified verified
+ * @param bool $required required
*
* @return void
*/
@@ -2472,7 +2463,6 @@ function dokan_get_seller_address( $seller_id = 0, $get_array = false ) {
$zip = isset( $address['zip'] ) ? $address['zip'] : '';
$country_code = isset( $address['country'] ) ? $address['country'] : '';
- $state_code = isset( $address['state'] ) ? $address['state'] : '';
$state_code = isset( $address['state'] ) ? ( $address['state'] === 'N/A' ) ? '' : $address['state'] : '';
$country_name = isset( $countries[ $country_code ] ) ? $countries[ $country_code ] : '';
diff --git a/includes/template-tags.php b/includes/template-tags.php
index 87c3a4171f..9a5e08fbec 100755
--- a/includes/template-tags.php
+++ b/includes/template-tags.php
@@ -271,10 +271,10 @@ function dokan_order_listing_status_filter() {
{$status_key} ?? 0;
- $formatted_order_count = $status_key === 'all' ? number_format_i18n( $total_orders ) : number_format_i18n( $status_order_count );
+ $formatted_order_count = $status_key === 'all' ? $total_orders : $status_order_count;
/* translators: 1: Order status label 2: Order count */
- printf( esc_html__( '%1$s (%2$s)', 'dokan-lite' ), $status_label, $formatted_order_count );
+ printf( esc_html__( '%1$s (%2$s)', 'dokan-lite' ), esc_html( $status_label ), number_format_i18n( $formatted_order_count ) );
?>
@@ -296,7 +296,7 @@ function dokan_order_listing_status_filter() {
*
* @return void
*/
- function dokan_store_category_menu( $seller_id, $title = '' ) {
+ function dokan_store_category_menu( $seller_id ) {
?>
get_store_categories();
$walker = new \WeDevs\Dokan\Walkers\StoreCategory( $seller_id );
echo '
';
- echo call_user_func_array( array( &$walker, 'walk' ), array( $categories, 0, array() ) ); //phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
+ echo wp_kses_post( call_user_func_array( array( &$walker, 'walk' ), array( $categories, 0, array() ) ) );
echo ' ';
}
?>
@@ -384,7 +384,7 @@ function dokan_store_term_menu_list( $seller_id, $taxonomy, $query_type ) {
echo '
- ' . $term->name . ' (' . $term->count . ')
+ ' . esc_html( $term->name ) . ' (' . esc_html( $term->count ) . ')
';
}
echo '';
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index 8f77234387..037e737eff 100755
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -129,6 +129,7 @@
+
@@ -202,6 +203,7 @@
+
diff --git a/templates/products/dokan-category-header-ui.php b/templates/products/dokan-category-header-ui.php
index dcfa481e05..0b9156ca01 100644
--- a/templates/products/dokan-category-header-ui.php
+++ b/templates/products/dokan-category-header-ui.php
@@ -13,21 +13,23 @@
// If no category is set then add a empty category box.
if ( count( $chosen_cat ) < 1 ) {
- array_push( $chosen_cat, $initial_category_for_modal );
+ $chosen_cat[] = $initial_category_for_modal;
}
?>
-
+
$term_id ) : ?>
-
+
+
+
diff --git a/templates/products/dokan-category-ui.php b/templates/products/dokan-category-ui.php
index 05eb38375b..90d1806eec 100644
--- a/templates/products/dokan-category-ui.php
+++ b/templates/products/dokan-category-ui.php
@@ -17,7 +17,12 @@
- /
+
+
+
+
+ /
+
diff --git a/templates/products/listing-status-filter.php b/templates/products/listing-status-filter.php
index b1e790860a..a3f44c9d82 100644
--- a/templates/products/listing-status-filter.php
+++ b/templates/products/listing-status-filter.php
@@ -20,7 +20,7 @@
total ) );
+ printf( esc_html__( 'All (%s)', 'dokan-lite' ), esc_html( number_format_i18n( $post_counts->total ) ) );
?>
diff --git a/templates/products/new-product.php b/templates/products/new-product.php
index 65b379528c..4bc7b0a649 100755
--- a/templates/products/new-product.php
+++ b/templates/products/new-product.php
@@ -128,11 +128,11 @@
%s ',
esc_url( dokan_edit_product_url( $created_product ) ),
- get_the_title( $created_product )
+ esc_html( get_the_title( $created_product ) )
)
);
?>
diff --git a/templates/products/products-listing.php b/templates/products/products-listing.php
index 86a258c40b..10dc773356 100755
--- a/templates/products/products-listing.php
+++ b/templates/products/products-listing.php
@@ -135,7 +135,7 @@ class="dokan-btn dokan-btn-theme"
__( 'Simple', 'dokan-lite' ) ] );
+ $product_types = apply_filters( 'dokan_product_types', [ 'simple' => esc_html__( 'Simple', 'dokan-lite' ) ] );
$args = array(
'posts_per_page' => 15,
@@ -251,13 +251,13 @@ class="dokan-btn dokan-btn-theme"
'_product_listing_filter_nonce' => wp_create_nonce( 'product_listing_filter' ),
],
'type' => 'array',
- 'prev_text' => __( '« Previous', 'dokan-lite' ),
- 'next_text' => __( 'Next »', 'dokan-lite' ),
+ 'prev_text' => esc_html__( '« Previous', 'dokan-lite' ),
+ 'next_text' => esc_html__( 'Next »', 'dokan-lite' ),
)
);
echo '\n";
echo '
';
}
diff --git a/templates/settings/bank-payment-method-settings.php b/templates/settings/bank-payment-method-settings.php
index 19adba915f..9963fe9aed 100644
--- a/templates/settings/bank-payment-method-settings.php
+++ b/templates/settings/bank-payment-method-settings.php
@@ -27,7 +27,7 @@
' . __( 'This is required', 'dokan-lite' ) . '';
+ echo '
' . esc_html__( 'This is required', 'dokan-lite' ) . ' ';
}
?>
@@ -49,7 +49,7 @@
' . __( 'This is required', 'dokan-lite' ) . '';
+ echo '
' . esc_html__( 'This is required', 'dokan-lite' ) . ' ';
}
?>
@@ -66,7 +66,7 @@
' . __( 'This is required', 'dokan-lite' ) . '';
+ echo '
' . esc_html__( 'This is required', 'dokan-lite' ) . ' ';
}
?>
@@ -84,7 +84,7 @@
' . __( 'This is required', 'dokan-lite' ) . '';
+ echo '
' . esc_html__( 'This is required', 'dokan-lite' ) . ' ';
}
?>
@@ -102,7 +102,7 @@
' . __( 'This is required', 'dokan-lite' ) . '';
+ echo '
' . esc_html__( 'This is required', 'dokan-lite' ) . ' ';
}
?>
@@ -120,7 +120,7 @@
' . __( 'This is required', 'dokan-lite' ) . '';
+ echo '
' . esc_html__( 'This is required', 'dokan-lite' ) . ' ';
}
?>
@@ -138,7 +138,7 @@
' . __( 'This is required', 'dokan-lite' ) . '';
+ echo '
' . esc_html__( 'This is required', 'dokan-lite' ) . ' ';
}
?>
@@ -156,7 +156,7 @@
' . __( 'This is required', 'dokan-lite' ) . '';
+ echo '
' . esc_html__( 'This is required', 'dokan-lite' ) . ' ';
}
?>
diff --git a/templates/settings/payment.php b/templates/settings/payment.php
index 10f53ba3cb..b361a2c355 100644
--- a/templates/settings/payment.php
+++ b/templates/settings/payment.php
@@ -28,8 +28,11 @@
@@ -60,7 +63,7 @@
if ( isset( $profile_info['payment'][ $method_key ] ) && ! empty( dokan_withdraw_get_method_additional_info( $method_key ) ) ) {
?>
-
+
diff --git a/templates/settings/store-form.php b/templates/settings/store-form.php
index 86d9ffc671..7c4cf3e7af 100644
--- a/templates/settings/store-form.php
+++ b/templates/settings/store-form.php
@@ -62,7 +62,7 @@
-
+
×
@@ -102,7 +102,7 @@
-
+
×
@@ -325,7 +325,7 @@
lang : dokan_helper.timepicker_locale,
minTime : '12:00 am',
maxTime : '11:30 pm',
- timeFormat : '',
+ timeFormat : '',
scrollDefault : 'now',
});
diff --git a/webpack.config.js b/webpack.config.js
index 74478d8e88..b4fcf9cd85 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -53,6 +53,7 @@ const entryPoint = {
'reverse-withdrawal-style': '/assets/src/less/reverse-withdrawal.less',
'dokan-product-category-ui': '/assets/src/less/dokan-product-category-ui.less',
'dokan-admin-product-style': '/assets/src/less/dokan-admin-product.less',
+ 'page-views': './assets/src/js/page-views.js',
};
const updatedConfig = {