Plugin Directory

Changeset 2513631


Ignore:
Timestamp:
04/12/2021 11:11:40 PM (5 years ago)
Author:
optipic
Message:

v1.13.1

Location:
optipic
Files:
15 added
4 edited

Legend:

Unmodified
Added
Removed
  • optipic/trunk/includes/optipic-cdn-php/ImgUrlConverter.php

    r2468687 r2513631  
    292292        $replaceWithoutOptiPic = $matches[0];
    293293       
     294        // skip images from json (json-encoded)
     295        if(stripos($replaceWithoutOptiPic, "\\/")!==false) {
     296            return $replaceWithoutOptiPic;
     297        }
     298       
    294299        $urlOriginal = $matches[2];
    295300       
     
    299304            if(!in_array($parseUrl['host'], self::$domains)) {
    300305                self::log($urlOriginal, 'callbackForPregReplace -> url original:');
    301                 self::log($replaceWithOptiPic, 'callbackForPregReplace -> url with optipic:');
     306                self::log($replaceWithoutOptiPic, 'callbackForPregReplace -> url with optipic:');
    302307                return $replaceWithoutOptiPic;
    303308            }
  • optipic/trunk/includes/settings.php

    r2468687 r2513631  
    8585
    8686<?
    87 $siteId = !empty($optipic_options['cdn_site_id'])? $optipic_options['cdn_site_id']: '';
     87$siteId = !empty($optipic_options['cdn_site_id'])? $optipic_options['cdn_site_id']: ''; 
    8888?>
    89 <script src="https://optipic.io/api/cp/stat?domain=<?=$_SERVER["HTTP_HOST"]?>&sid=<?=$siteId?>&cms=wordpress&stype=cdn&append_to=<?=urlencode("#optipic-settings-form-wrap")?>&version=1.13.0"></script>
     89<script src="https://optipic.io/api/cp/stat?domain=<?=$_SERVER["HTTP_HOST"]?>&sid=<?=$siteId?>&cms=wordpress&stype=cdn&append_to=<?=urlencode("#optipic-settings-form-wrap")?>&version=1.13.1"></script>
  • optipic/trunk/optipic.php

    r2468687 r2513631  
    5454}
    5555
    56 add_filter( 'template_include', 'optipic_load_template' );
     56//add_filter( 'template_include', 'optipic_load_template' );
    5757function optipic_load_template( $template ) {
    5858    define('OPTIPIC_LOAD_TEMPLATE_PATH', $template);
     
    6767}
    6868
     69function optipic_shutdown_action() {
     70    $final = '';
     71
     72    // We'll need to get the number of ob levels we're in, so that we can iterate over each, collecting
     73    // that buffer's output into the final output.
     74    $levels = ob_get_level();
     75
     76    for ($i = 0; $i < $levels; $i++) {
     77        $final .= ob_get_clean();
     78    }
     79
     80    // Apply any filters to the final output
     81    //echo apply_filters('final_output', $final);
     82    echo optipic_change_content($final);
     83}
     84
     85// https://stackoverflow.com/questions/772510/wordpress-filter-to-modify-final-html-output
     86if(!is_admin() && !defined('DOING_CRON')) {
     87    ob_start();
     88    add_action('shutdown', 'optipic_shutdown_action', 0);
     89}
     90
     91/*add_filter( 'the_content', 'optipic_change_content', 999999 );*/
     92
     93
     94/*function optipic_the_content($content) {
     95    require_once OPTIPIC_LOAD_TEMPLATE_PATH;
     96}*/
     97
     98//add_filter( 'woocommerce_after_single_product', 'optipic_woocommerce_after_single_product' );
     99
     100/*add_filter( 'woocommerce_product_thumbnails', 'optipic_ob_change_content' );
     101add_filter( 'woocommerce_after_single_product_summary', 'optipic_ob_change_content' );
     102add_filter( 'woocommerce_after_single_product', 'optipic_ob_change_content' );
     103add_filter( 'theme_mod_storefront_sticky_add_to_cart', 'optipic_ob_change_content' );
     104add_filter( 'woocommerce_product_thumbnails', 'optipic_ob_change_content' );
     105add_filter( 'woocommerce_product_thumbnails', 'optipic_ob_change_content' );
     106
     107
     108function optipic_ob_change_content() {
     109    //die("Q");
     110    //ob_start();
     111    $content = ob_get_contents();
     112    ob_end_clean();
     113   
     114    //die("Q");
     115    //var_dump($content);
     116    //exit;
     117
     118    //change content
     119    $content = optipic_change_content($content);
     120    //$content = str_replace('<head>', '<head test="test">', $content);
     121
     122    echo $content;
     123}
     124
     125function optipic_woocommerce_after_single_product() {
     126    //die("Q");
     127    //ob_start();
     128    $content = ob_get_contents();
     129    ob_end_clean();
     130   
     131    //die("Q");
     132    var_dump($content);
     133    exit;
     134
     135    //change content
     136    $content = optipic_change_content($content);
     137    //$content = str_replace('<head>', '<head test="test">', $content);
     138
     139    echo $content;
     140}*/
    69141?>
  • optipic/trunk/readme.txt

    r2468687 r2513631  
    33Tags: optimize images, compress images, convert webp, webp, image optimizer, performance, seo, pagespeed, image size, page speed, page speed insights, speed up wordpress, google page speed, speed, speedup, speed up
    44Requires at least: 4.0
    5 Tested up to: 5.5.3
    6 Stable tag: 1.13.0
     5Tested up to: 5.7
     6Stable tag: 1.13.1
    77License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    88
     
    6464= 1.13.0 =
    6565* Optimized images replacing logic.
     66
     67= 1.13.1 =
     68* Fix for WooCommerce
Note: See TracChangeset for help on using the changeset viewer.