Skip to content

Subscriptions

The subscriptions module adds products with recurring payments. Customers buy subscriptions with manual renewal, and the administrator manages them in WooCommerce.

  1. The administrator creates a “Subscription” product type with a cycle and price
  2. The customer purchases a subscription and pays the first order
  3. The plugin creates a subscription with “Active” status
  4. Before the renewal date, the customer receives a reminder email
  5. On the renewal date, the plugin creates a renewal order
  6. The customer pays the renewal order (manual renewal)
  7. The cycle repeats until the subscription is cancelled

Go to WooCommerce > Settings > Polski > PRO Modules > Subscriptions.

The module is controlled by the option:

polski_subscriptions
SettingDescription
Enable subscriptionsActivates the module
Renewal modeManual (customer pays the order)
Reminder daysHow many days before renewal to send a reminder (default 3)
Grace periodHow many days after the renewal date the subscription stays active (default 7)
Automatic suspensionSuspend subscription after the grace period expires
  1. Go to Products > Add New
  2. Select product type: Subscription
  3. Configure the price and cycle:
FieldDescription
Subscription priceAmount per billing period
Billing periodDay / Week / Month / Year
Period lengthNumber of periods (e.g. 1 month, 3 months)
Initial priceOptional - different price for the first period
Activation feeOptional - one-time fee on the first order
Renewal limit0 = no limit, or number of renewals
  1. Publish the product

The plugin supports scenarios where the price for the first period differs from the price for subsequent periods. Typical use cases:

  • free trial or reduced-price trial period
  • promotional introductory price
  • activation fee + lower recurring price

The initial price is applied only to the first order. Subsequent renewal orders use the standard subscription price.

Pending → Active → On Hold → Active → ...
→ Expired
→ Cancelled
StatusDescription
PendingAwaiting payment of the first order
ActiveActive - customer has access to the product
On HoldSuspended - renewal order awaiting payment
ExpiredExpired - renewal count reached the limit or grace period passed
CancelledCancelled by the customer or administrator

In the current version, the plugin supports manual renewals. This means that:

  1. The plugin creates a renewal order with “Pending payment” status
  2. The customer receives an email with a link to pay the order
  3. The customer pays the order using their chosen payment method
  4. After payment, the subscription is renewed for the next period

The plugin checks subscriptions due for renewal daily using WP cron:

polski_daily_maintenance

The cron task runs once daily and performs:

  • checking subscriptions whose renewal date falls on today or earlier
  • creating renewal orders for subscriptions requiring renewal
  • suspending subscriptions that have exceeded the grace period
  • expiring subscriptions that have reached the renewal limit

The plugin sends email reminders before the renewal date:

EmailWhenContent
Renewal reminderX days before renewalInformation about the upcoming renewal, amount, link to the panel
Renewal orderOn the renewal dateOrder to pay with a payment link
Subscription suspendedAfter payment due date passesInformation about suspension, link to pay
Subscription expiredAfter grace period passesInformation about expiration, link to repurchase

Email templates can be customized in WooCommerce > Settings > Emails.

The module adds a /polski-subscriptions endpoint to the customer’s My Account panel. The endpoint is available at:

/moje-konto/polski-subscriptions/

The customer sees a table with subscriptions:

ColumnDescription
ProductSubscription product name
StatusCurrent subscription status
PriceAmount per period
Next renewalNext renewal date
ActionsCancel / Pay renewal

After clicking on a subscription, the customer sees:

  • full subscription data (product, price, cycle, dates)
  • renewal history (list of associated orders)
  • subscription cancellation button
  • button to pay a pending renewal (if applicable)

The customer can cancel an active subscription from the My Account panel. Cancellation:

  • changes the subscription status to “Cancelled”
  • the subscription remains active until the end of the current paid period
  • the customer is informed about the access end date

Action fired after a subscription status change.

/**
* @param int $subscription_id ID subskrypcji
* @param string $new_status Nowy status
* @param string $old_status Poprzedni status
*/
do_action('polski_pro/subscription/status_changed', int $subscription_id, string $new_status, string $old_status);

