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
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
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
# USEFUL PLESK COMMANDS | |
# restart plesk | |
/etc/init.d/psa restart | |
# reload plesk configs (useful for vhost.conf) | |
/usr/local/psa/admin/sbin/websrvmng -a -v | |
# restart qmail | |
service qmail restart |
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 | |
# Bash script to clone an easyengine webiste installation onto another (the destination site must exist already) | |
# To debug, use set -xe | |
# I personally prefer to create an alias, after I placed this file at ~/scripts/ | |
# echo 'alias eeclone=". ~/scripts/eeclone.sh"' >> ~/.bash_aliases | |
# . ~/.bash_rc to load the new alias | |
# Note that the script will also create a log at the /var/www/destinationdomain.com/logs/ folder | |
log () | |
{ |
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
<?php | |
/** | |
* Plugin Name: Filter WooCommerce Orders by Payment Method | |
* Plugin URI: http://skyverge.com/ | |
* Description: Filters WooCommerce orders by the payment method used :) | |
* Author: SkyVerge | |
* Author URI: http://www.skyverge.com/ | |
* Version: 1.0.0 | |
* Text Domain: wc-filter-orders-by-payment | |
* |
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
#!/usr/bin/env bash | |
# Bash script to back up an easyengine webiste installation | |
# To debug, use set -xe | |
# I personally prefer to create an alias, after I placed this file at ~/scripts/ | |
# echo 'alias eebackup=". ~/scripts/eebackup.sh"' >> ~/.bash_aliases | |
# . ~/.bash_rc to load the new alias | |
# Note that the script will also create a log at the /var/www/backupdomain.com/logs/ folder | |
set -e | |
LOG_FILE="/var/www/$1/logs/eebackup.log" |
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
public function gens_send_email($user_id,$coupon_code) { | |
if ( !$user_id || !$coupon_code) { | |
return false; | |
} | |
global $woocommerce; | |
$mailer = $woocommerce->mailer(); | |
$user_info = get_userdata($user_id); |
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
<?php | |
/** | |
* Update site to use test mode in local and staging environments | |
*/ | |
function prefix_env_settings() { | |
// If settings have already been updated, return early | |
if ( 1 == get_transient( 'staging-settings-updated' ) ) { | |
return; | |
} |
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
<?php | |
/** | |
* Update site to use test mode in local and staging environments | |
*/ | |
function prefix_env_settings() { | |
// If settings have already been updated, return early | |
if ( 1 == get_transient( 'staging-settings-updated' ) ) { | |
return; | |
} |
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
<?php // from https://web.archive.org/web/20161021193734/https://andrewho.nl/encrypt-decrypt-strings-php-easy-way/ | |
function dec_enc($action, $string) { | |
$output = false; | |
$encrypt_method = "AES-256-CBC"; | |
$secret_key = 'This is my secret key'; | |
$secret_iv = 'This is my secret iv'; | |
// hash | |
$key = hash('sha256', $secret_key); |