wp rewrite flush
- Flush rewrite ruleswp media image-size
- List registered image sizeswp media regenerate --yes
- Regenerate all mediawp search-replace https://old.domain.tld https://new.domain.tld
- Replace an old domain in databasewp db export --add-drop-table
- Backup databasewp db import backup.sql
- Import backup in databasewp maintenance-mode activate
- Maintenance mode (usewp maintenance-mode deactivate
to return to normal)wp rewrite list
- Show rootes listwp search-replace "old_post_type" "new_post_type" wp_posts --include-columns="guid,post_type"
- Rename post_type (use--dry-run
to check what it will do)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=$1 # <-- wordpress root directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Path to the Git user file | |
GIT_USERS_FILE=~/.gitusers | |
# Check if Git is installed | |
if ! command -v git &>/dev/null; then | |
echo "Git is not installed on this machine" | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('.wpml-translation-setup-table input[type="radio"][value="3"]').forEach(input => { input.checked = true; }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BEGIN MAINTENANCE MODE | |
# ADD your IP address to gain access. Local IPS for local testing | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REMOTE_ADDR} !^192\.168\.0\.0 | |
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1 | |
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f | |
RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f | |
RewriteCond %{SCRIPT_FILENAME} !maintenance.html | |
RewriteRule ^.*$ /maintenance.html [R=503,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @example | |
*.try { | |
* const result = await retry((attempt) => { | |
* if ( Math.ceil(Math.random() >= .5) ) { | |
* return 'ok'; | |
* } | |
* | |
*. console.log('-> nope'); | |
* throw new Error('Failed after ' + attempt + ' tries'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @example | |
* const item = watch({}, (value, prop, source) => { | |
* if (prop === 'foo' && !value) { | |
* return 'default_value'; | |
* } | |
* | |
* if (prop === 'baz') { | |
* return 'nope'; | |
* } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import debounce from 'lodash.debounce'; | |
/** | |
* @example | |
* import { reactive, watch } from './reactivity'; | |
* | |
* const r1 = reactive({ isReady: false }) | |
* const r2 = reactive({ x: 1 }) | |
* | |
* setTimeout(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const colors = require('tailwindcss/colors'); | |
const themeJson = JSON.parse(fs.readFileSync('./theme.json')); | |
module.exports = { | |
theme: { | |
extend: { | |
colors: useThemeJSONWith({ | |
// brand | |
primary: colors.purple, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copy properties from source to target. | |
* @param target | |
* @param source | |
*/ | |
function copyProps(target, source) { | |
const properties = Object.getOwnPropertyNames(source); | |
properties | |
.concat(Object.getOwnPropertySymbols(source)) |
NewerOlder