PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | stripe/controllers/FrmTransLiteAppController.php +26 -3 6.32 → trunk View file →
@@ -44,14 +44,25 @@
44 44 }
45 45 }
46 46
47 47 /**
48 - * Remove the cron when the plugin is deactivated.
48 + * Remove the payment cron when all gateways are disconnected.
49 49 *
50 + * @since 6.32.1
51 + *
52 + * @param string $gateway 'stripe', 'square', or 'paypal'.
53 + * @param string $mode 'test' or 'live'.
54 + *
50 55 * @return void
51 56 */
52 - public static function remove_cron() {
53 - wp_clear_scheduled_hook( 'frm_payment_cron' );
57 + public static function maybe_remove_payment_cron( $gateway, $mode ) {
58 + $stripe_connected = FrmStrpLiteConnectHelper::at_least_one_mode_is_setup();
59 + $square_connected = FrmSquareLiteConnectHelper::at_least_one_mode_is_setup();
60 + $paypal_connected = FrmPayPalLiteConnectHelper::at_least_one_mode_is_setup();
61 +
62 + if ( ! $stripe_connected && ! $square_connected && ! $paypal_connected ) {
63 + wp_clear_scheduled_hook( 'frm_payment_cron' );
64 + }
54 65 }
55 66
56 67 /**
57 68 * Process overdue subscriptions.
@@ -229,6 +240,18 @@
229 240 #frm_builder_page li[data-ftype="gateway"] { display: none; }
230 241 .frm_field_box:has(li[data-ftype="gateway"]:only-child) { display: none; }
231 242 '
232 243 );
244 + }
245 +
246 + /**
247 + * Remove the cron when the plugin is deactivated.
248 + *
249 + * @deprecated 6.32.1
250 + *
251 + * @return void
252 + */
253 + public static function remove_cron() {
254 + _deprecated_function( __METHOD__, '6.32.1' );
255 + wp_clear_scheduled_hook( 'frm_payment_cron' );
233 256 }
234 257 }