includes/Admin/class-perf-translations.php
Performant Translations — .mo → .php compilation.
Class Perf_Translations
Perf Translations handler.
class Perf_TranslationsConstants
| Constant | Visibility | Value | Line |
|---|---|---|---|
FILTER_ENABLED | public | \'wppo_perf_translations_enabled\' | 39 |
publicstatic is_enabled()
public static function is_enabled(): boolWhether perf translations is enabled.
Return: bool.
publicstatic get_cache_dir()
public static function get_cache_dir(): stringBase cache directory for compiled translation files.
Return: string — Normalized path.
publicstatic get_cache_file()
public static function get_cache_file(string $mofile, string $domain): stringDerive a cache file path for a given .mo file and textdomain. Parameter Type Default Description $mofilestring— Path to .mo file. $domainstring— Text domain.
Return: string — Normalized cache file path (.php).
publicstatic filter_load_file()
public static function filter_load_file(string $file, string $domain): stringFilter callback for `load_textdomain_mofile` and `load_translation_file`. Parameter Type Default Description $filestring— Path to translation file (.mo or .php). $domainstring— Text domain.
Return: string — Filtered path.
publicstatic opcache_invalidate()
public static function opcache_invalidate(string $file): voidInvalidate OPCache after file write (action handler). Parameter Type Default Description $filestring— File path.
Return: void.
publicstatic init()
public static function init(): voidRegister hooks.
Return: void.
publicstatic on_upgrader_complete()
public static function on_upgrader_complete($upgrader, $hook_extra): voidOn language pack upgrades, the compiled cache should be purged so it regenerates fresh. Parameter Type Default Description $upgradermixed— Upgrader instance. $hook_extraarray— Extra data.
Return: void.
Hooks
Hooks referenced in includes/Admin/class-perf-translations.php: Hook Type Line Notes wppo_perf_translations_file_writtenaction 212 @param ×3 wppo_perf_translations_file_writtenaction registration 247 —