All Change!!

Finally took the big leap and moved the site off WordPress and onto Classic Press. There are several reasons for this with the primary ones being WordPress’s bloated code base and its jetpack plugin trying to basically make everyone else’s plugins obsolete. The other reason was Gutenberg – I hated block editing with a vengeance – It was slow and clunky and left my raw post full of junk. Also because it moved everything to react / Javascript it made maintaining the canalplan plugin impossible. I code for “fun” and having to learn a whole new programming language just to jump through WordPress’s lunacy just didn’t appeal.

 

Post Exporting and Importing

I’m planning on being on holiday later in the year (seeĀ  Liverpool in the Autumn for more details ) and I’m planning on doing some blogging whilst we’re underway.

So I want to be able to write my posts on my laptop when I’m disconnected from the internet and then connect and push the post and its images up onto my live blog.

Normally you’d use an offline client of one form or another but I’m using my WordPress Plugin for Canalplan to easily add links to Canalplan places into my blog. So that means that I have to use a local copy of WordPress on my laptop and then move the post when its complete, and that is where the problems start.

There are lots of plugins for WordPress that allow you to do things like export whole blog or a post but many of them (including the Official WordPress ones) expect the source blog to be visible to the internet so they can pull the images over. or they rely on you exporting the whole database and re-importing it which would mean having a whole multi-site install on my laptop which is a bit OTT.

So I sat down yesterday and started coding and I’ve got something working pretty well already.

So I can export a post (along with all its attached media) from one blog into a zip file.
You then move that zip file to the new server
Then you import the zip file either into an existing post (so we overwrite the contents) or into a new post.

Its all working OK so far but there are a few issues to work through. As I have to do search and replace on the image urls then both blogs must have the same image sizes set up because WordPress appends the image sizes when it creates the different sizes:

-rw-rw-r-- 1 www-data www-data 7623937 May 8 14:31 IMG_1032.jpg
-rw-rw-r-- 1 www-data www-data 4483 May 8 14:31 IMG_1032-150x100.jpg
-rw-rw-r-- 1 www-data www-data 15115 May 8 14:31 IMG_1032-300x200.jpg
-rw-rw-r-- 1 www-data www-data 149647 May 8 14:31 IMG_1032-1024x683.jpg
-rw-rw-r-- 1 www-data www-data 59728 May 8 14:31 IMG_1032-619x413.jpg

So if those image sizes are different then the replaced strings in the new content don’t match the files that were created when we loaded the exported media files into the blog.

Also the exporter assumes that filenames are unique – its possible to have two files with the same name in two different upload directories on the source. But on the target system it puts all the files in the current upload directory. So what would happen here is the two original image urls would end up pointing at the single new object.

I’ve not tested it on anything but image files so far but its looking pretty good.

Ready To Export A Post
Ready To Export A Post
Post Exported and Ready to Dowload
Post Exported and Ready to Dowload
Zip file loaded up to new Server and ready to load into new post
Zip file loaded up to new Server and ready to load into new post
File imported into new post
File imported into new post

If I like it I might submit it to the WordPress Plugin Repository.

Wordbooker and Canalplan

Well since I decided to abandon Wordbooker due to the major changes in the Facebook API and changes in the FB newsfeed algorithms which mean that Wordbooker posts actually got poor “reach” I’ve been working on the Canalplan AC Plugin for WordPress and also working on the Boat Index part of Canalplan.

The big changes to the Canalplan Plugin are to do with integrating Backitude. Backitude is an Android App that provides lightweight GPS functionality but what interested me is that it supports custom servers. So I sat down and coded up the stuff needed to get backitude to send its current location to the Canalplan AC plugin. The plugin uses that information to update the “Where am I” widget part of the plugin and it also passes that information through to Canalplan AC.

When we took on the Boat Index from Jim Shead we worked out we could do some clever integration into Canalplan.

So if you are logged in you can :

  • “like” a boat, actually you can like as many boats as you like
  • Edit Photos and “tag” them with any of the boats in your liked list
  • Nominate one of your “liked” boats to be “tracked” (Beta only at the moment)
  • Down load a backitude configuration to allow you to send track information to Canalplan (Beta only at the moment)

So Canalplan can now track a boat either directly with backitude or indirectly through the Canalplan AC blog plugin.

Boat tracks can be viewed by people and you can also see the current location of any boat which has enabled public tracking.

If you are logged in you can also:

  • Change the visibility of any tracked route you’ve created
  • Delete any tracked route you’ve created
  • Edit any tracked route to remove “rogue” tracking waypoints
  • Change if your tracked boat is public or not. If its private then none of its trips are available. This might change in future

These second set of features are only available in the Beta version at the moment.