Yoast / yoast-acf-analysis

WordPress plugin that adds the content of all ACF fields to the Yoast SEO score analysis.
https://wordpress.org/plugins/acf-content-analysis-for-yoast-seo/
GNU General Public License v3.0
61 stars 20 forks source link

PHPCS: Update to YoastCS 2.0.0 #229

Closed jrfnl closed 4 years ago

jrfnl commented 4 years ago

Summary

This PR can be summarized in the following changelog entry:

Relevant technical choices:

:exclamation: This PR will be easiest to review by going through the commits individually.

PHPCS: Update to YoastCS 2.0.0

This updates the dependency in composer.json, as well as the PHPCS ruleset for YoastCS 2.0.0.

Includes:

Ref: https://github.com/Yoast/yoastcs/releases/tag/2.0.0

PHPCS: whitelist an acf hook used

Deprecate Yoast_ACF_Analysis_Facade::get_filter_name()

Having filter names created via a function call makes it impossible for documentation scrapers to document the available filters.

This commit deprecated the method which was used for this and changes all existing filter to hard-coded filter names.

The filter names, however, are still the same, so this does not constitute a BC-break.

CS: deprecate old-style hook and add new-style hook [1]

This deprecates the yoast-acf-analysis/config filter hook in favour of the Yoast\WP\ACF\config hook.

[This needs a changelog entry]

CS: deprecate old-style hook and add new-style hook [2]

This deprecates the yoast-acf-analysis/headlines filter hook in favour of the Yoast\WP\ACF\headlines hook.

[This needs a changelog entry]

CS: deprecate old-style hook and add new-style hook [3]

This deprecates the yoast-acf-analysis/blacklist_type filter hook in favour of the Yoast\WP\ACF\blacklist_type hook.

[This needs a changelog entry]

CS: deprecate old-style hook and add new-style hook [4]

This deprecates the yoast-acf-analysis/blacklist_name filter hook in favour of the Yoast\WP\ACF\blacklist_name hook.

Includes adjusting a previously deprecated filter which should now point to the new-style filter to use apply_filters_deprecated() and provide proper deprecation information.

[This needs a changelog entry]

CS: deprecate old-style hook and add new-style hook [5]

This deprecates the yoast-acf-analysis/scraper_config filter hook in favour of the Yoast\WP\ACF\scraper_config hook.

[This needs a changelog entry]

CS: deprecate old-style hook and add new-style hook [6]

This deprecates the yoast-acf-analysis/refresh_rate filter hook in favour of the Yoast\WP\ACF\refresh_rate hook.

[This needs a changelog entry]

CS: deprecate old-style hook and add new-style hook [7]

This deprecates the yoast-acf-analysis/field_selectors filter hook in favour of the Yoast\WP\ACF\field_selectors hook.

[This needs a changelog entry]

CS: deprecate old-style hook and add new-style hook [8]

This deprecates the yoast-acf-analysis/field_order filter hook in favour of the Yoast\WP\ACF\field_order hook.

[This needs a changelog entry]

CS: use short arrays (everywhere)

CS: don't use Yoda conditions

Test instructions

This PR can be tested by following these steps:

See the test instructions in the Yoast/wpseo-woocommerce#451 PR for guidance on how to test this PR.

Closes #228

andizer commented 4 years ago

CR + Acceptance 👍