Problem with deactivation
-
After the import and export went well, I have tried to deactivate the plugin.
On both the source and the target site there was this fatal error trying to deactivate the plugin:“Fatal error: Uncaught Error: Class “ActionScheduler_RecurringActionScheduler” not found in /home/examplecom/example.com/wp-content/plugins/import-users-from-csv-with-meta/lib/action-scheduler/classes/abstracts/ActionScheduler.php:191 Stack trace: #0 /home/examplecom/example.com/wp-content/plugins/import-users-from-csv-with-meta/lib/action-scheduler/action-scheduler.php(60): ActionScheduler::init() #1 /home/examplecom/example.com/wp-content/plugins/import-users-from-csv-with-meta/lib/action-scheduler/action-scheduler.php(66): action_scheduler_initialize_3_dot_8_dot_1() #2 /home/examplecom/example.com/wp-content/plugins/import-users-from-csv-with-meta/import-users-from-csv-with-meta.php(91): include_once(‘/home/examplecom/…’) #3 /home/examplecom/example.com/wp-includes/class-wp-hook.php(341): ImportExportUsersCustomers::deactivate() #4 /home/examplecom/example.com/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters() #5 /home/examplecom/example.com/wp-includes/plugin.php(522): WP_Hook->do_action() #6 /home/examplecom/example.com/wp-admin/includes/plugin.php(826): do_action() #7 /home/examplecom/example.com/wp-admin/plugins.php(211): deactivate_plugins() #8 {main} thrown in /home/examplecom/example.com/wp-content/plugins/import-users-from-csv-with-meta/lib/action-scheduler/classes/abstracts/ActionScheduler.php on line 191″
Both sites are on WordPress 6.9.4, PHP 8.1.34.
AI analysis of the problem:
“Trace shows the crash happens inside the plugin’s deactivation routine. In the plugin source, ImportExportUsersCustomers::deactivate() tries to load its bundled Action Scheduler if as_unschedule_all_actions() is unavailable, then immediately calls as_unschedule_all_actions( ‘acui_cron_process’ ). That bundled bootstrap initializes Action Scheduler 3.8.1.”
The proposed patch:
[php]
static function deactivate() {
if ( get_option( 'acui_cron_activated' ) ) {
if ( ! function_exists( 'as_unschedule_all_actions' ) && file_exists( plugin_dir_path( FILE ) . 'lib/action-scheduler/action-scheduler.php' ) ) {
include_once plugin_dir_path( FILE ) . 'lib/action-scheduler/action-scheduler.php';
}
if ( function_exists( 'as_unschedule_all_actions' ) ) {
as_unschedule_all_actions( 'acui_cron_process' );
}
}
[/php]I am not sure if this has to do with particular configurations or possible conflicts, the target site was a fresh install.
Hope this helps if something needs fixing.
You must be logged in to reply to this topic.