activate(); update_option('woo_vipps_recurring_payments_activation', WC_VIPPS_RECURRING_VERSION); }); } } else if (!$subscriptions_exist) { if (!woo_vipps_ajax_cron_or_rest ()) { add_action('wp_loaded', function () { WC_Vipps_Recurring::get_instance()->deactivate(); delete_option('woo_vipps_recurring_payments_activation'); }); } } }, 1); /* Mark the Vipps MobilePay Recurring-plugin as needing update, so that we can inform that it is no longer required IOK 2024-12-20 */ add_filter( 'all_plugins', function ( $plugins ) { foreach ( $plugins as $plugin=> $plugin_data ) { if (basename($plugin) == 'woo-vipps-recurring.php') { // Necessary to properly display notice within row. $plugins[$plugin]['update'] = 1; } } return $plugins; } ); add_action('after_plugin_row', function ($plugin) { global $wp_list_table; if (!$wp_list_table) return; if (basename($plugin) != 'woo-vipps-recurring.php') return; $columns_count = $wp_list_table->get_column_count(); $notice = ""; if (is_plugin_active($plugin)) { $notice = sprintf(__( 'This plugin can now be deactivated because its functionality is now included in %1$s. After deactivation, it can not be activated again while that plugin is active, but exactly the same functionality will be provided.', 'woo-vipps' ), __("Pay with Vipps and MobilePay for WooCommerce", 'woo-vipps')); } else { $notice = sprintf(__( 'This plugin can no longer be activated because its functionality is now included in %1$s. It is recommended to delete it.', 'woo-vipps' ), __("Pay with Vipps and MobilePay for WooCommerce", 'woo-vipps')); } echo '