diff --git a/.github/workflows/e2e-js.yml b/.github/workflows/e2e-js.yml index 9c6591284..f8fa71826 100644 --- a/.github/workflows/e2e-js.yml +++ b/.github/workflows/e2e-js.yml @@ -9,6 +9,7 @@ on: jobs: e2e: runs-on: ubuntu-latest + if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it @@ -107,4 +108,4 @@ jobs: TYPING_ABOVE_60: ${{ steps.summary.outputs.TYPING_ABOVE_60 }} - \ No newline at end of file + diff --git a/.github/workflows/pr-checklist.yml b/.github/workflows/pr-checklist.yml index 543f7293e..a6e9ba7fe 100644 --- a/.github/workflows/pr-checklist.yml +++ b/.github/workflows/pr-checklist.yml @@ -13,7 +13,7 @@ jobs: add-labels: runs-on: ubuntu-latest name: Label PR based on checklist - if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name + if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && github.actor != 'dependabot[bot]' steps: - name: Check if checklist items are completed uses: Codeinwp/gha-pr-check-helper@master diff --git a/.github/workflows/sync-branches.yml b/.github/workflows/sync-branches.yml index 4084ce15d..cd40bd95f 100644 --- a/.github/workflows/sync-branches.yml +++ b/.github/workflows/sync-branches.yml @@ -21,11 +21,11 @@ jobs: from_branch: master target_branch: development github_token: ${{ secrets.BOT_TOKEN }} - - name: Merge development -> v2.3 + - name: Merge development -> next if: ${{ steps.retrieve-branch-name.outputs.branch_name == 'development' }} uses: Codeinwp/merge-branch@master with: type: now from_branch: development - target_branch: v2.3 + target_branch: next github_token: ${{ secrets.BOT_TOKEN }} diff --git a/.github/workflows/test-js.yml b/.github/workflows/test-js.yml index fec64d1c4..4cb9bba6f 100644 --- a/.github/workflows/test-js.yml +++ b/.github/workflows/test-js.yml @@ -1,11 +1,14 @@ name: Test JS -on: [pull_request] +on: + pull_request: + types: [ opened, synchronize, ready_for_review ] jobs: run: runs-on: ubuntu-latest + if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name strategy: matrix: node-version: [18.x] diff --git a/.github/workflows/test-php.yml b/.github/workflows/test-php.yml index a570c2c4b..05a8b9eb6 100644 --- a/.github/workflows/test-php.yml +++ b/.github/workflows/test-php.yml @@ -1,11 +1,14 @@ name: Test PHP -on: [pull_request] +on: + pull_request: + types: [ opened, synchronize, ready_for_review ] jobs: phplint: name: Phplint runs-on: ubuntu-latest + if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name steps: - name: Setup PHP version uses: shivammathur/setup-php@v1 @@ -33,6 +36,7 @@ jobs: phpunit: name: Phpunit runs-on: ubuntu-latest + if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name services: mysql: image: mysql:5.7 @@ -72,6 +76,7 @@ jobs: phpstan: name: PHPStan runs-on: ubuntu-latest + if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name steps: - name: Setup PHP version uses: shivammathur/setup-php@v2 diff --git a/composer.json b/composer.json index 3d162cebd..0258e5e17 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "dealerdirect/phpcodesniffer-composer-installer": "0.7.1", "automattic/vipwpcs": "^1.0.0", "phpunit/phpunit": "9.6.5", - "yoast/phpunit-polyfills": "^1.0", + "yoast/phpunit-polyfills": "^2.0", "phpstan/phpstan": "^1.10", "szepeviktor/phpstan-wordpress": "^1.3", "php-stubs/woocommerce-stubs": "^7.7", diff --git a/composer.lock b/composer.lock index c4d992115..b733a9629 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "60fffd630dc8f1393372f8533c20b01a", + "content-hash": "7fee5b4adf46e3b33d12c47e7cf1faa9", "packages": [ { "name": "codeinwp/themeisle-sdk", - "version": "3.3.0", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/Codeinwp/themeisle-sdk.git", - "reference": "68dc5d11c1d7a20a13f3ae730183f61ff309d574" + "reference": "efb66935e69935b21ad99b0e55484e611ce4549d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/68dc5d11c1d7a20a13f3ae730183f61ff309d574", - "reference": "68dc5d11c1d7a20a13f3ae730183f61ff309d574", + "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/efb66935e69935b21ad99b0e55484e611ce4549d", + "reference": "efb66935e69935b21ad99b0e55484e611ce4549d", "shasum": "" }, "require-dev": { @@ -42,9 +42,9 @@ ], "support": { "issues": "https://github.com/Codeinwp/themeisle-sdk/issues", - "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.3.0" + "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.3.1" }, - "time": "2023-05-30T08:55:06+00:00" + "time": "2023-06-21T06:55:46+00:00" }, { "name": "masterminds/html5", @@ -170,16 +170,16 @@ }, { "name": "stripe/stripe-php", - "version": "v10.14.0", + "version": "v10.16.0", "source": { "type": "git", "url": "https://github.com/stripe/stripe-php.git", - "reference": "c88a80fa7f361c2d30d6c81fb71f2bb30be1001f" + "reference": "ea863a92102a8e8dbdeddf79b4535c355ec62d91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stripe/stripe-php/zipball/c88a80fa7f361c2d30d6c81fb71f2bb30be1001f", - "reference": "c88a80fa7f361c2d30d6c81fb71f2bb30be1001f", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/ea863a92102a8e8dbdeddf79b4535c355ec62d91", + "reference": "ea863a92102a8e8dbdeddf79b4535c355ec62d91", "shasum": "" }, "require": { @@ -225,9 +225,9 @@ ], "support": { "issues": "https://github.com/stripe/stripe-php/issues", - "source": "https://github.com/stripe/stripe-php/tree/v10.14.0" + "source": "https://github.com/stripe/stripe-php/tree/v10.16.0" }, - "time": "2023-05-25T18:09:32+00:00" + "time": "2023-06-29T23:40:49+00:00" }, { "name": "tubalmartin/cssmin", @@ -585,16 +585,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.4", + "version": "v4.16.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" + "reference": "19526a33fb561ef417e822e85f08a00db4059c17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", + "reference": "19526a33fb561ef417e822e85f08a00db4059c17", "shasum": "" }, "require": { @@ -635,9 +635,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" }, - "time": "2023-03-05T19:49:14+00:00" + "time": "2023-06-25T14:52:30+00:00" }, { "name": "phar-io/manifest", @@ -796,16 +796,16 @@ }, { "name": "php-stubs/woocommerce-stubs", - "version": "v7.7.0", + "version": "v7.8.1", "source": { "type": "git", "url": "https://github.com/php-stubs/woocommerce-stubs.git", - "reference": "2fec812b7bb3458a232f4637bf83e4037106537d" + "reference": "3873da8a5634404a83756017b70675dadfd07783" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/2fec812b7bb3458a232f4637bf83e4037106537d", - "reference": "2fec812b7bb3458a232f4637bf83e4037106537d", + "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/3873da8a5634404a83756017b70675dadfd07783", + "reference": "3873da8a5634404a83756017b70675dadfd07783", "shasum": "" }, "require": { @@ -834,22 +834,22 @@ ], "support": { "issues": "https://github.com/php-stubs/woocommerce-stubs/issues", - "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v7.7.0" + "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v7.8.1" }, - "time": "2023-05-10T05:40:44+00:00" + "time": "2023-06-27T20:03:06+00:00" }, { "name": "php-stubs/wordpress-stubs", - "version": "v6.2.0", + "version": "v6.2.1", "source": { "type": "git", "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "b73fe99eadf9fb56363619dac0343b6d19907dce" + "reference": "0009429e639b748eef1c955200ea0d4e5ad5627d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/b73fe99eadf9fb56363619dac0343b6d19907dce", - "reference": "b73fe99eadf9fb56363619dac0343b6d19907dce", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/0009429e639b748eef1c955200ea0d4e5ad5627d", + "reference": "0009429e639b748eef1c955200ea0d4e5ad5627d", "shasum": "" }, "require-dev": { @@ -857,7 +857,8 @@ "php": "~7.3 || ~8.0", "php-stubs/generator": "^0.8.3", "phpdocumentor/reflection-docblock": "^5.3", - "phpstan/phpstan": "^1.9" + "phpstan/phpstan": "^1.10.12", + "phpunit/phpunit": "^9.5" }, "suggest": { "paragonie/sodium_compat": "Pure PHP implementation of libsodium", @@ -878,9 +879,9 @@ ], "support": { "issues": "https://github.com/php-stubs/wordpress-stubs/issues", - "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.2.0" + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.2.1" }, - "time": "2023-03-31T09:48:52+00:00" + "time": "2023-05-18T04:35:23+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -946,16 +947,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.15", + "version": "1.10.22", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "762c4dac4da6f8756eebb80e528c3a47855da9bd" + "reference": "97d694dfd4ceb57bcce4e3b38548f13ea62e4287" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/762c4dac4da6f8756eebb80e528c3a47855da9bd", - "reference": "762c4dac4da6f8756eebb80e528c3a47855da9bd", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/97d694dfd4ceb57bcce4e3b38548f13ea62e4287", + "reference": "97d694dfd4ceb57bcce4e3b38548f13ea62e4287", "shasum": "" }, "require": { @@ -1004,7 +1005,7 @@ "type": "tidelift" } ], - "time": "2023-05-09T15:28:01+00:00" + "time": "2023-06-30T20:04:11+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1726,16 +1727,16 @@ }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", "shasum": "" }, "require": { @@ -1780,7 +1781,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" }, "funding": [ { @@ -1788,7 +1789,7 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2023-05-07T05:35:17+00:00" }, { "name": "sebastian/environment", @@ -2747,30 +2748,29 @@ }, { "name": "yoast/phpunit-polyfills", - "version": "1.0.3", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", - "reference": "5ea3536428944955f969bc764bbe09738e151ada" + "reference": "c758753e8f9dac251fed396a73c8305af3f17922" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/5ea3536428944955f969bc764bbe09738e151ada", - "reference": "5ea3536428944955f969bc764bbe09738e151ada", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/c758753e8f9dac251fed396a73c8305af3f17922", + "reference": "c758753e8f9dac251fed396a73c8305af3f17922", "shasum": "" }, "require": { - "php": ">=5.4", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "php": ">=5.6", + "phpunit/phpunit": "^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0" }, "require-dev": { - "yoast/yoastcs": "^2.2.0" + "yoast/yoastcs": "^2.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.x-dev", - "dev-develop": "1.x-dev" + "dev-main": "2.x-dev" } }, "autoload": { @@ -2804,7 +2804,7 @@ "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", "source": "https://github.com/Yoast/PHPUnit-Polyfills" }, - "time": "2021-11-23T01:37:03+00:00" + "time": "2023-06-06T20:28:24+00:00" } ], "aliases": [], @@ -2817,5 +2817,5 @@ "platform-overrides": { "php": "7.4" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.3.0" } diff --git a/inc/integrations/api/form-response-data.php b/inc/integrations/api/form-response-data.php index 1881e3a83..85a8d3dd2 100644 --- a/inc/integrations/api/form-response-data.php +++ b/inc/integrations/api/form-response-data.php @@ -240,6 +240,18 @@ public function set_response( $response ) { return $this; } + /** + * Add new field to the response. + * + * @param string $key The key. + * @param mixed $value The value. + * @return $this + */ + public function add_response_field( $key, $value ) { + $this->response[ $key ] = $value; + return $this; + } + /** * Add new data to the response. * diff --git a/inc/plugins/class-stripe-api.php b/inc/plugins/class-stripe-api.php index bbc38c6cc..6fcb73de8 100644 --- a/inc/plugins/class-stripe-api.php +++ b/inc/plugins/class-stripe-api.php @@ -321,4 +321,22 @@ function( $item ) use ( $product ) { return $bool; } + + /** + * Get session email. + * + * @param string $session_id Stripe Session ID. + * + * @return bool|string + * @access public + */ + public function get_session_email( $session_id ) { + $session = $this->create_request( 'get_session', $session_id ); + + if ( empty( $session['customer_details']['email'] ) ) { + return false; + } + + return $session['customer_details']['email']; + } } diff --git a/inc/render/class-review-block.php b/inc/render/class-review-block.php index 5c4197e55..b12b07ce2 100644 --- a/inc/render/class-review-block.php +++ b/inc/render/class-review-block.php @@ -67,6 +67,9 @@ function() use ( $attributes, $post_id ) { ) ); + $is_one_colum_layout = strpos( $wrapper_attributes, 'is-style-single-column' ) !== false; + $is_inline_features = strpos( $wrapper_attributes, 'is-style-inline-features' ) !== false; + $main_heading = isset( $attributes['mainHeading'] ) ? $attributes['mainHeading'] : 'h2'; $sub_heading = isset( $attributes['subHeading'] ) ? $attributes['subHeading'] : 'h3'; @@ -79,7 +82,9 @@ function() use ( $attributes, $post_id ) { $html .= '