Make Me Static, Static Site Generator for Git publication
Make Me Static, Static Site Generator for Git publication

Make Me Static, Static Site Generator for Git publication

Gareth Bult

Welcome to the Make Me Static Plugin for WordPress. This plugin is a static site generator and aims to create and maintain a static copy of your WordPress website within a Git repository.
The intention is that this Git repository can be used as a source for a static page provider who can monitor Git updates and automatically publish a static copy of your site from the current contents of your repository.
The plugin provides a customised sitemap and change tracking which connects to the external MMS service which does all the heavy lifting.

What do we rely on?

This plugin employs a third party service to scan a WordPress site and store the resulting static copy in a Git repository. The service retains a metadata database for the site which includes file names, sizes and modification times, together with any credentials that have been added when creating a profile. (Sensitive credentials and other information is encrypted at rest). The external service is responsible for all scanning and processing activities to mitigate strain on the WordPress server.
The only private data transferred to the external service is the information you enter when creating a profile. All other information is obtained via an anonymous external scan, hence publically available.

The plugin references the third party service via directory services which are accessed at;
* https://mms-directory-1.madpenguin.uk
* https://mms-directory-2.madpenguin.uk
* https://mms-directory-3.madpenguin.uk

This in turn will refererence the crawler allocated to the site in question. Crawler URLs typically take the form https://mms-crawler-(n).madpenguin.uk. For on-premisis crawlers the
url will also include a customer-id prefix, but will always end in “.madpenguin.uk”.

Useful links relating to the 3rd party service

Note that this in an integrated solution, the 3rd party service is owned and operated by the plugin authors on a combination of cloud hosted and on premisis equipment.

How Does it work?

The WordPress site is scanned by the MMS service under direction from the WordPress plugin. This off-loads the scanning process to specialised software aims to minimise the loading on the WordPress server while scans are in progress.

There are three types of scan that can be performed;

  • An “update”, which literally only looks at entries with changed sitemap timestamps
    (this is very quick and great for typo’s and any changes that only affect a single page)

  • A “synchronise”, typically this will scan every asset on the WordPress site and compare a checksum of each asset against it’s database to see if it’s changed since the last scan. Any changes are then transferred to the connected Git repository.

  • A “Git verification”, this is like a “synchronise”, but also scans the Git repository for assets that are no longer referenced by the site (and removes them).

As the site is scanned “from the outside” there should be no risk of the plugins actions exposing any data that isn’t already public. By the same token the external service has no ability to modify WordPress so the security footprint of the plugin is tiny.

Feature bullet points

  • The plugin provides a way to produce a static copy of your website in a git repository
  • The result is compatible with both Github pages and CloudFlare pages for automatic publication
  • Multiple profiles are supported for (A+B_…) testing
  • Various scan rates are supported from one page per 5s to 7 cores flat out
  • Scheduled updates are supported and automated scanning
  • Currently “Gitlab” is supported with plans for GitHub and on-prem Gitlab
  • Support push services (WebPushr) to automatically notify subscribers on scan completion
  • Issue tracker for each profile to diagnose problems
    • Handles current and historical issues
    • Ability to acknowlede or delete issues when resolved
  • GUI access to the internal asset database
    • Search as you type filtering
    • Pinning (force assets to be scanned regardless of perceived change)
    • Selective / manual queueing of assets for testing
  • Ability to include manual / static assets in the scan (in the WP tree but unmanaged by WP)
  • Ability to exclude specific files and folders
  • Setup Wizard is included for a guided profile creation

The Technology

  • The Plugin presents as a WordPress Admin / plugin page
  • Backend connections are made over websockets using PKI
  • The crawler respects Robots.txt, (make sure the “MMSbot” agent is allowed on your site)
  • MMS Javascript runs in an isolated module and CSS “plays nice” with WordPress
  • Global CSS and theming is partitioned and user editable (if you feel the need …)
  • All of the front-end JS code and PHP is either GPL2 or MIT licensed
  • Backend-code is all based on the Orbit Framework (the framework and DB are all MIT licensed)
  • Orbit is a ‘real time’ framework, so the admin panel is 100% reactive.
    • Progress bar updates are typically “per percent” granularity
    • All statuses, totals, etc, are updated as they happen
    • Unless you’ve hit a but, there is no mileage in reloading the MMS plugin page
    • If you change your license information, it will change in real-time
    • If the crawler allocated to your site changes (perhaps due to a license upgrade) then the
      appriate version of the crawler UI will be uploaded “into” the page from the new
      crawler.
Are all the features free?

Yes, the license relates to number of scans per day, scan rates, database size etc

Will it work on any WordPress site?

In theory yes, although compatibility and interaction with with plugins will vary. The production process tries to be be clever when it comes to rewriting URL’s for AJAX, forms etc, but given the number of potential edge cases this will always be ongoing. (please request support for specific plugins if you’re having problems. We can’t guarantee to add support, but we’ll be happy to take a look to see what’s involved.)

How “good” is it?

For a few examples, take a look at;
* https://makemestatic.com
* https://linux.uk
* https://madpenguin.uk
* https://nutpress.co.uk

