Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
293 changes: 0 additions & 293 deletions base-tailwind.config.js

This file was deleted.

6 changes: 4 additions & 2 deletions includes/Admin/Dashboard/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ protected function register_setup_guide_scripts() {
wp_register_style(
$this->setup_guide_key,
DOKAN_PLUGIN_ASSEST . '/css/setup-guide-banner.css',
[],
[ 'dokan-tailwind' ],
$version
);

Expand Down Expand Up @@ -644,7 +644,9 @@ public function add_switching_container( $text ) {
return $text;
}

$dom_element = '<span id="dokan-admin-switching" class="dokan-layout dokan-admin-page-body"></span><br/>';
$dom_element = '<span id="dokan-admin-switching" class="dokan-layout dokan-admin-page-body"></span><br/>
<span id="footer-thankyou">If you like <strong>Dokan</strong> please leave us a <a href="https://wordpress.org/support/plugin/dokan-lite/reviews?rate=5#new-post" target="_blank" class="wc-rating-link" aria-label="five star" data-rated="Thanks :)">★★★★★</a> rating. A huge thanks in advance!</span>
';
Comment on lines +647 to +649
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -name "Dashboard.php" -path "*/Admin/Dashboard/*" | head -20

Repository: getdokan/dokan

Length of output: 98


🏁 Script executed:

wc -l ./includes/Admin/Dashboard/Dashboard.php

Repository: getdokan/dokan

Length of output: 102


🏁 Script executed:

sed -n '640,660p' ./includes/Admin/Dashboard/Dashboard.php

Repository: getdokan/dokan

Length of output: 878


🏁 Script executed:

sed -n '620,650p' ./includes/Admin/Dashboard/Dashboard.php

Repository: getdokan/dokan

Length of output: 1290


🏁 Script executed:

# Check if this string is localized anywhere or if there's a pattern of localization in this file
grep -n "esc_html__\|__(\|_e(" ./includes/Admin/Dashboard/Dashboard.php | head -20

Repository: getdokan/dokan

Length of output: 1151


🏁 Script executed:

# Check if there are other instances of target="_blank" in the codebase without rel attribute
rg 'target="_blank"' --type php -A 1 -B 1 | head -50

Repository: getdokan/dokan

Length of output: 5269


🏁 Script executed:

# Check if the string in question uses proper escaping functions
sed -n '645,655p' ./includes/Admin/Dashboard/Dashboard.php

Repository: getdokan/dokan

Length of output: 593


🏁 Script executed:

# Check how the $dom_element is returned/output
sed -n '645,660p' ./includes/Admin/Dashboard/Dashboard.php

Repository: getdokan/dokan

Length of output: 679


🏁 Script executed:

# Check the function signature and how the return value is used
sed -n '627,655p' ./includes/Admin/Dashboard/Dashboard.php

Repository: getdokan/dokan

Length of output: 1103


🏁 Script executed:

# Check how this function is hooked/used
grep -n "add_switching_container" ./includes/Admin/Dashboard/Dashboard.php

Repository: getdokan/dokan

Length of output: 200


🏁 Script executed:

# Check the WordPress security concern about reverse tabnabbing - verify if this is a real concern
# by looking at WordPress documentation patterns
grep -r "rel=\"noopener noreferrer\"" ./includes --include="*.php" | head -10

Repository: getdokan/dokan

Length of output: 901


🏁 Script executed:

# Verify this is an external link to wordpress.org and check if localization pattern is consistent
# Look at other admin footer related strings in the file
grep -n "footer\|admin_footer" ./includes/Admin/Dashboard/Dashboard.php -i

Repository: getdokan/dokan

Length of output: 809


Add rel="noopener noreferrer" for the external rating link and localize the user-facing string.

target="_blank" without rel enables reverse-tabnabbing on external pages. Additionally, the footer text should be localized using esc_html__() with the 'dokan-lite' text domain for consistency with the plugin's localization pattern.

Proposed fix
-        <span id="footer-thankyou">If you like <strong>Dokan</strong> please leave us a <a href="https://wordpress.org/support/plugin/dokan-lite/reviews?rate=5#new-post" target="_blank" class="wc-rating-link" aria-label="five star" data-rated="Thanks :)">★★★★★</a> rating. A huge thanks in advance!</span>
+        <span id="footer-thankyou"><?php esc_html_e( 'If you like ', 'dokan-lite' ); ?><strong>Dokan</strong><?php esc_html_e( ' please leave us a ', 'dokan-lite' ); ?><a href="https://wordpress.org/support/plugin/dokan-lite/reviews?rate=5#new-post" target="_blank" rel="noopener noreferrer" class="wc-rating-link" aria-label="five star" data-rated="Thanks :)">★★★★★</a><?php esc_html_e( ' rating. A huge thanks in advance!', 'dokan-lite' ); ?></span>
🤖 Prompt for AI Agents
In `@includes/Admin/Dashboard/Dashboard.php` around lines 647 - 649, The footer
string assigned to $dom_element contains an external anchor with target="_blank"
and an unlocalized user-facing message; update the anchor to include
rel="noopener noreferrer" to prevent reverse-tabnabbing and wrap the visible
text portion with esc_html__() using the 'dokan-lite' text domain (keep any HTML
markup intact, only localize the user-facing sentence) so the output uses
WordPress internationalization and is secure; locate the assignment to
$dom_element in Dashboard.php and apply these changes to the string building
around the rating link.


return $dom_element;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function enqueue_admin_scripts( $hook ) {
if ( 'toplevel_page_dokan' === $hook ) {
$localize_script = $this->get_admin_localized_scripts();
$vue_admin_localize_script = $this->get_vue_admin_localized_scripts();

wp_enqueue_style( 'dokan-tailwind' );
// Load common styles and scripts
wp_enqueue_script( 'dokan-tinymce' );
wp_enqueue_style( 'dokan-admin-css' );
Expand Down
8 changes: 0 additions & 8 deletions includes/Intelligence/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ public function register_all_scripts() {
}
$asset = include $asset;

wp_register_style(
'dokan-ai-style',
DOKAN_PLUGIN_ASSEST . '/css/dokan-intelligence.css',
[ 'dokan-react-components', 'dokan-react-frontend' ],
$asset['version']
);

wp_register_script(
'dokan-ai-script',
DOKAN_PLUGIN_ASSEST . '/js/dokan-intelligence.js',
Expand All @@ -53,7 +46,6 @@ public function enqueue_ai_assets() {
return;
}

wp_enqueue_style( 'dokan-ai-style' );
wp_enqueue_script( 'dokan-ai-script' );
wp_set_script_translations( 'dokan-ai-script', 'dokan-lite' );
}
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
},
"devDependencies": {
"@automattic/color-studio": "^2.5.0",
"@tailwindcss/container-queries": "^0.1.1",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/postcss": "^4.1.18",
"@tailwindcss/typography": "^0.5.15",
"@wordpress/dependency-extraction-webpack-plugin": "^6.32.0",
"@wordpress/scripts": "^30.25.0",
"@wordpress/env": "^10.26.0",
"@wordpress/scripts": "^30.25.0",
"chartjs-adapter-moment": "^1.0.1",
"debounce": "^1.2.1",
"eslint-import-resolver-typescript": "^3.7.0",
Expand All @@ -49,8 +49,7 @@
"replace-in-file": "^6.3.5",
"tailwind-merge": "^2.6.0",
"tailwind-scrollbar-hide": "^4.0.0",
"tailwindcss": "^3.3.3",
"tailwindcss-scoped-preflight": "^3.4.5",
"tailwindcss": "^4.1.18",
"vue": "^2.7.14",
"vue-chartjs": "^3.5.1",
"vue-color": "^2.8.1",
Expand Down
9 changes: 4 additions & 5 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
}
}
plugins: {
'@tailwindcss/postcss': {},
},
};
16 changes: 0 additions & 16 deletions src/ProFeatures/tailwind.config.js

