Trouble with Randomizer
Hello! Im sorry to reach out again,
The randomize question toggle has been turned to yes, and I have cache excluded for the page (I contacted my web host WPEngine to make sure it was excluded) However the questions are still not randomizing. Any help trouble shooting this would be appreciated!
Also, I am wondering if there is a way I can change the “quiz start” button to say something different.
Thank you for your time!
Sydney
Hi Sydney,
If you can provide a link to a quiz I can take a look to see if any caching is still happening.
Under HD Quiz -> settings menu, there is a translation tab. You can rename just about everything here, including the quiz start text
thank you! here is the link: https://sydneyevergreen.com/a-moment-of-reflection/
Hmmmm. Unless you’ve already fixed it on your end – I don’t see a problem :s
I’m looking at the page and when I reload, I get a random order of questions.
Based on your previous issue being cache related, and this one *probably* being one, my instinct is that your browser is HYPER aggressive at caching pages. I don’t think the issue is your site or server since the cache issue does not happen for me across 3 different browsers.
Are you able to test it on a different browser than whichever one you currently use? It would help prove my theory here.
Oh! So weird! Iv checked on my safari phone browser and on my chrome book incognito mode and both show them as not random!
Weird! Looking at it again this morning, I am always getting the same order.
The current order being displayed – is it random? I know it’s not randomizing new each load, but is it random at all, or is it the same order that they are in the admin area? If you disable random question order in the settings, does it correctly revert to the order they are in the admin area?
CLOUDFLARE
I see that you are using Cloudflare. It’s possible that the caching is happening on their end. They use something called CDNs (content delivery networks). This works by basically hosting multiple copies of your site on servers around the world. The idea the user can connect to the server that is closest to them for speed.
If I was right that it WAS randomizing for me last night (not a given! I am a dummy), then it’s possible that the server closest to you had it cashed, but the one closest to me wasn’t cached yet.
I don’t know how you have your integration with them setup, but look for a way to clear your Cloudflare cache and see if it starts randomizing again. If it does, we found the culprit!
Post Order Overwrite
Sometimes users have another plugin installed that specifically changes the order of posts, products, etc. This can be used to, for example, force your products to always be most recent first, or posts to always be by alphabetical etc. Take a look at your site plugins and see if you have any plugin that might be providing this functionality. It’s possible it is affecting the order that HD Quiz returns question order.
Thank you so much for helping trouble shoot this!
So the cloudflare is coming from my website host WP-Engine. I contacted them last night about this and they were able to set a cache exclusion on that page for me. They werent sure why it still wasnt working after that.
From what I see, it is not random at all it is showing always the exsact order in the backend. I also tried shutting off the randomizer to see if there was a difference but it seems like there is not as far as I can tell!
For the plugins, Im going to keep thinking about what might effect it, but the only one I can think that may would be a page loader plugin that I have? what do you think could that be possible?
Thanks so much your kind help means so much!
Sydney
Interesting. Since it is the same order in the backend as it is on the frontend, this makes is less likely to be a cache issue (unless you originally had the quiz set to non-random), and more likely that something else on your site is modifying post order (either theme or another plugin).
What makes this hard is WP Engine itself. They heavily modify WordPress in various ways making support more difficult. For example, when creating the query that gets the list of questions, I specifically set something called suppress_filters. What this setting does is prevent other plugins from modifying the query to, for example, change the order. But for all I know, WP Engine is doing something custom to prevent this.
In fact, doing some research, I think it IS WP Engine modifying WordPress. It looks like they actually disable a function called order_by_rand which is the function WordPress uses to return results in a random sort order. There is also an additional setting to the query that might be required called ignore_custom_sort, but let’s start by enabling order_by_rand first.
Instructions are here: https://wpengine.com/support/about-order-by-rand/#toc-enabling-order_by_rand
Just note the last bullet point in that article:
“Remember that the page generated by PHP will be cached for 10 minutes in our proprietary page caching system (Evercache). This means a randomized result will still only [sic] show every 10 minutes for your new users.”
Wow! You are the best!! I was able to figure out how to re enable the order by rand that wp engine disables and now it is working perfectly!! thank you so much you have been amazingly kind and helpful and im very happy to have this quiz plug in that is so customizable!
Sending you all the best!
Sydney
Great!
Now that I know WP Engine does this, I’ll try and think of a way to detect if that function is disabled so I can add a warning message in the future.
Also, if you have the time, I’d appreciate it if you could leave a review: https://wordpress.org/support/plugin/hd-quiz/reviews/
Great idea! and okay! I will leave a postive review! Thanks again for your time.
Respond to thread
This thread has been closed / marked as resolved.
You can reply to this thread, but it might be better to start a new thread if you need help.
Submit