Skip to content

Instantly share code, notes, and snippets.

View mattallan's full-sized avatar

Matt Allan mattallan

  • Australia
View GitHub Profile
@mattallan
mattallan / wcs-force-webhook.php
Last active February 9, 2017 19:19
Immediately send `subscription.updated` webhooks for pending subscriptions
<?php
/**
* Plugin Name: WCS immediately send subscription.updated webhook
* Plugin URI:
* Description: Force immediate webhook delivery for subscription.updated webhooks on pending subscriptions
* Version: 1.0
* Author: Matt Allan - Prospress Inc.
* Author URI: http://prospress.com
*/
@mattallan
mattallan / sync_end_date_fixer.php
Last active November 30, 2021 07:36
sync end date fixer
<?php
/**
* Plugin Name: Fix incorrect end dates calculated on Synced Subscriptions
* Plugin URI:
* Description: Add `&sync_date_fixer=log` to the URL to log any incorrect end dates (see log file: wcs_sync_fixer_test). Add `&sync_date_fixer=update` to the URL to log and update any incorrect end dates (see log file: wcs_sync_fixer_updated to find which subscriptions were incorrect and have been updated.)
* Version: 1.0
* Author: Matt Allan
* Author URI: http://prospress.com
* License: GPLv2
*/
@mattallan
mattallan / one-subscription-per-user.php
Last active August 29, 2015 14:19
Limit Subscriptions to one active/suspended per user.
<?php
/**
* Plugin Name: User Limited Subscriptions
* Description: Limit users to only one active or suspended subscription
* Author: Matt Allan
* Author URI: http://www.prospress.com
* Version: 1.0
* License: GPL v2
*/
@mattallan
mattallan / wcs-payment-gateway-support-example.php
Last active August 29, 2015 14:17
WC Subscriptions: Adding Support for Admin Change Payment Method Example
$this->supports = array(
'subscription_payment_method_change_admin',
// Add other support flags here
);
@mattallan
mattallan / wcs-redirect-to-cart.php
Created March 2, 2015 03:44
Redirect customers to the cart page when adding a subscription to their cart (rather than the checkout page, which is the default).
<?php
/**
* Plugin Name: WooCommerce Subscriptions Redirect to Cart
* Description: Redirect customers to the cart page when adding a subscription to their cart (rather than the checkout page, which is the default).
* Author: Gerhard Potgieter & Brent Shepherd
* Author URI: http://www.woothemes.com/products/woocommerce-subscriptions/
* Version: 1.0
* License: GPL v2
*/