This file was deleted.

6 changes: 2 additions & 4 deletions src/ProFeatures/tailwind.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
@use '../base-tailwind';
@config './tailwind.config.js';

//@import "@getdokan/dokan-ui/dist/dokan-ui.css";
/* Module-specific styles - Tailwind loaded via dokan-tailwind bundle */
/* No custom styles for this module */
9 changes: 0 additions & 9 deletions src/Status/status-tailwind.config.js

This file was deleted.

5 changes: 2 additions & 3 deletions src/Status/status.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
@use '../base-tailwind';
@config './status-tailwind.config.js';
//@import "@getdokan/dokan-ui/dist/dokan-ui.css";
/* Module-specific styles - Tailwind loaded via dokan-tailwind bundle */
/* No custom styles for this module */
9 changes: 0 additions & 9 deletions src/admin/banner/dashboard-banner-tailwind.config.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/admin/banner/tailwind.scss
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
@import '@getdokan/dokan-ui/dist/dokan-ui.css';
@config './dashboard-banner-tailwind.config.js';
@import './../../base-tailwind';
6 changes: 2 additions & 4 deletions src/admin/components/Commission/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
@config './tailwind-category-commission.config.js';
@tailwind base;
@tailwind components;
@tailwind utilities;
/* Module-specific styles - Tailwind loaded via dokan-tailwind bundle */
/* No custom styles for this module */

