WordPress.org

Plugin Directory

Changeset 1664974


Ignore:
Timestamp:
05/25/17 20:31:49 (6 months ago)
Author:
m_uysl
Message:

deploy from git

Location:
powered-cache/trunk
Files:
1 added
20 edited

Legend:

Unmodified
Added
Removed
  • powered-cache/trunk/extensions/cloudflare/cloudflare.php

    r1633170 r1664974  
    5454} 
    5555 
     56add_action( 'powered_cache_purge_all_cache', 'powered_cache_cloudflare_purge_cache' ); 
     57 
    5658// make description translatable 
    5759__( 'Cloudflare extension for Powered Cache', 'powered-cache' ); 
  • powered-cache/trunk/includes/admin/class-powered-cache-admin-actions.php

    r1638204 r1664974  
    1414     */ 
    1515    public static function update_settings() { 
    16         global $powered_cache_options, $wp_filesystem; 
     16        global $powered_cache_options, $powered_cache_fs; 
    1717 
    1818 
     
    4040                $new_options['ssl_cache']                  = ( isset( $_post['ssl_cache'] ) && 1 == $_post['ssl_cache'] ? true : false ); 
    4141                $new_options['gzip_compression']           = ( isset( $_post['gzip_compression'] ) && 1 == $_post['gzip_compression'] ? true : false ); 
    42                 $new_options['cache_timeout']              = ( isset( $_post['cache_timeout'] ) ? intval( $_post['cache_timeout'] ) : 1440 ); 
     42 
     43                /** 
     44                 * Calculate timeout with given interval, saving as minutes. 
     45                 * 
     46                 * @since 1.1 
     47                 */ 
     48                $cache_timeout = ( isset( $_post['cache_timeout'] ) ? intval( $_post['cache_timeout'] ) : 1440 ); 
     49 
     50                if ( $cache_timeout > 0 && isset( $_post['cache_timeout_interval'] ) ) { 
     51                    switch ( $_post['cache_timeout_interval'] ) { 
     52                        case 'DAY': 
     53                            $cache_timeout = $cache_timeout * 1440; 
     54                            break; 
     55                        case 'HOUR': 
     56                            $cache_timeout = $cache_timeout * 60; 
     57                            break; 
     58                        case 'MINUTE': 
     59                        default: 
     60                            $cache_timeout = $cache_timeout * 1; 
     61                    } 
     62                } 
     63 
     64                $new_options['cache_timeout'] = $cache_timeout; 
     65 
    4366                break; 
    4467            case 'advanced-options': 
     68                $new_options['remove_query_string']        = ( isset( $_post['remove_query_string'] ) && 1 == $_post['remove_query_string'] ? true : false ); 
    4569                $new_options['rejected_user_agents']   = ( strlen( trim( $_post['rejected_user_agents'] ) ) > 0 ? wp_kses_post( $_post['rejected_user_agents'] ) : '' ); 
    4670                $new_options['rejected_cookies']       = ( strlen( trim( $_post['rejected_cookies'] ) ) > 0 ? wp_kses_post( $_post['rejected_cookies'] ) : '' ); 
    4771                $new_options['rejected_uri']           = ( strlen( trim( $_post['rejected_uri'] ) ) > 0 ? wp_kses_post( $_post['rejected_uri'] ) : '' ); 
    4872                $new_options['accepted_query_strings'] = ( strlen( trim( $_post['accepted_query_strings'] ) ) > 0 ? wp_kses_post( $_post['accepted_query_strings'] ) : '' ); 
     73                $new_options['purge_additional_pages'] = ( strlen( trim( $_post['purge_additional_pages'] ) ) > 0 ? wp_kses_post( $_post['purge_additional_pages'] ) : '' ); 
    4974                break; 
    5075            case 'cdn': 
     
    101126 
    102127                    if ( $import_file && ! isset( $import_file['error'] ) ) { 
    103                         $imported_options = $wp_filesystem->get_contents( $import_file['file'] ); 
     128                        $imported_options = $powered_cache_fs->get_contents( $import_file['file'] ); 
    104129                        $imported_options = unserialize( $imported_options ); 
    105130                        $imported_options['cache_location'] = powered_cache_get_cache_dir(); 
    106                         $wp_filesystem->delete( $import_file['file'] ); 
     131                        $powered_cache_fs->delete( $import_file['file'] ); 
    107132                        update_option( 'powered_cache_settings', $imported_options ); 
    108133                        $new_options = get_option( 'powered_cache_settings' ); 
     
    130155    } 
    131156 
    132     /** 
    133      * just simple wrapper of powered_cache_flush 
    134      * 
    135      * @since 1.0 
    136      */ 
    137     public static function purge_cache() { 
    138         // purge cache stuff 
    139         powered_cache_flush(); 
    140  
    141         $msg = __( 'Cache flushed successfully', 'powered-cache' ); 
    142         Powered_Cache_Admin_Helper::set_flash_message( $msg ); 
    143  
    144         self::exit_with_redirect(); 
    145     } 
    146157 
    147158    /** 
     
    152163    public static function reset_settings() { 
    153164        // purge cache stuff 
    154         powered_cache_flush(); 
     165        powered_cache_clean_site_cache_dir(); 
    155166        delete_option( 'powered_cache_settings' ); 
    156167 
  • powered-cache/trunk/includes/admin/class-powered-cache-admin-helper.php

    r1633170 r1664974  
    2424        ); 
    2525 
     26        if ( is_multisite() && ! current_user_can( 'manage_network' ) ) { 
     27            unset( $sections['premium'] ); 
     28            unset( $sections['support'] ); 
     29        } 
     30 
    2631        return apply_filters( 'powered_cache_admin_settings_sections', $sections ); 
    2732    } 
     
    8590     * 
    8691     * @since 1.0 
    87      * 
    8892     * @return array 
    8993     */ 
     
    9195        $object_cache_methods = self::object_cache_dropins(); 
    9296 
    93         if ( ! function_exists( 'apc_fetch' ) ) { 
    94             unset( $object_cache_methods['apc'] ); 
    95         } 
    96  
    9797        if ( ! class_exists( 'Memcache' ) ) { 
    9898            unset( $object_cache_methods['memcache'] ); 
     
    107107        } 
    108108 
    109         return array_keys($object_cache_methods); 
     109        return array_keys( $object_cache_methods ); 
    110110    } 
    111111 
     
    157157     * 
    158158     * @since 1.0 
    159      * 
     159     * @since 1.1 $url changed to admin-post.php 
    160160     * @return string 
    161161     */ 
    162162    public static function flush_cache_button() { 
    163         $url = add_query_arg( array( 
    164             'page'                         => esc_attr( 'powered-cache' ), 
    165             'section'                      => 'misc', 
    166             'action'                       => 'purge_cache', 
    167             'wp_http_referer'              => urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 
    168             'powered_cache_settings_nonce' => wp_create_nonce( 'powered_cache_update_settings' ), 
    169         ), admin_url( 'admin.php' ) ); 
    170  
     163        $url  = wp_nonce_url( admin_url( 'admin-post.php?action=powered_cache_purge_all_cache' ), 'powered_cache_purge_all_cache' ); 
    171164        $html = '<a href="' . esc_url( $url ) . '" class="button" >' . esc_html__( 'Clear Cache', 'powered-cache' ) . '</a>'; 
    172165 
     
    269262    } 
    270263 
     264    /** 
     265     * convert minutes to possible time format 
     266     * 
     267     * @param int $timeout_in_minutes 
     268     * 
     269     * @since 1.1 
     270     * @return array 
     271     */ 
     272    public static function get_timeout_interval( $timeout_in_minutes ) { 
     273        $cache_timeout     = $timeout_in_minutes; 
     274        $selected_interval = 'MINUTE'; 
     275 
     276        if ( $cache_timeout > 0 ) { 
     277            if ( 0 === (int) ( $cache_timeout % 1440 ) ) { 
     278                $cache_timeout     = $cache_timeout / 1440; 
     279                $selected_interval = 'DAY'; 
     280            } elseif ( 0 === (int) ( $cache_timeout % 60 ) ) { 
     281                $cache_timeout     = $cache_timeout / 60; 
     282                $selected_interval = 'HOUR'; 
     283            } 
     284        } 
     285 
     286        return array( 
     287            $cache_timeout, 
     288            $selected_interval, 
     289        ); 
     290    } 
     291 
     292 
     293 
     294 
    271295} 
    272296 
  • powered-cache/trunk/includes/admin/class-powered-cache-admin.php

    r1633170 r1664974  
    3232 
    3333        add_action( 'admin_menu', array( $this, 'admin_menu' ) ); 
    34         add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), '9999' ); 
     34        add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 999 ); 
    3535        add_filter( 'plugin_action_links_' . plugin_basename( POWERED_CACHE_PLUGIN_FILE ), array( $this, 'action_links' ) ); 
    3636        add_action( 'load-toplevel_page_powered-cache', array( $this, 'update_options' ) ); 
    3737        add_action( 'admin_enqueue_scripts', array( $this, 'load_scripts' ) ); 
    3838        add_action( 'admin_post_deactivate_plugin', array( $this, 'deactivate_plugin' ) ); 
     39        add_action( 'admin_post_powered_cache_download_rewrite_settings', array( $this, 'download_rewrite_config' ) ); 
    3940 
    4041    } 
     
    5758                case 'powered_cache_update_settings': 
    5859                    Powered_Cache_Admin_Actions::update_settings(); 
    59                     break; 
    60                 case 'purge_cache': 
    61                     Powered_Cache_Admin_Actions::purge_cache(); 
    6260                    break; 
    6361                case 'reset_settings': 
     
    174172    } 
    175173 
     174 
     175    /** 
     176     * Downloads proper configuration file 
     177     * 
     178     * @since 1.1 
     179     */ 
     180    public function download_rewrite_config() { 
     181        if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'powered_cache_download_rewrite' ) ) { 
     182            wp_nonce_ays( '' ); 
     183        } 
     184 
     185        $server = $_GET['server']; 
     186        Powered_Cache_Config::factory()->download_rewrite_rules( $server ); 
     187 
     188        wp_safe_redirect( wp_get_referer() ); 
     189        die(); 
     190    } 
     191 
     192 
    176193    /** 
    177194     * Return an instance of the current class 
  • powered-cache/trunk/includes/admin/settings/advanced-options.php

    r1633170 r1664974  
    2121            <table class="form-table"> 
    2222                <tbody> 
     23                <tr> 
     24                    <th scope="row"><label for="powered_cache_remove_query_string"><?php _e( 'Remove query string', 'powered-cache' ); ?></label></th> 
     25                    <td> 
     26                        <label><input type="checkbox" <?php checked( powered_cache_get_option( 'remove_query_string' ), 1 ); ?> id="powered_cache_remove_query_string" name="powered_cache_settings[remove_query_string]" value="1"> 
     27                            <?php _e( 'Remove query strings from CSS & JS resources', 'powered-cache' ); ?> 
     28                            (<a target="_blank" href="http://docs.poweredcache.com/article/11-advanced-caching-options#remove-query-string">?</a>) 
     29                        </label> 
     30                    </td> 
     31                </tr> 
    2332                <tr> 
    2433                    <th scope="row"><label for="powered_cache_rejected_user_agents"><?php _e( 'Rejected user agents', 'powered-cache' ); ?></label></th> 
     
    5362                    </td> 
    5463                </tr> 
     64                <tr> 
     65                    <th scope="row"><label for="powered_cache_purge_additional_pages"><?php _e( 'Purge Additional Pages', 'powered-cache' ); ?></label></th> 
     66                    <td> 
     67                        <textarea id="powered_cache_purge_additional_pages" name="powered_cache_settings[purge_additional_pages]" cols="50" rows="5"><?php echo powered_cache_get_option( 'purge_additional_pages' ); ?></textarea><br> 
     68                        <span class="description"><?php _e( 'Enter pages line by line.', 'powered-cache' ); ?></span> 
     69                        (<a target="_blank" href="http://docs.poweredcache.com/article/11-advanced-caching-options#purge-additional-pages">?</a>) 
     70                    </td> 
     71                </tr> 
    5572 
    5673                </tbody> 
  • powered-cache/trunk/includes/admin/settings/basic-options.php

    r1633170 r1664974  
    3131                </tr> 
    3232 
     33                <?php 
     34                // additional control needed for cache flushing 
     35                if ( ( is_multisite() && current_user_can( 'manage_network' ) ) || current_user_can( 'activate_plugins' ) ): ?> 
    3336                <tr> 
    3437                    <th scope="row"><label for="powered_cache_object_cache"><?php _e( 'Object Caching', 'powered-cache' ); ?></label></th> 
     
    4649                    </td> 
    4750                </tr> 
     51                <?php endif; ?> 
    4852 
    4953                <tr> 
     
    8690                    <th scope="row"><label for="powered_cache_cache_timeout"><?php _e( 'Cache Timeout', 'powered-cache' ); ?></label></th> 
    8791                    <td> 
    88                         <label><input size="5" id="powered_cache_cache_timeout" type="text" value="<?php echo powered_cache_get_option( 'cache_timeout' ); ?>" name="powered_cache_settings[cache_timeout]"> <?php _e( 'minutes', 'powered-cache' ); ?></label> 
     92                        <?php 
     93                        $cache_timeout_in_minutes = powered_cache_get_option( 'cache_timeout' ); 
     94                        list( $cache_timeout, $selected_interval ) = Powered_Cache_Admin_Helper::get_timeout_interval( $cache_timeout_in_minutes ); 
     95                        ?> 
     96                        <label><input size="5" id="powered_cache_cache_timeout" type="text" value="<?php echo $cache_timeout; ?>" name="powered_cache_settings[cache_timeout]"> </label> 
     97                        <label> 
     98                            <select name="powered_cache_settings[cache_timeout_interval]" id="powered_cache_cache_timeout_interval"> 
     99                                <option <?php selected( 'MINUTE', $selected_interval ); ?> value="MINUTE"><?php echo __( 'Minute', 'powered-cache' ); ?></option> 
     100                                <option <?php selected( 'HOUR', $selected_interval ); ?> value="HOUR"><?php echo __( 'Hour', 'powered-cache' ); ?></option> 
     101                                <option <?php selected( 'DAY', $selected_interval ); ?> value="DAY"><?php echo __( 'Day', 'powered-cache' ); ?></option> 
     102                            </select> 
     103                        </label> 
    89104                        (<a target="_blank" href="http://docs.poweredcache.com/article/10-cache-timeout">?</a>) 
    90105                    </td> 
  • powered-cache/trunk/includes/admin/settings/misc.php

    r1633170 r1664974  
    2929                </tr> 
    3030 
     31                <?php 
     32                // additional control needed for cache flushing 
     33                if ( ( is_multisite() && current_user_can( 'manage_network' ) ) || current_user_can( 'activate_plugins' ) ): ?> 
     34                    <tr> 
     35                        <th scope="row"><label for="powered_cache_clear_cache"><?php _e( 'Clear Cache', 'powered-cache' ); ?></label></th> 
     36                        <td> 
     37                            <?php echo Powered_Cache_Admin_Helper::flush_cache_button(); ?> 
     38                            <br> 
     39                            <span class="description"><?php _e( 'Clear all cache, including object cache', 'powered-cache' ); ?></span> 
     40                        </td> 
     41                    </tr> 
     42                <?php endif; ?> 
     43 
    3144                <tr> 
    32                     <th scope="row"><label for="powered_cache_clear_cache"><?php _e( 'Clear Cache', 'powered-cache' ); ?></label></th> 
     45                    <th scope="row"><label for="powered_cache_rewrite"><?php _e( 'Download Configuration', 'powered-cache' ); ?></label></th> 
    3346                    <td> 
    34                         <?php echo Powered_Cache_Admin_Helper::flush_cache_button(); ?> 
     47                        <a href="<?php echo wp_nonce_url( admin_url( 'admin-post.php?action=powered_cache_download_rewrite_settings&server=apache' ), 'powered_cache_download_rewrite' ); ?>" class="button-secondary"> 
     48                            <?php _e( '.htaccess configuration', 'powered-cache' ); ?> 
     49                        </a> 
     50                        <a href="<?php echo wp_nonce_url( admin_url( 'admin-post.php?action=powered_cache_download_rewrite_settings&server=nginx' ), 'powered_cache_download_rewrite' ); ?>" class="button-secondary"> 
     51                            <?php _e( 'nginx configuration', 'powered-cache' ); ?> 
     52                        </a> 
    3553                        <br> 
    36                         <span class="description"><?php _e( 'Clear all cache, including object cache', 'powered-cache' ); ?></span> 
     54                        <span class="description"><?php _e( 'Download configuration file for your server', 'powered-cache' ); ?></span> 
    3755                    </td> 
    3856                </tr> 
    39  
    4057                <tr> 
    4158                    <th scope="row"><label for="powered_cache_clear_cache"><?php _e( 'Reset All Settings', 'powered-cache' ); ?></label></th> 
  • powered-cache/trunk/includes/class-powered-cache-advanced-cache.php

    r1633170 r1664974  
    3939        add_action( 'wp_set_comment_status', array( $this, 'purge_post_on_comment_status_change' ), 10, 2 ); 
    4040        add_action( 'set_comment_cookies', array( $this, 'set_comment_cookie' ), 10, 2 ); 
     41        add_filter( 'powered_cache_post_related_urls', array( $this, 'powered_cache_post_related_urls' ) ); 
    4142    } 
    4243 
     
    5859    /** 
    5960     * Purge page cache directory 
     61     * 
    6062     * @since 1.0 
     63     * @since 1.1 clean site dir instead of root page caching dir 
    6164     */ 
    6265    public function purge_page_cache() { 
     
    6568        } 
    6669 
    67         powered_cache_clean_page_cache_dir(); 
     70        powered_cache_clean_site_cache_dir(); 
    6871        Powered_Cache_Admin_Helper::set_flash_message( __( 'Page cache deleted successfully!', 'powered-cache' ) ); 
    6972 
     
    125128    } 
    126129 
     130 
     131    /** 
     132     * Adds custom pages to post related urls 
     133     * 
     134     * @since 1.1 
     135     * 
     136     * @param array $urls 
     137     * 
     138     * @return array urls 
     139     */ 
     140    public function powered_cache_post_related_urls( $urls ) { 
     141        $additional_pages = powered_cache_get_option( 'purge_additional_pages' ); 
     142 
     143        if ( empty( $additional_pages ) ) { 
     144            return $urls; 
     145        } 
     146 
     147        // we only need relative path 
     148        $additional_pages      = str_replace( site_url(), '', $additional_pages ); 
     149        $additional_page_paths = explode( PHP_EOL, $additional_pages ); 
     150        $additional_urls       = array(); 
     151 
     152        foreach ( $additional_page_paths as $page ) { 
     153            $additional_urls[] = site_url( $page ); 
     154        } 
     155 
     156        $urls = array_merge( $urls, $additional_urls ); 
     157 
     158        return $urls; 
     159    } 
     160 
    127161} 
  • powered-cache/trunk/includes/class-powered-cache-config.php

    r1633170 r1664974  
    1212     * 
    1313     * @since 1.0 
     14     * @since 1.1 initialize WP_Filesystem_Direct 
    1415     * @return Powered_Cache_Config 
    1516     */ 
     
    1920        if ( ! $instance ) { 
    2021            $instance = new self(); 
    21             global $wp_filesystem; 
    22  
    23             if ( ! $wp_filesystem ) { 
    24                 require_once( ABSPATH . 'wp-admin/includes/file.php' ); 
    25                 WP_Filesystem(); 
     22            global $powered_cache_fs; 
     23 
     24            if ( ! $powered_cache_fs ) { 
     25                include_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'; 
     26                include_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php'; 
     27 
     28                $powered_cache_fs = new WP_Filesystem_Direct( new StdClass() ); 
    2629            } 
    2730        } 
     
    5760            'cache_location'             => powered_cache_get_cache_dir(), 
    5861            // advanced options 
     62            'remove_query_string'        => false, 
    5963            'rejected_user_agents'       => '', 
    6064            'rejected_cookies'           => '', 
    6165            'rejected_uri'               => '', 
    6266            'accepted_query_strings'     => '', 
     67            'purge_additional_pages'     => '', 
    6368            // cdn 
    6469            'cdn_status'                 => false, 
     
    7984     * 
    8085     * @since 1.0 
     86     * @since 1.1 is_multisite control added 
    8187     * @return bool 
    8288     */ 
    8389    public function generate_advanced_cache_file() { 
    84         global $wp_filesystem; 
    85  
    86         $file = untrailingslashit( WP_CONTENT_DIR )  . '/advanced-cache.php'; 
     90        global $powered_cache_fs; 
     91 
     92        $file = untrailingslashit( WP_CONTENT_DIR ) . '/advanced-cache.php'; 
    8793 
    8894 
    8995        $file_string = ''; 
    9096 
    91         if ( true === powered_cache_get_option( 'enable_page_caching' ) ) { 
     97        /** 
     98         * multisite setups should always have `advanced-cache.php` file 
     99         */ 
     100        if ( true === powered_cache_get_option( 'enable_page_caching' ) || is_multisite() ) { 
    92101            $file_string = $this->advanced_cache_file_content(); 
    93102        } 
    94103 
    95         if ( ! $wp_filesystem->put_contents( $file, $file_string, FS_CHMOD_FILE ) ) { 
     104        if ( ! $powered_cache_fs->put_contents( $file, $file_string, FS_CHMOD_FILE ) ) { 
    96105            return false; 
    97106        } 
     
    110119     */ 
    111120    public function setup_object_cache( $backend = 'off' ) { 
    112         global $wp_filesystem; 
     121        global $powered_cache_fs; 
    113122 
    114123        $file = untrailingslashit( WP_CONTENT_DIR )  . '/object-cache.php'; 
    115124 
     125        if ( is_multisite() && ! current_user_can( 'manage_network' ) ) { 
     126            return false; 
     127        } 
     128 
    116129        if ( 'off' === $backend ) { 
    117             if ( $wp_filesystem->exists( $file ) ) { 
    118                 $wp_filesystem->delete( $file ); // remove object cache file 
     130            if ( $powered_cache_fs->exists( $file ) ) { 
     131                $powered_cache_fs->delete( $file ); // remove object cache file 
    119132            } 
    120133 
     
    124137        $file_string = $this->object_cache_file_content( $backend ); 
    125138 
    126         if ( ! $wp_filesystem->put_contents( $file, $file_string, FS_CHMOD_FILE ) ) { 
     139        if ( ! $powered_cache_fs->put_contents( $file, $file_string, FS_CHMOD_FILE ) ) { 
    127140            return false; 
    128141        } 
     
    162175     * 
    163176     * @since 1.0 
     177     * @since 1.1 supports `POWERED_CACHE_OBJECT_CACHE_DROPIN` 
    164178     * @param $backend 
    165179     * @see Powered_Cache_Admin_Helper::object_cache_dropins 
     
    169183    public function object_cache_file_content( $backend ) { 
    170184        $string = '<?php ' . "\n"; 
    171         $string .= "defined( 'ABSPATH' ) || exit;" . "\n"; 
    172         $string .= "define( 'POWERED_OBJECT_CACHE', true );" . "\n"; 
    173         $string .= "if ( ! @file_exists( WP_CONTENT_DIR . '/pc-config/config-' . \$_SERVER['HTTP_HOST'] . '.php' ) ) { return; }" . "\n"; 
     185        $string .= "defined( 'ABSPATH' ) || exit;" . PHP_EOL; 
     186        $string .= "define( 'POWERED_OBJECT_CACHE', true );" . PHP_EOL; 
     187        $string .= "if ( ! @file_exists( WP_CONTENT_DIR . '/pc-config/config-' . \$_SERVER['HTTP_HOST'] . '.php' ) ) { return; }" . PHP_EOL; 
    174188 
    175189        $object_caches = Powered_Cache_Admin_Helper::object_cache_dropins(); 
    176190 
    177191        $string .= "\$GLOBALS['powered_cache_options'] = include( WP_CONTENT_DIR . '/pc-config/config-' . \$_SERVER['HTTP_HOST'] . '.php' );" . "\n\n"; 
    178  
    179         $string .= 'if ( @file_exists( \'' . $object_caches[ $backend ] . '\' ) ) {' . "\n"; 
    180         $string .= "\t" . 'include( \'' . $object_caches[ $backend ] . '\' );' . "\n"; 
    181         $string .= '} else {' . "\n"; 
    182         $string .= "\t" . 'define( \'POWERED_OBJECT_CACHE_HAS_PROBLEM\', true );' . "\n"; 
     192        $string .= 'if ( defined( \'POWERED_CACHE_OBJECT_CACHE_DROPIN\') && @file_exists( POWERED_CACHE_OBJECT_CACHE_DROPIN ) ) {' . PHP_EOL; 
     193        $string .= "\t" . 'include( POWERED_CACHE_OBJECT_CACHE_DROPIN );' . PHP_EOL; 
     194        $string .= '} elseif ( @file_exists( \'' . $object_caches[ $backend ] . '\' ) ) {' . PHP_EOL; 
     195        $string .= "\t" . 'include( \'' . $object_caches[ $backend ] . '\' );' . PHP_EOL; 
     196        $string .= '} else {' . PHP_EOL; 
     197        $string .= "\t" . 'define( \'POWERED_OBJECT_CACHE_HAS_PROBLEM\', true );' . PHP_EOL; 
    183198        $string .= '}'; 
    184199 
     
    191206     * 
    192207     * @since 1.0 
     208     * @since 1.1 supports `POWERED_CACHE_ADVANCED_CACHE_DROPIN` 
    193209     * @return mixed|void 
    194210     */ 
     
    216232        $string .= '$powered_cache_mobile_prefixes = ' . var_export( powered_cache_mobile_prefixes(), true ) . ";" . PHP_EOL; 
    217233 
    218         $string .= 'if ( @file_exists( \'' . POWERED_CACHE_DROPIN_DIR . 'page-cache.php' . '\' ) ) {' . PHP_EOL; 
     234        $string .= 'if ( defined( \'POWERED_CACHE_ADVANCED_CACHE_DROPIN\') && @file_exists( POWERED_CACHE_ADVANCED_CACHE_DROPIN ) ) {' . PHP_EOL; 
     235        $string .= "\t" . 'include( POWERED_CACHE_ADVANCED_CACHE_DROPIN );' . PHP_EOL; 
     236        $string .= '} elseif ( @file_exists( \'' . POWERED_CACHE_DROPIN_DIR . 'page-cache.php' . '\' ) ) {' . PHP_EOL; 
    219237        $string .= "\t" . 'include( \'' . POWERED_CACHE_DROPIN_DIR . 'page-cache.php' . '\' );' . PHP_EOL; 
    220238        $string .= '} else {' . PHP_EOL; 
     
    235253     */ 
    236254    public function define_wp_cache( $status ) { 
    237         global $wp_filesystem; 
     255        global $powered_cache_fs; 
    238256        $config_path = $this->find_wp_config_file(); 
    239257 
     
    247265        } 
    248266 
    249         $config_file_string = $wp_filesystem->get_contents( $config_path ); 
     267        $config_file_string = $powered_cache_fs->get_contents( $config_path ); 
    250268 
    251269        // Config file is empty. Maybe couldn't read it? 
     
    282300        } 
    283301 
    284         if ( ! $wp_filesystem->put_contents( $config_path, implode( "\n\r", $config_file ), FS_CHMOD_FILE ) ) { 
     302        if ( ! $powered_cache_fs->put_contents( $config_path, implode( "\n\r", $config_file ), FS_CHMOD_FILE ) ) { 
    285303            return false; 
    286304        } 
     
    298316     */ 
    299317    public function find_wp_config_file() { 
    300         global $wp_filesystem; 
     318        global $powered_cache_fs; 
    301319 
    302320        $file = '/wp-config.php'; 
     
    307325            } 
    308326 
    309             if ( $wp_filesystem->exists( untrailingslashit( ABSPATH ) . $file ) ) { 
     327            if ( $powered_cache_fs->exists( untrailingslashit( ABSPATH ) . $file ) ) { 
    310328                $config_path = untrailingslashit( ABSPATH ) . $file; 
    311329                break; 
     
    329347     */ 
    330348    public function save_to_file( $configuration ) { 
    331         global $wp_filesystem; 
     349        global $powered_cache_fs; 
    332350 
    333351        $config_dir = WP_CONTENT_DIR  . '/pc-config'; 
     
    350368        $configuration['cache_location'] = powered_cache_get_cache_dir(); 
    351369 
    352         $wp_filesystem->mkdir( $config_dir ); 
     370        $powered_cache_fs->mkdir( $config_dir ); 
    353371 
    354372        $config_file_string = '<?php ' . "\n\r" . "defined( 'ABSPATH' ) || exit;" . "\n\r" . 'return ' . var_export( $configuration, true ) . '; ' . "\n\r"; 
    355373 
    356         if ( ! $wp_filesystem->put_contents( $config_file, $config_file_string, FS_CHMOD_FILE ) ) { 
     374        if ( ! $powered_cache_fs->put_contents( $config_file, $config_file_string, FS_CHMOD_FILE ) ) { 
    357375            return false; 
    358376        } 
     
    368386     */ 
    369387    public function configure_htaccess( $enable = true ) { 
    370         global $wp_filesystem; 
    371         $rules         = ''; 
     388        global $powered_cache_fs; 
    372389        $htaccess_file = get_home_path() . '.htaccess'; 
    373390 
    374         if ( $wp_filesystem->is_writable( $htaccess_file ) ) { 
    375             $contents = $wp_filesystem->get_contents( $htaccess_file ); 
    376  
    377             $rules .= apply_filters( 'powered_cache_pre_htaccess', '', $contents ); 
     391        if ( $powered_cache_fs->is_writable( $htaccess_file ) ) { 
     392            $contents = $powered_cache_fs->get_contents( $htaccess_file ); 
    378393 
    379394            //clean up 
     
    381396 
    382397            if ( false === $enable ) { 
    383                 return $wp_filesystem->put_contents( $htaccess_file, $contents, FS_CHMOD_FILE ); 
    384             } 
    385  
    386             $rules .= '# BEGIN POWERED CACHE' . PHP_EOL; 
    387  
    388             // todo set option here. 
    389             if ( apply_filters( 'powered_cache_browser_cache', true ) ) { 
    390                 $wp_mime_types = wp_get_mime_types(); 
    391                 $mime_types    = array_flip( $wp_mime_types ); 
    392                 //mimes 
    393                 $rules .= '<IfModule mod_mime.c>' . PHP_EOL; 
    394                     foreach ( $mime_types as $mime_type => $ext ) { 
    395                         $ext_str = '.' . str_replace( '|', ' .', $ext ); 
    396                         $rules .= "    AddType " . $mime_type . " " . $ext_str . PHP_EOL; 
    397                     } 
    398                 $rules .= "</IfModule>" . PHP_EOL; 
    399  
    400                 // set expire time 
    401  
    402                 $rules .= '<IfModule mod_expires.c>' . PHP_EOL; 
    403                 $rules .= "    ExpiresActive On".PHP_EOL; 
    404                 $rules .= '    ExpiresByType  text/html            "access plus 0 seconds"'. PHP_EOL; 
    405                 $rules .= '    ExpiresByType  text/richtext        "access plus 0 seconds"'. PHP_EOL; 
    406                 $rules .= '    ExpiresByType  image/svg+xml        "access plus 0 seconds"'. PHP_EOL; 
    407                 $rules .= '    ExpiresByType  text/plain           "access plus 0 seconds"'. PHP_EOL; 
    408                 $rules .= '    ExpiresByType  text/xsd             "access plus 0 seconds"'. PHP_EOL; 
    409                 $rules .= '    ExpiresByType  text/xsl             "access plus 0 seconds"'. PHP_EOL; 
    410                 $rules .= '    ExpiresByType  text/xml             "access plus 0 seconds"'. PHP_EOL; 
    411                 $rules .= '    ExpiresByType  text/cache-manifest  "access plus 0 seconds"'. PHP_EOL; 
    412  
    413  
    414                 foreach ( $mime_types as $mime_type => $ext ) { 
    415  
    416  
    417                     if ( in_array( $mime_type, array( 'text/html', 'text/richtext', 'image/svg+xml', 'text/plain', 'text/xsd', 'text/xsl', 'text/xml', 'text/cache-manifest' ) ) ) { 
    418                         continue; 
    419                     } 
    420  
    421                     /** 
    422                      * Apache allow both format like A2592000 => "access plus 1 month" 
    423                      * A => access, M => Modified 
    424                      * 
    425                      * @see http://httpd.apache.org/docs/current/mod/mod_expires.html 
    426                      */ 
    427  
    428                     if ( in_array( $mime_type, array( 'text/css', 'application/javascript' ) ) ) { 
    429                         $expiry_time = apply_filters( 'powered_cache_browser_cache_assets_lifespan', 'access plus 1 year' ); 
    430                     } else { 
    431                         $expiry_time = apply_filters( 'powered_cache_browser_cache_default_lifespan', 'access plus 1 month' ); 
    432                     } 
    433                     $rules .= '    ExpiresByType '.$mime_type.'                 "'.$expiry_time.'"' . PHP_EOL; 
     398                return $powered_cache_fs->put_contents( $htaccess_file, $contents, FS_CHMOD_FILE ); 
     399            } 
     400 
     401            $rules    = $this->htaccess_rules(); 
     402            $contents = $rules . $contents; 
     403 
     404            // Update the .htacces file 
     405            if ( ! $powered_cache_fs->put_contents( $htaccess_file, $contents, FS_CHMOD_FILE ) ) { 
     406                return false; 
     407            } 
     408 
     409            return true; 
     410        } 
     411 
     412        return false; 
     413    } 
     414 
     415 
     416    /** 
     417     * Prepares .htaccess rules for the caching 
     418     * 
     419     * @since 1.1 
     420     * @return string $rules 
     421     */ 
     422    public function htaccess_rules() { 
     423        $rules = ''; 
     424 
     425        /** 
     426         * @since 1.1 $contents parameter removed 
     427         */ 
     428        $rules .= apply_filters( 'powered_cache_pre_htaccess', '' ); 
     429 
     430        $rules .= '# BEGIN POWERED CACHE' . PHP_EOL; 
     431 
     432        // todo set option here. 
     433        if ( apply_filters( 'powered_cache_browser_cache', true ) ) { 
     434            $wp_mime_types = wp_get_mime_types(); 
     435            $mime_types    = array_flip( $wp_mime_types ); 
     436            //mimes 
     437            $rules .= '<IfModule mod_mime.c>' . PHP_EOL; 
     438            foreach ( $mime_types as $mime_type => $ext ) { 
     439                $ext_str = '.' . str_replace( '|', ' .', $ext ); 
     440                $rules .= "    AddType " . $mime_type . " " . $ext_str . PHP_EOL; 
     441            } 
     442            $rules .= "</IfModule>" . PHP_EOL; 
     443 
     444            // set expire time 
     445 
     446            $rules .= '<IfModule mod_expires.c>' . PHP_EOL; 
     447            $rules .= "    ExpiresActive On" . PHP_EOL; 
     448            $rules .= '    ExpiresByType  text/html            "access plus 0 seconds"' . PHP_EOL; 
     449            $rules .= '    ExpiresByType  text/richtext        "access plus 0 seconds"' . PHP_EOL; 
     450            $rules .= '    ExpiresByType  image/svg+xml        "access plus 0 seconds"' . PHP_EOL; 
     451            $rules .= '    ExpiresByType  text/plain           "access plus 0 seconds"' . PHP_EOL; 
     452            $rules .= '    ExpiresByType  text/xsd             "access plus 0 seconds"' . PHP_EOL; 
     453            $rules .= '    ExpiresByType  text/xsl             "access plus 0 seconds"' . PHP_EOL; 
     454            $rules .= '    ExpiresByType  text/xml             "access plus 0 seconds"' . PHP_EOL; 
     455            $rules .= '    ExpiresByType  text/cache-manifest  "access plus 0 seconds"' . PHP_EOL; 
     456 
     457            foreach ( $mime_types as $mime_type => $ext ) { 
     458 
     459                if ( in_array( $mime_type, array( 'text/html', 'text/richtext', 'image/svg+xml', 'text/plain', 'text/xsd', 'text/xsl', 'text/xml', 'text/cache-manifest' ) ) ) { 
     460                    continue; 
    434461                } 
    435                 $rules .= "</IfModule>" . PHP_EOL; 
    436  
    437             } 
    438  
    439  
    440             // gzip 
    441             $rules .= '<IfModule mod_deflate.c>' . PHP_EOL; 
    442             $rules .= '  <IfModule mod_headers.c>' . PHP_EOL; 
    443             $rules .= '    Header append Vary User-Agent env=!dont-vary' . PHP_EOL; 
    444             $rules .= '  </IfModule>' . PHP_EOL; 
    445             $rules .= '    AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/bmp application/java application/msword application/vnd.ms-fontobject application/x-msdownload image/x-icon application/json application/vnd.ms-access application/vnd.ms-project application/x-font-otf application/vnd.ms-opentype application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.presentation application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text audio/ogg application/pdf application/vnd.ms-powerpoint application/x-shockwave-flash image/tiff application/x-font-ttf application/vnd.ms-opentype audio/wav application/vnd.ms-write application/font-woff application/font-woff2 application/vnd.ms-excel' . PHP_EOL; 
    446             $rules .= '  <IfModule mod_mime.c>' . PHP_EOL; 
    447             $rules .= '    AddOutputFilter DEFLATE js css htm html xml' . PHP_EOL; 
    448             $rules .= '  </IfModule>' . PHP_EOL; 
    449             $rules .= '</IfModule>' . PHP_EOL; 
    450  
    451  
    452  
    453  
    454             // remove etag 
    455             $rules .= '<IfModule mod_headers.c>' . PHP_EOL; 
    456             $rules .= 'Header unset ETag' . PHP_EOL; 
    457             $rules .= '</IfModule>' . PHP_EOL . PHP_EOL; 
    458  
    459  
    460             // rewrite 
    461  
    462             $env_powered_cache_ua = ''; 
    463             $env_powered_cache_ssl = ''; 
    464             $env_powered_cache_enc = ''; 
    465  
    466  
    467             $rewrite_base = network_home_url( '', 'relative' ); 
    468             if ( empty( $rewrite_base ) ) { 
    469                 $rewrite_base = '/'; 
    470             } 
    471  
    472             $cache_dir = powered_cache_get_cache_dir(); 
    473  
    474             $rules .= '<IfModule mod_rewrite.c>' . PHP_EOL; 
    475             $rules .= '    RewriteEngine On' . PHP_EOL; 
    476             $rules .= '    RewriteBase ' . $rewrite_base . PHP_EOL; 
    477  
    478  
    479             if ( true === powered_cache_get_option( 'cache_mobile' ) && true === powered_cache_get_option( 'cache_mobile_separate_file' ) ) { 
    480                 $mobile_browsers = addcslashes( implode( '|', preg_split( '/[\s*,\s*]*,+[\s*,\s*]*/', powered_cache_mobile_browsers() ) ), ' ' ); 
    481                 $mobile_prefixes = addcslashes( implode( '|', preg_split( '/[\s*,\s*]*,+[\s*,\s*]*/', powered_cache_mobile_prefixes() ) ), ' ' ); 
    482                 // mobile env set 
    483                 $rules .= "    RewriteCond %{HTTP_USER_AGENT} (" . $mobile_browsers . ") [NC]" . PHP_EOL; 
    484                 $rules .= "    RewriteRule .* - [E=PC_UA:-mobile]" . PHP_EOL; 
    485                 $rules .= "    RewriteCond %{HTTP_USER_AGENT} ^(" . $mobile_prefixes . ") [NC]" . PHP_EOL; 
    486                 $rules .= "    RewriteRule .* - [E=PC_UA:-mobile]" . PHP_EOL; 
    487                 $env_powered_cache_ua = '%{ENV:PC_UA}'; 
    488             } 
    489  
    490             if ( true === powered_cache_get_option( 'ssl_cache' ) ) { 
    491                 $rules .= "    RewriteCond %{HTTPS} =on" . PHP_EOL; 
    492                 $rules .= "    RewriteRule .* - [E=W3TC_SSL:-https]" . PHP_EOL; 
    493                 $rules .= "    RewriteCond %{SERVER_PORT} =443" . PHP_EOL; 
    494                 $rules .= "    RewriteRule .* - [E=PC_SSL:-https]" . PHP_EOL; 
    495                 $env_powered_cache_ssl = '%{ENV:PC_SSL}'; 
    496             } 
    497  
    498             if ( true === powered_cache_get_option( 'gzip_compression' ) ) { 
    499                 $rules .= "    RewriteCond %{HTTP:Accept-Encoding} gzip" . PHP_EOL; 
    500                 $rules .= "    RewriteRule .* - [E=PC_ENC:_gzip]" . PHP_EOL; 
    501                 $env_powered_cache_enc = '%{ENV:PC_ENC}'; 
    502             } 
    503  
    504             $rules .= "    RewriteCond %{REQUEST_METHOD} !=POST" . PHP_EOL; 
    505             $rules .= '    RewriteCond %{QUERY_STRING} =""' . PHP_EOL; 
    506  
    507             if ( substr( get_option( 'permalink_structure' ), - 1 ) == '/' ) { 
    508                 $rules .= '    RewriteCond %{REQUEST_URI} \/$' . PHP_EOL; 
    509             } 
    510  
    511                 // Get root base 
    512             $home_root = parse_url( home_url() ); 
    513             $home_root = isset( $home_root['path'] ) ? trailingslashit($home_root['path']) : '/'; 
    514  
    515             $site_root = parse_url( site_url() ); 
    516             $site_root = isset( $site_root['path'] ) ? trailingslashit($site_root['path']) : ''; 
    517  
    518  
    519             // reject user agent 
    520             if ( false !== powered_cache_get_option( 'rejected_user_agents' ) ) { 
    521                 $rejected_user_agents = preg_split( '#(\r\n|\n|\r)#', powered_cache_get_option( 'rejected_user_agents' ) ); 
    522                 if ( ! empty( $rejected_user_agents ) ) { 
    523                     $rules .= '    RewriteCond %{HTTP_USER_AGENT} !^(' . implode( '|', $rejected_user_agents ) . ').* [NC]' . PHP_EOL; 
     462 
     463                /** 
     464                 * Apache allow both format like A2592000 => "access plus 1 month" 
     465                 * A => access, M => Modified 
     466                 * 
     467                 * @see http://httpd.apache.org/docs/current/mod/mod_expires.html 
     468                 */ 
     469                if ( in_array( $mime_type, array( 'text/css', 'application/javascript' ) ) ) { 
     470                    $expiry_time = apply_filters( 'powered_cache_browser_cache_assets_lifespan', 'access plus 1 year' ); 
     471                } else { 
     472                    $expiry_time = apply_filters( 'powered_cache_browser_cache_default_lifespan', 'access plus 1 month' ); 
    524473                } 
    525             } 
    526  
    527  
    528             // ignore cookies 
    529             if ( false !== powered_cache_get_option( 'rejected_uri' ) ) { 
    530                 $cookies = preg_split( '#(\n|\r)#', powered_cache_get_option( 'rejected_uri' ) ); 
    531             } 
    532             $wp_cookies = array( 'wordpressuser_', 'wordpresspass_', 'wordpress_sec_', 'wordpress_logged_in_' ); 
    533             if ( ! empty( $cookies ) ) { 
    534                 $wp_cookies = array_merge( $cookies, $wp_cookies ); 
    535             } 
    536             $rules .= '    RewriteCond %{HTTP:Cookie} !(' . implode( '|', $wp_cookies ) . ') [NC]' . PHP_EOL; 
    537  
    538             // dont cache fbexternal 
    539             $rules .= '    RewriteCond %{HTTP_USER_AGENT} !^(facebookexternalhit).* [NC]'.PHP_EOL; 
    540  
    541  
    542             $cache_location = powered_cache_get_cache_dir(); 
    543             $cache_location = untrailingslashit( $cache_location ) . '/powered-cache/'; 
    544             if ( strpos( ABSPATH, $cache_location ) === false ) { 
    545                 // clean doc root 
    546                 $cache_path = str_replace( $_SERVER['DOCUMENT_ROOT'], '', $cache_location ); 
    547             } else { 
    548                 $cache_path = $site_root . str_replace( ABSPATH, '', $cache_location ); 
    549             } 
    550  
    551  
    552             if ( apply_filters( 'powered_cache_maybe_1and1_hosting', ( 0 === strpos( $_SERVER['DOCUMENT_ROOT'], '/kunden/homepage/' ) ) ) ) { 
    553                 $rules .= '    RewriteCond "' . str_replace( '/kunden/homepage/', '/', $cache_location ) . '%{HTTP_HOST}' . '%{REQUEST_URI}/index' . $env_powered_cache_ssl . $env_powered_cache_ua . '.html' . $env_powered_cache_enc . '" -f' . PHP_EOL; 
    554             } else { 
    555                 $rules .= '    RewriteCond "%{DOCUMENT_ROOT}/' . ltrim( $cache_path, '/' ) . '%{HTTP_HOST}' . '%{REQUEST_URI}/index' . $env_powered_cache_ssl . $env_powered_cache_ua . '.html' . $env_powered_cache_enc . '" -f' . PHP_EOL; 
    556             } 
    557             $rules .= '    RewriteRule .* "' . $cache_path . '%{HTTP_HOST}' . '%{REQUEST_URI}/index' . $env_powered_cache_ssl . $env_powered_cache_ua . '.html' . $env_powered_cache_enc . '" [L]' . PHP_EOL; 
    558             $rules .= '</IfModule>' . PHP_EOL; 
    559             $rules .= '# END POWERED CACHE' . PHP_EOL; 
    560  
    561             $contents = $rules . $contents; 
    562  
    563             // Update the .htacces file 
    564             if ( ! $wp_filesystem->put_contents( $htaccess_file, $contents, FS_CHMOD_FILE ) ) { 
    565                 return false; 
    566             } 
    567  
    568             return true; 
    569         } 
    570  
    571         return false; 
     474                $rules .= '    ExpiresByType ' . $mime_type . '                 "' . $expiry_time . '"' . PHP_EOL; 
     475            } 
     476            $rules .= "</IfModule>" . PHP_EOL; 
     477 
     478        } 
     479 
     480 
     481        // gzip 
     482        $rules .= '<IfModule mod_deflate.c>' . PHP_EOL; 
     483        $rules .= '  <IfModule mod_headers.c>' . PHP_EOL; 
     484        $rules .= '    Header append Vary User-Agent env=!dont-vary' . PHP_EOL; 
     485        $rules .= '  </IfModule>' . PHP_EOL; 
     486        $rules .= '    AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/bmp application/java application/msword application/vnd.ms-fontobject application/x-msdownload image/x-icon application/json application/vnd.ms-access application/vnd.ms-project application/x-font-otf application/vnd.ms-opentype application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.presentation application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text audio/ogg application/pdf application/vnd.ms-powerpoint application/x-shockwave-flash image/tiff application/x-font-ttf application/vnd.ms-opentype audio/wav application/vnd.ms-write application/font-woff application/font-woff2 application/vnd.ms-excel' . PHP_EOL; 
     487        $rules .= '  <IfModule mod_mime.c>' . PHP_EOL; 
     488        $rules .= '    AddOutputFilter DEFLATE js css htm html xml' . PHP_EOL; 
     489        $rules .= '  </IfModule>' . PHP_EOL; 
     490        $rules .= '</IfModule>' . PHP_EOL; 
     491 
     492 
     493        // remove etag 
     494        $rules .= '<IfModule mod_headers.c>' . PHP_EOL; 
     495        $rules .= 'Header unset ETag' . PHP_EOL; 
     496        $rules .= '</IfModule>' . PHP_EOL . PHP_EOL; 
     497 
     498 
     499        // rewrite 
     500 
     501        $env_powered_cache_ua  = ''; 
     502        $env_powered_cache_ssl = ''; 
     503        $env_powered_cache_enc = ''; 
     504 
     505 
     506        $rewrite_base = network_home_url( '', 'relative' ); 
     507        if ( empty( $rewrite_base ) ) { 
     508            $rewrite_base = '/'; 
     509        } 
     510 
     511        $rules .= '<IfModule mod_rewrite.c>' . PHP_EOL; 
     512        $rules .= '    RewriteEngine On' . PHP_EOL; 
     513        $rules .= '    RewriteBase ' . $rewrite_base . PHP_EOL; 
     514 
     515 
     516        if ( true === powered_cache_get_option( 'cache_mobile' ) && true === powered_cache_get_option( 'cache_mobile_separate_file' ) ) { 
     517            $mobile_browsers = addcslashes( implode( '|', preg_split( '/[\s*,\s*]*,+[\s*,\s*]*/', powered_cache_mobile_browsers() ) ), ' ' ); 
     518            $mobile_prefixes = addcslashes( implode( '|', preg_split( '/[\s*,\s*]*,+[\s*,\s*]*/', powered_cache_mobile_prefixes() ) ), ' ' ); 
     519            // mobile env set 
     520            $rules .= "    RewriteCond %{HTTP_USER_AGENT} (" . $mobile_browsers . ") [NC]" . PHP_EOL; 
     521            $rules .= "    RewriteRule .* - [E=PC_UA:-mobile]" . PHP_EOL; 
     522            $rules .= "    RewriteCond %{HTTP_USER_AGENT} ^(" . $mobile_prefixes . ") [NC]" . PHP_EOL; 
     523            $rules .= "    RewriteRule .* - [E=PC_UA:-mobile]" . PHP_EOL; 
     524            $env_powered_cache_ua = '%{ENV:PC_UA}'; 
     525        } 
     526 
     527        if ( true === powered_cache_get_option( 'ssl_cache' ) ) { 
     528            $rules .= "    RewriteCond %{HTTPS} =on" . PHP_EOL; 
     529            $rules .= "    RewriteRule .* - [E=PC_SSL:-https]" . PHP_EOL; 
     530            $rules .= "    RewriteCond %{SERVER_PORT} =443" . PHP_EOL; 
     531            $rules .= "    RewriteRule .* - [E=PC_SSL:-https]" . PHP_EOL; 
     532            $env_powered_cache_ssl = '%{ENV:PC_SSL}'; 
     533        } 
     534 
     535        if ( true === powered_cache_get_option( 'gzip_compression' ) ) { 
     536            $rules .= "    RewriteCond %{HTTP:Accept-Encoding} gzip" . PHP_EOL; 
     537            $rules .= "    RewriteRule .* - [E=PC_ENC:_gzip]" . PHP_EOL; 
     538            $env_powered_cache_enc = '%{ENV:PC_ENC}'; 
     539        } 
     540 
     541        $rules .= "    RewriteCond %{REQUEST_METHOD} !=POST" . PHP_EOL; 
     542        $rules .= '    RewriteCond %{QUERY_STRING} =""' . PHP_EOL; 
     543 
     544        if ( substr( get_option( 'permalink_structure' ), - 1 ) == '/' ) { 
     545            $rules .= '    RewriteCond %{REQUEST_URI} \/$' . PHP_EOL; 
     546        } 
     547 
     548        // Get root base 
     549        $site_root = parse_url( site_url() ); 
     550        $site_root = isset( $site_root['path'] ) ? trailingslashit( $site_root['path'] ) : ''; 
     551 
     552 
     553        // reject user agent 
     554        if ( false !== powered_cache_get_option( 'rejected_user_agents' ) ) { 
     555            $rejected_user_agents = preg_split( '#(\r\n|\n|\r)#', powered_cache_get_option( 'rejected_user_agents' ) ); 
     556            if ( ! empty( $rejected_user_agents ) ) { 
     557                $rules .= '    RewriteCond %{HTTP_USER_AGENT} !^(' . implode( '|', $rejected_user_agents ) . ').* [NC]' . PHP_EOL; 
     558            } 
     559        } 
     560 
     561 
     562        // ignore cookies 
     563        if ( false !== powered_cache_get_option( 'rejected_uri' ) ) { 
     564            $cookies = preg_split( '#(\n|\r)#', powered_cache_get_option( 'rejected_uri' ) ); 
     565        } 
     566        $wp_cookies = array( 'wordpressuser_', 'wordpresspass_', 'wordpress_sec_', 'wordpress_logged_in_' ); 
     567        if ( ! empty( $cookies ) ) { 
     568            $wp_cookies = array_merge( $cookies, $wp_cookies ); 
     569        } 
     570        $rules .= '    RewriteCond %{HTTP:Cookie} !(' . implode( '|', $wp_cookies ) . ') [NC]' . PHP_EOL; 
     571 
     572        // dont cache fbexternal 
     573        $rules .= '    RewriteCond %{HTTP_USER_AGENT} !^(facebookexternalhit).* [NC]' . PHP_EOL; 
     574 
     575 
     576        $cache_location = powered_cache_get_cache_dir(); 
     577        $cache_location = untrailingslashit( $cache_location ) . '/powered-cache/'; 
     578        if ( strpos( ABSPATH, $cache_location ) === false ) { 
     579            // clean doc root 
     580            $cache_path = str_replace( $_SERVER['DOCUMENT_ROOT'], '', $cache_location ); 
     581        } else { 
     582            $cache_path = $site_root . str_replace( ABSPATH, '', $cache_location ); 
     583        } 
     584 
     585 
     586        if ( apply_filters( 'powered_cache_maybe_1and1_hosting', ( 0 === strpos( $_SERVER['DOCUMENT_ROOT'], '/kunden/homepage/' ) ) ) ) { 
     587            $rules .= '    RewriteCond "' . str_replace( '/kunden/homepage/', '/', $cache_location ) . '%{HTTP_HOST}' . '%{REQUEST_URI}/index' . $env_powered_cache_ssl . $env_powered_cache_ua . '.html' . $env_powered_cache_enc . '" -f' . PHP_EOL; 
     588        } else { 
     589            $rules .= '    RewriteCond "%{DOCUMENT_ROOT}/' . ltrim( $cache_path, '/' ) . '%{HTTP_HOST}' . '%{REQUEST_URI}/index' . $env_powered_cache_ssl . $env_powered_cache_ua . '.html' . $env_powered_cache_enc . '" -f' . PHP_EOL; 
     590        } 
     591        $rules .= '    RewriteRule .* "' . $cache_path . '%{HTTP_HOST}' . '%{REQUEST_URI}/index' . $env_powered_cache_ssl . $env_powered_cache_ua . '.html' . $env_powered_cache_enc . '" [L]' . PHP_EOL; 
     592        $rules .= '</IfModule>' . PHP_EOL; 
     593        $rules .= '# END POWERED CACHE' . PHP_EOL; 
     594 
     595        return $rules; 
     596    } 
     597 
     598 
     599    /** 
     600     * Prepares nginx configuration 
     601     * 
     602     * @since 1.1 
     603     * @return string $contents nginx rules 
     604     */ 
     605    public function nginx_rules() { 
     606        $contents = ''; 
     607        $contents .= '##### POWERED CACHE CONF #####' . PHP_EOL; 
     608        $contents .= 'set $cache_uri $request_uri;' . PHP_EOL; 
     609        $contents .= 'set $pc_ssl "";' . PHP_EOL; 
     610        $contents .= 'set $pc_enc "";' . PHP_EOL; 
     611        $contents .= 'set $pc_ua "";' . PHP_EOL . PHP_EOL; 
     612 
     613        // post 
     614        $contents .= '# POST requests and urls with a query string should always go to PHP' . PHP_EOL; 
     615        $contents .= 'if ($request_method = POST) {' . PHP_EOL; 
     616        $contents .= '  set $cache_uri \'null cache\';' . PHP_EOL; 
     617        $contents .= '}' . PHP_EOL . PHP_EOL; 
     618 
     619        // query string 
     620        $contents .= 'if ($query_string != "") {' . PHP_EOL; 
     621        $contents .= '  set $cache_uri \'null cache\';' . PHP_EOL; 
     622        $contents .= '}' . PHP_EOL . PHP_EOL; 
     623 
     624        // https 
     625        $contents .= '# HTTPS' . PHP_EOL; 
     626        $contents .= 'if ($https = "on") {' . PHP_EOL; 
     627        $contents .= '  set $pc_ssl "-https";' . PHP_EOL; 
     628        $contents .= '}' . PHP_EOL . PHP_EOL; 
     629 
     630        $contents .= '# Don\'t cache uris containing the following segments' . PHP_EOL; 
     631        $contents .= 'if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {' . PHP_EOL; 
     632        $contents .= '  set $cache_uri \'null cache\';' . PHP_EOL; 
     633        $contents .= '}' . PHP_EOL . PHP_EOL; 
     634 
     635        $contents .= '# Don\'t use the cache for logged in users or recent commenters' . PHP_EOL; 
     636        $contents .= 'if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in|powered_cache_commented_posts") {' . PHP_EOL; 
     637        $contents .= '  set $cache_uri \'null cache\';' . PHP_EOL; 
     638        $contents .= '}' . PHP_EOL . PHP_EOL; 
     639 
     640        $contents .= 'if ($http_x_wap_profile) {' . PHP_EOL; 
     641        $contents .= '  set $pc_ua \'-mobile\';' . PHP_EOL; 
     642        $contents .= '}' . PHP_EOL . PHP_EOL; 
     643 
     644        if ( true === powered_cache_get_option( 'cache_mobile' ) && true === powered_cache_get_option( 'cache_mobile_separate_file' ) ) { 
     645            $mobile_browsers = addcslashes( implode( '|', preg_split( '/[\s*,\s*]*,+[\s*,\s*]*/', powered_cache_mobile_browsers() ) ), ' ' ); 
     646            $mobile_prefixes = addcslashes( implode( '|', preg_split( '/[\s*,\s*]*,+[\s*,\s*]*/', powered_cache_mobile_prefixes() ) ), ' ' ); 
     647 
     648            $contents .= 'if ($http_user_agent ~* (' . $mobile_browsers . '))' . PHP_EOL; 
     649            $contents .= '  set $pc_ua \'-mobile\';' . PHP_EOL; 
     650            $contents .= '}' . PHP_EOL . PHP_EOL; 
     651 
     652            $contents .= 'if ($http_user_agent ~* (' . $mobile_prefixes . '))' . PHP_EOL; 
     653            $contents .= '  set $pc_ua \'-mobile\';' . PHP_EOL; 
     654            $contents .= '}' . PHP_EOL . PHP_EOL; 
     655        } 
     656 
     657        $contents .= 'location = /favicon.ico { log_not_found off; access_log off; }' . PHP_EOL; 
     658        $contents .= 'location = /robots.txt  { log_not_found off; access_log off; }' . PHP_EOL . PHP_EOL; 
     659 
     660        $contents .= 'location ~* .(jpg|jpeg|png|gif|ico|css|js|woff|svg)$ {' . PHP_EOL; 
     661        $contents .= '  expires 1M;' . PHP_EOL; 
     662        $contents .= '}' . PHP_EOL . PHP_EOL; 
     663 
     664        $cache_suffix = 'html'; 
     665        if ( true === powered_cache_get_option( 'gzip_compression' ) ) { 
     666            $cache_suffix .= '_gzip'; 
     667        } 
     668 
     669 
     670        $contents .= 'location / {' . PHP_EOL; 
     671        $contents .= '  add_header X-Powered-Cache nginx;' . PHP_EOL; 
     672        $contents .= '  try_files /wp-content/cache/powered-cache/$http_host/$cache_uri/index${pc_ssl}${pc_ua}.' . $cache_suffix . ' $uri $uri/ /index.php?$args;' . PHP_EOL; 
     673        $contents .= '}' . PHP_EOL . PHP_EOL; 
     674 
     675 
     676        return $contents; 
     677    } 
     678 
     679 
     680    /** 
     681     * Downloads configuration files 
     682     * 
     683     * @since 1.1 
     684     * 
     685     * @param string $server type supports apache and nginx 
     686     */ 
     687    public function download_rewrite_rules( $server ) { 
     688 
     689        $rules    = ''; 
     690        $filename = 'conf'; 
     691 
     692        if ( 'apache' === $server ) { 
     693            $rules    = $this->htaccess_rules(); 
     694            $filename = '.htaccess_powered_cache'; 
     695        } 
     696 
     697        if ( 'nginx' === $server ) { 
     698            $rules    = $this->nginx_rules(); 
     699            $filename = 'poweredcache.conf'; 
     700        } 
     701 
     702        nocache_headers(); 
     703        @header( 'Content-Type: text/plain' ); 
     704        @header( 'Content-Disposition: attachment; filename="' . $filename . '"' ); 
     705        @header( 'Content-Transfer-Encoding: binary' ); 
     706        @header( 'Content-Length: ' . strlen( $rules ) ); 
     707        @header( 'Connection: close' ); 
     708        echo $rules; 
     709        exit; 
    572710    } 
    573711 
  • powered-cache/trunk/includes/class-powered-cache-cron.php

    r1633170 r1664974  
    9292        } 
    9393 
    94         powered_cache_flush(); 
     94        $lifespan = powered_cache_get_option( 'cache_timeout' ) * 60; 
     95 
     96        $expired_files = powered_cache_get_exprired_files( powered_cache_site_cache_dir(), $lifespan ); 
     97 
     98        foreach ( $expired_files as $file_path ) { 
     99            @unlink( $file_path ); 
     100        } 
     101 
     102        do_action( 'powered_cache_expired_files_deleted' ); 
    95103    } 
    96104 
  • powered-cache/trunk/includes/class-powered-cache-extensions.php

    r1633170 r1664974  
    3535     */ 
    3636    public function get_extentions() { 
    37         global $wp_filesystem; 
     37        global $powered_cache_fs; 
    3838 
    3939        $extentions = array( 
     
    6464        foreach ( $extentions as $id => $extention ) { 
    6565 
    66             if ( $wp_filesystem->exists( $extention ) ) { 
     66            if ( $powered_cache_fs->exists( $extention ) ) { 
    6767 
    6868                $header_data = get_file_data( $extention, $default_headers ); 
    69                 if ( ! empty( $header_data['ExtensionImage'] ) && $wp_filesystem->exists( plugin_dir_path( $extention ) . $header_data['ExtensionImage'] ) ) { 
     69                if ( ! empty( $header_data['ExtensionImage'] ) && $powered_cache_fs->exists( plugin_dir_path( $extention ) . $header_data['ExtensionImage'] ) ) { 
    7070                    $header_data['ExtensionImage'] = plugin_dir_url( $extention ) . $header_data['ExtensionImage']; 
    7171                } 
     
    8787     */ 
    8888    public function load_extentions() { 
    89         global $wp_filesystem; 
     89        global $powered_cache_fs; 
    9090 
    9191        do_action( 'powered_cache_before_extension_load' ); 
     
    9797 
    9898            foreach ( $activated_extensions as $extension ) { 
    99                 if ( isset( $extensions[ $extension ] ) && $wp_filesystem->exists( $extensions[ $extension ]['path'] ) ) { 
     99                if ( isset( $extensions[ $extension ] ) && $powered_cache_fs->exists( $extensions[ $extension ]['path'] ) ) { 
    100100                    include_once $extensions[ $extension ]['path']; 
    101101 
  • powered-cache/trunk/includes/class-powered-cache-object-cache.php

    r1633170 r1664974  
    4545     */ 
    4646    public function admin_bar_menu( $wp_admin_bar ) { 
     47 
     48        if ( is_multisite() && ! current_user_can( 'manage_network' ) ) { 
     49            return; 
     50        } 
     51 
    4752        $wp_admin_bar->add_menu( array( 
    4853            'id'     => 'object-cache-purge', 
     
    6469        } 
    6570 
     71        if ( is_multisite() && ! current_user_can( 'manage_network' ) ) { 
     72            Powered_Cache_Admin_Helper::set_flash_message( __( "You don't have permission to perform this action!", 'powered-cache' ) ,'error' ); 
     73            wp_safe_redirect( wp_get_referer() ); 
     74            die(); 
     75        } 
     76 
    6677        if ( function_exists( 'wp_cache_flush' ) ) { 
    6778            wp_cache_flush(); 
  • powered-cache/trunk/includes/dropins/page-cache.php

    r1643215 r1664974  
    3232} 
    3333 
     34if ( ! $GLOBALS['powered_cache_options']['enable_page_caching'] ) { 
     35    return; 
     36} 
    3437 
    3538// Don't cache page with these user agents 
     
    267270    if ( @file_exists( $path ) && @is_readable( $path ) ) { 
    268271 
    269         header( 'X-Powered-Cache: true' ); 
     272        header( 'X-Powered-Cache: php' ); 
    270273 
    271274        if ( function_exists( 'gzencode' ) && $GLOBALS['powered_cache_options']['gzip_compression'] ) { 
  • powered-cache/trunk/includes/functions.php

    r1638204 r1664974  
    8686 
    8787    if ( isset( $changed_settings['enable_page_caching'] ) ) { 
    88         powered_cache_clean_page_cache_dir(); 
     88        powered_cache_clean_site_cache_dir(); 
    8989    } 
    9090 
     
    202202 
    203203/** 
    204  * get page cache dir 
     204 * Page cache base directory. 
     205 * 
     206 * @since 1.0 
     207 * @since 1.1 $url parameter removed @see `powered_cache_get_url_dir` 
     208 * @return string 
     209 */ 
     210function powered_cache_get_page_cache_dir() { 
     211    $path = powered_cache_get_cache_dir() . 'powered-cache/'; 
     212 
     213    return apply_filters( 'powered_cache_get_page_cache_dir', $path ); 
     214} 
     215 
     216 
     217/** 
     218 * get cache location of given url 
    205219 * 
    206220 * @param string $url 
    207  * @since 1.0 
    208  * 
    209  * @return string 
    210  */ 
    211 function powered_cache_get_page_cache_dir( $url = false ) { 
    212     if ( $url ) { 
    213         $url_info = parse_url( $url ); 
    214         $sub_dir  = $url_info['host'] . $url_info['path']; 
    215  
    216         return powered_cache_get_cache_dir() . 'powered-cache/' . ltrim( $sub_dir, '/' ); 
    217     } 
    218  
    219     return powered_cache_get_cache_dir() . 'powered-cache/'; 
    220 } 
     221 * 
     222 * @since 1.1 
     223 * @return mixed|void 
     224 */ 
     225function powered_cache_get_url_dir( $url ) { 
     226    $url_info = parse_url( $url ); 
     227    $sub_dir  = $url_info['host'] . $url_info['path']; 
     228    $path     = powered_cache_get_cache_dir() . 'powered-cache/' . ltrim( $sub_dir, '/' ); 
     229 
     230    return apply_filters( 'powered_cache_get_url_dir', $path ); 
     231} 
     232 
     233/** 
     234 * get base caching directory of site 
     235 * 
     236 * @since 1.1 
     237 * @return mixed|void 
     238 */ 
     239function powered_cache_site_cache_dir() { 
     240    $base_dir = powered_cache_get_page_cache_dir(); 
     241 
     242    // compatible with multisite 
     243    $site_url = get_site_url(); 
     244 
     245    $site_path = parse_url( $site_url, PHP_URL_HOST ); 
     246 
     247    $site_cache_dir = $base_dir . $site_path; 
     248 
     249    return apply_filters( 'powered_cache_site_cache_dir', $site_cache_dir ); 
     250} 
     251 
    221252 
    222253/** 
     
    230261function powered_cache_delete_page_cache( $url ) { 
    231262 
    232     $dir = trailingslashit( powered_cache_get_page_cache_dir( $url ) ); 
     263    $dir = trailingslashit( powered_cache_get_url_dir( trim( $url ) ) ); 
    233264 
    234265    if ( is_dir( $dir ) ) { 
     
    337368 */ 
    338369function powered_cache_clean_page_cache_dir() { 
    339     global $wp_filesystem; 
    340  
    341     return $wp_filesystem->rmdir( untrailingslashit( powered_cache_get_cache_dir() ) . '/powered-cache', true ); 
    342 } 
    343  
     370    global $powered_cache_fs; 
     371 
     372    return $powered_cache_fs->rmdir( untrailingslashit( powered_cache_get_cache_dir() ) . '/powered-cache', true ); 
     373} 
     374 
     375/** 
     376 * Clean cache base for the current site 
     377 * 
     378 * @since 1.1 
     379 * @return mixed 
     380 */ 
     381function powered_cache_clean_site_cache_dir() { 
     382    global $powered_cache_fs; 
     383 
     384    return $powered_cache_fs->rmdir( powered_cache_site_cache_dir(), true ); 
     385} 
    344386 
    345387 
     
    348390 * 
    349391 * @since 1.0 
     392 * @since 1.1 powered_cache_post_related_urls filter added 
     393 * 
    350394 * @param $post_id 
    351395 * 
     
    417461    } 
    418462 
     463    $related_urls = apply_filters( 'powered_cache_post_related_urls', $related_urls ); 
     464 
    419465    return $related_urls; 
    420466} 
     
    471517} 
    472518 
     519 
     520/** 
     521 * Get list of expired files for given directory 
     522 * 
     523 * @param string $path 
     524 * @param int $lifespan lifespan in seconds 
     525 * 
     526 * @since 1.1 
     527 * @return array expired file list 
     528 */ 
     529function powered_cache_get_exprired_files( $path, $lifespan = 0 ) { 
     530 
     531    $current_time = time(); 
     532 
     533    $expired_files = array(); 
     534    $files         = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $path ) ); 
     535 
     536    foreach ( $files as $file ) { 
     537 
     538        if ( $file->isDir() ) { 
     539            continue; 
     540        } 
     541 
     542 
     543        $path = $file->getPathname(); 
     544 
     545        if ( @filemtime( $path ) + $lifespan <= $current_time ) { 
     546            $expired_files[] = $path; 
     547        } 
     548 
     549    } 
     550 
     551    return $expired_files; 
     552} 
    473553 
    474554/** 
  • powered-cache/trunk/languages/powered-cache-tr_TR.po

    r1638204 r1664974  
    33"Project-Id-Version: Powered Cache 1.0\n" 
    44"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/powered-cache\n" 
    5 "POT-Creation-Date: 2017-04-15 13:25:24+00:00\n" 
    6 "PO-Revision-Date: 2017-04-15 16:28+0300\n" 
     5"POT-Creation-Date: 2017-05-24 20:22:26+00:00\n" 
     6"PO-Revision-Date: 2017-05-24 23:22+0300\n" 
    77"Last-Translator: Mustafa Uysal <EMAIL@ADDRESS>\n" 
    88"Language-Team: TR LANGUAGE <LL@li.org>\n" 
     
    1717"X-Poedit-SearchPath-0: ..\n" 
    1818 
    19 #: extensions/cloudflare/cloudflare.php:57 
     19#: extensions/cloudflare/cloudflare.php:59 
    2020msgid "Cloudflare extension for Powered Cache" 
    2121msgstr "Powered Cache için Cloudflare eklentisi." 
     
    3939#: extensions/cloudflare/inc/class-powered-cache-cloudflare-admin.php:134 
    4040#: extensions/cloudflare/inc/settings.php:41 
    41 #: includes/admin/class-powered-cache-admin-helper.php:171 
    42 #: includes/admin/settings/misc.php:32 
     41#: includes/admin/class-powered-cache-admin-helper.php:164 
     42#: includes/admin/settings/misc.php:35 
    4343msgid "Clear Cache" 
    4444msgstr "Önbelleği Temizle" 
     
    7777 
    7878#: extensions/lazy-load/inc/settings.php:21 
    79 #: includes/admin/class-powered-cache-admin-helper.php:245 
     79#: includes/admin/class-powered-cache-admin-helper.php:238 
    8080msgid "Images" 
    8181msgstr "Resimler" 
     
    168168"gerekmektedir." 
    169169 
    170 #. Plugin Name of the plugin/theme 
     170#: extensions/preload/inc/class-powered-cache-preload-admin.php:89 
     171#: includes/admin/class-powered-cache-admin.php:117 
     172#: includes/admin/class-powered-cache-admin.php:134 
     173#: includes/admin/notices.php:61 includes/admin/notices.php:63 
     174#: includes/admin/notices.php:116 includes/admin/settings.php:27 
     175#: premium/extensions/minifier/inc/class-powered-cache-minifier-helper.php:665 
     176#: premium/extensions/remote-cron/inc/class-powered-cache-remote-cron-admin.php:48 
    171177msgid "Powered Cache" 
    172178msgstr "Powered Cache" 
     
    255261 
    256262#: extensions/preload/inc/settings.php:30 
    257 #: includes/admin/settings/basic-options.php:88 
    258263msgid "minutes" 
    259264msgstr "dakika" 
     
    283288msgstr "Powered Cache için Varnish eklentisi." 
    284289 
    285 #: includes/admin/class-powered-cache-admin-actions.php:74 
     290#: includes/admin/class-powered-cache-admin-actions.php:99 
    286291msgid "Extension activated" 
    287292msgstr "Eklenti aktifleştirildi" 
    288293 
    289 #: includes/admin/class-powered-cache-admin-actions.php:79 
     294#: includes/admin/class-powered-cache-admin-actions.php:104 
    290295msgid "Extension deactivated" 
    291296msgstr "Eklenti pasifleştirildi" 
    292297 
    293 #: includes/admin/class-powered-cache-admin-actions.php:119 
     298#: includes/admin/class-powered-cache-admin-actions.php:144 
    294299#: includes/admin/class-powered-cache-extension-admin-base.php:117 
    295300msgid "Options updated" 
    296301msgstr "Ayarlar güncellendi" 
    297302 
    298 #: includes/admin/class-powered-cache-admin-actions.php:126 
     303#: includes/admin/class-powered-cache-admin-actions.php:151 
    299304msgid "" 
    300305"Something went wrong, we could not save settings to file. Please make sure " 
     
    304309"dosyasının yazılabilir olduğundan emin olunuz." 
    305310 
    306 #: includes/admin/class-powered-cache-admin-actions.php:141 
    307 msgid "Cache flushed successfully" 
    308 msgstr "Önbellek başarılı bir şekilde temizlendi" 
    309  
    310 #: includes/admin/class-powered-cache-admin-actions.php:160 
     311#: includes/admin/class-powered-cache-admin-actions.php:171 
    311312msgid "All settings cleaned!" 
    312313msgstr "Tüm ayarlar temizlendi!" 
     
    342343msgstr "Destek" 
    343344 
    344 #: includes/admin/class-powered-cache-admin-helper.php:56 
     345#: includes/admin/class-powered-cache-admin-helper.php:61 
    345346msgid "Dismiss this notice" 
    346347msgstr "Bu bildirimi yoksay" 
     
    358359msgstr "Şimdi Yükselt" 
    359360 
    360 #: includes/admin/class-powered-cache-admin-helper.php:192 
     361#: includes/admin/class-powered-cache-admin-helper.php:185 
    361362msgid "Download Settings" 
    362363msgstr "Ayarları İndir" 
    363364 
    364 #: includes/admin/class-powered-cache-admin-helper.php:214 
     365#: includes/admin/class-powered-cache-admin-helper.php:207 
    365366msgid "Reset Settings" 
    366367msgstr "Ayarları Sıfırla" 
    367368 
    368 #: includes/admin/class-powered-cache-admin-helper.php:231 
     369#: includes/admin/class-powered-cache-admin-helper.php:224 
    369370msgid "Cheatin, uh?" 
    370371msgstr "Hile mi yapıyorsunuz?" 
    371372 
    372 #: includes/admin/class-powered-cache-admin-helper.php:244 
     373#: includes/admin/class-powered-cache-admin-helper.php:237 
    373374msgid "All files" 
    374375msgstr "Tüm dosyalar" 
    375376 
    376 #: includes/admin/class-powered-cache-admin-helper.php:246 
     377#: includes/admin/class-powered-cache-admin-helper.php:239 
    377378msgid "JavaScript" 
    378379msgstr "JavaScript" 
    379380 
    380 #: includes/admin/class-powered-cache-admin-helper.php:247 
     381#: includes/admin/class-powered-cache-admin-helper.php:240 
    381382msgid "CSS" 
    382383msgstr "CSS" 
    383384 
    384 #: includes/admin/class-powered-cache-admin.php:119 
    385 #: includes/admin/class-powered-cache-admin.php:125 
     385#: includes/admin/class-powered-cache-admin.php:117 
     386#: includes/admin/class-powered-cache-admin.php:123 
    386387msgid "Powered Cache Settings" 
    387388msgstr "Powered Cache Ayarları" 
    388389 
    389 #: includes/admin/class-powered-cache-admin.php:125 
     390#: includes/admin/class-powered-cache-admin.php:123 
    390391#: includes/admin/extension-settings.php:10 
    391392msgid "Settings" 
    392393msgstr "Ayarlar" 
    393394 
    394 #: includes/admin/class-powered-cache-admin.php:151 
     395#: includes/admin/class-powered-cache-admin.php:149 
    395396msgid "<a href=\"%s\">Settings</a>" 
    396397msgstr "<a href=\"%s\">Ayarlar</a>" 
    397398 
    398 #: includes/admin/class-powered-cache-admin.php:153 
     399#: includes/admin/class-powered-cache-admin.php:151 
    399400msgid "<a href=\"%s\" style=\"color: red;\">Get Premium</a>" 
    400401msgstr "<a href=\"%s\" style=\"color: red;\">Premium Ol</a>" 
     
    455456 
    456457#: includes/admin/settings/advanced-options.php:24 
     458msgid "Remove query string" 
     459msgstr "Query string kaldır" 
     460 
     461#: includes/admin/settings/advanced-options.php:27 
     462msgid "Remove query strings from CSS & JS resources" 
     463msgstr "CSS & JS adreslerinden sorgu parametrelerini kaldır" 
     464 
     465#: includes/admin/settings/advanced-options.php:33 
    457466msgid "Rejected user agents" 
    458467msgstr "Reddedilen kullanıcı aracıları" 
    459468 
    460 #: includes/admin/settings/advanced-options.php:27 
     469#: includes/admin/settings/advanced-options.php:36 
    461470msgid "Never send cache pages for these user agents." 
    462471msgstr "Ön belleğe alınmayacak kullanıcı aracıları (user-agent)" 
    463472 
    464 #: includes/admin/settings/advanced-options.php:32 
     473#: includes/admin/settings/advanced-options.php:41 
    465474msgid "Rejected cookies" 
    466475msgstr "Reddedilen çerezler" 
    467476 
    468 #: includes/admin/settings/advanced-options.php:35 
     477#: includes/admin/settings/advanced-options.php:44 
    469478msgid "Never cache pages that use the specified cookies." 
    470479msgstr "" 
     
    472481"gösterilmeyecektir." 
    473482 
    474 #: includes/admin/settings/advanced-options.php:40 
     483#: includes/admin/settings/advanced-options.php:49 
    475484msgid "Never cache the following pages" 
    476485msgstr "Hiç ön belleğe alınmayacak sayfalar" 
    477486 
    478 #: includes/admin/settings/advanced-options.php:43 
     487#: includes/admin/settings/advanced-options.php:52 
    479488msgid "Ignore the specified pages / directories. Supports regex." 
    480489msgstr "Belirtilen sayfaları / dizinleri yok sayar. Regex destekler." 
    481490 
    482 #: includes/admin/settings/advanced-options.php:48 
     491#: includes/admin/settings/advanced-options.php:57 
    483492msgid "Accepted query strings" 
    484493msgstr "Kabul edilen query strings" 
    485494 
    486 #: includes/admin/settings/advanced-options.php:51 
     495#: includes/admin/settings/advanced-options.php:60 
    487496msgid "Enter GET parameters line by line." 
    488497msgstr "Kabul edilen GET parametrelerini satır satır giriniz." 
     498 
     499#: includes/admin/settings/advanced-options.php:65 
     500msgid "Purge Additional Pages" 
     501msgstr "Temizlenecek Harici Sayfalar" 
     502 
     503#: includes/admin/settings/advanced-options.php:68 
     504msgid "Enter pages line by line." 
     505msgstr "Sayfaları satır satır girin." 
    489506 
    490507#: includes/admin/settings/basic-options.php:24 
     
    497514"Sayfa önbelleğini etkinleştirmeniz sitenizin cevap süresini azaltacaktır." 
    498515 
    499 #: includes/admin/settings/basic-options.php:34 
     516#: includes/admin/settings/basic-options.php:37 
    500517msgid "Object Caching" 
    501518msgstr "Obje Önbelleği" 
    502519 
    503 #: includes/admin/settings/basic-options.php:37 
     520#: includes/admin/settings/basic-options.php:40 
    504521#: premium/includes/class-powered-cache-license-page.php:127 
    505522msgid "Off" 
    506523msgstr "Kapalı" 
    507524 
    508 #: includes/admin/settings/basic-options.php:44 
     525#: includes/admin/settings/basic-options.php:47 
    509526msgid "Speed up dynamic pageviews" 
    510527msgstr "Dinamik sayfa gösterimlerini hızlandırır" 
    511528 
    512 #: includes/admin/settings/basic-options.php:50 
     529#: includes/admin/settings/basic-options.php:54 
    513530msgid "Mobile Cache" 
    514531msgstr "Mobil Önbellek" 
    515532 
    516 #: includes/admin/settings/basic-options.php:52 
     533#: includes/admin/settings/basic-options.php:56 
    517534msgid "Enable caching for mobile devices." 
    518535msgstr "Mobil cihazlar için önbelleği etkinleştir" 
    519536 
    520 #: includes/admin/settings/basic-options.php:55 
     537#: includes/admin/settings/basic-options.php:59 
    521538msgid "Use separate cache file for mobile." 
    522539msgstr "Mobil önbelleği ayrı dosyalarda tut." 
    523540 
    524 #: includes/admin/settings/basic-options.php:63 
     541#: includes/admin/settings/basic-options.php:67 
    525542msgid "Logged in user cache" 
    526543msgstr "Giriş yapmış kullanıcı önbelleği" 
    527544 
    528 #: includes/admin/settings/basic-options.php:65 
     545#: includes/admin/settings/basic-options.php:69 
    529546msgid "Show cached page for logged in users" 
    530547msgstr "Giriş yapmış kullanıcıya önbelleğe alınmış sayfayı göster" 
    531548 
    532 #: includes/admin/settings/basic-options.php:71 
     549#: includes/admin/settings/basic-options.php:75 
    533550msgid "SSL Cache" 
    534551msgstr "SSL Önbelleği" 
    535552 
    536 #: includes/admin/settings/basic-options.php:73 
     553#: includes/admin/settings/basic-options.php:77 
    537554msgid "Enable caching for SSL" 
    538555msgstr "SSL için önbelleklemeyi aç" 
    539556 
    540 #: includes/admin/settings/basic-options.php:79 
     557#: includes/admin/settings/basic-options.php:83 
    541558msgid "Gzip" 
    542559msgstr "Gzip" 
    543560 
    544 #: includes/admin/settings/basic-options.php:81 
     561#: includes/admin/settings/basic-options.php:85 
    545562msgid "Enable gzip compression" 
    546563msgstr "Gzip sıkıştırmasını etkinleştir" 
    547564 
    548 #: includes/admin/settings/basic-options.php:86 
     565#: includes/admin/settings/basic-options.php:90 
    549566msgid "Cache Timeout" 
    550567msgstr "Önbellek Süresi" 
     568 
     569#: includes/admin/settings/basic-options.php:99 
     570msgid "Minute" 
     571msgstr "Dakika" 
     572 
     573#: includes/admin/settings/basic-options.php:100 
     574msgid "Hour" 
     575msgstr "Saat" 
     576 
     577#: includes/admin/settings/basic-options.php:101 
     578msgid "Day" 
     579msgstr "Gün" 
    551580 
    552581#: includes/admin/settings/cdn.php:27 
     
    601630msgstr "Önbellek durum mesajını footer'da göster" 
    602631 
    603 #: includes/admin/settings/misc.php:36 
     632#: includes/admin/settings/misc.php:39 
    604633msgid "Clear all cache, including object cache" 
    605634msgstr "Tüm önbelleği temizle, obje önbelleği dahil" 
    606635 
    607 #: includes/admin/settings/misc.php:41 
     636#: includes/admin/settings/misc.php:45 
     637msgid "Download Configuration" 
     638msgstr "Ayarları İndir" 
     639 
     640#: includes/admin/settings/misc.php:48 
     641msgid ".htaccess configuration" 
     642msgstr ".htaccess ayarları" 
     643 
     644#: includes/admin/settings/misc.php:51 
     645msgid "nginx configuration" 
     646msgstr "nginx ayarları" 
     647 
     648#: includes/admin/settings/misc.php:54 
     649msgid "Download configuration file for your server" 
     650msgstr "Sunucunuz için uygun ayar dosyasını indirin" 
     651 
     652#: includes/admin/settings/misc.php:58 
    608653msgid "Reset All Settings" 
    609654msgstr "Tüm Ayarları Sıfırla" 
    610655 
    611 #: includes/admin/settings/misc.php:48 
     656#: includes/admin/settings/misc.php:65 
    612657msgid "Export" 
    613658msgstr "Dışarı aktar" 
    614659 
    615 #: includes/admin/settings/misc.php:55 
     660#: includes/admin/settings/misc.php:72 
    616661msgid "Import" 
    617662msgstr "İçeri aktar" 
    618663 
    619 #: includes/admin/settings/misc.php:59 
     664#: includes/admin/settings/misc.php:76 
    620665msgid "Upload and import" 
    621666msgstr "Yükle ve içeri aktar" 
     
    786831msgstr "Lütfen <a href=\"%s\">destek politikamızı</a> okuyunuz" 
    787832 
    788 #: includes/class-powered-cache-advanced-cache.php:51 
     833#: includes/class-powered-cache-advanced-cache.php:52 
    789834msgid "Purge Page Cache" 
    790835msgstr "Sayfa Önbelleğini Temizle" 
    791836 
    792 #: includes/class-powered-cache-advanced-cache.php:68 
     837#: includes/class-powered-cache-advanced-cache.php:71 
    793838msgid "Page cache deleted successfully!" 
    794839msgstr "Sayfa önbelleği başarılı bir şekilde silindi!" 
     
    798843msgstr "Powered Cache Temizleme Aralığı" 
    799844 
    800 #: includes/class-powered-cache-object-cache.php:49 
     845#: includes/class-powered-cache-hooks.php:58 
     846msgid "Purge All Cache" 
     847msgstr "Tüm Önbelleği Temizle" 
     848 
     849#: includes/class-powered-cache-hooks.php:77 
     850#: includes/class-powered-cache-object-cache.php:72 
     851msgid "You don't have permission to perform this action!" 
     852msgstr "Bu işlemi gerçekleştirebilecek yetkiniz bulunmamaktadır!" 
     853 
     854#: includes/class-powered-cache-hooks.php:87 
     855msgid "Cache flushed successfully" 
     856msgstr "Önbellek başarılı bir şekilde temizlendi" 
     857 
     858#: includes/class-powered-cache-object-cache.php:54 
    801859msgid "Purge Object Cache" 
    802860msgstr "Obje Önbelleğini Temizle" 
    803861 
    804 #: includes/class-powered-cache-object-cache.php:70 
     862#: includes/class-powered-cache-object-cache.php:81 
    805863msgid "Object cache deleted successfully!" 
    806864msgstr "Obje önbelleği başarılı bir şekilde silindi!" 
     
    810868msgstr "Bu özellik yalnızca premium kullanıcılara özel" 
    811869 
    812 #: powered-cache.php:202 powered-cache.php:210 
     870#: powered-cache.php:206 powered-cache.php:214 
    813871msgid "Cheatin&#8217; huh?" 
    814872msgstr "Hile mi yapıyorsunuz?" 
    815873 
    816 #: powered-cache.php:271 
     874#: powered-cache.php:275 
    817875msgid "Your site does not support Powered Cache." 
    818876msgstr "Siteniz Powered Cache'i desteklemiyor." 
    819877 
    820 #: powered-cache.php:273 
     878#: powered-cache.php:277 
    821879msgid "" 
    822880"Your site is currently running WordPress version %1$s, while Powered Cache " 
     
    826884"daha üst bir sürüm kullanmalısınız." 
    827885 
    828 #: powered-cache.php:275 
     886#: powered-cache.php:279 
    829887msgid "Please update your WordPress or deactivate Powered Cache." 
    830888msgstr "" 
     
    931989msgstr "Minifier" 
    932990 
    933 #: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:63 
     991#: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:70 
    934992msgid "Blocking – (default)" 
    935993msgstr "Blocking – (varsayılan)" 
    936994 
    937 #: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:64 
     995#: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:71 
    938996msgid "Non-blocking using async" 
    939997msgstr "Non-blocking (async kullanarak)" 
    940998 
    941 #: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:65 
     999#: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:72 
    9421000msgid "Non-blocking using defer" 
    9431001msgstr "Non-blocking (defer kullanarak)" 
    9441002 
    945 #: premium/extensions/minifier/inc/class-powered-cache-minifier-helper.php:602 
     1003#: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:82 
     1004msgid "Purge Minifier Cache" 
     1005msgstr "Minify Önbelleğini Temizle" 
     1006 
     1007#: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:103 
     1008msgid "Minifier cache flushed successfully" 
     1009msgstr "Minifier önbelleğı başarılı bir şekilde temizlendi" 
     1010 
     1011#: premium/extensions/minifier/inc/class-powered-cache-minifier-helper.php:666 
    9461012msgid "Minifier could not create cache directory" 
    9471013msgstr "Minifier önbellek dizini oluşturamadı" 
    9481014 
    949 #: premium/extensions/minifier/inc/class-powered-cache-minifier-helper.php:604 
     1015#: premium/extensions/minifier/inc/class-powered-cache-minifier-helper.php:668 
    9501016msgid "" 
    9511017"Please make sure root caching directory writable by plugin. If you defined " 
     
    9911057msgstr "Hariç tutulacak CSS dosyaları" 
    9921058 
    993 #: premium/extensions/minifier/inc/settings.php:54 
     1059#: premium/extensions/minifier/inc/settings.php:53 
    9941060msgid "JS files to exclude" 
    9951061msgstr "Hariç tutulacak JS dosyaları" 
     
    11471213"veya  <code>%s</code> sabiti ile wp-config.php dosyasında tanımlayınız." 
    11481214 
     1215#. Plugin Name of the plugin/theme 
     1216msgid "Powered Cache Premium" 
     1217msgstr "Powered Cache Premium" 
     1218 
    11491219#. Plugin URI of the plugin/theme 
    11501220msgid "https://poweredcache.com" 
  • powered-cache/trunk/languages/powered-cache.pot

    r1638204 r1664974  
    33msgid "" 
    44msgstr "" 
    5 "Project-Id-Version: Powered Cache 1.0\n" 
     5"Project-Id-Version: Powered Cache Premium 1.1-beta\n" 
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/powered-cache\n" 
    7 "POT-Creation-Date: 2017-04-15 13:25:24+00:00\n" 
     7"POT-Creation-Date: 2017-05-24 20:22:26+00:00\n" 
    88"MIME-Version: 1.0\n" 
    99"Content-Type: text/plain; charset=utf-8\n" 
     
    2525"X-Textdomain-Support: yes\n" 
    2626 
    27 #: extensions/cloudflare/cloudflare.php:57 
     27#: extensions/cloudflare/cloudflare.php:59 
    2828msgid "Cloudflare extension for Powered Cache" 
    2929msgstr "" 
     
    4747#: extensions/cloudflare/inc/class-powered-cache-cloudflare-admin.php:134 
    4848#: extensions/cloudflare/inc/settings.php:41 
    49 #: includes/admin/class-powered-cache-admin-helper.php:171 
    50 #: includes/admin/settings/misc.php:32 
     49#: includes/admin/class-powered-cache-admin-helper.php:164 
     50#: includes/admin/settings/misc.php:35 
    5151msgid "Clear Cache" 
    5252msgstr "" 
     
    8585 
    8686#: extensions/lazy-load/inc/settings.php:21 
    87 #: includes/admin/class-powered-cache-admin-helper.php:245 
     87#: includes/admin/class-powered-cache-admin-helper.php:238 
    8888msgid "Images" 
    8989msgstr "" 
     
    173173msgstr "" 
    174174 
    175 #. Plugin Name of the plugin/theme 
     175#: extensions/preload/inc/class-powered-cache-preload-admin.php:89 
     176#: includes/admin/class-powered-cache-admin.php:117 
     177#: includes/admin/class-powered-cache-admin.php:134 
     178#: includes/admin/notices.php:61 includes/admin/notices.php:63 
     179#: includes/admin/notices.php:116 includes/admin/settings.php:27 
     180#: premium/extensions/minifier/inc/class-powered-cache-minifier-helper.php:665 
     181#: premium/extensions/remote-cron/inc/class-powered-cache-remote-cron-admin.php:48 
    176182msgid "Powered Cache" 
    177183msgstr "" 
     
    258264 
    259265#: extensions/preload/inc/settings.php:30 
    260 #: includes/admin/settings/basic-options.php:88 
    261266msgid "minutes" 
    262267msgstr "" 
     
    286291msgstr "" 
    287292 
    288 #: includes/admin/class-powered-cache-admin-actions.php:74 
     293#: includes/admin/class-powered-cache-admin-actions.php:99 
    289294msgid "Extension activated" 
    290295msgstr "" 
    291296 
    292 #: includes/admin/class-powered-cache-admin-actions.php:79 
     297#: includes/admin/class-powered-cache-admin-actions.php:104 
    293298msgid "Extension deactivated" 
    294299msgstr "" 
    295300 
    296 #: includes/admin/class-powered-cache-admin-actions.php:119 
     301#: includes/admin/class-powered-cache-admin-actions.php:144 
    297302#: includes/admin/class-powered-cache-extension-admin-base.php:117 
    298303msgid "Options updated" 
    299304msgstr "" 
    300305 
    301 #: includes/admin/class-powered-cache-admin-actions.php:126 
     306#: includes/admin/class-powered-cache-admin-actions.php:151 
    302307msgid "" 
    303308"Something went wrong, we could not save settings to file. Please make sure " 
     
    305310msgstr "" 
    306311 
    307 #: includes/admin/class-powered-cache-admin-actions.php:141 
    308 msgid "Cache flushed successfully" 
    309 msgstr "" 
    310  
    311 #: includes/admin/class-powered-cache-admin-actions.php:160 
     312#: includes/admin/class-powered-cache-admin-actions.php:171 
    312313msgid "All settings cleaned!" 
    313314msgstr "" 
     
    343344msgstr "" 
    344345 
    345 #: includes/admin/class-powered-cache-admin-helper.php:56 
     346#: includes/admin/class-powered-cache-admin-helper.php:61 
    346347msgid "Dismiss this notice" 
    347348msgstr "" 
     
    359360msgstr "" 
    360361 
    361 #: includes/admin/class-powered-cache-admin-helper.php:192 
     362#: includes/admin/class-powered-cache-admin-helper.php:185 
    362363msgid "Download Settings" 
    363364msgstr "" 
    364365 
    365 #: includes/admin/class-powered-cache-admin-helper.php:214 
     366#: includes/admin/class-powered-cache-admin-helper.php:207 
    366367msgid "Reset Settings" 
    367368msgstr "" 
    368369 
    369 #: includes/admin/class-powered-cache-admin-helper.php:231 
     370#: includes/admin/class-powered-cache-admin-helper.php:224 
    370371msgid "Cheatin, uh?" 
    371372msgstr "" 
    372373 
    373 #: includes/admin/class-powered-cache-admin-helper.php:244 
     374#: includes/admin/class-powered-cache-admin-helper.php:237 
    374375msgid "All files" 
    375376msgstr "" 
    376377 
    377 #: includes/admin/class-powered-cache-admin-helper.php:246 
     378#: includes/admin/class-powered-cache-admin-helper.php:239 
    378379msgid "JavaScript" 
    379380msgstr "" 
    380381 
    381 #: includes/admin/class-powered-cache-admin-helper.php:247 
     382#: includes/admin/class-powered-cache-admin-helper.php:240 
    382383msgid "CSS" 
    383384msgstr "" 
    384385 
    385 #: includes/admin/class-powered-cache-admin.php:119 
    386 #: includes/admin/class-powered-cache-admin.php:125 
     386#: includes/admin/class-powered-cache-admin.php:117 
     387#: includes/admin/class-powered-cache-admin.php:123 
    387388msgid "Powered Cache Settings" 
    388389msgstr "" 
    389390 
    390 #: includes/admin/class-powered-cache-admin.php:125 
     391#: includes/admin/class-powered-cache-admin.php:123 
    391392#: includes/admin/extension-settings.php:10 
    392393msgid "Settings" 
    393394msgstr "" 
    394395 
     396#: includes/admin/class-powered-cache-admin.php:149 
     397msgid "<a href=\"%s\">Settings</a>" 
     398msgstr "" 
     399 
    395400#: includes/admin/class-powered-cache-admin.php:151 
    396 msgid "<a href=\"%s\">Settings</a>" 
    397 msgstr "" 
    398  
    399 #: includes/admin/class-powered-cache-admin.php:153 
    400401msgid "<a href=\"%s\" style=\"color: red;\">Get Premium</a>" 
    401402msgstr "" 
     
    448449 
    449450#: includes/admin/settings/advanced-options.php:24 
     451msgid "Remove query string" 
     452msgstr "" 
     453 
     454#: includes/admin/settings/advanced-options.php:27 
     455msgid "Remove query strings from CSS & JS resources" 
     456msgstr "" 
     457 
     458#: includes/admin/settings/advanced-options.php:33 
    450459msgid "Rejected user agents" 
    451460msgstr "" 
    452461 
    453 #: includes/admin/settings/advanced-options.php:27 
     462#: includes/admin/settings/advanced-options.php:36 
    454463msgid "Never send cache pages for these user agents." 
    455464msgstr "" 
    456465 
    457 #: includes/admin/settings/advanced-options.php:32 
     466#: includes/admin/settings/advanced-options.php:41 
    458467msgid "Rejected cookies" 
    459468msgstr "" 
    460469 
    461 #: includes/admin/settings/advanced-options.php:35 
     470#: includes/admin/settings/advanced-options.php:44 
    462471msgid "Never cache pages that use the specified cookies." 
    463472msgstr "" 
    464473 
    465 #: includes/admin/settings/advanced-options.php:40 
     474#: includes/admin/settings/advanced-options.php:49 
    466475msgid "Never cache the following pages" 
    467476msgstr "" 
    468477 
    469 #: includes/admin/settings/advanced-options.php:43 
     478#: includes/admin/settings/advanced-options.php:52 
    470479msgid "Ignore the specified pages / directories. Supports regex." 
    471480msgstr "" 
    472481 
    473 #: includes/admin/settings/advanced-options.php:48 
     482#: includes/admin/settings/advanced-options.php:57 
    474483msgid "Accepted query strings" 
    475484msgstr "" 
    476485 
    477 #: includes/admin/settings/advanced-options.php:51 
     486#: includes/admin/settings/advanced-options.php:60 
    478487msgid "Enter GET parameters line by line." 
     488msgstr "" 
     489 
     490#: includes/admin/settings/advanced-options.php:65 
     491msgid "Purge Additional Pages" 
     492msgstr "" 
     493 
     494#: includes/admin/settings/advanced-options.php:68 
     495msgid "Enter pages line by line." 
    479496msgstr "" 
    480497 
     
    487504msgstr "" 
    488505 
    489 #: includes/admin/settings/basic-options.php:34 
     506#: includes/admin/settings/basic-options.php:37 
    490507msgid "Object Caching" 
    491508msgstr "" 
    492509 
    493 #: includes/admin/settings/basic-options.php:37 
     510#: includes/admin/settings/basic-options.php:40 
    494511#: premium/includes/class-powered-cache-license-page.php:127 
    495512msgid "Off" 
    496513msgstr "" 
    497514 
    498 #: includes/admin/settings/basic-options.php:44 
     515#: includes/admin/settings/basic-options.php:47 
    499516msgid "Speed up dynamic pageviews" 
    500517msgstr "" 
    501518 
    502 #: includes/admin/settings/basic-options.php:50 
     519#: includes/admin/settings/basic-options.php:54 
    503520msgid "Mobile Cache" 
    504521msgstr "" 
    505522 
    506 #: includes/admin/settings/basic-options.php:52 
     523#: includes/admin/settings/basic-options.php:56 
    507524msgid "Enable caching for mobile devices." 
    508525msgstr "" 
    509526 
    510 #: includes/admin/settings/basic-options.php:55 
     527#: includes/admin/settings/basic-options.php:59 
    511528msgid "Use separate cache file for mobile." 
    512529msgstr "" 
    513530 
    514 #: includes/admin/settings/basic-options.php:63 
     531#: includes/admin/settings/basic-options.php:67 
    515532msgid "Logged in user cache" 
    516533msgstr "" 
    517534 
    518 #: includes/admin/settings/basic-options.php:65 
     535#: includes/admin/settings/basic-options.php:69 
    519536msgid "Show cached page for logged in users" 
    520537msgstr "" 
    521538 
    522 #: includes/admin/settings/basic-options.php:71 
     539#: includes/admin/settings/basic-options.php:75 
    523540msgid "SSL Cache" 
    524541msgstr "" 
    525542 
    526 #: includes/admin/settings/basic-options.php:73 
     543#: includes/admin/settings/basic-options.php:77 
    527544msgid "Enable caching for SSL" 
    528545msgstr "" 
    529546 
    530 #: includes/admin/settings/basic-options.php:79 
     547#: includes/admin/settings/basic-options.php:83 
    531548msgid "Gzip" 
    532549msgstr "" 
    533550 
    534 #: includes/admin/settings/basic-options.php:81 
     551#: includes/admin/settings/basic-options.php:85 
    535552msgid "Enable gzip compression" 
    536553msgstr "" 
    537554 
    538 #: includes/admin/settings/basic-options.php:86 
     555#: includes/admin/settings/basic-options.php:90 
    539556msgid "Cache Timeout" 
     557msgstr "" 
     558 
     559#: includes/admin/settings/basic-options.php:99 
     560msgid "Minute" 
     561msgstr "" 
     562 
     563#: includes/admin/settings/basic-options.php:100 
     564msgid "Hour" 
     565msgstr "" 
     566 
     567#: includes/admin/settings/basic-options.php:101 
     568msgid "Day" 
    540569msgstr "" 
    541570 
     
    590619msgstr "" 
    591620 
    592 #: includes/admin/settings/misc.php:36 
     621#: includes/admin/settings/misc.php:39 
    593622msgid "Clear all cache, including object cache" 
    594623msgstr "" 
    595624 
    596 #: includes/admin/settings/misc.php:41 
     625#: includes/admin/settings/misc.php:45 
     626msgid "Download Configuration" 
     627msgstr "" 
     628 
     629#: includes/admin/settings/misc.php:48 
     630msgid ".htaccess configuration" 
     631msgstr "" 
     632 
     633#: includes/admin/settings/misc.php:51 
     634msgid "nginx configuration" 
     635msgstr "" 
     636 
     637#: includes/admin/settings/misc.php:54 
     638msgid "Download configuration file for your server" 
     639msgstr "" 
     640 
     641#: includes/admin/settings/misc.php:58 
    597642msgid "Reset All Settings" 
    598643msgstr "" 
    599644 
    600 #: includes/admin/settings/misc.php:48 
     645#: includes/admin/settings/misc.php:65 
    601646msgid "Export" 
    602647msgstr "" 
    603648 
    604 #: includes/admin/settings/misc.php:55 
     649#: includes/admin/settings/misc.php:72 
    605650msgid "Import" 
    606651msgstr "" 
    607652 
    608 #: includes/admin/settings/misc.php:59 
     653#: includes/admin/settings/misc.php:76 
    609654msgid "Upload and import" 
    610655msgstr "" 
     
    764809msgstr "" 
    765810 
    766 #: includes/class-powered-cache-advanced-cache.php:51 
     811#: includes/class-powered-cache-advanced-cache.php:52 
    767812msgid "Purge Page Cache" 
    768813msgstr "" 
    769814 
    770 #: includes/class-powered-cache-advanced-cache.php:68 
     815#: includes/class-powered-cache-advanced-cache.php:71 
    771816msgid "Page cache deleted successfully!" 
    772817msgstr "" 
     
    776821msgstr "" 
    777822 
    778 #: includes/class-powered-cache-object-cache.php:49 
     823#: includes/class-powered-cache-hooks.php:58 
     824msgid "Purge All Cache" 
     825msgstr "" 
     826 
     827#: includes/class-powered-cache-hooks.php:77 
     828#: includes/class-powered-cache-object-cache.php:72 
     829msgid "You don't have permission to perform this action!" 
     830msgstr "" 
     831 
     832#: includes/class-powered-cache-hooks.php:87 
     833msgid "Cache flushed successfully" 
     834msgstr "" 
     835 
     836#: includes/class-powered-cache-object-cache.php:54 
    779837msgid "Purge Object Cache" 
    780838msgstr "" 
    781839 
    782 #: includes/class-powered-cache-object-cache.php:70 
     840#: includes/class-powered-cache-object-cache.php:81 
    783841msgid "Object cache deleted successfully!" 
    784842msgstr "" 
     
    788846msgstr "" 
    789847 
    790 #: powered-cache.php:202 powered-cache.php:210 
     848#: powered-cache.php:206 powered-cache.php:214 
    791849msgid "Cheatin&#8217; huh?" 
    792850msgstr "" 
    793851 
    794 #: powered-cache.php:271 
     852#: powered-cache.php:275 
    795853msgid "Your site does not support Powered Cache." 
    796854msgstr "" 
    797855 
    798 #: powered-cache.php:273 
     856#: powered-cache.php:277 
    799857msgid "" 
    800858"Your site is currently running WordPress version %1$s, while Powered Cache " 
     
    802860msgstr "" 
    803861 
    804 #: powered-cache.php:275 
     862#: powered-cache.php:279 
    805863msgid "Please update your WordPress or deactivate Powered Cache." 
    806864msgstr "" 
     
    902960msgstr "" 
    903961 
    904 #: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:63 
     962#: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:70 
    905963msgid "Blocking – (default)" 
    906964msgstr "" 
    907965 
    908 #: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:64 
     966#: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:71 
    909967msgid "Non-blocking using async" 
    910968msgstr "" 
    911969 
    912 #: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:65 
     970#: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:72 
    913971msgid "Non-blocking using defer" 
    914972msgstr "" 
    915973 
    916 #: premium/extensions/minifier/inc/class-powered-cache-minifier-helper.php:602 
     974#: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:82 
     975msgid "Purge Minifier Cache" 
     976msgstr "" 
     977 
     978#: premium/extensions/minifier/inc/class-powered-cache-minifier-admin.php:103 
     979msgid "Minifier cache flushed successfully" 
     980msgstr "" 
     981 
     982#: premium/extensions/minifier/inc/class-powered-cache-minifier-helper.php:666 
    917983msgid "Minifier could not create cache directory" 
    918984msgstr "" 
    919985 
    920 #: premium/extensions/minifier/inc/class-powered-cache-minifier-helper.php:604 
     986#: premium/extensions/minifier/inc/class-powered-cache-minifier-helper.php:668 
    921987msgid "" 
    922988"Please make sure root caching directory writable by plugin. If you defined " 
     
    9601026msgstr "" 
    9611027 
    962 #: premium/extensions/minifier/inc/settings.php:54 
     1028#: premium/extensions/minifier/inc/settings.php:53 
    9631029msgid "JS files to exclude" 
    9641030msgstr "" 
     
    10991165msgstr "" 
    11001166 
     1167#. Plugin Name of the plugin/theme 
     1168msgid "Powered Cache Premium" 
     1169msgstr "" 
     1170 
    11011171#. Plugin URI of the plugin/theme 
    11021172msgid "https://poweredcache.com" 
  • powered-cache/trunk/powered-cache.php

    r1643215 r1664974  
    66 * Author:        SKOP, Mustafa Uysal 
    77 * Author URI:    http://skop.co/ 
    8  * Version:       1.0.1 
     8 * Version:       1.1 
    99 * Text Domain:   powered-cache 
    1010 * Domain Path:   /languages/ 
     
    7070 
    7171            if ( ! defined( 'POWERED_CACHE_PLUGIN_VERSION' ) ) { 
    72                 define( 'POWERED_CACHE_PLUGIN_VERSION', '1.0.1' ); 
     72                define( 'POWERED_CACHE_PLUGIN_VERSION', '1.1' ); 
    7373            } 
    7474 
     
    114114            require_once POWERED_CACHE_INC_DIR . 'class-powered-cache-extensions.php'; 
    115115            require_once POWERED_CACHE_INC_DIR . 'class-powered-cache-cron.php'; 
     116            require_once POWERED_CACHE_INC_DIR . 'class-powered-cache-hooks.php'; 
    116117            require_once POWERED_CACHE_INC_DIR . 'class-powered-cache-advanced-cache.php'; 
    117118            require_once POWERED_CACHE_INC_DIR . 'class-powered-cache-object-cache.php'; 
     
    158159            Powered_Cache_Cron::factory(); 
    159160 
     161            // Attached hooks 
     162            Powered_Cache_Hooks::factory(); 
     163 
    160164            // init admin 
    161165            if ( is_admin() && class_exists( 'Powered_Cache_Admin' ) ) { 
     
    220224 
    221225function powered_cache_deactivation() { 
    222     global $wp_filesystem; 
     226    global $powered_cache_fs; 
    223227 
    224228    powered_cache_flush(); 
     
    230234        // delete object cache file 
    231235        if ( file_exists( untrailingslashit( WP_CONTENT_DIR ) . '/object-cache.php' ) ) { 
    232             $wp_filesystem->delete( untrailingslashit( WP_CONTENT_DIR ) . '/object-cache.php' ); 
     236            $powered_cache_fs->delete( untrailingslashit( WP_CONTENT_DIR ) . '/object-cache.php' ); 
    233237        } 
    234238 
    235239        // delete advanced cache file 
    236240        if ( file_exists( untrailingslashit( WP_CONTENT_DIR ) . '/advanced-cache.php' ) ) { 
    237             $wp_filesystem->delete( untrailingslashit( WP_CONTENT_DIR ) . '/advanced-cache.php' ); 
     241            $powered_cache_fs->delete( untrailingslashit( WP_CONTENT_DIR ) . '/advanced-cache.php' ); 
    238242        } 
    239243    } 
  • powered-cache/trunk/readme.txt

    r1643215 r1664974  
    44Tags: cache, caching, powered cache, cdn, performance, optimisation, SEO 
    55Requires at least:  4.1 
    6 Tested up to:  4.7 
    7 Stable tag:  1.0.1 
     6Tested up to:  4.8 
     7Stable tag:  1.1 
    88License: GPLv2 (or later) 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    112112== Changelog == 
    113113 
    114 = 1.0.1 = 
    115  - gzip encoding buffer fix 
    116  - rejected_uri regex fix 
    117  - notice fix, (due to enabling page cache) 
     114= 1.1 = 
     115 - Human readable format for interval fields 
     116 - Predefined .htaccess & nginx configuration files 
     117 - Additional page purging added 
     118 - Better garbage collecting 
     119 - Purge all cache with single click 
     120 - Multisite improvements 
     121 - New constants added 
     122 - Bug fixes 
     123 
    118124 
    119125Detailed changelog located in [changelog page](https://poweredcache.com/changelog) 
  • powered-cache/trunk/uninstall.php

    r1633170 r1664974  
    1212include_once( 'powered-cache.php' ); 
    1313 
    14 global $wp_filesystem; 
     14global $powered_cache_fs; 
    1515 
    1616// clean cache 
     
    2727// delete object cache file 
    2828if ( file_exists( untrailingslashit( WP_CONTENT_DIR ) . '/object-cache.php' ) ) { 
    29     $wp_filesystem->delete( untrailingslashit( WP_CONTENT_DIR ) . '/object-cache.php' ); 
     29    $powered_cache_fs->delete( untrailingslashit( WP_CONTENT_DIR ) . '/object-cache.php' ); 
    3030} 
    3131 
    3232// delete advanced cache file 
    3333if ( file_exists( untrailingslashit( WP_CONTENT_DIR ) . '/advanced-cache.php' ) ) { 
    34     $wp_filesystem->delete( untrailingslashit( WP_CONTENT_DIR ) . '/advanced-cache.php' ); 
     34    $powered_cache_fs->delete( untrailingslashit( WP_CONTENT_DIR ) . '/advanced-cache.php' ); 
    3535} 
    3636 
    3737// delete cache directory 
    3838if ( file_exists( powered_cache_get_cache_dir() ) ) { 
    39     $wp_filesystem->delete( powered_cache_get_cache_dir(), true ); 
     39    $powered_cache_fs->delete( powered_cache_get_cache_dir(), true ); 
    4040} 
    4141 
    4242// delete configuration files 
    4343if ( file_exists( WP_CONTENT_DIR . '/pc-config' ) ) { 
    44     $wp_filesystem->delete( WP_CONTENT_DIR . '/pc-config', true ); 
     44    $powered_cache_fs->delete( WP_CONTENT_DIR . '/pc-config', true ); 
    4545} 
    4646 
Note: See TracChangeset for help on using the changeset viewer.