Background
This is a workaround if you use the Prime Mover plugin in hosts that don’t allow you to write files to the mu-plugins
directory.
In some instances – where the Prime Mover script inside mu-plugins
the directory is not writable, you get a similar error when you upgrade to Prime Mover 2.0.0+ from Prime Mover 1.9.9 (and exporting any site):
PHP Fatal error: Uncaught Error: Call to undefined method Codexonics\PrimeMoverFramework\general\PrimeMoverMustUsePluginManager::getAutoBackupCronInitialized()
This is because Prime Mover 2.0.0+ is a significant update from the previous version, 1.9.9. An updated script must be written for the mu-plugins
directory.
The script in the mu-plugins
directory must be updated and compatible with the one being used by the Prime Mover plugin (latest version)
/wp-content/mu-plugins/prime-mover-cli-plugin-manager.php
Solution
Let’s fix this manually on your end. Before we start, ensure you know the plugin slug to use when finding these paths on your server. If you are activating the pro version, the plugin slug should be prime-mover-pro
so the path to your plugin manager script should be:
/wp-content/plugins/prime-mover-pro/scripts/prime-mover-cli-plugin-manager.php
For the free version, it should be:
/wp-content/plugins/prime-mover/scripts/prime-mover-cli-plugin-manager.php
These are the steps:
- Ensure you always use the latest version of the Prime Mover plugin (PRO or FREE version).
- Make sure the plugin is deactivated (network deactivated if multisite).
- Login to your WordPress directory via SFTP or your hosting file manager.
- Delete this outdated Prime Mover script file (if it exists):
/wp-content/mu-plugins/prime-mover-cli-plugin-manager.php
- [Optional] If this file cannot be deleted, then you don’t have access to delete it, so you must contact your hosting technical support to delete it.
- Copy this updated file FROM (e.g., if the free version is used, use the PRO version path above if required):
/wp-content/plugins/prime-mover/scripts/prime-mover-cli-plugin-manager.php
And paste it into the mu-plugins
directory:
/wp-content/mu-plugins/
This updates the Prime Mover plugin manager script inside the mu-plugins
directory to its latest version.
- [Optional] Now, if you cannot copy the above to the mu-plugins directory – it’s because you don’t have access to it or your hosting won’t allow it. In this case – please get in touch with your hosting technical support to manually copy the specified file to the
mu-plugins
directory.
- Finally, once the script is updated, activate the Prime Mover 2.0.4 again (network activate if multisite). You should be able to activate the plugin without any errors. The export should work with the latest version, and the plugin should operate normally, just as expected.
Importance of Prime Mover mu-plugins
directory script
This file is crucial since it controls the entire plugin’s operations at runtime, including export and import. If it is not updated, several issues can occur, including the inability to export and import and performance issues related to the database. In summary, without this update or if you are using an outdated version, you cannot use the Prime Mover plugin on your site.