Mu-plugin causes entire site to crash [closed]

is_plugin_active isn’t available for mu-plugins to use. The codex says: NOTE: defined in wp-admin/includes/plugin.php, so this is only available from within the admin pages, and any references to this function must be hooked to admin_init or a later action. If you want to use this function from within a template or a must-use plugin, you … Read more

Add OR in mu-plugin to check if one of multiple users is the logged in user

Your question boils down to simple PHP. It is basically how to avoid ‘AdminUser’ !== $user->user_login || ‘AdminUser2’ !== $user->user_login || ‘AdminUser3’ !== $user->user_login || ‘AdminUser4’ !== $user->user_login || etc. One way to solve this is use in_array() instead: $allowed_users = [ ‘AdminUser’, ‘AdminUser2’, ‘AdminUser3’, // etc ]; $user = wp_get_current_user(); if($user && isset($user->user_login) && … Read more

mu-plugins aren’t loading

The reason plugins in the mu-plugins folder can’t be activated in the plugins page is because that’s not how mu-plugins works. The mu stands for must use. Improtant things to know: mu-plugins load before plugins WP loads PHP files in the mu-plugins folder it does not search subfolders it does not look for plugin headers … Read more

Hide mu-plugins list

The solution to this request is filtering show_advanced_plugins. This filter is called twice, once for mustuse– and once for dropins-plugins. The filter accepts two parameters, the first one being the standard value (true), and the second one being the type of the advanced plugin (Must-Use and Drop-In). So returning false does the trick, if your … Read more