Skip to content

Commit 0d85f56

Browse files
chore: Release version 4.2.9
Merge branch 'release/4.2.9'
2 parents 7eeddf5 + 2c03a37 commit 0d85f56

File tree

69 files changed

+2502
-2153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2502
-2153
lines changed

.github/workflows/phpcs.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ jobs:
88
steps:
99
- uses: actions/checkout@v4
1010

11+
- name: Use desired version of NodeJS
12+
uses: actions/setup-node@v4
13+
with:
14+
node-version: 20
15+
cache: npm
16+
17+
- name: Npm install and build
18+
run: |
19+
npm i
20+
npm run build
21+
1122
- name: Setup PHP
1223
uses: shivammathur/setup-php@v2
1324
with:
@@ -27,7 +38,7 @@ jobs:
2738
restore-keys: ${{ runner.os }}-composer-
2839

2940
- name: Install dependencies
30-
run: composer install --prefer-dist --no-progress
41+
run: composer install --prefer-dist --no-progress || composer update --prefer-dist --no-progress
3142

3243
- id: changes
3344
run: |
@@ -37,3 +48,11 @@ jobs:
3748
3849
- name: Detect coding standard violations
3950
run: vendor/bin/phpcs ${{ steps.changes.outputs.files }} -q --report=checkstyle | cs2pr --graceful-warnings
51+
52+
- name: Start WordPress Environment
53+
run: |
54+
npm run env:start
55+
56+
- name: Running the phpunit tests
57+
run: |
58+
npm run phpunit

.wp-env.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"core": null,
3+
"phpVersion": "7.4",
4+
"plugins": [
5+
".",
6+
"https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip"
7+
]
8+
}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
### v4.2.9 ( Jan 27, 2026 ) ###
2+
- **update:** Replace DokanModal dependency from dokan-ui with WordPress Modal.
3+
- **update:** Add user feedback link across Dokan admin pages.
4+
- **update:** Introduce a customizable option to exclude vendor order balance.
5+
- **update:** Add AI text and image enhancer settings to vendor preferences.
6+
- **fix:** Improve default table interactions in Dokan admin.
7+
- **fix:** Handle vendor payment settings permission properly for Vendor staff.
8+
19
### v4.2.8 ( Jan 20, 2026 ) ###
210
- **update:** Restore vendor revenue widget for vendor dashboard.
311
- **update:** Improve query arguments on admin withdraw pages to support filtering options.

assets/src/less/global-admin.less

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@
368368
.toplevel_page_dokan #wpcontent .dokan-admin-page-body,
369369
.dokan_page_dokan-dashboard #wpcontent .dokan-admin-page-body {
370370
padding-left: 20px;
371+
padding-bottom: 16px;
371372
}
372373

373374
#dokan-admin-panel-header {
@@ -395,3 +396,17 @@
395396
padding-left: 10px;
396397
}
397398
}
399+
400+
#dokan-admin-switching {
401+
display: block;
402+
padding-top: 0.5rem;
403+
padding-bottom: 0.25rem;
404+
}
405+
406+
#dokan-footer-thankyou {
407+
display: block;
408+
font-weight: bold;
409+
font-style: normal;
410+
padding-bottom: 0.5rem;
411+
font-size: 13px;
412+
}

