The facts of food

Alternative facts have long existed in the world of food. When you create a powerful enough fiction, you are no longer bound by the need for evidence, for fact checking, for responsibility and a concern for the safety of the vulnerable. The people peddling the candida myth have discovered that in making up a problem, valuable new markets can be created from nothing.

From Captain Science vs the Army of Fungus

How to Auto Schedule WordPress Posts

If you post to a WordPress blog on a regular basis like I do on In Photos dot Org you’ll no doubt recognise the fatigue that comes from adjusting the publish date every single time on a new post so it appears a day later. If you have multiple posts like on a daily photoblog you have to remember what day the last post was made and adjust the date accordingly.

A few years ago I wrote a small plugin that I never released to help schedule posts. In the media uploader you could select multiple photos and click a few buttons to be brought to a new page where you could enter title, content and tags for each image. Based on this experience, I suggested it as an idea to one of the teams at Automattic who built Post Bot. I used that for a long time and it has its strengths. If you’re posting content that has the same or similar tags you can copy and paste the tags from one post to another. I posted lots of black and white street images from my home town this way and it was super useful!

I got tired of manually typing out tags, and unfortunately the site broke a few times, with posts not scheduling or one time they scheduled all in one go. Luckily the problems were quickly fixed. However, I started using the WordPress post editor again and scheduling a bunch of photos that way.

Manually editing the publish date quickly became a chore. Lazarus, the form saver Chrome extension, would sometimes popup if I didn’t click exactly on the date, or as I said before I had to remember when the last post was made. They say there’s a plugin for everything, and there is for this too. Check out Publish to Schedule.

You tell “Publish to Schedule” which days and how many posts should be published and when you go into the post editor the next available date is picked for you! The date doesn’t change until you hit Publish but I already used it to schedule a number of posts and it works really well.

Edit: I forgot to mention Daily Image a new plugin by Sam Hotchkiss that does the same sort of job as Postbot but it runs on your own server. The first time you load the plugin it will show you every single unattached image in your media library which can be quite a number of images but it allows you to enter tags and quickly schedule images for posting in a simple manner.

Since my focus here is on image posts I should really mention the WordPress Export Plugin for Lightroom. When installed you can create a new export target that will resize and sharpen your image and upload it to your blog, even if it’s not a WordPress.com site.

Meteor and Three Won’t “Roam Like Home” in the EU but I’m ok with that

As reported in the Independent, it seems that Meteor and Three have found a loophole in EU legislation to get rid of mobile roaming charges. Of the Irish telecoms companies, only Vodafone “is publicly saying that it will let customers use every bit of data abroad that they’re entitled to at home”.

Concerned, I contacted @Meteor_Mobile on Twitter and received a response within minutes. If you have a Meteor bill pay plan you’ll get “up to 5GB of roaming data”. Pay as you go customers must still buy a roaming add-on. The new limits will be introduced early in the summer so the roaming page will be updated then I expect.

It’s disappointing for PAYG customers, but as a PAYG customer I’m willing to stay with Meteor because their monthly cost is relatively low. I rarely make phone calls or send SMS texts and I make heavy use of their 7.5GB data offer for €10 a month. It wouldn’t be worth my while upgrading to a bill pay plan. I’d need to spend €20/month €25/month to get that amount of data or more and the call minutes and texts would go to waste. 1GB of roaming data is €14.99 for PAYG customers, or I have the option of buying a sim locally for even better value.

Moving to Vodafone isn’t really an option either. The closest offer is still twice as expensive, as I wouldn’t use the €10 credit left in the account each month.

If I was travelling around the EU every month I’d certainly upgrade to a bill pay plan but the monthly cost of a PAYG data plan is a no-brainer. It’s better value for my usage.

Edit: a few hours after I posted this the European Commission warned Irish mobile operators that there wasn’t any loophole.
I couldn’t find any mention of PAYG customers specifically but this BT PDF makes no distinction between bill pay and PAYG customers. (One wonders what will happen there when BREXIT happens.)

This means BT One Phone customer’s will begin to see their UK allowance(s) decremented when they are Roaming inside the EU. If a customer has used up all their UK allowance they will begin to be charged their normal UK PAYG/Out of bundle or Overage rate while roaming inside the European Union.

Coming up in WP Super Cache 1.5.0

The next version of WP Super Cache will be one with some big changes! There are many small bug fixes and improvements but the one I’m most excited about is moving the legacy cache files into the supercache directory.

The legacy cache files were the files created by the old WP-Cache plugin upon which this plugin is based. They’re really useful as they store the headers sent from the server as well as the page contents. If you’re serving pages that aren’t regular html, such as JSON or XML you don’t want to tell the browser they’re text/html documents. This caching method is also used for anyone who is logged into your site, or left a comment.
There is a problem however. They’re stored in one directory. If you have many thousands of visitors interacting with your site you may end up with a directory containing thousands of files. The names of the cache files are a hash of the URL, gzip support and browser cookies so one file can match one user, or one file can be used by thousands of anonymous users. In the event that someone left a comment on a popular post the plugin has to search through all those files looking for the pages cached for other users who were also looking at that page. On a busy server that can cause problems.

