Content Security Policy breaks WP Data Access
-
Hello Peter,
Sorry to bother you again.
I’m trying to implement better security on my website by implementing a Content Security Policy, but when I do so, it appears to stop WP Data Access working!
I am not red-hot on CSPs at the best of times, but have implemented one as follows:
default-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' http:; style-src 'unsafe-inline' http:; img-src http: data:; font-src http: data:; sandbox allow-forms allow-scriptsWhen I switch that on, the web page displays OK, but the ‘list of composers’ stuff that is meant to display an alphabetical list of composers from a WP Data Access table merely displays the word ‘ComposerName’ twice. It happens on any page, actually, that’s trying to fetch content from a Data Access table.
Clearly, my CSP instruction to use ‘unsafe-inline, unsafe-eval and http’ script sources is interfering in WP Data Access’s ability to actually fetch data from its table.
If I delete the Content-Security-Policy entirely, it all works as normal.
Can you shed any light on what bits of the policy I need to relax to get WPDA working normally, please? I don’t think it’s really a WP Data Access problem, to be fair, so if you declare it’s out-of-scope, that’s fine.
I’ll leave the broken website up for a while, so you can see it not working. I’ll have to fix it at some point though, so if it all looks perfect if/when you visit, it will be because I’ve reverted the CSP!
Best wishes,
HowardThe page I need help with: [log in to see the link]
The topic ‘Content Security Policy breaks WP Data Access’ is closed to new replies.