This file was deleted.

31 changes: 0 additions & 31 deletions src/admin/dashboard/admin-dashboard-tailwind.config.js

This file was deleted.

9 changes: 0 additions & 9 deletions src/admin/dashboard/pages/dashboard/tailwind.config.js

This file was deleted.

3 changes: 1 addition & 2 deletions src/admin/dashboard/pages/dashboard/tailwind.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@use '../../../../base-tailwind';
@config './tailwind.config.js';
/* Module-specific styles - Tailwind loaded via dokan-tailwind bundle */

// Hide the notice list.
#dokan__notice-list {
Expand Down
13 changes: 6 additions & 7 deletions src/admin/dashboard/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@use '../../base-tailwind';
@config './admin-dashboard-tailwind.config.js';
/* Module-specific styles - Tailwind loaded via dokan-tailwind bundle */
// Define custom animation keyframes

@keyframes completeStep {
Expand All @@ -14,9 +13,9 @@
.animate-complete-step {
animation: completeStep 0.9s ease-in-out;
}
.dokan-lite-module-select-category-popover {
@apply top-5 !important;
}
.dokan-lite-module-select-category-popover {
top: 1.25rem !important;
}

#dokan-admin-dashboard {
.dokan-dashboard-datatable {
Expand Down Expand Up @@ -49,10 +48,10 @@
}

table.dataviews-view-table {
border: 1px solid #E9E9E9;
border: 1px solid #e9e9e9;
th {
background-color: #f9fafb;
border-bottom: 1px solid #E9E9E9;
border-bottom: 1px solid #e9e9e9;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
Expand Down
9 changes: 0 additions & 9 deletions src/admin/header/header-tailwind.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/admin/header/tailwind.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@use '../../base-tailwind';
@config './header-tailwind.config.js';
/* Module-specific styles - Tailwind loaded via dokan-tailwind bundle */
/* No custom styles for this module */
12 changes: 0 additions & 12 deletions src/admin/onboard/onboard-tailwind.config.js

This file was deleted.

3 changes: 1 addition & 2 deletions src/admin/onboard/tailwind.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* Module-specific styles - Tailwind loaded via dokan-tailwind bundle */
@import '@getdokan/dokan-ui/dist/dokan-ui.css';
@config './onboard-tailwind.config.js';
@import './../../base-tailwind';

.dokan-admin-setup-wizard {
margin: 0;
Expand Down
9 changes: 0 additions & 9 deletions src/admin/panel-switcher/panel-switcher-tailwind.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/admin/panel-switcher/tailwind.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@config './panel-switcher-tailwind.config.js';
@import './../../base-tailwind';
/* Module-specific styles - Tailwind loaded via dokan-tailwind bundle */
/* No custom styles for this module */
95 changes: 95 additions & 0 deletions src/base-tailwind.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
@layer theme, base, components, utilities;
@import "tailwindcss/theme.css" layer(theme);
/* ============================================
Tailwind v4 Theme Configuration
Simplified color system with CSS variable support
============================================ */
@theme {
/* Custom breakpoints */
--breakpoint-d-xs: 360px;

/* Primary Colors - Single source of truth */
--color-primary: var(--dokan-primary-color, #7047eb);
--color-primary-hover: var(--dokan-primary-hover-color, #502bbf);
--color-primary-light: var(--dokan-primary-light-color, #daceff);
--color-primary-dark: var(--dokan-primary-dark-color, #322067);

/* Text colors on colored backgrounds (for contrast) */
--color-on-primary: var(--dokan-on-primary-color, #ffffff);
--color-on-info: var(--dokan-on-info-color, #ffffff);
--color-on-success: var(--dokan-on-success-color, #ffffff);
--color-on-warning: var(--dokan-on-warning-color, #ffffff);
--color-on-danger: var(--dokan-on-danger-color, #ffffff);

/* Neutral Colors */
--color-neutral-50: #fafafa;
--color-neutral-100: #f5f5f5;
--color-neutral-200: #e5e5e5;
--color-neutral-300: #d4d4d4;
--color-neutral-400: #a3a3a3;
--color-neutral-500: #737373;
--color-neutral-600: #525252;
--color-neutral-700: #404040;
--color-neutral-800: #262626;
--color-neutral-900: #171717;

/* Border Colors */
--color-border: var(--dokan-border-color, #e5e5e5);
--color-border-light: var(--dokan-border-light-color, #f5f5f5);
--color-border-dark: var(--dokan-border-dark-color, #d4d4d4);

/* Semantic Colors */
--color-info: #0b76b7;
--color-info-light: #e9f9ff;
--color-info-hover: #2795d7;

--color-success: #07a67e;
--color-success-light: #daf8e6;
--color-success-hover: #11b68c;

--color-warning: #e9a905;
--color-warning-light: #fffbeb;
--color-warning-hover: #fbbf24;

--color-danger: #e3050c;
--color-danger-light: #fef3f3;
--color-danger-hover: #f23030;

/* Sidebar Colors */
--color-sidebar: var(--dokan-sidebar-bg, #322067);
--color-sidebar-hover: var(--dokan-sidebar-hover-bg, #7047eb);
--color-sidebar-text: var(--dokan-sidebar-text, #daceff);
--color-sidebar-text-hover: var(--dokan-sidebar-text-hover, #ffffff);
}

/* Base layer styles */
@layer base {
:root {
--colors-primary-500: var(--color-primary);
--wp-components-color-accent: var(--color-primary);
--wp-components-color-accent-darker-20: var(--color-primary-hover);
}

/* Headless UI portal visibility fix */
#headlessui-portal-root {
display: none;
}

/* Z-index for popover/modal layers */
div[data-radix-popper-content-wrapper],
div[data-headlessui-state="open"][role="dialog"] {
z-index: 999 !important;
}
}

.dokan-layout {
@import "tailwindcss/preflight.css" layer(base);
@import "tailwindcss/utilities.css";

/* Import custom component styles */
@import './dokan-components.css';

border-color: var(--color-border);

}
@import '@getdokan/dokan-ui/dist/dokan-ui.css';
Comment on lines +85 to +95
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, let's examine the complete src/base-tailwind.css file to understand the context
wc -l src/base-tailwind.css

Repository: getdokan/dokan

Length of output: 172


🏁 Script executed:

# Read the file to see the actual import structure and context around lines 85-95
cat -n src/base-tailwind.css | head -100

Repository: getdokan/dokan

Length of output: 3863


Move all @import statements outside of selector blocks to the top of the stylesheet.

@import rules cannot appear inside selectors or other blocks—they must be at the stylesheet root. Lines 86-90 place imports inside the .dokan-layout selector block, causing them to be ignored by browsers. Additionally, the import at line 95 should appear before style rules to ensure proper style layering.

🐛 Proposed fix
 `@layer` theme, base, components, utilities;
 `@import` "tailwindcss/theme.css" layer(theme);
+@import "tailwindcss/preflight.css" layer(base);
+@import "tailwindcss/utilities.css";
+@import './dokan-components.css';
+@import '@getdokan/dokan-ui/dist/dokan-ui.css';
 /* ============================================
    Tailwind v4 Theme Configuration
    ...
 `@layer` base {
     ...
 }
 
 .dokan-layout {
-    `@import` "tailwindcss/preflight.css" layer(base);
-    `@import` "tailwindcss/utilities.css";
-
-    /* Import custom component styles */
-    `@import` './dokan-components.css';
-
     border-color: var(--color-border);
 
 }
-@import '@getdokan/dokan-ui/dist/dokan-ui.css';
🧰 Tools
🪛 Biome (2.1.2)

[error] 95-95: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)

🤖 Prompt for AI Agents
In `@src/base-tailwind.css` around lines 85 - 95, The `@import` rules currently
inside the .dokan-layout block must be moved to the top of the stylesheet and
placed before any selectors so they are not ignored; remove the `@import`
"tailwindcss/preflight.css" layer(base), `@import` "tailwindcss/utilities.css",
`@import` './dokan-components.css', and `@import`
'@getdokan/dokan-ui/dist/dokan-ui.css' from inside .dokan-layout and place them
at the top of src/base-tailwind.css in the intended order (preflight, utilities,
dokan-components, dokan-ui) while leaving only the CSS declarations such as
border-color: var(--color-border); inside the .dokan-layout selector.

Loading
Loading