| @@ -31,12 +31,12 @@ | ||
| 31 | 31 | public const VERSION = '1.1.0'; |
| 32 | 32 | |
| 33 | 33 | public function ui_metadata(): array { |
| 34 | 34 | return array( |
| 35 | - 'label' => 'Compression', | |
| 36 | - 'tab_label' => 'GZIP', // its own tab on the Compression page | |
| 35 | + 'label' => __( 'Compression', 'xspeed' ), | |
| 36 | + 'tab_label' => __( 'GZIP', 'xspeed' ), // its own tab on the Compression page | |
| 37 | 37 | 'icon' => 'Layers', |
| 38 | - 'description' => 'Compress responses to reduce transfer size.', | |
| 38 | + 'description' => __( 'Compress responses to reduce transfer size.', 'xspeed' ), | |
| 39 | 39 | // Host panel merges GZIP (this module) + Brotli (Pro) into one |
| 40 | 40 | // page — they are one decision with a fallback chain, not two |
| 41 | 41 | // sidebar rows (FBS-83633). The panel renders this module's own |
| 42 | 42 | // schema form plus a Brotli Pro section. |
| @@ -48,9 +48,9 @@ | ||
| 48 | 48 | return array( |
| 49 | 49 | 'gzip_enabled' => array( |
| 50 | 50 | 'type' => 'bool', |
| 51 | 51 | 'default' => false, |
| 52 | - 'label' => 'Enable GZIP Compression', | |
| 52 | + 'label' => __( 'Enable GZIP Compression', 'xspeed' ), | |
| 53 | 53 | // Server-conditional. The old copy said "On nginx the snippet |
| 54 | 54 | // below must be added to your server config" — unconditionally, |
| 55 | 55 | // and there is no snippet below: the Compression page is a tab |
| 56 | 56 | // strip plus this toggle, and NginxServerBlock only mounts under |
| @@ -104,8 +104,9 @@ | ||
| 104 | 104 | array( |
| 105 | 105 | 'name' => 'xspeed gzip', |
| 106 | 106 | 'callback' => array( $this, 'cli_handler' ), |
| 107 | 107 | 'shortdesc' => 'Show GZIP status (server type, active, mode).', |
| 108 | + 'ai_hint' => 'Is text compression (GZIP/Brotli) actually working on this site? Answers "why are my HTML/CSS/JS transfers so large" and whether the server is compressing at all. Reports the detected server, whether compression is active, and how it is applied.', | |
| 108 | 109 | 'synopsis' => array(), |
| 109 | 110 | ), |
| 110 | 111 | ); |
| 111 | 112 | } |
| @@ -283,6 +284,13 @@ | ||
| 283 | 284 | return null; |
| 284 | 285 | } |
| 285 | 286 | $snippet = LegacyGzip::nginx_snippet(); |
| 286 | 287 | return is_string( $snippet ) && '' !== $snippet ? $snippet : null; |
| 288 | + } | |
| 289 | + | |
| 290 | + /** | |
| 291 | + * Gzip stores its switch as `gzip_enabled`, not `enabled`. (#363) | |
| 292 | + */ | |
| 293 | + public function is_active(): ?bool { | |
| 294 | + return $this->any_bool_flag_on(); | |
| 287 | 295 | } |
| 288 | 296 | } |