Skip to content

Instantly share code, notes, and snippets.

View thenbrent's full-sized avatar

Brent Shepherd thenbrent

View GitHub Profile
@thenbrent
thenbrent / wcs-reduce-upgrade-batch-size.php
Last active October 22, 2015 21:25
Reduce batch size for WooCommerce Subscriptions upgrade process.
<?php
/**
* Plugin Name: WooCommerce Subscriptions Reduce Upgrade Batch Size
* Plugin URI:
* Description: Drastically reduce the size of each batch of data WooCommerce Subscriptions upgrades per request. Handy to avoiding low script timeout settings on Nginx.
* Author: Prospress Inc.
* Version: 1.0
* Author URI: http://prospress.com
*/
function eg_reduce_wcs_upgrade_batch_size( $batch_size ) {
@thenbrent
thenbrent / wcs-change-pending-cancellation-name.php
Last active November 12, 2021 19:59
Change the name of the "Pending Cancellation" status in WooCommerce Subscriptions to be "Cancelled Payments".
<?php
/**
* Plugin Name: WooCommerce Subscriptions Change Pending Cancellation Status
* Plugin URI: https://gist.github.com/thenbrent/2b2b328b1413e563adfb
* Description: Change the name of the "Pending Cancellation" status in WooCommerce Subscriptions to be "Cancelled Payments".
* Author: Prospress Inc.
* Version: 1.0
* Author URI: http://prospress.com
*/
<?php
/**
* Plugin Name: WooCommerce Subscriptions Remove Deprecation Handlers
* Plugin URI: https://support.woothemes.com/hc/en-us/articles/205214466
* Description: Do not load backward compatibility support in Subscriptions 2.0.
* Author: Prospress Inc.
* Version: 1.0
* Author URI: http://prospress.com
*/
@thenbrent
thenbrent / custom-subscription-interval.php
Last active April 2, 2021 10:25
Add a new billing interval to WooCommerce Subscriptions to allow for longer intervals between subscription renewal payments. Specifically a new "8" interval to allow you to sell a subscription that renews every 8 days, weeks, months or years.
<?php
/**
* Plugin Name: WooCommerce Subscription Custom Interval
* Description: Add a custom 8 week subscription interval to WooCommerce Subscriptions
* Author: Brent Shepherd
* Version: 1.0
* License: GPL v2
*/
function eg_add_custom_subscription_interval( $subscription_intervals ) {
@thenbrent
thenbrent / woocommerce-do-not-reduce-renewal-stock.md
Last active November 10, 2016 20:00
By default, WooCommerce reduces stock for any payment on a product, including the initial purchase for a subscription and renewals. This extension prevents stock being reduced for renewal order payments so that stock is only reduced on the initial purchase.
@thenbrent
thenbrent / wcs-remove-zero-recurring.php
Last active August 29, 2015 14:06
Remove $0.00 recurring discount coupon amount
<?php
/*
Plugin Name: WooCommerce Subscriptions Remove $0.00 Recurring Discount
Plugin URI:
Description: Do not include a $0.00 recurring discount amount when a coupon is displaying it. For example, instead of display a coupon discount as "$10.00 now then $0.00 / month", display it as "$10.00".
Author:
Author URI:
Version: 0.1
*/
@thenbrent
thenbrent / no-renewal-emails-for-zero-reneawl.php
Last active August 26, 2023 07:35
Do not send renewal order emails when the email relates to a $0 renewal.
<?php
/*
Plugin Name: WooCommerce Subscriptions No $0 Emails
Plugin URI:
Description: Do not send processing or completed renewal order emails to customers when the order or renewal is for $0.00.
Author:
Author URI:
Version: 0.1
*/
@thenbrent
thenbrent / error-log-setup.php
Last active August 29, 2015 14:05
Set PHP error log from `wp-config.php`
<?php
if ( ! defined( 'WP_DEBUG' ) ) {
define('WP_DEBUG', true);
}
if ( ! defined( 'WP_DEBUG_DISPLAY' ) ) {
define('WP_DEBUG_DISPLAY', false);
}
if ( ! defined( 'WP_DEBUG_LOG' ) ) {
define('WP_DEBUG_LOG', true);
@thenbrent
thenbrent / reinstate-renewal-title.php
Last active June 7, 2016 14:57
Reinstate old Subscription renewal order item name
<?php
/*
Plugin Name: WooCommerce Subscriptions Reinstate Old Renewal Order Item Name
Plugin URI: https://gist.github.com/thenbrent/8e4bda5a53b91addc68b
Description: Reinstate the "Renewal of {product_title} purchased in Order {order_id}" string on renewal order items.
Author:
Author URI:
Version: 0.3
*/
(function( window, undefined ) {
'use strict';
function WP_API() {
this.models = {};
this.collections = {};
this.views = {};
}