composer.lock

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dokan-class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class WeDevs_Dokan {
2525
*
2626
* @var string
2727
*/
28-
public $version = '4.2.8';
28+
public $version = '4.2.9';
2929

3030
/**
3131
* Instance of self

dokan.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Dokan
44
* Plugin URI: https://dokan.co/wordpress/
55
* Description: An e-commerce marketplace plugin for WordPress. Powered by WooCommerce and weDevs.
6-
* Version: 4.2.8
6+
* Version: 4.2.9
77
* Author: Dokan Inc.
88
* Author URI: https://dokan.co/wordpress/
99
* Text Domain: dokan-lite

includes/Admin/Dashboard/Dashboard.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,9 +644,10 @@ public function add_switching_container( $text ) {
644644
return $text;
645645
}
646646

647-
$dom_element = '<span id="dokan-admin-switching" class="dokan-layout dokan-admin-page-body"></span><br/>';
647+
ob_start();
648+
dokan_get_template_part( 'global/global-review-rating' );
648649

649-
return $dom_element;
650+
return ob_get_clean();
650651
}
651652

652653
/**

includes/Dashboard/Templates/Settings.php

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -223,32 +223,64 @@ function ( $payment_method_id ) use ( $seller_id ) {
223223
}
224224

225225
/**
226-
* Load Payment Content
226+
* Validate payment access and check active methods
227227
*
228-
* @since 2.4
228+
* @since 4.2.9
229229
*
230-
* @param string $slug_suffix
230+
* @param array $active_methods
231231
*
232-
* @return void
232+
* @return bool Returns true if validation passes, false otherwise
233233
*/
234-
public function load_payment_content( $slug_suffix ) {
235-
$seller_id = dokan_get_current_user_id();
236-
$data = $this->get_seller_payment_methods( $seller_id );
237-
$connected_methods = $data['connected_methods'];
238-
$disconnected_methods = $data['disconnected_methods'];
239-
$active_methods = $data['active_methods'];
234+
protected function validate_payment_access( $active_methods ) {
235+
// Check staff permissions
236+
if ( ! current_user_can( 'dokan_view_store_payment_menu' ) ) {
237+
dokan_get_template_part(
238+
'global/dokan-error',
239+
'',
240+
[
241+
'deleted' => false,
242+
'message' => esc_html__( 'You have no permission to view this page', 'dokan-lite' ),
243+
]
244+
);
240245

241-
//no payment method is active, show informative message
246+
return false;
247+
}
248+
249+
// Check if payment methods are available
242250
if ( empty( $active_methods ) ) {
243251
dokan_get_template_part(
244252
'global/dokan-error',
245253
'',
246254
[
247255
'deleted' => false,
248-
'message' => __( 'No withdraw method is available. Please contact site admin.', 'dokan-lite' ),
256+
'message' => esc_html__( 'No withdraw method is available. Please contact site admin.', 'dokan-lite' ),
249257
]
250258
);
251259

260+
return false;
261+
}
262+
263+
return true;
264+
}
265+
266+
/**
267+
* Load Payment Content
268+
*
269+
* @since 2.4
270+
*
271+
* @param string $slug_suffix
272+
*
273+
* @return void
274+
*/
275+
public function load_payment_content( $slug_suffix ) {
276+
$seller_id = dokan_get_current_user_id();
277+
$data = $this->get_seller_payment_methods( $seller_id );
278+
$connected_methods = $data['connected_methods'];
279+
$disconnected_methods = $data['disconnected_methods'];
280+
$active_methods = $data['active_methods'];
281+
282+
// Check permissions and validate payment methods
283+
if ( ! $this->validate_payment_access( $active_methods ) ) {
252284
return;
253285
}
254286

includes/Order/Hooks.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,29 @@ public function on_order_status_change( $order_id, $old_status, $new_status, $or
123123
*/
124124
$exclude_cod_payment = 'on' === dokan_get_option( 'exclude_cod_payment', 'dokan_withdraw', 'off' );
125125

126-
if ( $exclude_cod_payment && 'cod' === $order->get_payment_method() ) {
126+
$should_exclude_cod_payment = $exclude_cod_payment && 'cod' === $order->get_payment_method();
127+
128+
/**
129+
* Filter whether the order should be excluded from vendor withdrawal balance.
130+
*
131+
* @since 4.2.9
132+
*
133+
* @param bool $should_exclude_cod_payment Whether to exclude COD payment from balance.
134+
* @param WC_Order $order Order object.
135+
* @param int $order_id Order ID.
136+
* @param string $new_status New order status.
137+
* @param bool $exclude_cod_payment Whether exclude COD option is enabled.
138+
*/
139+
$should_exclude_cod_payment = apply_filters(
140+
'dokan_order_should_exclude_from_vendor_balance',
141+
$should_exclude_cod_payment,
142+
$order,
143+
$order_id,
144+
$new_status,
145+
$exclude_cod_payment
146+
);
147+
148+
if ( $should_exclude_cod_payment ) {
127149
return;
128150
}
129151

0 commit comments

Comments
 (0)