Plugin Directory

Changeset 3263433


Ignore:
Timestamp:
03/28/2025 10:32:23 AM (12 months ago)
Author:
aguidrevitch
Message:

🔧 Maintenance Update
Release Date: January 28, 2025
🛠️ Fixes & Improvements

  • PHP 8.4 Compatibility: Enhanced compatibility to ensure smooth performance with the latest PHP version.
  • Exclusion Fixes: Resolved minor issues with exclusions for a more reliable optimization process.
  • UI Fixes: Made small UI adjustments for a cleaner and more intuitive experience.
Location:
fastpixel-website-accelerator/trunk
Files:
2 added
17 edited

Legend:

Unmodified
Added
Removed
  • fastpixel-website-accelerator/trunk/fastpixel.php

    r3255528 r3263433  
    55 * Description: Faster WordPress Made Easy – Solve all your website speed problems effortlessly with just a few clicks.
    66 * Author:      ShortPixel
    7  * Version:     1.0.44
     7 * Version:     1.0.45
    88 * Text Domain: fastpixel-website-accelerator
    99 * Domain Path: /languages
     
    2121defined('ABSPATH') || exit;
    2222
    23 define('FASTPIXEL_VERSION', '1.0.44');
     23define('FASTPIXEL_VERSION', '1.0.45');
    2424define('FASTPIXEL_NAME', 'FastPixel');
    2525if (!defined('FASTPIXEL_PLUGIN_DIR'))
  • fastpixel-website-accelerator/trunk/inc/backend/assets/backend.js

    r3251166 r3263433  
    2626    function fastpixelOnOptimizationChange(disable = true) {
    2727        if (disable) {
    28             jQuery('[data-depends-on="fastpixel-javascript-optimization"]').attr('disabled', 'disabled');
    29         } else {
    30             jQuery('[data-depends-on="fastpixel-javascript-optimization"]').removeAttr('disabled');
     28            jQuery('[data-depends-on="fastpixel-javascript-optimization"]').attr('readonly', 'readonly');
     29        } else {
     30            jQuery('[data-depends-on="fastpixel-javascript-optimization"]').removeAttr('readonly');
    3131        }
    3232    }
    3333
    3434    //adding custom event to have ability to trigger it programmatically and avoid loop triggering
    35     jQuery('#fastpixel_javascript_optimization').on('fastpixelChange', function () {
    36         const value = jQuery(this).val(); const disable = value == 3 ? true : false; fastpixelOnOptimizationChange(disable);
    37     });
    38     jQuery('#fastpixel_javascript_optimization').on('change', function () {
     35    jQuery('input[name="fastpixel_javascript_optimization"]').on('fastpixelChange', function () {
     36        const checked = jQuery(this).prop('checked');
     37        if (checked) {
     38            const value = jQuery(this).val();
     39            const disable = (parseInt(value) == 2 ? false : true);
     40            fastpixelOnOptimizationChange(disable);
     41        }
     42    });
     43    jQuery('input[name="fastpixel_javascript_optimization"]').on('change', function () {
    3944        jQuery(this).trigger('fastpixelChange');
    4045    });
  • fastpixel-website-accelerator/trunk/inc/backend/controllers/cache.php

    r3255528 r3263433  
    1313        protected $config;
    1414        protected $time_to_wait = 5; //need this option to avoid multiple page cache requests
    15         protected $serve_stale;
     15        protected $serve_stale = false;
    1616        protected $be_functions;
    1717        protected $purged_objects_cache = false;
     18        protected $run_purge_for_custom_urls = false;
    1819
    1920        public function __construct()
     
    2728
    2829
    29             $this->serve_stale = function_exists('get_option') ? $this->functions->get_option('fastpixel_serve_stale') : $this->config->get_option('serve_stale');
     30            $this->serve_stale = function_exists('get_option') ? (bool) $this->functions->get_option('fastpixel_serve_stale') : (bool) $this->config->get_option('serve_stale');
    3031
    3132            //cache functions only for backend
     
    154155            add_action('admin_post_fastpixel_admin_delete_cached', [$this, 'admin_delete_cached_files']);
    155156            //taxonomy functions
     157            add_action('created_term', function ($term, $taxonomy, $args) {
     158                do_action('fastpixel/term/created', $term, $taxonomy, $args); //own hook
     159            }, 10, 3);
    156160            add_action('edit_terms', function ($term_id, $taxonomy, $args) {
    157161                if ($this->debug) {
     
    283287             * Different update hooks
    284288             */
    285             add_action('wp_update_nav_menu', function(int $menu_id, array $menu_data) {
     289            add_action('wp_update_nav_menu', function(int $menu_id, array $menu_data = []) {
    286290                $this->purge_all_with_message_no_request();
    287291            }, 10, 2);  // When a custom menu is update.
     
    307311                $this->purge_all_with_message_no_request();
    308312            }, 10, 1);  // When customizer is saved.
     313
     314            //run purge for custom urls on shutdown callback
     315            add_action('fastpixel/shutdown', [$this, 'always_purge_urls'], 10);
     316            //enabling purge for custom urls on post actions
     317            add_action('fastpixel/post/published', [$this, 'run_purge_for_custom_urls'], 10);
     318            add_action('fastpixel/post/inserted', [$this, 'run_purge_for_custom_urls'], 10);
     319            add_action('fastpixel/post/draft_to_publish', [$this, 'run_purge_for_custom_urls'], 10);
     320            add_action('fastpixel/post/pending_to_publish', [$this, 'run_purge_for_custom_urls'], 10);
     321            add_action('fastpixel/post/trashed', [$this, 'run_purge_for_custom_urls'], 10);
     322            //TOOD: check if we need always purge on terms actions
     323            //enabling purge for custom urls on term actions
     324            add_action('fastpixel/term/created', [$this, 'run_purge_for_custom_urls'], 10);
     325            add_action('fastpixel/terms/edited', [$this, 'run_purge_for_custom_urls'], 10);
     326            add_action('fastpixel/term/deleted', [$this, 'run_purge_for_custom_urls'], 10);
    309327        }
    310328
     
    561579            //remove cache folder if serve_stale is disabled
    562580            $clear_folder = apply_filters('fastpixel/purge_all/clear_cache_folder', true);
    563             $serve_stale = $this->functions->get_option('fastpixel_serve_stale');
    564581            if ($this->debug) {
    565582                FASTPIXEL_DEBUG::log('Class FASTPIXEL_Backend_Cache: ACTION purge_all, clear cache directory', $clear_folder);
    566                 FASTPIXEL_DEBUG::log('Class FASTPIXEL_Backend_Cache: ACTION purge_all, serve stale', $serve_stale);
    567             }
    568             if (($clear_folder && !$serve_stale)) {
     583                FASTPIXEL_DEBUG::log('Class FASTPIXEL_Backend_Cache: ACTION purge_all, serve stale', $this->serve_stale);
     584            }
     585            if (($clear_folder && !$this->serve_stale)) {
    569586                add_action('fastpixel/shutdown', function () {
    570587                    if ($this->debug) {
     
    924941            return false;
    925942        }
     943
     944        public function run_purge_for_custom_urls() {
     945            $this->run_purge_for_custom_urls = true;
     946        }
     947
     948        public function always_purge_urls() {
     949            //getting urls to purge
     950            if ($this->run_purge_for_custom_urls) {
     951                $urls_setting = $this->functions->get_option('fastpixel_always_purge_urls', []);
     952                $urls = explode("\r\n", $urls_setting);
     953                if (!empty($urls) && is_array($urls)) {
     954                    foreach($urls as $url) {
     955                        if (substr($url, 0, 1) != '/') {
     956                            continue;
     957                        }
     958                        $options = [
     959                            'original_url' => $url
     960                        ];
     961                        $full_url = new FASTPIXEL_Url(apply_filters('fastpixel/backend/always_purge_url', get_home_url(null, $url), $options));
     962                        //delete cached files if serve stale is disabled(adding this to keep more free space and avoid serving cached pages)
     963                        if (!$this->serve_stale) {
     964                            $this->functions->delete_cached_files($full_url->get_url_path());
     965                        }
     966                        $this->functions->update_post_cache($full_url->get_url_path(), true);
     967                    }
     968                }
     969            }
     970        }
    926971    }
    927972    new FASTPIXEL_Backend_Cache();
  • fastpixel-website-accelerator/trunk/inc/backend/controllers/classes/post-types-statuses.php

    r3255528 r3263433  
    2121            $this->be_functions = FASTPIXEL_Backend_Functions::get_instance();
    2222            //loading post types later, when all plugins and themes loaded
    23             add_action('init', function () {
     23            add_action('admin_init', function () {
    2424                $this->post_types = get_post_types(['public' => true], 'objects');
    2525                $this->nonce = wp_create_nonce('cache_status_nonce');
  • fastpixel-website-accelerator/trunk/inc/backend/controllers/tabs/javascript.php

    r3245943 r3263433  
    117117                'field_value' => $excludes,
    118118                'label'       => $args['label'],
    119                 'description' => $description
     119                'description' => $description,
     120                'data'        => ['data-depends-on="fastpixel-javascript-optimization"']
    120121            ], true);
    121122        }
     
    131132                'field_value' => $excludes,
    132133                'label'       => $args['label'],
    133                 'description' => $description
     134                'description' => $description,
     135                'data'        => ['data-depends-on="fastpixel-javascript-optimization"']
    134136            ], true);
    135137        }
  • fastpixel-website-accelerator/trunk/inc/backend/controllers/tabs/settings.php

    r3230775 r3263433  
    4444            register_setting(FASTPIXEL_TEXTDOMAIN, 'fastpixel_params_exclusions', ['type' => 'array']);
    4545            register_setting(FASTPIXEL_TEXTDOMAIN, 'fastpixel_excluded_post_types', ['type' => 'array', 'sanitize_callback' => [$this, 'sanitize_fastpixel_post_types_exclusion_cb']]);
     46            register_setting(FASTPIXEL_TEXTDOMAIN, 'fastpixel_always_purge_urls', ['type' => 'array']);
    4647            // Register a new section in the "settings" page.
    4748            add_settings_section(
     
    154155                $field_title,
    155156                [$this, 'field_exclude_post_types_cb'],
     157                FASTPIXEL_TEXTDOMAIN,
     158                'fastpixel_settings_section',
     159                [
     160                    'class' => 'fastpixel-settings-form-row',
     161                    'label' => $field_title
     162                ]
     163            );
     164
     165            $field_title = esc_html__('Always Purge URL(s)', 'fastpixel-website-accelerator');
     166            add_settings_field(
     167                'fastpixel_always_purge_urls',
     168                $field_title,
     169                [$this, 'field_always_purge_urls_cb'],
    156170                FASTPIXEL_TEXTDOMAIN,
    157171                'fastpixel_settings_section',
     
    324338        }
    325339
     340        public function field_always_purge_urls_cb($args)
     341        {
     342            // Get the value of the setting we've registered with register_setting()
     343            $urls = $this->functions->get_option('fastpixel_always_purge_urls');
     344            $description = esc_html__('Page URLs that should always be purged from the cache whenever posts or plugins are added, edited, or deleted. Each URL should be added on a new line.', 'fastpixel-website-accelerator');
     345            $description .= '<br/>';
     346            $description .= esc_html__('Example: /blog/', 'fastpixel-website-accelerator');
     347            $this->be_functions->print_textarea([
     348                'field_name'  => 'fastpixel_always_purge_urls',
     349                'field_value' => $urls,
     350                'label'       => $args['label'],
     351                'description' => $description,
     352                'data'        => []
     353            ], true);
     354        }
     355
    326356        public function save_options() {
    327357            if (sanitize_text_field($_SERVER['REQUEST_METHOD']) !== 'POST' || (defined('DOING_AJAX') && DOING_AJAX) ||
     
    343373            //saving excludes and removing existing files if they exist
    344374            $this->save_excludes();
     375            //saving purge urls
     376            $this->save_purge_urls();
    345377            $exclude_all_params = isset($_POST['fastpixel_exclude_all_params']) && 1 == sanitize_text_field($_POST['fastpixel_exclude_all_params']) ? 1 : 0;
    346378            $this->functions->update_option('fastpixel_exclude_all_params', $exclude_all_params);
     
    367399        }
    368400
    369         public function save_excludes() {
     401        protected function save_excludes() {
    370402            //added extra check to avoid pcp validation notice
    371403            if (check_admin_referer('fastpixel-settings', 'fastpixel-nonce') == false) {
     
    397429        }
    398430
     431        protected function save_purge_urls()
     432        {
     433            //added extra check to avoid pcp validation notice
     434            if (check_admin_referer('fastpixel-settings', 'fastpixel-nonce') == false) {
     435                return;
     436            }
     437            //getting old value
     438            $old_values = $this->functions->get_option('fastpixel_always_purge_urls');
     439            //getting new(submitted) value
     440            $new_values = sanitize_textarea_field($_POST['fastpixel_always_purge_urls']);
     441            //comparing values and saving only when differs
     442            if ($old_values != $new_values) {
     443                //updating value
     444                $this->functions->update_option('fastpixel_always_purge_urls', sanitize_textarea_field($_POST['fastpixel_always_purge_urls']));
     445            }
     446        }
     447
    399448        public function sanitize_fastpixel_speculation_mode($value) {
    400449            if (!in_array(sanitize_text_field($value), ['prefetch', 'prerender'])) {
  • fastpixel-website-accelerator/trunk/inc/backend/controllers/ui-multi.php

    r3197588 r3263433  
    5050            ]);
    5151            //we can add status link when not in network admin
    52             if (!is_network_admin()) {
     52            if (!is_network_admin() && $this->check_network_capabilities()) {
    5353                $wp_admin_bar->add_node([
    5454                    'id'     => 'fastpixel-top-' . FASTPIXEL_TEXTDOMAIN . '-status',
     
    5858                ]);
    5959            }
    60             $wp_admin_bar->add_node([
    61                 'id'     => 'fastpixel-top-' . FASTPIXEL_TEXTDOMAIN . '-settings',
    62                 'parent' => 'fastpixel-top-' . FASTPIXEL_TEXTDOMAIN . '-menu',
    63                 'href'   => esc_url(network_admin_url('admin.php?page=' . FASTPIXEL_TEXTDOMAIN . '-settings')),
    64                 'title'  => esc_html__('Settings', 'fastpixel-website-accelerator'),
    65             ]);
     60            if ($this->check_network_capabilities()) {
     61                $wp_admin_bar->add_node([
     62                    'id'     => 'fastpixel-top-' . FASTPIXEL_TEXTDOMAIN . '-settings',
     63                    'parent' => 'fastpixel-top-' . FASTPIXEL_TEXTDOMAIN . '-menu',
     64                    'href'   => esc_url(network_admin_url('admin.php?page=' . FASTPIXEL_TEXTDOMAIN . '-settings')),
     65                    'title'  => esc_html__('Settings', 'fastpixel-website-accelerator'),
     66                ]);
     67            }
    6668            $this->admin_bar_purge_button($wp_admin_bar); //there can be button for purge single post/page/taxonomy/author/archive
    6769            $wp_admin_bar->add_node([
     
    7375        }
    7476
    75         public function check_capabilities()
     77        protected function check_network_capabilities()
    7678        {
    7779            // check user capabilities
  • fastpixel-website-accelerator/trunk/inc/backend/models/diag-tests/config-file.php

    r3083183 r3263433  
    1212        protected $display_notifications = false;
    1313        protected $visible_on_diagnostics_page = false;
    14 
     14        protected $functions;
     15        protected $config_file;
    1516
    1617        public function __construct() {
    1718            parent::__construct();
     19            $this->functions = FASTPIXEL_Functions::get_instance();
     20            $this->config_file = FASTPIXEL_Config_Model::get_instance();
    1821        }
    1922
     
    2326            $options = ['fastpixel_serve_stale', 'fastpixel_display_cached_for_logged', 'fastpixel_cache_lifetime'];
    2427            $modified = false;
    25             $functions = FASTPIXEL_Functions::get_instance();
    26             $config_file = FASTPIXEL_Config_Model::get_instance();
     28
    2729            foreach ($options as $option_name) {
    28                 $option_value = $functions->get_option($option_name, false);
    29                 if ($config_file->get_option($option_name) != $option_value) {
    30                     $config_file->set_option($option_name, $option_value);
     30                $option_value = $this->functions->get_option($option_name, false);
     31                if ($this->config_file->get_option($option_name) != $option_value) {
     32                    $this->config_file->set_option($option_name, $option_value);
    3133                    $modified = true;
    3234                }   
    3335            }
     36            if ($this->check_permalinks()) {
     37                $modified = true;
     38            }
     39            if ($this->check_wpml()) {
     40                $modified = true;
     41            }
    3442            if ($modified) {
    35                 $config_file->save_file();
     43                $this->config_file->save_file();
    3644            }
    3745        }
     
    4452            $this->name = esc_html__('Configuration File', 'fastpixel-website-accelerator');
    4553        }
     54
     55        protected function check_permalinks() {
     56            //skip check when multisite
     57            if (function_exists('is_multisite') && is_multisite()) {
     58                return false;
     59            }
     60            //check permalinks
     61            $modified = false;
     62            $permalink_stucture = $this->functions->get_option('permalink_structure');
     63            if (preg_match('/\/$/', $permalink_stucture)) {
     64                if ($this->config_file->get_option('fastpixel_force_trailing_slash') != true) {
     65                    $this->config_file->set_option('fastpixel_force_trailing_slash', true);
     66                    $modified = true;
     67                }
     68            } else {
     69                if ($this->config_file->get_option('fastpixel_force_trailing_slash') != false) {
     70                    $this->config_file->set_option('fastpixel_force_trailing_slash', false);
     71                    $modified = true;
     72                }
     73            }
     74            return $modified;
     75        }
     76
     77        protected function check_wpml() {
     78            //probably WPML should not be used with multisite
     79            if (function_exists('is_multisite') && is_multisite()) {
     80                return false;
     81            }
     82            $force_redirect_for_default_language = $this->config_file->get_option('fastpixel_wpml_use_directory_for_default_language');
     83            //if wpml is enabled
     84            if (defined('ICL_SITEPRESS_VERSION')) {
     85                $settings = get_option('icl_sitepress_settings');
     86                $use_directory = false;
     87                if (!empty($settings['urls']['directory_for_default_language'])) {
     88                    $use_directory = $settings['urls']['directory_for_default_language'];
     89                }
     90                if ($use_directory == true && $force_redirect_for_default_language == false) {
     91                    $this->config_file->set_option('fastpixel_wpml_use_directory_for_default_language', true);
     92                    return true;
     93                } elseif ($use_directory == false && $force_redirect_for_default_language == true) {
     94                    $this->config_file->set_option('fastpixel_wpml_use_directory_for_default_language', false);
     95                    return true;
     96                }
     97                return false;
     98            } else {
     99                if ($force_redirect_for_default_language == true) {
     100                    $this->config_file->set_option('fastpixel_wpml_use_directory_for_default_language', false);
     101                    return true;
     102                }
     103            }
     104        }
    46105    }
    47106    new FASTPIXEL_Diag_Test_Config();
  • fastpixel-website-accelerator/trunk/inc/backend/models/ui.php

    r3245943 r3263433  
    209209        public function status_page()
    210210        {
    211             if (!$this->check_capabilities()) {
    212                 return;
    213             }
    214211            echo '<hr class="wp-header-end"><hr class="fastpixel-header-hr"><div class="wrap fastpixel-website-accelerator-wrap">';
    215             echo wp_kses($this->header(), $this->allowed_tags);
    216             foreach ($this->tabs as $tab) {
    217                 if (!in_array($tab->get_slug(), array('cache-status')) || !$tab->is_enabled()) {
    218                     continue;
    219                 }
    220                 $tab->view();
     212            if ($this->check_capabilities()) {
     213                echo wp_kses($this->header(), $this->allowed_tags);
     214                foreach ($this->tabs as $tab) {
     215                    if (!in_array($tab->get_slug(), array('cache-status')) || !$tab->is_enabled()) {
     216                        continue;
     217                    }
     218                    $tab->view();
     219                }
     220            } else {
     221                echo '<h1>' . esc_html__('You do not have sufficient permissions to access this page.', 'fastpixel-website-accelerator') . '</h1>';
    221222            }
    222223            echo '</div>';
  • fastpixel-website-accelerator/trunk/inc/classes/excluded-file-extensions.php

    r3209416 r3263433  
    2626            'xml',
    2727            'xsl',
     28            'pdf',
    2829            //fonts
    2930            'woff',
     
    3536            'css',
    3637            //javascript
    37             'js'
     38            'js',
     39            //archives
     40            'zip',
     41            'rar',
     42            'tar',
     43            'gz',
     44            '7z',
     45            //audio video
     46            'mp3',
     47            'mp4',
     48            'avi',
     49            'mov',
     50            'wmv',
     51            'flv',
     52            'swf',
     53            'webm',
     54            'm4v',
     55            'mkv',
     56            'm4a',
     57            'wav',
     58            'ogg',
     59            'flac',
     60            'aac',
     61            'wma',
     62            'aiff',
     63            'mpg',
     64            'mpeg',
     65            //other
     66            'json',
     67            'csv',
     68            'xls',
     69            'map'
    3870        ];
    3971
  • fastpixel-website-accelerator/trunk/inc/classes/excluded-url-params.php

    r3245943 r3263433  
    3737            'tagverify'           => '', // site kit by google
    3838            'wc-ajax'             => '', // WooCommerce
     39            'bfwkey'              => ''
    3940        ];
    4041
  • fastpixel-website-accelerator/trunk/inc/classes/excluded-urls.php

    r3245943 r3263433  
    2424            $this->config = FASTPIXEL_Config_Model::get_instance();
    2525            add_filter('fastpixel/init/excluded', [$this, 'is_excluded'], 13, 2);
     26            add_filter('fastpixel/init/excluded', [$this, 'is_excluded_by_trailing_slash'], 8, 2);
     27            add_filter('fastpixel/init/excluded', [$this, 'is_excluded_by_wpml'], 14, 2);
    2628            if (is_admin()) {
    2729                add_filter('fastpixel/backend_functions/cache_status_display/excluded', [$this, 'admin_check_is_excluded'], 13, 2);
     
    116118            return $status;
    117119        }
     120
     121        public function is_excluded_by_trailing_slash($excluded, $url) {
     122            if ($excluded == true) {
     123                return $excluded;
     124            }
     125            if (!$this->is_home()) {
     126                //temporary solution, if multisite then skip check
     127                if (is_multisite()) {
     128                    return $excluded;
     129                }
     130                $force = $this->config->get_option('fastpixel_force_trailing_slash');
     131                if ($force && !preg_match('/\/$/', $url->get_path())) { //case when we need to force trailing slash and url does not have it
     132                    return true;
     133                }
     134                if (!$force && preg_match('/\/$/', $url->get_path())) { //case when we need to force no trailing slash and url has it
     135                    return true;
     136                }
     137            }
     138            return false;
     139        }
     140
     141        public function is_excluded_by_wpml($excluded, $url)
     142        {
     143            if ($excluded == true) {
     144                return $excluded;
     145            }
     146            /**
     147             * checking excluded urls
     148             */
     149
     150            $use_directory = $this->config->get_option('fastpixel_wpml_use_directory_for_default_language');
     151            if ($use_directory && $this->is_home()) {
     152                return true; //we need to redirect homepage to directory, example / -> /en/
     153            }
     154            return false;
     155        }
     156
     157        protected function is_home()
     158        {
     159            if (!empty($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] == '/') {
     160                return true;
     161            }
     162            return false;
     163        }
    118164    }
    119165    new FASTPIXEL_Excluded_Urls();
  • fastpixel-website-accelerator/trunk/inc/classes/request.php

    r3223801 r3263433  
    222222            //checking if wpml is installed and url format is different domain
    223223            if ($this->functions->get_option('fastpixel_skip_url_match', false) || (function_exists('is_multisite') && is_multisite())) {
    224                 FASTPIXEL_DEBUG::log('REQUEST Class: fastpixel_skip_url_match is set, skipping url match');
     224                if ($this->debug_request) {
     225                    FASTPIXEL_DEBUG::log('REQUEST Class: fastpixel_skip_url_match is set, skipping url match');
     226                }
    225227                return true;
    226228            }
  • fastpixel-website-accelerator/trunk/inc/config-model.php

    r3179548 r3263433  
    99        public static $instance;
    1010        protected $options = [
    11             'fastpixel_serve_stale'               => false,
    12             'fastpixel_display_cached_for_logged' => false,
    13             'fastpixel_javascript_optimization'   => 1, //1 => 'optimize', 2 => 'delaycritical', 3 => 'donotoptimize'
    14             'fastpixel_cache_lifetime'            => 1, //1 => unlimited, 2 => 24H, 3 => 12H
    15             'fastpixel_enabled_modules'           => [],
    16             'fastpixel_exclusions'                => false,
    17             'fastpixel_exclude_all_params'        => false,
    18             'fastpixel_params_exclusions'         => false
     11            'fastpixel_serve_stale'                             => false,
     12            'fastpixel_display_cached_for_logged'               => false,
     13            'fastpixel_javascript_optimization'                 => 1, //1 => 'optimize', 2 => 'delaycritical', 3 => 'donotoptimize'
     14            'fastpixel_cache_lifetime'                          => 1, //1 => unlimited, 2 => 24H, 3 => 12H
     15            'fastpixel_enabled_modules'                         => [],
     16            'fastpixel_exclusions'                              => false,
     17            'fastpixel_exclude_all_params'                      => false,
     18            'fastpixel_params_exclusions'                       => false,
     19            'fastpixel_force_trailing_slash'                    => true, //used in single site install, usually is set to true
     20            'fastpixel_wpml_use_directory_for_default_language' => false
    1921        ];
    2022        protected $config_dir;
     
    108110                            }
    109111                        }
    110                        
    111112                    }
     113                    $this->check_permalinks();
    112114                }
    113115                $this->save_file();
     
    130132            return false;
    131133        }
     134
     135        protected function check_permalinks() {
     136            //check permalinks
     137            if (function_exists('is_multisite') && is_multisite()) {
     138                return false;
     139            }
     140            $permalink_stucture = $this->functions->get_option('permalink_structure');
     141            if (preg_match('/\/$/', $permalink_stucture)) {
     142                $this->set_option('fastpixel_force_trailing_slash', true);
     143            } else {
     144                $this->set_option('fastpixel_force_trailing_slash', false);
     145            }
     146        }
    132147    }
    133148}
  • fastpixel-website-accelerator/trunk/inc/url.php

    r3255528 r3263433  
    227227        public function get_url() {
    228228            //temporary done dynamic url generation
    229             return $this->scheme . '://' . $this->host . (!empty($this->port) ? $this->port : '') . (!empty($this->path) ? rtrim($this->path, '/') : '') . '/' . (!empty($this->query) ? '?' . $this->query : '');
     229            return $this->scheme . '://' . $this->host . (!empty($this->port) ? $this->port : '') . $this->path . (!empty($this->query) ? '?' . $this->query : '');
    230230        }
    231231        public function get_host() {
  • fastpixel-website-accelerator/trunk/readme.txt

    r3255528 r3263433  
    55Tested up to: 6.7
    66Requires PHP: 5.6
    7 Stable tag: 1.0.44
     7Stable tag: 1.0.45
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    201201== Changelog ==
    202202
     203= 1.0.45 =
     204
     205🌐 The Smart Purge Update
     206
     207Release Date: March 28, 2025
     208
     209✨ New Features
     210
     211* Always Purge URL(s): You can now define specific page URLs that should always be purged from the cache whenever posts, pages, or plugins are added, edited, or removed. Perfect for keeping key landing pages and dynamic content fresh!
     212
     213🤝 Compatibility Improvements
     214
     215* WPML Support Enhanced: Added redirect patches to improve compatibility with multilingual setups using WPML.
     216* Affiliate Parameter Handling: Improved support for affiliate tracking parameters to ensure they don’t interfere with caching or optimization.
     217
     218🛠️ Bug Fixes
     219
     220* Various under-the-hood bugfixes to improve stability and performance.
     221
    203222🔄 The Smarter Cache Update
    204223
  • fastpixel-website-accelerator/trunk/vendor/composer/installed.php

    r3255528 r3263433  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => '12cc62107ef979074d4d13b1b8f3619fcb393a19',
     6        'reference' => '4ae102c19a31b655483cb166294205f6a3e9a784',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => '12cc62107ef979074d4d13b1b8f3619fcb393a19',
     16            'reference' => '4ae102c19a31b655483cb166294205f6a3e9a784',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.