Plugin Directory

Changeset 3251676


Ignore:
Timestamp:
03/06/2025 11:57:14 AM (12 months ago)
Author:
shakee93
Message:

Update to version 3.1.2 from GitHub

Location:
unusedcss
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • unusedcss/tags/3.1.2/constants.php

    r3249182 r3251676  
    2626
    2727if ( ! defined( 'UUCSS_VERSION' ) ) {
    28     define( 'UUCSS_VERSION', '3.1.1' );
     28    define( 'UUCSS_VERSION', '3.1.2' );
    2929}
    3030
  • unusedcss/tags/3.1.2/includes/RapidLoad_Base.php

    r3238439 r3251676  
    158158        $this->enqueue_diagnose_script();
    159159
     160        //add_filter('site_transient_update_plugins', [$this, 'rapidload_plugin_check_for_update']);
     161
     162        //add_filter('plugins_api', [$this, 'rapidload_plugin_update_info'], 10, 3);
     163
     164    }
     165
     166    public function rapidload_plugin_update_info($false, $action, $args) {
     167        if ($action !== 'plugin_information') {
     168            return false;
     169        }
     170
     171        $slug = 'unusedcss';
     172
     173        if(defined('RAPIDLOAD_PLUGIN_SLUG')){
     174            $slug = RAPIDLOAD_PLUGIN_SLUG;
     175        }
     176   
     177        if ($args->slug !== $slug) {
     178            return false;
     179        }
     180   
     181        $response = wp_remote_get('https://plugin.rapidload.ai/download/update.json');
     182
     183        if (is_wp_error($response) || wp_remote_retrieve_response_code($response) !== 200) {
     184            return false;
     185        }
     186
     187        $data = json_decode(wp_remote_retrieve_body($response), true);
     188   
     189        if (!isset($data['version']) || !isset($data['download_url'])) {
     190            return false;
     191        }
     192   
     193        return (object) [
     194            'name'             => 'RapidLoad AI - Optimize Web Vitals Automatically',
     195            'slug'             => $slug,
     196            'version'          => $data['version'],
     197            'author'           => 'RapidLoad',
     198            'author_profile'   => 'https://rapidload.ai',
     199            'homepage'         => 'https://plugin.rapidload.ai',
     200            'download_link'    => $data['download_url'],
     201            'requires'         => $data['requires'],
     202            'tested'           => $data['tested'],
     203            'requires_php'     => isset($data['requires_php']) ? $data['requires_php'] : '',
     204            'last_updated'     => date('Y-m-d'),
     205            'sections'         => [
     206                'description'   => isset($data['sections']['description']) ? $data['sections']['description'] : 'No description available.',
     207                'changelog'     => isset($data['sections']['changelog']) ? $data['sections']['changelog'] : 'No changelog available.',
     208                'faq'           => isset($data['sections']['faq']) ? $data['sections']['faq'] : 'No FAQ available.'
     209            ]
     210        ];
     211    }
     212
     213    public function rapidload_plugin_check_for_update($transient){
     214        if (empty($transient->checked)) {
     215            return $transient;
     216        }
     217
     218        $slug = 'unusedcss';
     219
     220        if(defined('RAPIDLOAD_PLUGIN_SLUG')){
     221            $slug = RAPIDLOAD_PLUGIN_SLUG;
     222        }
     223   
     224        $plugin_slug = $slug . '/unusedcss.php'; // Adjust this to match your plugin's path.
     225        $remote_url = 'https://plugin.rapidload.ai/download/update.json'; // The URL where update details are hosted.
     226   
     227        $response = wp_remote_get($remote_url, array('timeout' => 10));
     228        if (is_wp_error($response) || wp_remote_retrieve_response_code($response) !== 200) {
     229            return $transient;
     230        }
     231   
     232        $data = json_decode(wp_remote_retrieve_body($response), true);
     233        if (!isset($data['version']) || !isset($data['download_url'])) {
     234            return $transient;
     235        }
     236   
     237        $current_version = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_slug)['Version'];
     238   
     239        if (version_compare($current_version, $data['version'], '<')) {
     240            $transient->response[$plugin_slug] = (object) [
     241                'slug' => $slug,
     242                'new_version' => $data['version'],
     243                'package' => $data['download_url'],
     244                'url' => 'https://rapidload.ai/', // Your plugin's details page.
     245                'tested' => $data['tested'],
     246                'requires' => $data['requires'],
     247            ];
     248        }
     249   
     250        return $transient;
    160251    }
    161252
  • unusedcss/tags/3.1.2/includes/RapidLoad_Enqueue.php

    r3238439 r3251676  
    176176            }
    177177
    178             $domains = array_unique($domains);
    179 
    180             if(gettype($dom) != "string"){
    181                 foreach ($domains as $domain){
    182                     if(!$this->str_contains(site_url(), $domain)){
    183                         $head = $dom->find('head', 0);
    184                         $preconnect = '<link href="//' . $domain . '" rel="dns-prefetch" crossorigin>';
    185                         $first_child = $head->first_child();
    186                         $first_child->__set('outertext', $preconnect . $first_child->outertext);
     178            if(apply_filters('rapidload/enqueue/dns-prefetch/enabled', true)){
     179                $domains = array_unique($domains);
     180
     181                if(gettype($dom) != "string"){
     182                    foreach ($domains as $domain){
     183                        if(!$this->str_contains(site_url(), $domain)){
     184                            $head = $dom->find('head', 0);
     185                            $preconnect = '<link href="//' . $domain . '" rel="dns-prefetch" crossorigin>';
     186                            $first_child = $head->first_child();
     187                            $first_child->__set('outertext', $preconnect . $first_child->outertext);
     188                        }
    187189                    }
    188190                }
    189191            }
    190 
    191 
    192192
    193193            if (gettype($dom) == "string") {
     
    235235
    236236        if ( isset( $this->options['uucss_excluded_links'] ) && ! empty( $this->options['uucss_excluded_links'] ) ) {
    237             $exploded = explode( ',', $this->options['uucss_excluded_links'] );
    238 
     237           
     238            if(is_string($this->options['uucss_excluded_links'])){
     239                $exploded = explode( ',', $this->options['uucss_excluded_links'] );
     240            }else{
     241                $exploded = $this->options['uucss_excluded_links'];
     242            }
     243           
    239244            foreach ( $exploded as $pattern ) {
    240245
  • unusedcss/tags/3.1.2/includes/RapidLoad_Utils.php

    r3238439 r3251676  
    576576
    577577        if ( isset( $options['uucss_excluded_links'] ) && ! empty( $options['uucss_excluded_links'] ) ) {
    578             $exploded = explode( ',', $options['uucss_excluded_links'] );
     578
     579            if(is_string($options['uucss_excluded_links'])){
     580                $exploded = explode( ',', $options['uucss_excluded_links'] );
     581            }else{
     582                $exploded = $options['uucss_excluded_links'];
     583            }
    579584
    580585            foreach ( $exploded as $pattern ) {
  • unusedcss/tags/3.1.2/includes/modules/javascript/Javascript_Enqueue.php

    r3242971 r3251676  
    105105            }
    106106
     107            $this->optimize_js_delivery($link);
     108
     109            // legacy delay starts here
     110
     111            if(isset($this->options['delay_javascript']) && $this->options['delay_javascript'] == "1"){
     112
     113                if(!apply_filters('rapidload/js/delay-excluded', false, $link, $this->job, $this->strategy, $this->options)){
     114                    $this->load_scripts_on_user_interaction($link, $original_src);
     115                }
     116
     117            }
     118
     119            // legacy delay ended
     120
    107121            if(isset($this->options['minify_js']) && $this->options['minify_js'] == "1"){
    108122                $this->minify_js($link);
    109123            }
    110 
    111             $this->optimize_js_delivery($link);
    112 
    113             // legacy delay starts here
    114 
    115             if(isset($this->options['delay_javascript']) && $this->options['delay_javascript'] == "1"){
    116 
    117                 if(!apply_filters('rapidload/js/delay-excluded', false, $link, $this->job, $this->strategy, $this->options)){
    118                     $this->load_scripts_on_user_interaction($link, $original_src);
    119                 }
    120 
    121             }
    122 
    123             // legacy delay ended
    124124
    125125            do_action('rapidload/enqueue/optimize-js', $link, $this->job, $this->strategy, $this->options);
  • unusedcss/tags/3.1.2/readme.txt

    r3249182 r3251676  
    66Requires at least: 5.0
    77Tested up to: 6.7
    8 Stable tag: 3.1.1
     8Stable tag: 3.1.2
    99Requires PHP: 5.4
    1010License: GPLv3
     
    144144== Changelog ==
    145145
     146= 3.1.2 - 06/03/2025 =
     147 * fix: known bugs
     148
    146149= 3.1.1 - 02/03/2025 =
    147150 * fix: minor improvements and stability updates
  • unusedcss/tags/3.1.2/unusedcss.php

    r3249182 r3251676  
    44Plugin URI:  https://rapidload.ai/
    55Description: Supercharge your website with RapidLoad AI, featuring cutting-edge AI to automate optimizing CSS, JavaScript, images, fonts, and caching.
    6 Version:     3.1.1
     6Version:     3.1.2
    77Author:      RapidLoad
    88Author URI:  https://rapidload.ai/
  • unusedcss/trunk/constants.php

    r3249182 r3251676  
    2626
    2727if ( ! defined( 'UUCSS_VERSION' ) ) {
    28     define( 'UUCSS_VERSION', '3.1.1' );
     28    define( 'UUCSS_VERSION', '3.1.2' );
    2929}
    3030
  • unusedcss/trunk/includes/RapidLoad_Base.php

    r3238439 r3251676  
    158158        $this->enqueue_diagnose_script();
    159159
     160        //add_filter('site_transient_update_plugins', [$this, 'rapidload_plugin_check_for_update']);
     161
     162        //add_filter('plugins_api', [$this, 'rapidload_plugin_update_info'], 10, 3);
     163
     164    }
     165
     166    public function rapidload_plugin_update_info($false, $action, $args) {
     167        if ($action !== 'plugin_information') {
     168            return false;
     169        }
     170
     171        $slug = 'unusedcss';
     172
     173        if(defined('RAPIDLOAD_PLUGIN_SLUG')){
     174            $slug = RAPIDLOAD_PLUGIN_SLUG;
     175        }
     176   
     177        if ($args->slug !== $slug) {
     178            return false;
     179        }
     180   
     181        $response = wp_remote_get('https://plugin.rapidload.ai/download/update.json');
     182
     183        if (is_wp_error($response) || wp_remote_retrieve_response_code($response) !== 200) {
     184            return false;
     185        }
     186
     187        $data = json_decode(wp_remote_retrieve_body($response), true);
     188   
     189        if (!isset($data['version']) || !isset($data['download_url'])) {
     190            return false;
     191        }
     192   
     193        return (object) [
     194            'name'             => 'RapidLoad AI - Optimize Web Vitals Automatically',
     195            'slug'             => $slug,
     196            'version'          => $data['version'],
     197            'author'           => 'RapidLoad',
     198            'author_profile'   => 'https://rapidload.ai',
     199            'homepage'         => 'https://plugin.rapidload.ai',
     200            'download_link'    => $data['download_url'],
     201            'requires'         => $data['requires'],
     202            'tested'           => $data['tested'],
     203            'requires_php'     => isset($data['requires_php']) ? $data['requires_php'] : '',
     204            'last_updated'     => date('Y-m-d'),
     205            'sections'         => [
     206                'description'   => isset($data['sections']['description']) ? $data['sections']['description'] : 'No description available.',
     207                'changelog'     => isset($data['sections']['changelog']) ? $data['sections']['changelog'] : 'No changelog available.',
     208                'faq'           => isset($data['sections']['faq']) ? $data['sections']['faq'] : 'No FAQ available.'
     209            ]
     210        ];
     211    }
     212
     213    public function rapidload_plugin_check_for_update($transient){
     214        if (empty($transient->checked)) {
     215            return $transient;
     216        }
     217
     218        $slug = 'unusedcss';
     219
     220        if(defined('RAPIDLOAD_PLUGIN_SLUG')){
     221            $slug = RAPIDLOAD_PLUGIN_SLUG;
     222        }
     223   
     224        $plugin_slug = $slug . '/unusedcss.php'; // Adjust this to match your plugin's path.
     225        $remote_url = 'https://plugin.rapidload.ai/download/update.json'; // The URL where update details are hosted.
     226   
     227        $response = wp_remote_get($remote_url, array('timeout' => 10));
     228        if (is_wp_error($response) || wp_remote_retrieve_response_code($response) !== 200) {
     229            return $transient;
     230        }
     231   
     232        $data = json_decode(wp_remote_retrieve_body($response), true);
     233        if (!isset($data['version']) || !isset($data['download_url'])) {
     234            return $transient;
     235        }
     236   
     237        $current_version = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_slug)['Version'];
     238   
     239        if (version_compare($current_version, $data['version'], '<')) {
     240            $transient->response[$plugin_slug] = (object) [
     241                'slug' => $slug,
     242                'new_version' => $data['version'],
     243                'package' => $data['download_url'],
     244                'url' => 'https://rapidload.ai/', // Your plugin's details page.
     245                'tested' => $data['tested'],
     246                'requires' => $data['requires'],
     247            ];
     248        }
     249   
     250        return $transient;
    160251    }
    161252
  • unusedcss/trunk/includes/RapidLoad_Enqueue.php

    r3238439 r3251676  
    176176            }
    177177
    178             $domains = array_unique($domains);
    179 
    180             if(gettype($dom) != "string"){
    181                 foreach ($domains as $domain){
    182                     if(!$this->str_contains(site_url(), $domain)){
    183                         $head = $dom->find('head', 0);
    184                         $preconnect = '<link href="//' . $domain . '" rel="dns-prefetch" crossorigin>';
    185                         $first_child = $head->first_child();
    186                         $first_child->__set('outertext', $preconnect . $first_child->outertext);
     178            if(apply_filters('rapidload/enqueue/dns-prefetch/enabled', true)){
     179                $domains = array_unique($domains);
     180
     181                if(gettype($dom) != "string"){
     182                    foreach ($domains as $domain){
     183                        if(!$this->str_contains(site_url(), $domain)){
     184                            $head = $dom->find('head', 0);
     185                            $preconnect = '<link href="//' . $domain . '" rel="dns-prefetch" crossorigin>';
     186                            $first_child = $head->first_child();
     187                            $first_child->__set('outertext', $preconnect . $first_child->outertext);
     188                        }
    187189                    }
    188190                }
    189191            }
    190 
    191 
    192192
    193193            if (gettype($dom) == "string") {
     
    235235
    236236        if ( isset( $this->options['uucss_excluded_links'] ) && ! empty( $this->options['uucss_excluded_links'] ) ) {
    237             $exploded = explode( ',', $this->options['uucss_excluded_links'] );
    238 
     237           
     238            if(is_string($this->options['uucss_excluded_links'])){
     239                $exploded = explode( ',', $this->options['uucss_excluded_links'] );
     240            }else{
     241                $exploded = $this->options['uucss_excluded_links'];
     242            }
     243           
    239244            foreach ( $exploded as $pattern ) {
    240245
  • unusedcss/trunk/includes/RapidLoad_Utils.php

    r3238439 r3251676  
    576576
    577577        if ( isset( $options['uucss_excluded_links'] ) && ! empty( $options['uucss_excluded_links'] ) ) {
    578             $exploded = explode( ',', $options['uucss_excluded_links'] );
     578
     579            if(is_string($options['uucss_excluded_links'])){
     580                $exploded = explode( ',', $options['uucss_excluded_links'] );
     581            }else{
     582                $exploded = $options['uucss_excluded_links'];
     583            }
    579584
    580585            foreach ( $exploded as $pattern ) {
  • unusedcss/trunk/includes/modules/javascript/Javascript_Enqueue.php

    r3242971 r3251676  
    105105            }
    106106
     107            $this->optimize_js_delivery($link);
     108
     109            // legacy delay starts here
     110
     111            if(isset($this->options['delay_javascript']) && $this->options['delay_javascript'] == "1"){
     112
     113                if(!apply_filters('rapidload/js/delay-excluded', false, $link, $this->job, $this->strategy, $this->options)){
     114                    $this->load_scripts_on_user_interaction($link, $original_src);
     115                }
     116
     117            }
     118
     119            // legacy delay ended
     120
    107121            if(isset($this->options['minify_js']) && $this->options['minify_js'] == "1"){
    108122                $this->minify_js($link);
    109123            }
    110 
    111             $this->optimize_js_delivery($link);
    112 
    113             // legacy delay starts here
    114 
    115             if(isset($this->options['delay_javascript']) && $this->options['delay_javascript'] == "1"){
    116 
    117                 if(!apply_filters('rapidload/js/delay-excluded', false, $link, $this->job, $this->strategy, $this->options)){
    118                     $this->load_scripts_on_user_interaction($link, $original_src);
    119                 }
    120 
    121             }
    122 
    123             // legacy delay ended
    124124
    125125            do_action('rapidload/enqueue/optimize-js', $link, $this->job, $this->strategy, $this->options);
  • unusedcss/trunk/readme.txt

    r3249182 r3251676  
    66Requires at least: 5.0
    77Tested up to: 6.7
    8 Stable tag: 3.1.1
     8Stable tag: 3.1.2
    99Requires PHP: 5.4
    1010License: GPLv3
     
    144144== Changelog ==
    145145
     146= 3.1.2 - 06/03/2025 =
     147 * fix: known bugs
     148
    146149= 3.1.1 - 02/03/2025 =
    147150 * fix: minor improvements and stability updates
  • unusedcss/trunk/unusedcss.php

    r3249182 r3251676  
    44Plugin URI:  https://rapidload.ai/
    55Description: Supercharge your website with RapidLoad AI, featuring cutting-edge AI to automate optimizing CSS, JavaScript, images, fonts, and caching.
    6 Version:     3.1.1
     6Version:     3.1.2
    77Author:      RapidLoad
    88Author URI:  https://rapidload.ai/
Note: See TracChangeset for help on using the changeset viewer.