• Resolved adejones

    (@adejones)


    Hi, I have just backed up one of my websites which has v5.1.9 of the plugin, then tried to restore it on another domain and instantly got “There has been a critical error on this website.”

    The error_log contains:
    [01-Jun-2023 13:30:34 UTC] PHP Fatal error: Cannot declare class AIOWPSecurity_Utility_File, because the name is already in use in /home/swclients/public_html/k84015/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-utility-file.php on line 6

    Tried to roll back to 5.1.8 and 5.1.7 but this didn’t fix it. Have used the plugin for years, and have cloned this website 200+ times without issue and this is a new one on me, no idea how or why, but any ideas?

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter adejones

    (@adejones)

    What i’ve had to do is deactivate the plugin by renaming the directory via FTP, log in to WP dashboard, then via FTP I have deleted /wp-content/uploads/aios, also deleted /wp-content/mu-plugins/aios-firewall-loader.php (because without removing these 2, I couldn’t reactivate the plugin), then re-activate and re-insert the rules.

    But this seems to be a lengthy and annoying process to have to do from now on each time I clone a site, which i’ve never had problems with before – has something been updated? And how am I now best restoring backups of my sites?

    Thanks

    Thread Starter adejones

    (@adejones)

    Just to help with your investigation in to this, I have compared the site I clone from (the one I tried to restore on a new domain), with one of my other sites.

    My other site does not have the following in .htaccess:

    # Begin AIOWPSEC Firewall
    	<IfModule LiteSpeed>
    		php_value auto_prepend_file '/home/blabla/public_html/demo/aios-bootstrap.php'
    	</IfModule>
    	<IfModule lsapi_module>
    		php_value auto_prepend_file '/home/blabla/public_html/demo/aios-bootstrap.php'
    	</IfModule>
    # End AIOWPSEC Firewall

    And I suspect this is because I haven’t yet clicked “Upgrade your protection now” on this message:
    “We have detected that your AIOS firewall is not fully installed, and therefore does not have the highest level of protection. Your firewall will have reduced functionality until it has been upgraded.”

    So by clicking that button, what else does that do apart from add the above lines in to the .htaccess file? and when was this introduced?

    I only ‘upgraded the protection’ on my demo website a few days ago so this process must have been the cause of this new issue I am having with restoring the backup, why would it do this?

    Thanks.

    Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @adejones

    This issue might be due to the site has been copied from some where other site and still the path in wp-config.php., htaccess, .user.ini, aios-bootstrap.php are of the old site which is loading the class form another copy of website on the same hosting.

    Or in parent folder another site will have the AIOS installed and from its the aios-bootstrap.php being called and prepend file.

    Regards

    Thread Starter adejones

    (@adejones)

    Hi @hjogiupdraftplus – thanks for the reply. That seems about right, I did another clone and got the error but then removed the /wp-content/mu-plugins/aios-firewall-loader.php file and I was able to proceed with my set up process.

    I assume this is something added in to the latest update? Is there anything in particular I can disable in the settings to remove this file from my main sites mu-plugins directory to make my future cloning a bit easier?

    Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @adejones

    Latest update do not have any change regarding the mu-plugins /aios-firewall-loader.php related. but yes how it gets added using the full path that is changed due to for some new install undetermined context issue.

    Right now there is no any such settings to remove that file.

    Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @adejones

    This recently identified issue regarding can not redeclare class have been solved by us.


    Please upload the zip as Add new plugin and replace it with existing AIOS plugin.

    https://gofile.io/d/QNwe88

    This fix is going to be in the next version release.

    Thread Starter adejones

    (@adejones)

    Thanks, uploaded the zip yesterday, cloned my site again for another customer today and didn’t have any issues.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Cannot declare class AIOWPSecurity_Utility_File’ is closed to new replies.