I encountered this “not working”. Version 2.13.2.
Normally install plugins via the WP-CLI — and that’s how I installed this one.
While debugging, I monitored the traffic and noticed that I was getting errors like this:
NOTICE: PHP message: WordPress database error Table 'project.wp_searchmeter' doesn't exist for query DELETE FROM
wp_searchmeter
Which means that … for some reason when I installed it and activated it — it did not create it’s database tables.
So… I just went to the actual plugins screen, deactivated it, and then reactivated it. That fixed the database problem. Then I noticed it wasn’t writing my searches to it, no matter what I did. I then started looking at the code.
There’s this bit of code:
tguy_sm_array_value($_SERVER, 'HTTP_REFERER')
… that basically is saying “Do not log searches unless the HTTP_REFERER value exists.” — The HTTP Referer value just means that traffic needs to originate from a place. ANY PLACE. It’s pointless code… I know what they were going for here… which was to ask the question “did this request come from the site” but… that’s not what it does. ALSO… HTTP_REFERER drops if you involve HTTPS to NON-HTTPS at any point. OR if people are in private browsing mode.
Search engines should not be using search results pages… those pages should actually be NOINDEX NOFOLLOW — here’s an article on that: https://yoast.com/noindexfollow-your-wordpress-search-result-pages/
ANYWAY… here’s what I did to finally start seeing results.
- Make sure you have the latest version of the plugin (2.13.2 as of this response)
- Deactivate the plugin.
- Reactivate the plugin.
- Go to settings, make sure that your user level can view results. To be safe you can just set this to “All logged-in users”.
- Disable “Ignore searches made by logged-in administrators” for your testing purposes. Enable it later if you want.
- Now, go to your home page, and type in a search term, and submit it. You must NOT be in private browsing mode. You should now see results.
Hope this helps.