Gzip and Brotli

Gzip and Brotli compress web pages. Let’s say you are running WordPress and have Litespeed active at server level. You install the Litespeed cache plugin, and set it up. Then you run a test on something like Pingdom and it tells you that Gzip compression is not configured.

And it’s true that it isn’t configured, but it’s because Litespeed uses Brotli for compression.

Check it at GiftOfSpeed

If it is enabled you will see something like this:

Results for: https://maincontrol.co.uk/
Brotli Is Enabled
Original Size: 52.47 KB
Brotli Size (compressed): 15.69 KB
Compression %: 70.1% is compressed
HTTP Status: 200
Request Time: 0.3036 ms
Compression Time: 0.0014 s
Content Type: text/html
Server: Uknown

Margin versus padding in CSS

In CSS, a margin is the space around an element’s border, while padding is the space between an element’s border and the element’s content.

I keep forgetting this and have to look it up time and time again.

Categories CSS

Copy Layer To New Photoshop Document

It used to be that if one isolated a part of a file and copied it with Cmd+C (I am on a Mac) and then Cmd+N, then the new document would be the size of the part one had isolated. And then one could paste in the part one had isolated and it would fit exactly, Not any more – instead the new document is, well I don’t know what it is, but it is not the correct size.

Jain Lemos, a Photoshop professional in the Adobe community forums provides the answer:

Please try checking Use Legacy “New Document” Interface in Preferences on the General tab.

Advanced WordPress Reset

Advanced WordPress Reset is another plugin that will reset and restore a WordPress database to its original state when you want to start from scratch with a site. You can also direct it to clean up the uploads folder, delete comments, remove plugins.

I just used this plugin and then WP Reset that I wrote about before, to clean up a test site to start from fresh.

Make A Disk Image On A Mac

The nice thing about disk images is that you can encrypt them and password protect them.

First make your file or files and pop them in a folder. Then go to Disk Utility (it’s in the Utilities folder in Applications) and then find ‘Files’ in the top line, and choose ‘new image/image from folder.’ Find the folder you want to use and give it a name or keep the one that comes up. Then choose an encryption level and make a password. That’s it. The file will be saved as a .dmg.

If you lose the password you will not be able to recover it from anywhere.

WooCommerce: Setting Different Time Limits To Cancel Orders

In WooCommerce> Settings > Products > Inventory page, you can choose how long the system will hold stock for unpaid orders. When the limit you set is reached, the pending order will be cancelled. Or you can leave the field blank to disable it. That is generally not a good idea, because you might find customers put products in the basket and leave – and soon you will have no available stock to sell.

But what happens if you have a variety of methods of payment, for example credit card or cheque or ban transfer? You can’t set a limit of, say, 60 minutes, because that won’t allow enough time for a bank transfer or for a cheque to arrive.

The WooCommerce Cancel Abandoned Order plugin allows you to set specific time limits to hold stock for different kinds of payment.