Skip to content

Instantly share code, notes, and snippets.

View seb86's full-sized avatar
🚀

Sébastien Dumont seb86

🚀
View GitHub Profile
# Install and activate typical plugins.
plugins:
wp plugin delete hello akismet; \
wp plugin install debug-bar disable-emojis jetpack query-monitor woocommerce --activate; \
# Install, copy and clean up drop-ins.
cache-plugins:
wp plugin install batcache memcached-redux; \
cp wp-content/plugins/batcache/advanced-cache.php wp-content/advanced-cache.php; \
cp wp-content/plugins/memcached-redux/object-cache.php wp-content/object-cache.php; \
@kosso
kosso / WP_API_OAuth_Test_client.php
Last active September 16, 2021 05:30
Test PHP client for Wordpress REST API v2.0 / OAuth1.0a 0.3.0
<?php
//opcache_reset(); // Disable local dev MAMP cache
/*
WP_API_OAuth_Test_client.php
Tested with Wordpress 4.7.1
WordPress REST API - OAuth 1.0a Server v.0.3.0 - https://en-gb.wordpress.org/plugins/rest-api-oauth1/
@jessepearson
jessepearson / add_bcc_to_certain_emails.php
Created October 31, 2016 17:19
Add a BCC to certain defined emails sent from WooCommerce
<?php // only copy this line if needed
/**
* Function adds a BCC header to emails that match our array
*
* @param string $headers The default headers being used
* @param string $object The email type/object that is being processed
*/
function add_bcc_to_certain_emails( $headers, $object ) {
@kloon
kloon / functions.php
Last active October 27, 2021 04:47
WooCommerce 3.2: Add resend admin order email option that was removed
<?php
/**
* This adds back an option to resend the admin new order email from the order edit screen that was removed in WooCommerce 3.2
*/
/**
* Filter to add a new menu to the dropdown
*
* @param array $actions
* @return array
@nternetinspired
nternetinspired / gist:7482445
Last active February 24, 2022 17:20
Load Disqus comments only on demand if you give a shit about page weight and your visitors. Even with no comments, i.e. an empty comment form, calling Disqus will load an extra 226Kb. If your page has comments this can be far higher. This Gist accompanies my blog post: http://internet-inspired.com/wrote/load-disqus-on-demand/
// Requires jQuery of course.
$(document).ready(function() {
$('.show-comments').on('click', function(){
var disqus_shortname = 'YOUR-DISQUS-USERNAME'; // Replace this value with *your* username.
// ajax request to load the disqus javascript
$.ajax({
type: "GET",
url: "http://" + disqus_shortname + ".disqus.com/embed.js",
dataType: "script",
@maddisondesigns
maddisondesigns / cookie-policy.md
Last active June 19, 2022 17:59
eCommerce Terms & Conditions and Privacy Templates
@noopkat
noopkat / chat.js
Last active August 24, 2022 21:52
Streamlabs Dracula Themed Chat Box
const setup = () => {
const nearestColorScript = document.createElement('script');
document.body.appendChild(nearestColorScript);
nearestColorScript.onload = onScriptLoad;
nearestColorScript.src = 'https://cdn.rawgit.com/dtao/nearest-color/a017c25b/nearestColor.js';
}
const onScriptLoad = () => {
console.log('nearest color script loaded');
@pento
pento / commercial-client.php
Created July 2, 2013 12:29
Sample Commercial Plugin update server and client
<?php
/*
* Plugin Name: Commercial Client
* Plugin URI: http://pento.net/
* Description: A sample client plugin for showing updates for non-WordPress.org plugins
* Author: pento
* Version: 0.1
* Author URI: http://pento.net/
* License: GPL2+
*/
@johnkolbert
johnkolbert / gist:769160
Created January 7, 2011 05:45
Unregisters a post type and removes the menu item
<?php
/*
* Usage for a custom post type named 'movies':
* unregister_post_type( 'movies' );
*
* Usage for the built in 'post' post type:
* unregister_post_type( 'post', 'edit.php' );
*/
function unregister_post_type( $post_type, $slug = '' ){
@jessepearson
jessepearson / functions.php
Last active October 12, 2022 05:59
Disables opening Terms and Conditions on WooCommerce Checkout page in an inline form and instead open in a new tab or window.
<?php // do not copy this line
/**
* Disables opening the Terms and Conditions page in an inline form on the Checkout page.
* The Terms and Conditions link will then open in a new tab/window.
*/
add_action( 'wp', function() {
remove_action( 'woocommerce_checkout_terms_and_conditions', 'wc_checkout_privacy_policy_text', 20 );
remove_action( 'woocommerce_checkout_terms_and_conditions', 'wc_terms_and_conditions_page_content', 30 );
} );