register_admin_menu(); } ); add_action( 'admin_init', function() { $this->handle_actions(); } ); } /** * Store response from an API request. * * @var string */ protected $response = ''; /** * Store response from the integration status API request. * * @var string */ protected $integration_status_response = []; /** * Add menu entries */ protected function register_admin_menu() { if ( apply_filters( 'woocommerce_gla_enable_connection_test', false ) ) { add_menu_page( 'Connection Test', 'Connection Test', 'manage_woocommerce', 'connection-test-admin-page', function () { $this->render_admin_page(); } ); } else { add_submenu_page( '', 'Connection Test', 'Connection Test', 'manage_woocommerce', 'connection-test-admin-page', function () { $this->render_admin_page(); } ); } } /** * Render the admin page. */ protected function render_admin_page() { /** @var OptionsInterface $options */ $options = $this->container->get( OptionsInterface::class ); /** @var Manager $manager */ $manager = $this->container->get( Manager::class ); $blog_token = $manager->get_tokens()->get_access_token(); $user_token = $manager->get_tokens()->get_access_token( get_current_user_id() ); $user_data = $manager->get_connected_user_data( get_current_user_id() ); $url = admin_url( 'admin.php?page=connection-test-admin-page' ); if ( ! empty( $_GET['google-mc'] ) && 'connected' === $_GET['google-mc'] ) { $this->response .= 'Google Account connected successfully.'; } if ( ! empty( $_GET['google-manager'] ) && 'connected' === $_GET['google-manager'] ) { $this->response .= 'Successfully connected a Google Manager account.'; } if ( ! empty( $_GET['google'] ) && 'failed' === $_GET['google'] ) { $this->response .= 'Failed to connect to Google.'; } ?>
Google for WooCommerce connection testing page used for debugging purposes. Debug responses are output at the top of the page.
response ); ?>
|
|
|
| Test WCS Connection: | |
| Test Authenticated WCS Request: |
|
|
|
|
|
|
Connected with another user account |
|
| Connection Status: | |
| Reconnect WordPress.com: |
| Connect: | |
|---|---|
| Disconnect: | |
| Get Status: |
For single-step development testing, not used for normal account setup flow.
| Link Site to MCA: | |
|---|---|
| Claim Website: | |
| Clear Status Cache: |
| Accept Merchant Center ToS: | |
|---|---|
| Get Latest Merchant Center ToS: |