- determine site ID (for example:
5
) - create a spot where the new website will live (for example:
/www/mywebsite.nl/public
) - install a new WordPress
cd /www/mywebsite.nl/public ; wp core download
- copy theme(s) and plugins
# https://gist.github.com/rmpel/a54ffc349ecdba57c5dd7f33b81263dd | |
# | |
# This file is for unifying the coding style for different editors and IDEs | |
# Or at least; that is the plan. Currently FULLY supported IDEs are: | |
# - phpStorm | |
# | |
# Tried and failed; | |
# - VS Code (Supports .editorConfig, but does not support any extended rule-set) | |
# | |
# More information on the file format: |
[rules] => Array ( | |
[category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2] | |
[category/(.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2] | |
[category/(.+?)/page/?([0-9]{1,})/?$] => index.php?category_name=$matches[1]&paged=$matches[2] | |
[category/(.+?)/?$] => index.php?category_name=$matches[1] | |
[tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2] | |
[tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2] | |
[tag/([^/]+)/page/?([0-9]{1,})/?$] => index.php?tag=$matches[1]&paged=$matches[2] | |
[tag/([^/]+)/?$] => index.php?tag=$matches[1] | |
[type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?post_format=$matches[1]&feed=$matches[2] |
<?php | |
// Backfill missing uploads | |
// build your dev copy using plugins, theme and database | |
// don't download all uploads | |
// access an image on it, for example /wp-content/uploads/2021/10/some-image.png | |
// (of course, just loading a page with images on it will do) | |
// you will get 404s on all images | |
// place this file in mu-plugins folder | |
// try to access the url/page again |
<?php | |
/** QUICK AND VERY DIRTY */ | |
header('Content-Type: text/plain'); header('Content-Disposition: attachment; filename=crawl.csv'); | |
?> | |
type,path,timestamp,date | |
<?php | |
___T(__DIR__); | |
function ___T($s) { | |
$l = array_merge( glob($s .'/.*'), glob($s .'/*') ); |
<IfModule mod_headers.c> | |
SetEnvIf Origin "http(s)?://(www\.)?((subdomain.)?yourdomain.nl)$" AccessControlAllowOrigin=$0 | |
Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin | |
Header merge Vary Origin | |
</IfModule> |
<?php // wp-content/mu-plugins/ga4.php - GA4 tracker boilerplate. | |
define('GA_NOT_LIVE', true); // remove for go | |
define('GA4_MEASUREMENT_ID', 'G-XXXXXXXXXX'); // required | |
define('UA_PROPERTY_ID', 'UA-XXXXXXX-YY'); // optional | |
define('GA_ANONYMIZE_IP', true); // optional | |
define('GA_TRACK_ADMINS', false); // optional, defaults to true | |
define('GA_TRACK_EDITORS', false); // optional, defaults to true | |
// we need GA as first thing in the body |
<?php | |
function migrate_webp_express_htaccess_files() { | |
$extra = []; | |
$uploads = wp_upload_dir(); | |
$uploads = $uploads['basedir']; | |
$themes = WP_CONTENT_DIR .'/themes'; | |
$plugins = WP_CONTENT_DIR .'/plugins'; |
#!/usr/bin/env bash | |
### | |
# This script creates a backup using the WP-CLI tool and then stores it in a GIT repository. | |
# As GIT only saves the changes, you have a nice history of stuff that happened on your website. | |
# This is mostly an investigation tool and I have yet to determine the usefulness :) | |
# | |
# p.s., this does not work if git or wp-cli is installed; ergo; does NOT work with Local by Flywheel (unless you ssh into the docker and `sudo apt-get install git`. | |
## |
/** SCSS */ | |
/** Fuck those small screens! */ | |
@for $i from 0 through 16 { | |
@media all and (max-width: ( 375px - ($i*10px) )) { | |
body { | |
zoom: ( 375px - ($i*10px) ) / 385px; | |
} | |
} | |
} |