Linux 软件免费装

Fast Translate

开发者 greencp
underdude
更新时间 2019年12月12日 18:14
PHP版本: 4.0 及以上
WordPress版本: 5.3
版权: GPLv3
版权网址: 版权信息

标签

speed performance translate language l10n translation localization mo languages localize

下载

1.2.1 1.3

详情介绍:

Changing the WordPress site language to any other than English slows down page generation times. A lot. This is caused by the slow and inefficient way of text domain loading. PO and MO files are designed to be used with PHP Gettext-extension. But since it's an extension, it's not installed by defalt on very hosting platform. To overcome this barrier, WordPress has re-implemented the whole MO file parsing in PHP, but WordPress' implementation is quite slow and memory intense. This plugin replaces the default MO-Reader with another implementation of MO parsing, which is faster than the default one. Only used text domains are loaded (since version 4.6 this is also WordPress' default behaviour) and from these only used translations are loaded. It also makes use of hash tables included in mo files, which are ignored completely by WordPress' default implementation. To boost the performance even more, the plugin also caches translations to the object cache, if one is installed. For optimal performance you need a fast object cache backend like Redis, Memcached or APC(u). Fast Translate is a minimalistic fork of WP Performance Packs localization improvements. WP Performance Pack offers additional control and more optimizations for WordPress performance, e.g. use of PHPs native gettext extension, improved image handling and CDN support.

安装:

Requires PHP >= 5.3 and WordPress >= 4.0

屏幕截图:

  • Fast Translate benchmark: Front page load times of a "fresh" WordPress 4.8 installation and a "real life" installation. Benchmarked version 1.2.0, times are mean of five test runs measured using XDebug.

常见问题:

Which persisten object cache plugins are recommended?

Any persisten object cache will do, but it has to be supported in your hosting environment. Check if any caches like APC(u), XCache, Memcache, etc. are installed on your webserver and select a suitable cache plugin respectively. File based object caches should work always and might improve performance, same goes for data base based caches. Performance gains depend on the available caching method and its configuration.

Does Fast Translate support multisite?

Yes

How do localization improvements work

Fast Translate overrides WordPress' default implementation by using the override_load_textdomain hook. It uses a complete rewrite of WordPress' MO imlementation. The default WordPress implementaion loads a complete mo file whenever a single translation from it is needed. This needs quite some time and even more memory. Fast Translate features on demand loading. It doesn't load a mo file until the first translation call to that specific textdomain (so does WordPress since version 4.6). And it doesn't load the entire mo file either, only the requested translation. Though the (highly optimized) search for an individual translation is slower, the vastly improved loading time and reduced memory foot print result in an overall performance gain. Caching can further improve performance. When using Fast Translate with an installed and activated object cache, translations get cached using WordPress Object Cache API. Front end pages usually don't use many translations, so for all front end pages one cache is used per textdomain. Back end pages on the other hand use many translations. So back end pages get each their own individual translation cache with one base cache for each textdomain. This base cache consists of those translations that are used on all back end pages (i.e. they have been used up to admin_init hook). Later used translations are cached for each page. All this is to reduce cache size, which is very limited on many caching methods like APC. To even further reduce cache size, the transaltions get compressed before being saved to cache.

更新日志:

1.4 1.3 1.2.1 1.2.0 First realease on wp.org