PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 2.0.0
Subscriptions for WooCommerce with Stripe Recurring Payments v2.0.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 1.4.1 1.4.2 1.5.0 1.5.1 All 61 releases
← All changes | includes/Utils/Product.php +17 -1 1.10.32.0.0 View file →
@@ -122,9 +122,25 @@
122 122 return $this->product->get_meta( '_subscrpt_max_no_payment' );
123 123 }
124 124
125 125 public function is_enabled(): bool {
126 - return $this->product->get_meta( '_subscrpt_enabled' );
126 + if ( empty( $this->product->get_meta( '_subscrpt_enabled' ) ) ) {
127 + return false;
128 + }
129 +
130 + // Once plan-connected, a product is a subscription only while it still has
131 + // a plan — it never falls back to the legacy terms after a detach.
132 + if ( 'yes' === $this->product->get_meta( '_subscrpt_plan_connected_before' ) && function_exists( 'subscrpt_product_has_plan' ) ) {
133 + $parent = $this->product->get_parent_id();
134 + $has_plan = $parent
135 + ? subscrpt_product_has_plan( $parent, $this->product->get_id() )
136 + : subscrpt_product_has_plan( $this->product->get_id() );
137 + if ( ! $has_plan ) {
138 + return false;
139 + }
140 + }
141 +
142 + return true;
127 143 }
128 144
129 145 public function get_trial_timing_per(): int {
130 146 return (int) ( $this->product->get_meta( '_subscrpt_trial_timing_per' ) ?? 1 );