• Resolved roadlink

    (@roadlink)


    Hi there,
    It seems your plugin blocks this feature.
    https://web.dev/articles/bfcache?utm_source=devtools

    I have below error when I test it as explained in here. BFCache Explained: Verify on your WordPress site (youtube.com)

    “Pages that use WebAuthetication API are not eligible for back/forward cache.”

    Can you check and fix if possible?

    Chat gpt’s suggestion

    4. Modify Plugin or Theme Code for Conditional Loading

    a. Enqueue Scripts Conditionally:

    • Action Steps:
      • Edit the plugin or theme files to load WebAuthn scripts only on necessary pages (e.g., login or account pages).
      • Example in functions.php:phpCopy codefunction conditional_webauthn_scripts() { if ( is_page('login') || is_account_page() ) { // Enqueue WebAuthn script wp_enqueue_script( 'webauthn-script', plugin_dir_url( __FILE__ ) . 'js/webauthn.js', array(), '1.0.0', true ); } } add_action( 'wp_enqueue_scripts', 'conditional_webauthn_scripts' );
      • Note: Replace 'js/webauthn.js' with the actual path to the WebAuthn script.

    b. Defer Initialization:

    • Initialize WebAuthn functionality only when the user interacts with specific elements.javascriptCopy codedocument.getElementById('login-button').addEventListener('click', function() { // Initialize WebAuthn here });
Viewing 1 replies (of 1 total)
  • Plugin Contributor robertabela

    (@robert681)

    Thank you for trying our plugin roadlink.

    Can you please share more details about this so we can better understand the context? As in:

    1. What version of the plugin and WordPress are you using?
    2. How are you reproducing this? I am presuming you are enabling our plugin, but when exactly do you see this error?
    3. Have you enabled any specific settings in the brower?

    The more information you can share with us the better we can understand this.

    Looking forward to hearing from you.

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