Plugin Directory

Changeset 2633085


Ignore:
Timestamp:
11/20/2021 11:26:40 PM (4 years ago)
Author:
codealfa
Message:

Uploading version 3.0.2

Location:
jch-optimize/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • jch-optimize/trunk/Awf/Mvc/Model.php

    r2624891 r2633085  
    8282    protected $config = array();
    8383
     84    private $hash;
     85
    8486
    8587    /**
     
    342344    public function getHash()
    343345    {
    344         static $hash = null;
    345 
    346         if (is_null($hash))
    347         {
    348             $hash = ucfirst($this->container->application->getName()) . '.' . $this->getName() . '.';
    349         }
    350 
    351         return $hash;
     346        if (is_null($this->hash))
     347        {
     348            $this->hash = ucfirst($this->container->application->getName()) . '.' . $this->getName() . '.';
     349        }
     350
     351        return $this->hash;
    352352    }
    353353
  • jch-optimize/trunk/jch-optimize.php

    r2625145 r2633085  
    55 * Plugin URI: http://www.jch-optimize.net/
    66 * Description: JCH Optimize performs several front-end optimizations to your webpages for fast downloads
    7  * Version: 3.0.1
     7 * Version: 3.0.2
    88 * Author: Samuel Marshall
    99 * License: GNU/GPLv3
     
    3030define( 'JCH_PLUGIN_URL', plugin_dir_url( JCH_PLUGIN_FILE ) );
    3131define( 'JCH_PLUGIN_DIR', plugin_dir_path( JCH_PLUGIN_FILE ) );
     32define( 'JCH_CACHE_DIR', WP_CONTENT_DIR . '/cache/jch-optimize/' );
    3233
    3334require_once( JCH_PLUGIN_DIR . 'autoload.php' );
  • jch-optimize/trunk/readme.txt

    r2625145 r2633085  
    33Contributors: codealfa
    44Tags: performance, pagespeed, cache, optimize, seo
    5 Tested up to: 5.8.1
    6 Stable tag: 3.0.1
     5Tested up to: 5.8.2
     6Stable tag: 3.0.2
    77License: GPLv3 or later
    88License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    7373
    7474== Changelog ==
     75
     76= 3.0.2 =
     77* Bug Fix: Fix issue with sites using FTP to upgrade
    7578
    7679= 3.0.1 =
  • jch-optimize/trunk/src/Platform/Cache.php

    r2624891 r2633085  
    6262        if ( ! isset( self::$wp_filesystem ) )
    6363        {
     64            // Set the permission constants if not already set.
     65            if ( ! defined( 'FS_CHMOD_DIR' ) )
     66            {
     67                define( 'FS_CHMOD_DIR', ( fileperms( ABSPATH ) & 0777 | 0755 ) );
     68            }
     69            if ( ! defined( 'FS_CHMOD_FILE' ) )
     70            {
     71                define( 'FS_CHMOD_FILE', ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ) );
     72            }
     73
     74            require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php';
     75            require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php';
     76
     77            self::$wp_filesystem = new \WP_Filesystem_Direct( true );
     78
     79
    6480            /** @var \WP_Filesystem_Base $wp_filesystem */
     81            /*
    6582            global $wp_filesystem;
    66 
    6783            $wp_filesystem_cache = $wp_filesystem;
    6884
     
    7793            ), 10, 7 );
    7894
    79             if ( false === ( $creds = request_filesystem_credentials( admin_url( 'options-general.php?page=jchoptimize-settings' ), '', false,
     95
     96            if ( false === ( $creds = request_filesystem_credentials( admin_url( 'options-general.php?page=jch_optimize' ), '', false,
    8097                    WP_CONTENT_DIR, null, true ) ) )
    8198            {
     
    120137
    121138            $wp_filesystem = $wp_filesystem_cache;
     139
     140*/
    122141        }
    123142
    124143        return self::$wp_filesystem;
    125     }
    126 
    127     /**
    128      *
    129      * @param   string  $id
    130      * @param   bool    $page_cache
    131      *
    132      * @return string
    133      */
    134     private static function _getFileName( $id, $page_cache = false )
    135     {
    136         return JCH_CACHE_DIR . ( $page_cache ? 'page/' : '' ) . md5( NONCE_SALT . $id );
    137144    }
    138145
     
    168175
    169176        return self::_getCacheFile( $file, $wp_filesystem );
    170     }
    171 
    172     protected static function getLifetime( $page_cache = false )
    173     {
    174         static $lifetime, $page_cache_lifetime;
    175 
    176         if ( $page_cache )
    177         {
    178             if ( ! $page_cache_lifetime )
    179             {
    180                 $params              = Plugin::getPluginParams();
    181                 $page_cache_lifetime = $params->get( 'page_cache_lifetime', '900' );
    182             }
    183 
    184             return (int) $page_cache_lifetime;
    185         }
    186 
    187         if ( ! $lifetime )
    188         {
    189             $params = Plugin::getPluginParams();
    190 
    191             $lifetime = $params->get( 'cache_lifetime', '900' );
    192         }
    193 
    194         return (int) $lifetime;
    195     }
    196 
    197     /**
    198      *
    199      * @param   string               $file
    200      * @param   \WP_Filesystem_Base  $wp_filesystem
    201      *
    202      * @return string
    203      */
    204     private static function _getCacheFile( $file, $wp_filesystem )
    205     {
    206         $content = $wp_filesystem->get_contents( $file );
    207 
    208         return unserialize( base64_decode( $content ) );
    209177    }
    210178
     
    311279        if ( in_array( '', $credentials ) )
    312280        {
    313             return false;
     281            return $value;
    314282        }
    315283
     
    414382        return true;
    415383    }
     384
     385    protected static function getLifetime( $page_cache = false )
     386    {
     387        static $lifetime, $page_cache_lifetime;
     388
     389        if ( $page_cache )
     390        {
     391            if ( ! $page_cache_lifetime )
     392            {
     393                $params              = Plugin::getPluginParams();
     394                $page_cache_lifetime = $params->get( 'page_cache_lifetime', '900' );
     395            }
     396
     397            return (int) $page_cache_lifetime;
     398        }
     399
     400        if ( ! $lifetime )
     401        {
     402            $params = Plugin::getPluginParams();
     403
     404            $lifetime = $params->get( 'cache_lifetime', '900' );
     405        }
     406
     407        return (int) $lifetime;
     408    }
     409
     410    /**
     411     *
     412     * @param   string  $id
     413     * @param   bool    $page_cache
     414     *
     415     * @return string
     416     */
     417    private static function _getFileName( $id, $page_cache = false )
     418    {
     419        return JCH_CACHE_DIR . ( $page_cache ? 'page/' : '' ) . md5( NONCE_SALT . $id );
     420    }
     421
     422    /**
     423     *
     424     * @param   string               $file
     425     * @param   \WP_Filesystem_Base  $wp_filesystem
     426     *
     427     * @return string
     428     */
     429    private static function _getCacheFile( $file, $wp_filesystem )
     430    {
     431        $content = $wp_filesystem->get_contents( $file );
     432
     433        return unserialize( base64_decode( $content ) );
     434    }
    416435}
  • jch-optimize/trunk/vendor/composer/installed.json

    r2624891 r2633085  
    155155                "type": "git",
    156156                "url": "[email protected]:jchoptimize/core.git",
    157                 "reference": "a33911b719d87c865995452c320f7add6b56c6af"
    158             },
    159             "dist": {
    160                 "type": "zip",
    161                 "url": "https://api.github.com/repos/jchoptimize/core/zipball/a33911b719d87c865995452c320f7add6b56c6af",
    162                 "reference": "a33911b719d87c865995452c320f7add6b56c6af",
     157                "reference": "d0efaf5ffe9904fddb8393ca6d897fb29f690329"
     158            },
     159            "dist": {
     160                "type": "zip",
     161                "url": "https://api.github.com/repos/jchoptimize/core/zipball/d0efaf5ffe9904fddb8393ca6d897fb29f690329",
     162                "reference": "d0efaf5ffe9904fddb8393ca6d897fb29f690329",
    163163                "shasum": ""
    164164            },
     
    167167                "php": ">=7"
    168168            },
    169             "time": "2021-10-31T00:13:46+00:00",
     169            "time": "2021-11-17T18:25:31+00:00",
    170170            "default-branch": true,
    171171            "type": "jchoptimize-core",
  • jch-optimize/trunk/vendor/composer/installed.php

    r2625145 r2633085  
    66        'install_path' => __DIR__ . '/../../',
    77        'aliases' => array(),
    8         'reference' => '769fb84a26db9112daa91512eb9a9fd1a1eb8f84',
     8        'reference' => '6feba8f0724bfdb3ee6b89606b04975dc599b606',
    99        'name' => 'jchoptimize/wordpress-platform',
    1010        'dev' => false,
     
    5252                0 => '9999999-dev',
    5353            ),
    54             'reference' => 'a33911b719d87c865995452c320f7add6b56c6af',
     54            'reference' => 'd0efaf5ffe9904fddb8393ca6d897fb29f690329',
    5555            'dev_requirement' => false,
    5656        ),
     
    6161            'install_path' => __DIR__ . '/../../',
    6262            'aliases' => array(),
    63             'reference' => '769fb84a26db9112daa91512eb9a9fd1a1eb8f84',
     63            'reference' => '6feba8f0724bfdb3ee6b89606b04975dc599b606',
    6464            'dev_requirement' => false,
    6565        ),
  • jch-optimize/trunk/vendor/jchoptimize/core/src/Browser.php

    r2624891 r2633085  
    2929        {
    3030
    31                 $this->oClient = new \Browser( $userAgent );
     31                $this->oClient = Utility::userAgent($userAgent);
    3232                $this->calculateFontHash();
    3333        }
     
    3535        protected function calculateFontHash()
    3636        {
    37                 $this->fontHash .= $this->oClient->getPlatform() . '/';
     37                $this->fontHash .= $this->oClient->os . '/';
    3838
    39                 $sVersion = $this->oClient->getVersion();
     39                $sVersion = $this->oClient->browserVersion;
    4040
    41                 switch ( $this->oClient->getBrowser() )
     41                switch ( $this->oClient->browser )
    4242                {
    4343                        case 'Chrome':
     
    155155        public function getBrowser()
    156156        {
    157                 return $this->oClient->getBrowser();
     157                return $this->oClient->browser;
    158158        }
    159159
     
    165165        public function getVersion()
    166166        {
    167                 return $this->oClient->getVersion();
     167                return $this->oClient->browserVersion;
    168168        }
    169169
  • jch-optimize/trunk/version.php

    r2625145 r2633085  
    1515defined( '_JCH_EXEC' ) or die;
    1616
    17 const JCH_VERSION  = '3.0.1';
    18 const JCH_DATE     = '2021-11-05';
     17const JCH_VERSION  = '3.0.2';
     18const JCH_DATE     = '2021-11-20';
    1919const JCH_PRO      = '0';
    2020const JCH_PLATFORM = 'WordPress';
Note: See TracChangeset for help on using the changeset viewer.