-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Core Profiler - replace install-async with install-activate-async #38434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core Profiler - replace install-async with install-activate-async #38434
Conversation
|
Hi @chihsuan, @rjchow, @woocommerce/ghidorah Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
1 similar comment
|
Hi @chihsuan, @rjchow, @woocommerce/ghidorah Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
Test Results SummaryCommit SHA: 1e09a4d
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
| * @return bool | ||
| */ | ||
| public function install_plugins_async_callback( array $plugins, string $job_id ) { | ||
| $option_name = 'woocommerce_onboarding_plugins_install_async_' . $job_id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also rename this function to install_and_activate_plugins_async_callback?
And I'm seeing this error in error.log. Should we make it static?
[25-May-2023 08:06:50 UTC] PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method Automattic\WooCommerce\Admin\PluginsHelper::install_plugins_async_callback() cannot be called statically in /var/www/html/wp-includes/class-wp-hook.php:308
Stack trace:
#0 /var/www/html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#1 /var/www/html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#2 /var/www/html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/actions/ActionScheduler_Action.php(43): do_action_ref_array('woocommerce_plu...', Array)
#3 /var/www/html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php(65): ActionScheduler_Action->execute()
#4 /var/www/html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/ActionScheduler_QueueRunner.php(166): ActionScheduler_Abstract_QueueRunner->process_action(102, 'WP Cron')
#5 /var/www/html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/ActionScheduler_QueueRunner.php(136): ActionScheduler_QueueRunner->do_batch(25, 'WP Cron')
#6 /var/www/html/wp-includes/class-wp-hook.php(308): ActionScheduler_QueueRunner->run('WP Cron')
#7 /var/www/html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#8 /var/www/html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#9 /var/www/html/wp-cron.php(188): do_action_ref_array('action_schedule...', Array)
#10 /var/www/html/wp-includes/cron.php(886): include_once('/var/www/html/w...')
#11 /var/www/html/wp-includes/cron.php(1002): spawn_cron(1685002010.5754)
#12 /var/www/html/wp-includes/class-wp-hook.php(308): _wp_cron('')
#13 /var/www/html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
#14 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#15 /var/www/html/wp-settings.php(645): do_action('wp_loaded')
#16 /var/www/html/wp-config.php(258): require_once('/var/www/html/w...')
#17 /var/www/html/wp-load.php(50): require_once('/var/www/html/w...')
#18 /var/www/html/wp-blog-header.php(13): require_once('/var/www/html/w...')
#19 /var/www/html/index.php(17): require('/var/www/html/w...')
#20 {main}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chihsuan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and tested well. 👍
Changes proposed in this Pull Request:
Closes #38410
This PR replaces
install-asyncendpoint withinstall-and-activate-asyncto activate installed plugins.How to test the changes in this Pull Request:
/wp-json/wc-admin/onboarding/plugins/install-and-activate-asyncwith the following JSON requestjob_idfield. Copy it./wp-json/wc-admin/onboarding/plugins/scheduled-installs/:job_id. It should return the following response.plugins.:name.statusfield value should beactivated