This file contains hidden or 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 CustomOrderEmail extends \WC_Email { | |
// This is a just a simple example. See \WC_Email and child classes for more examples | |
public function __construct() { | |
$this->id = 'custom_order_email'; | |
$this->title = 'Custom Order Email'; |
This file contains hidden or 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 LocalValetDriver | |
* | |
* This class demonstrates how we might go about proxying any missing local images to a remote host. i.e; the production | |
* site. This has been created with WordPress in mind but could be adjusted to work with any other system. | |
*/ | |
class LocalValetDriver extends WordPressValetDriver { |
This file contains hidden or 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: HTTP2 Push scripts | |
* Author: Tom J Nowell | |
*/ | |
function tomjn_get_dep_url( /*\WP_Dependency*/ $dep ) { | |
global $wp_version; | |
$relative = str_replace( site_url(), '', $dep->src ); | |
$ver = $dep->ver; |
This file contains hidden or 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
(function (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
This file contains hidden or 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 | |
include_once "./randomString.php"; | |
$s = []; | |
for ($x = 0; $x < 100000; $x++) { | |
$obj = new stdClass(); | |
$obj->name = randomString(); | |
$obj->age = rand(1, 100); | |
$s[] = $obj; |
This file contains hidden or 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 | |
# Check: https://onexa.nl/wordpress/toolbar-link-redis-object-cache/ | |
/** | |
* Add a link to the Admin Toolbar to easily flush the Redis cache (Redis Object Cache plugin) | |
* | |
* @author Hiranthi Herlaar, onexa.nl | |
* @version 2.0 | |
* |
This file contains hidden or 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 BenchMarker | |
* @author Phil Kurth <[email protected]> | |
* | |
* A simple benchmarking utility. Easiest way to use this: | |
* | |
* BenchMarker::start(); | |
* | |
* … run stuff here … |
This file contains hidden or 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
# Mailhog | |
MAIL_MAILER=smtp | |
MAIL_HOST=0.0.0.0 | |
MAIL_PORT=1025 | |
MAIL_USERNAME=null | |
MAIL_PASSWORD=null | |
MAIL_ENCRYPTION=null |
This file contains hidden or 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
# Lists revision post IDs and their meta data count in descending order | |
SELECT post_id, count(*) AS count FROM wp_postmeta LEFT JOIN wp_posts ON post_id = ID WHERE post_type = 'revision' GROUP BY post_id ORDER BY count DESC; | |
# Tells you how many (total figure) meta rows belong to revision posts | |
SELECT count(*) as total_revision_meta FROM wp_postmeta INNER JOIN wp_posts ON post_id = ID WHERE post_type = 'revision'; | |
# Lists the post_id number of revisions for posts in descending order by number of revisions | |
SELECT post_parent as post_id, count(*) AS n_revisions FROM wp_posts WHERE post_type = 'revision' GROUP BY post_parent ORDER BY n_revisions DESC; | |
This file contains hidden or 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 | |
/** | |
* Display the checkout steps so the customer knows where they are. | |
* | |
* The output uses classes of Bootstrap 4 and the icons of FontAwesome (Free) | |
**/ | |
function onx_woocommerce_checkout_steps() | |
{ | |
echo '<nav id="woo-checkout-steps" class="nav nav-pills nav-justified mb-4" role="navigation">'; |