PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 2.4.0
Subscriptions for WooCommerce with Stripe Recurring Payments v2.4.0
2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.11.2 1.11.1 1.11.0 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.6 1.9.5 trunk 1.3.0 1.3.1 1.3.2 1.4.0 All 65 releases
← All changes | includes/Illuminate.php +47 -1 1.10.4 → 2.4.0 View file →
@@ -1,13 +1,22 @@
1 1 <?php
2 +/**
3 + * Service container bootstrap.
4 + *
5 + * @package SpringDevs\Subscription
6 + */
2 7
3 8 namespace SpringDevs\Subscription;
4 9
5 10 use SpringDevs\Subscription\Frontend\Checkout;
11 +use SpringDevs\Subscription\Frontend\PlanCheckout;
6 12 use SpringDevs\Subscription\Illuminate\AutoRenewal;
7 13 use SpringDevs\Subscription\Illuminate\Block;
14 +use SpringDevs\Subscription\Illuminate\Cancellation;
8 15 use SpringDevs\Subscription\Illuminate\Cron;
16 +use SpringDevs\Subscription\Illuminate\StockPause;
9 17 use SpringDevs\Subscription\Illuminate\Email;
18 +use SpringDevs\Subscription\Illuminate\Multilingual;
10 19 use SpringDevs\Subscription\Illuminate\Order;
11 20 use SpringDevs\Subscription\Illuminate\Post;
12 21 use SpringDevs\Subscription\Illuminate\Stats;
13 22 use SpringDevs\Subscription\Illuminate\Gateways\Stripe\Stripe;
@@ -30,18 +39,55 @@
30 39 new Subscription();
31 40 new RoleManagement();
32 41 new Order();
33 42 new Cron();
43 + new StockPause();
44 + new Cancellation();
34 45 new Stats();
35 46 new Post();
36 47 new Block();
37 48 new Checkout();
49 + // Pro ships a superset plan checkout (Subscribe & Save, Installments,
50 + // variable / per-variation) on the same hooks and priorities, so free's
51 + // Recurring-simple checkout runs only when Pro is absent — otherwise the two
52 + // would create the subscription twice.
53 + if ( ! subscrpt_pro_activated() ) {
54 + new PlanCheckout();
55 + }
38 56 new GuestCheckout();
39 57 new AutoRenewal();
40 58 new Email();
59 + new Multilingual();
60 +
61 + // Hide the internal plan snapshot meta from the admin order-item screen.
62 + // WooCommerce's admin item view lists every meta key not in this filter
63 + // (it does not hide the leading-underscore prefix there). Registered here —
64 + // always loaded, both plugins share these keys — so it covers free and pro.
65 + add_filter( 'woocommerce_hidden_order_itemmeta', array( $this, 'hidden_plan_order_itemmeta' ) );
41 66 }
42 67
43 68 /**
69 + * Hide the plan snapshot meta keys on the admin order-item screen.
70 + *
71 + * @param array $keys Hidden order-item meta keys.
72 + *
73 + * @return array
74 + */
75 + public function hidden_plan_order_itemmeta( $keys ) {
76 + return array_merge(
77 + (array) $keys,
78 + array(
79 + '_subscrpt_plan_id',
80 + '_subscrpt_plan_group_id',
81 + '_subscrpt_plan_price',
82 + '_subscrpt_plan_payment_type',
83 + '_subscrpt_plan_max_no_payment',
84 + '_subscrpt_plan_terms',
85 + )
86 + );
87 + }
88 +
89 + /**
44 90 * Stripe Initialization.
45 91 *
46 92 * @return void
47 93 */
@@ -74,9 +120,9 @@
74 120 $is_paypal_integration_enabled = 'on' === get_option( 'wp_subs_paypal_integration_enabled', 'off' );
75 121
76 122 // Register the PayPal gateway with WooCommerce.
77 123 if ( $is_paypal_integration_enabled ) {
78 - add_filter( 'woocommerce_payment_gateways', array( $this, 'register_paypal_gateway' ) );
124 + add_filter( 'woocommerce_payment_gateways', [ $this, 'register_paypal_gateway' ] );
79 125 }
80 126 }
81 127
82 128 /**