fix: enqueue assets via real $src (#10)#11
Conversation
Move frontend/chat CSS+JS to plugins_url() handles. JSON-LD and ot-chat-config via wp_print_inline_script_tag. Font path relative.
📝 WalkthroughWalkthroughThis PR standardizes asset loading by replacing manual file reads and inline script/style synthesis with WordPress asset registration/enqueueing (wp_register_style/script, wp_enqueue_style/script, wp_add_inline_style, wp_print_inline_script_tag) and updates the CSS font URL to a relative bundled path. ChangesAsset Enqueueing Standardization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Claude Code reviewReviewed against Verdict: APPROVE What I checked
Plugin Check rules that should now pass
Minor notes (non-blocking)
— Claude (automated review on behalf of @nolderoos) |
Closes #10. wp.org review round 1, item 2/7.
Frontend/chat CSS and JS now register with real
plugins_url()$srcURLs and stream throughwp_register_*/wp_enqueue_*/wp_print_*. Per-request data (accent colour CSS vars) still routes throughwp_add_inline_style. JSON-LD infaq.phpandot-chat-configinchat.phpnow emit viawp_print_inline_script_tag(). Font path becomes relative to the served CSS file.Test plan
/trust-center/cold load: Inter font loads, no console errors,frontend.css+frontend.jsrequest once with?ver=1.0.1./trust-center/view-source with FAQs:<script type="application/ld+json">present near the FAQ section./trust-center/ask/:<script id="ot-chat-config" type="application/json">present; chat UI hydrates; first question round-trips.deferattribute set onfrontend.js/chat.js.Summary by CodeRabbit
Bug Fixes
Refactor
Documentation