Example:

add_action('polski_pro/subscription/status_changed', function (int $subscription_id, string $new_status, string $old_status): void {
if ($new_status === 'cancelled') {
$subscription = polski_pro_get_subscription($subscription_id);
// Wysłanie ankiety o powód rezygnacji
wp_mail(
$subscription->get_customer_email(),
'Szkoda, że odchodzisz',
'Powiedz nam, dlaczego anulujesz subskrypcję: https://example.com/ankieta'
);
}
}, 10, 3);

Action fired after a renewal order is created.

/**
* @param int $order_id ID zamówienia odnowienia
* @param int $subscription_id ID subskrypcji
*/
do_action('polski_pro/subscription/renewal_created', int $order_id, int $subscription_id);

Example:

add_action('polski_pro/subscription/renewal_created', function (int $order_id, int $subscription_id): void {
$order = wc_get_order($order_id);
$order->add_order_note(
sprintf('Zamówienie odnowienia dla subskrypcji #%d', $subscription_id)
);
}, 10, 2);

Action fired after a renewal order is paid.

/**
* @param int $order_id ID zamówienia odnowienia
* @param int $subscription_id ID subskrypcji
*/
do_action('polski_pro/subscription/renewal_paid', int $order_id, int $subscription_id);

The reminder engine (14 + 7 days before renewal by default) exposes filters and actions:

// Customise windows (days before renewal)
add_filter('polski_subscription_reminder_windows', fn ($w) => ['first' => 21, 'second' => 7, 'last' => 1]);
// Subject / body / headers filters
add_filter('polski_subscription_reminder_subject', fn ($s, $sub, $type) => "[$type] $s", 10, 3);
add_filter('polski_subscription_reminder_body', fn ($b, $sub, $type) => $b . "\n\nThanks!", 10, 3);
add_filter('polski_subscription_reminder_headers', fn () => ['Content-Type: text/html; charset=UTF-8']);
// Skip a specific subscription
add_filter('polski_subscription_skip_reminder', fn ($skip, $sub) => $sub->productId === 42, 10, 2);
// Observe dispatch
add_action('polski_subscription_reminder_sent', fn ($sub, $type, $days) => null, 10, 3);
add_action('polski_subscription_reminder_failed', fn ($sub, $type) => null, 10, 2);

SubscriptionRepository::updateRecurringAmount() detects an amount change and emails the customer with old/new price, effective next billing date and a one-click cancel link (EU consumer-protection requirement).

add_action('polski_subscription_amount_changed', function (int $id, float $prev, float $next) {
error_log("Subscription $id: $prev -> $next");
}, 10, 3);
add_filter('polski_subscription_amount_change_body', fn ($body, $sub, $prev, $next) => $body, 10, 4);
add_action('polski_subscription_amount_change_notified', fn ($sub, $prev, $next, $sent) => null, 10, 4);

Go to WooCommerce > Subscriptions. The table contains:

  • subscription ID
  • customer (first name, last name, email)
  • product
  • status
  • price and cycle
  • next renewal date
  • creation date

Available filters: status, product, creation date.

The administrator can:

  • change the subscription status
  • change the next renewal date
  • change the price (affects subsequent renewals)
  • add a note
  • browse status history and associated orders
  1. Check if WP-Cron is working properly (wp_cron is being called)
  2. Go to Tools > Scheduled Actions and check if the polski_daily_maintenance task is scheduled
  3. Verify that the subscription has “Active” status and a correct renewal date
  1. Check the WooCommerce email configuration
  2. Verify that the reminder email template is enabled
  3. Check the “Reminder days” setting - whether it is greater than 0

Subscription does not change status after payment

Section titled “Subscription does not change status after payment”
  1. Check if the renewal order has a correct association with the subscription
  2. Verify WooCommerce logs for errors
  3. Check if the payment gateway correctly changes the order status
This page is for informational purposes only and does not constitute legal advice. Consult a lawyer before implementation. Polski for WooCommerce is open source software (GPLv2) provided without warranty.