我无法在 wp-admin 区域或使用 wp-cli 激活或停用插件

I cannot activate or deactivate plugins in wp-admin area or using wp-cli

我在客户的实时 WordPress 网站上遇到问题,我无法激活或停用插件。我是一名管理员,曾经能够做到这一点。我可以添加新插件但无法激活。

如果能深入了解我接下来可以尝试什么,我将不胜感激。

我正在使用 WordPress v5.2.4 和 PHP v7.3 以及 MariaDB。

在 wp-admin 中,当我尝试激活插件时,我看到一条已成功激活的消息,但实际上什么也没有发生。我在 wp-cli 中看到了相同的行为。请参阅下面粘贴的代码。

我看过其他人遇到同样问题的帖子。

一个建议的答案是从文件系统中删除所有插件。我不愿意这样做,因为它是一个实时客户端站点,但我已停用 mainwp-child,因为它不会影响该站点的访问者。

另一个建议的答案是数据库中的选项 table 可能已损坏。我能够更新数据库中的 active_plugins 记录以停用插件,所以我认为不是这个。

linuxuser@aws-server:~/files$ wp plugin list
+-------------------------------+----------+--------------------------------+------------+
| name                          | status   | update                         | version    |
+-------------------------------+----------+--------------------------------+------------+
| all-in-one-wp-security-and-fi | inactive | none                           | 4.4.2      |
| rewall_old_                   |          |                                |            |
| classic-editor                | active   | none                           | 1.5        |
| contact-form-7                | active   | none                           | 5.1.5      |
| youtube-embed-plus            | active   | none                           | 13.1.2.1   |
| google-analytics-for-wordpres | active   | none                           | 7.10.0     |
| s                             |          |                                |            |
| limit-login-attempts-reloaded | inactive | none                           | 2.9.0      |
| rankya-localbusiness-markup-s | active   | none                           | 1.1        |
| chema                         |          |                                |            |
| mainwp-child                  | active   | none                           | 4.0.4      |
| spinupwp                      | active   | none                           | 1.1.2      |
| stream                        | inactive | none                           | 3.4.2      |
| updraftplus                   | active   | version higher than expected   | 2.16.20.24 |
| vc_clipboard                  | active   | none                           | 3.25       |
| js_composer                   | active   | none                           | 6.0.5      |
| goodbye-captcha               | active   | none                           | 3.1.34     |
| wp-bruiser-contactform7       | active   | none                           | 3.1.34     |
| wp-mail-smtp                  | active   | none                           | 1.7.1      |
| wordpress-seo                 | active   | none                           | 12.5       |
| spinupwp-debug-log-path       | must-use | none                           | 1.0        |
| object-cache.php              | dropin   | none                           |            |
+-------------------------------+----------+--------------------------------+------------+

我通过重命名和更新数据库中的选项 table 设法停用了 all-in-one-wp-security-and-firewall。我想激活 limit-login-attempts-reloaded

linuxuser@aws-server:~/files$ wp plugin activate limit-login-attempts-reloaded
Plugin 'limit-login-attempts-reloaded' activated.
Success: Activated 1 of 1 plugins.

但它没有:

+-------------------------------+----------+--------------------------------+------------+
| name                          | status   | update                         | version    |
+-------------------------------+----------+--------------------------------+------------+
| all-in-one-wp-security-and-fi | inactive | none                           | 4.4.2      |
| rewall_old_                   |          |                                |            |
| classic-editor                | active   | none                           | 1.5        |
| contact-form-7                | active   | none                           | 5.1.5      |
| youtube-embed-plus            | active   | none                           | 13.1.2.1   |
| google-analytics-for-wordpres | active   | none                           | 7.10.0     |
| s                             |          |                                |            |
| limit-login-attempts-reloaded | inactive | none                           | 2.9.0      |
| rankya-localbusiness-markup-s | active   | none                           | 1.1        |
| chema                         |          |                                |            |
| mainwp-child                  | active   | none                           | 4.0.4      |
| spinupwp                      | active   | none                           | 1.1.2      |
| stream                        | inactive | none                           | 3.4.2      |
| updraftplus                   | active   | version higher than expected   | 2.16.20.24 |
| vc_clipboard                  | active   | none                           | 3.25       |
| js_composer                   | active   | none                           | 6.0.5      |
| goodbye-captcha               | active   | none                           | 3.1.34     |
| wp-bruiser-contactform7       | active   | none                           | 3.1.34     |
| wp-mail-smtp                  | active   | none                           | 1.7.1      |
| wordpress-seo                 | active   | none                           | 12.5       |
| spinupwp-debug-log-path       | must-use | none                           | 1.0        |
| object-cache.php              | dropin   | none                           |            |
+-------------------------------+----------+--------------------------------+------------+