So, in #177 I added code that moves the legacy cache files into the supercache directory. That means the files are stored in directories that reflect the URL of the page that was served which makes it very easy to delete the cached files belonging to that page as they’re all in the same directory!

The new code will look in the old location for legacy files first as some sites will have a large collection of cached files, but any new cache files will be created in the supercache directory.

Ian Dunn submitted code to cache the REST API. It’s not yet complete but we’ll be able to build on the changes to the legacy cache to make caching the API more efficient than it would have been before.

I really need people to help test this. The latest code is running on this site so I’m very confident in how well it works but just because it works on my odd little server doesn’t mean it will work right everywhere. If you want to give it a spin, visit the plugin Github repository and click on the “Clone or download” button. If you don’t know how to clone a Git respository just grab the zip file and install it on your server, overwriting the files in the plugins/wp-super-cache/ directory. If the changes to where cache files go doesn’t interest you, some of the changes in this list might:

WP Super Cache 1.4.9

There’s a new release of WP Super Cache out and it’s a security release to fix XSS problems in the settings pages. Those pages are only accessible by admin users so an anonymous visitor to your site can’t come along and enable it to steal your login cookies but along with those fixes come many bug fixes so it’s worth upgrading if you’re using an old version.

From the Changelog:

  • Fixed bug when not running sem_remove after sem_release. See https://github.com/Automattic/wp-super-cache/issues/85
  • Fixed a PHP error impacting PHP 7.1.
  • Fixed a bug where we cached PUT and DELETE requests. We’re treating them like POST requests now.
  • Delete supercache cache files, even when supercache is disabled, because mod_rewrite rules might still be active.
  • Updated the settings page, moving things around. #173
  • Make file locking less attractive on the settings page and fixed the WPSC_DISABLE_LOCKING constant so it really disables file locking even if the user has enabled it already.
  • Added a WPSC_REMOVE_SEMAPHORE constant that must be defined if sem_remove() is to be used as it may cause problems. #174
  • Added a “wpsc_delete_related_pages_on_edit” filter that on returning 0 will disable deletion of pages outside of page being edited. #175
  • Fixed plugin deleting all cached pages when a site had a static homepage. #175
  • Make sure $cache_path has a trailing slash #177
  • Remove flush() #127 but also check if headers are empty and flush and get headers again. #179
  • Add fix for customizer #161 and don’t cache PUT AND DELETE requests #178
  • Check for superglobals before using them. #131

You can click through to each of the Github pull requests above to see discussion around each bug fix.

If you’re hosting many sites that use WP Super Cache and you’re seeing issues with semaphores it may mean that your users are using file locking. It’s really not needed and in #174 there’s a fix that went into this release. You can disable file locking completely by setting the constant “WPSC_DISABLE_LOCKING” in a global configuration file. The file locking simply slowed down how fast cache files were created and is a hold-over from WP Cache when that plugin used to write directly to the cache files. This plugin writes to temporary files before moving to the final cache files so that locking isn’t really needed, but some sites still use it which is why it’s still around.

I’ve already been working on the next release with efforts to move the legacy cache files into the supercache directories. This will make it easier to maintain them and improve performance. We really need to find a better name for this caching method however. It caches everything – page contents and http headers so it’s quite useful!
If you’re going to test that PR, try #176 too. The plugin only deletes index.html type files right now but this chunk of code cleans up various for loops in the plugin and also deletes any file in the named directory. There are some restrictions on it so it won’t delete anything outside the cache directory.

Thanks to everyone who contributed to this release!

The Galaxy S7 finally gets Nougat

Nougat, or Android 7.0 has finally been released by Samsung for the Galaxy S7/ and S7 Edge and my phone is downloading it.

Now that it’s here I was wondering if I should install it as I’m quite fond of “Good Lock”, a replacement for the notification system in Samsung phones that doesn’t yet work in Nougat, but this comparison video (of the first beta) below convinced me to try it.

The notification panel looks ok, but has been updated since that video was made. The brightness slider can be moved to the top of the notification panel so it shows on the first pull-down now. That brightness warning dialog only showed the first time I set it to that bright. It’s definitely an improvement on the panel in stock Marshmallow on the S7. I like the multitasking, and the camera has got a nice UI update, even though I rarely use anything but the “pro” mode to shoot raw files. I hope Android Pay still works. I guess that’s one good thing about credit cards – you don’t have to worry about an OS update breaking it!

I wonder if I can enable the blue light filter only at night. That would be more useful than the screen turning yellow during the day. Nightmode Enabler doesn’t work.

Finally, here’s a video showing the final Nougat update..