[wordpress插件] Delete Expired Transients删除过期的瞬态

wordpress 插件 文章 2020-04-14 22:20 638 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

Delete old, expired transients from the WordPress options table (wp_options), to prevent them from bloating your database and even slowing down your website.

从WordPress选项表( wp_options )中删除过期的旧瞬态,以防止它们使数据库膨胀甚至使网站变慢。

Unless you are using an object cache (like memcached), WordPress stores transient records in the options table.

除非您使用对象缓存(如memcached),否则WordPress将瞬态记录存储在options表中。

Many transients are given an expiration time, so in theory they should disappear after some time.

许多瞬态都有一个到期时间,因此理论上它们应该在一段时间后消失。

In practise, because old transients are only deleted when requested again after they’ve expired, many transients stay in the database.

实际上,由于旧的瞬变仅在过期后再次请求时才被删除,因此许多瞬变会保留在数据库中。

After a while, there can be thousands or even millions of expired transients needlessly taking up space in your options table, depending on what your plugins are doing.

一段时间后,可能有成千上万的过期瞬态不必要地占用了选项表中的空间,具体取决于您的插件在做什么。

Delete Expired Transients schedules a daily task to delete any expired transients from the options table.

删除过期的瞬变计划一个日常任务,以从选项表中删除任何过期的瞬变。

It performs this operation with a single SQL query, and then runs a second query to find any orphaned expiration records and deletes them too.

它使用单个SQL查询执行此操作,然后运行第二个查询以查找任何孤立的到期记录并删除它们。

There are a few other plugins around that clean up expired transients.

周围还有一些其他插件可以清除过期的瞬变。

This one is written for fast performance, set-and-forget scheduled housekeeping, and maximum compatibility.

编写此文件是为了实现快速性能,设置并忘记预定的内务处理以及最大的兼容性。

It uses the PHP time to determine whether transients are expired, not the database time (which can be different).

它使用PHP时间来确定瞬变是否已过期,而不是数据库时间(可以不同)。

It does only one job, and it does it well with the minimum of resources.

它只做一项工作,而且用最少的资源就能很好地完成工作。

Now optimised for WordPress Multisite.

现在针对WordPress多站点进行了优化。

Translations

翻译

Many thanks to the generous efforts of our translators:

非常感谢我们翻译人员的慷慨努力:

安装步骤

    1. Upload this plugin to your /wp-content/plugins/ directory.
    2. 将此插件上传到您的/ wp-content / plugins /目录。

    3. Activate the plugin through the ‘Plugins’ menu in WordPress.
    4. 通过WordPress中的“插件”菜单激活插件。

    That’s it!

    就是这样!

    Expired transients will be deleted the next time you visit your website, and then again once every day after that.

    下次您访问网站时,过期的瞬态信息将被删除,此后每天都将再次删除。

下载地址
https://downloads.wordpress.org/plugin/delete-expired-transients.2.0.7.zip
-EOF-

AI助手支持GPT4.0