Tag name:wordpress

Fixing the Simply Static plugin

After updating my Ubuntu system to 20.04, I discovered that my method for generating the static version of the site no longer works. It turns out that the Simply Static plugin has a hidden dependency on PHP 7.2 (and upgrading Ubuntu from 18.04 to 20.04 incidently updates the PHP level from 7.2 to 7.4).

After doing some digging I discovered that the Simply Static plugin has an included library called PhpSimpleHtmlDom and the version in the plugin (1.5) is the culprit, I downloaded a more recent version of that library from github and replaced the version of the library with that level and (after a minor hack to change the namespace of the library to match the old namespace being used), Simply Static is now working again.

Hopefully, at some point, the author of the plugin will update it and I won't need the hack. That said the plugin has not been updated for a few years so may now be abandoned. If so I'll probably have to change the infrastructure that builds the static version of the website...

My thanks to Github user caophihung94 for providing a newer version of the PhpSimpleHtmlDom library

Legal

First published 21st October 2020 (Last Modified 2nd December 2024)

Privacy Policy

This website is intended purely as a Personal web site. As such it does not collect any personal information from any body other than myself.

Cookie Policy

This site uses cookies - small text files that are placed on your machine to help the site provide a better user experience. In general, cookies are used to retain user preferences, store information for things like shopping carts, and provide anonymised tracking data to third party applications like Google Analytics. As a rule, cookies will make your browsing experience better.

On this site, the only cookies are those used by WordPress itself so that it can determine where you are in the site and if, for example, you've logged on or not. There a good write up of this on the cookielawinfo website (note, however, that wesbite is trying to get you to sign up for their plugin for wordpress that provides a cookie consent banner among other GDPR features).

However, you may prefer to disable cookies on this site and on others. The most effective way to do this is to disable cookies in your browser. I suggest consulting the Help section of your browser or taking a look at the About Cookies website which offers guidance for all modern browsers.

Local Browser Storage

Both the Sumo Oyakata and the Domain of the Ancients games provides load and save1 buttons. The data saved is entirely local to your browser and never leaves it in any form. The Mongoose Traveller 2e Character Creator also provides load and save buttons. Again the data saved is entirely local to your browser. However the character creator also provides the ability to export the character as files that can be downloaded. These files are generated locally in your browser. The Character Sandpit also provides the same ability to export the character while it does nor have the ability to save or load the character data.

Copyright

Unless otherwise noted on the relevant page all the text on this website is my own and is thus copyrighted by myself (David Vines). Again unless otherwise noted on the relevant page you may copy and reuse the text as long as you abide by the terms of the Creative Commons License Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

The copyright in the images used on this website has various different copyright owners varying by the image. If you click on the image you should be taken to the attachment page for the image where details of the copyright owner will be stated and the license used by this website to the image. For images where I'm the sole copyright owner again you may reuse the image in your work as long as you abide by the terms of the Creative Commons License Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact

Should you need to contact me, please send an email to webmaster(at)blog(dot)tremlas(dot)com.

Change History

Last updated: December 2, 2024 at 14:54 pm

2nd December 2024
Updated section on Local Browser Storage to also include details about the character creators.

Footnotes

  1. Sumo provides a save button, Domain of the Ancients doesn't (because it auto saves at the beginning of every turn).

More wordpress plugins I have used but are now uninstalled (but want to keep a record of)

Another plugin I've used but is currently uninstalled is:

Enhanced Media Plugin
Seemingly now unsupported I used to to more easily manage the tags from within the media library. A shame since the standard way is definitely long winded 🙂

WordPress plugins I have used but are now uninstalled (but want to keep a record of)

I have used (indeed am still using) a number of wordpress plugins. I have actually written quite a few myself as well as several others. There are a few I've used in the past and may well use again, but are currently uninstalled.

They are:

