the_lar
Forum Replies Created
-
I think I may have figured out what’s going on here, can I run this past you?
The particular bit of functionality of my theme uses
get_transient()
for a bunch of keys – I know those transients are present so I don’t check first. BUT – the transients were created before I installed Redis, so presumably it’s returningfalse
rather than the array of data I need, because Redis knows nothing about these keys?So in this case, I just need to delete the transients and recreate them with Redis enabled and active? Is that about right?
Ah OK, yes my site uses
$wpdb
a lot – there’s a lot of custom functionality.So basically I need to install Redis locally then and go from there in the first instance? When you say
wpdb
will give me trouble – specifically what kind of things and why? I’m pretty new to Redis so in basic terms what could break?Forum: Plugins
In reply to: [Redis Object Cache] Issue enabling plugin with roots/bedrock in productionOK, just found that changing the setting to
false
, enabling the plugin, then changing the setting back totrue
works and Redis continues running just fine.Forum: Plugins
In reply to: [WP Search with Algolia] Strategy for conversion tracking?Hi Michael, I’ve actually done this using Mixpanel which is what we already use for lots of custom Event tracking on the site and it was going to be much easier it seemed to do it that way. Thanks anyway for the help though!
Have a great Christmas!
Kevin
Forum: Plugins
In reply to: [WP Search with Algolia] algoliasearch is not defined – just on my blog postsSure, I’d be happy to do that. We have a staging site so that would be idea. As our custom theme is based on roots/sage, I’ve had to make some allowances as detailed here – https://discourse.roots.io/t/algolia-search-integration/15047/9?u=the_lar – but possibly makes it a good test bed for alternative setups anyway.
Forum: Plugins
In reply to: [WP Search with Algolia] algoliasearch is not defined – just on my blog postsFixed – taken most of the day but discovered that it was down to the way a freelancer we employed last year had set up the template for
posts
– clearly didn’t have a clue how blade works by extending a core layout file and was extending it again – this was resulting inwp_footer
being called at least 3 times and ultimately generating a frankenstein version of our footer just onpost
types! As the old saying goes, if you want something done properly – do it yourself!!! ?????♂?Forum: Plugins
In reply to: [WP Search with Algolia] algoliasearch is not defined – just on my blog posts@tw2113 I’ve done some more digging, looking at the source, on my
post
articles the autocomplete.php code is present wherewp_footer()
is hit but there’s a lot of scripts below that which aren’t present that definitely are there elsewhere, wp-utils.js being one of the missing scripts. The strange thing is, when I capture the output ofwp_footer()
by putting in a breakpoint like you suggested and usingob_start()
– the scripts are there, they just don’t make it onto the page for some reason! ?????♂?Anyway I tried turning Algolia plugin off completely and the issue persists. So obviously there’s an something going on with
post
‘s that’s not related to your plugin at all – it’s just never been picked up before. I’ll have to pick it apart and see what gives – thanks for your help anyway!Forum: Plugins
In reply to: [WP Search with Algolia] algoliasearch is not defined – just on my blog posts@tw2113 – to answer your question, the theme as I say is built on roots/sage 9 which uses blade templates, so all of my templates including single.blade.php (which is for
post
) use something like this…@extends('layouts.app') @section('content') {{--whatever--}} @endsection
Then my
layouts/app.blade.php
is something like this (very simplified version)…<!doctype html> <html {!! get_language_attributes() !!}> <head> @php wp_head() @endphp </head> <body> @yield('content') @php wp_footer() @endphp </body> </html>
- This reply was modified 1 year, 5 months ago by the_lar.
Forum: Plugins
In reply to: [WP Search with Algolia] algoliasearch is not defined – just on my blog postsStrangely when I put a breakpoint into
includes/class-algolia-scripts.php
on around line 38 – it does get hit when I refresh mypost
– and there are no errors showing up in my IDE console!Forum: Plugins
In reply to: [WP Search with Algolia] algoliasearch is not defined – just on my blog posts@tw2113 – yeah so I can see that
wp-util
andalgoliasearch
are not being loaded on mypost
articles (for whatever reason) – they just aren’t there in the Network tab of Firefox console – there’s no 404, just not there at all. They ARE there on my other post types –page
product
etc – https://4x4tyres.co.uk/wheel-search/ for example. Not sure what this is telling us but my guess is that the script you linked to above is maybe failing onpost
possibly because of a dependency issue (just a guess), but the fact that none of the scripts are even present does imply an enqueuing error I think – would you agree?- This reply was modified 1 year, 5 months ago by the_lar.
Forum: Plugins
In reply to: [WP Search with Algolia] algoliasearch is not defined – just on my blog postsYeah so when I add those to my footer, it changes the error to:
Uncaught TypeError: wp.template is not a function algolia_setup (index):1456 algolia_setup (index):1455 init common.js:89 jQuery 10 init common.js:73 fire Router.js:38 loadEvents Router.js:53 <anonymous> main.js:96 jQuery 13
So wp.template is not loaded also on posts – very odd!
Forum: Plugins
In reply to: [WP Search with Algolia] algoliasearch is not defined – just on my blog postsYeah don’t think it’s Litespeed because I don’t use that on my local dev version on my own machine but still seeing the issue there too.
The custom theme I’ve built uses
roots/sage
androots/bedrock
not sure if that’s of any relevance, just weird how it’s only affecting mypost
‘sForum: Plugins
In reply to: [WP Search with Algolia] Escaping HTML encoded text in autocomplete template?Yeah so basically there doesn’t seem to be any way to decode html entities then.
Just using
{{ }}
instead of the triple version simply encodes the&
at the start of"
so you end up with Alloy Wheel 20&quot; x 9&quot; ??And using
<# #>
just outputsdata._snippetResult['content'].value
rather than any valueI’ll just have to take a different approach and decode them before I send them to Algolia I guess.
Forum: Plugins
In reply to: [WP Search with Algolia] Escaping HTML encoded text in autocomplete template?@tw2113 – yes they indexed that way – see below:
The three bracket spots are the default in autocomplete.php already – this is what I’ve got with no changes:
All I need to do
url_decode
the encoded html entities. As I say, in blade this would simply be{!! !!}
instead of{{ }}
– but I’m not sure what language these templates are using, are they Liquid?- This reply was modified 1 year, 5 months ago by the_lar.
- This reply was modified 1 year, 5 months ago by the_lar.
- This reply was modified 1 year, 5 months ago by the_lar.
- This reply was modified 1 year, 5 months ago by the_lar.
- This reply was modified 1 year, 5 months ago by the_lar.
- This reply was modified 1 year, 5 months ago by the_lar.
Forum: Plugins
In reply to: [WP Search with Algolia] Search page not matching autocomplete results@tw2113 – figured it out. I just needed to add
add_filter( 'algolia_searchable_posts_index_settings', '\App\my_posts_index_settings' );
to my filters.php, then in instantsearch.php I changed to this:<# if ( data._snippetResult['acf_content'] ) { #> <span class="suggestion-post-content ais-hits--content-snippet">
data._snippetResult['acf_content'].value
</span> <# }else if( data._snippetResult['content'] ) { #> <span class="suggestion-post-content ais-hits--content-snippet">data._snippetResult['acf_content'].value
</span> <# } #>Works! ??
- This reply was modified 1 year, 5 months ago by the_lar.