diff --git a/.github/workflows/phpunit_on_pull_request.yml b/.github/workflows/phpunit_on_pull_request.yml index fcca5610..e2670d3a 100644 --- a/.github/workflows/phpunit_on_pull_request.yml +++ b/.github/workflows/phpunit_on_pull_request.yml @@ -48,9 +48,13 @@ jobs: if: steps.check_files.outputs.files_exists == 'true' run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + - name: Update composer packages + if: steps.check_files.outputs.files_exists == 'true' + run: composer update + - name: Run PHPUnit if: steps.check_files.outputs.files_exists == 'true' - run: composer update && composer tests:unit + run: vendor/bin/phpunit tests/php/Unit/ --verbose - name: Archive code coverage results uses: actions/upload-artifact@v2 diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 4ee495a9..2379080a 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -5,6 +5,11 @@ + + diff --git a/src/Interfaces/Container.php b/src/Interfaces/Container.php index b83e9613..a5ff90ce 100644 --- a/src/Interfaces/Container.php +++ b/src/Interfaces/Container.php @@ -16,6 +16,7 @@ * @package WpGuruDev\OrderExport\Interfaces */ interface Container { + /** * Define services in container. * diff --git a/src/Modules/Shortcode.php b/src/Modules/Shortcode.php index 0d9c87a5..05f86bfc 100644 --- a/src/Modules/Shortcode.php +++ b/src/Modules/Shortcode.php @@ -134,7 +134,6 @@ public function scan_shortcode( string $output, string $tag, $attrs ): string { return $output; } - /** * Filter redirect URL as per shortcode param. * diff --git a/src/Utils/GoogleClient.php b/src/Utils/GoogleClient.php index ea78f887..b162f00e 100644 --- a/src/Utils/GoogleClient.php +++ b/src/Utils/GoogleClient.php @@ -244,11 +244,14 @@ public function user(): \stdClass { * @return string */ public function state(): string { - $state_data['nonce'] = wp_create_nonce( 'login_with_google' ); + + $state_data = [ + 'nonce' => wp_create_nonce( 'login_with_google' ), + ]; + $state_data = apply_filters( 'rtcamp.google_login_state', $state_data ); $state_data['provider'] = 'google'; return base64_encode( wp_json_encode( $state_data ) ); } - } diff --git a/templates/google-login-button.php b/templates/google-login-button.php index c010785f..93290387 100644 --- a/templates/google-login-button.php +++ b/templates/google-login-button.php @@ -20,7 +20,7 @@ if ( is_user_logged_in() ) { $button_text = __( 'Log out', 'login-with-google' ); - $button_url = wp_logout_url( get_permalink() ); + $button_url = wp_logout_url( get_permalink() ); } ?>