Merge + Minify + Refresh
Used to minimise the size of the css and javascript sent out by wordpress when delivering pages. Not currently simply because it seriously interferes with debugging the javascript!
WP Content Security Policy Plugin
Used to play with the content security policy that allows cautious browsers (and the server) to manage the javascript being used. I did use this to clean up the delivery, but couldn't get to a really clean content policy. I'd still like to do that, but it's not so trivial for the this site (from memory it's mostly the theme that causes trouble).
WP Super Cache
used when the site on dreamhost was an actual wordpress installation to reduce the server load. Since the dreamhost is now just a static version of the site I don't need it there and don't use on the version on my local network since the caching gets in the way of my testing.
WP-DBManager
I have used this to explore the wordpress database. I don't currently need to do this, but would use it if I needed to
WP-RSSImport
Used to query RSS feeds - As I described on the affected page I used to follow a bunch of RSS feeds, but no longer do so (and it's less useful for this static version of the site anyway).

Romsey Signal Box Simulation Plugin Details

First published 10th April 2020 (Last Modified 12th January 2023)

Description

This plugin adds support for my simulation of the preserved Romsey Signal Box by:
  • adding a shortcode, romseySignalBox, to add the simulation. Examples of use: [romseySignalBox]Text that will appear at the bottom middle of the simulation. Typically this would display instructions or hints.[/romseySignalBox]
  • Also, as is standard for my plugins, it adds a shortcode to add the current version number of the plugin: [romseySignalBoxVersion]

Possible Future Enhancements

  • Add the missing repeater instruments
  • Align the repeater instruments with their corresponding lever
  • Allow the commutator control to be turned as well/instead of the buttons
  • Addition of the lights for the automatic half barriers at Halterworth
  • Addition of (a much simpler) simulation of the Halterworth crossing box before its automation
  • Addition of a tutorial mode
  • Correctly handle shunt movements
  • Get Eastleigh to honour the direction lever
  • Possibly add a 1909 variant (either just the timetable (most likely) or its map as well)
  • Add (fake) position lights for the sidings and add some train movements for those too
  • Version: 3.244.0
  • Author: David Vines
  • Last Updated: 2023-02-23T13:20:14Z
  • Requires WordPress Version: 4.0 or higher
  • Tested up to: 6.1.1
  • License: Uses sounds by Alexander available from Orange Free Sounds used under the "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)" license and the segment display by Rüdiger Appel available from 3quarks used under the "Attribution 3.0 Unported (CC BY 3.0)" License. Javascript (other than that for the segment display) and php code in the plugin may used under the 3 Clause BSD license.

Change Log

3.244.0 - 23 February 2023

Tweak the size of the bell push buttons

3.238.0 - 22 January 2023

Fix indentation of lever label annotations

3.226.0 - 12 January 2023

Fix css errors

3.161.0 - 09 September 2021

Fix update detection logic

3.157.0 - 21 July 2021

Common up wordpress plugin updating logic with my other plugins

3.153.0 - 21 July 2021

Fix updating logic!

3.108.0 - 29 March 2021

Update URL of the details page

3.101.0 - 13 March 2021

  • Fix estimated time to leave section when something happpens between parts of the traversal of the section.

3.100.0 - 01 March 2021

  • Add a timetable for 19 Feb 2021 when there were major engineering works in southampton so the GWR services were diverted via Eastleigh and the SWR service terminated at Romsey (and used line to Eastleigh to change platforms), all while the freight services are also diverted via Eastleigh and an Engineering Train from Southampton needs to return to base.

3.99.0 - 01 March 2021

  • Refactor code of how change of destination works fixing some minor bugs in the process

3.76.0 - 28 January 2021

  • Add support for self-hosted update notification

3.64.0 - 29 May 2020

  • Adjustment to the overlaps for the platforms. Adjusted the train's movement on the up line to extend the track circuit for C to include the track between the platform and the points controlled by lever 8

3.63.0 - 28 May 2020

  • Only one pull on levers 3 and 13 is permitted after the line is cleared by the relevant remote box

3.62.0 - 24 May 2020

  • Track circuits now overlap (based on the actual overlaps recorded on the 1973 track plan). There still some tweaking to do here, particularly for the artificial track circuits for the platforms
  • Improved train timings. Again based on the 1973 track plan. The current trains use modern train speeds (i.e. 80 mph for the passenger trains)
  • Commutator locked up to the signal box

3.56.0 - 02 May 2020

Many changes including:

  • Additionally lock levers based on the track circuits occupied
  • Reduce the time gap between Train Entering Section and the next track circuit being occupied
  • Revised how the timetable and active trains are shown
  • Have the remote boxes complain if things are out of sequence (including a missing Train out of section, or a commutator is not reset)
  • Trains now verify points are as expected by the train (and the driver will complain if mis-set
  • Train driver will call if they are held at a signal for over a minute
  • Adding multiple trains will add the trains with different train codes (up to ten, then numbers will cycle)
  • Train drivers will check the next track circuit is unoccupied before entering the next section (note: this should only occur if signals are not replaced by the signaller after trains pass them)
  • Remote boxes will wait five seconds before offering a new train once a train leaves the section
  • Remote boxes will ignore offers while the line is occupied
  • The code that recognises bell pushes has been overhauled. Long pauses are now only recognised if it is where a long pauses could be and if it is at least quarter of a second longer than the average for the other pauses

3.50.0 - 11 April 2020

Minor adjustments to train timings. Minor refactoring of how the remote boxes handle bell pushes when they expecting a train entering section bell code.

3.49.0 - 10 April 2020

Initial Version


The information on this page was retrieved by Plugin Information Version 3.263.0.

Feeds

First published 26th March 2020 (Last Modified 7th February 2021)

I used to follow a whole bunch of RSS feeds. When Google stopped its RSS reader back in 2013, I converted this very web page on my personal site to gather RSS feeds for me. However my personal usage of that page steadily dropped and in 2019 (which, by then, was based on WordPress) I converted the site to a set of static pages I concluded that maintaining that page was basically infeasible. However I also have a policy of trying to avoid 404 errors for URLs that previously existed. Now, to be fair, I had broken that rule as I've only today noticed that the URL for my 'feeds' page no longer has a page backing it. This is to rectify that error.

As a memoriam, I used to follow RSS feeds from Slashdot, Coding Horror, Cédric Beust's Otaku blog, Igor Ostrovsky Blogging, Bruce Schneier's Blog, Coding Cookies, Cheshire Engineering, The secret barrister, Mark Evanier (Writer of Groo), Patrick Smith (Ask the Pilot), Humble Bundle, Rosemary Kirstein, Sue and Matthew,1 and Syndey Padua. It's interesting to note that most of these haven't been updated in years!

Footnotes

  1. Oxford comma used here to avoid ambiguity.

TablePressNoCacheCommentExtension Plugin Details

Description

This plugin suppresses the comment that TablePress adds to indicate that it has inserted the table contents from a cache rather than rerendering the table. When using static site generation and a library system to help minimise the changes to the html this comment causes a "spurious" change to the html resulting in an unnecessary change to the file to be indicated. This extension to TablePress simply suppresses that comment.
  • Version: 3.161.0
  • Author: David Vines
  • Last Updated: 2021-09-09T14:09:19Z
  • Requires WordPress Version: 4.0 or higher
  • Tested up to: 6.0
  • License: Although I claim sole ownership of the copyright for this plugin, I hereby grant permission to use this plugin under the terms of the GNU General Public License, version 2 license.

Change Log

3.161.0 - 09 September 2021

Fix update detection logic!

3.157.0 - 21 July 2021

Fix updating logic!

3.153.0 - 21 July 2021

Common up plugin updating code

3.108.0 - 29 March 2021

Update URL of the details page

3.76.0 - 28 January 2021

  • Add support for self-hosted update notification

3.40.0 - 23 February 2020

  • Initial Version

The information on this page was retrieved by Plugin Information Version 3.263.0.

Automating the static upload

First published 14th February 2020 (Last Modified 9th January 2021)

I've automated some of my static upload process. This post is partially to provide a new post and partially to document/record the automatic part of the process. I created a batch script that generates a winscp script to upload files that changed, and will show the other differences (file adds and deletes) involved in the process. That script is:

@echo off
setlocal ENABLEDELAYEDEXPANSION
fossil extras >%temp%\fossil.out
for /f "delims=" %%a in (%temp%\fossil.out) do (
 fossil add %%a
)

set localdir=%cd%
set remotedir=/home/djvines/blog.tremlas.com

fossil status >%temp%\fossil.out
echo open blog.tremlas.com >%temp%\winscp.txt
for /f "delims=" %%a in (%temp%\fossil.out) do (
 set string=%%a
 for /f "tokens=1,2" %%c in ("!string!") do (
  set dz=%%d
  if "%%c"=="EDITED" echo put %localdir%\!dz:/=\! %remotedir%/%%d >>%temp%\winscp.txt
  if not "%%c"=="EDITED" echo !string!
 )
)
echo exit >>%temp%\winscp.txt
echo to run script execute:
echo "c:\Program Files (x86)\WinSCP\WinSCP.com" /script=%temp%\winscp.txt

Going static

For a variety of reasons I reckon it's time to convert the public facing version of my website to go to a static version. The reasons include:

  • After the suspension of En Garde there's no dynamic input to the site other than my own (When I restart that campaign I will need to modify the hosting mechanism to provide the form processing - I'll cross that bridge when I get to it)
  • It'll make the site more secure (no WordPress admin on the public version of the site)
  • No more annoying emails from my web host encouraging me to upgrade from a shared host to a VPS due to reaching memory limits (presumably due to the wordfence plugin).

I'm using the Simply Static plugin though I did have to handle some quirks due to the private server sharing the same machine as my fossil repositories and my popmail spam filter.

It should be noted that this post is also part of an experiment to see how the workflow of updating my website is going to go!

En Garde! Plugin Details

First published 13th October 2017 (Last Modified 12th January 2023)

Description

This plugin adds support for my En Garde! game by:
  • adding a shortcode, enGardeCharacter, to allow a character table to be generated. Examples of use: [enGardeCharacter id="C"] [str is="9" initial="9"] [rapier is="12" initial="12"] [sabre is="12" initial="12"] [cutlass is="12" initial="12"] [con is="15" initial="15"] [end is="135 of 135" initial="135"] [ma is="1" initial="1"] [cash is="32" initial="44"] [allowance is="12" initial="0"] [regiment is="Royal Foot Guards, Private"] [club is="Hunter's"] [mentions is="1"] [stable has="1 horse"] [appointment is="Trooper, King's Escort"] [mistress is="Catherine de Borgonne"] [level is="11" initial="12"] [location is="In Paris"] [/enGardeCharacter]
  • adding a shortcode to display a form to allow the submission of orders for a character. Examples of use: [enGardeOrderTemplate id="C"]

    The id used must match one of those from a character on the same page (the javascript used for validation needs to look up information from the table).

Change Log

3.226.0 - 12 January 2023

Remove exception from typeof check for unit testing. Remove a line break from the form template

3.168.0 - 04 January 2022

Update to add '!' to En Garde! where possible

3.167.0 - 03 January 2022

Add a break before the horizontal rule after the order template

3.161.0 - 09 September 2021

Fix update detection logic!

3.157.0 - 21 July 2021

Fix updating logic!

3.153.0 - 21 July 2021

Common up updating logic

3.108.0 - 29 March 2021

Update URL of the details page

3.90.0 - 07 February 2021

  • Don't provide a target url for order form if orders aren't being accepted

3.80.0 - 28 January 2021

  • Restore the insertion of the game month in the order form

3.76.0 - 28 January 2021

  • Add support for self-hosted update notification

3.36.0 - 22 December 2018

  • Disable the submit button if submissions are disabled

3.26.0 - 01 January 2018

  • Save last order submit details

3.24.0 - 20 December 2017

  • Fix leaving/joining club

3.13.0 - 05 December 2017

  • Fix investments

3.12.0 - 05 December 2017

  • Add support for investments

3.11.0 - 05 December 2017

  • Fix location @charset directive in stylesheets

3.10.0

  • Remove migration code (for weapon expertise)

3.9.0 - 25 November 2017

  • Add support for automatically updating expertise

3.6.0 - 21 November 2017

  • Fix wealthy companions

3.5.0 - 21 November 2017

  • Version number scheme changes
  • Add support for battle outcomes

20171115-1410 - 15 November 2017

  • email address fixes

20171114-1440 - 14 November 2017

  • Bug fixes

2.0.0.20171111-1313 - 11 November 2017

  • Better admin

2.0.0.20171105-1511 - 05 November 2017

  • Bug fixes

2.0.0.20171105-1148 - 05 November 2017

  • Improved hints and checks

2.0.0.20171105-0917 - 05 November 2017

  • Sort out last_orders (move into own db table)

2.0.0.20171104-1050 - 04 November 2017

  • Add playhouses and admin support

2.0.0.20171030-1717 - 30 October 2017

  • Refactoring of the javascript

2.0.0.20171024-1626 - 24 October 2017

  • Various bug fixes

2.0.0.20171013-1012 - 13 October 2017

  • Initial Version

The information on this page was retrieved by Plugin Information Version 3.263.0.