Changeset 3452663
- Timestamp:
- 02/03/2026 08:23:25 AM (8 weeks ago)
- Location:
- hyper-cache
- Files:
-
- 7 added
- 5 edited
-
tags/3.4.3 (added)
-
tags/3.4.3/advanced-cache.php (added)
-
tags/3.4.3/images (added)
-
tags/3.4.3/images/donation.png (added)
-
tags/3.4.3/options.php (added)
-
tags/3.4.3/plugin.php (added)
-
tags/3.4.3/readme.txt (added)
-
trunk (modified) (1 prop)
-
trunk/advanced-cache.php (modified) (1 diff)
-
trunk/options.php (modified) (27 diffs)
-
trunk/plugin.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hyper-cache/trunk
- Property svn:ignore
-
old new 1 build.xml 1 2 nbproject
-
- Property svn:ignore
-
hyper-cache/trunk/advanced-cache.php
r2985226 r3452663 1 1 <?php 2 3 defined('ABSPATH') || exit; 2 4 3 5 global $cache_stop; -
hyper-cache/trunk/options.php
r2985226 r3452663 1 1 <?php 2 defined('ABSPATH') || exit; 3 2 4 $controls = new HyperCacheControls(); 3 5 $plugin = HyperCache::$instance; … … 83 85 $plugin->remove_dir($folder . ''); 84 86 do_action('hyper_cache_flush_all'); 85 $controls->messages = __('The cache folder has been cleaned.', 'hyper-cache');87 $controls->messages = __('The cache folder has been cleaned.', 'hyper-cache'); 86 88 } 87 89 … … 137 139 } 138 140 139 140 141 function hc_size($dir) { 141 142 $files = glob($dir . '*', GLOB_MARK); … … 161 162 // Sometime it happens that a scheduled job is lost... 162 163 if (!wp_next_scheduled('hyper_cache_clean')) { 163 wp_schedule_event(time()+300, 'hourly', 'hyper_cache_clean'); 164 } 165 164 wp_schedule_event(time() + 300, 'hourly', 'hyper_cache_clean'); 165 } 166 166 ?> 167 167 <style> … … 192 192 text-decoration: none; 193 193 } 194 194 195 195 </style> 196 196 <script> 197 jQuery(document).ready(function () {198 jQuery(function () {197 jQuery(document).ready(function () { 198 jQuery(function () { 199 199 tabs = jQuery("#tabs").tabs({ 200 200 cookie: { … … 212 212 <div class="error"> 213 213 <p> 214 <?php _e('You must add to the file wp-config.php (after the <code><?php</code> first line) the line of code: <code>define("WP_CACHE", true);</code>', 'hyper-cache'); ?>214 <?php esc_html_e('You must add to the file wp-config.php (after the <code><?php</code> first line) the line of code: <code>define("WP_CACHE", true);</code>', 'hyper-cache'); ?> 215 215 </p> 216 216 </div> … … 220 220 <div class="error"> 221 221 <p> 222 <?php _e('You must save the options since some files must be updated.', 'hyper-cache'); ?>222 <?php esc_html_e('You must save the options since some files must be updated.', 'hyper-cache'); ?> 223 223 </p> 224 224 </div> … … 228 228 <div class="error"> 229 229 <p> 230 <?php 231 printf(__('Hyper Cache was not able to create or find the %s folder.', 'hyper-cache'), 232 '<code>' . $plugin->get_folder() . '</code>'); 233 _e('Please create it manually with list, write and read permissions (usually 777).', 'hyper-cache'); 234 ?> 230 <?php esc_html_e('Unable to create the folder: ', 'hyper-cache'); ?> 231 <code><?= esc_html($plugin->get_folder()) ?></code> 232 <?php esc_html_e('Please create it manually.', 'hyper-cache'); ?> 235 233 236 234 </p> … … 241 239 <div class="error"> 242 240 <p> 243 <?php244 _e('You should choose a different permalink structure.', 'hyper-cache');245 _e('Change it on the <a href="options-permalink.php" target="_blank">permalink panel</a> otherwise Hyper Cache cannot work properly.', 'hyper-cache');241 <?php 242 esc_html_e('You should choose a different permalink structure.', 'hyper-cache'); 243 esc_html_e('Change it on the <a href="options-permalink.php" target="_blank">permalink panel</a> otherwise Hyper Cache cannot work properly.', 'hyper-cache'); 246 244 ?> 247 245 </p> 248 246 </div> 249 247 <?php } ?> 250 251 248 249 252 250 253 251 … … 277 275 <div id="tabs"> 278 276 <ul> 279 <li><a href="#tabs-general"><?php _e('General', 'hyper-cache'); ?></a></li>280 <li><a href="#tabs-rejects"><?php _e('Bypasses', 'hyper-cache'); ?></a></li>281 <li><a href="#tabs-mobile"><?php _e('Mobile', 'hyper-cache'); ?></a></li>282 <li><a href="#tabs-advanced"><?php _e('Advanced', 'hyper-cache'); ?></a></li>283 <li><a href="#tabs-cdn"><?php _e('CDN', 'hyper-cache'); ?></a></li>277 <li><a href="#tabs-general"><?php esc_html_e('General', 'hyper-cache'); ?></a></li> 278 <li><a href="#tabs-rejects"><?php esc_html_e('Bypasses', 'hyper-cache'); ?></a></li> 279 <li><a href="#tabs-mobile"><?php esc_html_e('Mobile', 'hyper-cache'); ?></a></li> 280 <li><a href="#tabs-advanced"><?php esc_html_e('Advanced', 'hyper-cache'); ?></a></li> 281 <li><a href="#tabs-cdn"><?php esc_html_e('CDN', 'hyper-cache'); ?></a></li> 284 282 </ul> 285 283 286 284 <div id="tabs-cdn"> 287 <p><?php _e('It works only with images, css, scripts.', 'hyper-cache'); ?></p>285 <p><?php esc_html_e('It works only with images, css, scripts.', 'hyper-cache'); ?></p> 288 286 <table class="form-table"> 289 287 <tr> … … 298 296 <?php $controls->text('cdn_url', 50); ?> 299 297 <p class="description"> 300 <?php _e('Write here the CDN URL.', 'hyper-cache'); ?>301 <?php _e('For example a MaxCDN URL is something like', 'hyper-cache'); ?>298 <?php esc_html_e('Write here the CDN URL.', 'hyper-cache'); ?> 299 <?php esc_html_e('For example a MaxCDN URL is something like', 'hyper-cache'); ?> 302 300 <code>http://foo.bar.netdna-cdn.com</code>. 303 <?php _e('You should usually create a pull zone in your CDN panel and they will give your an URL.', 'hyper-cache'); ?>301 <?php esc_html_e('You should usually create a pull zone in your CDN panel and they will give your an URL.', 'hyper-cache'); ?> 304 302 </p> 305 303 </td> … … 316 314 <table class="form-table"> 317 315 <tr> 318 <th><?php _e('Cached pages will be valid for', 'hyper-cache'); ?></th>319 <td> 320 <?php $controls->text('max_age'); ?><?php _e('hours', 'hyper-cache'); ?>321 <p class="description"><?php _e('0 means forever.', 'hyper-cache'); ?></p>322 </td> 323 </tr> 324 <tr> 325 <th><?php _e('Enable compression', 'hyper-cache'); ?></th>316 <th><?php esc_html_e('Cached pages will be valid for', 'hyper-cache'); ?></th> 317 <td> 318 <?php $controls->text('max_age'); ?><?php esc_html_e('hours', 'hyper-cache'); ?> 319 <p class="description"><?php esc_html_e('0 means forever.', 'hyper-cache'); ?></p> 320 </td> 321 </tr> 322 <tr> 323 <th><?php esc_html_e('Enable compression', 'hyper-cache'); ?></th> 326 324 <td> 327 325 <?php $controls->checkbox('gzip'); ?> 328 326 329 327 <p class="description"> 330 <?php _e('If you note odd characters when enabled, disable it since your server is already compressing the pages.', 'hyper-cache'); ?>331 <?php _e('If your server has mod_pagespeed, leave the compression disabled otherwise the module cannot optimize the page.', 'hyper-cache'); ?>332 </p> 333 </td> 334 </tr> 335 336 337 338 <tr> 339 <th><?php _e('When a post is edited', 'hyper-cache'); ?></th>328 <?php esc_html_e('If you note odd characters when enabled, disable it since your server is already compressing the pages.', 'hyper-cache'); ?> 329 <?php esc_html_e('If your server has mod_pagespeed, leave the compression disabled otherwise the module cannot optimize the page.', 'hyper-cache'); ?> 330 </p> 331 </td> 332 </tr> 333 334 335 336 <tr> 337 <th><?php esc_html_e('When a post is edited', 'hyper-cache'); ?></th> 340 338 <td> 341 339 <?php $controls->checkbox('clean_archives_on_post_edit'); ?> clean archives (categories, tags, ..., but not the home) … … 348 346 </tr> 349 347 350 351 352 348 349 350 353 351 <tr valign="top"> 354 <th><?php _e('Allow browser caching', 'hyper-cache'); ?></th>352 <th><?php esc_html_e('Allow browser caching', 'hyper-cache'); ?></th> 355 353 <td> 356 354 <?php $controls->checkbox('browser_cache', __('Enable', 'hyper-cache')); ?> … … 358 356 with an expire time of <?php $controls->text('browser_cache_hours', 5); ?> hours 359 357 <p class="description"> 360 <?php _e('Lets browser to use a local copy of the page if newer than specified.', 'hyper-cache'); ?>361 <?php _e('Attention: the browser may not reload a page from the blog showing not updated content. ', 'hyper-cache'); ?>362 </p> 363 </td> 364 </tr> 365 358 <?php esc_html_e('Lets browser to use a local copy of the page if newer than specified.', 'hyper-cache'); ?> 359 <?php esc_html_e('Attention: the browser may not reload a page from the blog showing not updated content. ', 'hyper-cache'); ?> 360 </p> 361 </td> 362 </tr> 363 366 364 367 365 <tr valign="top"> 368 <th><?php _e('HTTPS', 'hyper-cache'); ?></th> 369 <td> 370 <?php $controls->select('https', array(0 => __('Bypass the cache', 'hyper-cache'), 366 <th><?php esc_html_e('HTTPS', 'hyper-cache'); ?></th> 367 <td> 368 <?php 369 $controls->select('https', array(0 => __('Bypass the cache', 'hyper-cache'), 371 370 1 => __('Build a separated cache', 'hyper-cache'), 372 2 => __('Use the standard cache (I have HTTP/HTTPS aware pages)', 'hyper-cache'))); ?> 373 <p class="description"> 374 <?php _e('Pages are usually different when served in HTTP and HTTPS.', 'hyper-cache'); ?> 375 </p> 376 </td> 377 </tr> 378 379 380 <tr> 381 <th><?php _e('Serve expired pages to bots', 'hyper-cache'); ?></th> 371 2 => __('Use the standard cache (I have HTTP/HTTPS aware pages)', 'hyper-cache'))); 372 ?> 373 <p class="description"> 374 <?php esc_html_e('Pages are usually different when served in HTTP and HTTPS.', 'hyper-cache'); ?> 375 </p> 376 </td> 377 </tr> 378 379 380 <tr> 381 <th><?php esc_html_e('Serve expired pages to bots', 'hyper-cache'); ?></th> 382 382 <td> 383 383 <?php $controls->checkbox('serve_expired_to_bots', __('Enable', 'hyper-cache')); ?> 384 384 <p class="description"> 385 <?php _e('Serve a cache page even if expired when requested by bots.', 'hyper-cache'); ?>385 <?php esc_html_e('Serve a cache page even if expired when requested by bots.', 'hyper-cache'); ?> 386 386 </p> 387 387 </td> … … 394 394 <table class="form-table"> 395 395 <tr> 396 <th><?php _e('Do not cache the home page', 'hyper-cache'); ?></th>396 <th><?php esc_html_e('Do not cache the home page', 'hyper-cache'); ?></th> 397 397 <td> 398 398 <?php $controls->checkbox('reject_home'); ?> 399 399 <p class="description"> 400 <?php _e('When active, the home page and its subpages are not cached.', 'hyper-cache'); ?>401 <?php _e('Works even with a static home page.', 'hyper-cache'); ?>402 </p> 403 </td> 404 </tr> 405 <tr> 406 <th><?php _e('Do not cache the "404 - Not found" page', 'hyper-cache'); ?></th>400 <?php esc_html_e('When active, the home page and its subpages are not cached.', 'hyper-cache'); ?> 401 <?php esc_html_e('Works even with a static home page.', 'hyper-cache'); ?> 402 </p> 403 </td> 404 </tr> 405 <tr> 406 <th><?php esc_html_e('Do not cache the "404 - Not found" page', 'hyper-cache'); ?></th> 407 407 <td> 408 408 <?php $controls->checkbox('reject_404'); ?> 409 409 <p class="description"> 410 <?php _e('When active, Hyper Cache does not serve a cached "404 not found" page.', 'hyper-cache'); ?>411 <?php _e('Requests which lead to a 404 not found page overload you blog since WordPress must generate a full page', 'hyper-cache'); ?>412 <?php _e('Caching it help in reduce that overload.', 'hyper-cache'); ?>413 </p> 414 </td> 415 </tr> 416 <tr> 417 <th><?php _e('Do not cache the blog main feeds', 'hyper-cache'); ?></th>410 <?php esc_html_e('When active, Hyper Cache does not serve a cached "404 not found" page.', 'hyper-cache'); ?> 411 <?php esc_html_e('Requests which lead to a 404 not found page overload you blog since WordPress must generate a full page', 'hyper-cache'); ?> 412 <?php esc_html_e('Caching it help in reduce that overload.', 'hyper-cache'); ?> 413 </p> 414 </td> 415 </tr> 416 <tr> 417 <th><?php esc_html_e('Do not cache the blog main feeds', 'hyper-cache'); ?></th> 418 418 <td> 419 419 <?php $controls->checkbox('reject_feeds'); ?> 420 420 <p class="description"> 421 <?php printf(__('When active, the main blog feed %s is not cached.', 'hyper-cache'), 422 '(<code>' . get_option('home') . '/feed</code>)'); ?> 423 </p> 424 </td> 425 </tr> 426 <tr> 427 <th><?php _e('Do not cache single post comment feed', 'hyper-cache'); ?></th> 421 <?php esc_html_e('When active, the main blog feed is not cached.', 'hyper-cache'); ?> 422 </p> 423 </td> 424 </tr> 425 <tr> 426 <th><?php esc_html_e('Do not cache single post comment feed', 'hyper-cache'); ?></th> 428 427 <td> 429 428 <?php $controls->checkbox('reject_comment_feeds'); ?> 430 429 <p class="description"> 431 <?php _e('When active, the single post comment feeds are not cached.', 'hyper-cache'); ?>432 <?php _e('Usually I enable this bypass since it saves disk space and comment feed on single posts are not usually used.', 'hyper-cache'); ?>433 </p> 434 </td> 435 </tr> 436 <tr> 437 <th><?php _e('Do not cache pages with URIs', 'hyper-cache'); ?></th>430 <?php esc_html_e('When active, the single post comment feeds are not cached.', 'hyper-cache'); ?> 431 <?php esc_html_e('Usually I enable this bypass since it saves disk space and comment feed on single posts are not usually used.', 'hyper-cache'); ?> 432 </p> 433 </td> 434 </tr> 435 <tr> 436 <th><?php esc_html_e('Do not cache pages with URIs', 'hyper-cache'); ?></th> 438 437 <td> 439 438 <?php $controls->checkbox('reject_uris_exact_enabled', __('Enable', 'hyper-cache')); ?><br> 440 439 <?php $controls->textarea('reject_uris_exact'); ?> 441 440 <p class="description"> 442 <?php _e('One per line.', 'hyper-cache'); ?>443 <?php _e('Those URIs are exactly matched.', 'hyper-cache'); ?>444 <?php _e('For example if you add the <code>/my-single-post</code> URI and a request is received for <code>http://youblog.com<strong>/my-single-post</strong></code> that page IS NOT cached.', 'hyper-cache'); ?>445 <?php _e('A request for <code>http://youblog.com<strong>/my-single-post-something</strong></code> IS cached.', 'hyper-cache'); ?>446 </p> 447 </td> 448 </tr> 449 <tr> 450 <th><?php _e('Do not cache pages with URIs starting with', 'hyper-cache'); ?></th>441 <?php esc_html_e('One per line.', 'hyper-cache'); ?> 442 <?php esc_html_e('Those URIs are exactly matched.', 'hyper-cache'); ?> 443 <?php esc_html_e('For example if you add the <code>/my-single-post</code> URI and a request is received for <code>http://youblog.com<strong>/my-single-post</strong></code> that page IS NOT cached.', 'hyper-cache'); ?> 444 <?php esc_html_e('A request for <code>http://youblog.com<strong>/my-single-post-something</strong></code> IS cached.', 'hyper-cache'); ?> 445 </p> 446 </td> 447 </tr> 448 <tr> 449 <th><?php esc_html_e('Do not cache pages with URIs starting with', 'hyper-cache'); ?></th> 451 450 <td> 452 451 <?php $controls->checkbox('reject_uris_enabled', __('Enable', 'hyper-cache')); ?><br> 453 452 <?php $controls->textarea('reject_uris'); ?> 454 453 <p class="description"> 455 <?php _e('One per line.', 'hyper-cache'); ?>456 <?php _e('Those URIs match if a requested URI starts with one of them.', 'hyper-cache'); ?>457 <?php _e('For example if you add the <code>/my-single-post</code> URI and a request is received for <code>http://youblog.com<strong>/my-single-post</strong></code> that page IS NOT cached.', 'hyper-cache'); ?>458 459 <?php _e('A request for <code>http://youblog.com<strong>/my-single-post-something</strong></code> IS NOT cached as well.', 'hyper-cache'); ?>460 </p> 461 </td> 462 </tr> 463 <tr> 464 <th><?php _e('Bypass the cache for readers with cookies', 'hyper-cache'); ?></th>454 <?php esc_html_e('One per line.', 'hyper-cache'); ?> 455 <?php esc_html_e('Those URIs match if a requested URI starts with one of them.', 'hyper-cache'); ?> 456 <?php esc_html_e('For example if you add the <code>/my-single-post</code> URI and a request is received for <code>http://youblog.com<strong>/my-single-post</strong></code> that page IS NOT cached.', 'hyper-cache'); ?> 457 458 <?php esc_html_e('A request for <code>http://youblog.com<strong>/my-single-post-something</strong></code> IS NOT cached as well.', 'hyper-cache'); ?> 459 </p> 460 </td> 461 </tr> 462 <tr> 463 <th><?php esc_html_e('Bypass the cache for readers with cookies', 'hyper-cache'); ?></th> 465 464 <td> 466 465 <?php $controls->checkbox('reject_cookies_enabled', __('Enable', 'hyper-cache')); ?><br> 467 466 <?php $controls->textarea('reject_cookies'); ?> 468 467 <p class="description"> 469 <?php _e('One per line.', 'hyper-cache'); ?>470 <?php _e('If the visitor has a cookie named as one of the listed values, the cache is bypassed.', 'hyper-cache'); ?>471 </p> 472 </td> 473 </tr> 474 <tr> 475 <th><?php _e('Bypass the cache for readers with devices (user agents)', 'hyper-cache'); ?></th>468 <?php esc_html_e('One per line.', 'hyper-cache'); ?> 469 <?php esc_html_e('If the visitor has a cookie named as one of the listed values, the cache is bypassed.', 'hyper-cache'); ?> 470 </p> 471 </td> 472 </tr> 473 <tr> 474 <th><?php esc_html_e('Bypass the cache for readers with devices (user agents)', 'hyper-cache'); ?></th> 476 475 <td> 477 476 <?php $controls->checkbox('reject_agents_enabled', __('Enable', 'hyper-cache')); ?><br> 478 477 <?php $controls->textarea('reject_agents'); ?> 479 478 <p class="description"> 480 <?php _e('One per line.', 'hyper-cache'); ?>481 <?php _e('If the visitor has a device with a user agent named as one of the listed values, the cache is bypassed.', 'hyper-cache'); ?>482 </p> 483 </td> 484 </tr> 485 486 <tr> 487 <th><?php _e('Bypass the cache for readers which are commenters', 'hyper-cache'); ?></th>479 <?php esc_html_e('One per line.', 'hyper-cache'); ?> 480 <?php esc_html_e('If the visitor has a device with a user agent named as one of the listed values, the cache is bypassed.', 'hyper-cache'); ?> 481 </p> 482 </td> 483 </tr> 484 485 <tr> 486 <th><?php esc_html_e('Bypass the cache for readers which are commenters', 'hyper-cache'); ?></th> 488 487 <td> 489 488 <?php $controls->checkbox('reject_comment_authors', __('Enable', 'hyper-cache')); ?> 490 489 491 490 <p class="description"> 492 <?php _e('Hyper Cache is able to work with users who left a comment and completes the comment form with491 <?php esc_html_e('Hyper Cache is able to work with users who left a comment and completes the comment form with 493 492 user data even on cached page', 'hyper-cache'); ?> 494 <?php _e('(with a small JavaScript added at the end of the pages).', 'hyper-cache'); ?>495 <?php _e('But the "awaiting moderation" message cannot be shown.', 'hyper-cache'); ?>496 <?php _e('If you have few readers who comment you can disable this feature to get back the classical WordPress comment flow.', 'hyper-cache'); ?>497 </p> 498 </td> 499 </tr> 500 <tr> 501 <th><?php _e('Do not cache posts older than', 'hyper-cache'); ?></th>502 <td> 503 <?php $controls->text('reject_old_posts', 5); ?> <?php _e('days', 'hyper-cache'); ?>504 <p class="description"> 505 <?php _e('Older posts won\'t be cached and stored resulting in a lower disk space usage.', 'hyper-cache'); ?>506 <?php _e('Useful when older posts have low traffic.', 'hyper-cache'); ?>493 <?php esc_html_e('(with a small JavaScript added at the end of the pages).', 'hyper-cache'); ?> 494 <?php esc_html_e('But the "awaiting moderation" message cannot be shown.', 'hyper-cache'); ?> 495 <?php esc_html_e('If you have few readers who comment you can disable this feature to get back the classical WordPress comment flow.', 'hyper-cache'); ?> 496 </p> 497 </td> 498 </tr> 499 <tr> 500 <th><?php esc_html_e('Do not cache posts older than', 'hyper-cache'); ?></th> 501 <td> 502 <?php $controls->text('reject_old_posts', 5); ?> <?php esc_html_e('days', 'hyper-cache'); ?> 503 <p class="description"> 504 <?php esc_html_e('Older posts won\'t be cached and stored resulting in a lower disk space usage.', 'hyper-cache'); ?> 505 <?php esc_html_e('Useful when older posts have low traffic.', 'hyper-cache'); ?> 507 506 </p> 508 507 </td> … … 510 509 </table> 511 510 </div> 512 511 513 512 <div id="tabs-advanced"> 514 513 <table class="form-table"> 515 514 <tr> 516 <th><?php _e('Enable on-the-fly compression', 'hyper-cache'); ?></th>515 <th><?php esc_html_e('Enable on-the-fly compression', 'hyper-cache'); ?></th> 517 516 <td> 518 517 <?php $controls->checkbox('gzip_on_the_fly'); ?> 519 518 520 519 <p class="description"> 521 <?php _e('Enable on the fly compression for non cached pages.', 'hyper-cache'); ?>522 </p> 523 </td> 524 </tr> 525 <tr>526 <tr> 527 <th><?php _e('When a post receives a comment', 'hyper-cache'); ?></th>520 <?php esc_html_e('Enable on the fly compression for non cached pages.', 'hyper-cache'); ?> 521 </p> 522 </td> 523 </tr> 524 <tr> 525 <tr> 526 <th><?php esc_html_e('When a post receives a comment', 'hyper-cache'); ?></th> 528 527 <td> 529 528 <?php $controls->checkbox('clean_archives_on_comment'); ?> clean archives (categories, tags, ..., but not the home) … … 537 536 <tr> 538 537 539 <th><?php _e('When the home is refreshed, refresh even the', 'hyper-cache'); ?></th>540 <td> 541 <?php $controls->text('clean_last_posts', 5); ?> <?php _e('latest post', 'hyper-cache'); ?>542 <p class="description"> 543 <?php _e('The number of latest posts to invalidate when the home is invalidated.', 'hyper-cache'); ?>544 </p> 545 </td> 546 </tr> 547 548 <tr> 549 <th><?php _e('Next autoclean will run in', 'hyper-cache'); ?></th>538 <th><?php esc_html_e('When the home is refreshed, refresh even the', 'hyper-cache'); ?></th> 539 <td> 540 <?php $controls->text('clean_last_posts', 5); ?> <?php esc_html_e('latest post', 'hyper-cache'); ?> 541 <p class="description"> 542 <?php esc_html_e('The number of latest posts to invalidate when the home is invalidated.', 'hyper-cache'); ?> 543 </p> 544 </td> 545 </tr> 546 547 <tr> 548 <th><?php esc_html_e('Next autoclean will run in', 'hyper-cache'); ?></th> 550 549 <td> 551 550 <?php $controls->checkbox('autoclean', 'enable it'); ?> 552 551 553 (<?php _e('will run again in', 'hyper-cache'); ?> <?php echo (int)((wp_next_scheduled('hyper_cache_clean')-time())/60) ?> <?php_e('minutes', 'hyper-cache'); ?>)554 <p class="description"> 555 <?php _e('The autoclean process removes old files to save disk space.', 'hyper-cache'); ?>556 <?php _e('If you enable the "serve expired pages to bots", you should disable the auto clean.', 'hyper-cache'); ?>557 </p> 558 </td> 559 </tr> 560 561 <tr> 562 <th><?php _e('Cache folder', 'hyper-cache'); ?></th>552 (<?php esc_html_e('will run again in', 'hyper-cache'); ?> <?php echo (int) ((wp_next_scheduled('hyper_cache_clean') - time()) / 60) ?> <?php esc_html_e('minutes', 'hyper-cache'); ?>) 553 <p class="description"> 554 <?php esc_html_e('The autoclean process removes old files to save disk space.', 'hyper-cache'); ?> 555 <?php esc_html_e('If you enable the "serve expired pages to bots", you should disable the auto clean.', 'hyper-cache'); ?> 556 </p> 557 </td> 558 </tr> 559 560 <tr> 561 <th><?php esc_html_e('Cache folder', 'hyper-cache'); ?></th> 563 562 <td> 564 563 <?php if (defined('HYPER_CACHE_FOLDER')) { ?> 565 <?php _e('A custom cache folder is deinfed in wp-config.php', 'hyper-cache'); ?>: <code><?php echo esc_html(HYPER_CACHE_FOLDER)?></code>564 <?php esc_html_e('A custom cache folder is deinfed in wp-config.php', 'hyper-cache'); ?>: <code><?php echo esc_html(HYPER_CACHE_FOLDER) ?></code> 566 565 <?php } else { ?> 567 <?php _e('A custom cache folder can be defined in wp-config.php', 'hyper-cache'); ?>566 <?php esc_html_e('A custom cache folder can be defined in wp-config.php', 'hyper-cache'); ?> 568 567 <code>define('HYPER_CACHE_FOLDER', '/path/to/cache/folder');</code> 569 568 <?php } ?> … … 580 579 <table class="form-table"> 581 580 <tr> 582 <th><?php _e('For mobile devices', 'hyper-cache'); ?></th> 583 <td> 584 <?php $controls->select('mobile', array(0 => __('Use the main cache', 'hyper-cache'), 581 <th><?php esc_html_e('For mobile devices', 'hyper-cache'); ?></th> 582 <td> 583 <?php 584 $controls->select('mobile', array(0 => __('Use the main cache', 'hyper-cache'), 585 585 1 => __('Use a separated cache', 'hyper-cache'), 586 2 => __('Bypass the cache', 'hyper-cache'))); ?> 587 588 <p class="description"> 589 <?php _e('Choose "cache separately" if you produce different content for mobile devices', 'hyper-cache'); ?><br> 590 <?php _e('See for example my <a href="http://www.satollo.net/plugins/header-footer" target="_blank">Header and Footer</a> plugin for different desktop/mobile ads injection in posts.', 'hyper-cache'); ?> 591 </p> 592 </td> 593 </tr> 594 <tr> 595 <th><?php _e('Mobile theme', 'hyper-cache'); ?></th> 586 2 => __('Bypass the cache', 'hyper-cache'))); 587 ?> 588 589 <p class="description"> 590 <?php esc_html_e('Choose "cache separately" if you produce different content for mobile devices', 'hyper-cache'); ?><br> 591 <?php esc_html_e('See for example my <a href="http://www.satollo.net/plugins/header-footer" target="_blank">Header and Footer</a> plugin for different desktop/mobile ads injection in posts.', 'hyper-cache'); ?> 592 </p> 593 </td> 594 </tr> 595 <tr> 596 <th><?php esc_html_e('Mobile theme', 'hyper-cache'); ?></th> 596 597 <td> 597 598 <?php … … 604 605 <?php $controls->select('theme', $list); ?> 605 606 <p class="description"> 606 <?php _e('If you have plugins which produce different content for desktop and mobile devices, you should use a separate cache for mobile.', 'hyper-cache'); ?>607 </p> 608 </td> 609 </tr> 610 <tr> 611 <th><?php _e('Mobile user agents', 'hyper-cache'); ?></th>607 <?php esc_html_e('If you have plugins which produce different content for desktop and mobile devices, you should use a separate cache for mobile.', 'hyper-cache'); ?> 608 </p> 609 </td> 610 </tr> 611 <tr> 612 <th><?php esc_html_e('Mobile user agents', 'hyper-cache'); ?></th> 612 613 <td> 613 614 <?php $controls->textarea('mobile_agents'); ?> 614 <?php $controls->button('reset_mobile_agents', __('Reset', 'hyper-cache' )); ?>615 <p class="description"> 616 <?php _e('One per line.', 'hyper-cache'); ?>617 <?php _e('A "user agent" is a text which identify the kind of device used to surf the site.', 'hyper-cache'); ?>618 <?php _e('For example and iPhone has <code>iphone</code> as user agent.', 'hyper-cache'); ?>615 <?php $controls->button('reset_mobile_agents', __('Reset', 'hyper-cache')); ?> 616 <p class="description"> 617 <?php esc_html_e('One per line.', 'hyper-cache'); ?> 618 <?php esc_html_e('A "user agent" is a text which identify the kind of device used to surf the site.', 'hyper-cache'); ?> 619 <?php esc_html_e('For example and iPhone has <code>iphone</code> as user agent.', 'hyper-cache'); ?> 619 620 </p> 620 621 </td> … … 629 630 630 631 <?php if ($_SERVER['HTTP_HOST'] == 'www.satollo.net' || $_SERVER['HTTP_HOST'] == 'www.satollo.com') { ?> 631 <?php $controls->button('delete', 'Delete options'); ?>632 <?php $controls->button('autoclean', 'Autoclean'); ?>632 <?php $controls->button('delete', 'Delete options'); ?> 633 <?php $controls->button('autoclean', 'Autoclean'); ?> 633 634 <?php } ?> 634 635 </p> … … 663 664 if (is_array($value)) 664 665 $value = implode(',', $value); 665 echo '<input name="options[' . $name . ']" type="text" size="' . $size. '" value="';666 echo htmlspecialchars($value);666 echo '<input name="options[' . esc_attr($name) . ']" type="text" size="' . esc_attr($size) . '" value="'; 667 echo esc_attr($value); 667 668 echo '"/>'; 668 669 } … … 672 673 $this->options[$name] = ''; 673 674 $value = $this->options[$name]; 674 echo '<label><input class="panel_checkbox" name="options[' . $name. ']" type="checkbox" value="1"';675 echo '<label><input class="panel_checkbox" name="options[' . esc_attr($name) . ']" type="checkbox" value="1"'; 675 676 if (!empty($value)) 676 677 echo ' checked'; 677 678 echo '>'; 678 echo $label;679 echo esc_html($label); 679 680 echo '</label>'; 680 681 } … … 687 688 if (is_array($value)) 688 689 $value = implode("\n", $value); 689 echo '<textarea name="options[' . $name. ']" style="width: 100%; heigth: 120px;">';690 echo htmlspecialchars($value);690 echo '<textarea name="options[' . esc_attr($name) . ']" style="width: 100%; heigth: 120px;">'; 691 echo esc_html($value); 691 692 echo '</textarea>'; 692 693 } … … 697 698 $value = $this->options[$name]; 698 699 699 echo '<select name="options[' . $name. ']">';700 echo '<select name="options[' . esc_attr($name) . ']">'; 700 701 foreach ($options as $key => $label) { 701 echo '<option value="' . $key. '"';702 echo '<option value="' . esc_attr($key) . '"'; 702 703 if ($value == $key) 703 704 echo ' selected'; 704 echo '>' . htmlspecialchars($label) . ' </option>';705 echo '>' . esc_html($label) . ' </option>'; 705 706 } 706 707 echo '</select>'; … … 709 710 function button($action, $label, $message = null) { 710 711 if ($message == null) { 711 echo '<input class="button-primary" type="submit" value="' . $label . '" onclick="this.form.act.value=\'' . $action. '\'"/>';712 echo '<input class="button-primary" type="submit" value="' . esc_attr($label) . '" onclick="this.form.act.value=\'' . esc_attr($action) . '\'"/>'; 712 713 } else { 713 echo '<input class="button-primary" type="submit" value="' . $label . '" onclick="this.form.act.value=\'' . $action. '\';return confirm(\'' .714 htmlspecialchars($message) . '\')"/>';714 echo '<input class="button-primary" type="submit" value="' . esc_attr($label) . '" onclick="this.form.act.value=\'' . esc_attr($action) . '\';return confirm(\'' . 715 esc_attr($message) . '\')"/>'; 715 716 } 716 717 } … … 735 736 if (!empty($this->errors)) { 736 737 echo '<div class="error"><p>'; 738 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 737 739 echo $this->errors; 738 740 echo '</p></div>'; … … 741 743 if (!empty($this->messages)) { 742 744 echo '<div class="updated"><p>'; 745 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 743 746 echo $this->messages; 744 747 echo '</p></div>'; 745 748 } 746 749 } 747 748 750 } 749 751 ?> -
hyper-cache/trunk/plugin.php
r2985435 r3452663 1 1 <?php 2 3 defined('ABSPATH') || exit; 2 4 3 5 /* … … 5 7 Plugin URI: https://www.satollo.net/plugins/hyper-cache 6 8 Description: A easy to configure and efficient cache to increase the speed of your blog. 7 Version: 3.4. 29 Version: 3.4.3 8 10 Author: Stefano Lissa 9 11 Author URI: https://www.satollo.net 10 12 Disclaimer: Use at your own risk. No warranty expressed or implied is provided. 11 13 Contributors: satollo 12 Requires PHP: 5.613 Requires at least: 4.614 Requires PHP: 7.0 15 Requires at least: 6.1 14 16 */ 15 17 … … 353 355 // For some reason it seems more performant than readfile... 354 356 header('X-Hyper-Cache: hit,404,wp'); 357 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 355 358 echo file_get_contents($file); 356 359 die(); … … 415 418 // For some reason it seems more performant than readfile... 416 419 header('X-Hyper-Cache: hit,404,template_redirect'); 420 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 417 421 echo file_get_contents($file); 418 422 die(); -
hyper-cache/trunk/readme.txt
r2985435 r3452663 1 1 === Hyper Cache === 2 2 Tags: cache,performance,staticizer,apache,htaccess,tuning,speed,bandwidth,optimization 3 Tested up to: 6. 3.24 Stable tag: 3.4. 23 Tested up to: 6.9 4 Stable tag: 3.4.3 5 5 Donate link: https://www.satollo.net/donations 6 6 Contributors: satollo … … 73 73 == Changelog == 74 74 75 = 3.4.3 = 76 77 * WP 6.9 check 78 * PCP check 79 75 80 = 3.4.2 = 76 81
Note: See TracChangeset
for help on using the changeset viewer.