-
Notifications
You must be signed in to change notification settings - Fork 216
Fix set non-existing store page to return 404 error #2923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Walkthroughstore_template now signals WordPress 404 (sets global query and header) for invalid or non-existent store users before returning the 404 template. store_page_breadcrumb prepopulates the store listing crumb and returns an explicit "Error 404" crumb when no seller is found. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant WP as WordPress Router
participant R as includes/Rewrites.php:store_template
participant Q as WP_Query
participant T as Theme
U->>WP: Request /store/{slug}
WP->>R: Route to store_template
R->>R: Validate store_user (exists, not vendor_staff, is seller)
alt Invalid store
R->>Q: set is_404 = true
R->>WP: status_header(404)
WP->>T: Load 404 template
T-->>U: Render 404 page (is_404()=true)
else Valid store
R->>T: Continue normal store template
T-->>U: Render store page
end
sequenceDiagram
autonumber
participant C as includes/Rewrites.php:store_page_breadcrumb
participant S as Seller Lookup
participant B as Breadcrumb Array
C->>B: crumbs[1] = Store Listing (formatted)
C->>S: Find seller by slug
alt Seller not found
C->>B: crumbs[2] = "Error 404"
C-->>B: Return crumbs
else Seller found
C->>B: Populate seller-specific crumbs
C-->>B: Return crumbs
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
includes/Rewrites.php(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
includes/Rewrites.php (1)
includes/functions.php (3)
dokan_get_option(1014-1024)dokan_get_store_url(1082-1110)dokan_is_user_seller(73-79)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: e2e tests (2, 3)
- GitHub Check: e2e tests (3, 3)
- GitHub Check: e2e tests (1, 3)
- GitHub Check: api tests (1, 1)
DO NOT MERGEFatal error on this branch.. [13-Oct-2025 09:23:21 UTC] PHP Fatal error: Uncaught Error: Class "WeDevs\Dokan\Intelligence\Services\Provider" not found in /Users/wedevs/Documents/Sites/dokantesting/wp-content/plugins/dokan-pro/includes/Intelligence/Provider/BriaAi.php:16 |
All Submissions:
Closes
How to test the changes in this Pull Request:
Changelog entry
No needed
Summary by CodeRabbit