The Crawl doesn’t find any pages?

  • Make sure you set your permalink structure to be something other than “Plain” as this mode won’t generate a file and folder structure suitable for a static site.
  • Make sure you have NOT enabled “short tags”, so you need “short_open_tag = Off” in your PHP config

How quick it is?

This depends to an extent on the speed of your website, but also on the crawl rate you select. If you are running your WordPress effectively as an off-line copy and presenting your main site as a static, and are prepared to hammer your WordPress instance when it comes time to update, it’s pretty quick.

Looks like the scan rate isn’t being applied?

The scan rate ONLY affects pages, it is assumed static assets will be subject to caching hence will be scanned as fast as the scanner can go based on the number of cores at it’s dispostal.

The progress bar isn’t linear?

No, it’s based on the number of items remaining vs the number scanned. As assets are “discovered”, they will be added to the “pages remaining” total. There is no way of knowing how many assets will be discovered, so the progress indicator is a “best effort”.

If no changes are detected on the site, will the Git repository see a commit or PR?

No. If it does, then the plugin thinks something changed. You will be able to see what got updated by looking at the commit / PR on your Git control panel. (or with “git diff”)

The label next to my profile says “Pending”, what does that mean?

It means the plugin thinks “something” has changed on the site. It watches for changes to posts, pages, comments, images, plugin updates etc. It might be the change doesn’t affect your site so a sync will have no effect – but it has no way of know that until you actually do a sync.

How to I add specific static assets to the process?

In your “wp-config.php” file, you need to add a define section, in this example we’re including the “static” folder in your wordpress directory, so all assets in this folder tree will be included.

define( 'MAKE_ME_STATIC_FOLDER_WLIST', ['static']);
  • To prevent folders from being scanned, in this example we’re excluding an entire plugin;

    define( ‘MAKE_ME_STATIC_FOLDER_BLIST’, [‘wp-content/plugins/my-bad-plugin’]);

Does this work over HTTP?

  • No. Your site will need at least to have a front-end HTTPS front-end. Always make sure your site address in Settings -> General reflects the HTTPS address you want the plugin to use.

More Detail can be found here …
https://madpenguin.uk/make-me-static/

Simply amazing

By NickS2 on September 5, 2024

This plugin is really amazing when compared to other plugins, since it lets you automate most of the stuff that would otherwise need to be done manually. The best thing is that once you setup your GitLab account, it will be synced to it and published to the domain for your static that you assign via your DNS register. So you can have site a.mysite.com as a WP website, and then push the static files to git repo which would then resolve to mysite.com, thus making sure you have static website on the front for the visitors. The best thing is that after the first sync there are incremental updates, so you don't need to sync everything again. In case you use any caching on server side, like Varnish, you may need to tweak it in case it prevents loading of the plugin page. I have installed the plugin on my website, and will be installing it for my organization too. The author is very responsive to support requests and I am looking forward towards GitHub integration.

A whole new ball-game

By linuxhostmaster on September 2, 2024

I've had performance problems with WP for as long as I can remember, and security worries, and availability worries. I finally have a setup where I can make a bunch of changes to the site and click on "Sync", and within a minute the static version is "live" with the changes. To be fair it takes a little bit of doing to get set up in the first place, but the end result is worth the effort.

1.0.247

Back-end crawling improvements

  • Crawler: Better support form /wp-json and dynamic URL’s
  • Crawler: Fixed reporting on invalid GitLab token
  • Crawler: Fixed exception report in site validation fail
  • Crawler: Changed behaviour when dealing with local (#) links
  • Crawler: Changed behaviour when dealing /wp-json and oembed

1.0.239

Crawler improvements and documentation

  • Docs: New site at https://makemestatic.com
  • Crawler: Better support for oembed mapping
  • Crawler: Fixed auto-robots.txt location
  • Crawler/UI: Better re-conection on server restart

1.0.231

Useful fixes for new users

  • UI: Better error trapping for plain permalinks
  • UI: Better error trapping for sites using http (not https)
  • Crawler: Better handling on non-specific script tags
  • Crawler: Better handling of /wp-admin links
  • Crawler: Better detection of mixed mode URL’s (http+https)
  • Better support for http behind CloudFlare tunnels

1.0.213

Misc Bug fixes and edge case traps

  • Report and block if site is configured with “plain” permalinks
  • Report and block if WP back-end is intefering with WP JSON API query strings
  • Fix some spelling errors and comments

1.0.193

Updating readme.txt

  • Changed tags to static site generator, performance, security, speed, static
  • Changed short Description to This plugin is a static site generator for your WordPress instance that stores and updates a static version of your site inside a Git repository.

1.0.191

Updating assets and readme.txt

1.0.189

WordPress Directory Initial Release

  • Integrated subscriptions system powered by stripe
  • Email address verification and notification system
  • Subscription based resources

1.0.102

Third submission:

  • composer.json was present in the source repo but not in the plugin zip file
  • documentation was in README.md rather than readme.txt, transferred

1.0.97

Second submission with changes to namespacing and various documentation changes. (no change in functionality)

1.0.58

Initial Directory Submission

Reviews

5 out of 5 stars

  • Version: 1.0.247
  • Last updated: 3 weeks ago
  • Active installations: 10
  • WordPress version: 6.5
  • Tested up to: 6.6.2
  • PHP version: 7.0