Plugin Directory

Changeset 3452663


Ignore:
Timestamp:
02/03/2026 08:23:25 AM (8 weeks ago)
Author:
satollo
Message:

Version 3.4.3

Location:
hyper-cache
Files:
7 added
5 edited

Legend:

Unmodified
Added
Removed
  • hyper-cache/trunk

    • Property svn:ignore
      •  

        old new  
         1build.xml
        12nbproject
  • hyper-cache/trunk/advanced-cache.php

    r2985226 r3452663  
    11<?php
     2
     3defined('ABSPATH') || exit;
    24
    35global $cache_stop;
  • hyper-cache/trunk/options.php

    r2985226 r3452663  
    11<?php
     2defined('ABSPATH') || exit;
     3
    24$controls = new HyperCacheControls();
    35$plugin = HyperCache::$instance;
     
    8385    $plugin->remove_dir($folder . '');
    8486    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');
    8688}
    8789
     
    137139}
    138140
    139 
    140141function hc_size($dir) {
    141142    $files = glob($dir . '*', GLOB_MARK);
     
    161162// Sometime it happens that a scheduled job is lost...
    162163if (!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}
    166166?>
    167167<style>
     
    192192        text-decoration: none;
    193193    }
    194    
     194
    195195</style>
    196196<script>
    197     jQuery(document).ready(function() {
    198         jQuery(function() {
     197    jQuery(document).ready(function () {
     198        jQuery(function () {
    199199            tabs = jQuery("#tabs").tabs({
    200200                cookie: {
     
    212212        <div class="error">
    213213            <p>
    214                 <?php _e('You must add to the file wp-config.php (after the <code>&lt;?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>&lt;?php</code> first line) the line of code: <code>define("WP_CACHE", true);</code>', 'hyper-cache'); ?>
    215215            </p>
    216216        </div>
     
    220220        <div class="error">
    221221            <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'); ?>
    223223            </p>
    224224        </div>
     
    228228        <div class="error">
    229229            <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'); ?>
    235233
    236234            </p>
     
    241239        <div class="error">
    242240            <p>
    243                  <?php
    244                 _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');
    246244                ?>
    247245            </p>
    248246        </div>
    249247    <?php } ?>
    250    
    251    
     248
     249
    252250
    253251
     
    277275        <div id="tabs">
    278276            <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>
    284282            </ul>
    285283
    286284            <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>
    288286                <table class="form-table">
    289287                    <tr>
     
    298296                            <?php $controls->text('cdn_url', 50); ?>
    299297                            <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'); ?>
    302300                                <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'); ?>
    304302                            </p>
    305303                        </td>
     
    316314                <table class="form-table">
    317315                    <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>
    326324                        <td>
    327325                            <?php $controls->checkbox('gzip'); ?>
    328326
    329327                            <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>
    340338                        <td>
    341339                            <?php $controls->checkbox('clean_archives_on_post_edit'); ?> clean archives (categories, tags, ..., but not the home)
     
    348346                    </tr>
    349347
    350                  
    351 
    352                    
     348
     349
     350
    353351                    <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>
    355353                        <td>
    356354                            <?php $controls->checkbox('browser_cache', __('Enable', 'hyper-cache')); ?>
     
    358356                            with an expire time of <?php $controls->text('browser_cache_hours', 5); ?> hours
    359357                            <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
    366364
    367365                    <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'),
    371370                                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>
    382382                        <td>
    383383                            <?php $controls->checkbox('serve_expired_to_bots', __('Enable', 'hyper-cache')); ?>
    384384                            <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'); ?>
    386386                            </p>
    387387                        </td>
     
    394394                <table class="form-table">
    395395                    <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>
    397397                        <td>
    398398                            <?php $controls->checkbox('reject_home'); ?>
    399399                            <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>
    407407                        <td>
    408408                            <?php $controls->checkbox('reject_404'); ?>
    409409                            <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>
    418418                        <td>
    419419                            <?php $controls->checkbox('reject_feeds'); ?>
    420420                            <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>
    428427                        <td>
    429428                            <?php $controls->checkbox('reject_comment_feeds'); ?>
    430429                            <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>
    438437                        <td>
    439438                            <?php $controls->checkbox('reject_uris_exact_enabled', __('Enable', 'hyper-cache')); ?><br>
    440439                            <?php $controls->textarea('reject_uris_exact'); ?>
    441440                            <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>
    451450                        <td>
    452451                            <?php $controls->checkbox('reject_uris_enabled', __('Enable', 'hyper-cache')); ?><br>
    453452                            <?php $controls->textarea('reject_uris'); ?>
    454453                            <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>
    465464                        <td>
    466465                            <?php $controls->checkbox('reject_cookies_enabled', __('Enable', 'hyper-cache')); ?><br>
    467466                            <?php $controls->textarea('reject_cookies'); ?>
    468467                            <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>
    476475                        <td>
    477476                            <?php $controls->checkbox('reject_agents_enabled', __('Enable', 'hyper-cache')); ?><br>
    478477                            <?php $controls->textarea('reject_agents'); ?>
    479478                            <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>
    488487                        <td>
    489488                            <?php $controls->checkbox('reject_comment_authors', __('Enable', 'hyper-cache')); ?>
    490489
    491490                            <p class="description">
    492                                 <?php _e('Hyper Cache is able to work with users who left a comment and completes the comment form with
     491                                <?php esc_html_e('Hyper Cache is able to work with users who left a comment and completes the comment form with
    493492                                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'); ?>
    507506                            </p>
    508507                        </td>
     
    510509                </table>
    511510            </div>
    512            
     511
    513512            <div id="tabs-advanced">
    514513                <table class="form-table">
    515514                    <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>
    517516                        <td>
    518517                            <?php $controls->checkbox('gzip_on_the_fly'); ?>
    519518
    520519                            <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>
    528527                        <td>
    529528                            <?php $controls->checkbox('clean_archives_on_comment'); ?> clean archives (categories, tags, ..., but not the home)
     
    537536                    <tr>
    538537
    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>
    550549                        <td>
    551550                            <?php $controls->checkbox('autoclean', 'enable it'); ?>
    552551
    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>
    563562                        <td>
    564563                            <?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>
    566565                            <?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'); ?>
    568567                                <code>define('HYPER_CACHE_FOLDER', '/path/to/cache/folder');</code>
    569568                            <?php } ?>
     
    580579                <table class="form-table">
    581580                    <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'),
    585585                                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>
    596597                        <td>
    597598                            <?php
     
    604605                            <?php $controls->select('theme', $list); ?>
    605606                            <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>
    612613                        <td>
    613614                            <?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'); ?>
    619620                            </p>
    620621                        </td>
     
    629630
    630631            <?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'); ?>
    633634            <?php } ?>
    634635        </p>
     
    663664        if (is_array($value))
    664665            $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);
    667668        echo '"/>';
    668669    }
     
    672673            $this->options[$name] = '';
    673674        $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"';
    675676        if (!empty($value))
    676677            echo ' checked';
    677678        echo '>';
    678         echo $label;
     679        echo esc_html($label);
    679680        echo '</label>';
    680681    }
     
    687688        if (is_array($value))
    688689            $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);
    691692        echo '</textarea>';
    692693    }
     
    697698        $value = $this->options[$name];
    698699
    699         echo '<select name="options[' . $name . ']">';
     700        echo '<select name="options[' . esc_attr($name) . ']">';
    700701        foreach ($options as $key => $label) {
    701             echo '<option value="' . $key . '"';
     702            echo '<option value="' . esc_attr($key) . '"';
    702703            if ($value == $key)
    703704                echo ' selected';
    704             echo '>' . htmlspecialchars($label) . '&nbsp;&nbsp;</option>';
     705            echo '>' . esc_html($label) . '&nbsp;&nbsp;</option>';
    705706        }
    706707        echo '</select>';
     
    709710    function button($action, $label, $message = null) {
    710711        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) . '\'"/>';
    712713        } 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) . '\')"/>';
    715716        }
    716717    }
     
    735736        if (!empty($this->errors)) {
    736737            echo '<div class="error"><p>';
     738            // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    737739            echo $this->errors;
    738740            echo '</p></div>';
     
    741743        if (!empty($this->messages)) {
    742744            echo '<div class="updated"><p>';
     745            // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    743746            echo $this->messages;
    744747            echo '</p></div>';
    745748        }
    746749    }
    747 
    748750}
    749751?>
  • hyper-cache/trunk/plugin.php

    r2985435 r3452663  
    11<?php
     2
     3defined('ABSPATH') || exit;
    24
    35/*
     
    57  Plugin URI: https://www.satollo.net/plugins/hyper-cache
    68  Description: A easy to configure and efficient cache to increase the speed of your blog.
    7   Version: 3.4.2
     9  Version: 3.4.3
    810  Author: Stefano Lissa
    911  Author URI: https://www.satollo.net
    1012  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
    1113  Contributors: satollo
    12   Requires PHP: 5.6
    13   Requires at least: 4.6
     14  Requires PHP: 7.0
     15  Requires at least: 6.1
    1416 */
    1517
     
    353355                    // For some reason it seems more performant than readfile...
    354356                    header('X-Hyper-Cache: hit,404,wp');
     357                    // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    355358                    echo file_get_contents($file);
    356359                    die();
     
    415418                    // For some reason it seems more performant than readfile...
    416419                    header('X-Hyper-Cache: hit,404,template_redirect');
     420                    // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    417421                    echo file_get_contents($file);
    418422                    die();
  • hyper-cache/trunk/readme.txt

    r2985435 r3452663  
    11=== Hyper Cache ===
    22Tags: cache,performance,staticizer,apache,htaccess,tuning,speed,bandwidth,optimization
    3 Tested up to: 6.3.2
    4 Stable tag: 3.4.2
     3Tested up to: 6.9
     4Stable tag: 3.4.3
    55Donate link: https://www.satollo.net/donations
    66Contributors: satollo
     
    7373== Changelog ==
    7474
     75= 3.4.3 =
     76
     77* WP 6.9 check
     78* PCP check
     79
    7580= 3.4.2 =
    7681
Note: See TracChangeset for help on using the changeset viewer.