OK, I found the culprit. It’s this line in function set_firewall_configs():
if (version_compare($firewall_version, ‘1.0.1’, ‘<‘))
where $firewall_version is assigned the value of get_option(‘aiowpsec_firewall_version’);
We’re on version 5.1.0, where this option doesn’t exist, and when updating to a higher version the get_option apparently returns a value of false. However, version_compare() expects 2 strings, and I assume that when it gets a parameter that’s not a string, that triggers something that causes the 504 error.
I’ve found a workaround for this, so I don’t know of you actually have to fix something in the plugin’s code. I do the following:
- Download latest plugin version and unzip to a folder
- I comment out lines 480-494 in all-in-one-wp-security-and-firewall\classes\wp-security-configure-settings.php
- I upload this folder to the site and activate the plugin.
- Following this successful upgrade, I uncomment those lines. This is possible due to the fact that line 496 in that file updates the option ‘aiowpsec_firewall_version’.
That’s all ??