Plugin Directory

Changeset 3481926


Ignore:
Timestamp:
03/13/2026 11:28:22 AM (2 weeks ago)
Author:
asjain84
Message:

Initial stable release of BlinkSpeed optimization plugin.

Location:
blinkspeed
Files:
15 added
11 edited

Legend:

Unmodified
Added
Removed
  • blinkspeed/trunk/admin/admin-page.php

    r3478468 r3481926  
    3636        <div class="top_panel d-none">
    3737            <div class="logo_container">
    38                 <img class="logo" src="<?php $blinkSpeed_admin->core->blinkspeed_esc_url_echo( BLINKSPEED_URL . 'assets/images/transparent-logo.png' ); ?>">
     38                <img class="logo" src="<?php $blinkSpeed_admin->core->blinkspeed_esc_url_echo( BLINKSPEED_URL . 'assets/images/Blinkspeed-logo-final-white.webp' ); ?>">
    3939            </div>
    4040
     
    6666            </div>
    6767            <div class="logo_container">
    68                 <img class="logo" src="<?php $blinkSpeed_admin->core->blinkspeed_esc_url_echo( BLINKSPEED_URL . 'assets/images/transparent-logo.png' ); ?>">
     68                <img class="logo" src="<?php $blinkSpeed_admin->core->blinkspeed_esc_url_echo( BLINKSPEED_URL . 'assets/images/Blinkspeed-logo-final-white.webp' ); ?>">
    6969            </div>
    7070            <?php include 'includes/tabs.php'; ?>
  • blinkspeed/trunk/assets/css/admin-style.css

    r3478468 r3481926  
    160160}
    161161
     162li#toplevel_page_blinkspeed .wp-menu-image > img, li#toplevel_page_settings-page-blinkspeed .wp-menu-image > img {
     163    filter: brightness(0) invert(1);
     164    min-width: 25px;
     165}
     166
    162167/*** Media Image Optimize Css :End */
  • blinkspeed/trunk/assets/css/admin.css

    r3478468 r3481926  
    102102    padding: 25px 35px 50px;
    103103    border-top: 2px solid #fff;
    104     background: #1d212a;
     104    background: transparent;
    105105    border-radius: 0 0 20px 0;
    106106}
     
    154154
    155155main.admin-blinkSpeed ul.nav.nav-tabs {
    156     background: #1d212a;
     156    background: transparent;
    157157    border: none !important;
    158158    padding: 25px 0;
     
    187187main.admin-blinkSpeed .nav > li > a:hover,
    188188main.admin-blinkSpeed .nav > li.active a {
    189     color: #11429C !important;
     189    color: #0192e2 !important;
    190190}
    191191main.admin-blinkSpeed .show:not(.active) {
     
    275275    font-size: 12px;
    276276    font-weight: bold;
    277     color: #11429C;
     277    color: #0192e2;
    278278    text-decoration: underline;
    279279}
     
    290290    font-family: FontAwesome;
    291291    margin-right: 5px;
    292     color: #11429C;
     292    color: #0192e2;
    293293}
    294294main.admin-blinkSpeed .icon_container img {
     
    376376}
    377377main.admin-blinkSpeed .bstext-skyblue {
    378     color: #11429C;
     378    color: #0192e2;
    379379}
    380380main.admin-blinkSpeed .bsw-100 {
    381381    width: 100%;
     382}
     383.admin-blinkSpeed .row {
     384    margin: 0;
    382385}
    383386main.admin-blinkSpeed label {
     
    458461}
    459462main.admin-blinkSpeed label.switch input:checked + .checked {
    460     background-color: #11429C;
     463    background-color: #0192e2;
    461464}
    462465main.admin-blinkSpeed .blinkspeed-cdn .bsd-flex.gap20,
     
    486489    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512' height='13' width='13' fill='%23fff'%3E%3Cpath d='M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 108.4c12.5-12.5 32.8-12.5 45.3 0z'/%3E%3C/svg%3E");
    487490    padding: 2px;
    488     background: #11429C;
     491    background: #0192e2;
    489492    line-height: 16px;
    490493    position: absolute;
    491494    left: 0;
    492495    top: 0;
    493     border: 1px solid #11429C;
     496    border: 1px solid #0192e2;
    494497}
    495498main.admin-blinkSpeed input[type="checkbox"]:focus,
     
    528531    font-family: 'FontAwesome';
    529532    font-size: 22px;
    530     color: #11429C;
     533    color: #0192e2;
    531534    font-weight: 700;
    532535}
     
    585588    position: sticky;
    586589    top: 50px;
     590    background: linear-gradient(57deg, hsl(203, 100%, 46%), hsl(142, 76%, 36%));
     591    padding: 0;
    587592}
    588593main.admin-blinkSpeed .tab-content > section {
     
    624629    user-select: none;
    625630    /* background-color: transparent; */
    626     background: #11429C;
     631    background: #0192e2;
    627632    border: 1px solid transparent;
    628633    padding: 6px 12px;
     
    678683main.admin-blinkSpeed textarea:focus {
    679684    box-shadow: none !important;
    680     border-color: #11429C !important;
     685    border-color: #0192e2 !important;
    681686}
    682687
     
    699704    line-height: normal;
    700705}
    701 
     706.blinkspeed_optimize_ai span.new-feature {
     707    display: none;
     708}
    702709main.admin-blinkSpeed small.default-fn {
    703710    font-size: 15px;
    704711}
    705712main.admin-blinkSpeed textarea.hook_before_start.error_textarea,main.admin-blinkSpeed .CodeMirror.cm-s-default.CodeMirror-wrap.error_textarea {
    706         border: 1px solid red;
    707     }
    708 
    709     main.admin-blinkSpeed img.loader-img {
    710         max-width: 26px;
    711         border-radius: 50%;
    712     }
    713     main.admin-blinkSpeed small.extra-small {
    714         /* font-size: 85%; */
    715         color: #11429C;
    716     }
    717     main.admin-blinkSpeed .single-hook > label {
    718         margin-bottom: 5px;
    719         display: block;
    720     }
    721     main.admin-blinkSpeed .single-hook code {
    722         margin: 5px 0;
    723         display: inline-block;
    724         background-color: transparent;
    725     }
    726     main.admin-blinkSpeed .single-hook textarea{
    727         display: block;
    728     }
    729     main.admin-blinkSpeed .single-hook span.blinkspeed-info-display {
    730         font-size: 14px;
    731         font-weight: normal;
    732         letter-spacing: 0.5px;
    733         padding: 10px;
    734         /* width: max-content; */
    735     }
    736     main.admin-blinkSpeed .single-hook span.blinkspeed-info-display p {
    737         margin-bottom: 5px;
    738     }
    739     main.admin-blinkSpeed span.progress-percent {
    740         font-size: 14px;
    741     }
    742     /* .cdn_resources textarea {
    743         min-width: 100px;
    744         height: 35px;
    745         resize: vertical;
    746         overflow-y: auto;
    747         margin: 5px 0;
    748     } */
    749     main.admin-blinkSpeed input#cache_path + small {
     713    border: 1px solid red;
     714}
     715
     716main.admin-blinkSpeed img.loader-img {
     717    max-width: 26px;
     718    border-radius: 50%;
     719}
     720main.admin-blinkSpeed small.extra-small {
     721    /* font-size: 85%; */
     722    color: #0192e2;
     723}
     724main.admin-blinkSpeed .single-hook > label {
     725    margin-bottom: 5px;
     726    display: block;
     727}
     728main.admin-blinkSpeed .single-hook code {
     729    margin: 5px 0;
     730    display: inline-block;
     731    background-color: transparent;
     732}
     733main.admin-blinkSpeed .single-hook textarea{
     734    display: block;
     735}
     736main.admin-blinkSpeed .single-hook span.blinkspeed-info-display {
     737    font-size: 14px;
     738    font-weight: normal;
     739    letter-spacing: 0.5px;
     740    padding: 10px;
     741    /* width: max-content; */
     742}
     743main.admin-blinkSpeed .single-hook span.blinkspeed-info-display p {
     744    margin-bottom: 5px;
     745}
     746main.admin-blinkSpeed span.progress-percent {
     747    font-size: 14px;
     748}
     749/* .cdn_resources textarea {
     750    min-width: 100px;
     751    height: 35px;
     752    resize: vertical;
     753    overflow-y: auto;
     754    margin: 5px 0;
     755} */
     756main.admin-blinkSpeed input#cache_path + small {
    750757    word-break: break-word;
    751758}
     
    778785}
    779786main.admin-blinkSpeed .logo_container {
    780     background: #1d212a;
     787    background: transparent;
    781788    padding-top: 15px;
     789    text-align: center;
    782790}
    783791
    784792main.admin-blinkSpeed .logo_container img.logo {
    785793    width: 100%;
    786     max-width: 250px;
     794    max-width: 230px;
    787795}
    788796
     
    860868}
    861869main.admin-blinkSpeed .search_hooks > button.clear_field svg {
    862     fill: #11429C;
     870    fill: #0192e2;
    863871}
    864872main.admin-blinkSpeed .advance-cache-exist-error,
     
    904912main.admin-blinkSpeed .search_hooks input.pl_search_field {
    905913    font-size: 16px;
    906     border: 1px solid #11429C;
     914    border: 1px solid #0192e2;
    907915    padding: 8px 12px;
    908     color: #11429C;
     916    color: #0192e2;
    909917    line-height: normal;
    910918}
    911919main.admin-blinkSpeed .search_hooks input.pl_search_field::placeholder {
    912     color: #11429C;
     920    color: #0192e2;
    913921    font-style: italic;
    914922    letter-spacing:.5px
     
    10361044    border: none;
    10371045    text-decoration: underline;
    1038     color: #11429C;
     1046    color: #0192e2;
    10391047    padding: 0;
    10401048    font-weight: 500;
     
    11381146    main.admin-blinkSpeed .tab-panel {
    11391147        width: 100%;
    1140         max-width: 290px;
     1148        max-width: 260px;
    11411149    }
    11421150    /*.tab-content  {
     
    12241232    }
    12251233    main.admin-blinkSpeed .support_section {
    1226         display: block;
     1234        display: flex;
    12271235        padding: 0;
    12281236        border-radius: 0;
    12291237        background: no-repeat;
     1238        flex-direction: column;
     1239        align-items: center;
    12301240    }
    12311241    main.admin-blinkSpeed .support_section a {
     
    12391249        align-items: center;
    12401250        justify-content: center;
    1241         margin: 20px 8px;
     1251        margin: 10px 8px 10px;
    12421252        background-image: linear-gradient(45deg, #24a4cc, #1286da) !important;
    12431253        position: relative;
     
    12451255        text-indent: -18px;
    12461256    }
     1257   
    12471258    main.admin-blinkSpeed .support_section a.doc.btn i:before {
    12481259        content: "\f0f6 ";
     
    12641275        transform: translate(-50%, -50%);
    12651276        animation: ring 2s infinite;
    1266       }
     1277    }
    12671278     
    1268       @keyframes ring {
     1279    @keyframes ring {
    12691280        0% {
    12701281          box-shadow:0 0 0 0px rgb(25 146 213);
     
    12731284          box-shadow:0 0 0 10px rgb(239 74 41 / 0%)
    12741285        }
    1275       }
     1286    }
     1287    main.admin-blinkSpeed .logo_container img.logo {
     1288        max-width: 70px;
     1289        object-fit: contain;
     1290    }
    12761291}
    12771292
     
    14831498main.admin-blinkSpeed button.btn.btn-rem-filter {
    14841499    background: transparent;
    1485     color: #11429C !important;
     1500    color: #0192e2 !important;
    14861501    border: 1px solid;
    14871502}
     
    15781593main.admin-blinkSpeed .pagination button.active,
    15791594main.admin-blinkSpeed .pagination button:hover {
    1580     background-image: linear-gradient(90deg, #11429C, #11429C);
     1595    background-image: linear-gradient(90deg, #0192e2, #0192e2);
    15811596    color: #fff;
    1582     border-color: #11429C;
     1597    border-color: #0192e2;
    15831598}
    15841599main.admin-blinkSpeed button#btn.expend-textarea {
     
    15861601    border: none;
    15871602    fill: #fff;
    1588     background-image: linear-gradient(90deg, #11429C, #11429C);
     1603    background-image: linear-gradient(90deg, #0192e2, #0192e2);
    15891604    height: 40px;
    15901605    width: 40px;
     
    17171732  height: 40px;
    17181733  background: conic-gradient(
    1719     #11429C calc(var(--percentage) * 1%),
     1734    #0192e2 calc(var(--percentage) * 1%),
    17201735    rgba(17, 66, 156, 0.1) calc(var(--percentage) * 1%)
    17211736  );
     
    17411756  position: absolute;
    17421757  font-weight: 600;
    1743   color: #11429C;
     1758  color: #0192e2;
    17441759  text-align: center;
    17451760  z-index: 2;
     
    17751790  }
    17761791}
    1777 
     1792#blinkspeedChangeLog > .bsd-flex {
     1793    margin-bottom: 16px;
     1794}
    17781795main.admin-blinkSpeed .cst-loader-container.no-animate .cst-loader::before{
    17791796  animation: none;
     
    17971814main.admin-blinkSpeed a.n_help_a {
    17981815    margin-right: 70px;
    1799     /* background: #11429C; */
    1800     background: linear-gradient(90deg, #11429C 30%, #11429C 100%);
     1816    /* background: #0192e2; */
     1817    background: linear-gradient(90deg, #0192e2 30%, #0192e2 100%);
    18011818    color: #fff;
    18021819    padding: 8px;
     
    18541871.admin-blinkSpeed :is(:focus, :focus-visible) {
    18551872    box-shadow: none !important;
    1856     border-color: #11429C !important;
     1873    border-color: #0192e2 !important;
    18571874    outline: none;
    18581875}
     
    22182235}
    22192236main.admin-blinkSpeed .selected-item {
    2220     background-color: #11429C;
     2237    background-color: #0192e2;
    22212238}
    22222239main.admin-blinkSpeed .selected-item button {
  • blinkspeed/trunk/assets/js/bs-admin-core.js

    r3478468 r3481926  
    104104
    105105    jQuery("ul.blinkSpeednav li a").click(function (e) {
    106 
    107106        e.preventDefault();
    108107        var url = document.location.href;
     
    110109        var updatedUrl = updateQueryStringParameter(url, 'tab', newTab);
    111110        history.pushState({}, '', updatedUrl);
     111        jQuery('.blinkSpeednav li').removeClass('active');
     112        jQuery(this).parent().addClass('active in');
    112113        jQuery('.tab-pane').removeClass('active in');
    113114        jQuery('#' + newTab).addClass('active in');
    114115    });
     116
    115117    var hash = window.location.href.match(/[?&]tab=([^&]+)/);
    116118    if (hash && hash[1] && hash[1].length > 0) {
     
    118120        jQuery('#' + hash[1]).addClass('active in');
    119121    }
    120 
    121122
    122123    function updateQueryStringParameter(uri, key, value) {
  • blinkspeed/trunk/blinkspeed.php

    r3478468 r3481926  
    33 * Plugin Name: BlinkSpeed
    44 * Description: Boost your WordPress site speed with advanced AI optimization techniques. Improve Core Web Vitals, achieve higher scores on Google PageSpeed Insights and GTmetrix, and deliver a faster, smoother browsing experience for your visitors.
    5  * Version: 1.0.4
     5 * Version: 1.0.5
    66 * Author: BlinkSpeed
    77 * Author URI: https://blinkspeed.ai/
     
    2424
    2525// Define plugin constants
    26 define( 'BLINKSPEED_VERSION', '1.0.4' );
     26define( 'BLINKSPEED_VERSION', '1.0.5' );
    2727define( 'BLINKSPEED_FILE', __FILE__ );
    2828define( 'BLINKSPEED_DIR', plugin_dir_path( __FILE__ ) );
  • blinkspeed/trunk/includes/Core.php

    r3478468 r3481926  
    944944            $ignore_critical_css = $this->blinkspeed_check_ignore_critical_css_callback($this->addSettings['full_url'],$ignore_critical_css);
    945945        }
     946
     947        $ignore_critical_css = $this->blinkspeed_no_critical_css($ignore_critical_css, $this->addSettings['full_url']);
    946948       
    947949        $this->addSettings['ignoreCriticalCss'] = $ignore_critical_css;
     
    13131315                $img_obj['src'] = 'about:blank';
    13141316                $img_obj['data-class'] = 'LazyLoad';
    1315                 $this->blinkspeed_str_replace_set_img($img, $this->blinkspeed_implode_link_array('iframe', $img_obj) . $iframe_html);
     1317
     1318                $iframe_lazy = 0;
     1319                $iframe_lazy = $this->blinkspeed_change_iframe_to_iframe_lazy($iframe_lazy);
     1320
     1321                if($iframe_lazy){
     1322                    $this->blinkspeed_str_replace_set_img($img, $this->blinkspeed_implode_link_array('iframelazy', $img_obj) . $iframe_html);
     1323                } else {
     1324                    $this->blinkspeed_str_replace_set_img($img, $this->blinkspeed_implode_link_array('iframe', $img_obj) . $iframe_html);
     1325                }
    13161326            }
    13171327        }
     
    13671377                );
    13681378                $video_new = str_replace('<video ', '<video data-class="LazyLoad" ', $video_new);
     1379
     1380                $videolazy = 0;
     1381                $videolazy = $this->blinkspeed_change_video_to_videolazy($videolazy);
     1382                // Apply videolazy conversion if enabled
     1383                if ($videolazy) {
     1384                    $video_new = str_replace(array('<video', '</video>'), array('<videolazy', '</videolazy>'), $video_new);
     1385                }
    13691386
    13701387                $videoObj = $this->blinkspeed_parse_link('video', $video);
     
    15671584                   
    15681585                    // Handle mobile responsive images
    1569                     if (!empty($this->addSettings['is_mobile']) && !empty($this->settings['resp_bg_img'])) {
     1586                    if (!empty($this->addSettings['is_mobile']) && !empty($this->settings['resp_bg_img']) && !$this->blinkspeed_exclude_image_from_convert_to_webp($imgsrc_filepath)) {
    15701587                        if (!empty($img_size[0]) && $img_size[0] > 600) {
    15711588                            [$imgnn_arr, $imgsrc_filepath] = $this->blinkspeed_convert_to_smaller_image($img_root_path, $imgsrc_filepath, $imgnn_arr);
     
    15811598                   
    15821599                    // Handle WebP conversion
    1583                     if (count($webp_enable) > 0 && in_array($blinkSpeed_img_ext, $webp_enable)) {
     1600                    if (count($webp_enable) > 0 && in_array($blinkSpeed_img_ext, $webp_enable) && !$this->blinkspeed_exclude_image_from_convert_to_webp($imgsrc_filepath)) {
    15841601                        $imgsrc_webpfilepath = $this->blinkspeed_get_img_webp_path($img_root_path, $imgsrc_filepath);
    15851602                        if (file_exists($imgsrc_webpfilepath)) {
     
    16291646                        $this->addSettings['preload_resources']['all'][] = $imgSrcArr['path'];
    16301647                    }
     1648
     1649                    $imgnn = $this->blinkspeed_customize_image($imgnn, $img, $imgnn_arr);
    16311650                   
    16321651                    // Set high priority loading for excluded images
     
    16661685                    }
    16671686                }
     1687
     1688                $imgnn = $this->blinkspeed_customize_image($imgnn, $img, $imgnn_arr);
    16681689               
    16691690                $this->blinkspeed_str_replace_set_img($img, $imgnn);
     
    20292050            $exclude_image = 1;
    20302051        }
     2052        $exclude_image = $this->blinkspeed_exclude_image_to_lazyload($exclude_image, $img, $imgnn_arr);
    20312053        return $exclude_image;
    20322054    }
     
    22442266                    $critical_css = $this->blinkspeed_get_contents($this->blinkspeed_preload_css_path() . '/' . $this->addSettings['critical_css']);
    22452267                    if (!empty($critical_css)) {
     2268                        $critical_css = $this->blinkspeed_customize_critical_css($critical_css);
    22462269                        $criticalCssInsertion = 1;
    22472270                        $critical_css_modified = $this->blinkspeed_convert_webp_in_critical($critical_css);
     
    27872810        }
    27882811        $url = $this->blinkspeed_preload_css_customize_path($url);
     2812        $url = $this->blinkspeed_customize_critical_css_url($url, $orgurl);
    27892813        $full_url = str_replace($this->addSettings['secure'], '', rtrim($url, '/'));
    27902814        $path = urldecode($this->blinkspeed_get_critical_cache_path($full_url));
     
    28412865        $file_name = count($combined_css_files);
    28422866        $main_css_file_name = md5($file_name) . $this->addSettings['css_ext'];
     2867        $main_css_file_name = $this->blinkspeed_customize_critical_css_filename($main_css_file_name, $combined_css_files);
    28432868        return $main_css_file_name;
    28442869    }
     
    53045329        }
    53055330    }
     5331
     5332    public function blinkspeed_apply_pre_optimization_hooks() {
     5333        $this->html = apply_filters('blinkspeed_apply_pre_optimization_hooks', $this->html);
     5334    }
     5335
     5336    public function blinkspeed_apply_before_optimization_hooks() {
     5337        $this->html = apply_filters('blinkspeed_apply_before_optimization_hooks', $this->html);
     5338    }
     5339
     5340    public function blinkspeed_apply_after_optimization_hooks() {
     5341        $this->html = apply_filters('blinkspeed_apply_after_optimization_hooks', $this->html);
     5342    }
     5343
     5344    public function blinkspeed_inner_js_customize($script_text) {
     5345        return apply_filters('blinkspeed_inner_js_customize', $script_text);
     5346    }
     5347
     5348    public function blinkspeed_inner_js_excluded($exclude_js_bool, $inner_js) {
     5349        return apply_filters('blinkspeed_inner_js_excluded', $exclude_js_bool, $inner_js);
     5350    }
     5351
     5352    public function blinkspeed_internal_js_customize($string, $path) {
     5353        return apply_filters('blinkspeed_internal_js_customize', $string, $path);
     5354    }
     5355
     5356    public function blinkspeed_internal_css_customize($css, $path) {
     5357        return apply_filters('blinkspeed_internal_css_customize', $css, $path);
     5358    }
     5359
     5360    public function blinkspeed_internal_css_minify($css_minify, $css, $path) {
     5361        return apply_filters('blinkspeed_internal_css_minify', $css_minify, $css, $path);
     5362    }
     5363
     5364    public function blinkspeed_no_critical_css($ignore_critical_css, $url) {
     5365        return apply_filters('blinkspeed_no_critical_css', $ignore_critical_css, $url);
     5366    }
     5367
     5368    public function blinkspeed_customize_critical_css($critical_css) {
     5369        return apply_filters('blinkspeed_customize_critical_css', $critical_css);
     5370    }
     5371
     5372    public function blinkspeed_disable_htaccess_webp() {
     5373        $this->addSettings['disable_htaccess_webp'] = apply_filters('blinkspeed_disable_htaccess_webp', $this->settings['hook_disable_htaccess_webp']);
     5374    }
     5375
     5376    public function blinkspeed_customize_add_settings($addSettings) {
     5377        return apply_filters('blinkspeed_customize_add_settings', $addSettings);
     5378    }
     5379
     5380    public function blinkspeed_customize_main_settings($settings) {
     5381        return apply_filters('blinkspeed_customize_main_settings', $settings);
     5382    }
     5383
     5384    public function blinkspeed_change_video_to_videolazy($video_lazy) {
     5385        return apply_filters('blinkspeed_change_video_to_videolazy', $video_lazy);
     5386    }
     5387
     5388    public function blinkspeed_change_iframe_to_iframe_lazy($iframe_lazy) {
     5389        return apply_filters('blinkspeed_change_iframe_to_iframe_lazy', $iframe_lazy);
     5390    }
     5391
     5392    public function blinkspeed_exclude_image_to_lazyload($exclude_image, $img, $imgnn_arr) {
     5393        return apply_filters('blinkspeed_exclude_image_to_lazyload', $exclude_image, $img, $imgnn_arr);
     5394    }
     5395
     5396    public function blinkspeed_customize_image($imgnn, $img, $imgnn_arr) {
     5397        return apply_filters('blinkspeed_customize_image', $imgnn, $img, $imgnn_arr);
     5398    }
     5399
     5400    public function blinkspeed_exclude_css_filter($exclude_css, $css_obj, $css, $html) {
     5401        return apply_filters('blinkspeed_exclude_css_filter', $exclude_css, $css_obj, $css, $html);
     5402    }
     5403
     5404    public function blinkspeed_customize_force_lazy_css($force_lazyload_css) {
     5405        return apply_filters('blinkspeed_customize_force_lazy_css', $force_lazyload_css);
     5406    }
     5407
     5408    public function blinkspeed_external_javascript_customize($script_obj, $script) {
     5409        return apply_filters('blinkspeed_external_javascript_customize', $script_obj, $script);
     5410    }
     5411
     5412    public function blinkspeed_external_javascript_filter($exclude_js,$script_obj,$script,$html) {
     5413        return apply_filters('blinkspeed_external_javascript_filter', $exclude_js,$script_obj,$script,$html);
     5414    }
     5415
     5416    public function blinkspeed_customize_script_object($script_obj, $script) {
     5417        return apply_filters('blinkspeed_customize_script_object', $script_obj, $script);
     5418    }
     5419
     5420    public function blinkspeed_exclude_internal_js_changes($exclude_from_blinkspeed_changes, $path, $string) {
     5421        return apply_filters('blinkspeed_exclude_internal_js_changes', $exclude_from_blinkspeed_changes, $path, $string);
     5422    }
     5423
     5424    public function blinkspeed_exclude_page_optimization($html) {
     5425        $exclude_page_optimization = 0;
     5426        $exclude_page_optimization = apply_filters('blinkspeed_exclude_page_optimization', $exclude_page_optimization, $html);
     5427        if ( $exclude_page_optimization ) {
     5428            return true;
     5429        }
     5430        return false;
     5431    }
     5432
     5433    public function blinkspeed_customize_critical_css_url($url, $orgurl) {
     5434        return apply_filters('blinkspeed_customize_critical_css_url', $url, $orgurl);
     5435    }
     5436
     5437    public function blinkspeed_customize_critical_css_filename($main_css_file_name, $combined_css_files) {
     5438        return apply_filters('blinkspeed_customize_critical_css_filename', $main_css_file_name, $combined_css_files);
     5439    }
     5440
     5441    public function blinkspeed_exclude_image_from_convert_to_webp($path) {
     5442        return apply_filters('blinkspeed_exclude_image_from_convert_to_webp', false, $path);
     5443    }
    53065444}
  • blinkspeed/trunk/includes/CssOptimize.php

    r3478468 r3481926  
    182182                continue;
    183183            }
    184             if(in_array($ext, ['.jpg', '.webp', '.jpeg', '.png'])){
     184            if(in_array($ext, ['.jpg', '.webp', '.jpeg', '.png']) && !$this->blinkspeed_exclude_image_from_convert_to_webp($match1)){
    185185                list($img_root_path, $img_root_url) = $this->blinkspeed_get_img_root_path();
    186186                $webp_enable = $this->addSettings['webp_enable'];
     
    260260        if( !file_exists($cache_file_path) ){
    261261            $css = $this->blinkspeed_get_contents($root_path.$path);
     262            $css = $this->blinkspeed_internal_css_customize($css, $path);
    262263
    263264            $css = $this->blinkspeed_remove_css_comments($css);
     
    265266            $css_minify = 1;
    266267           
     268            $css_minify = $this->blinkspeed_internal_css_minify($css_minify, $css, $path);
    267269            if($css_minify){
    268270                $minify = $this->blinkspeed_css_compress($minify);
     
    303305            }
    304306            $force_lazyload_css = !empty($this->settings['force_lazyload_css']) && is_array($this->settings['force_lazyload_css']) ? $this->settings['force_lazyload_css'] : array();
    305             $force_lazyload_css = $force_lazyload_css;
     307
     308            $force_lazyload_css = $this->blinkspeed_customize_force_lazy_css($force_lazyload_css);
    306309
    307310            $enable_cdn = $this->blinkspeed_check_enable_cdn('css');
     
    558561        }
    559562
     563        $exclude_css = $this->blinkspeed_exclude_css_filter($exclude_css,$css_obj,$css,$this->html);
     564
    560565        if($exclude_css){
    561566            if($this->blinkspeed_endswith($css_obj['href'], '.css')){
  • blinkspeed/trunk/includes/HtmlOptimize.php

    r3478468 r3481926  
    7272        // Set cache file path
    7373        $this->blinkspeed_set_cache_file_path();
     74
     75        $this->blinkspeed_apply_pre_optimization_hooks();
    7476       
    7577        // Check if optimization should be skipped
     
    8082            return $this->html;
    8183        }
     84
     85        // Apply customization hooks
     86        $this->blinkspeed_apply_customization_hooks();
    8287       
    8388        // Clean script tags
    8489        $this->html = $this->blinkspeed_clean_script_tags( $this->html );
     90
     91        $this->blinkspeed_apply_before_optimization_hooks();
    8592       
    8693        // Handle lazy loading for background images
     
    131138        // Performance timing for BS script
    132139        $this->blinkspeed_debug_time( 'bs script' );
     140
     141        $this->blinkspeed_apply_after_optimization_hooks();
    133142       
    134143        // Handle HTML caching
     
    216225        // Check admin user status
    217226        if ( $this->addSettings['admin_user'] ) {
     227            return 1;
     228        }
     229
     230        if ($this->blinkspeed_exclude_page_optimization( $this->html ) ) {
    218231            return 1;
    219232        }
     
    275288            $this->blinkspeed_create_html_cache_file();
    276289        }
     290    }
     291
     292    /**
     293     * Apply customization hooks
     294     *
     295     * Executes hooks for customizing addSettings and main settings.
     296     */
     297    private function blinkspeed_apply_customization_hooks(){
     298        // Customize addSettings
     299        $this->addSettings = $this->blinkspeed_customize_add_settings($this->addSettings);
     300
     301        // Customize settings
     302        $this->settings = $this->blinkspeed_customize_main_settings($this->settings);
     303
     304        // Apply custom htaccess webp hook
     305        $this->blinkspeed_disable_htaccess_webp();
    277306    }
    278307
  • blinkspeed/trunk/includes/JsOptimize.php

    r3478468 r3481926  
    4444        if(!empty($this->settings['load_combined_js'])){
    4545            $exclude_from_blinkspeed_changes = 0;
     46            $exclude_from_blinkspeed_changes = $this->blinkspeed_exclude_internal_js_changes($exclude_from_blinkspeed_changes, $path,$string);
    4647            if(stripos($string,'holdready') === false && !$exclude_from_blinkspeed_changes){
    4748                $string = $this->blinkspeed_changes_in_js($string,$path);
    4849            }
    4950        }
     51       
     52        $string = $this->blinkspeed_internal_js_customize($string, $path);
    5053        return $string;
    5154    }
     
    170173                    continue;
    171174                }
     175
     176                $script_obj = $this->blinkspeed_customize_script_object($script_obj, $script);
    172177               
    173178                if(!empty($script_obj['src'])){
     
    199204                        }
    200205                    }
    201                     if(function_exists('blinkspeed_exclude_javascript_filter')){
    202                         $exclude_js = blinkspeed_exclude_javascript_filter($exclude_js,$script_obj,$script,$this->html);
    203                     }
     206
     207                    $exclude_js = $this->blinkspeed_external_javascript_filter($exclude_js,$script_obj,$script,$html);
    204208                   
    205209                    if($exclude_js){
     
    272276                        $script_obj['src'] = $enable_cdn && $enable_cdn_path ? str_replace($this->addSettings['site_url'],$this->addSettings['js_cdn_url'] ,$script_obj['src']) : $script_obj['src'];
    273277                        $script_obj['type'] = 'lazyExJs';
     278                        $script_obj = $this->blinkspeed_external_javascript_customize($script_obj, $script);
    274279                        $this->blinkspeed_preconnect_external_url($script_obj['src']);
    275280                        $this->blinkspeed_str_replace_set_js($script,$this->blinkspeed_implode_link_array('script',$script_obj));
     
    314319     */
    315320    public function blinkspeed_get_modified_script_tag( $script, $script_obj, $script_text, $si, $exclude_js_bool, $force_js_bool ) {
     321        $script_text = $this->blinkspeed_inner_js_customize($script_text);
     322
    316323        if($tag = $this->blinkspeed_load_script_tag_in_url($script_text,$si)){
    317324            $this->blinkspeed_get_url_from_inline_script($script);
     
    418425            }
    419426        }
     427        $exclude_js_bool = $this->blinkspeed_inner_js_excluded($exclude_js_bool, $inner_js);
    420428        return $exclude_js_bool;
    421429    }
  • blinkspeed/trunk/languages/blinkspeed.pot

    r3478468 r3481926  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: BlinkSpeed 1.0.4\n"
     5"Project-Id-Version: BlinkSpeed 1.0.5\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/blinkspeed/\n"
    77"POT-Creation-Date: 2026-02-04 00:00+0000\n"
Note: See TracChangeset for help on using the changeset viewer.