Author: Gavin Simpson
Creating a WordPress Class with Backend and Frontend functionality
Firstly, a bare bones PHP class. Add this in it’s own file, eg mynewclass.php, and include it in functions.php Now a slightly more sophisticated one to add an admin menu item and page, with page tabs.
Ubuntu 22.04 Fix Broken Pipe on apt-get
apt-get -o DPkg::Options::=”–force-overwrite” install <package name> This will force an overwrite.
Ubuntu 20.04 Node Server on localhost with SSL
To get SSL on your localhost for testing purposes you will need a SSL key and certificate generated. I do the following in a certs directory to call up later in the node server app. Import the rootCA.pem file into your browser under the ‘Authority‘ tab. Then create server.cnf as follows … and v3.ext as…
Installing Node on Ubuntu 20.04
Step 1 Do the usual first, i.e. and Step 2 Make sure npm is up to date as well It might take some doing to achieve the above, as I had a few issues to deal with ion Ubuntu 20..04 Firstly I had to update npm and node : Then I had to change the…
SQL to extract order report
This SQL string will extract multiple meta values from an order.
Ubuntu 18.04 Disable Auto Time Updates
Firstly disable automatic times Then simple set the time manualy, or the time itself will still automatically update. To re-enable automatic date/time updates use To check the status use You should see something like below. the three ‘no’ mean it’s disabled.
Cleaning Ubuntu boot partition
Often the Ubuntu upgrades will fail fue to a no space error. The only solution is to remove old kernels manually. The first step is to show which kernel you are currently running, as you do not want to delete this one. So change to the boot directory for simplicity and list all existing kernels…
WP REST with JWT
Using the WordPress REST API with JWT authentication Step 1. Install this plugin => https://wordpress.org/plugins/advanced-access-manager/. The free version will suffice. This goes on the site you will be xtracting data from. The REST API must be enabled in the WordPress settings. Step 2. Configure the plugin and on it’s Settings tab add the Secret as…
WordPress Security
This applies to self-managed Apache2 servers. Shared servers require different permissions, for example wp-config : set that file’s permissions to 440 or 400. Site Lockdown File permissions to lock down website, from the websites home folder. Do this from the root directory for example and you will break your server. Change the folder ownership of…
SSL Localhost
To enable ssl on a localhost website, and stop Chrome from showing is as “unsafe” …. Pertains to Ubuntu 18.04 Bionic, and running Apache 2.4.29 Create localhost.cnf Then use openssl to generate the certificates in 3 steps Edit /etc/apache2/sites-available/default-ssl.conf as below Enable the site … and restart Apache2 As things stand you will be asked…