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
-server | |
-Xms1500m | |
-Xmx1500m | |
-XX:MaxPermSize=350m | |
-XX:ReservedCodeCacheSize=256m | |
-XX:+UseConcMarkSweepGC | |
-XX:+UseParNewGC | |
-XX:SoftRefLRUPolicyMSPerMB=50 | |
-XX:+CMSParallelRemarkEnabled | |
-XX:ConcGCThreads=4 |
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
add_action( 'woocommerce_order_status_completed', 'change_role_on_purchase' ); | |
function change_role_on_purchase( $order_id ) { | |
$order = wc_get_order( $order_id ); | |
$items = $order->get_items(); | |
$products_to_check = array( '1', '2', '3' ); | |
foreach ( $items as $item ) { | |
if ( $order->user_id > 0 && in_array( $item['product_id'], $products_to_check ) ) { | |
$user = new WP_User( $order->user_id ); |
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: WooCommerce Subscriptions Failed Payment Retry Rules for Testing | |
* Plugin URI: | |
* Description: Replace the default WooCommerce Subscriptions failed payment retry rules with rules that run every few minutes (not days) and always send dunning emails to help with testing. | |
* Author: Prospress Inc. | |
* Author URI: http://prospress.com/ | |
* Version: 1.0 | |
* | |
* Copyright 2016 Prospress, Inc. (email : [email protected]) |
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: Brent's Debugging Helpers | |
* Plugin URI: | |
* Description: bs_backtrace() etc. | |
* Version: 8.13.21 | |
* Author: | |
* Author URI: | |
*/ |
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 | |
/* | |
* Get user's role. | |
* | |
* If $user parameter is not provided, returns the current user's role. | |
* Only returns the user's first role, even if they have more than one. | |
* | |
* @param mixed $user User ID or object. Pass nothing for current user. | |
* | |
* @return string The User's role, or an empty string if none. |
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: WooCommerce Enable Free Shipping on a Per Product Basis | |
* Plugin URI: https://gist.github.com/BFTrick/d4a21524a8f7b25ec296 | |
* Description: Enable free shipping for certain products | |
* Author: Patrick Rauland | |
* Author URI: http://speakinginbytes.com/ | |
* Version: 1.0.1 | |
* | |
* This program is free software: you can redistribute it and/or modify |
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
add_filter('woocommerce_dynamic_pricing_process_product_discounts', 'exclude_some_products', 10, 4); | |
function is_product_eligible( $eligible, $product, $discounter_name, $discounter_object ) { | |
if ($product->ID == 200){ | |
$eligible = false; | |
} | |
return $eligible; | |
} |
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
.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel-parent, | |
#customize-theme-controls .customize-pane-child.current-section-parent { | |
-webkit-transform: translateX(-100%); | |
-ms-transform: translateX(-100%); | |
transform: translateX(-100%); | |
} |
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
echo 'display_errors = false' | sudo tee --append /etc/php5.4-sp/php.ini && echo 'display_errors = false' | sudo tee --append /etc/php5.5-sp/php.ini && echo 'display_errors = false' | sudo tee --append /etc/php5.6-sp/php.ini && echo 'display_errors = false' | sudo tee --append /etc/php7.0-sp/php.ini && echo 'display_errors = false' | sudo tee --append /etc/php7.1-sp/php.ini && cat /etc/php5.4-sp/php.ini && cat /etc/php5.5-sp/php.ini && cat /etc/php5.6-sp/php.ini && cat /etc/php7.0-sp/php.ini && cat /etc/php7.1-sp/php.ini && sudo service php5.4-fpm-sp restart && sudo service php5.5-fpm-sp restart && sudo service php5.6-fpm-sp restart && sudo service php7.0-fpm-sp restart && sudo service php7.1-fpm-sp restart |
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
#!/usr/bin/env node | |
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/ | |
// Pass it as a parameter: node ./delete-slack-messages.js CHANNEL_ID | |
// CONFIGURATION ####################################################################################################### | |
const token = 'SLACK TOKEN'; | |
// Legacy tokens are no more supported. | |
// Please create an app or use an existing Slack App |