sshfs <USERNAME>@<SERVER>:/ /home/<PATH TO LOCAL>/ -p 2222
fusermount -u ~/
sshfs <USERNAME>@<SERVER>:/ /home/<PATH TO LOCAL>/ -p 2222
fusermount -u ~/
<?php | |
/** | |
* Checks that the filename has correct extensions | |
*/ | |
function validate_export( $filename ){ | |
$ext = explode(".", $filename); | |
if( $ext[1] && $ext[1] != "sql" ){ | |
return false; | |
} | |
if( $ext[2] && $ext[2] != "gz" ){ |
<?php | |
// this will probably take a while to run | |
// so don't refresh the page, if the browser complains | |
// continue to wait | |
// -1 posts per page will give ALL | |
// will default to 10 if blank | |
// default blog posts | |
$blog_args = array( |
<?php | |
// Allow svg: https://wpengine.com/resources/enable-svg-wordpress/ | |
add_filter( 'wp_check_filetype_and_ext', function($data, $file, $filename, $mimes) { | |
global $wp_version; | |
if ( $wp_version !== '4.7.1' ) { | |
return $data; | |
} | |
$filetype = wp_check_filetype( $filename, $mimes ); | |
return [ | |
'ext' => $filetype['ext'], |
<?php | |
// Add to functions.php | |
// Remove the "[vc_*]" shortcodes usually found during migrations | |
// Add this shortcode to a debug/test page and visit it | |
// The page will render and dump all new post/pages to the screen | |
// This can take a long time if there are a lot of pages/posts | |
add_shortcode('remove-vc-shortcodes', 'remove_vc_shortcodes'); | |
function remove_vc_shortcodes() { | |
$pattern = '/\[\/?vc_.*\]?/i'; |
# Python script to find-replace an exported DB | |
# For use when the php version timeout's or exceeding memory limits | |
# export db you want to update, rename it to backup.sql | |
# place backup in same dir as this script | |
# run script | |
# import the out.sql file | |
import re | |
from pprint import pprint |
<IfModule mod_headers.c>
Header set X-Frame-Options SAMEORIGIN
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options "nosniff"
Header set Referrer-Policy "strict-origin-when-cross-origin"
Header set Strict-Transport-Security "max-age=86400; includeSubDomains;" env=HTTPS
Header set Permission-Policy "accelerometer=Origin(), autoplay=(), camera=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), publickey-credentials-get=(), usb=()"
Header always unset X-Powered-By
Header always unset server