From b3888c08691400f945aeb5829f4147cb65d5a928 Mon Sep 17 00:00:00 2001 From: Aftabul Islam Date: Wed, 7 Feb 2024 15:52:06 +0600 Subject: [PATCH 001/175] feat: action added for vendor product table column. --- templates/products/products-listing-row.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/templates/products/products-listing-row.php b/templates/products/products-listing-row.php index 5ddcb3fffc..aae2eae11f 100644 --- a/templates/products/products-listing-row.php +++ b/templates/products/products-listing-row.php @@ -48,6 +48,7 @@ get_image( 'thumbnail' ), $img_kses ); ?> + get_id() ); ?> @@ -63,9 +64,11 @@ + get_id() ); ?> + get_id() ); ?> @@ -78,6 +81,7 @@ echo ''; } ?> + get_id() ); ?> get_stock_quantity() ); } ?> + get_id() ); ?> –'; } ?> + get_id() ); ?> '; } ?> + get_id() ); ?> ID, 'pageview', true ); ?> + get_id() ); ?> + get_id() ); ?> From 095e6ebd99c7fe285dadd166ab49f635ba6d5aee Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Fri, 26 Apr 2024 16:37:10 +0600 Subject: [PATCH 002/175] enhance: Update dokan admin logo & add logo update notice. --- assets/src/less/admin.less | 1 + assets/src/less/global-admin.less | 2 +- includes/Admin/Menu.php | 2 +- includes/Admin/Notices/Manager.php | 69 +++++++++++++++++++++++++++--- 4 files changed, 65 insertions(+), 9 deletions(-) diff --git a/assets/src/less/admin.less b/assets/src/less/admin.less index f9b43d347b..d0e330b323 100644 --- a/assets/src/less/admin.less +++ b/assets/src/less/admin.less @@ -12,6 +12,7 @@ .dokan-admin-header-logo { display: flex; + align-items: center; img { height: 25px; diff --git a/assets/src/less/global-admin.less b/assets/src/less/global-admin.less index 027c13c30b..3c713b857c 100644 --- a/assets/src/less/global-admin.less +++ b/assets/src/less/global-admin.less @@ -111,7 +111,7 @@ .dokan-logo { width: 60px; height: 60px; - background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 62 62' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='.90723' y='.79541' width='61' height='61' rx='30.5' fill='%23F16982'/%3E%3Cpath d='m19.688 25.014v-6.1614c1.4588-0.0303 7.7804 0.0301 13.407 3.6546-0.5844-0.2658-1.2264-0.4219-1.8846-0.4584-0.6581-0.0364-1.3177 0.0477-1.9361 0.2469-1.4936 0.5135-2.7441 1.8122-2.8483 3.2016-0.1737 2.3861 0 4.8627 0 7.2488v7.2186c-1.1115 0.0906-2.2577 0.1208-3.2649 0.1208-1.0768 0.0302-2.1188 0.0302-2.9524 0.1208l-0.521 0.0907v-15.283z' fill='%23fff'/%3E%3Cpath d='m17.848 43.77s-0.278-2.3257 2.5007-2.6579c2.7787-0.3323 8.0583 0.302 11.532-1.6008 0 0 2.0494-0.9363 2.4662-1.3893l-0.5558 1.6309s-1.6325 4.9534-6.5994 5.5876c-4.967 0.6041-5.9048-1.7517-9.3434-1.5705z' fill='%23fff'/%3E%3Cpath d='m28.546 45.824c3.9596-0.8457 8.4404-3.3828 8.4404-16.159 0-12.776-17.02-11.689-17.02-11.689 4.0639-2.084 25.008-4.6815 25.008 13.32 0 17.971-16.429 14.528-16.429 14.528z' fill='%23fff'/%3E%3C/svg%3E"); + background-image: url("data:image/svg+xml,%3Csvg width='201' height='201' viewBox='0 0 201 201' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0.944824' y='0.286865' width='200' height='200' rx='100' fill='url(%23paint0_linear_1000_463)'/%3E%3Crect x='0.944824' y='0.286865' width='200' height='200' rx='100' fill='url(%23paint1_linear_1000_463)'/%3E%3Cpath opacity='0.5' d='M120.094 97.8397C120.017 116.945 111.818 136.669 94.8784 145.642C82.9666 151.984 54.8115 156.857 54.8115 136.205C54.8115 136.205 54.8115 59.3972 54.8115 59.3198C54.8115 47.8721 64.4802 44.082 74.1488 44.6235C88.5358 45.397 102.304 52.1263 110.658 64.5022C115.995 72.3919 118.934 81.9058 119.862 91.4971C119.94 93.6629 120.094 95.7513 120.094 97.8397Z' fill='white'/%3E%3Cpath d='M146.78 91.1102C145.155 75.331 135.487 62.1042 122.105 54.1373C113.842 49.1791 103.642 47.6922 97.5842 56.0645C96.6338 57.3779 95.8894 58.8748 95.1173 60.3003C88.6566 72.2286 57.2433 129.954 57.2093 130.017C57.2081 130.019 57.2087 130.018 57.2075 130.02C53.8062 136.284 54.5799 141.465 57.6734 145.719C62.3143 152.061 71.5189 154.923 79.0217 155.697C85.9832 156.47 93.022 155.697 99.7514 154.15C120.094 149.509 138.117 135.663 144.227 115.553C146.625 107.663 147.631 99.3866 146.78 91.1102Z' fill='white'/%3E%3Cdefs%3E%3ClinearGradient id='paint0_linear_1000_463' x1='100.945' y1='0.286865' x2='100.945' y2='200.287' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23FF7D92'/%3E%3Cstop offset='0.229167' stop-color='%23E3397D'/%3E%3Cstop offset='0.635417' stop-color='%23800CD2'/%3E%3Cstop offset='1' stop-color='%235812D0'/%3E%3C/linearGradient%3E%3ClinearGradient id='paint1_linear_1000_463' x1='100.945' y1='0.286865' x2='100.945' y2='200.287' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23FF7D92'/%3E%3Cstop offset='0.229167' stop-color='%23E3397D'/%3E%3Cstop offset='0.635417' stop-color='%23800CD2'/%3E%3Cstop offset='1' stop-color='%235812D0'/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: cover; background-position: center; diff --git a/includes/Admin/Menu.php b/includes/Admin/Menu.php index 87b7e01fc4..8ef39e3673 100644 --- a/includes/Admin/Menu.php +++ b/includes/Admin/Menu.php @@ -40,7 +40,7 @@ public function add_admin_menu() { $withdraw_text = sprintf( __( 'Withdraw %s', 'dokan-lite' ), '' . $withdraw['pending'] . '' ); } - $dashboard = add_menu_page( __( 'Dokan', 'dokan-lite' ), __( 'Dokan', 'dokan-lite' ), $capability, $slug, [ $this, 'dashboard' ], 'data:image/svg+xml;base64,' . base64_encode( '' ), $menu_position ); + $dashboard = add_menu_page( __( 'Dokan', 'dokan-lite' ), __( 'Dokan', 'dokan-lite' ), $capability, $slug, [ $this, 'dashboard' ], 'data:image/svg+xml;base64,' . base64_encode( '' ), $menu_position ); if ( current_user_can( $capability ) ) { $submenu[ $slug ][] = [ __( 'Dashboard', 'dokan-lite' ), $capability, 'admin.php?page=' . $slug . '#/' ]; diff --git a/includes/Admin/Notices/Manager.php b/includes/Admin/Notices/Manager.php index 2eac5e9bea..1deeba8dcf 100644 --- a/includes/Admin/Notices/Manager.php +++ b/includes/Admin/Notices/Manager.php @@ -48,7 +48,9 @@ private function init_hooks() { add_action( 'admin_notices', [ $this, 'render_missing_woocommerce_notice' ] ); add_action( 'admin_notices', [ $this, 'render_global_admin_notices_html' ] ); add_filter( 'dokan_admin_notices', [ $this, 'show_permalink_setting_notice' ] ); + add_filter( 'dokan_admin_notices', [ $this, 'show_admin_logo_update_notice' ] ); add_filter( 'dokan_admin_notices', [ $this, 'show_one_step_product_add_notice' ] ); + add_action( 'wp_ajax_dismiss_dokan_admin_logo_update_notice', [ $this, 'dismiss_dokan_admin_logo_update_notice' ] ); add_action( 'wp_ajax_dismiss_dokan_one_step_product_notice', [ $this, 'dismiss_dokan_one_step_product_notice' ] ); } @@ -139,12 +141,12 @@ public function show_permalink_setting_notice( $notices ) { public function show_one_step_product_add_notice( $notices ) { if ( 'yes' !== get_option( 'dismiss_dokan_one_step_product_nonce', 'no' ) ) { $notices[] = [ - 'type' => 'alert', - 'title' => __( 'New One-Step Product Form', 'dokan-lite' ), - 'description' => __( 'Try it now to enhance your vendor\'s product upload experience, the older two-step version will be retired in one month.', 'dokan-lite' ), - 'priority' => 1, + 'priority' => 1, 'show_close_button' => true, - 'ajax_data' => [ + 'type' => 'alert', + 'title' => __( 'New One-Step Product Form', 'dokan-lite' ), + 'description' => __( 'Try it now to enhance your vendor\'s product upload experience, the older two-step version will be retired in one month.', 'dokan-lite' ), + 'ajax_data' => [ 'action' => 'dismiss_dokan_one_step_product_notice', 'nonce' => wp_create_nonce( 'dismiss_dokan_one_step_product_nonce' ), ], @@ -154,6 +156,33 @@ public function show_one_step_product_add_notice( $notices ) { return $notices; } + /** + * Display dokan admin logo update notice. + * + * @since DOKAN_SINCE + * + * @param array $notices + * + * @return array + */ + public function show_admin_logo_update_notice( array $notices ): array { + if ( 'yes' !== get_option( 'dismiss_dokan_admin_logo_nonce', 'no' ) ) { + $notices[] = [ + 'priority' => 1, + 'show_close_button' => true, + 'type' => 'info', + 'title' => __( 'New Dokan Logo!', 'dokan-lite' ), + 'description' => __( 'Introducing our fresh new logo! Keep an eye for out for it in your admin dashboard.', 'dokan-lite' ), + 'ajax_data' => [ + 'action' => 'dismiss_dokan_admin_logo_update_notice', + 'nonce' => wp_create_nonce( 'dismiss_dokan_admin_logo_nonce' ), + ], + ]; + } + + return $notices; + } + /** * Dismisses one-step product create notice. * @@ -162,7 +191,33 @@ public function show_one_step_product_add_notice( $notices ) { * @return void */ public function dismiss_dokan_one_step_product_notice() { - if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), 'dismiss_dokan_one_step_product_nonce' ) ) { + // Check nonce actions, permissions & dismiss dokan admin logo notice. + $this->dismiss_notice( 'dismiss_dokan_one_step_product_nonce' ); + } + + /** + * Dismisses dokan admin logo update notice. + * + * @since DOKAN_SINCE + * + * @return void + */ + public function dismiss_dokan_admin_logo_update_notice() { + // Check nonce actions, permissions & dismiss dokan admin logo notice. + $this->dismiss_notice( 'dismiss_dokan_admin_logo_nonce' ); + } + + /** + * Dismisses dokan notice. + * + * @since DOKAN_SINCE + * + * @param string $option_name The name of the option to update. + * + * @return void + */ + private function dismiss_notice( string $option_name ) { + if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), $option_name ) ) { wp_send_json_error( __( 'Invalid nonce', 'dokan-lite' ) ); } @@ -171,7 +226,7 @@ public function dismiss_dokan_one_step_product_notice() { wp_send_json_error( __( 'You have no permission to do that', 'dokan-lite' ) ); } - update_option( 'dismiss_dokan_one_step_product_nonce', 'yes' ); + update_option( $option_name, 'yes' ); wp_send_json_success(); } } From 6775f6de6e22d79b93d63d76ebb203a4347d349b Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Fri, 26 Apr 2024 16:45:24 +0600 Subject: [PATCH 003/175] add: updated admin dashboard logo png --- assets/images/dokan-logo.png | Bin 3613 -> 3578 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/assets/images/dokan-logo.png b/assets/images/dokan-logo.png index ea81c5bb1c9bc55a69a31d6511b0a5cf1d45e90c..ba298c67cdd3c7a92fd8f94fc15a2d8e18017bba 100644 GIT binary patch literal 3578 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 From 0da43369d67e7e1107ec8d2102f29784245233bb Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Thu, 2 May 2024 12:36:46 +0600 Subject: [PATCH 004/175] update: logo update nonce name, comments position, update notice description & remove one-step notice. --- includes/Admin/Notices/Manager.php | 56 +++++------------------------- 1 file changed, 8 insertions(+), 48 deletions(-) diff --git a/includes/Admin/Notices/Manager.php b/includes/Admin/Notices/Manager.php index 1deeba8dcf..b8c5e7176b 100644 --- a/includes/Admin/Notices/Manager.php +++ b/includes/Admin/Notices/Manager.php @@ -49,9 +49,7 @@ private function init_hooks() { add_action( 'admin_notices', [ $this, 'render_global_admin_notices_html' ] ); add_filter( 'dokan_admin_notices', [ $this, 'show_permalink_setting_notice' ] ); add_filter( 'dokan_admin_notices', [ $this, 'show_admin_logo_update_notice' ] ); - add_filter( 'dokan_admin_notices', [ $this, 'show_one_step_product_add_notice' ] ); add_action( 'wp_ajax_dismiss_dokan_admin_logo_update_notice', [ $this, 'dismiss_dokan_admin_logo_update_notice' ] ); - add_action( 'wp_ajax_dismiss_dokan_one_step_product_notice', [ $this, 'dismiss_dokan_one_step_product_notice' ] ); } /** @@ -129,33 +127,6 @@ public function show_permalink_setting_notice( $notices ) { return $notices; } - /** - * Display single page product page create notice. - * - * @since 3.8.2 - * - * @param array $notices - * - * @return array - */ - public function show_one_step_product_add_notice( $notices ) { - if ( 'yes' !== get_option( 'dismiss_dokan_one_step_product_nonce', 'no' ) ) { - $notices[] = [ - 'priority' => 1, - 'show_close_button' => true, - 'type' => 'alert', - 'title' => __( 'New One-Step Product Form', 'dokan-lite' ), - 'description' => __( 'Try it now to enhance your vendor\'s product upload experience, the older two-step version will be retired in one month.', 'dokan-lite' ), - 'ajax_data' => [ - 'action' => 'dismiss_dokan_one_step_product_notice', - 'nonce' => wp_create_nonce( 'dismiss_dokan_one_step_product_nonce' ), - ], - ]; - } - - return $notices; - } - /** * Display dokan admin logo update notice. * @@ -166,16 +137,16 @@ public function show_one_step_product_add_notice( $notices ) { * @return array */ public function show_admin_logo_update_notice( array $notices ): array { - if ( 'yes' !== get_option( 'dismiss_dokan_admin_logo_nonce', 'no' ) ) { + if ( 'yes' !== get_option( 'dismiss_dokan_admin_logo_update_notice', 'no' ) ) { $notices[] = [ 'priority' => 1, 'show_close_button' => true, 'type' => 'info', 'title' => __( 'New Dokan Logo!', 'dokan-lite' ), - 'description' => __( 'Introducing our fresh new logo! Keep an eye for out for it in your admin dashboard.', 'dokan-lite' ), + 'description' => __( 'Introducing the new freshly designed Dokan Logo. Keep an eye on your admin dashboard!!', 'dokan-lite' ), 'ajax_data' => [ 'action' => 'dismiss_dokan_admin_logo_update_notice', - 'nonce' => wp_create_nonce( 'dismiss_dokan_admin_logo_nonce' ), + 'nonce' => wp_create_nonce( 'dismiss_dokan_admin_logo_update_notice_nonce' ), ], ]; } @@ -183,18 +154,6 @@ public function show_admin_logo_update_notice( array $notices ): array { return $notices; } - /** - * Dismisses one-step product create notice. - * - * @since 3.8.2 - * - * @return void - */ - public function dismiss_dokan_one_step_product_notice() { - // Check nonce actions, permissions & dismiss dokan admin logo notice. - $this->dismiss_notice( 'dismiss_dokan_one_step_product_nonce' ); - } - /** * Dismisses dokan admin logo update notice. * @@ -203,8 +162,7 @@ public function dismiss_dokan_one_step_product_notice() { * @return void */ public function dismiss_dokan_admin_logo_update_notice() { - // Check nonce actions, permissions & dismiss dokan admin logo notice. - $this->dismiss_notice( 'dismiss_dokan_admin_logo_nonce' ); + $this->dismiss_notice( 'dismiss_dokan_admin_logo_update_notice' ); } /** @@ -217,15 +175,17 @@ public function dismiss_dokan_admin_logo_update_notice() { * @return void */ private function dismiss_notice( string $option_name ) { - if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), $option_name ) ) { + // Check nonce actions. + if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), $option_name . '_nonce' ) ) { wp_send_json_error( __( 'Invalid nonce', 'dokan-lite' ) ); } - // phpcs:ignore + // Check permission. if ( ! current_user_can( 'manage_woocommerce' ) ) { wp_send_json_error( __( 'You have no permission to do that', 'dokan-lite' ) ); } + // Dismiss dokan admin logo notice. update_option( $option_name, 'yes' ); wp_send_json_success(); } From 30faf7a7751463bac12714852b47998455321b6c Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Thu, 2 May 2024 13:01:02 +0600 Subject: [PATCH 005/175] fix: add phpcs for unknown capability --- includes/Admin/Notices/Manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Admin/Notices/Manager.php b/includes/Admin/Notices/Manager.php index b8c5e7176b..5d5bf7db09 100644 --- a/includes/Admin/Notices/Manager.php +++ b/includes/Admin/Notices/Manager.php @@ -181,7 +181,7 @@ private function dismiss_notice( string $option_name ) { } // Check permission. - if ( ! current_user_can( 'manage_woocommerce' ) ) { + if ( ! current_user_can( 'manage_woocommerce' ) ) { // phpcs:ignore wp_send_json_error( __( 'You have no permission to do that', 'dokan-lite' ) ); } From 718cdfe4694a4a95bc554e458bd9b51f0253f274 Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Mon, 3 Jun 2024 08:52:55 +0600 Subject: [PATCH 006/175] feat: Implement order mark as received settings for customers. --- src/admin/components/Fields.vue | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/admin/components/Fields.vue b/src/admin/components/Fields.vue index e38bf30f8e..47abee9b0a 100644 --- a/src/admin/components/Fields.vue +++ b/src/admin/components/Fields.vue @@ -846,11 +846,23 @@ return; } - let isChecked = this.validateInputData( this.fieldData.name, status ? 'on' : 'off', this.fieldValue[ this.fieldData.name ], this.fieldData ); + let isChecked = this.validateInputData( this.fieldData.name, status ? 'on' : 'off', this.fieldValue[ this.fieldData.name ], this.fieldData ); this.checked = isChecked; this.fieldValue[ this.fieldData.name ] = isChecked; + // Load shipping receive status if marked as receive. + if ( this.fieldData.name === 'allow_mark_received' ) { + this.loadReceiveStatus( status ); + } + + // this.fieldValue[ this.fieldData.name ] = dokan.hooks.applyFilters( + // 'dokanFieldComponentSwitcherValue', + // isChecked, + // this.fieldValue, + // this.fieldData.name + // ); + this.$root.$emit( 'onFieldSwitched', this.fieldValue[ this.fieldData.name ], this.fieldData.name ); }, @@ -924,6 +936,23 @@ this.fieldData[ key ] = value; }, + + loadReceiveStatus( status ) { + if ( status ) { + return this.fieldValue?.[ 'shipping_status_list' ]?.push( { + 'id' : 'ss_mark_received', + 'desc' : '(This is must use item)', + 'value' : 'Received', + 'must_use' : true, + } ); + } + + const updatedStatus = this.fieldValue?.[ 'shipping_status_list' ].filter( + shippingStatus => shippingStatus.id !== 'ss_mark_received' + ); + + this.fieldValue.shipping_status_list = [ ...updatedStatus ]; + }, }, }; From 2f29b36e61d764575b0a3d877f77e6bd5a5fd562 Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Mon, 10 Jun 2024 13:31:49 +0600 Subject: [PATCH 007/175] enhance: use hooks for update switcher settings field value --- src/admin/components/Fields.vue | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/src/admin/components/Fields.vue b/src/admin/components/Fields.vue index 47abee9b0a..d5e69bf12c 100644 --- a/src/admin/components/Fields.vue +++ b/src/admin/components/Fields.vue @@ -852,16 +852,12 @@ this.fieldValue[ this.fieldData.name ] = isChecked; // Load shipping receive status if marked as receive. - if ( this.fieldData.name === 'allow_mark_received' ) { - this.loadReceiveStatus( status ); - } - - // this.fieldValue[ this.fieldData.name ] = dokan.hooks.applyFilters( - // 'dokanFieldComponentSwitcherValue', - // isChecked, - // this.fieldValue, - // this.fieldData.name - // ); + this.fieldValue[ this.fieldData.name ] = dokan.hooks.applyFilters( + 'dokanFieldComponentSwitcherValue', + isChecked, + this.fieldValue, + this.fieldData.name + ); this.$root.$emit( 'onFieldSwitched', this.fieldValue[ this.fieldData.name ], this.fieldData.name ); }, @@ -936,23 +932,6 @@ this.fieldData[ key ] = value; }, - - loadReceiveStatus( status ) { - if ( status ) { - return this.fieldValue?.[ 'shipping_status_list' ]?.push( { - 'id' : 'ss_mark_received', - 'desc' : '(This is must use item)', - 'value' : 'Received', - 'must_use' : true, - } ); - } - - const updatedStatus = this.fieldValue?.[ 'shipping_status_list' ].filter( - shippingStatus => shippingStatus.id !== 'ss_mark_received' - ); - - this.fieldValue.shipping_status_list = [ ...updatedStatus ]; - }, }, }; From 4a375f7e679215b18937bede8ced4286a9c9e020 Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Mon, 10 Jun 2024 15:27:26 +0600 Subject: [PATCH 008/175] update: Update doc comments on switcher hook introducing. --- src/admin/components/Fields.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/admin/components/Fields.vue b/src/admin/components/Fields.vue index d5e69bf12c..bbafa99194 100644 --- a/src/admin/components/Fields.vue +++ b/src/admin/components/Fields.vue @@ -851,7 +851,7 @@ this.checked = isChecked; this.fieldValue[ this.fieldData.name ] = isChecked; - // Load shipping receive status if marked as receive. + // Make field value editable from premium version. (on switcher udpate) this.fieldValue[ this.fieldData.name ] = dokan.hooks.applyFilters( 'dokanFieldComponentSwitcherValue', isChecked, From e0e2e1630c220d2b5325003ce8f5bf6c9fd66e0b Mon Sep 17 00:00:00 2001 From: Al Amin Ahamed <34349365+mralaminahamed@users.noreply.github.com> Date: Tue, 2 Jul 2024 10:46:55 +0600 Subject: [PATCH 009/175] refactor: update docblock for new action in `products-listing-row.php` --- templates/products/products-listing-row.php | 114 ++++++++++++++++++-- 1 file changed, 104 insertions(+), 10 deletions(-) diff --git a/templates/products/products-listing-row.php b/templates/products/products-listing-row.php index aae2eae11f..16138af7b6 100644 --- a/templates/products/products-listing-row.php +++ b/templates/products/products-listing-row.php @@ -48,7 +48,19 @@ get_image( 'thumbnail' ), $img_kses ); ?> - get_id() ); ?> + get_id() ); + ?> @@ -64,7 +76,19 @@ - get_id() ); ?> + get_id() ); + ?> @@ -81,7 +105,19 @@ echo ''; } ?> - get_id() ); ?> + get_id() ); + ?> get_stock_quantity() ); } ?> - get_id() ); ?> + get_id() ); + ?> –'; } ?> - get_id() ); ?> + get_id() ); + ?> '; } ?> - get_id() ); ?> + get_id() ); + ?> ID, 'pageview', true ); ?> - get_id() ); ?> + get_id() ); + ?> post_date ) { $post_published_date = __( 'Unpublished', 'dokan-lite' ); $human_readable_time = __( 'Unpublished', 'dokan-lite' ); @@ -177,7 +259,19 @@ esc_html_e( 'Last Modified', 'dokan-lite' ); } ?> - get_id() ); ?> + get_id() ); + ?> From 7778a060f8025190b40b314699011be9dcec441d Mon Sep 17 00:00:00 2001 From: Raad Date: Mon, 8 Jul 2024 11:15:15 +0600 Subject: [PATCH 010/175] Update readme.txt (#2307) Updated description according to wp org team --- readme.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index 2f4e0400ba..84ffcab44e 100644 --- a/readme.txt +++ b/readme.txt @@ -15,10 +15,10 @@ Transform your WooCommerce site into a multivendor marketplace with Dokan - a po == Description == -= THE BEST MULTIVENDOR MARKETPLACE PLUGIN FOR WORDPRESS – POWERED BY WOOCOMMERCE = += POWERFUL MULTIVENDOR MARKETPLACE PLUGIN FOR WORDPRESS – POWERED BY WOOCOMMERCE = -[Dokan](https://dokan.co/wordpress/?utm_campaign=dokan-wordpress-org-visitor&utm_medium=learn_more_about_dokan&utm_source=WordPress.org) is the best frontend multivendor marketplace plugin for WordPress, powered by WooCommerce. It helps you build your own multivendor marketplace similar to Amazon, Shopify, eBay, and Magento in under 30 minutes. +[Dokan](https://dokan.co/wordpress/?utm_campaign=dokan-wordpress-org-visitor&utm_medium=learn_more_about_dokan&utm_source=WordPress.org) is the ultimate frontend multivendor marketplace plugin for WordPress, powered by WooCommerce. It helps you build your own multivendor marketplace similar to Amazon, Shopify, eBay, and Magento in under 30 minutes. Moreover, Plus, with Dokan, you don't need any coding skills to create a thriving WooCommerce multivendor marketplace. Trusted by over 60,000 entrepreneurs globally for more than a decade, Dokan makes multivendor marketplace setup effortless and accessible to all. Dokan is the fastest way to launch an eCommerce business and earn through commissions for products ranging from digital and physical to variable products. @@ -81,7 +81,7 @@ Here is how you can build your multivendor marketplace with Dokan. [youtube https://www.youtube.com/watch?v=4id-EwbfUko] -= THE BEST FRONTEND USER INTERFACE = += HIGHLY USER-FRIENDLY FRONTEND INTERFACE = To provide a comprehensive frontend experience, every vendor has a [personalized customizable dashboard](https://dokan.co/wordpress/features/?utm_campaign=dokan-wordpress-org-visitor&utm_medium=learn_more_about_dokan&utm_source=WordPress.org) on the store frontend. They can easily navigate and control every aspect of their marketplace from there. Backend access is restricted to only the admin, which sets Dokan apart from other marketplace plugins. However, all Dokan [modules](https://dokan.co/wordpress/modules/) are frontend compatible so that both the admin and vendors can enjoy the benefits and advanced features of Dokan. From 64fcc7dc80a52c96e82bba564b471ec909d0b361 Mon Sep 17 00:00:00 2001 From: Al Amin Ahamed <34349365+mralaminahamed@users.noreply.github.com> Date: Mon, 8 Jul 2024 11:18:57 +0600 Subject: [PATCH 011/175] refactor: `WordPress.Security.EscapeOutput.OutputNotEscaped`, `WordPress.Security.EscapeOutput.ExceptionNotEscaped` escaping (#2270) * refactor: page view scripts load from template * refactor: escaping tooltip text * refactor: escaping dokan withdraw method title * refactor: escaping installed error message * style: ignore scaping wc_esc_json function * refactor: escaping note and ship info * refactor: heading control description * style: ignore escaping the svg label image from radio image control * refactor: shop order custom columns data * refactor: escaping some text * style: ignore escaping for back trace message * refactor: escaping some variables * style: ignore escaping for back trace message * reactor: escaping some variables and some are ignored * style: ignore escaping for some variables * style: ignore escaping some variables * update: add phpcs rule for exception output * style: ignore escaping for dynamic content * style: ignore escaping for dynamic content * update: php method doc * update: php method doc * style: ignore escaping for dynamic content * update: php method doc * style: ignore escaping for dynamic content * style: ignore escaping for dynamic content * refactor: escpaing php variables * refactor: escaping some variables * refactor: escaping variables * refactor: title text * refactor: ecaping some text * refactor: escaping localize text * refactor: ecaping some text * refactor: dynamic time format data * update: phpcs rule set for capabilities * update: phpcs config * update: phpcs rule as per woocommerce * refactor: phpcs issues * added: Available roles in the phpcs for PHPCS check * refactor: fix wp data sanitization errors for SetupWizard.php * refactor: fix wp data sanitization errors for SetupWizardNoWC.php * refactor: fix wp data sanitization errors for SetupWizard.php * added: rules for custom sanitizing functions * refactor: html markup escaping * fix: template load issue for Page view * refactor: docblock for return type `dokan_get_product_types` * Update includes/Ajax.php Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update templates/settings/store-form.php Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * refactor: WordPress coding standards and security issues * refactor: WordPress coding standards and security issues * refactor: WordPress coding standards and security issues skip for non required code * update: enqueue script instead of template `templates/page-views.php` * update: using escaping `wp_kses_post($this->description);` instead of `wp_kses( $this->description, wp_kses_allowed_html( 'user_description' ) );` * delete: old tempalte for `page-views.php` --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- assets/js/page-views.js | 32 ++++ assets/src/js/page-views.js | 33 ++++ includes/Admin/Hooks.php | 6 +- includes/Admin/SetupWizard.php | 10 +- includes/Admin/SetupWizardNoWC.php | 2 +- includes/Ajax.php | 11 +- includes/Customizer/HeadingControl.php | 4 +- includes/Customizer/RadioImageControl.php | 2 +- includes/Order/Admin/Hooks.php | 8 +- includes/PageViews.php | 153 +++++++++--------- includes/REST/ProductController.php | 30 ++-- .../ReverseWithdrawal/ReverseWithdrawal.php | 4 +- includes/Traits/ChainableContainer.php | 4 +- includes/Widgets/BestSellingProducts.php | 7 +- includes/Widgets/FilterByAttributes.php | 18 +-- includes/Widgets/ProductCategoryMenu.php | 21 +-- includes/Widgets/StoreCategoryMenu.php | 16 +- includes/Widgets/StoreContactForm.php | 17 +- includes/Widgets/StoreLocation.php | 12 +- includes/Widgets/StoreOpenClose.php | 16 +- includes/Widgets/TopratedProducts.php | 10 +- includes/functions.php | 46 +++--- includes/template-tags.php | 10 +- phpcs.xml.dist | 2 + .../products/dokan-category-header-ui.php | 8 +- templates/products/dokan-category-ui.php | 7 +- templates/products/listing-status-filter.php | 2 +- templates/products/new-product.php | 4 +- templates/products/products-listing.php | 8 +- .../settings/bank-payment-method-settings.php | 16 +- templates/settings/payment.php | 9 +- templates/settings/store-form.php | 6 +- webpack.config.js | 1 + 33 files changed, 307 insertions(+), 228 deletions(-) create mode 100644 assets/js/page-views.js create mode 100644 assets/src/js/page-views.js 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 ); ?>"> <?php echo esc_attr( $label['label'] ); ?> 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 ) {

    - +

    - +  ' . $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 '
      • '; - echo join( "
      • \n\t
      • ", $page_links ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped + echo implode( "
      • \n\t
      • ", $page_links ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped,WordPress.Security.EscapeOutput.OutputNotEscaped echo "
      • \n
      \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 @@ <?php echo esc_attr( $method_key ); ?>
      @@ -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 @@
      - + banner ×
      @@ -102,7 +102,7 @@
      - + gravtar ×
      @@ -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 = { From 42c5839ebe77a9e6d411638655b2826668f13933 Mon Sep 17 00:00:00 2001 From: "Md. Asif Hossain Nadim" <90011088+MdAsifHossainNadim@users.noreply.github.com> Date: Mon, 8 Jul 2024 11:20:30 +0600 Subject: [PATCH 012/175] fix: Shop url rendered double slash when using WPML on vendor registration form. (#2291) * fix: Shop url rendered double slash when using WPML on vendor registration form. * fix: phpcs issue. * add: Used escaping function before shop url redered. * add: Used escaping function before shop url rendered on seller registration form. --- templates/account/update-customer-to-vendor.php | 10 ++++++++-- templates/global/seller-registration-form.php | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/templates/account/update-customer-to-vendor.php b/templates/account/update-customer-to-vendor.php index 0caa4e7506..b7f8426399 100644 --- a/templates/account/update-customer-to-vendor.php +++ b/templates/account/update-customer-to-vendor.php @@ -13,6 +13,9 @@ * @var string $phone * @var string $toc_page_id */ + +$home_url = untrailingslashit( home_url() ); +$custom_store_url = dokan_get_option( 'custom_store_url', 'dokan_general', 'store' ); ?>

      @@ -38,7 +41,10 @@ - / + + + +

      @@ -63,7 +69,7 @@ %2$s', esc_url( $toc_page_url ), __( 'Terms & Conditions', 'dokan-lite' ) ); // translators: 1. Terms and conditions of agreement link. - echo sprintf( __( 'I have read and agree to the %1$s.', 'dokan-lite' ), $tc_link ); + printf( __( 'I have read and agree to the %1$s.', 'dokan-lite' ), $tc_link ); ?>

      diff --git a/templates/global/seller-registration-form.php b/templates/global/seller-registration-form.php index 29d2a728bc..3ccc0f309a 100644 --- a/templates/global/seller-registration-form.php +++ b/templates/global/seller-registration-form.php @@ -4,6 +4,9 @@ * * @since 2.4 */ + +$home_url = untrailingslashit( home_url() ); +$custom_store_url = dokan_get_option( 'custom_store_url', 'dokan_general', 'store' ); ?>
      @@ -29,7 +32,10 @@ - / + + + +

      Date: Mon, 8 Jul 2024 11:21:51 +0600 Subject: [PATCH 013/175] =?UTF-8?q?=F0=9F=9A=80=20enhance:=20Direct=20link?= =?UTF-8?q?s=20to=20the=20relevant=20settings=20from=20vendor=20progress?= =?UTF-8?q?=20bar=20(#2297)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * enhance: Direct links to the relevant settings from vendor progress bar * fix: Missing navigation link for add address link on profile progress bar --- templates/settings/address-form.php | 2 +- templates/settings/payment.php | 2 +- templates/settings/store-form.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/settings/address-form.php b/templates/settings/address-form.php index 66e4376f7f..e400bfa717 100644 --- a/templates/settings/address-form.php +++ b/templates/settings/address-form.php @@ -25,7 +25,7 @@
      -
      +