Someone keeps changing my SITEURL (mysql injection or xss?) [closed]

YOu need to deeply look throughout your site for the ‘infection’/malware code. This would include the following steps: update everything (WP, themes, plugins) change credentials on everything (hosting, FTP, admin-level users) create a new admin user, log in as it, then delete the user called ‘admin’ (or demote to ‘subscriber’) look at all folders for … Read more

Content-Security-Policy blocks WordPress check boxes from being activated

Thanks to Jacob’s hint I got the solution. This one is working. Header set Content-Security-Policy “base-uri ‘self’; default-src ‘self’; font-src ‘self’ data: https://fonts.gstatic.com; frame-src https://www.google.com https://www.youtube.com; img-src data: ‘self’ https://secure.gravatar.com; script-src ‘self’ ‘unsafe-inline’ ; style-src ‘self’ ‘unsafe-inline’ https://fonts.googleapis.com; object-src ‘self’; form-action ‘self’; frame-ancestors ‘self’;” The difference is the data: in the ìmg-src section.

should I escape a literal url added in functions.php

No, you don’t have to escape values that cannot be changed by someone else. You should escape output that might be changed by some other source, for example if there is a filter running on the values. Let’s say you are using wp_upload_dir() to find the upload directory – and you absolutely should, because the … Read more