Hi @sophieworpress, thanks for getting in touch.
Can I clarify whether the optimize button is physically unclickable or whether the actions taken do not result in any changes?
Try disabling all plugins except for Wordfence and changing your theme to a default like Twenty Twenty-One. Do you still experience the same issue? If not, there is a conflict elsewhere that can be found by re-enabling the plugins and theme one-by-one until the problem reoccurs. Sometimes our Javascript can be stopped from running if there are other errors on the page caused by these conflicts. This will usually show as red text in your browser console. Feel free to paste errors to me here, or take a screenshot and share it with me using a service like Snipboard so we can try to troubleshoot it for you.
However if the issue is the optimization itself, ensure the permissions for WordPress folders are 755
and the owner on your WordPress root directory (and all contained directories) is www-data
. Web servers such as Apache, Nginx, etc will require www-data to be an owner so that WordPress and plugins can update and run functions required to do so. Please check this first.
The following links may also be of assistance, as the troubleshooting guide can assist you in modifying your .user.ini manually:
https://www.wordfence.com/help/firewall/optimizing-the-firewall/#firewall-optimization-setup
https://www.wordfence.com/help/firewall/optimizing-the-firewall/troubleshooting/
Let me know what you find out.
Thanks,
Peter.