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 | |
/** Template Name: Payment template */ | |
if (! defined('ABSPATH')) { | |
exit; // Exit if accessed directly. | |
} | |
function generateNABTransactFingerprint($vendorName, $paymentReference, $paymentAlert, $products, $merchantTransactionPassword) | |
{ |
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 | |
// disable the admin menu | |
add_action( 'admin_menu', function() { | |
remove_submenu_page( 'tools.php', 'site-health.php' ); | |
}); | |
// block site health page screen |
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 | |
/** | |
* Class CustomPage_Frontend | |
*/ | |
class CustomPage_Frontend { | |
private static $instance = null; | |
public $path = 'custompage'; |
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 | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); | |
$ch = curl_init('https://www.howsmyssl.com/a/check'); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$data = curl_exec($ch); | |
curl_close($ch); |
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 | |
$order = wc_get_order(34152); | |
$mailer = WC()->mailer(); | |
$mails = $mailer->get_emails(); | |
if ( ! empty( $mails ) ) { | |
foreach ( $mails as $mail ) { | |
if ( $mail->id == 'failed_order' ) { | |
$mail->trigger( $order->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
# arg1 : bucket | |
# arg2 : max sub folders / days | |
total=`s3cmd ls s3://$1/ | wc -l` | |
# remove old folders if move then max | |
if [ "$total" -gt "$2" ] | |
then | |
# clean up s3 backups | |
s3cmd ls s3://$1/ | while read -r line; |
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
# arg1 : bucket | |
# arg2 : project path | |
# arg3 : backup path | |
# arg4 : max s3 | |
# Switch to the docroot. | |
cd $2 | |
# Backup the database. |
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
RewriteEngine On | |
RewriteCond %{HTTP_HOST} \.dev$ [NC] | |
RewriteCond %{HTTP_HOST} ^dev\. [NC] | |
RewriteCond %{HTTP_HOST} \.uat$ [NC] | |
RewriteCond %{HTTP_HOST} ^uat\. [NC] | |
RewriteRule ^robots.txt robots_dev.txt [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
if (typeof console !== "undefined") { | |
window.console.log.apply(console, [ | |
'\n %c Made by Itomic %c %c %c http://www.itomic.com.au %c \n\n', | |
'color: #fff; background: #1dbeea; padding:5px 0;', | |
'background: #1dbeea; padding:5px 0;', | |
'background: #222222; padding:5px 0;', | |
'color: #fff; background: #222222; padding:5px 0;', | |
'background: #fff; padding:5px 0;' |
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 | |
add_filter('http_request_args', function( $r, $url ) { | |
if ( 0 === strpos( $url, 'https://api.wordpress.org/plugins/update-check/1.1/' ) ) { | |
$blocked_plugins = array( | |
'plugin_name_1', | |
'plugin_name_2', | |
'plugin_name_3' | |
); |
NewerOlder