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/Admin/ProSettingsFields.php +107 -0 2.1.0 → 2.4.0 View file →
@@ -45,8 +45,9 @@
45 45 */
46 46 public function add_pro_preview_fields( $settings_fields ) {
47 47 $pro_fields = array_merge(
48 48 $this->pro_core_fields(),
49 + $this->license_fields(),
49 50 $this->grace_period_fields(),
50 51 $this->payment_failure_fields(),
51 52 $this->api_fields(),
52 53 $this->health_queue_fields(),
@@ -102,8 +103,114 @@
102 103 'label' => __( 'Accept Early Renewal Payments', 'subscription' ),
103 104 'description' => __( 'With early renewals enabled, customers can renew their subscriptions before the next payment date.', 'subscription' ),
104 105 'value' => '1',
105 106 'checked' => '1' === get_option( 'subscrpt_early_renew', '1' ),
107 + ],
108 + ],
109 + [
110 + 'type' => 'select',
111 + 'group' => 'renewals',
112 + 'priority' => 9,
113 + 'field_data' => [
114 + 'id' => 'subscrpt_early_renew_visibility',
115 + 'title' => __( 'Early Renew Button Visibility', 'subscription' ),
116 + 'description' => __( 'Choose when customers see the Early Renew button on an active subscription.', 'subscription' ),
117 + 'options' => [
118 + 'always' => __( 'Always', 'subscription' ),
119 + 'before_days' => __( 'Before X days of the next renewal', 'subscription' ),
120 + 'day_of_month' => __( 'From a fixed day of the month', 'subscription' ),
121 + 'cycle_left' => __( 'When a percentage of the billing cycle remains', 'subscription' ),
122 + ],
123 + 'selected' => esc_attr( get_option( 'subscrpt_early_renew_visibility', 'always' ) ),
124 + ],
125 + ],
126 + [
127 + 'type' => 'input',
128 + 'group' => 'renewals',
129 + 'priority' => 10,
130 + 'field_data' => [
131 + 'id' => 'subscrpt_early_renew_before_days',
132 + 'title' => __( 'Early Renew: Days Before Renewal', 'subscription' ),
133 + 'description' => __( 'Used with "Before X days". The button shows this many days before the next renewal date.', 'subscription' ),
134 + 'value' => esc_attr( get_option( 'subscrpt_early_renew_before_days', '7' ) ),
135 + 'type' => 'number',
136 + 'attributes' => [
137 + 'min' => 1,
138 + ],
139 + ],
140 + ],
141 + [
142 + 'type' => 'input',
143 + 'group' => 'renewals',
144 + 'priority' => 11,
145 + 'field_data' => [
146 + 'id' => 'subscrpt_early_renew_day_of_month',
147 + 'title' => __( 'Early Renew: Day of Month', 'subscription' ),
148 + 'description' => __( 'Used with "From a fixed day of the month". The button shows from this day until the end of each month. Short months use their last day.', 'subscription' ),
149 + 'value' => esc_attr( get_option( 'subscrpt_early_renew_day_of_month', '25' ) ),
150 + 'type' => 'number',
151 + 'attributes' => [
152 + 'min' => 1,
153 + 'max' => 31,
154 + ],
155 + ],
156 + ],
157 + [
158 + 'type' => 'input',
159 + 'group' => 'renewals',
160 + 'priority' => 12,
161 + 'field_data' => [
162 + 'id' => 'subscrpt_early_renew_cycle_left',
163 + 'title' => __( 'Early Renew: Cycle Remaining (%)', 'subscription' ),
164 + 'description' => __( 'Used with "When a percentage of the billing cycle remains". The button shows once this percentage of the current cycle or less is left.', 'subscription' ),
165 + 'value' => esc_attr( get_option( 'subscrpt_early_renew_cycle_left', '20' ) ),
166 + 'type' => 'number',
167 + 'attributes' => [
168 + 'min' => 1,
169 + 'max' => 100,
170 + ],
171 + ],
172 + ],
173 + ];
174 + }
175 +
176 + /**
177 + * Module: License integrations (Integrations/LicenseManagerWoo.php).
178 + *
179 + * @return array
180 + */
181 + private function license_fields() {
182 + return [
183 + [
184 + 'type' => 'heading',
185 + 'group' => 'license_settings',
186 + 'priority' => 4,
187 + 'field_data' => [
188 + 'title' => __( 'License Settings', 'subscription' ),
189 + ],
190 + ],
191 + [
192 + 'type' => 'toggle',
193 + 'group' => 'license_settings',
194 + 'priority' => 1,
195 + 'field_data' => [
196 + 'id' => 'subscrpt_regenerate_license_on_renewal',
197 + 'title' => __( 'Regenerate License on Renewal', 'subscription' ),
198 + 'description' => __( 'Enable this option if you want to invalidate the old key and issue a fresh license key whenever a subscription renews.', 'subscription' ),
199 + 'value' => '1',
200 + 'checked' => '1' === get_option( 'subscrpt_regenerate_license_on_renewal', '0' ),
201 + ],
202 + ],
203 + [
204 + 'type' => 'toggle',
205 + 'group' => 'license_settings',
206 + 'priority' => 2,
207 + 'field_data' => [
208 + 'id' => 'subscrpt_deactivate_old_license_on_renewal',
209 + 'title' => __( 'Deactivate Previous License', 'subscription' ),
210 + 'description' => __( 'When a fresh license key is issued on renewal, deactivate the previous key. Turn off to let the previous key keep working until it expires.', 'subscription' ),
211 + 'value' => '1',
212 + 'checked' => '1' === get_option( 'subscrpt_deactivate_old_license_on_renewal', '1' ),
106 213 ],
107 214 ],
108 215 ];
109 216 }