这是我运行并在数据库中提交的更新语句:

update options 
set option_value = 'a:15:{i:0;s:33:"classic-editor/classic-editor.ph
p";i:1;s:36:"contact-form-7/wp-contact-form-7.php";i:2;s:35:"goodbye-ca
ptcha/goodbye-captcha.php";i:3;s:50:"google-analytics-for-wordpress/goo
gleanalytics.php";i:4;s:27:"js_composer/js_composer.php";i:5;s:29:"main
wp-child/mainwp-child.php";i:6;s:73:"rankya-localbusiness-markup-schema
/rankya-localbusiness-markup-schema.php";i:7;s:21:"spinupwp/spinupwp.ph
p";i:8;s:17:"stream/stream.php";i:9;s:27:"updraftplus/updraftplus.php"
;i:10;s:29:"vc_clipboard/vc_clipboard.php";i:11;s:24:"wordpress-seo/wp-
seo.php";i:12;s:51:"wp-bruiser-contactform7/wp-bruiser-contactform7.php
";i:13;s:29:"wp-mail-smtp/wp_mail_smtp.php";i:14;s:30:"youtube-embed-pl
us/youtube.php";}'
where option_name = 'active_plugins';

虽然插件仍然显示在 wp-cli 的输出中:

array (
  0 => 'goodbye-captcha/goodbye-captcha.php',
  1 => 'all-in-one-wp-security-and-firewall/wp-security.php',
  2 => 'classic-editor/classic-editor.php',
  3 => 'contact-form-7/wp-contact-form-7.php',
  4 => 'google-analytics-for-wordpress/googleanalytics.php',
  5 => 'js_composer/js_composer.php',
  6 => 'mainwp-child/mainwp-child.php',
  7 => 'rankya-localbusiness-markup-schema/rankya-localbusiness-markup-schema.php',
  8 => 'spinupwp/spinupwp.php',
  9 => 'updraftplus/updraftplus.php',
  10 => 'vc_clipboard/vc_clipboard.php',
  11 => 'wordpress-seo/wp-seo.php',
  12 => 'wp-bruiser-contactform7/wp-bruiser-contactform7.php',
  13 => 'wp-mail-smtp/wp_mail_smtp.php',
  14 => 'youtube-embed-plus/youtube.php',
)

它不在数据库中 active_plugins(select 语句 运行 在 mainwp_child 停用后):

MariaDB [dbname]> select option_value
    -> from pfx_options
    -> where option_name = 'active_plugins';
| option_value              
| a:13:{i:0;s:35:"goodbye-captcha/goodbye-captcha.php";i:2;s:33:"classic-editor/classic-ed
itor.php";i:3;s:36:"contact-form-7/wp-contact-form-7.php";i:4;s:50:"google-analytics-for-w
ordpress/googleanalytics.php";i:5;s:27:"js_composer/js_composer.php";i:7;s:73:"rankya-loca
lbusiness-markup-schema/rankya-localbusiness-markup-schema.php";i:8;s:21:"spinupwp/spinupw
p.php";i:9;s:27:"updraftplus/updraftplus.php";i:10;s:29:"vc_clipboard/vc_clipboard.php";i:
11;s:24:"wordpress-seo/wp-seo.php";i:12;s:51:"wp-bruiser-contactform7/wp-bruiser-contactfo
rm7.php";i:13;s:29:"wp-mail-smtp/wp_mail_smtp.php";i:14;s:30:"youtube-embed-plus/youtube.p
hp";} |

如果你已经做到了这一步,谢谢。如果您有任何想法,我真的很乐意尝试。

亲切的问候,

梅艳芳

正如我在问题的评论部分提到的,它看起来像是一个缓存问题。

在这个例子中,当您评估 Breeze 时,它​​可能与 object-cache.php and/or 有关。如果不重现问题,我不能说具体的事情。

但是,恕我直言在制作中播放时,如果您更改代码中的某些内容并且看不到假定的输出,则它很可能被缓存了 或您更改了错误的文件或您的代码尚未部署。

投注始终在缓存中。祝你下次好运。