I am logged into a WordPress site backend as an administrator. The theme was built using the Sage Starter Theme.
During development there was no issue with adding plugins or upgrading the core, but since moving to production, there is no “Add New” button for plugins and the upgrade message reads “WordPress 4.3 is available! Please notify the site administrator.”
I tried manually changing the db_version
field of the wp_options
table to force a database upgrade. This didn’t work.
I tried disabling all plugins and changing to the twentyten theme – this did not work.
Checked all permissions on the server – no joy.
How can I resolve this issue?
The latest Sage Starter theme uses a
.env
file to set up environments via thephpdotenv
library. It lives in a directory above the public HTML web root of the WordPress installation.If you changed the line
WP_ENV=development
toWP_ENV=production
in the.env
file when the site went live, then it’s likely this is the source of the issue.If you look at the actual configuration for the production environment in
/config/environments/production.php
, you see the following:This tells WordPress not to allow manual addition of plugins or allow core updates. You can simply edit this to be:
After you’ve modified the core or added plugins, you can simply change it back if you don’t want admins to have this power, but a better solution would be to install a capability manager plugin and define an admin role with slightly lower privileges.
For anyone else with this problem, there is another line that you may have to find in your wp-config or functions file and change to false:
I can’t find the line
define('DISALLOW_FILE_MODS', true);
ordefine('DISALLOW_FILE_MODS', false);
in mywp-config.php
file.My solution: I just added the line
define('DISALLOW_FILE_MODS', false);
inwp-config.php
file afterdefine('DB_HOST', 'localhost'); /* or anywhere */
That SOLVED my problem and I was able to update again core, theme and plugins.
In my case, the problem was caused by the removed permissions for my “administrators” user group.
More exactly the
update_core
were missing inwp_options
tableoption_name = %wp-table-prefix%_wp_user_roles
The easiest way to fix it is to install PublishPress Capabilities plugin and you can find it in the “Admin” tab. First, click black X (negate all) and save and then you can enable it.
The same maybe for plugins and themes updates.