[wordpress插件] Transient Cleaner瞬态清洁剂

wordpress 插件 文章 2020-02-21 14:30 555 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

As of version 4.9 of WordPress, transient housekeeping now takes place automatically – this plugin is therefore no longer required!

从WordPress 4.9版开始,临时内务处理现在会自动进行-因此不再需要此插件!

Housekeep expired transients from your options table.

您的选项表中的房屋保管过期瞬变。

The original and best!

原来最好的!

“Transients are a simple and standardized way of storing cached data in the WordPress database temporarily by giving it a custom name and a timeframe after which it will expire and be deleted.”

“瞬态是一种简单且标准化的方式,可以通过为缓存的数据提供自定义名称和时间范围来临时将缓存的数据临时存储在WordPress数据库中,在此时间之后它将过期并被删除。”

Unfortunately, expired transients only get deleted when you attempt to access them.

不幸的是,过期的瞬变仅在您尝试访问它们时被删除。

If you don’t access the transient then, even though it’s expired, WordPress will not remove it.

如果您没有访问瞬态,即使瞬态已过期,WordPress也不会将其删除。

This is a known “issue” but due to reasons,

这是一个已知的“问题” ,但由于某些原因,

which are explained in the FAQ, this has not been adequately resolved.

常见问题解答中对此进行了解释,但此问题尚未得到充分解决。

Why is this a problem?

为什么这是个问题?

Transients are often used by plugins to “cache” data (my own plugins included).

插件经常使用瞬态来“缓存”数据(包括我自己的插件)。

Because of the housekeeping problems this means that expired data can be left and build up, resulting in a bloated database table.

由于内部管理问题,这意味着可以保留和累积过期的数据,从而导致数据库表过大。

Meantime, this plugin is the hero that you’ve been waiting for.

同时,此插件是您一直在等待的英雄。

Simply activate the plugin, sit back and enjoy a much cleaner, smaller options table.

只需激活插件,坐下来,享受一个更清洁,更小的选项表。

It also adds the additional recommendation that after a database upgrade all transients will be cleared down.

它还添加了额外的建议,即在数据库升级后,所有瞬态都将被清除。

Technical specification…

技术规范...

    • Licensed under GPLv2 (or later)
    • GPLv2(或更高版本)

    • Designed for both single and multi-site installations
    • 专为单站点和多站点安装而设计

    • PHP7 compatible
    • 兼容PHP7

    • Fully internationalized, ready for translations.

    • 完全国际化,准备翻译。

      If you would like to add a translation to this plugin then please head to our Translating WordPress page

    • WordPress“ rel =” nofollow“>翻译WordPress 页

    • Gutenberg ready
    • 古腾堡准备好了

    I’d like to thank WordPress Developer Andrew Nacin for his early discussion on this.

    我要感谢WordPress开发人员Andrew Nacin对此的早期讨论。

    Also, I'd like to acknowledge the useful article at Everybody Staze<

    另外,我想感谢 Everybody Staze上的有用文章<

    /a> for ensuring the proposed solution wasn't totally mad, and W-Shadow.com for the cleaning code.

    Stale Transients” rel =“ nofollow”> W-Shadow.com 获取清洁代码。

    Please visit the Github page for the latest code development, planned enhancements

    请访问 Github页面,以获取最新的代码开发和计划的增强功能

    and known issues.

    和已知问题。

    The Settings Screen

    设置屏幕

    Within Administration -> Tools -> Transients an options screen exists allowing you to tweak which of the various housekeeping you'd like to

    Administration -> Tools -> Transients 内,存在一个选项屏幕,可让您调整要执行的各种内务处理中的哪一项

    happen, including the ability to perform an ad-hoc run, and when you'd like the to be automatically scheduled.

    发生,包括执行临时运行的能力,以及您希望自动安排的时间。

    You can even request an optimization of the options table to give your system a real “pep”!

    您甚至可以请求对选项表进行优化,以使您的系统真正“ pep”!

    Running in Lite mode

    以精简模式运行

    A “lite” mode is available.

    可以使用“精简”模式。

    By activating this the options screen will no longer appear and default settings will be used.

    通过激活此选项,选项屏幕将不再出现,并且将使用默认设置。

    The advantage?

    优势?

    Improved performance to Admin and, especially if you’re running multi-site, no chance of anybody “tinkering” with the settings.

    改善了Admin的性能,尤其是在运行多站点的情况下,任何人都无法修改这些设置。

    To activate, use the following…

    要激活,请使用以下…

    define( 'TC_LITE', true );

      define('TC_LITE',true);

    This should be added to your wp-config.php file.

    这应该添加到您的 wp-config.php 文件中。

    Using hooks

    使用挂钩

    If you’re the type of odd person who likes to code for WordPress (really?) then I’ve added a couple of hooks so you can call our rather neat housekeeping functions…

    如果您是喜欢为WordPress编写代码的奇怪的人(真的吗?),那么我添加了几个挂钩,以便您可以调用我们相当整洁的客房服务功能……

      • housekeep_transients – this will clear down any expired transients
      • housekeep_transients –这将清除所有过期的瞬变

      • clear_all_transients – this will remove any and all transients, expired or otherwise
      • clear_all_transients –这将删除所有或所有已过期或其他原因的瞬变

安装步骤

Transient Cleaner can be found and installed via the Plugin menu within WordPress administration (Plugins -> Add New).

可以通过WordPress管理(插件->添加新功能)中的“插件”菜单找到并安装Transient Cleaner。

Alternatively, it can be downloaded from WordPress.org and installed manually…

另外,也可以从WordPress.org下载并手动安装…

    1. Upload the entire artiss-transient-cleaner folder to your wp-content/plugins/ directory.
    2. 将整个 artiss-transient-cleaner 文件夹上传到您的 wp-content / plugins / 目录。

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

    Voila!

    Voila!

    It’s ready to go.

    准备好了。

下载地址
https://downloads.wordpress.org/plugin/artiss-transient-cleaner.1.5.7.zip
-EOF-

AI助手支持GPT4.0