Skip to content
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

Tests: Stop using deprecated setMethods method #427

Merged
merged 2 commits into from Oct 5, 2021

Conversation

GaryJones
Copy link
Contributor

Description

Use a different MockBuilder function for mocking particular SUT methods.

Motivation and Context

PHPUnit\Framework\MockObject\MockBuilder::setMethods() is deprecated from PHPUnit 8, and will be removed in PHPUnit 10. The replacement is onlyMethods(), which was added in PHPUnit 8.

Ideally, PHPUnit-Pollyfills would handle this for PHPUnit 7, but right now it's not supported, so this PR includes a simple workaround.

Closes #426.

How Has This Been Tested?

Ran the CI tests.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@GaryJones GaryJones added this to the 3.0.0 milestone Sep 30, 2021
@GaryJones GaryJones self-assigned this Sep 30, 2021
@GaryJones GaryJones requested a review from a team as a code owner September 30, 2021 11:04
Use `onlyMethods()` instead, which ensures that the method that is being mocked does exist in the class being mocked.
@GaryJones GaryJones force-pushed the fix/switch-setMethods-for-onlyMethods branch from 17afc20 to bd8e7f3 Compare October 4, 2021 12:56
Copy link
Contributor

@pauarge pauarge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pauarge pauarge merged commit bb6d44b into develop Oct 5, 2021
@pauarge pauarge deleted the fix/switch-setMethods-for-onlyMethods branch October 5, 2021 13:56
pauarge added a commit that referenced this pull request Nov 25, 2021
* Remove custom post type to simplify test

It doesn’t change the functionality to have a custom post type or not, so to simplify we’ll remove that from the test.

* Change cpt-tax-archive to cpt-archive

* Fix code comments

* Clarify the name of the custom taxonomy

* Update check for cpt and taxonomy archives

* Change test name

* functioning e2e framework

* hello world test

* package-lock (+@wordpress/e2e-test-utils)

* hook tests into CI

* limit to a single job

* Update npm to latest

* cache npm in setup-node

* switch to lts syntax for node-version

* some progress using docker compose

* more progress -- it's working!

* docker-compose vs docker compose

* trying to wait for wp

* working loop i hope

* bg docker-compose correctly

* tweak name & rm unused var

* rm the strategy and just code in node lts

* try npm ci

* README for e2e tests

* fixup watch runner name

* add option to reset wp db to init script

* update readme

* update e2e readme

* incraese timeout so tests pass in interactive mode

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* fixup watch script ws

* add details to the 'Run the tests' section

* Add step to node test to confirm the build is up-to-date

* demonstrate failure case when untracked file is present

* demonstrate failure case when change to src is not present in build

* remove failure -- this should pass

* Bump prettier from 2.3.2 to 2.4.1

Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.4.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Renaming alpha

* Bump @wordpress/scripts from 17.1.0 to 18.0.1

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 17.1.0 to 18.0.1.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@18.0.1/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Simplifying get_options function

* Tests: Improve the get_current_url data provider

Data providers actually provide an iterator rather than just an array, so we can build up the data using `yield` instead.

As per https://peakd.com/hive-168588/@crell/fun-with-phpunit-data-providers this has several advantages:

1. It's easier to read, making it better for future you to understand the code.
1. It's less indented, which gives you more room for longer lines for each value.
1. Because each test set is syntactically independent, it's easier to add new ones, reorder them, or temporarily comment out a single test set.
1. If a given test set needs more setup than just a static list, it's simple to put that setup before the `yield` statement for which it is relevant.

As per the follow-up article https://peakd.com/hive-168588/@crell/advanced-phpunit-shenanigans, I've also included a `@testdox` line on the test method. When this contains the method parameters, it completely overrides the sentence when the `--testdox` flag is called when running PHPUnit.

* Tests: Rename final *-test.php file to *Test.php

PSR-4 naming is needed for PHPUnit 9.1 support.

Fixes #379.

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Updating package-lock

* Removing ampersand

* Revert "Removing ampersand"

This reverts commit 228c2b72b6748c17c8f5d4fbed296bc159a768d7.

* Remove jQuery from recommended widget

* Using built code

* Forcing reset of e2e

* Change trigger

* Revert "Change trigger"

This reverts commit f61c2a3c36b6634706d0ab70d90db97d3489c8fd.

* Fix flaky test

* Updating package-lock

* Rollback tests changes

* Changing red color in admin to match wp-admin

* Remove unused default logo variable

* Using npm caching on GitHub Actions

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Clarifying success message

* Updating built files

* Fixing syntax error

* Remove unused return_personalized_json function

* Hide admin warning on network admin

* Fix typo

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Adding unit tests

* Fix linting issues

* Simplifying set_options on test

* Separating function for testing

* Update @covers annotation

* Simplifying logic

* Fix rendering errors with multiple widgets

* Fixing linting issues

* Fixing issue with sanitization

* Cleaning up logic

* Updating tests to be more reliable

* Separating subtests

* Tests: Improve get current URL tests

The focus of these tests is on the parsing issues related to the domain, port, and potential path, and this is represented in the data provider.

However, it's good to be able to confirm that going to the homepage, random URL and a post via it's ID, also work well for each of the combinations in the first parts of the URL.

* Adding 3.0 upgrade notice on README

* Encoding boolean values

* Fix linting issues

* Fix linting issues

* Small typo

* Fix linting issues

* Fix linting issues

* Split out plugin actions links logic

Moves the logic that adds the plugin action link to its own class.

Adds integration tests.

See #96.

* Tests: e2e for verifying the plugin action link

See #401.

* API Key: Add utility method for checking it is set

Also add utility method for checking if it is missing.

Includes unit tests.

Closes #395.

* API key: add utility method to retrieve key

Adds unit test.

* Testcase: Allow getMethod() to use different class

The existing method made the assumption that only non-public methods in the `Parsely` class would need to be made available for testing with Reflection.

This updates the method to allow methods in other classes to be reflected as well.

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Apply suggestions from code review

Clarify variable name.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Adapting code to new project layout

