[wordpress插件] Customize Widgets Plus自定义小部件加

wordpress 插件 文章 2020-04-10 18:20 518 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

This plugin consists of lab features and a testbed for improvements to Widgets and the Customizer.

此插件包含实验室功能和一个用于改进小部件和自定义程序的测试平台。

Requires PHP 5.3+.

需要PHP 5.3 +。

Development of this plugin is done on GitHub.

此插件的开发在GitHub上 完成。

Pull requests welcome.

拉请求欢迎。

Please see issues reported there before going to the 问题,然后再转到

://wordpress.org/support/plugin/customize-widgets-plus">plugin forum.

://wordpress.org/support/plugin/customize-widgets-plus“>插件论坛。

Current features:

当前功能:

Non-Autoloaded Widget Options

非自动加载的窗口小部件选项

Widgets are stored in options (normally).

小部件存储在选项中(通常)。

Multi-widgets store all of their instances in one big serialized array specific to that type.

多窗口小部件将所有实例存储在特定于该类型的一个大序列化数组中。

When there are many widgets of a given type, the size of the serialized array can grow very large.

当有许多给定类型的小部件时,序列化数组的大小可能会变得非常大。

What's more is that WP_Widget does not explicitly add_option(... 'no' ) before calling update_option(), and so all of the settings

更重要的是,在调用 update_option()之前, WP_Widget 不会显式地 add_option(...'no'),因此所有设置

get added with autoloading.

加入自动加载功能。

This is very bad when using Memcached Object Cache specifically because it can result in the total alloptions cache key to become larger than 1MB and result in Memcached failing to store the value in the cache.

特别是在使用Memcached对象高速缓存时,这非常糟糕,因为它可能导致 alloptions 高速缓存的总密钥大于1MB,并导致Memcached无法将值存储在高速缓存中。

On WordPress.com the result is a “Matt's fault” error which has to be fixed by the VIP team.

nofollow“>“ Matt的错误”错误,该错误必须由VIP小组解决。

Widget settings should not be stored in serialized arrays to begin with;

首先,小部件设置不应存储在序列化数组中;

each widget instance should be stored in a custom post type.

每个小部件实例应以自定义帖子类型存储。

But until this is done we should stop autoloading options.

但是在完成此操作之前,我们应该停止自动加载选项。

See also #26876 and #26876

.org/ticket/23909" rel="nofollow">#23909.

.org / ticket / 23909“ rel =” nofollow“>#23909 。

Widget Number Incrementing

小部件编号递增

Implements fixes for Core issue #32183 (Widget ID auto-increments conflict for concurrent

针对核心问题#32183 的修正(并发的窗口小部件ID自动递增冲突

users).

用户)。

The stored widget_number option provides a centralized auto-increment number for whenever a widget is instantiated, even widgets in the Customizer that are not yet saved.

存储的widget_number选项为实例化窗口小部件(甚至是尚未保存的定制程序中的窗口小部件)提供一个集中的自动递增编号。

Efficient Multidimensional Setting Sanitizing

高效的多维设置消毒

Settings for multidimensional options and theme_mods are extremely inefficient to sanitize in Core because all of the Customizer settings registered for the subsets of the option or theme_mod need filters that are added

多维选项和theme_mods的设置在Core中清理效率极低,因为为 option theme_mod 的子集注册的所有Customizer设置都需要添加过滤器

to the entire value, meaning sanitizing one single setting will result in all filters for all other settings in that option/theme_mod will also get applied.

到整个值,这意味着清理一个单一设置将导致所有其他设置的所有过滤器都生效,因为 option / theme_mod 也将被应用。

This functionality seeks to improve this as much as possible, especially for widgets which are the worst offenders.

此功能旨在尽可能地改善此问题,尤其是对于那些最坏的小部件。

Implements partial fix for #32103.

#32103 实现部分修复。

HTTPS Resource Proxy

HTTPS资源代理

When FORCE_SSL_ADMIN is enabled (such as on WordPress.com), the Customizer will load the site into the preview iframe using HTTPS as well.

启用 FORCE_SSL_ADMIN (例如在WordPress.com上)时,定制程序还将使用HTTPS将网站加载到预览iframe中。

If, however, external resources are being referenced which are not HTTPS, they will fail to load due to the browser’s security model raise mixed content warnings.

但是,如果引用的外部资源不是HTTPS,则将由于浏览器的安全模型引发混合内容警告而无法加载。

This functionality will attempt to rewrite any HTTP URLs to be HTTPS ones via a WordPress-based proxy.

此功能将尝试通过基于WordPress的代理将所有HTTP URL重写为HTTPS。

Widget Posts

小部件帖子

Store widget instances in posts instead of options.

将小部件实例存储在帖子中,而不是选项中。

Requires trunk due to patch committed in #32474.

由于#32474 中提交的补丁,因此需要中继。

More details forthcoming…

即将有更多细节……

下载地址
https://downloads.wordpress.org/plugin/customize-widgets-plus.zip
-EOF-

AI助手支持GPT4.0