Menu

#63 Installing custom mu-plugins

open
nobody
None
2020-09-17
2020-09-17
Anonymous
No

Originally created by: corzel

Hi,

If someone needs to install a custom mu-plugin with a single php file, according to documentation: "WordPress only looks for PHP files right inside the mu-plugins directory, and (unlike for normal plugins) not for files in subdirectories".
By default SlickStack delete and recreate mu-plugins folder every day, so if you copy manually your mu-plugin this will be erased all the time.

So, to install it you can follow the following steps:

  1. Zip your php file: my_mu-plugin.php -> my_mu-plugin.zip
  2. Upload the zip file somewhere accessible in your server or externally. I used my own uploads directory. https://mydomain.xyz/wp-content/uploads/my_mu-plugin.zip
  3. Edit ss-config:
    SS_MU_PLUGINS="custom"

Add new lines at the end of mu-plugins list, change XX for the next number of the list. As a destination directory put the name of you PHP file.

MU_PLUGIN_XX_SOURCE="https://mydomain.xyz/wp-content/uploads/my_mu-plugin.zip"
MU_PLUGIN_XX_DIR="my_mu-plugin.php"
  1. Run ss-install-wordpress-mu-plugins
    sudo bash /var/www/ss-install-wordpress-mu-plugins

  2. Check if your php file is in mu-plugins folder. The modification date/time must be the same (+- secs) than autoloader.php & xxx-notices.php

That's is all.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB