Tofandel
Forum Replies Created
-
Forum: Plugins
In reply to: [Fast Velocity Minify] Invalid css minificationAnd on line 1022 there is an undefined variable
$tvers
Line 1487 there is an undefined variable$cache_methodForum: Plugins
In reply to: [Fast Velocity Minify] Invalid css minificationAlso completely unrelated, I was reading the source to locate the error, and there is an error in common.php
$purge_savvii = new \Savvii\CacheFlusherPlugin(); if ( method_exists( $plugin, 'domainflush' ) ) { $purge_savvii->domainflush(); return __( 'A cache purge request has been sent to <strong>Savvii</strong>', 'fast-velocity-minify' ); }$pluginin method_exists should be$purge_savviAnd your answer is completely unrelated to what I explained…
I’m saying that when the integration is enabled API calls are being made to cloudlfare on each request… And those api calls are synchronous so blocking script execution, which means that every non cached page gets an increase of 4s TTFBcloudflare_get_zone_id + cloudflare_clear_cache is executed twice on each page because a non cached post is being updated (eg when adding to the cart, passing an order, posting a comment), the result of the first request can easily and SHOULD BE cached, as for the cache clear it should be proxied and register a wordpress cron job to execute the api call on the next cron run, not in sync with the request or the user is subject to terrible waiting times
Another possibility way easier to implement than cron job is to modify the function so that it is non blocking and runs only once
public static function cloudflare_clear_cache($email = false, $key = false, $zoneid = false){ static $executed = false; //diff if ($executed) { //diff return; } if(!$email && !$key && !$zoneid){ if($cdn_values = get_option("WpFastestCacheCDN")){ $std_obj = json_decode($cdn_values); foreach ($std_obj as $key => $value) { if($value->id == "cloudflare"){ $email = $value->cdnurl; $key = $value->originurl; break; } } if($email && $key){ $zone = self::cloudflare_get_zone_id($email, $key, false); if($zone["success"]){ $zoneid = $zone["zoneid"]; } } } } if($email && $key && $zoneid){ $header = array("method" => "DELETE", 'headers' => array( "X-Auth-Email" => $email, "X-Auth-Key" => $key, "Content-Type" => "application/json" ), "blocking" => false, //diff "body" => '{"purge_everything":true}' ); wp_remote_request('https://api.cloudflare.com/client/v4/zones/'.$zoneid.'/purge_cache', $header); $executed = true; //diff } }Until this is solved, the cloudflare cache integration is unusable.
Forum: Plugins
In reply to: [Redirection for Contact Form 7] Issue with WPMLA pull request has been submitted as well
Hello,
I’m using phpstorm as my IDE (not free but there is a 30 days free trial), the code analysis and autoformating are really good
Thank you