• Resolved hassantafreshi

    (@hassantafreshi)


    As the developer of the?Easy Form Builder plugin, I’m seeking some advice about potential conflicts with Breeze.

    Here is the function I am currently using for internal caching:

    public function get_efbFunction($state) {    if (isset($this->efbFunction)) return $this->efbFunction;    $efbFunctionInstance;    if (false === ($efbFunctionInstance = wp_cache_get('efbFunctionInstance', 'emsfb'))) {        if (!class_exists('Emsfb\efbFunction')) {            require_once(EMSFB_PLUGIN_DIRECTORY . 'includes/functions.php');        }        $efbFunctionInstance = new \Emsfb\efbFunction();        wp_cache_set('efbFunctionInstance', $efbFunctionInstance, 'emsfb', 3600); // 1 hour cache    }    $this->efbFunction = $efbFunctionInstance;    if ($state == 1) return $this->efbFunction;}

    My concern is whether using wp_cache_get and wp_cache_set for internal caching might cause any conflicts with [Breeze – WordPress Cache Plugin]. Has anyone had similar experiences or know of best practices to ensure they work together smoothly?

    Any guidance or insights would be greatly appreciated.

    Thank you for your help!

    Best regards,

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author owaisalam

    (@owaisalam)

    I’ve installed the plugin and conducted some preliminary testing, but I’m uncertain about what specific issues I should be focusing on. Could you provide more details on the exact nature of the problem? Specifically, what kind of conflict is occurring, and what abnormal behavior or symptoms should I be looking for? Any additional guidance on how to identify or reproduce the issue would be greatly appreciated.

    Thread Starter hassantafreshi

    (@hassantafreshi)

    Thank you for your response and review. To facilitate a more thorough examination, please conduct the test on the version available on GitHub at the following link.

    https://github.com/hassantafreshi/easy-form-builder/tree/dev4

    We have communicated with cache plugin developers prior to release to prevent any potential issues. The get_efbFunction is also called when the form is published, and if it causes any problems, it will be with the cache plugin on public pages. My final question is: Does your plugin make any changes or oversee the functionality of the wp_cache_set function that could potentially cause conflicts?

    Thank you.

    Plugin Author owaisalam

    (@owaisalam)

    Thanks for sharing the details. Breeze only caches the rendered page and does not conflict with the wp_cache_set function. Let me explain the functionality of the Breeze caching system. When the Breeze cache system is enabled, the plugin creates a cache of pages visited by users according to the settings applied in Breeze. Throughout this process, Breeze does not conflict with any functions used in the activated theme or other plugins, as you mentioned in your question.

    If you still have any questions, please feel free to ask.

    Thread Starter hassantafreshi

    (@hassantafreshi)

    Thank you for the response. We use the following function to handle page caching with plugins. Do you have a structure similar to other plugins that we can add to solve the caching issue?

    public function cache_cleaner_Efb($page_id){

    if (defined('LSCWP_V') || defined('LSCWP_BASENAME' )){

    //litespeed done

    do_action( 'litespeed_purge_post', $page_id );

    }else if (function_exists('rocket_clean_post')){

    //wp-rocket done

    $r = rocket_clean_post($page_id);

    }elseif (function_exists('wp_cache_post_change')){

    //WP Super Cache done

    //Jetpack done

    $GLOBALS['super_cache_enabled']=1;

    wp_cache_post_change($page_id);

    }elseif(function_exists('autoptimize_filter_js_noptimize ')){

    //auto-Optimize done

    autoptimize_filter_js_exclude(['jquery.min-efb.js','core-efb.js']);

    autoptimize_filter_js_noptimize();

    }elseif(class_exists('WPO_Page_Cache')){

    //WP-Optimize done

    \WPO_Page_Cache::delete_single_post_cache($page_id);

    }elseif(function_exists('w3tc_flush_post')){

    //W3 Total Cache done

    w3tc_flush_post($page_id);

    }elseif(function_exists('wpfc_clear_post_cache_by_id')){

    //WP Fastest Cache done

    wpfc_clear_post_cache_by_id($page_id);

    }elseif(has_action('wphb_clear_page_cache')){

    //Hummingbird done

    do_action( 'wphb_clear_page_cache', $page_id );

    }

    }

    Click here to get the full source code on GitHub..

    Thank you.

    Plugin Author owaisalam

    (@owaisalam)

    It would be great to add the following filter to clear the cache
    do_action(‘breeze_clear_all_cache’);

    Thread Starter hassantafreshi

    (@hassantafreshi)

    Thank you for your assistance, I will added this code , what do you think ?

    elseif(has_action('breeze_clear_all_cache')){
    do_action('breeze_clear_all_cache');
    }
    Plugin Author owaisalam

    (@owaisalam)

    Yes, it seems fine.

    Thread Starter hassantafreshi

    (@hassantafreshi)

    Thank you

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.