CommerceKit Stripe Billing
Custom WooCommerce Stripe billing plugin with subscriptions, analytics, webhook handling, and admin dashboard
by CommerceKit · github.com/matvey1347/woocommerce-stripe-billing-plugin · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/matvey1347/woocommerce-stripe-billing-plugin/archive/refs/heads/main.zipCommerceKit Stripe Billing (WordPress Plugin)
CommerceKit Stripe Billing is a custom WooCommerce + Stripe plugin for:
- hosted checkout payments
- subscription plan checkout
- local subscription/invoice data sync
- admin operations, analytics, and diagnostics
It is built as a standalone plugin and can be showcased independently in a portfolio.
Version
- Current version:
2.0.0 - Main file:
wp-stripe-payments.php - Text domain:
wp-stripe-payments
Core Capabilities
Stripe + WooCommerce Payments
- Registers custom WooCommerce gateway (
wp_stripe_gateway) - Starts hosted Stripe Checkout sessions for WooCommerce orders
- Handles payment completion/failure updates through webhooks
Subscription Billing
- Custom subscription plan post type (
wp_sp_sub_plan) - Plan metadata (price, interval, image, status, Stripe IDs)
- Plan sync to Stripe product/price
- Hosted Stripe Checkout for subscription signups
- Account endpoint for subscriptions:
/my-account/wp-sp-subscriptions/
Webhooks and Sync
- REST webhook route:
/wp-json/wp-stripe-payments/webhook - Signature verification using webhook secret
- Processes key Stripe events including:
checkout.session.completedcustomer.subscription.created|updated|deletedinvoice.paid,invoice.payment_failed,invoice.finalized,invoice.voidedcharge.refunded
- Event idempotency via processed event cache
Admin Suite
- Dashboard
- Setup Guide
- Settings
- Customer Subscriptions
- Analytics
- Plans
- Logs
Safety and Ops Controls
- Nonce + capability checks for admin actions
- Safe actions for subscriptions (cancel/resume/sync/manual review/portal)
- Local structured logs (up to 200 records) + WooCommerce logger integration
Data Model
On activation, plugin creates and migrates local tables:
wp_sp_customer_subscriptionswp_sp_subscription_invoices
This allows filtered admin views, analytics KPIs, and billing history timelines without relying only on live API reads.
Settings Model
Option key:
wp_stripe_payments_settings
Supports:
- test/live API keys
- test/live mode switching
- webhook secret
- billing portal enable/return URL
- debug logging toggle
- gateway title/description
Installation (Standalone Plugin)
- Copy folder
wp-stripe-paymentsto:wp-content/plugins/wp-stripe-payments
- Ensure WooCommerce is active
- Activate CommerceKit Stripe Billing in WordPress admin
- Open plugin menu and run setup
Stripe Setup (Recommended Order)
- Enable Test mode and save
pk_test+sk_test - Add webhook endpoint:
/wp-json/wp-stripe-payments/webhook
- Subscribe to subscription/invoice/checkout events
- Save webhook signing secret (
whsec_...) in plugin settings - Create/sync at least one active subscription plan
- Run test checkout and verify admin records
- Only then switch to Live mode with live keys + live webhook
Shortcode and Frontend
Shortcode available:
[wp_sp_subscription_plans]
Use it on a landing page to render subscription plans and start Stripe checkout.
Architecture Snapshot
includes/Core/*— bootstrap, loader, hooksincludes/Gateway/*— WooCommerce payment gatewayincludes/Stripe/*— Stripe API client, checkout/session services, webhook handlingincludes/Subscriptions/*— plans, checkout controller, subscription and billing domain logicincludes/Admin/*— admin pages, assets, settings UXincludes/Utils/Logger.php— logging abstraction and local log storage
Portfolio Notes
This plugin demonstrates practical WordPress product engineering:
- custom billing domain on top of WooCommerce + Stripe
- maintainable modular architecture (services/repositories/controllers)
- secure admin workflows and operational tooling
- merchant-oriented UX (setup guidance, diagnostics, analytics)
Compatibility
- WordPress + WooCommerce
- PHP
8.0+ - Stripe account with Checkout + Billing enabled
Repository Context
In this repository, plugin lives in:
plugins/wp-stripe-payments
A full project-level README (theme + plugin + docker stack) is available in repository root:
README.md