Forum Replies Created

Viewing 15 replies - 16 through 30 (of 110 total)
  • Thread Starter the_lar

    (@the_lar)

    Oh I think I’ve found something…

    OK so on my wp_posts_page index – in Algolia under configuration, acf_content is present. However on wp_searchable_posts it’s not!

    I guess that is the reason? But when I try to Add a Searchable attribute in the Algolia admin, acf_content is not available – even though it is present at least on some of the records?

    Any ideas?

    Thread Starter the_lar

    (@the_lar)

    Hi again @tw2113 – sorry, feel like I’m being such a pain but I’m so close!!

    So limiting searchable_posts to just pages now works thanks to the above:

    add_filter( 'algolia_searchable_post_types', function( array $post_types ) {
        $post_types = ['page'];
    
        return $post_types;
    } );

    So now my wp_posts_page index and my wp_searchable_posts index are both the same and just contain pages – so that’s great for now whilst I’m getting up and running.

    The biggie now is that on my Search page, instantsearch is not seeing acf_content which I’ve verified IS present on the searchable_posts index – do I need to configure instantsearch.php somehow so that it searches this field?

    Thread Starter the_lar

    (@the_lar)

    Brill, that works perfectly, thank you @tw2113 ??

    Thread Starter the_lar

    (@the_lar)

    Hi @tw2113 – I’ve made progress but wonder if you can just help me over the line for the last little bit?

    I’m basically cycling through the ACF blocks and sending a new attribute for acf_content to Algolia.

    I have added a word winklepicker to one of the ACF fields because I know that it doesn’t appear elsewhere on the site (I’m pretty certain).

    So I can see that my acf_content and that word is in Algolia’s index:

    And I’ve followed your code on the page you linked and added the following to my filters.php file:

    function my_posts_index_settings( array $settings ) {
    
        // Make Algolia search the 'bio' field when searching for results.
        // Using ordered instead of unordered will make words matching in the beginning of the attribute score higher.
        // @see https://www.algolia.com/doc/api-reference/api-parameters/searchableAttributes/
        $settings['searchableAttributes'][] = 'unordered(acf_content)';
    
        // Make Algolia return a pre-computed snippet of 50 chars as part of the result set.
        // @see https://www.algolia.com/doc/api-reference/api-parameters/#highlighting-snippeting
        $settings['attributesToSnippet'][] = 'acf_content:50';
    
        // Always return the value we are filtering.
        return $settings;
    }
    add_filter( 'algolia_posts_page_index_settings', '\App\my_posts_index_settings' );

    I then pushed my settings for Pages (it’s the homepage that has the word winklepicker on it)

    So when I type ‘winklepicker’ into my search bar, my homepage is the only result – which is great, so that part works. The issue I have is that it’s not displaying the snippet with the matched word highlighted:

    If it helps, here is the response I am getting in the Firefox console:

    {
      "hits": [
        {
          "post_id": 25,
          "post_type": "page",
          "post_type_label": "Pages",
          "post_title": "Home",
          "post_excerpt": "",
          "post_date": 1564497883,
          "post_date_formatted": "30th July 2019",
          "post_modified": 1695330788,
          "comment_count": 0,
          "menu_order": 0,
          "post_author": {
            "user_id": 1,
            "display_name": "4x4Admin",
            "user_url": "",
            "user_login": "4x4Admin"
          },
          "images": {
            "thumbnail": {
              "url": "https://4x4tyres.localhost/app/uploads/2019/12/hp-feature-1-150x150.jpg",
              "width": 150,
              "height": 150
            }
          },
          "permalink": "https://4x4tyres.localhost/",
          "post_mime_type": "",
          "taxonomies": [],
          "taxonomies_hierarchical": [],
          "is_sticky": 0,
          "acf_content": "Wheel and tyre packages\nTransform your vehicle’s looks and performance, and save time and hassle. Our packages come assembled, balanced and ready to fit to your winklepicker.\n\nSearch for steel wheels\nTransform the looks and performance of your 4×4, van or SUV with new alloy or steel wheels from leading brands. Buy with confidence from the experts. Choose fitting near you or fast delivery to your door.\n\nAbout 4x4 Tyres\nWe’re the UK’s leading dedicated 4×4 and off road wheel and tyre specialist. We source the best brands from around the world, giving you unrivalled choice backed up by expert advice and support. Our most popular tyre brands include BFGoodrich, Cooper, General, Insa Turbo and Falken. Our most popular wheel brands include Tuff Torque, DV8 Works, Challenger, Urban, Kahn and Navis. Every day we help customers get the perfect looks and performance for their 4x4s, vans and SUVs including Land Rover, Defender, Discovery, Range Rover, VW Transporter, Hilux, Amarok, L200 and Navara. Choose between expert fitting at over 300 locations, or fast mail order straight to your door. And you’ll always get our expert advice and outstanding service.\n\n",
          "content": "We are forward thinking, service driven, wheel and tyre specialists who have been trading for 15 years and have collectively over 100 years of specialist 4x4 knowledge. Our team brings together a blend of expertise and experience from a diverse knowledge base of both on and off-road performance vehicles. Having such an eclectic team with varying automotive backgrounds we are able to offer our customers the very best advice.",
          "record_index": 0,
          "objectID": "25-0",
          "_snippetResult": {
            "content": {
              "value": "We are forward thinking, service driven, wheel and tyre specialists …",
              "matchLevel": "none"
            }
          },
          "_highlightResult": {
            "post_title": {
              "value": "Home",
              "matchLevel": "none",
              "matchedWords": []
            },
            "acf_content": {
              "value": "Wheel and tyre packages\nTransform your vehicle’s looks and performance, and save time and hassle. Our packages come assembled, balanced and ready to fit to your __ais-highlight__winklepicker__/ais-highlight__.\n\nSearch for steel wheels\nTransform the looks and performance of your 4×4, van or SUV with new alloy or steel wheels from leading brands. Buy with confidence from the experts. Choose fitting near you or fast delivery to your door.\n\nAbout 4x4 Tyres\nWe’re the UK’s leading dedicated 4×4 and off road wheel and tyre specialist. We source the best brands from around the world, giving you unrivalled choice backed up by expert advice and support. Our most popular tyre brands include BFGoodrich, Cooper, General, Insa Turbo and Falken. Our most popular wheel brands include Tuff Torque, DV8 Works, Challenger, Urban, Kahn and Navis. Every day we help customers get the perfect looks and performance for their 4x4s, vans and SUVs including Land Rover, Defender, Discovery, Range Rover, VW Transporter, Hilux, Amarok, L200 and Navara. Choose between expert fitting at over 300 locations, or fast mail order straight to your door. And you’ll always get our expert advice and outstanding service.\n\n",
              "matchLevel": "full",
              "fullyHighlighted": false,
              "matchedWords": [
                "winklepicker"
              ]
            },
            "content": {
              "value": "We are forward thinking, service driven, wheel and tyre specialists who have been trading for 15 years and have collectively over 100 years of specialist 4x4 knowledge. Our team brings together a blend of expertise and experience from a diverse knowledge base of both on and off-road performance vehicles. Having such an eclectic team with varying automotive backgrounds we are able to offer our customers the very best advice.",
              "matchLevel": "none",
              "matchedWords": []
            }
          }
        }
      ],
      "nbHits": 1,
      "page": 0,
      "nbPages": 1,
      "hitsPerPage": 5,
      "exhaustiveNbHits": true,
      "exhaustiveTypo": true,
      "exhaustive": {
        "nbHits": true,
        "typo": true
      },
      "query": "winklepicker",
      "params": "query=winklepicker&hitsPerPage=5&attributesToSnippet=%5B%22content%3A10%22%5D&highlightPreTag=__ais-highlight__&highlightPostTag=__%2Fais-highlight__",
      "renderingContent": {},
      "processingTimeMS": 1,
      "processingTimingsMS": {
        "_request": {
          "roundTrip": 21
        }
      }
    }

    Hopefully you can see why this isn’t quite working?

    Cheers again for helping!

    Thread Starter the_lar

    (@the_lar)

    @tw2113 thanks so much for your help so far! Really appreciate it.

    On our content pages the ACF stuff is quite complicated in that we have a Flexible block builder that allows editors to construct pages in the way they want, a bit like Elementor for example. But on those pages we don’t have any Gutenburg content editor content so I’m thinking what I’ll do is by using the filters you gave me, I’ll just parse the ACF fields and throw the content into $attributes['content'] that would work OK wouldn’t it? I could just loop through all the blocks that way and pull out the titles and text into that? Do you think that would be the best approach? What about structuring as HTML would I need to do that?

    Thread Starter the_lar

    (@the_lar)

    Got you, thank you @tw2113 I will give it a try!

    One other question – on our pages, we heavily rely on ACF plugin as a kind of content block builder – we use their flexible layout feature basically. Is it possible, and how would I go about ensuring the content that is in an ACF field on say our homepage is included in the Algolia index?

    Thread Starter the_lar

    (@the_lar)

    Hi @hailite – sorry I don’t know what you mean by please create a tix ? I do have a staging server though which is an exact copy of our production site, do you want access to that?

    Thread Starter the_lar

    (@the_lar)

    @hailite – note I’ve removed the ESI block for now on https://staging.4x4tyres.co.uk to test a different solution which doesn’t use ESI as need to go live with this on Monday – I can put it back though if you need me to?

    Thread Starter the_lar

    (@the_lar)

    @hailite yeah I see what you’re saying, but I don’t know.

    Here is my code in filters.php :

    function esi_postcode_form_block_esi_load($params)
    {
        //do_action( 'litespeed_control_set_ttl', 300 );
        do_action( 'litespeed_control_set_nocache' );
        echo sprintf('<input id="%s" type="text" class="%s %s postcode" data-search_postcode="%s" disabled />', $params['id'], $params['classes'], $params['type']==='size'?'tyre-size':'reg', WC()->session->get('search_postcode'));
    }
    add_action( 'litespeed_esi_load-esi_postcode_form_block', '\App\esi_postcode_form_block_esi_load' );

    So I’m only putting the <input /> into the ESI.

    And when I output the ESI in my shortcode I am doing this:

    if(is_plugin_active('litespeed-cache/litespeed-cache.php')){
        $size_postcode_field = apply_filters('litespeed_esi_url', 'esi_postcode_form_block', 'Postcode form block', ['id' => sprintf('sc-fbf-reg-tyre-search--%s-postcode_%s', 'size', $id), 'type' => 'size', 'classes' => 'sc-fbf-reg-tyre-search__form-field']);
    }else{
        $size_postcode_field = sprintf('<input id="sc-fbf-reg-tyre-search--%s-postcode_%s" type="text" class="sc-fbf-reg-tyre-search__form-field %s postcode" data-search_postcode="%s" disabled />', 'size', $id, 'tyre-size', WC()->session->get('search_postcode'));
    }
    
    $html = <<<HTML
      <div class="fbf-form-group sc-fbf-reg-tyre-search__form--row">
        {$size_postcode_field}
        <label for="sc-fbf-reg-tyre-search--size-postcode_{$id}" class="control-label">
          <span class="floating-label">Postcode</span>
        </label>
      </div>
    HTML;
    return $html;

    As you can see, I’m not adding the <label> into the ESI at all, so I don’t know why it’s getting included in the ‘broken’ xesi markup at all.

    • This reply was modified 1 year, 6 months ago by the_lar.
    Thread Starter the_lar

    (@the_lar)

    @hailite yes the 2nd log above is for normal execution when the ESI block is working as expected.

    The first log is when I changed the code from <esi to <xesi in order to break it, so in that case when I purge Litespeed cache and visit the link directly, I don’t see the html input field, I just see this:

    And in the HTML:

    <div class="fbf-form-group sc-fbf-reg-tyre-search__form--row">
    <xesi:include src="/?lsesi=esi_postcode_form_block&amp;_control=private%2Cno-vary&amp;esi=eyJpZCI6InNjLWZiZi1yZWctdHlyZS1zZWFyY2gtLXNpemUtcG9zdGNvZGVfIiwidHlwZSI6InNpemUiLCJjbGFzc2VzIjoic2MtZmJmLXJlZy10eXJlLXNlYXJjaF9fZm9ybS1maWVsZCJ9&amp;_hash=4a42890678f96addcbbb029192abaeca" cache-control="private,no-vary">
    <label for="sc-fbf-reg-tyre-search--size-postcode_" class="control-label">
    <span class="floating-label">Postcode</span>
    </label></xesi:include></div>

    As I say, I’m happy to give you Admin access to our staging site if you want me to?

    Thanks for helping!

    Thread Starter the_lar

    (@the_lar)

    Without the code change, and after purging the cache, when I look at the logs, the bit relating to the postcode ESI block is:

    09/14/23 16:03:42.624 [213.246.156.82:56476 1 ovo] ?? ------GET HTTP/1.1 (HTTPS) /
    09/14/23 16:03:42.624 [213.246.156.82:56476 1 ovo] Query String: lsesi=esi_postcode_form_block&_control=private%2Cno-vary&esi=eyJpZCI6InNjLWZiZi1yZWctdHlyZS1zZWFyY2gtLXNpemUtcG9zdGNvZGVfIiwidHlwZSI6InNpemUiLCJjbGFzc2VzIjoic2MtZmJmLXJlZy10eXJlLXNlYXJjaF9fZm9ybS1maWVsZCJ9&_hash=4a42890678f96addcbbb029192abaeca
    09/14/23 16:03:42.624 [213.246.156.82:56476 1 ovo] HTTP_REFERER: https://staging.4x4tyres.co.uk/
    09/14/23 16:03:42.624 [213.246.156.82:56476 1 ovo] User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/116.0
    09/14/23 16:03:42.624 [213.246.156.82:56476 1 ovo] Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
    09/14/23 16:03:42.624 [213.246.156.82:56476 1 ovo] Accept Encoding: gzip, deflate, br
    09/14/23 16:03:42.624 [213.246.156.82:56476 1 ovo] Cookie _lscache_vary: guest_mode:1
    09/14/23 16:03:42.624 [213.246.156.82:56476 1 ovo] X-LSCACHE: true
    09/14/23 16:03:42.624 [213.246.156.82:56476 1 ovo] ESI_CONTENT_TYPE: text/html; charset=UTF-8
    09/14/23 16:03:42.625 [213.246.156.82:56476 1 ovo] [ESI] Overwrite wp_create_nonce()
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] ? not ESI req
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] ESI_REFERER: /
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] stats_nonce
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] subscribe_nonce
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] 4x4_nonce
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] wp_rest
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] cmreg_registration_nonce
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] role_nonce
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] wdap-call-nonce
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] seopress_cookies_user_consent_nonce
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] swpmtxnonce
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] wdt.*
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] _vcnonce
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] data-vc-public-nonce
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] rating_nonce
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] timeline_nonce
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] blog_feed_nonce
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] wsf_post
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] edd\-.*
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] edd_.*
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [ESI] Appended nonce action to nonce list [action] wpmenucart
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [Router] get_role:
    09/14/23 16:03:42.718 [213.246.156.82:56476 1 ovo] [Media] init
    09/14/23 16:03:42.719 [213.246.156.82:56476 1 ovo] [LQIP] init
    09/14/23 16:03:42.719 [213.246.156.82:56476 1 ovo] [Optm] init
    09/14/23 16:03:42.719 [213.246.156.82:56476 1 ovo] [CDN] init
    09/14/23 16:03:42.719 [213.246.156.82:56476 1 ovo] ? Init
    09/14/23 16:03:42.719 [213.246.156.82:56476 1 ovo] [Router] LSCWP_CTRL bypassed empty
    09/14/23 16:03:42.719 [213.246.156.82:56476 1 ovo] [GUI] init
    09/14/23 16:03:42.777 [213.246.156.82:56476 1 ovo] ?? [Tag] Add --- HTTP.200
    09/14/23 16:03:42.778 [213.246.156.82:56476 1 ovo] [Ctrl] X Cache_control init on
    09/14/23 16:03:42.795 [213.246.156.82:56476 1 ovo] ? calling ESI template
    09/14/23 16:03:42.804 [213.246.156.82:56476 1 ovo] [ESI] param --- array (
    'action' => '4x4_nonce',
    '_ls_silence' => true,
    )
    09/14/23 16:03:42.804 [213.246.156.82:56476 1 ovo] [ESI] md5_string=nonceeyJhY3Rpb24iOiI0eDRfbm9uY2UiLCJfbHNfc2lsZW5jZSI6dHJ1ZX0=
    09/14/23 16:03:42.804 [213.246.156.82:56476 1 ovo] ? ?? [BLock_ID] nonce [wrapper] wp_create_nonce 4x4_nonce [Control]
    09/14/23 16:03:42.804 [213.246.156.82:56476 1 ovo] ? <esi:include src='/?lsesi=nonce&esi=eyJhY3Rpb24iOiI0eDRfbm9uY2UiLCJfbHNfc2lsZW5jZSI6dHJ1ZX0%3D&_hash=6b53e5ecbf4ec5dfc47674ada75c8e25' as-var='1' />
    09/14/23 16:03:42.804 [213.246.156.82:56476 1 ovo] ? Preserved to 399f9a3ac9bde5326847e29bb81a5c57
    09/14/23 16:03:42.840 [213.246.156.82:56476 1 ovo] [ESI] md5_string=esi_postcode_form_blockprivate,no-varyeyJpZCI6InNjLWZiZi1yZWctdHlyZS1zZWFyY2gtLXNpemUtcG9zdGNvZGVfIiwidHlwZSI6InNpemUiLCJjbGFzc2VzIjoic2MtZmJmLXJlZy10eXJlLXNlYXJjaF9fZm9ybS1maWVsZCJ9
    09/14/23 16:03:42.840 [213.246.156.82:56476 1 ovo] [ESI] parms --- '{"id":"sc-fbf-reg-tyre-search--size-postcode_","type":"size","classes":"sc-fbf-reg-tyre-search__form-field"}'
    09/14/23 16:03:42.840 [213.246.156.82:56476 1 ovo] [ESI] ? [ID] esi_postcode_form_block
    09/14/23 16:03:42.840 [213.246.156.82:56476 1 ovo] ?? [Tag] Add --- ESI
    09/14/23 16:03:42.840 [213.246.156.82:56476 1 ovo] ?? [Tag] Add --- ESI.esi_postcode_form_block
    09/14/23 16:03:42.840 [213.246.156.82:56476 1 ovo] [Ctrl] X Cache_control -> private
    09/14/23 16:03:42.840 [213.246.156.82:56476 1 ovo] [Ctrl] X Cache_control -> no-vary => LiteSpeed\Control::set_no_vary()@177 => LiteSpeed\ESI->load_esi_block()@652 =>
    /home/staging4x4tyresc/public_html/app/themes/4x4tyres/vendor/illuminate/view/Engines/PhpEngine.php@4 => Illuminate\View\Engines\PhpEngine->evaluatePath(/home/staging4x4tyresc/public_html/app/plugins/litespeed-cache/tpl/esi.tpl.php,ARRAY)@43
    09/14/23 16:03:42.840 [213.246.156.82:56476 1 ovo] [Ctrl] X Cache_control -> no Cache => LiteSpeed\Control::set_nocache()@372 => WP_Hook->apply_filters(,ARRAY)@310 => WP_Hook->do_action(ARRAY)@334 =>
    /home/staging4x4tyresc/public_html/app/themes/4x4tyres/app/filters.php@517 =>
    /home/staging4x4tyresc/public_html/wp/wp-includes/class-wp-hook.php@3493 => WP_Hook->apply_filters(,ARRAY)@310
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Core] CHK html bypass: miss footer const
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Ctrl] not cacheable before ctrl finalize
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Router] get_role:
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Vary] role id: failed, guest
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Router] get_role:
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Router] get_role:
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Vary] no custimzed vary
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] ?? X-LiteSpeed-Cache-Control: no-cache,esi=on
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Router] get_role:
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Vary] role id: failed, guest
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Router] get_role:
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Router] get_role:
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Core] CHK html bypass: miss footer const
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Core] run hook litespeed_buffer_finalize
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Media] bypass: Not frontend HTML type
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] GUI bypassed by no counter
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Optm] bypass: Not frontend HTML type
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [ESI] replacing preserved blocks --- 399f9a3ac9bde5326847e29bb81a5c57
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Core] ESI Start ??
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] <input id="sc-fbf-reg-tyre-search--size-postcode_" type="text" class="sc-fbf-reg-tyre-search__form-field tyre-size postcode" data-search_postcode="WR111HA" disabled />
    <!-- Block uncached by LiteSpeed Cache 5.7-a17 on 2023-09-14 16:03:42 -->
    <!-- X-LiteSpeed-Cache-Control: no-cache,esi=on -->
    <!-- Full varies: guest_mode:1 -->
    <!-- Object Cache [total] 7790 [hit_incall] 7439 [hit] 0 [miss_incall] 38 [miss] 313 [set] 366 -->
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] [Core] ESI End ??
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] <input id="sc-fbf-reg-tyre-search--size-postcode_" type="text" class="sc-fbf-reg-tyre-search__form-field tyre-size postcode" data-search_postcode="WR111HA" disabled />
    <!-- Block uncached by LiteSpeed Cache 5.7-a17 on 2023-09-14 16:03:42 -->
    <!-- X-LiteSpeed-Cache-Control: no-cache,esi=on -->
    <!-- Full varies: guest_mode:1 -->
    <!-- Object Cache [total] 7790 [hit_incall] 7439 [hit] 0 [miss_incall] 38 [miss] 313 [set] 366 -->
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] Response headers --- array (
    0 => 'Content-Type: text/html; charset=UTF-8',
    1 => 'Link: <https://staging.4x4tyres.co.uk/wp-json/>; rel="https://api.w.org/"',
    2 => 'Link: <https://staging.4x4tyres.co.uk/wp-json/wp/v2/pages/25>; rel="alternate"; type="application/json"',
    3 => 'Link: <https://staging.4x4tyres.co.uk/>; rel=shortlink',
    4 => 'X-LiteSpeed-Tag: f41_HTTP.200,f41_ESI,f41_ESI.esi_postcode_form_block',
    5 => 'X-LiteSpeed-Cache-Control: no-cache,esi=on',
    )
    09/14/23 16:03:42.841 [213.246.156.82:56476 1 ovo] End response
    --------------------------------------------------Duration: 218.13 ms------------------------------

    Does that help?

    Thread Starter the_lar

    (@the_lar)

    @hailite – that code is on line 501 in the dev version of the plugin, is that correct?

    Just to note, in order to get the code change to show up, I had to purge the litespeed cache, so obviously that fixes the issue anyway.

    So now the html is showing up as:

    I’ve looked in the log and all I can see is POST request to `/wp/wp-admin/admin-ajax.php:

    09/14/23 15:39:49.133 [213.246.156.82:56053 1 ohB] ?? ------POST HTTP/1.1 (HTTPS) /wp/wp-admin/admin-ajax.php
    09/14/23 15:39:49.133 [213.246.156.82:56053 1 ohB] Query String:
    09/14/23 15:39:49.133 [213.246.156.82:56053 1 ohB] HTTP_REFERER: https://staging.4x4tyres.co.uk/tyre-search/
    09/14/23 15:39:49.133 [213.246.156.82:56053 1 ohB] User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/116.0
    09/14/23 15:39:49.133 [213.246.156.82:56053 1 ohB] Accept: application/json, text/javascript, */*; q=0.01
    09/14/23 15:39:49.133 [213.246.156.82:56053 1 ohB] Accept Encoding: gzip, deflate, br
    09/14/23 15:39:49.133 [213.246.156.82:56053 1 ohB] Cookie _lscache_vary: guest_mode:1
    09/14/23 15:39:49.133 [213.246.156.82:56053 1 ohB] X-LSCACHE: true
    09/14/23 15:39:49.134 [213.246.156.82:56053 1 ohB] [ESI] Overwrite wp_create_nonce()
    09/14/23 15:39:49.137 [213.246.156.82:56053 1 6rk] ?? ------POST HTTP/1.1 (HTTPS) /wp/wp-admin/admin-ajax.php
    09/14/23 15:39:49.137 [213.246.156.82:56053 1 6rk] Query String:
    09/14/23 15:39:49.137 [213.246.156.82:56053 1 6rk] HTTP_REFERER: https://staging.4x4tyres.co.uk/tyre-search/
    09/14/23 15:39:49.137 [213.246.156.82:56053 1 6rk] User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/116.0
    09/14/23 15:39:49.137 [213.246.156.82:56053 1 6rk] Accept: application/json, text/javascript, */*; q=0.01
    09/14/23 15:39:49.137 [213.246.156.82:56053 1 6rk] Accept Encoding: gzip, deflate, br
    09/14/23 15:39:49.137 [213.246.156.82:56053 1 6rk] Cookie _lscache_vary: guest_mode:1
    09/14/23 15:39:49.137 [213.246.156.82:56053 1 6rk] X-LSCACHE: true
    09/14/23 15:39:49.138 [213.246.156.82:56053 1 6rk] [ESI] Overwrite wp_create_nonce()
    09/14/23 15:39:49.278 [213.246.156.82:56053 1 6rk] ?? No cache due to Admin page
    09/14/23 15:39:49.278 [213.246.156.82:56053 1 ohB] ?? No cache due to Admin page
    09/14/23 15:39:49.318 [213.246.156.82:56053 1 6rk] [Media] init
    09/14/23 15:39:49.318 [213.246.156.82:56053 1 6rk] [LQIP] init
    09/14/23 15:39:49.318 [213.246.156.82:56053 1 6rk] [CDN] init
    09/14/23 15:39:49.318 [213.246.156.82:56053 1 6rk] ? Init
    09/14/23 15:39:49.319 [213.246.156.82:56053 1 6rk] [Router] LSCWP_CTRL bypassed empty
    09/14/23 15:39:49.320 [213.246.156.82:56053 1 ohB] [Media] init
    09/14/23 15:39:49.321 [213.246.156.82:56053 1 ohB] [LQIP] init
    09/14/23 15:39:49.321 [213.246.156.82:56053 1 ohB] [CDN] init
    09/14/23 15:39:49.321 [213.246.156.82:56053 1 ohB] ? Init
    09/14/23 15:39:49.321 [213.246.156.82:56053 1 ohB] [Router] LSCWP_CTRL bypassed empty
    09/14/23 15:39:49.427 [213.246.156.82:56053 1 6rk] [Core] CHK html bypass: miss footer const
    09/14/23 15:39:49.427 [213.246.156.82:56053 1 6rk] [Ctrl] not cacheable before ctrl finalize
    09/14/23 15:39:49.428 [213.246.156.82:56053 1 6rk] [Router] get_role:
    09/14/23 15:39:49.428 [213.246.156.82:56053 1 6rk] [Vary] role id: failed, guest
    09/14/23 15:39:49.428 [213.246.156.82:56053 1 6rk] [Router] get_role:
    09/14/23 15:39:49.428 [213.246.156.82:56053 1 6rk] [Vary] no custimzed vary
    09/14/23 15:39:49.428 [213.246.156.82:56053 1 6rk] [Ctrl] ? forced no cache [reason] DONOTCACHEPAGE const
    09/14/23 15:39:49.428 [213.246.156.82:56053 1 6rk] ?? X-LiteSpeed-Cache-Control: no-cache
    09/14/23 15:39:49.428 [213.246.156.82:56053 1 6rk] [Router] get_role:
    09/14/23 15:39:49.428 [213.246.156.82:56053 1 6rk] [Vary] role id: failed, guest
    09/14/23 15:39:49.428 [213.246.156.82:56053 1 6rk] [Router] get_role:
    09/14/23 15:39:49.428 [213.246.156.82:56053 1 6rk] [Core] CHK html bypass: miss footer const
    09/14/23 15:39:49.428 [213.246.156.82:56053 1 6rk] [Core] run hook litespeed_buffer_finalize
    09/14/23 15:39:49.428 [213.246.156.82:56053 1 6rk] [Core] Silence Comment due to REST/AJAX
    09/14/23 15:39:49.428 [213.246.156.82:56053 1 6rk] Response headers --- array (
    0 => 'Access-Control-Allow-Origin: https://staging.4x4tyres.co.uk',
    1 => 'Access-Control-Allow-Credentials: true',
    2 => 'Content-Type: text/html; charset=UTF-8',
    3 => 'X-Robots-Tag: noindex',
    4 => 'X-Content-Type-Options: nosniff',
    5 => 'Expires: Wed, 11 Jan 1984 05:00:00 GMT',
    6 => 'Cache-Control: no-cache, must-revalidate, max-age=0',
    7 => 'Referrer-Policy: strict-origin-when-cross-origin',
    8 => 'X-Frame-Options: SAMEORIGIN',
    9 => 'X-LiteSpeed-Cache-Control: no-cache',
    )
    09/14/23 15:39:49.428 [213.246.156.82:56053 1 6rk] End response
    --------------------------------------------------Duration: 292.80 ms------------------------------

    Not sure if that’s any use? I can set you up with Admin access as this is on our staging site if that would help?

    • This reply was modified 1 year, 6 months ago by the_lar.
    • This reply was modified 1 year, 6 months ago by the_lar.
    Thread Starter the_lar

    (@the_lar)

    @hailite – please see above, this issue is still present with v5.7-a17, is there anything I can do in terms of capturing logs that will help you resolve this?

    Thread Starter the_lar

    (@the_lar)

    By the way, I haven’t cleared the cache so that you can see the issue, it’s present on https://staging.4x4tyres.co.uk/ and https://staging.4x4tyres.co.uk/tyre-search/ but it isn’t present on https://staging.4x4tyres.co.uk/wheel-search/ or https://staging.4x4tyres.co.uk/accessory-search/ which both use a similar ESI block

    Thread Starter the_lar

    (@the_lar)

    @qtwrk – I installed v5.7-a17 yesterday on the staging site – https://staging.4x4tyres.co.uk and it ran ok, but this morning when I’ve looked at it it’s broken again, so sorry to report but the bugfix does not seem to be working.

    In order to try and help you resolve this, I buried deep into the repeated HTML and where the ESI block should be in the repeated page I found this:

    As you can see, where the field should be it says [an error occured while processing this directive] – I’ve checked for PHP errors though and I’m not seeing anything.

    Appreciate you looking into this for me.

    • This reply was modified 1 year, 6 months ago by the_lar.
Viewing 15 replies - 16 through 30 (of 110 total)