Blog traffic

sep2016_cloudflare_traffic According to cloudflare, my blog traffic this month.

sep2016_analytics_trafficAccording to google analytics, my blog traffic this month.

The difference?
a) Cloudflare is counting requests to my server (each image, each file, each style sheet) whereas Google Analytics is joining requests from the same visitor into a session.
b) Hackers don’t always ask for a page, and don’t load the javascript that google analytics need to track the visitor.

What can we infer from this?
Computers in Ukraine that are visiting the blog aren’t reading this text, but they visit a lot.
We cannot state with certainty the users instigating this are in Ukraine though, just that the requests can be traced as far as there. Likewise, computers in the USA requesting items from my server are less likely to be people than computers in the UK.
My guess of the reason for this: Hacking attempts, search engines.
You cannot tell from the source (eg: Ukraine) that the people controlling the computer requesting files [be that hacking or search engine or other uses good and bad] are in Ukraine. For example, for a long time my web server lived in Paris, but I’m not in France to control it.

Upgrading my server to PHP7 broke wordpress admin interface (cloudflare)

wp-cli, a command line interface for WordPress, just saved me a big headache.

It all began when I updated my server to the latest ubuntu LTS. That removed PHP5 support and replaced it with PHP7. That meant several of my sites stopped working as the nginx configuration had to change. With that done I thought the blog as the pages were still displaying OK but for some reason I could no longer access the admin interface to make new posts or moderate comments. Instead, when I logged in I would see a message: Sorry, you are not allowed to access this page

I decided the most likely cause of this would be a plugin. However, I couldn’t use the admin interface to disable all the plugins so I needed to find another way. I read that I could start editing the database directly but then I stumbled upon wp-cli. Installing that allowed me to use an SSH shell to check, disable, enable and update the plugins. I quickly discovered that there was an update to cloudflare that hadn’t been applied. I applied it and it failed. I’m not entirely sure if it failed due to the background change of PHP5 to PHP7, or if my earlier fault finding had changed a file owner (I tried removing the plugins by moving the directory to a new name), but once I used wp-cli to update cloudflare everything started working perfectly, including the ability to preview theme changes which had stopped working a long time ago.

If I didn’t find wp-cli I would have been checking my backups, creating a test server in my office to install and test backups and assuming they worked removing and reinstalling wordpress.