[wordpress插件] Disable Plugins禁用插件

wordpress 插件 文章 2020-04-18 08:01 922 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

One of WordPress’ biggest bottlenecks is that it loads every single plugin that

WordPress的最大瓶颈之一是它会加载每个单独的插件,

is active on your WordPress installation on every single post/page no matter

无论每个帖子/页面上的WordPress安装都处于活动状态,

whether they are needed for that post/page or not.

该帖子/页面是否需要它们。

This plugin will allow you

此插件将允许您

to create simple rewrite rules to exclude a plugin or plugins from any URI

创建简单的重写规则以从任何URI中排除一个或多个插件

pattern match.

模式匹配。

This is a great way to reduce the memory footprint, SQL queries

这是减少内存占用的好方法,SQL查询

run at page load, load times, and improve site response speed.

在页面加载,加载时间运行并提高站点响应速度。

This is NOT a normal WordPress plugin, but an mu (must use) plugin and requires

这不是普通的WordPress插件,而是 mu (必须使用)插件,需要

special installation instructions.

特殊安装说明。

Please see the installation section for more

请参阅安装部分以获取更多信息

information.

信息。

Requirements: PHP5+, WordPress 2.9.x+

要求:PHP5 +,WordPress 2.9.x +

安装步骤

Create a /wp-content/mu-plugins/disable-plugins-rules directory if the plugin

如果插件
,则创建一个 / wp-content / mu-plugins / disable-plugins-rules 目录

has not created one for you already.

尚未为您创建一个。

Create a rules file for each site your

为您的每个站点创建一个规则文件

WordPress installation is running, naming the file after the host name for

WordPress安装正在运行,将文件的主机名命名为

the site followed by a .rules extension.

该网站后跟 .rules 扩展名。

For example mywordpresssite.com.rules

例如 mywordpresssite.com.rules

would be a rules set for mywordpresssite.com.

将是为 mywordpresssite.com 设置的规则。

Populate your rules using regular expression pattern matches and plugin base

使用正则表达式模式匹配和插件库填充规则

names on each line of your rules file.

规则文件每一行上的名称。

For example, to exclude the Hello Dolly

例如,排除 Hello Dolly

and Akisment plugins from being loaded on your home page, you would write

Akisment 插件加载到您的首页后,您将编写

a rules file that looks like:

规则文件如下:

# Prevent the Hello Dolly plugin from loading on the home page

 #阻止将Hello Dolly插件加载到主页上

^\/$ hello

^ \ / $你好

# Prevent the Akisment plugin from loading on the home page

#阻止将Akisment插件加载到主页上

^\/$ akismet

^ \ / $ akismet

You will need to write a rule for each plugin that will be excluded for each

您将需要为每个插件编写一个规则,每个规则都将排除在外

pattern that you wish to exclude that plugin from.

您希望从中排除该插件的模式。

C style comments are

C风格的注释是

allowed in your rules file to document your rules.

允许在规则文件中记录规则。

下载地址
https://downloads.wordpress.org/plugin/disable-plugins.zip
-EOF-

AI助手支持GPT4.0