* Using utility function to check for API keys

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Add admin warning for minimum requirements in 3.0 (#408)

* Adding admin upgrade warning

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Feature/improve test environment (#411)

* Tests: make future-compatible

- Use the snake_case fixture names
- Use wp-test-utils 1.0.0, and remove explicit PHPUnit constraints
- Refresh phpunit config file, including switching to TestDox output format

* CI: Use WP trunk with new test improvements

* CI: No need for pcov-clobber with PHPUnit 8.5

Also, don't ignore platform requirements for PHP 8, as we no longer need to force install PHPUnit 7.5 onto it.

* Bootstrap: Remove PHP_Token references

* Add coverage report back in

Not used yet, but without it, seems like no coverage check is actually done.

* CI: Add support for PHP 8.1 (allowed failures)

Also ensure `convertDeprecationsToExceptions` is true to better highlight PHP 8.1 native deprecation notices.

* Tests: split into unit and integration tests

See #179.

* Bootstrap: Move global code into a function

With all global code (other than some class file requires) in a function that is hooked in when WordPress runs, we can remove the `die`, which allows this file, with the defined constants and functions, to be included for unit tests.

* CI: Support running unit tests

* CI: Run unit tests on PHP 8 as well

* Tests: Define constants from plugin root file

* Tests: Fix CS

* Tests: Fix namespace

* Replace constants

* Various fixes

- Improve handling of no options being set.
- Fix CS
- Fix coverage annotations
- Fix wrong TestCase reference.

* Composer: Improve coverage scripts

Now with verbosity, which is useful in PHPUnit 9.5 to see why a test is classed as risky.

* CI: Add PHP 8.2

* CI: Fix indentation

* CI: Run coverage for integration tests

* CI: Always run coverage on multisite installs

* Re-fix Settings link on plugins page

* Tests: Re-add PluginActions test

Somehow got dropped from my branch when I rebased on to `develop`.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Split out row action link logic (#406)

* Bring develop up to date with 2.6.0 (#415)

* Release 2.6.0 (#414)

* Hide the recommendation widget until the element is populated

* Update hidden classname per feedback

* Add conditional for cpt archives

Change to get queried object instead of category.

* Change conditional to is_archive

`is_archive()` is better in this case because it also targets taxonomy archives as well as custom post type archives.

* Add unit tests for CPT archive metadata

* Add unit test for CPT term archive

* Beautify code

* Remove custom post type to simplify test

It doesn’t change the functionality to have a custom post type or not, so to simplify we’ll remove that from the test.

* Change cpt-tax-archive to cpt-archive

* Fix code comments

* Clarify the name of the custom taxonomy

* Update check for cpt and taxonomy archives

* Change test name

* functioning e2e framework

* hello world test

* package-lock (+@wordpress/e2e-test-utils)

* hook tests into CI

* limit to a single job

* Update npm to latest

* cache npm in setup-node

* switch to lts syntax for node-version

* some progress using docker compose

* more progress -- it's working!

* docker-compose vs docker compose

* trying to wait for wp

* working loop i hope

* bg docker-compose correctly

* tweak name & rm unused var

* rm the strategy and just code in node lts

* try npm ci

* README for e2e tests

* fixup watch runner name

* add option to reset wp db to init script

* update readme

* update e2e readme

* incraese timeout so tests pass in interactive mode

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* fixup watch script ws

* add details to the 'Run the tests' section

* Add step to node test to confirm the build is up-to-date

* demonstrate failure case when untracked file is present

* demonstrate failure case when change to src is not present in build

* remove failure -- this should pass

* Bump prettier from 2.3.2 to 2.4.1

Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.4.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Renaming alpha

* Bump @wordpress/scripts from 17.1.0 to 18.0.1

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 17.1.0 to 18.0.1.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@18.0.1/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Simplifying get_options function

* Tests: Improve the get_current_url data provider

Data providers actually provide an iterator rather than just an array, so we can build up the data using `yield` instead.

As per https://peakd.com/hive-168588/@crell/fun-with-phpunit-data-providers this has several advantages:

1. It's easier to read, making it better for future you to understand the code.
1. It's less indented, which gives you more room for longer lines for each value.
1. Because each test set is syntactically independent, it's easier to add new ones, reorder them, or temporarily comment out a single test set.
1. If a given test set needs more setup than just a static list, it's simple to put that setup before the `yield` statement for which it is relevant.

As per the follow-up article https://peakd.com/hive-168588/@crell/advanced-phpunit-shenanigans, I've also included a `@testdox` line on the test method. When this contains the method parameters, it completely overrides the sentence when the `--testdox` flag is called when running PHPUnit.

* Tests: Rename final *-test.php file to *Test.php

PSR-4 naming is needed for PHPUnit 9.1 support.

Fixes #379.

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Updating package-lock

* Removing ampersand

* Revert "Removing ampersand"

This reverts commit 228c2b72b6748c17c8f5d4fbed296bc159a768d7.

* Remove jQuery from recommended widget

* Using built code

* Forcing reset of e2e

* Change trigger

* Revert "Change trigger"

This reverts commit f61c2a3c36b6634706d0ab70d90db97d3489c8fd.

* Fix flaky test

* Updating package-lock

* Rollback tests changes

* Changing red color in admin to match wp-admin

* Remove unused default logo variable

* Using npm caching on GitHub Actions

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Clarifying success message

* Updating built files

* Fixing syntax error

* Remove unused return_personalized_json function

* Hide admin warning on network admin

* Fix typo

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Adding unit tests

* Fix linting issues

* Simplifying set_options on test

* Separating function for testing

* Update @covers annotation

* Simplifying logic

* Fix rendering errors with multiple widgets

* Fixing linting issues

* Fixing issue with sanitization

* Cleaning up logic

* Updating tests to be more reliable

* Separating subtests

* Tests: Improve get current URL tests

The focus of these tests is on the parsing issues related to the domain, port, and potential path, and this is represented in the data provider.

However, it's good to be able to confirm that going to the homepage, random URL and a post via it's ID, also work well for each of the combinations in the first parts of the URL.

* Adding 3.0 upgrade notice on README

* Encoding boolean values

* Fix linting issues

* Fix linting issues

* Small typo

* Fix linting issues

* Fix linting issues

* Split out plugin actions links logic

Moves the logic that adds the plugin action link to its own class.

Adds integration tests.

See #96.

* Tests: e2e for verifying the plugin action link

See #401.

* API Key: Add utility method for checking it is set

Also add utility method for checking if it is missing.

Includes unit tests.

Closes #395.

* API key: add utility method to retrieve key

Adds unit test.

* Testcase: Allow getMethod() to use different class

The existing method made the assumption that only non-public methods in the `Parsely` class would need to be made available for testing with Reflection.

This updates the method to allow methods in other classes to be reflected as well.

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Apply suggestions from code review

Clarify variable name.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Adapting code to new project layout

* Using utility function to check for API keys

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Add admin warning for minimum requirements in 3.0 (#408)

* Adding admin upgrade warning

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Feature/improve test environment (#411)

* Tests: make future-compatible

- Use the snake_case fixture names
- Use wp-test-utils 1.0.0, and remove explicit PHPUnit constraints
- Refresh phpunit config file, including switching to TestDox output format

* CI: Use WP trunk with new test improvements

* CI: No need for pcov-clobber with PHPUnit 8.5

Also, don't ignore platform requirements for PHP 8, as we no longer need to force install PHPUnit 7.5 onto it.

* Bootstrap: Remove PHP_Token references

* Add coverage report back in

Not used yet, but without it, seems like no coverage check is actually done.

* CI: Add support for PHP 8.1 (allowed failures)

Also ensure `convertDeprecationsToExceptions` is true to better highlight PHP 8.1 native deprecation notices.

* Tests: split into unit and integration tests

See #179.

* Bootstrap: Move global code into a function

With all global code (other than some class file requires) in a function that is hooked in when WordPress runs, we can remove the `die`, which allows this file, with the defined constants and functions, to be included for unit tests.

* CI: Support running unit tests

* CI: Run unit tests on PHP 8 as well

* Tests: Define constants from plugin root file

* Tests: Fix CS

* Tests: Fix namespace

* Replace constants

* Various fixes

- Improve handling of no options being set.
- Fix CS
- Fix coverage annotations
- Fix wrong TestCase reference.

* Composer: Improve coverage scripts

Now with verbosity, which is useful in PHPUnit 9.5 to see why a test is classed as risky.

* CI: Add PHP 8.2

* CI: Fix indentation

* CI: Run coverage for integration tests

* CI: Always run coverage on multisite installs

* Re-fix Settings link on plugins page

* Tests: Re-add PluginActions test

Somehow got dropped from my branch when I rebased on to `develop`.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Split out row action link logic (#406)

* Bumping version numbers

* Add changelog

* Update CHANGELOG.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Moving deprecated notes from changelog

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>

* Bumping version number

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>

* Increase minimum PHP and WP versions

See #390.

* CI: Specify coverage: none where it is not needed

See #418.

* Declare strict_types=1

On it's own this doesn't do much, but when more type definitions are added, particularly scalar types, then PHP will handle the types without juggling them.

For choice of positioning below the file-level DocBlock, see https://www.php-fig.org/psr/psr-12/.
For lack of spaces inside the parentheses and around the `=`, see https://make.wordpress.org/core/2020/03/20/updating-the-coding-standards-for-modern-php/

See #389.

* Fix PHP 8+ TypeError for getting current URL

> TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, bool given

This originates when no `$post_id` is passed to the `get_current_url()` method, and no Post ID can be determined from the global `$post`.

As `get_permalink()` can return `false`, then casting it to a string means it will have a value of an empty string.

* Docs: Add contributor note about strong typing

* Remove post_has_viewable_type (#417)

* Using PHP 7 null coalescing operator (#421)

* Using PHP 7 null coalescing operator

* Fixing linter

* Revert "Add admin warning for minimum requirements in 3.0 (#408)" (#424)

* Revert "Add admin warning for minimum requirements in 3.0 (#408)"

This reverts commit 79742d5b39470fb9dd4267eacdf34b41fb2ff8b9.

* Fix identation

* Add return type declarations (#429)

* Add return types for Parsely class

* Add return types to test methods

* Add return types to remaining files

* Nested dirname calls can be replaced

Second argument supported since PHP 7.0.

* Declare visibility for class-level constants

Makes them all explicitly `public`, but some of these could be made less visible.

See #428.

* Convert documented param type to short form

* Fix discrepancy of class name and its use

* Replace full qualified name with an import

* Inline one-time use variables

* Add return type declarations

* Remove incorrect return type declaration

* Fix typos and unnecessary abbreviations

* Remove unnecessary regular expression escaping

* Regexp: Use character class

More performant than single character alternation.

* Use const syntax instead of define()

* Fix CS alignments

* Tests: Stop using deprecated setMethods method (#427)

* Tests: Stop using deprecated setMethods method

Use `onlyMethods()` instead, which ensures that the method that is being mocked does exist in the class being mocked.

* Tests: use onlyMethods() only if it exists

* Displaying Open on Parse.ly links by default (#433)

* Displaying Open on Parse.ly links by default

* Empty

* Remove deprecated filter after_set_parsely_page (#436)

* Remove deprecated filter after_set_parsely_page

* Updating tests

* Remove deprecated filter parsely_filter_insert_javascript (#437)

* Remove deprecated filter parsely_filter_insert_javascript

* Removing deprecated test

* Fixing some code smells (#435)

* Fixing code smells

* Removing duplicate

* Fix linting issues

* Adding E2E test to check for available recommended widget (#434)

* Adding E2E test to check for available recommended widget

* Adding utils

* Documenting utils and separating logical behavior

* Adding missing await

* Extracting more logic into constants

* Fix not working readme code sample (#439)

* Update defaults in `get_bottom_level_term` to empty array to prevent warnings downstream (#438)

* Update class-parsely.php

Change default from null to empty array to prevent warnings thrown by array_diff on line 1650

* Update src/class-parsely.php

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Removing old init script (#441)

* Add wp_parsely_should_insert_metadata filter (#440)

* Add wp_parsely_should_insert_metadata filter

* Revert return change

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding uninstall script (#444)

* Adding uninstall script

* Addressing linting issues

* Bump @wordpress/e2e-test-utils from 5.4.3 to 5.4.4 (#449)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.3 to 5.4.4.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.4/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/scripts from 18.0.1 to 18.1.0 (#450)

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 18.0.1 to 18.1.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@18.1.0/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Constant return type on insert_parsely_page (#443)

* Constant return type on insert_parsely_page

* Adding deprecation warning for method

* Fix linting issues

* Fixing backwards compat return

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Fixing return types of update_metadata_endpoint (#446)

* Fixing return types of update_metadata_endpoint

* Fix identation

* Change get_current_url default type to non-post (#447)

* Change to non-post default

* Fix linting issues

* Adding docstring to document parameter change

* Create codeql-analysis.yml (#453)

See https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning

* Add namespaces to files (#430)

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Bring develop up to date with 2.6.1 (#454)

* Release 2.6.0 (#414)

* Hide the recommendation widget until the element is populated

* Update hidden classname per feedback

* Add conditional for cpt archives

Change to get queried object instead of category.

* Change conditional to is_archive

`is_archive()` is better in this case because it also targets taxonomy archives as well as custom post type archives.

* Add unit tests for CPT archive metadata

* Add unit test for CPT term archive

* Beautify code

* Remove custom post type to simplify test

It doesn’t change the functionality to have a custom post type or not, so to simplify we’ll remove that from the test.

* Change cpt-tax-archive to cpt-archive

* Fix code comments

* Clarify the name of the custom taxonomy

* Update check for cpt and taxonomy archives

* Change test name

* functioning e2e framework

* hello world test

* package-lock (+@wordpress/e2e-test-utils)

* hook tests into CI

* limit to a single job

* Update npm to latest

* cache npm in setup-node

* switch to lts syntax for node-version

* some progress using docker compose

* more progress -- it's working!

* docker-compose vs docker compose

* trying to wait for wp

* working loop i hope

* bg docker-compose correctly

* tweak name & rm unused var

* rm the strategy and just code in node lts

* try npm ci

* README for e2e tests

* fixup watch runner name

* add option to reset wp db to init script

* update readme

* update e2e readme

* incraese timeout so tests pass in interactive mode

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* fixup watch script ws

* add details to the 'Run the tests' section

* Add step to node test to confirm the build is up-to-date

* demonstrate failure case when untracked file is present

* demonstrate failure case when change to src is not present in build

* remove failure -- this should pass

* Bump prettier from 2.3.2 to 2.4.1

Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.4.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Renaming alpha

* Bump @wordpress/scripts from 17.1.0 to 18.0.1

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 17.1.0 to 18.0.1.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@18.0.1/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Simplifying get_options function

* Tests: Improve the get_current_url data provider

Data providers actually provide an iterator rather than just an array, so we can build up the data using `yield` instead.

As per https://peakd.com/hive-168588/@crell/fun-with-phpunit-data-providers this has several advantages:

1. It's easier to read, making it better for future you to understand the code.
1. It's less indented, which gives you more room for longer lines for each value.
1. Because each test set is syntactically independent, it's easier to add new ones, reorder them, or temporarily comment out a single test set.
1. If a given test set needs more setup than just a static list, it's simple to put that setup before the `yield` statement for which it is relevant.

As per the follow-up article https://peakd.com/hive-168588/@crell/advanced-phpunit-shenanigans, I've also included a `@testdox` line on the test method. When this contains the method parameters, it completely overrides the sentence when the `--testdox` flag is called when running PHPUnit.

* Tests: Rename final *-test.php file to *Test.php

PSR-4 naming is needed for PHPUnit 9.1 support.

Fixes #379.

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Updating package-lock

* Removing ampersand

* Revert "Removing ampersand"

This reverts commit 228c2b72b6748c17c8f5d4fbed296bc159a768d7.

* Remove jQuery from recommended widget

* Using built code

* Forcing reset of e2e

* Change trigger

* Revert "Change trigger"

This reverts commit f61c2a3c36b6634706d0ab70d90db97d3489c8fd.

* Fix flaky test

* Updating package-lock

* Rollback tests changes

* Changing red color in admin to match wp-admin

* Remove unused default logo variable

* Using npm caching on GitHub Actions

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Clarifying success message

* Updating built files

* Fixing syntax error

* Remove unused return_personalized_json function

* Hide admin warning on network admin

* Fix typo

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Adding unit tests

* Fix linting issues

* Simplifying set_options on test

* Separating function for testing

* Update @covers annotation

* Simplifying logic

* Fix rendering errors with multiple widgets

* Fixing linting issues

* Fixing issue with sanitization

* Cleaning up logic

* Updating tests to be more reliable

* Separating subtests

* Tests: Improve get current URL tests

The focus of these tests is on the parsing issues related to the domain, port, and potential path, and this is represented in the data provider.

However, it's good to be able to confirm that going to the homepage, random URL and a post via it's ID, also work well for each of the combinations in the first parts of the URL.

* Adding 3.0 upgrade notice on README

* Encoding boolean values

* Fix linting issues

* Fix linting issues

* Small typo

* Fix linting issues

* Fix linting issues

* Split out plugin actions links logic

Moves the logic that adds the plugin action link to its own class.

Adds integration tests.

See #96.

* Tests: e2e for verifying the plugin action link

See #401.

* API Key: Add utility method for checking it is set

Also add utility method for checking if it is missing.

Includes unit tests.

Closes #395.

* API key: add utility method to retrieve key

Adds unit test.

* Testcase: Allow getMethod() to use different class

The existing method made the assumption that only non-public methods in the `Parsely` class would need to be made available for testing with Reflection.

This updates the method to allow methods in other classes to be reflected as well.

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Apply suggestions from code review

Clarify variable name.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Adapting code to new project layout

* Using utility function to check for API keys

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Add admin warning for minimum requirements in 3.0 (#408)

* Adding admin upgrade warning

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Feature/improve test environment (#411)

* Tests: make future-compatible

- Use the snake_case fixture names
- Use wp-test-utils 1.0.0, and remove explicit PHPUnit constraints
- Refresh phpunit config file, including switching to TestDox output format

* CI: Use WP trunk with new test improvements

* CI: No need for pcov-clobber with PHPUnit 8.5

Also, don't ignore platform requirements for PHP 8, as we no longer need to force install PHPUnit 7.5 onto it.

* Bootstrap: Remove PHP_Token references

* Add coverage report back in

Not used yet, but without it, seems like no coverage check is actually done.

* CI: Add support for PHP 8.1 (allowed failures)

Also ensure `convertDeprecationsToExceptions` is true to better highlight PHP 8.1 native deprecation notices.

* Tests: split into unit and integration tests

See #179.

* Bootstrap: Move global code into a function

With all global code (other than some class file requires) in a function that is hooked in when WordPress runs, we can remove the `die`, which allows this file, with the defined constants and functions, to be included for unit tests.

* CI: Support running unit tests

* CI: Run unit tests on PHP 8 as well

* Tests: Define constants from plugin root file

* Tests: Fix CS

* Tests: Fix namespace

* Replace constants

* Various fixes

- Improve handling of no options being set.
- Fix CS
- Fix coverage annotations
- Fix wrong TestCase reference.

* Composer: Improve coverage scripts

Now with verbosity, which is useful in PHPUnit 9.5 to see why a test is classed as risky.

* CI: Add PHP 8.2

* CI: Fix indentation

* CI: Run coverage for integration tests

* CI: Always run coverage on multisite installs

* Re-fix Settings link on plugins page

* Tests: Re-add PluginActions test

Somehow got dropped from my branch when I rebased on to `develop`.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Split out row action link logic (#406)

* Bumping version numbers

* Add changelog

* Update CHANGELOG.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Moving deprecated notes from changelog

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>

* Fix recommended widget not following configuration (#451)

* Fix recommended widget not following configuration

* Remove unwanted console log

* Release 2.6.1 (#452)

* Preparing for 2.6.1 release

* Update CHANGELOG.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Reverting test changes

* Reverting more changes

* Updating asset

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>

* Removing empty functions (#456)

* Enqueue scripts with theme independent hook (#458)

* Move Parse.ly settings to views folder (#459)

* Move Parse.ly settings to views folder

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Removing Parse.ly load text domain (#457)

* i18n: Fix JS string translation

* Adding argument types to functions (#455)

* Adding argument types to functions

* Making tests pass

* Fix linting issues

* Adding types to tests

* Fix type issues

* Addressing PR feedback

* Addressing tests

* Updating more tests

* Fixing final test

* Removing additional comment lines

* Revert OtherTest

* Revert "Revert OtherTest"

This reverts commit 5b8607a010c23e98a8e15676cf82a6724412dd9c.

* Reverting test changes and adding more defensive code on authors

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding translation support for Yes and No fields (#463)

* Adding translation support for Yes and No fields

* Fix linting issues

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding labels to admin settings form (#464)

* Adding labels to admin settings form

* Fixing identation

* Bump @wordpress/e2e-test-utils from 5.4.4 to 5.4.5 (#466)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.4 to 5.4.5.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.5/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/scripts from 18.1.0 to 19.0.0 (#465)

* Bump @wordpress/scripts from 18.1.0 to 19.0.0

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 18.1.0 to 19.0.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@19.0.0/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Updating built files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pau@outlook.com>

* Removing code coverage annotations (#469)

* Removing upgrade README notice (#470)

* Extract settings page from Parsely class (#467)

* Moving settings page out of class-parsely

* Move print dynamic tracking note

* Fixing hooks

* Fix automated linting issues

* Fix manual linting issues

* Updating hook to _admin_menu

* Fix type errors (#474)

* Fix type error get_api_url

* Fixing various type errors

* Fix linting issues

* Adding namespace to Recommended Widget (#475)

* Fix type error get_api_url

* Fixing various type errors

* Fix linting issues

* Adding missing namespaces

* Namespacing recommended widget

* Using proper namespace on tests

* Adding filter to display Cloudflare links (#473)

* Adding filter to display CloudFlare links

* Adding test for filter

* Updating failing test

* Fix multisite test

* Updating readme

* Update README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Updating filter docs

* Removing redundant test assertions

* Changing name of the filter

* Update README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Avoid making duplicate calls on Recommended Widget (#460)

* Avoid making duplicate calls on Recommended Widget

* Refactoring constructUrl

* Fixing parsing issues of updated values

* Adding e2e tests

* Adding type fixes

* Improving type fixes

* Revert optional post

* Extract admin warning from class-parsely (#468)

* Moving settings page out of class-parsely

* Move print dynamic tracking note

* Fixing hooks

* Fix automated linting issues

* Fix manual linting issues

* Extracting admin warning

* Updating hook to _admin_menu

* Moving admin warning tests

* Fix get method

* e2e tests: fix watch command (#476)

* e2e tests: fix watch command

Previously it would error as `test-e2e` command didn't exist.

* Update package.json

* Adding e2e interactive command

* Fix padding

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pau@outlook.com>

* Adding namespace to root class (#477)

* Starting namespace add

* Adding namespace to root class

* Working on tests

* Working on UI tests

* Address StructuredData tests

* Explicit WP_User import

* Fix linting issues

* Using fully qualified names on docstrings in StructuredData tests

* Correcting more docstrings

* Fixing warnings on UI tests

* Fix get_options

* Removing warnings on AdminWarningTest

* Fix FBIA tests

* Fix Integrations Test

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Bump @wordpress/scripts from 19.0.0 to 19.1.0 (#480)

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 19.0.0 to 19.1.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/@wordpress/scripts@19.1.0/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@19.1.0/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/e2e-test-utils from 5.4.5 to 5.4.6 (#479)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.5 to 5.4.6.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/@wordpress/e2e-test-utils@5.4.6/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.6/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Bump @wordpress/e2e-test-utils from 5.4.6 to 5.4.7 (#488)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.6 to 5.4.7.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.7/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Use checkboxes for multiple selects in settings page (#482)

* Moving settings page out of class-parsely

* Move print dynamic tracking note

* Fixing hooks

* Fix automated linting issues

* Fix manual linting issues

* Updating hook to _admin_menu

* Working on settings select

* Formatting data correctly

* Rollback new line

* Reverting label change

* Fix automated linting issues

* Fix linting issues

* Simplifying select

* Removing references to multiple argument

* Displaying public taxonomies only

* Matching id and label of checkbox

* Move tracker logic to separate file (#478)

* Starting namespace add

* Adding namespace to root class

* Working on tests

* Working on UI tests

* Address StructuredData tests

* Explicit WP_User import

* Fix linting issues

* Using fully qualified names on docstrings in StructuredData tests

* Correcting more docstrings

* Fixing warnings on UI tests

* Fix get_options

* Removing warnings on AdminWarningTest

* Fix FBIA tests

* Fix Integrations Test

* Splitting out tracker code

* Adding tracker test

* Adding additional tests

* Keep moving tests

* Moving constant

* Adding WP_Scripts

* Renaming class to scripts

* Fixing scripts naming

* Fix path

* Making sure script enqueue is clean

* Fix linting issues

* Updating comment

* Updating more comments

* Bump @wordpress/eslint-plugin from 9.2.0 to 9.3.0 (#490)

Bumps [@wordpress/eslint-plugin](https://github.com/WordPress/gutenberg/tree/HEAD/packages/eslint-plugin) from 9.2.0 to 9.3.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/eslint-plugin@9.3.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@wordpress/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/e2e-test-utils from 5.4.7 to 5.4.8 (#492)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.7 to 5.4.8.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.8/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/scripts from 19.1.0 to 19.2.1 (#491)

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 19.1.0 to 19.2.1.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@19.2.1/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Renaming functions on Scripts class (#481)

* Starting namespace add

* Adding namespace to root class

* Working on tests

* Working on UI tests

* Address StructuredData tests

* Explicit WP_User import

* Fix linting issues

* Using fully qualified names on docstrings in StructuredData tests

* Correcting more docstrings

* Fixing warnings on UI tests

* Fix get_options

* Removing warnings on AdminWarningTest

* Fix FBIA tests

* Fix Integrations Test

* Splitting out tracker code

* Adding tracker test

* Adding additional tests

* Keep moving tests

* Moving constant

* Adding WP_Scripts

* Fixing small issues with scripts class

* Renaming class to scripts

* Fixing scripts naming

* Fix path

* Renaming functions on tests

* Adding a cannonical way of running the plugin locally (#493)

* Adding a local dev environment

* Adding link to VIP dev-env

* Fix tabs on package.json

* Making class members private (#486)

* Making class members private

* Fix FBIA tests

* Fix Recommended API tests

* Revert AMP changes

* Using reflection in tests

* Test with hardcoded constant

* Fix test

* Update tests/Integration/Integrations/FacebookInstantArticlesTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding changelog for 3.0.0 (#495)

* Adding Changelog for 3.0

* Finishing up changelog

* Preparing 3.0.0 release

* Updating changelog

* Making recommended widget final

* Adding more details to Changelog

* Adding more detailed changelog

* Adding more details on removed section

* Fix typo

* Fix plugin typo

Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>
Co-authored-by: Michael Chan <michael.chan@automattic.com>
pauarge added a commit that referenced this pull request Nov 25, 2021
* Add unit tests for CPT archive metadata

* Add unit test for CPT term archive

* Beautify code

* Remove custom post type to simplify test

It doesn’t change the functionality to have a custom post type or not, so to simplify we’ll remove that from the test.

* Change cpt-tax-archive to cpt-archive

* Fix code comments

* Clarify the name of the custom taxonomy

* Update check for cpt and taxonomy archives

* Change test name

* functioning e2e framework

* hello world test

* package-lock (+@wordpress/e2e-test-utils)

* hook tests into CI

* limit to a single job

* Update npm to latest

* cache npm in setup-node

* switch to lts syntax for node-version

* some progress using docker compose

* more progress -- it's working!

* docker-compose vs docker compose

* trying to wait for wp

* working loop i hope

* bg docker-compose correctly

* tweak name & rm unused var

* rm the strategy and just code in node lts

* try npm ci

* README for e2e tests

* fixup watch runner name

* add option to reset wp db to init script

* update readme

* update e2e readme

* incraese timeout so tests pass in interactive mode

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* fixup watch script ws

* add details to the 'Run the tests' section

* Add step to node test to confirm the build is up-to-date

* demonstrate failure case when untracked file is present

* demonstrate failure case when change to src is not present in build

* remove failure -- this should pass

* Bump prettier from 2.3.2 to 2.4.1

Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.4.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Renaming alpha

* Bump @wordpress/scripts from 17.1.0 to 18.0.1

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 17.1.0 to 18.0.1.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@18.0.1/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Simplifying get_options function

* Tests: Improve the get_current_url data provider

Data providers actually provide an iterator rather than just an array, so we can build up the data using `yield` instead.

As per https://peakd.com/hive-168588/@crell/fun-with-phpunit-data-providers this has several advantages:

1. It's easier to read, making it better for future you to understand the code.
1. It's less indented, which gives you more room for longer lines for each value.
1. Because each test set is syntactically independent, it's easier to add new ones, reorder them, or temporarily comment out a single test set.
1. If a given test set needs more setup than just a static list, it's simple to put that setup before the `yield` statement for which it is relevant.

As per the follow-up article https://peakd.com/hive-168588/@crell/advanced-phpunit-shenanigans, I've also included a `@testdox` line on the test method. When this contains the method parameters, it completely overrides the sentence when the `--testdox` flag is called when running PHPUnit.

* Tests: Rename final *-test.php file to *Test.php

PSR-4 naming is needed for PHPUnit 9.1 support.

Fixes #379.

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Updating package-lock

* Removing ampersand

* Revert "Removing ampersand"

This reverts commit 228c2b72b6748c17c8f5d4fbed296bc159a768d7.

* Remove jQuery from recommended widget

* Using built code

* Forcing reset of e2e

* Change trigger

* Revert "Change trigger"

This reverts commit f61c2a3c36b6634706d0ab70d90db97d3489c8fd.

* Fix flaky test

* Updating package-lock

* Rollback tests changes

* Changing red color in admin to match wp-admin

* Remove unused default logo variable

* Using npm caching on GitHub Actions

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Clarifying success message

* Updating built files

* Fixing syntax error

* Remove unused return_personalized_json function

* Hide admin warning on network admin

* Fix typo

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Adding unit tests

* Fix linting issues

* Simplifying set_options on test

* Separating function for testing

* Update @covers annotation

* Simplifying logic

* Fix rendering errors with multiple widgets

* Fixing linting issues

* Fixing issue with sanitization

* Cleaning up logic

* Updating tests to be more reliable

* Separating subtests

* Tests: Improve get current URL tests

The focus of these tests is on the parsing issues related to the domain, port, and potential path, and this is represented in the data provider.

However, it's good to be able to confirm that going to the homepage, random URL and a post via it's ID, also work well for each of the combinations in the first parts of the URL.

* Adding 3.0 upgrade notice on README

* Encoding boolean values

* Fix linting issues

* Fix linting issues

* Small typo

* Fix linting issues

* Fix linting issues

* Split out plugin actions links logic

Moves the logic that adds the plugin action link to its own class.

Adds integration tests.

See #96.

* Tests: e2e for verifying the plugin action link

See #401.

* API Key: Add utility method for checking it is set

Also add utility method for checking if it is missing.

Includes unit tests.

Closes #395.

* API key: add utility method to retrieve key

Adds unit test.

* Testcase: Allow getMethod() to use different class

The existing method made the assumption that only non-public methods in the `Parsely` class would need to be made available for testing with Reflection.

This updates the method to allow methods in other classes to be reflected as well.

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Apply suggestions from code review

Clarify variable name.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Adapting code to new project layout

* Using utility function to check for API keys

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Add admin warning for minimum requirements in 3.0 (#408)

* Adding admin upgrade warning

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Feature/improve test environment (#411)

* Tests: make future-compatible

- Use the snake_case fixture names
- Use wp-test-utils 1.0.0, and remove explicit PHPUnit constraints
- Refresh phpunit config file, including switching to TestDox output format

* CI: Use WP trunk with new test improvements

* CI: No need for pcov-clobber with PHPUnit 8.5

Also, don't ignore platform requirements for PHP 8, as we no longer need to force install PHPUnit 7.5 onto it.

* Bootstrap: Remove PHP_Token references

* Add coverage report back in

Not used yet, but without it, seems like no coverage check is actually done.

* CI: Add support for PHP 8.1 (allowed failures)

Also ensure `convertDeprecationsToExceptions` is true to better highlight PHP 8.1 native deprecation notices.

* Tests: split into unit and integration tests

See #179.

* Bootstrap: Move global code into a function

With all global code (other than some class file requires) in a function that is hooked in when WordPress runs, we can remove the `die`, which allows this file, with the defined constants and functions, to be included for unit tests.

* CI: Support running unit tests

* CI: Run unit tests on PHP 8 as well

* Tests: Define constants from plugin root file

* Tests: Fix CS

* Tests: Fix namespace

* Replace constants

* Various fixes

- Improve handling of no options being set.
- Fix CS
- Fix coverage annotations
- Fix wrong TestCase reference.

* Composer: Improve coverage scripts

Now with verbosity, which is useful in PHPUnit 9.5 to see why a test is classed as risky.

* CI: Add PHP 8.2

* CI: Fix indentation

* CI: Run coverage for integration tests

* CI: Always run coverage on multisite installs

* Re-fix Settings link on plugins page

* Tests: Re-add PluginActions test

Somehow got dropped from my branch when I rebased on to `develop`.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Split out row action link logic (#406)

* Bring develop up to date with 2.6.0 (#415)

* Release 2.6.0 (#414)

* Hide the recommendation widget until the element is populated

* Update hidden classname per feedback

* Add conditional for cpt archives

Change to get queried object instead of category.

* Change conditional to is_archive

`is_archive()` is better in this case because it also targets taxonomy archives as well as custom post type archives.

* Add unit tests for CPT archive metadata

* Add unit test for CPT term archive

* Beautify code

* Remove custom post type to simplify test

It doesn’t change the functionality to have a custom post type or not, so to simplify we’ll remove that from the test.

* Change cpt-tax-archive to cpt-archive

* Fix code comments

* Clarify the name of the custom taxonomy

* Update check for cpt and taxonomy archives

* Change test name

* functioning e2e framework

* hello world test

* package-lock (+@wordpress/e2e-test-utils)

* hook tests into CI

* limit to a single job

* Update npm to latest

* cache npm in setup-node

* switch to lts syntax for node-version

* some progress using docker compose

* more progress -- it's working!

* docker-compose vs docker compose

* trying to wait for wp

* working loop i hope

* bg docker-compose correctly

* tweak name & rm unused var

* rm the strategy and just code in node lts

* try npm ci

* README for e2e tests

* fixup watch runner name

* add option to reset wp db to init script

* update readme

* update e2e readme

* incraese timeout so tests pass in interactive mode

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* fixup watch script ws

* add details to the 'Run the tests' section

* Add step to node test to confirm the build is up-to-date

* demonstrate failure case when untracked file is present

* demonstrate failure case when change to src is not present in build

* remove failure -- this should pass

* Bump prettier from 2.3.2 to 2.4.1

Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.4.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Renaming alpha

* Bump @wordpress/scripts from 17.1.0 to 18.0.1

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 17.1.0 to 18.0.1.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@18.0.1/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Simplifying get_options function

* Tests: Improve the get_current_url data provider

Data providers actually provide an iterator rather than just an array, so we can build up the data using `yield` instead.

As per https://peakd.com/hive-168588/@crell/fun-with-phpunit-data-providers this has several advantages:

1. It's easier to read, making it better for future you to understand the code.
1. It's less indented, which gives you more room for longer lines for each value.
1. Because each test set is syntactically independent, it's easier to add new ones, reorder them, or temporarily comment out a single test set.
1. If a given test set needs more setup than just a static list, it's simple to put that setup before the `yield` statement for which it is relevant.

As per the follow-up article https://peakd.com/hive-168588/@crell/advanced-phpunit-shenanigans, I've also included a `@testdox` line on the test method. When this contains the method parameters, it completely overrides the sentence when the `--testdox` flag is called when running PHPUnit.

* Tests: Rename final *-test.php file to *Test.php

PSR-4 naming is needed for PHPUnit 9.1 support.

Fixes #379.

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Updating package-lock

* Removing ampersand

* Revert "Removing ampersand"

This reverts commit 228c2b72b6748c17c8f5d4fbed296bc159a768d7.

* Remove jQuery from recommended widget

* Using built code

* Forcing reset of e2e

* Change trigger

* Revert "Change trigger"

This reverts commit f61c2a3c36b6634706d0ab70d90db97d3489c8fd.

* Fix flaky test

* Updating package-lock

* Rollback tests changes

* Changing red color in admin to match wp-admin

* Remove unused default logo variable

* Using npm caching on GitHub Actions

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Clarifying success message

* Updating built files

* Fixing syntax error

* Remove unused return_personalized_json function

* Hide admin warning on network admin

* Fix typo

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Adding unit tests

* Fix linting issues

* Simplifying set_options on test

* Separating function for testing

* Update @covers annotation

* Simplifying logic

* Fix rendering errors with multiple widgets

* Fixing linting issues

* Fixing issue with sanitization

* Cleaning up logic

* Updating tests to be more reliable

* Separating subtests

* Tests: Improve get current URL tests

The focus of these tests is on the parsing issues related to the domain, port, and potential path, and this is represented in the data provider.

However, it's good to be able to confirm that going to the homepage, random URL and a post via it's ID, also work well for each of the combinations in the first parts of the URL.

* Adding 3.0 upgrade notice on README

* Encoding boolean values

* Fix linting issues

* Fix linting issues

* Small typo

* Fix linting issues

* Fix linting issues

* Split out plugin actions links logic

Moves the logic that adds the plugin action link to its own class.

Adds integration tests.

See #96.

* Tests: e2e for verifying the plugin action link

See #401.

* API Key: Add utility method for checking it is set

Also add utility method for checking if it is missing.

Includes unit tests.

Closes #395.

* API key: add utility method to retrieve key

Adds unit test.

* Testcase: Allow getMethod() to use different class

The existing method made the assumption that only non-public methods in the `Parsely` class would need to be made available for testing with Reflection.

This updates the method to allow methods in other classes to be reflected as well.

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Apply suggestions from code review

Clarify variable name.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Adapting code to new project layout

* Using utility function to check for API keys

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Add admin warning for minimum requirements in 3.0 (#408)

* Adding admin upgrade warning

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Feature/improve test environment (#411)

* Tests: make future-compatible

- Use the snake_case fixture names
- Use wp-test-utils 1.0.0, and remove explicit PHPUnit constraints
- Refresh phpunit config file, including switching to TestDox output format

* CI: Use WP trunk with new test improvements

* CI: No need for pcov-clobber with PHPUnit 8.5

Also, don't ignore platform requirements for PHP 8, as we no longer need to force install PHPUnit 7.5 onto it.

* Bootstrap: Remove PHP_Token references

* Add coverage report back in

Not used yet, but without it, seems like no coverage check is actually done.

* CI: Add support for PHP 8.1 (allowed failures)

Also ensure `convertDeprecationsToExceptions` is true to better highlight PHP 8.1 native deprecation notices.

* Tests: split into unit and integration tests

See #179.

* Bootstrap: Move global code into a function

With all global code (other than some class file requires) in a function that is hooked in when WordPress runs, we can remove the `die`, which allows this file, with the defined constants and functions, to be included for unit tests.

* CI: Support running unit tests

* CI: Run unit tests on PHP 8 as well

* Tests: Define constants from plugin root file

* Tests: Fix CS

* Tests: Fix namespace

* Replace constants

* Various fixes

- Improve handling of no options being set.
- Fix CS
- Fix coverage annotations
- Fix wrong TestCase reference.

* Composer: Improve coverage scripts

Now with verbosity, which is useful in PHPUnit 9.5 to see why a test is classed as risky.

* CI: Add PHP 8.2

* CI: Fix indentation

* CI: Run coverage for integration tests

* CI: Always run coverage on multisite installs

* Re-fix Settings link on plugins page

* Tests: Re-add PluginActions test

Somehow got dropped from my branch when I rebased on to `develop`.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Split out row action link logic (#406)

* Bumping version numbers

* Add changelog

* Update CHANGELOG.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Moving deprecated notes from changelog

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>

* Bumping version number

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>

* Increase minimum PHP and WP versions

See #390.

* CI: Specify coverage: none where it is not needed

See #418.

* Declare strict_types=1

On it's own this doesn't do much, but when more type definitions are added, particularly scalar types, then PHP will handle the types without juggling them.

For choice of positioning below the file-level DocBlock, see https://www.php-fig.org/psr/psr-12/.
For lack of spaces inside the parentheses and around the `=`, see https://make.wordpress.org/core/2020/03/20/updating-the-coding-standards-for-modern-php/

See #389.

* Fix PHP 8+ TypeError for getting current URL

> TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, bool given

This originates when no `$post_id` is passed to the `get_current_url()` method, and no Post ID can be determined from the global `$post`.

As `get_permalink()` can return `false`, then casting it to a string means it will have a value of an empty string.

* Docs: Add contributor note about strong typing

* Remove post_has_viewable_type (#417)

* Using PHP 7 null coalescing operator (#421)

* Using PHP 7 null coalescing operator

* Fixing linter

* Revert "Add admin warning for minimum requirements in 3.0 (#408)" (#424)

* Revert "Add admin warning for minimum requirements in 3.0 (#408)"

This reverts commit 79742d5b39470fb9dd4267eacdf34b41fb2ff8b9.

* Fix identation

* Add return type declarations (#429)

* Add return types for Parsely class

* Add return types to test methods

* Add return types to remaining files

* Nested dirname calls can be replaced

Second argument supported since PHP 7.0.

* Declare visibility for class-level constants

Makes them all explicitly `public`, but some of these could be made less visible.

See #428.

* Convert documented param type to short form

* Fix discrepancy of class name and its use

* Replace full qualified name with an import

* Inline one-time use variables

* Add return type declarations

* Remove incorrect return type declaration

* Fix typos and unnecessary abbreviations

* Remove unnecessary regular expression escaping

* Regexp: Use character class

More performant than single character alternation.

* Use const syntax instead of define()

* Fix CS alignments

* Tests: Stop using deprecated setMethods method (#427)

* Tests: Stop using deprecated setMethods method

Use `onlyMethods()` instead, which ensures that the method that is being mocked does exist in the class being mocked.

* Tests: use onlyMethods() only if it exists

* Displaying Open on Parse.ly links by default (#433)

* Displaying Open on Parse.ly links by default

* Empty

* Remove deprecated filter after_set_parsely_page (#436)

* Remove deprecated filter after_set_parsely_page

* Updating tests

* Remove deprecated filter parsely_filter_insert_javascript (#437)

* Remove deprecated filter parsely_filter_insert_javascript

* Removing deprecated test

* Fixing some code smells (#435)

* Fixing code smells

* Removing duplicate

* Fix linting issues

* Adding E2E test to check for available recommended widget (#434)

* Adding E2E test to check for available recommended widget

* Adding utils

* Documenting utils and separating logical behavior

* Adding missing await

* Extracting more logic into constants

* Fix not working readme code sample (#439)

* Update defaults in `get_bottom_level_term` to empty array to prevent warnings downstream (#438)

* Update class-parsely.php

Change default from null to empty array to prevent warnings thrown by array_diff on line 1650

* Update src/class-parsely.php

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Removing old init script (#441)

* Add wp_parsely_should_insert_metadata filter (#440)

* Add wp_parsely_should_insert_metadata filter

* Revert return change

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding uninstall script (#444)

* Adding uninstall script

* Addressing linting issues

* Bump @wordpress/e2e-test-utils from 5.4.3 to 5.4.4 (#449)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.3 to 5.4.4.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.4/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/scripts from 18.0.1 to 18.1.0 (#450)

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 18.0.1 to 18.1.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@18.1.0/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Constant return type on insert_parsely_page (#443)

* Constant return type on insert_parsely_page

* Adding deprecation warning for method

* Fix linting issues

* Fixing backwards compat return

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Fixing return types of update_metadata_endpoint (#446)

* Fixing return types of update_metadata_endpoint

* Fix identation

* Change get_current_url default type to non-post (#447)

* Change to non-post default

* Fix linting issues

* Adding docstring to document parameter change

* Create codeql-analysis.yml (#453)

See https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning

* Add namespaces to files (#430)

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Bring develop up to date with 2.6.1 (#454)

* Release 2.6.0 (#414)

* Hide the recommendation widget until the element is populated

* Update hidden classname per feedback

* Add conditional for cpt archives

Change to get queried object instead of category.

* Change conditional to is_archive

`is_archive()` is better in this case because it also targets taxonomy archives as well as custom post type archives.

* Add unit tests for CPT archive metadata

* Add unit test for CPT term archive

* Beautify code

* Remove custom post type to simplify test

It doesn’t change the functionality to have a custom post type or not, so to simplify we’ll remove that from the test.

* Change cpt-tax-archive to cpt-archive

* Fix code comments

* Clarify the name of the custom taxonomy

* Update check for cpt and taxonomy archives

* Change test name

* functioning e2e framework

* hello world test

* package-lock (+@wordpress/e2e-test-utils)

* hook tests into CI

* limit to a single job

* Update npm to latest

* cache npm in setup-node

* switch to lts syntax for node-version

* some progress using docker compose

* more progress -- it's working!

* docker-compose vs docker compose

* trying to wait for wp

* working loop i hope

* bg docker-compose correctly

* tweak name & rm unused var

* rm the strategy and just code in node lts

* try npm ci

* README for e2e tests

* fixup watch runner name

* add option to reset wp db to init script

* update readme

* update e2e readme

* incraese timeout so tests pass in interactive mode

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* fixup watch script ws

* add details to the 'Run the tests' section

* Add step to node test to confirm the build is up-to-date

* demonstrate failure case when untracked file is present

* demonstrate failure case when change to src is not present in build

* remove failure -- this should pass

* Bump prettier from 2.3.2 to 2.4.1

Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.4.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Renaming alpha

* Bump @wordpress/scripts from 17.1.0 to 18.0.1

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 17.1.0 to 18.0.1.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@18.0.1/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Simplifying get_options function

* Tests: Improve the get_current_url data provider

Data providers actually provide an iterator rather than just an array, so we can build up the data using `yield` instead.

As per https://peakd.com/hive-168588/@crell/fun-with-phpunit-data-providers this has several advantages:

1. It's easier to read, making it better for future you to understand the code.
1. It's less indented, which gives you more room for longer lines for each value.
1. Because each test set is syntactically independent, it's easier to add new ones, reorder them, or temporarily comment out a single test set.
1. If a given test set needs more setup than just a static list, it's simple to put that setup before the `yield` statement for which it is relevant.

As per the follow-up article https://peakd.com/hive-168588/@crell/advanced-phpunit-shenanigans, I've also included a `@testdox` line on the test method. When this contains the method parameters, it completely overrides the sentence when the `--testdox` flag is called when running PHPUnit.

* Tests: Rename final *-test.php file to *Test.php

PSR-4 naming is needed for PHPUnit 9.1 support.

Fixes #379.

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Updating package-lock

* Removing ampersand

* Revert "Removing ampersand"

This reverts commit 228c2b72b6748c17c8f5d4fbed296bc159a768d7.

* Remove jQuery from recommended widget

* Using built code

* Forcing reset of e2e

* Change trigger

* Revert "Change trigger"

This reverts commit f61c2a3c36b6634706d0ab70d90db97d3489c8fd.

* Fix flaky test

* Updating package-lock

* Rollback tests changes

* Changing red color in admin to match wp-admin

* Remove unused default logo variable

* Using npm caching on GitHub Actions

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Clarifying success message

* Updating built files

* Fixing syntax error

* Remove unused return_personalized_json function

* Hide admin warning on network admin

* Fix typo

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Adding unit tests

* Fix linting issues

* Simplifying set_options on test

* Separating function for testing

* Update @covers annotation

* Simplifying logic

* Fix rendering errors with multiple widgets

* Fixing linting issues

* Fixing issue with sanitization

* Cleaning up logic

* Updating tests to be more reliable

* Separating subtests

* Tests: Improve get current URL tests

The focus of these tests is on the parsing issues related to the domain, port, and potential path, and this is represented in the data provider.

However, it's good to be able to confirm that going to the homepage, random URL and a post via it's ID, also work well for each of the combinations in the first parts of the URL.

* Adding 3.0 upgrade notice on README

* Encoding boolean values

* Fix linting issues

* Fix linting issues

* Small typo

* Fix linting issues

* Fix linting issues

* Split out plugin actions links logic

Moves the logic that adds the plugin action link to its own class.

Adds integration tests.

See #96.

* Tests: e2e for verifying the plugin action link

See #401.

* API Key: Add utility method for checking it is set

Also add utility method for checking if it is missing.

Includes unit tests.

Closes #395.

* API key: add utility method to retrieve key

Adds unit test.

* Testcase: Allow getMethod() to use different class

The existing method made the assumption that only non-public methods in the `Parsely` class would need to be made available for testing with Reflection.

This updates the method to allow methods in other classes to be reflected as well.

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Apply suggestions from code review

Clarify variable name.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Adapting code to new project layout

* Using utility function to check for API keys

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Add admin warning for minimum requirements in 3.0 (#408)

* Adding admin upgrade warning

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Feature/improve test environment (#411)

* Tests: make future-compatible

- Use the snake_case fixture names
- Use wp-test-utils 1.0.0, and remove explicit PHPUnit constraints
- Refresh phpunit config file, including switching to TestDox output format

* CI: Use WP trunk with new test improvements

* CI: No need for pcov-clobber with PHPUnit 8.5

Also, don't ignore platform requirements for PHP 8, as we no longer need to force install PHPUnit 7.5 onto it.

* Bootstrap: Remove PHP_Token references

* Add coverage report back in

Not used yet, but without it, seems like no coverage check is actually done.

* CI: Add support for PHP 8.1 (allowed failures)

Also ensure `convertDeprecationsToExceptions` is true to better highlight PHP 8.1 native deprecation notices.

* Tests: split into unit and integration tests

See #179.

* Bootstrap: Move global code into a function

With all global code (other than some class file requires) in a function that is hooked in when WordPress runs, we can remove the `die`, which allows this file, with the defined constants and functions, to be included for unit tests.

* CI: Support running unit tests

* CI: Run unit tests on PHP 8 as well

* Tests: Define constants from plugin root file

* Tests: Fix CS

* Tests: Fix namespace

* Replace constants

* Various fixes

- Improve handling of no options being set.
- Fix CS
- Fix coverage annotations
- Fix wrong TestCase reference.

* Composer: Improve coverage scripts

Now with verbosity, which is useful in PHPUnit 9.5 to see why a test is classed as risky.

* CI: Add PHP 8.2

* CI: Fix indentation

* CI: Run coverage for integration tests

* CI: Always run coverage on multisite installs

* Re-fix Settings link on plugins page

* Tests: Re-add PluginActions test

Somehow got dropped from my branch when I rebased on to `develop`.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Split out row action link logic (#406)

* Bumping version numbers

* Add changelog

* Update CHANGELOG.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Moving deprecated notes from changelog

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>

* Fix recommended widget not following configuration (#451)

* Fix recommended widget not following configuration

* Remove unwanted console log

* Release 2.6.1 (#452)

* Preparing for 2.6.1 release

* Update CHANGELOG.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Reverting test changes

* Reverting more changes

* Updating asset

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>

* Removing empty functions (#456)

* Enqueue scripts with theme independent hook (#458)

* Move Parse.ly settings to views folder (#459)

* Move Parse.ly settings to views folder

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Removing Parse.ly load text domain (#457)

* i18n: Fix JS string translation

* Adding argument types to functions (#455)

* Adding argument types to functions

* Making tests pass

* Fix linting issues

* Adding types to tests

* Fix type issues

* Addressing PR feedback

* Addressing tests

* Updating more tests

* Fixing final test

* Removing additional comment lines

* Revert OtherTest

* Revert "Revert OtherTest"

This reverts commit 5b8607a010c23e98a8e15676cf82a6724412dd9c.

* Reverting test changes and adding more defensive code on authors

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding translation support for Yes and No fields (#463)

* Adding translation support for Yes and No fields

* Fix linting issues

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding labels to admin settings form (#464)

* Adding labels to admin settings form

* Fixing identation

* Bump @wordpress/e2e-test-utils from 5.4.4 to 5.4.5 (#466)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.4 to 5.4.5.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.5/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/scripts from 18.1.0 to 19.0.0 (#465)

* Bump @wordpress/scripts from 18.1.0 to 19.0.0

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 18.1.0 to 19.0.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@19.0.0/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Updating built files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pau@outlook.com>

* Removing code coverage annotations (#469)

* Removing upgrade README notice (#470)

* Extract settings page from Parsely class (#467)

* Moving settings page out of class-parsely

* Move print dynamic tracking note

* Fixing hooks

* Fix automated linting issues

* Fix manual linting issues

* Updating hook to _admin_menu

* Fix type errors (#474)

* Fix type error get_api_url

* Fixing various type errors

* Fix linting issues

* Adding namespace to Recommended Widget (#475)

* Fix type error get_api_url

* Fixing various type errors

* Fix linting issues

* Adding missing namespaces

* Namespacing recommended widget

* Using proper namespace on tests

* Adding filter to display Cloudflare links (#473)

* Adding filter to display CloudFlare links

* Adding test for filter

* Updating failing test

* Fix multisite test

* Updating readme

* Update README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Updating filter docs

* Removing redundant test assertions

* Changing name of the filter

* Update README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Avoid making duplicate calls on Recommended Widget (#460)

* Avoid making duplicate calls on Recommended Widget

* Refactoring constructUrl

* Fixing parsing issues of updated values

* Adding e2e tests

* Adding type fixes

* Improving type fixes

* Revert optional post

* Extract admin warning from class-parsely (#468)

* Moving settings page out of class-parsely

* Move print dynamic tracking note

* Fixing hooks

* Fix automated linting issues

* Fix manual linting issues

* Extracting admin warning

* Updating hook to _admin_menu

* Moving admin warning tests

* Fix get method

* e2e tests: fix watch command (#476)

* e2e tests: fix watch command

Previously it would error as `test-e2e` command didn't exist.

* Update package.json

* Adding e2e interactive command

* Fix padding

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pau@outlook.com>

* Adding namespace to root class (#477)

* Starting namespace add

* Adding namespace to root class

* Working on tests

* Working on UI tests

* Address StructuredData tests

* Explicit WP_User import

* Fix linting issues

* Using fully qualified names on docstrings in StructuredData tests

* Correcting more docstrings

* Fixing warnings on UI tests

* Fix get_options

* Removing warnings on AdminWarningTest

* Fix FBIA tests

* Fix Integrations Test

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Bump @wordpress/scripts from 19.0.0 to 19.1.0 (#480)

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 19.0.0 to 19.1.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/@wordpress/scripts@19.1.0/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@19.1.0/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/e2e-test-utils from 5.4.5 to 5.4.6 (#479)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.5 to 5.4.6.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/@wordpress/e2e-test-utils@5.4.6/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.6/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Bump @wordpress/e2e-test-utils from 5.4.6 to 5.4.7 (#488)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.6 to 5.4.7.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.7/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Use checkboxes for multiple selects in settings page (#482)

* Moving settings page out of class-parsely

* Move print dynamic tracking note

* Fixing hooks

* Fix automated linting issues

* Fix manual linting issues

* Updating hook to _admin_menu

* Working on settings select

* Formatting data correctly

* Rollback new line

* Reverting label change

* Fix automated linting issues

* Fix linting issues

* Simplifying select

* Removing references to multiple argument

* Displaying public taxonomies only

* Matching id and label of checkbox

* Move tracker logic to separate file (#478)

* Starting namespace add

* Adding namespace to root class

* Working on tests

* Working on UI tests

* Address StructuredData tests

* Explicit WP_User import

* Fix linting issues

* Using fully qualified names on docstrings in StructuredData tests

* Correcting more docstrings

* Fixing warnings on UI tests

* Fix get_options

* Removing warnings on AdminWarningTest

* Fix FBIA tests

* Fix Integrations Test

* Splitting out tracker code

* Adding tracker test

* Adding additional tests

* Keep moving tests

* Moving constant

* Adding WP_Scripts

* Renaming class to scripts

* Fixing scripts naming

* Fix path

* Making sure script enqueue is clean

* Fix linting issues

* Updating comment

* Updating more comments

* Bump @wordpress/eslint-plugin from 9.2.0 to 9.3.0 (#490)

Bumps [@wordpress/eslint-plugin](https://github.com/WordPress/gutenberg/tree/HEAD/packages/eslint-plugin) from 9.2.0 to 9.3.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/eslint-plugin@9.3.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@wordpress/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/e2e-test-utils from 5.4.7 to 5.4.8 (#492)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.7 to 5.4.8.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.8/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/scripts from 19.1.0 to 19.2.1 (#491)

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 19.1.0 to 19.2.1.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@19.2.1/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Renaming functions on Scripts class (#481)

* Starting namespace add

* Adding namespace to root class

* Working on tests

* Working on UI tests

* Address StructuredData tests

* Explicit WP_User import

* Fix linting issues

* Using fully qualified names on docstrings in StructuredData tests

* Correcting more docstrings

* Fixing warnings on UI tests

* Fix get_options

* Removing warnings on AdminWarningTest

* Fix FBIA tests

* Fix Integrations Test

* Splitting out tracker code

* Adding tracker test

* Adding additional tests

* Keep moving tests

* Moving constant

* Adding WP_Scripts

* Fixing small issues with scripts class

* Renaming class to scripts

* Fixing scripts naming

* Fix path

* Renaming functions on tests

* Adding a cannonical way of running the plugin locally (#493)

* Adding a local dev environment

* Adding link to VIP dev-env

* Fix tabs on package.json

* Making class members private (#486)

* Making class members private

* Fix FBIA tests

* Fix Recommended API tests

* Revert AMP changes

* Using reflection in tests

* Test with hardcoded constant

* Fix test

* Update tests/Integration/Integrations/FacebookInstantArticlesTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding changelog for 3.0.0 (#495)

* Adding Changelog for 3.0

* Finishing up changelog

* Remove unnecessary npm step in e2e (#494)

* Shorter timeout for tests

* Not updating npm each time

* Shorter timeout

* Reverting changes on tests

* Removing custom jest

* Optimizing tests

* Removing explicit timeouts

* Only running NodeJS checks with latest version (#499)

* Checking for updates in GitHub Actions (#498)

* Merging trunk to develop. (#505)

Co-authored-by: Volodymyr Kolesnykov <sjinks@users.noreply.github.com>

* Changelog: Add more detail for 3.0 release (#506)

* Changelog: Add more detail for 3.0 release

* Update CHANGELOG.md

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>
Co-authored-by: Michael Chan <michael.chan@automattic.com>
Co-authored-by: Volodymyr Kolesnykov <sjinks@users.noreply.github.com>
pauarge added a commit that referenced this pull request Nov 25, 2021
* Add unit test for CPT term archive

* Beautify code

* Remove custom post type to simplify test

It doesn’t change the functionality to have a custom post type or not, so to simplify we’ll remove that from the test.

* Change cpt-tax-archive to cpt-archive

* Fix code comments

* Clarify the name of the custom taxonomy

* Update check for cpt and taxonomy archives

* Change test name

* functioning e2e framework

* hello world test

* package-lock (+@wordpress/e2e-test-utils)

* hook tests into CI

* limit to a single job

* Update npm to latest

* cache npm in setup-node

* switch to lts syntax for node-version

* some progress using docker compose

* more progress -- it's working!

* docker-compose vs docker compose

* trying to wait for wp

* working loop i hope

* bg docker-compose correctly

* tweak name & rm unused var

* rm the strategy and just code in node lts

* try npm ci

* README for e2e tests

* fixup watch runner name

* add option to reset wp db to init script

* update readme

* update e2e readme

* incraese timeout so tests pass in interactive mode

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* fixup watch script ws

* add details to the 'Run the tests' section

* Add step to node test to confirm the build is up-to-date

* demonstrate failure case when untracked file is present

* demonstrate failure case when change to src is not present in build

* remove failure -- this should pass

* Bump prettier from 2.3.2 to 2.4.1

Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.4.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Renaming alpha

* Bump @wordpress/scripts from 17.1.0 to 18.0.1

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 17.1.0 to 18.0.1.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@18.0.1/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Simplifying get_options function

* Tests: Improve the get_current_url data provider

Data providers actually provide an iterator rather than just an array, so we can build up the data using `yield` instead.

As per https://peakd.com/hive-168588/@crell/fun-with-phpunit-data-providers this has several advantages:

1. It's easier to read, making it better for future you to understand the code.
1. It's less indented, which gives you more room for longer lines for each value.
1. Because each test set is syntactically independent, it's easier to add new ones, reorder them, or temporarily comment out a single test set.
1. If a given test set needs more setup than just a static list, it's simple to put that setup before the `yield` statement for which it is relevant.

As per the follow-up article https://peakd.com/hive-168588/@crell/advanced-phpunit-shenanigans, I've also included a `@testdox` line on the test method. When this contains the method parameters, it completely overrides the sentence when the `--testdox` flag is called when running PHPUnit.

* Tests: Rename final *-test.php file to *Test.php

PSR-4 naming is needed for PHPUnit 9.1 support.

Fixes #379.

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Updating package-lock

* Removing ampersand

* Revert "Removing ampersand"

This reverts commit 228c2b72b6748c17c8f5d4fbed296bc159a768d7.

* Remove jQuery from recommended widget

* Using built code

* Forcing reset of e2e

* Change trigger

* Revert "Change trigger"

This reverts commit f61c2a3c36b6634706d0ab70d90db97d3489c8fd.

* Fix flaky test

* Updating package-lock

* Rollback tests changes

* Changing red color in admin to match wp-admin

* Remove unused default logo variable

* Using npm caching on GitHub Actions

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Clarifying success message

* Updating built files

* Fixing syntax error

* Remove unused return_personalized_json function

* Hide admin warning on network admin

* Fix typo

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Adding unit tests

* Fix linting issues

* Simplifying set_options on test

* Separating function for testing

* Update @covers annotation

* Simplifying logic

* Fix rendering errors with multiple widgets

* Fixing linting issues

* Fixing issue with sanitization

* Cleaning up logic

* Updating tests to be more reliable

* Separating subtests

* Tests: Improve get current URL tests

The focus of these tests is on the parsing issues related to the domain, port, and potential path, and this is represented in the data provider.

However, it's good to be able to confirm that going to the homepage, random URL and a post via it's ID, also work well for each of the combinations in the first parts of the URL.

* Adding 3.0 upgrade notice on README

* Encoding boolean values

* Fix linting issues

* Fix linting issues

* Small typo

* Fix linting issues

* Fix linting issues

* Split out plugin actions links logic

Moves the logic that adds the plugin action link to its own class.

Adds integration tests.

See #96.

* Tests: e2e for verifying the plugin action link

See #401.

* API Key: Add utility method for checking it is set

Also add utility method for checking if it is missing.

Includes unit tests.

Closes #395.

* API key: add utility method to retrieve key

Adds unit test.

* Testcase: Allow getMethod() to use different class

The existing method made the assumption that only non-public methods in the `Parsely` class would need to be made available for testing with Reflection.

This updates the method to allow methods in other classes to be reflected as well.

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Apply suggestions from code review

Clarify variable name.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Adapting code to new project layout

* Using utility function to check for API keys

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Add admin warning for minimum requirements in 3.0 (#408)

* Adding admin upgrade warning

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Feature/improve test environment (#411)

* Tests: make future-compatible

- Use the snake_case fixture names
- Use wp-test-utils 1.0.0, and remove explicit PHPUnit constraints
- Refresh phpunit config file, including switching to TestDox output format

* CI: Use WP trunk with new test improvements

* CI: No need for pcov-clobber with PHPUnit 8.5

Also, don't ignore platform requirements for PHP 8, as we no longer need to force install PHPUnit 7.5 onto it.

* Bootstrap: Remove PHP_Token references

* Add coverage report back in

Not used yet, but without it, seems like no coverage check is actually done.

* CI: Add support for PHP 8.1 (allowed failures)

Also ensure `convertDeprecationsToExceptions` is true to better highlight PHP 8.1 native deprecation notices.

* Tests: split into unit and integration tests

See #179.

* Bootstrap: Move global code into a function

With all global code (other than some class file requires) in a function that is hooked in when WordPress runs, we can remove the `die`, which allows this file, with the defined constants and functions, to be included for unit tests.

* CI: Support running unit tests

* CI: Run unit tests on PHP 8 as well

* Tests: Define constants from plugin root file

* Tests: Fix CS

* Tests: Fix namespace

* Replace constants

* Various fixes

- Improve handling of no options being set.
- Fix CS
- Fix coverage annotations
- Fix wrong TestCase reference.

* Composer: Improve coverage scripts

Now with verbosity, which is useful in PHPUnit 9.5 to see why a test is classed as risky.

* CI: Add PHP 8.2

* CI: Fix indentation

* CI: Run coverage for integration tests

* CI: Always run coverage on multisite installs

* Re-fix Settings link on plugins page

* Tests: Re-add PluginActions test

Somehow got dropped from my branch when I rebased on to `develop`.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Split out row action link logic (#406)

* Bring develop up to date with 2.6.0 (#415)

* Release 2.6.0 (#414)

* Hide the recommendation widget until the element is populated

* Update hidden classname per feedback

* Add conditional for cpt archives

Change to get queried object instead of category.

* Change conditional to is_archive

`is_archive()` is better in this case because it also targets taxonomy archives as well as custom post type archives.

* Add unit tests for CPT archive metadata

* Add unit test for CPT term archive

* Beautify code

* Remove custom post type to simplify test

It doesn’t change the functionality to have a custom post type or not, so to simplify we’ll remove that from the test.

* Change cpt-tax-archive to cpt-archive

* Fix code comments

* Clarify the name of the custom taxonomy

* Update check for cpt and taxonomy archives

* Change test name

* functioning e2e framework

* hello world test

* package-lock (+@wordpress/e2e-test-utils)

* hook tests into CI

* limit to a single job

* Update npm to latest

* cache npm in setup-node

* switch to lts syntax for node-version

* some progress using docker compose

* more progress -- it's working!

* docker-compose vs docker compose

* trying to wait for wp

* working loop i hope

* bg docker-compose correctly

* tweak name & rm unused var

* rm the strategy and just code in node lts

* try npm ci

* README for e2e tests

* fixup watch runner name

* add option to reset wp db to init script

* update readme

* update e2e readme

* incraese timeout so tests pass in interactive mode

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* fixup watch script ws

* add details to the 'Run the tests' section

* Add step to node test to confirm the build is up-to-date

* demonstrate failure case when untracked file is present

* demonstrate failure case when change to src is not present in build

* remove failure -- this should pass

* Bump prettier from 2.3.2 to 2.4.1

Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.4.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Renaming alpha

* Bump @wordpress/scripts from 17.1.0 to 18.0.1

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 17.1.0 to 18.0.1.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@18.0.1/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Simplifying get_options function

* Tests: Improve the get_current_url data provider

Data providers actually provide an iterator rather than just an array, so we can build up the data using `yield` instead.

As per https://peakd.com/hive-168588/@crell/fun-with-phpunit-data-providers this has several advantages:

1. It's easier to read, making it better for future you to understand the code.
1. It's less indented, which gives you more room for longer lines for each value.
1. Because each test set is syntactically independent, it's easier to add new ones, reorder them, or temporarily comment out a single test set.
1. If a given test set needs more setup than just a static list, it's simple to put that setup before the `yield` statement for which it is relevant.

As per the follow-up article https://peakd.com/hive-168588/@crell/advanced-phpunit-shenanigans, I've also included a `@testdox` line on the test method. When this contains the method parameters, it completely overrides the sentence when the `--testdox` flag is called when running PHPUnit.

* Tests: Rename final *-test.php file to *Test.php

PSR-4 naming is needed for PHPUnit 9.1 support.

Fixes #379.

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Updating package-lock

* Removing ampersand

* Revert "Removing ampersand"

This reverts commit 228c2b72b6748c17c8f5d4fbed296bc159a768d7.

* Remove jQuery from recommended widget

* Using built code

* Forcing reset of e2e

* Change trigger

* Revert "Change trigger"

This reverts commit f61c2a3c36b6634706d0ab70d90db97d3489c8fd.

* Fix flaky test

* Updating package-lock

* Rollback tests changes

* Changing red color in admin to match wp-admin

* Remove unused default logo variable

* Using npm caching on GitHub Actions

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Clarifying success message

* Updating built files

* Fixing syntax error

* Remove unused return_personalized_json function

* Hide admin warning on network admin

* Fix typo

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Adding unit tests

* Fix linting issues

* Simplifying set_options on test

* Separating function for testing

* Update @covers annotation

* Simplifying logic

* Fix rendering errors with multiple widgets

* Fixing linting issues

* Fixing issue with sanitization

* Cleaning up logic

* Updating tests to be more reliable

* Separating subtests

* Tests: Improve get current URL tests

The focus of these tests is on the parsing issues related to the domain, port, and potential path, and this is represented in the data provider.

However, it's good to be able to confirm that going to the homepage, random URL and a post via it's ID, also work well for each of the combinations in the first parts of the URL.

* Adding 3.0 upgrade notice on README

* Encoding boolean values

* Fix linting issues

* Fix linting issues

* Small typo

* Fix linting issues

* Fix linting issues

* Split out plugin actions links logic

Moves the logic that adds the plugin action link to its own class.

Adds integration tests.

See #96.

* Tests: e2e for verifying the plugin action link

See #401.

* API Key: Add utility method for checking it is set

Also add utility method for checking if it is missing.

Includes unit tests.

Closes #395.

* API key: add utility method to retrieve key

Adds unit test.

* Testcase: Allow getMethod() to use different class

The existing method made the assumption that only non-public methods in the `Parsely` class would need to be made available for testing with Reflection.

This updates the method to allow methods in other classes to be reflected as well.

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Apply suggestions from code review

Clarify variable name.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Adapting code to new project layout

* Using utility function to check for API keys

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Add admin warning for minimum requirements in 3.0 (#408)

* Adding admin upgrade warning

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Feature/improve test environment (#411)

* Tests: make future-compatible

- Use the snake_case fixture names
- Use wp-test-utils 1.0.0, and remove explicit PHPUnit constraints
- Refresh phpunit config file, including switching to TestDox output format

* CI: Use WP trunk with new test improvements

* CI: No need for pcov-clobber with PHPUnit 8.5

Also, don't ignore platform requirements for PHP 8, as we no longer need to force install PHPUnit 7.5 onto it.

* Bootstrap: Remove PHP_Token references

* Add coverage report back in

Not used yet, but without it, seems like no coverage check is actually done.

* CI: Add support for PHP 8.1 (allowed failures)

Also ensure `convertDeprecationsToExceptions` is true to better highlight PHP 8.1 native deprecation notices.

* Tests: split into unit and integration tests

See #179.

* Bootstrap: Move global code into a function

With all global code (other than some class file requires) in a function that is hooked in when WordPress runs, we can remove the `die`, which allows this file, with the defined constants and functions, to be included for unit tests.

* CI: Support running unit tests

* CI: Run unit tests on PHP 8 as well

* Tests: Define constants from plugin root file

* Tests: Fix CS

* Tests: Fix namespace

* Replace constants

* Various fixes

- Improve handling of no options being set.
- Fix CS
- Fix coverage annotations
- Fix wrong TestCase reference.

* Composer: Improve coverage scripts

Now with verbosity, which is useful in PHPUnit 9.5 to see why a test is classed as risky.

* CI: Add PHP 8.2

* CI: Fix indentation

* CI: Run coverage for integration tests

* CI: Always run coverage on multisite installs

* Re-fix Settings link on plugins page

* Tests: Re-add PluginActions test

Somehow got dropped from my branch when I rebased on to `develop`.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Split out row action link logic (#406)

* Bumping version numbers

* Add changelog

* Update CHANGELOG.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Moving deprecated notes from changelog

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>

* Bumping version number

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>

* Increase minimum PHP and WP versions

See #390.

* CI: Specify coverage: none where it is not needed

See #418.

* Declare strict_types=1

On it's own this doesn't do much, but when more type definitions are added, particularly scalar types, then PHP will handle the types without juggling them.

For choice of positioning below the file-level DocBlock, see https://www.php-fig.org/psr/psr-12/.
For lack of spaces inside the parentheses and around the `=`, see https://make.wordpress.org/core/2020/03/20/updating-the-coding-standards-for-modern-php/

See #389.

* Fix PHP 8+ TypeError for getting current URL

> TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, bool given

This originates when no `$post_id` is passed to the `get_current_url()` method, and no Post ID can be determined from the global `$post`.

As `get_permalink()` can return `false`, then casting it to a string means it will have a value of an empty string.

* Docs: Add contributor note about strong typing

* Remove post_has_viewable_type (#417)

* Using PHP 7 null coalescing operator (#421)

* Using PHP 7 null coalescing operator

* Fixing linter

* Revert "Add admin warning for minimum requirements in 3.0 (#408)" (#424)

* Revert "Add admin warning for minimum requirements in 3.0 (#408)"

This reverts commit 79742d5b39470fb9dd4267eacdf34b41fb2ff8b9.

* Fix identation

* Add return type declarations (#429)

* Add return types for Parsely class

* Add return types to test methods

* Add return types to remaining files

* Nested dirname calls can be replaced

Second argument supported since PHP 7.0.

* Declare visibility for class-level constants

Makes them all explicitly `public`, but some of these could be made less visible.

See #428.

* Convert documented param type to short form

* Fix discrepancy of class name and its use

* Replace full qualified name with an import

* Inline one-time use variables

* Add return type declarations

* Remove incorrect return type declaration

* Fix typos and unnecessary abbreviations

* Remove unnecessary regular expression escaping

* Regexp: Use character class

More performant than single character alternation.

* Use const syntax instead of define()

* Fix CS alignments

* Tests: Stop using deprecated setMethods method (#427)

* Tests: Stop using deprecated setMethods method

Use `onlyMethods()` instead, which ensures that the method that is being mocked does exist in the class being mocked.

* Tests: use onlyMethods() only if it exists

* Displaying Open on Parse.ly links by default (#433)

* Displaying Open on Parse.ly links by default

* Empty

* Remove deprecated filter after_set_parsely_page (#436)

* Remove deprecated filter after_set_parsely_page

* Updating tests

* Remove deprecated filter parsely_filter_insert_javascript (#437)

* Remove deprecated filter parsely_filter_insert_javascript

* Removing deprecated test

* Fixing some code smells (#435)

* Fixing code smells

* Removing duplicate

* Fix linting issues

* Adding E2E test to check for available recommended widget (#434)

* Adding E2E test to check for available recommended widget

* Adding utils

* Documenting utils and separating logical behavior

* Adding missing await

* Extracting more logic into constants

* Fix not working readme code sample (#439)

* Update defaults in `get_bottom_level_term` to empty array to prevent warnings downstream (#438)

* Update class-parsely.php

Change default from null to empty array to prevent warnings thrown by array_diff on line 1650

* Update src/class-parsely.php

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Removing old init script (#441)

* Add wp_parsely_should_insert_metadata filter (#440)

* Add wp_parsely_should_insert_metadata filter

* Revert return change

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding uninstall script (#444)

* Adding uninstall script

* Addressing linting issues

* Bump @wordpress/e2e-test-utils from 5.4.3 to 5.4.4 (#449)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.3 to 5.4.4.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.4/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/scripts from 18.0.1 to 18.1.0 (#450)

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 18.0.1 to 18.1.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@18.1.0/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Constant return type on insert_parsely_page (#443)

* Constant return type on insert_parsely_page

* Adding deprecation warning for method

* Fix linting issues

* Fixing backwards compat return

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Fixing return types of update_metadata_endpoint (#446)

* Fixing return types of update_metadata_endpoint

* Fix identation

* Change get_current_url default type to non-post (#447)

* Change to non-post default

* Fix linting issues

* Adding docstring to document parameter change

* Create codeql-analysis.yml (#453)

See https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning

* Add namespaces to files (#430)

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Bring develop up to date with 2.6.1 (#454)

* Release 2.6.0 (#414)

* Hide the recommendation widget until the element is populated

* Update hidden classname per feedback

* Add conditional for cpt archives

Change to get queried object instead of category.

* Change conditional to is_archive

`is_archive()` is better in this case because it also targets taxonomy archives as well as custom post type archives.

* Add unit tests for CPT archive metadata

* Add unit test for CPT term archive

* Beautify code

* Remove custom post type to simplify test

It doesn’t change the functionality to have a custom post type or not, so to simplify we’ll remove that from the test.

* Change cpt-tax-archive to cpt-archive

* Fix code comments

* Clarify the name of the custom taxonomy

* Update check for cpt and taxonomy archives

* Change test name

* functioning e2e framework

* hello world test

* package-lock (+@wordpress/e2e-test-utils)

* hook tests into CI

* limit to a single job

* Update npm to latest

* cache npm in setup-node

* switch to lts syntax for node-version

* some progress using docker compose

* more progress -- it's working!

* docker-compose vs docker compose

* trying to wait for wp

* working loop i hope

* bg docker-compose correctly

* tweak name & rm unused var

* rm the strategy and just code in node lts

* try npm ci

* README for e2e tests

* fixup watch runner name

* add option to reset wp db to init script

* update readme

* update e2e readme

* incraese timeout so tests pass in interactive mode

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* fixup watch script ws

* add details to the 'Run the tests' section

* Add step to node test to confirm the build is up-to-date

* demonstrate failure case when untracked file is present

* demonstrate failure case when change to src is not present in build

* remove failure -- this should pass

* Bump prettier from 2.3.2 to 2.4.1

Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.4.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Renaming alpha

* Bump @wordpress/scripts from 17.1.0 to 18.0.1

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 17.1.0 to 18.0.1.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@18.0.1/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Simplifying get_options function

* Tests: Improve the get_current_url data provider

Data providers actually provide an iterator rather than just an array, so we can build up the data using `yield` instead.

As per https://peakd.com/hive-168588/@crell/fun-with-phpunit-data-providers this has several advantages:

1. It's easier to read, making it better for future you to understand the code.
1. It's less indented, which gives you more room for longer lines for each value.
1. Because each test set is syntactically independent, it's easier to add new ones, reorder them, or temporarily comment out a single test set.
1. If a given test set needs more setup than just a static list, it's simple to put that setup before the `yield` statement for which it is relevant.

As per the follow-up article https://peakd.com/hive-168588/@crell/advanced-phpunit-shenanigans, I've also included a `@testdox` line on the test method. When this contains the method parameters, it completely overrides the sentence when the `--testdox` flag is called when running PHPUnit.

* Tests: Rename final *-test.php file to *Test.php

PSR-4 naming is needed for PHPUnit 9.1 support.

Fixes #379.

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Updating package-lock

* Removing ampersand

* Revert "Removing ampersand"

This reverts commit 228c2b72b6748c17c8f5d4fbed296bc159a768d7.

* Remove jQuery from recommended widget

* Using built code

* Forcing reset of e2e

* Change trigger

* Revert "Change trigger"

This reverts commit f61c2a3c36b6634706d0ab70d90db97d3489c8fd.

* Fix flaky test

* Updating package-lock

* Rollback tests changes

* Changing red color in admin to match wp-admin

* Remove unused default logo variable

* Using npm caching on GitHub Actions

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Clarifying success message

* Updating built files

* Fixing syntax error

* Remove unused return_personalized_json function

* Hide admin warning on network admin

* Fix typo

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Adding unit tests

* Fix linting issues

* Simplifying set_options on test

* Separating function for testing

* Update @covers annotation

* Simplifying logic

* Fix rendering errors with multiple widgets

* Fixing linting issues

* Fixing issue with sanitization

* Cleaning up logic

* Updating tests to be more reliable

* Separating subtests

* Tests: Improve get current URL tests

The focus of these tests is on the parsing issues related to the domain, port, and potential path, and this is represented in the data provider.

However, it's good to be able to confirm that going to the homepage, random URL and a post via it's ID, also work well for each of the combinations in the first parts of the URL.

* Adding 3.0 upgrade notice on README

* Encoding boolean values

* Fix linting issues

* Fix linting issues

* Small typo

* Fix linting issues

* Fix linting issues

* Split out plugin actions links logic

Moves the logic that adds the plugin action link to its own class.

Adds integration tests.

See #96.

* Tests: e2e for verifying the plugin action link

See #401.

* API Key: Add utility method for checking it is set

Also add utility method for checking if it is missing.

Includes unit tests.

Closes #395.

* API key: add utility method to retrieve key

Adds unit test.

* Testcase: Allow getMethod() to use different class

The existing method made the assumption that only non-public methods in the `Parsely` class would need to be made available for testing with Reflection.

This updates the method to allow methods in other classes to be reflected as well.

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Apply suggestions from code review

Clarify variable name.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Adapting code to new project layout

* Using utility function to check for API keys

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Add admin warning for minimum requirements in 3.0 (#408)

* Adding admin upgrade warning

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Feature/improve test environment (#411)

* Tests: make future-compatible

- Use the snake_case fixture names
- Use wp-test-utils 1.0.0, and remove explicit PHPUnit constraints
- Refresh phpunit config file, including switching to TestDox output format

* CI: Use WP trunk with new test improvements

* CI: No need for pcov-clobber with PHPUnit 8.5

Also, don't ignore platform requirements for PHP 8, as we no longer need to force install PHPUnit 7.5 onto it.

* Bootstrap: Remove PHP_Token references

* Add coverage report back in

Not used yet, but without it, seems like no coverage check is actually done.

* CI: Add support for PHP 8.1 (allowed failures)

Also ensure `convertDeprecationsToExceptions` is true to better highlight PHP 8.1 native deprecation notices.

* Tests: split into unit and integration tests

See #179.

* Bootstrap: Move global code into a function

With all global code (other than some class file requires) in a function that is hooked in when WordPress runs, we can remove the `die`, which allows this file, with the defined constants and functions, to be included for unit tests.

* CI: Support running unit tests

* CI: Run unit tests on PHP 8 as well

* Tests: Define constants from plugin root file

* Tests: Fix CS

* Tests: Fix namespace

* Replace constants

* Various fixes

- Improve handling of no options being set.
- Fix CS
- Fix coverage annotations
- Fix wrong TestCase reference.

* Composer: Improve coverage scripts

Now with verbosity, which is useful in PHPUnit 9.5 to see why a test is classed as risky.

* CI: Add PHP 8.2

* CI: Fix indentation

* CI: Run coverage for integration tests

* CI: Always run coverage on multisite installs

* Re-fix Settings link on plugins page

* Tests: Re-add PluginActions test

Somehow got dropped from my branch when I rebased on to `develop`.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Split out row action link logic (#406)

* Bumping version numbers

* Add changelog

* Update CHANGELOG.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Moving deprecated notes from changelog

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>

* Fix recommended widget not following configuration (#451)

* Fix recommended widget not following configuration

* Remove unwanted console log

* Release 2.6.1 (#452)

* Preparing for 2.6.1 release

* Update CHANGELOG.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Reverting test changes

* Reverting more changes

* Updating asset

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>

* Removing empty functions (#456)

* Enqueue scripts with theme independent hook (#458)

* Move Parse.ly settings to views folder (#459)

* Move Parse.ly settings to views folder

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Removing Parse.ly load text domain (#457)

* i18n: Fix JS string translation

* Adding argument types to functions (#455)

* Adding argument types to functions

* Making tests pass

* Fix linting issues

* Adding types to tests

* Fix type issues

* Addressing PR feedback

* Addressing tests

* Updating more tests

* Fixing final test

* Removing additional comment lines

* Revert OtherTest

* Revert "Revert OtherTest"

This reverts commit 5b8607a010c23e98a8e15676cf82a6724412dd9c.

* Reverting test changes and adding more defensive code on authors

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding translation support for Yes and No fields (#463)

* Adding translation support for Yes and No fields

* Fix linting issues

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding labels to admin settings form (#464)

* Adding labels to admin settings form

* Fixing identation

* Bump @wordpress/e2e-test-utils from 5.4.4 to 5.4.5 (#466)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.4 to 5.4.5.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.5/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/scripts from 18.1.0 to 19.0.0 (#465)

* Bump @wordpress/scripts from 18.1.0 to 19.0.0

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 18.1.0 to 19.0.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@19.0.0/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Updating built files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pau@outlook.com>

* Removing code coverage annotations (#469)

* Removing upgrade README notice (#470)

* Extract settings page from Parsely class (#467)

* Moving settings page out of class-parsely

* Move print dynamic tracking note

* Fixing hooks

* Fix automated linting issues

* Fix manual linting issues

* Updating hook to _admin_menu

* Fix type errors (#474)

* Fix type error get_api_url

* Fixing various type errors

* Fix linting issues

* Adding namespace to Recommended Widget (#475)

* Fix type error get_api_url

* Fixing various type errors

* Fix linting issues

* Adding missing namespaces

* Namespacing recommended widget

* Using proper namespace on tests

* Adding filter to display Cloudflare links (#473)

* Adding filter to display CloudFlare links

* Adding test for filter

* Updating failing test

* Fix multisite test

* Updating readme

* Update README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Updating filter docs

* Removing redundant test assertions

* Changing name of the filter

* Update README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Avoid making duplicate calls on Recommended Widget (#460)

* Avoid making duplicate calls on Recommended Widget

* Refactoring constructUrl

* Fixing parsing issues of updated values

* Adding e2e tests

* Adding type fixes

* Improving type fixes

* Revert optional post

* Extract admin warning from class-parsely (#468)

* Moving settings page out of class-parsely

* Move print dynamic tracking note

* Fixing hooks

* Fix automated linting issues

* Fix manual linting issues

* Extracting admin warning

* Updating hook to _admin_menu

* Moving admin warning tests

* Fix get method

* e2e tests: fix watch command (#476)

* e2e tests: fix watch command

Previously it would error as `test-e2e` command didn't exist.

* Update package.json

* Adding e2e interactive command

* Fix padding

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pau@outlook.com>

* Adding namespace to root class (#477)

* Starting namespace add

* Adding namespace to root class

* Working on tests

* Working on UI tests

* Address StructuredData tests

* Explicit WP_User import

* Fix linting issues

* Using fully qualified names on docstrings in StructuredData tests

* Correcting more docstrings

* Fixing warnings on UI tests

* Fix get_options

* Removing warnings on AdminWarningTest

* Fix FBIA tests

* Fix Integrations Test

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Bump @wordpress/scripts from 19.0.0 to 19.1.0 (#480)

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 19.0.0 to 19.1.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/@wordpress/scripts@19.1.0/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@19.1.0/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/e2e-test-utils from 5.4.5 to 5.4.6 (#479)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.5 to 5.4.6.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/@wordpress/e2e-test-utils@5.4.6/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.6/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Bump @wordpress/e2e-test-utils from 5.4.6 to 5.4.7 (#488)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.6 to 5.4.7.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.7/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Use checkboxes for multiple selects in settings page (#482)

* Moving settings page out of class-parsely

* Move print dynamic tracking note

* Fixing hooks

* Fix automated linting issues

* Fix manual linting issues

* Updating hook to _admin_menu

* Working on settings select

* Formatting data correctly

* Rollback new line

* Reverting label change

* Fix automated linting issues

* Fix linting issues

* Simplifying select

* Removing references to multiple argument

* Displaying public taxonomies only

* Matching id and label of checkbox

* Move tracker logic to separate file (#478)

* Starting namespace add

* Adding namespace to root class

* Working on tests

* Working on UI tests

* Address StructuredData tests

* Explicit WP_User import

* Fix linting issues

* Using fully qualified names on docstrings in StructuredData tests

* Correcting more docstrings

* Fixing warnings on UI tests

* Fix get_options

* Removing warnings on AdminWarningTest

* Fix FBIA tests

* Fix Integrations Test

* Splitting out tracker code

* Adding tracker test

* Adding additional tests

* Keep moving tests

* Moving constant

* Adding WP_Scripts

* Renaming class to scripts

* Fixing scripts naming

* Fix path

* Making sure script enqueue is clean

* Fix linting issues

* Updating comment

* Updating more comments

* Bump @wordpress/eslint-plugin from 9.2.0 to 9.3.0 (#490)

Bumps [@wordpress/eslint-plugin](https://github.com/WordPress/gutenberg/tree/HEAD/packages/eslint-plugin) from 9.2.0 to 9.3.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/eslint-plugin@9.3.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@wordpress/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/e2e-test-utils from 5.4.7 to 5.4.8 (#492)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.7 to 5.4.8.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.8/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/scripts from 19.1.0 to 19.2.1 (#491)

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 19.1.0 to 19.2.1.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@19.2.1/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Renaming functions on Scripts class (#481)

* Starting namespace add

* Adding namespace to root class

* Working on tests

* Working on UI tests

* Address StructuredData tests

* Explicit WP_User import

* Fix linting issues

* Using fully qualified names on docstrings in StructuredData tests

* Correcting more docstrings

* Fixing warnings on UI tests

* Fix get_options

* Removing warnings on AdminWarningTest

* Fix FBIA tests

* Fix Integrations Test

* Splitting out tracker code

* Adding tracker test

* Adding additional tests

* Keep moving tests

* Moving constant

* Adding WP_Scripts

* Fixing small issues with scripts class

* Renaming class to scripts

* Fixing scripts naming

* Fix path

* Renaming functions on tests

* Adding a cannonical way of running the plugin locally (#493)

* Adding a local dev environment

* Adding link to VIP dev-env

* Fix tabs on package.json

* Making class members private (#486)

* Making class members private

* Fix FBIA tests

* Fix Recommended API tests

* Revert AMP changes

* Using reflection in tests

* Test with hardcoded constant

* Fix test

* Update tests/Integration/Integrations/FacebookInstantArticlesTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding changelog for 3.0.0 (#495)

* Adding Changelog for 3.0

* Finishing up changelog

* Remove unnecessary npm step in e2e (#494)

* Shorter timeout for tests

* Not updating npm each time

* Shorter timeout

* Reverting changes on tests

* Removing custom jest

* Optimizing tests

* Removing explicit timeouts

* Only running NodeJS checks with latest version (#499)

* Checking for updates in GitHub Actions (#498)

* Merging trunk to develop. (#505)

Co-authored-by: Volodymyr Kolesnykov <sjinks@users.noreply.github.com>

* Changelog: Add more detail for 3.0 release (#506)

* Changelog: Add more detail for 3.0 release

* Update CHANGELOG.md

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Deploy on published release

As per https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#release, the workflow will only fire when we publish a release on GitHub. The `released` type will only fire for stable releases,  and not pre-release releases. 

This allows tagging and release of alpha and beta versions, without it automatically pushing to WPORG SVN which then result in sites pulling those in via plugin auto-updates.

Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pau@outlook.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>
Co-authored-by: Michael Chan <michael.chan@automattic.com>
Co-authored-by: Volodymyr Kolesnykov <sjinks@users.noreply.github.com>
pauarge added a commit that referenced this pull request Jan 21, 2022
* Nested dirname calls can be replaced

Second argument supported since PHP 7.0.

* Declare visibility for class-level constants

Makes them all explicitly `public`, but some of these could be made less visible.

See #428.

* Convert documented param type to short form

* Fix discrepancy of class name and its use

* Replace full qualified name with an import

* Inline one-time use variables

* Add return type declarations

* Remove incorrect return type declaration

* Fix typos and unnecessary abbreviations

* Remove unnecessary regular expression escaping

* Regexp: Use character class

More performant than single character alternation.

* Use const syntax instead of define()

* Fix CS alignments

* Tests: Stop using deprecated setMethods method (#427)

* Tests: Stop using deprecated setMethods method

Use `onlyMethods()` instead, which ensures that the method that is being mocked does exist in the class being mocked.

* Tests: use onlyMethods() only if it exists

* Displaying Open on Parse.ly links by default (#433)

* Displaying Open on Parse.ly links by default

* Empty

* Remove deprecated filter after_set_parsely_page (#436)

* Remove deprecated filter after_set_parsely_page

* Updating tests

* Remove deprecated filter parsely_filter_insert_javascript (#437)

* Remove deprecated filter parsely_filter_insert_javascript

* Removing deprecated test

* Fixing some code smells (#435)

* Fixing code smells

* Removing duplicate

* Fix linting issues

* Adding E2E test to check for available recommended widget (#434)

* Adding E2E test to check for available recommended widget

* Adding utils

* Documenting utils and separating logical behavior

* Adding missing await

* Extracting more logic into constants

* Fix not working readme code sample (#439)

* Update defaults in `get_bottom_level_term` to empty array to prevent warnings downstream (#438)

* Update class-parsely.php

Change default from null to empty array to prevent warnings thrown by array_diff on line 1650

* Update src/class-parsely.php

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Removing old init script (#441)

* Add wp_parsely_should_insert_metadata filter (#440)

* Add wp_parsely_should_insert_metadata filter

* Revert return change

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding uninstall script (#444)

* Adding uninstall script

* Addressing linting issues

* Bump @wordpress/e2e-test-utils from 5.4.3 to 5.4.4 (#449)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.3 to 5.4.4.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.4/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/scripts from 18.0.1 to 18.1.0 (#450)

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 18.0.1 to 18.1.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@18.1.0/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Constant return type on insert_parsely_page (#443)

* Constant return type on insert_parsely_page

* Adding deprecation warning for method

* Fix linting issues

* Fixing backwards compat return

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Fixing return types of update_metadata_endpoint (#446)

* Fixing return types of update_metadata_endpoint

* Fix identation

* Change get_current_url default type to non-post (#447)

* Change to non-post default

* Fix linting issues

* Adding docstring to document parameter change

* Create codeql-analysis.yml (#453)

See https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning

* Add namespaces to files (#430)

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Bring develop up to date with 2.6.1 (#454)

* Release 2.6.0 (#414)

* Hide the recommendation widget until the element is populated

* Update hidden classname per feedback

* Add conditional for cpt archives

Change to get queried object instead of category.

* Change conditional to is_archive

`is_archive()` is better in this case because it also targets taxonomy archives as well as custom post type archives.

* Add unit tests for CPT archive metadata

* Add unit test for CPT term archive

* Beautify code

* Remove custom post type to simplify test

It doesn’t change the functionality to have a custom post type or not, so to simplify we’ll remove that from the test.

* Change cpt-tax-archive to cpt-archive

* Fix code comments

* Clarify the name of the custom taxonomy

* Update check for cpt and taxonomy archives

* Change test name

* functioning e2e framework

* hello world test

* package-lock (+@wordpress/e2e-test-utils)

* hook tests into CI

* limit to a single job

* Update npm to latest

* cache npm in setup-node

* switch to lts syntax for node-version

* some progress using docker compose

* more progress -- it's working!

* docker-compose vs docker compose

* trying to wait for wp

* working loop i hope

* bg docker-compose correctly

* tweak name & rm unused var

* rm the strategy and just code in node lts

* try npm ci

* README for e2e tests

* fixup watch runner name

* add option to reset wp db to init script

* update readme

* update e2e readme

* incraese timeout so tests pass in interactive mode

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* fixup watch script ws

* add details to the 'Run the tests' section

* Add step to node test to confirm the build is up-to-date

* demonstrate failure case when untracked file is present

* demonstrate failure case when change to src is not present in build

* remove failure -- this should pass

* Bump prettier from 2.3.2 to 2.4.1

Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.4.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Renaming alpha

* Bump @wordpress/scripts from 17.1.0 to 18.0.1

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 17.1.0 to 18.0.1.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@18.0.1/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Simplifying get_options function

* Tests: Improve the get_current_url data provider

Data providers actually provide an iterator rather than just an array, so we can build up the data using `yield` instead.

As per https://peakd.com/hive-168588/@crell/fun-with-phpunit-data-providers this has several advantages:

1. It's easier to read, making it better for future you to understand the code.
1. It's less indented, which gives you more room for longer lines for each value.
1. Because each test set is syntactically independent, it's easier to add new ones, reorder them, or temporarily comment out a single test set.
1. If a given test set needs more setup than just a static list, it's simple to put that setup before the `yield` statement for which it is relevant.

As per the follow-up article https://peakd.com/hive-168588/@crell/advanced-phpunit-shenanigans, I've also included a `@testdox` line on the test method. When this contains the method parameters, it completely overrides the sentence when the `--testdox` flag is called when running PHPUnit.

* Tests: Rename final *-test.php file to *Test.php

PSR-4 naming is needed for PHPUnit 9.1 support.

Fixes #379.

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/e2e/README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Updating package-lock

* Removing ampersand

* Revert "Removing ampersand"

This reverts commit 228c2b72b6748c17c8f5d4fbed296bc159a768d7.

* Remove jQuery from recommended widget

* Using built code

* Forcing reset of e2e

* Change trigger

* Revert "Change trigger"

This reverts commit f61c2a3c36b6634706d0ab70d90db97d3489c8fd.

* Fix flaky test

* Updating package-lock

* Rollback tests changes

* Changing red color in admin to match wp-admin

* Remove unused default logo variable

* Using npm caching on GitHub Actions

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Clarifying success message

* Updating built files

* Fixing syntax error

* Remove unused return_personalized_json function

* Hide admin warning on network admin

* Fix typo

* Integrations: Extract into separate classes

- Move AMP and Facebook Instant Article integrations into separate files.
- Improve and add tests that better check for the intended behaviour.

* Adding unit tests

* Fix linting issues

* Simplifying set_options on test

* Separating function for testing

* Update @covers annotation

* Simplifying logic

* Fix rendering errors with multiple widgets

* Fixing linting issues

* Fixing issue with sanitization

* Cleaning up logic

* Updating tests to be more reliable

* Separating subtests

* Tests: Improve get current URL tests

The focus of these tests is on the parsing issues related to the domain, port, and potential path, and this is represented in the data provider.

However, it's good to be able to confirm that going to the homepage, random URL and a post via it's ID, also work well for each of the combinations in the first parts of the URL.

* Adding 3.0 upgrade notice on README

* Encoding boolean values

* Fix linting issues

* Fix linting issues

* Small typo

* Fix linting issues

* Fix linting issues

* Split out plugin actions links logic

Moves the logic that adds the plugin action link to its own class.

Adds integration tests.

See #96.

* Tests: e2e for verifying the plugin action link

See #401.

* API Key: Add utility method for checking it is set

Also add utility method for checking if it is missing.

Includes unit tests.

Closes #395.

* API key: add utility method to retrieve key

Adds unit test.

* Testcase: Allow getMethod() to use different class

The existing method made the assumption that only non-public methods in the `Parsely` class would need to be made available for testing with Reflection.

This updates the method to allow methods in other classes to be reflected as well.

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Apply suggestions from code review

Clarify variable name.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Adapting code to new project layout

* Using utility function to check for API keys

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Add admin warning for minimum requirements in 3.0 (#408)

* Adding admin upgrade warning

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Feature/improve test environment (#411)

* Tests: make future-compatible

- Use the snake_case fixture names
- Use wp-test-utils 1.0.0, and remove explicit PHPUnit constraints
- Refresh phpunit config file, including switching to TestDox output format

* CI: Use WP trunk with new test improvements

* CI: No need for pcov-clobber with PHPUnit 8.5

Also, don't ignore platform requirements for PHP 8, as we no longer need to force install PHPUnit 7.5 onto it.

* Bootstrap: Remove PHP_Token references

* Add coverage report back in

Not used yet, but without it, seems like no coverage check is actually done.

* CI: Add support for PHP 8.1 (allowed failures)

Also ensure `convertDeprecationsToExceptions` is true to better highlight PHP 8.1 native deprecation notices.

* Tests: split into unit and integration tests

See #179.

* Bootstrap: Move global code into a function

With all global code (other than some class file requires) in a function that is hooked in when WordPress runs, we can remove the `die`, which allows this file, with the defined constants and functions, to be included for unit tests.

* CI: Support running unit tests

* CI: Run unit tests on PHP 8 as well

* Tests: Define constants from plugin root file

* Tests: Fix CS

* Tests: Fix namespace

* Replace constants

* Various fixes

- Improve handling of no options being set.
- Fix CS
- Fix coverage annotations
- Fix wrong TestCase reference.

* Composer: Improve coverage scripts

Now with verbosity, which is useful in PHPUnit 9.5 to see why a test is classed as risky.

* CI: Add PHP 8.2

* CI: Fix indentation

* CI: Run coverage for integration tests

* CI: Always run coverage on multisite installs

* Re-fix Settings link on plugins page

* Tests: Re-add PluginActions test

Somehow got dropped from my branch when I rebased on to `develop`.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Split out row action link logic (#406)

* Bumping version numbers

* Add changelog

* Update CHANGELOG.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Moving deprecated notes from changelog

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>

* Fix recommended widget not following configuration (#451)

* Fix recommended widget not following configuration

* Remove unwanted console log

* Release 2.6.1 (#452)

* Preparing for 2.6.1 release

* Update CHANGELOG.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Reverting test changes

* Reverting more changes

* Updating asset

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Jones <gary@gamajo.com>

* Removing empty functions (#456)

* Enqueue scripts with theme independent hook (#458)

* Move Parse.ly settings to views folder (#459)

* Move Parse.ly settings to views folder

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Removing Parse.ly load text domain (#457)

* i18n: Fix JS string translation

* Adding argument types to functions (#455)

* Adding argument types to functions

* Making tests pass

* Fix linting issues

* Adding types to tests

* Fix type issues

* Addressing PR feedback

* Addressing tests

* Updating more tests

* Fixing final test

* Removing additional comment lines

* Revert OtherTest

* Revert "Revert OtherTest"

This reverts commit 5b8607a010c23e98a8e15676cf82a6724412dd9c.

* Reverting test changes and adding more defensive code on authors

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding translation support for Yes and No fields (#463)

* Adding translation support for Yes and No fields

* Fix linting issues

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding labels to admin settings form (#464)

* Adding labels to admin settings form

* Fixing identation

* Bump @wordpress/e2e-test-utils from 5.4.4 to 5.4.5 (#466)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.4 to 5.4.5.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.5/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/scripts from 18.1.0 to 19.0.0 (#465)

* Bump @wordpress/scripts from 18.1.0 to 19.0.0

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 18.1.0 to 19.0.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@19.0.0/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Updating built files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pau@outlook.com>

* Removing code coverage annotations (#469)

* Removing upgrade README notice (#470)

* Extract settings page from Parsely class (#467)

* Moving settings page out of class-parsely

* Move print dynamic tracking note

* Fixing hooks

* Fix automated linting issues

* Fix manual linting issues

* Updating hook to _admin_menu

* Fix type errors (#474)

* Fix type error get_api_url

* Fixing various type errors

* Fix linting issues

* Adding namespace to Recommended Widget (#475)

* Fix type error get_api_url

* Fixing various type errors

* Fix linting issues

* Adding missing namespaces

* Namespacing recommended widget

* Using proper namespace on tests

* Adding filter to display Cloudflare links (#473)

* Adding filter to display CloudFlare links

* Adding test for filter

* Updating failing test

* Fix multisite test

* Updating readme

* Update README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update src/class-parsely.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Updating filter docs

* Removing redundant test assertions

* Changing name of the filter

* Update README.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Avoid making duplicate calls on Recommended Widget (#460)

* Avoid making duplicate calls on Recommended Widget

* Refactoring constructUrl

* Fixing parsing issues of updated values

* Adding e2e tests

* Adding type fixes

* Improving type fixes

* Revert optional post

* Extract admin warning from class-parsely (#468)

* Moving settings page out of class-parsely

* Move print dynamic tracking note

* Fixing hooks

* Fix automated linting issues

* Fix manual linting issues

* Extracting admin warning

* Updating hook to _admin_menu

* Moving admin warning tests

* Fix get method

* e2e tests: fix watch command (#476)

* e2e tests: fix watch command

Previously it would error as `test-e2e` command didn't exist.

* Update package.json

* Adding e2e interactive command

* Fix padding

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pau@outlook.com>

* Adding namespace to root class (#477)

* Starting namespace add

* Adding namespace to root class

* Working on tests

* Working on UI tests

* Address StructuredData tests

* Explicit WP_User import

* Fix linting issues

* Using fully qualified names on docstrings in StructuredData tests

* Correcting more docstrings

* Fixing warnings on UI tests

* Fix get_options

* Removing warnings on AdminWarningTest

* Fix FBIA tests

* Fix Integrations Test

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Update tests/Integration/Integrations/AmpTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Bump @wordpress/scripts from 19.0.0 to 19.1.0 (#480)

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 19.0.0 to 19.1.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/@wordpress/scripts@19.1.0/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@19.1.0/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/e2e-test-utils from 5.4.5 to 5.4.6 (#479)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.5 to 5.4.6.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/@wordpress/e2e-test-utils@5.4.6/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.6/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Bump @wordpress/e2e-test-utils from 5.4.6 to 5.4.7 (#488)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.6 to 5.4.7.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.7/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Starting with REST API

* Returning metadata on REST

* Adding testing class

* Test rest_api_init

* Adding filter to disable REST API support

* Use checkboxes for multiple selects in settings page (#482)

* Moving settings page out of class-parsely

* Move print dynamic tracking note

* Fixing hooks

* Fix automated linting issues

* Fix manual linting issues

* Updating hook to _admin_menu

* Working on settings select

* Formatting data correctly

* Rollback new line

* Reverting label change

* Fix automated linting issues

* Fix linting issues

* Simplifying select

* Removing references to multiple argument

* Displaying public taxonomies only

* Matching id and label of checkbox

* Move tracker logic to separate file (#478)

* Starting namespace add

* Adding namespace to root class

* Working on tests

* Working on UI tests

* Address StructuredData tests

* Explicit WP_User import

* Fix linting issues

* Using fully qualified names on docstrings in StructuredData tests

* Correcting more docstrings

* Fixing warnings on UI tests

* Fix get_options

* Removing warnings on AdminWarningTest

* Fix FBIA tests

* Fix Integrations Test

* Splitting out tracker code

* Adding tracker test

* Adding additional tests

* Keep moving tests

* Moving constant

* Adding WP_Scripts

* Renaming class to scripts

* Fixing scripts naming

* Fix path

* Making sure script enqueue is clean

* Fix linting issues

* Updating comment

* Updating more comments

* Bump @wordpress/eslint-plugin from 9.2.0 to 9.3.0 (#490)

Bumps [@wordpress/eslint-plugin](https://github.com/WordPress/gutenberg/tree/HEAD/packages/eslint-plugin) from 9.2.0 to 9.3.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/eslint-plugin@9.3.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@wordpress/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/e2e-test-utils from 5.4.7 to 5.4.8 (#492)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.7 to 5.4.8.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.8/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/scripts from 19.1.0 to 19.2.1 (#491)

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 19.1.0 to 19.2.1.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@19.2.1/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Adding registration test

* Check for get_callback function

* Checking other functions are not defined

* Renaming functions on Scripts class (#481)

* Starting namespace add

* Adding namespace to root class

* Working on tests

* Working on UI tests

* Address StructuredData tests

* Explicit WP_User import

* Fix linting issues

* Using fully qualified names on docstrings in StructuredData tests

* Correcting more docstrings

* Fixing warnings on UI tests

* Fix get_options

* Removing warnings on AdminWarningTest

* Fix FBIA tests

* Fix Integrations Test

* Splitting out tracker code

* Adding tracker test

* Adding additional tests

* Keep moving tests

* Moving constant

* Adding WP_Scripts

* Fixing small issues with scripts class

* Renaming class to scripts

* Fixing scripts naming

* Fix path

* Renaming functions on tests

* Adding a cannonical way of running the plugin locally (#493)

* Adding a local dev environment

* Adding link to VIP dev-env

* Fix tabs on package.json

* Making class members private (#486)

* Making class members private

* Fix FBIA tests

* Fix Recommended API tests

* Revert AMP changes

* Using reflection in tests

* Test with hardcoded constant

* Fix test

* Update tests/Integration/Integrations/FacebookInstantArticlesTest.php

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding changelog for 3.0.0 (#495)

* Adding Changelog for 3.0

* Finishing up changelog

* Adding explicit return type on parsely meta

* Starting register parsely meta json string

* Renaming field

* Registering field to page

* Adding additional filter to disable feature

* Fix typo

* Fix linting issues

* Add data provider to test

* Fix provider test

* Remove unnecessary npm step in e2e (#494)

* Shorter timeout for tests

* Not updating npm each time

* Shorter timeout

* Reverting changes on tests

* Removing custom jest

* Optimizing tests

* Removing explicit timeouts

* Only running NodeJS checks with latest version (#499)

* Checking for updates in GitHub Actions (#498)

* Merging trunk to develop. (#505)

Co-authored-by: Volodymyr Kolesnykov <sjinks@users.noreply.github.com>

* Changelog: Add more detail for 3.0 release (#506)

* Changelog: Add more detail for 3.0 release

* Update CHANGELOG.md

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Adding types to function arguments in GetCurrentUrlTest (#504)

* Settings page: Use submit_button() function (#513)

* Docs: Minor amendments (#514)

* Removing version leak in front-end (#502)

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Tests: Run in random order (#511)

* PR Template: Remove checkboxes (#512)

* Remove settings page custom CSS

* Bump @wordpress/scripts from 19.2.1 to 19.2.2 (#503)

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 19.2.1 to 19.2.2.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@19.2.2/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Bump prettier from 2.4.1 to 2.5.0 (#509)

Bumps [prettier](https://github.com/prettier/prettier) from 2.4.1 to 2.5.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.4.1...2.5.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pau@outlook.com>

* Fixing end to end tests in CI (#521)

* Commenting out end to end test

* Increase timeout

* Testing gutnberg tests

* Installing wp-env

* Removing build step

* Install wp-env globally

* Reverting changes

* Fix typo

* Removing explicit install of env

* Revert deletion

* Removing PHP 8.2 from CI (#523)

* Restoring settings file

* Removing custom E2E Docker image (#524)

* Adding explicit dependabot reviewers (#526)

* Adding instructions for local development on README files (#525)

* Adding more detail to README files

* Removing blank line

* Apply suggestions from code review

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Moving docs to CONTRIBUTING

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding E2E test to verify if scripts are rendered in FE (#528)

* Working on FE e2e test

* Adding second test

* Moving internal dependency

* Enabling linting for JS and CSS files (#527)

* Linting JS and CSS

* Adding babel configuration

* Applying automatic fixes

* Fix npm package

* Updating package-lock.json

* Fixing linting issues in CSS

* Supressing warnings recommended widget

* Awaiting result

* Adding page as a global variable

* Updating linting instructions

* Update wp-parsely.css

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Addressing formatting issues

* Fixing linting on e2e

* Reverting editorconfig changes

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Upgrading Ubuntu CI to 20.04 (#445)

* Upgrading Ubuntu CI to 20.04

* Starting MySQL with parameters

* Using MySQL service

* Test without health

* Updating MySQL call

* Removing healthchecks

* Running command

* Specifying password

* Specifying user

* Correctly passing password

* Overriding config file

* Running as root

* Testing local config<

* Adding group

* Updating root again

* Explicit localhost

* Removing config file

* Minor formatting

* Moving to explicit Ubuntu 20.04

* Bump prettier from 2.5.0 to 2.5.1 (#529)

Bumps [prettier](https://github.com/prettier/prettier) from 2.5.0 to 2.5.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.5.0...2.5.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @wordpress/e2e-test-utils from 5.4.8 to 5.4.9 (#530)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.8 to 5.4.9.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.9/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Settings Page UI improvements (#518)

* Settings: Multiple adjustments

- Remove help-text divs. Since there is no longer any custom CSS applied, there is no need for these divs.
- Re-order settings. Groups those needing a recrawl together.
- Amend settings sections - from Required (one field) and Optional, to Basic, Requires Recrawl, and Advanced.
- Move repeated "Important!" message from each setting that would require a recrawl, to the Requires Recrawl section callback.
- Remove admin-page JavaScript file. This was only used to insert the repeated "Important!" message for those fields that required a recrawl.
- Remove recrawl_required field flags.
- Mark required field as required, in label and on the field itself.
- Remove separated help_links, and allow translatable help text to contain HTML.
- Move logic for conditionally showing description (help text) to a new method.
- Add screen help text.
- Refactor Types to Track checkboxes to use fieldset, and fix non-unique ID attributes which mis-linked labels.
- Moved note about dynamic tracking into screen help tab.

* Use aria-describedby for non-fieldset fields

Programattically associates the description with the select or text field, so that screen reader users can better access it.

Fixes #515.

* Settings: Avoid blocking invalid form submissions

While we want to programattically indicate that a field is required, we don't want different browser implementations of client-side validation to block the form submission. It leads to inconsistent behaviour across browsers, isn't overly accessible to assistive technologies, and we already have a warning message that the single required field is required.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Settings: Hide Disable AMP setting if not needed (#519)

Hiding the setting is simple enough. Extra logic is needed during validation to set it to use the previously saved value if a value wasn't submitted for it.

Fixes #516.

* Adding dev-env logs command (#532)

* Bump @wordpress/e2e-test-utils from 5.4.9 to 5.4.10 (#534)

Bumps [@wordpress/e2e-test-utils](https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils) from 5.4.9 to 5.4.10.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/e2e-test-utils@5.4.10/packages/e2e-test-utils)

---
updated-dependencies:
- dependency-name: "@wordpress/e2e-test-utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: Fix typo in example for PHP code standard (#537)

`compose cs` should be `composer cs`

* Update package-lock.json -- tabs vs. spaces (#539)

* Set up husky

* new npm script: lint -- calls all lint tasks concurrently

* whitespace fix

* Add a pre-commit lint check
Result of:
> npx husky add .husky/pre-commit "npm run lint"

* Add a pre-commit lint check
Result of:
> npx husky add .husky/pre-commit "composer cs"

* Add an npm script for 'composer lint' included in 'npm run lint' wrapper

* Only check for phpcs errors -- permit warnings

* Still show phpcs warnings, but return 0 & allow the commit

* include updated package-lock.json

* fix npm script alphabetized order

* Fix Undefined index in class-settings-page.php (#536)

In my local environment, when saving the plugin's settings, I was getting a
"Notice: Undefined index: disable_amp in /src/UI/class-settings-page.php on
line 712" resulting in a "Warning: Cannot modify header information - headers
already sent" error.

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Settings page: Show error message when duplicate tracking selected

If the user selects the same element in the "Post Types to Track" and "Page Types to Track" sections, an error message will be shown to them telling them that the element should be selected only in one of the sections.

The reasoning behind this is that we should not allow duplicate tracking.

* Add comment to make code block purpose clearer

* Bring Develop up to date with 3.0.0 release (#542)

* Fixing end to end tests in CI (#521) (#541)

* Commenting out end to end test

* Increase timeout

* Testing gutnberg tests

* Installing wp-env

* Removing build step

* Install wp-env globally

* Reverting changes

* Fix typo

* Removing explicit install of env

* Revert deletion

* Handle broken database option (#540)

* Fix broken option

* Fix linting issues

* Using is_array

* Adding integration test

* Release 3.0.0 (#533)

* Release 3.0.0

* Updated changelog

* Source the correct asset meta data file for the Recommendations Widget script

* Include usage description ion CONTRIBUTING.md

* Re-allow phpcs warnings to block commits

* strict comparison for in_array in class-scripts.php

* ignore phpcs warnings in tests/Integration/ScriptsTest.php

* strict type comparison for in_array in src/class-parsely.php

* switch to rawurlencode in the settings mailto reprocess link

* phpcs --severity=1 in the pre-commit hook

* Fix metadata on password protected posts (#547)

* Fix post trackable status

* Fix linting

* Adding filter to disable behavior

* Update tests/Integration/OtherTest.php

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

* Enforce phpcs severity=1 in CI

* Demo warning caught in CI that bypassed pre-commit check

* Revert demo commit 32b16f8

* Adding decoupled support (#489)

* Starting with REST API

* Returning metadata on REST

* Adding testing class

* Test rest_api_init

* Adding filter to disable REST API support

* Adding registration test

* Check for get_callback function

* Checking other functions are not defined

* Adding explicit return type on parsely meta

* Nesting fields in array

* Using options to select object_type

* Renaming field

* Adding object type filter

* Changing object type to plural

* Fix linting issues

* Adding filter test

* Fix test

* Fix linting issues

* Adding additional tests

Cleaning up tests

Testing with dump

Testing with count

Asserting null callback

Check

Checking array key does not exist

Expecting get_callback to not be null

Remove separate process

Checking for null

Removing line

Revert changes

Check post and page don't exist

Running in separate processes

Checking for changes on post and page

Check get_callback is not null

* Rest: Test improvements

- Return type declarations
- Use More specific native assertions
- Consolidating repeated groups of assertions into a new helper method.
- Assert finer details about the expected get_callback value.

* Extracting parsely_rest_get_callback function

* Rest: Further test adjustments

* Extracting parsely_rest_get_callback function

* Adding rest callback test

Adding rest callback test

Chaning covers

Declaring parsely

Using generated metadata

Test rest callback

* Removing  argument

* Removing unused code

* Update tests/Integration/RestTest.php

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

* Update src/class-rest.php

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

* Rename register_parsely_meta to register_meta

* Renaming parsely_rest_get_callback to get_callback

* Renaming constants

Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

* Bring develop up to date with 3.0.1 release (#550)

* Fixing end to end tests in CI (#521) (#541)

* Commenting out end to end test

* Increase timeout

* Testing gutnberg tests

* Installing wp-env

* Removing build step

* Install wp-env globally

* Reverting changes

* Fix typo

* Removing explicit install of env

* Revert deletion

* Handle broken database option (#540)

* Fix broken option

* Fix linting issues

* Using is_array

* Adding integration test

* Release 3.0.0 (#533)

* Release 3.0.0

* Updated changelog

* Release 3.0.1 (#548)

* Fix metadata on password protected posts (#547)

* Fix post trackable status

* Fix linting

* Adding filter to disable behavior

* Update tests/Integration/OtherTest.php

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

* Bumping version number

* Updating README

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

* Renaming field to rendered

* Adding filter

* Adding rendered meta test

* Adding repeated metas test

* Removing line break

* Rest: fix flawed tests

* REST: Add documentation

* Bump concurrently from 6.4.0 to 6.5.1

Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 6.4.0 to 6.5.1.
- [Release notes](https://github.com/open-cli-tools/concurrently/releases)
- [Commits](https://github.com/open-cli-tools/concurrently/compare/v6.4.0...v6.5.1)

---
updated-dependencies:
- dependency-name: concurrently
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Mention duplicate post types in error message

* Include integration test with duplicate tracking detection

* Fix: don't save invalid tracking settings

Although an error message was being displayed for duplicate tracking, the specific settings were being saved into the database. This fix corrects that.

* Fix and simplify settings page integration tests

* Improve settings page texts

Fix the casing for some words, remove a duplicate 'and', hightlight 'WARNING' texts in red.

* Implement code review suggestions

* Fix bad comparison code

* extend the severity=1 flag to the composer cs script

* test_parsely_register_scripts(): Add comments and improve  assertion messages

* test_enqueue_js_tracker: Add comments and improve  assertion messages

* ScriptsTest.php: Remove output tests

- Remove all output tests within ScriptsTest.php, except for output tests within the test_enqueue_js_tracker_with_cloudflare() function
- Make the absolutely necessary adjustments to tests so they can all pass

* Group JS tracker tests together

* Rename @group insert-js to enqueue-js

Raname @group comments to enqueue-js since most tests are now much more enqueuing-oriented rather than output-oriented

* Tests: Add go_to_new_post() function to reduce code duplication

* Fix typos

* ScriptTests.php: Refactor and comment for clarity and code reuse

* ScriptsTest.php: Fix CS and linting errors

* Update assertion message for clarity

* Update function comment for clarity

* CI: Add concurrency to CI configs

Previously, in Travis, when the same branch was pushed again and the "Auto cancellation" option on the "Settings" page had been turned on (as it was for most repos), any still running builds for the same branch would be stopped in favour of starting the build for the newly pushed version of the branch.

To enable this behaviour in GH Actions, a concurrency configuration needs to be added to each workflow for which this should applied to.

More than anything, this is a way to be kind to GitHub by not wasting resources which they so kindly provide to us for free.

* Add tracker enqueue test with disable_javascript option set to true

* CI: Composer tweaks

- `ramsay/composer-install`, the action used to install Composer packages and handle the caching has released a new major (and some follow-up patch releases), which means the action reference needs to be updated to benefit from it.
- Add `--no-interaction` to "plain" Composer commands to potentially prevent CI hanging if, for whatever reason, interaction would be needed in the future.

* Composer: permit composer plugins

The `dealerdirect/phpcodesniffer-composer-installer` and `composer/installers` Composer plugins are used to register an external PHPCS standards with PHPCS, and allow the plugin to be installed in a `wp-content/plugins` directory.

As of Composer 2.2.0, Composer plugins need to be explicitly allowed to run. This adds the necessary configuration for that.

Any globally-installed Composer plugin should be configured in the global `composer.json`.

`composer normalize` also run on the file, which fixes a non-alphabetical script.

Also refresh the list of script descriptions.

Refs:

https://blog.packagist.com/composer-2-2/#more-secure-plugin-execution

* Correct Parsely spelling in comments within tests

* Include API script in test_do_not_track_logged_in_users()

* Improve assert_script_statuses() comments

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Move and rename test_enqueue_js_tracker_with_cloudflare() for clarity

* Include non-registered check in test_parsely_register_scripts()

* Change @group enqueue-js to @group scripts

* Change function name for better Textdox conformity

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Mark assert_script_statuses() as risky when no assertions get passed to it

* Use composer cs script in CI instead of calling phpcs directly

* Update README.md

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

* Update src/class-rest.php

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

* Bump concurrently from 6.5.1 to 7.0.0 (#566)

Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 6.5.1 to 7.0.0.
- [Release notes](https://github.com/open-cli-tools/concurrently/releases)
- [Commits](https://github.com/open-cli-tools/concurrently/compare/v6.5.1...v7.0.0)

---
updated-dependencies:
- dependency-name: concurrently
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* SettingsPageTest: Add expected values first in assertions

* SettingsPageTest: Move validate_options() calls for readability

* SettingsPageTest: Put every assertion in its own test

* SettingsPageTest: Fix incorrect class comment

* Updating release process guidelines (#567)

* Updating release process instructions for the plugin

* Adding additional step

* Resolve #558 (Last Modified date is wrong in the json+ld) (#560)

* Replace get_the_modified_date() with get_post_modified_time()
* Fix fatal errors on gmdate calls (which have been removed in favor of passing the date format into the functions & comparing the standardized datetime strings directly)
* Extract metadata post time functionality to set_metadata_post_times()
* Implement tests for post modified date & particular creation / modification date values of various relation in Parsely metadata

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Update wordpress.org screenshots for settings page (#574)

* Add new screenshots

* Update README.md

* README.md: Restore trailing spaces (line breaks)

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Pull 3.0.2 Changelog into develop (#579)

* Add wordpress.org banners

* Fix fatal TypeError in get_categories function (#591)

* Moving plugin loading to named functions (#595)

* Moving loading files to named functions

* Moving parsely_initialize_plugin out

* Recommended Widget: Remove private migrate_old_fields fn (#599)

* Bump @wordpress/scripts from 19.2.2 to 19.2.3 (#603)

Bumps [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/HEAD/packages/scripts) from 19.2.2 to 19.2.3.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/scripts@19.2.3/packages/scripts)

---
updated-dependencies:
- dependency-name: "@wordpress/scripts"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Adding PHPStan to perform static analysis (#590)

* Adding PHPStan to perform static analysis

* Adding phpstan config file

* Adding strict rules

* Update phpstan.neon

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Updating phpstan to 1.4

Co-authored-by: Gary Jones <gary.jones@automattic.com>

* Adding Parse.ly stats button on admin bar (#569)

* Adding Parse.ly stats button on admin bar

* Adding utilities test

* Update src/UI/class-admin-bar.php

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

* Fix suggestion

* Adding tests

* Adding parameters to generate_parsely_post_url

* Calling cannot show parsely dash link

* Renaming class to Dashboard Links

* Adding tests for can show link

* Adding admin bar test

* Renaming function to can_show_link

* Renaming class to Dashboard_Link

* Renaming class to Dashboard_Link

* Removing explicit requires

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

* Bring develop up to date with 3.0.4 (#604)

* Fixing end to end tests in CI (#521) (#541)

* Commenting out end to end test

* Increase timeout

* Testing gutnberg tests

* Installing wp-env

* Removing build step

* Install wp-env globally

* Reverting changes

* Fix typo

* Removing explicit install of env

* Revert deletion

* Handle broken database option (#540)

* Fix broken option

* Fix linting issues

* Using is_array

* Adding integration test

* Release 3.0.0 (#533)

* Release 3.0.0

* Updated changelog

* Release 3.0.1 (#548)

* Fix metadata on password protected posts (#547)

* Fix post trackable status

* Fix linting

* Adding filter to disable behavior

* Update tests/Integration/OtherTest.php

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

* Bumping version number

* Updating README

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

* Bump version number to 3.0.1 in readme & plugin class file

* Changelog entry for 3.0.2

* whitespace tweaks in changelog

* Resolve #558 (Last Modified date is wrong in the json+ld) (#560)

* Replace get_the_modified_date() with get_post_modified_time()
* Fix fatal errors on gmdate calls (which have been removed in favor of passing the date format into the functions & comparing the standardized datetime strings directly)
* Extract metadata post time functionality to set_metadata_post_times()
* Implement tests for post modified date & particular creation / modification date values of various relation in Parsely metadata

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* annotate set_metadata_post_times with a 'since 3.0.2' in docblock

* include link to compare against 3.0.1 in changelog

* update version number in plugin header

* Fix typo in changelog entry

`unexpedted` -> `unexpected`

* Restore trailing whitespace in readme for Stable tag (#578)

* Release 3.0.3 (#592)

* Fix fatal TypeError in get_categories function (#591)

* Bumping version number

* Release 3.0.4 (#598)

* Moving plugin loading to named functions (#595)

* Moving loading files to named functions

* Moving parsely_initialize_plugin out

* Adding changelog and bumping version number

* Removing REST reference

* Adding changes link to changelog

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: Alex Cicovic <23142906+acicovic@users.noreply.github.com>

* Backport TypeError Fixes from VIP (#607)

* Fix type errors when generating metadata -- backport from VIP

* Yoda conditionals to appease the linter

Co-authored-by: Pau Argelaguet <pauarge@users.noreply.github.com>

* Adding CHANGELOG

* Revert tabulation

* Updating version number

* Revert changes on CHANGELOG.md

* Updating CHANGELOG link

* Update CHANGELOG.md

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

* Update CONTRIBUTING.md

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

* Update README.md

Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: Gary Jones <gary.jones@automattic.com>

Co-authored-by: Gary Jones <gary.jones@automattic.com>
Co-authored-by: Michael Chan <michael.chan@automattic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jeff Bowen <jblz@users.noreply.github.com>
Co-authored-by: mikeyarce <mikeyarce@gmail.com>
Co-authored-by: Gary Jones <gary@gamajo.com>
Co-authored-by: Volodymyr Kolesnykov <sjinks@users.noreply.github.com>
Co-authored-by: Alex Cicovic <23142906+acicovic@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests: Stop using deprecated setMethods().
2 participants