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

Add PHPCompatibility sniffs to PHPCS & fix issues #2907

Merged
merged 25 commits into from
Oct 10, 2019
Merged

Add PHPCompatibility sniffs to PHPCS & fix issues #2907

merged 25 commits into from
Oct 10, 2019

Conversation

arnaudbroes
Copy link
Contributor

@arnaudbroes arnaudbroes commented Sep 14, 2019

Issue #2851 (& #2834)

Proposed changes

This PR adds the PHPCompatibility sniffs to our PHPCS configuration and fixes any remaining compatibility issues in our code.

Also, I made a few other changes:

  • Added PHPCS, WPCS & PHPCS Composer Installer as Composer dependencies
  • Added Composer and VSCode folders to .gitignore
  • Renamed "inc/compatability" to "inc/compatibility" to fix the typo
  • Added a separate Grunt task set for Travis that doesn't run phpcbf, uglify & cssmin (these are useless when testing builds)

Types of changes

  • Bugfixes (non-breaking changes which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improves existing functionality
  • Improves existing code

Checklist

  • I've selected the appropriate branch (ie x.y rather than master).
  • I've created an appropriate title, descriptive of what the PR does.
  • Travis-ci runs with no errors.

Testing instructions

There isn't much that can be tested here. I'd recommend having a look at the code changes, then installing the PR and just having a brief look to see if all looks good.

Navigate through the menus, go to the meta box and make sure WP_DEBUG is enabled. You'll also want to create a Post, enter a description with special characters and make sure those still get encoded the same as before.

Further comments

In addition to ensuring our PHP cross-version compatibility, this PR will also make it much easier to setup the development environment locally as PHPCS and WPCS no longer need to be downloaded and configured manually.

@arnaudbroes arnaudbroes added this to the 3.3 milestone Sep 14, 2019
@arnaudbroes arnaudbroes self-assigned this Sep 14, 2019
@arnaudbroes
Copy link
Contributor Author

Here's an example of how this looks like when an error is found - https://travis-ci.org/semperfiwebdesign/all-in-one-seo-pack/jobs/585055472 (toggle cat "logs/phpcs.log" at the bottom of the page)

@michaeltorbert
Copy link
Contributor

michaeltorbert commented Oct 5, 2019

I've tested this according to the instructions and couldn't find any error notices or bugs. It's ready for code review.

Copy link
Contributor

@EkoJR EkoJR left a comment

Choose a reason for hiding this comment

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

Looks good for the most part. Just a couple comments

.gitignore Outdated Show resolved Hide resolved
aioseop_class.php Show resolved Hide resolved
inc/compatibility/php-functions.php Show resolved Hide resolved
@EkoJR
Copy link
Contributor

EkoJR commented Oct 8, 2019

When merging this, the Wiki should also be updated to include PHPCompatibility.

@EkoJR EkoJR assigned arnaudbroes and unassigned EkoJR Oct 8, 2019
@arnaudbroes
Copy link
Contributor Author

When merging this, the Wiki should also be updated to include PHPCompatibility.

I've updated it. Since I only added two extra files to the .gitignore file, I'm going to ahead and send this off to @michaeltorbert for final review.

@michaeltorbert michaeltorbert removed their assignment Oct 10, 2019
@michaeltorbert michaeltorbert merged commit 8e84146 into awesomemotive:3.3 Oct 10, 2019
michaeltorbert pushed a commit that referenced this pull request Oct 29, 2019
* Add support for Google Tag Manager #2983

* 3.3 (#17)

* Add PHPCompatibility sniffs to PHPCS & fix issues (#2907)

* Add PHPCompatibility sniffs to PHPCS #2851

* Ignore Composer & VScode for Git #2851

* Fix PHP compatibility issues (1) #2851

* Don't check PHP compatibility of unit tests #2851

* Fix PHP compatibility issues (2) #2851

* Move parse_ini_string() to compatibility/php-functions.php #2851

* Fix typo #2851

* Fix typo (2) #2851

* Add Grunt task set for Travis CI builds #2851

* Add Travis CI support for PHPCompatibility #2851

* Print installed sniffs after "composer install" in Travis CI #2851

* Delete composer.lock #2851

* Move parse_ini_string() from aioseop_functions.php to compatibility/php-functions.php #2851

* Remove compat-gutenberg.php

* Readd compat-gutenberg.php

* Fix Grunt #2851

* Fix path to compat files #2851

* Add package-lock.json to .gitignore #2851

* Add composer.lock to .gitignore #2851

* Fix phpDoc in compatibility/php-funcitons.php #2851

* Change schema person's name & logo to add the option of manually ente… (#2920)

* Change schema person's name & logo to add the option of manually entered name & image

* Grunt

* Add Schema to AMP plugin (#2879)

* Fix loose comparator in AMP Head causing a return with empty description

* Move AMP hooks to separate function for AMP hooks

* Add remove hook for AMP Schema

* Add AIOSEOP's Schema to AMP

* Dev-change aioseop_amp_description filter to only affect meta descriptions

* Add filter aioseop_amp_schema to enable/disable schema on AMP posts

* Dev-Fix disable schema filter and no meta desc.

* Invert if statement and add third decimal to phpDoc since tags #506

* Add third decimal to phpDoc since tag (2) #506

* Fix Grunt issue

* Fix Grunt issue (2)

* Change bin path for phpcs (#2966)

* Change bin path for phpcs #2965

* Delete phpcs and phpcompatibility script entries #2965

* Add new line to init-grunt.sh #2965

* Refactor operations in All_in_One_SEO_Pack_Opengraph::add_meta() (#2941)

* Change variable variables to direct variables

* Change early initialize thumbnail variable to use image variable

* Change operations from call filter to call method

* Add filter documentation

* Change to group operations together

* Add dev notes

* Grunt

* Dev-Fix filter params

* Dev-Add dev note

* Dev-Fix error on SSL enabled site

* Dev-Change duplicate code to function

* Only output meta descriptions if autogenerate descriptions is enabled (#2947)

* Fix issue 2439

* Dev-Change to strict comparator

* Dev-Fix empty value check

* Dev-Change applied changes

The excerpt was being added elsewhere as a final fallback

* Revert previous changes #2439

* Refactor code #2439

* Remove unneeded check #2439

* Fix Grunt issue

* Fix SEO for search results page (#2964)

* Added/updated help text for new Schema fields (#2959)

* #2958 Added/updated help text for new Schema fields

* Add missing i18n domains #2958

* Resolves #2411 (#2955)

* 3.2.10 to 3.3 (#2986)

* Update help text for Sitemap Indexes setting (#2961)

* Only show Welcome Screen on major version updates (#2922)

* add get_major_version function #2662

* only show welcome screen on major version updates #2662

* remove function

* move function to aioseop_functions.php

* Remove class keywords #2662

* Grunt & WPCS

* Fix conflict between Chromium v77.0.3865.75 and Gutenberg (#2921)

* Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914

* Grunt fixes #2914

* Revert removed package tag #2914

* Target WP 5.0 <= X < 5.3 #2914

* Move echo statement inside version check #2914

* Do proper version checks #2914

* Fix phpDoc #2914

* Add filter hook to disable schema.org markup (#2915)

* Add filter hook to disable schema.org markup

* fix return value for schema filter

* Grunt fix #2913

* reversing schema filter logic and using a boolean instead of string

* Update help text for Sitemap Indexes setting #2954

* Remove version check for Gutenberg/Chrome compatibility fix and check if user agent is set (#2928)

* Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914

* Grunt fixes #2914

* Revert removed package tag #2914

* Target WP 5.0 <= X < 5.3 #2914

* Move echo statement inside version check #2914

* Do proper version checks #2914

* Fix phpDoc #2914

* Only show Welcome Screen on major version updates (#2922)

* add get_major_version function #2662

* only show welcome screen on major version updates #2662

* remove function

* move function to aioseop_functions.php

* Remove class keywords #2662

* Grunt & WPCS

* Fix conflict between Chromium v77.0.3865.75 and Gutenberg (#2921)

* Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914

* Grunt fixes #2914

* Revert removed package tag #2914

* Target WP 5.0 <= X < 5.3 #2914

* Move echo statement inside version check #2914

* Do proper version checks #2914

* Fix phpDoc #2914

* Add filter hook to disable schema.org markup (#2915)

* Add filter hook to disable schema.org markup

* fix return value for schema filter

* Grunt fix #2913

* reversing schema filter logic and using a boolean instead of string

* Remove WP v5.3 version check and move function out of action hook #2914

* Invert version_compare and prefix functions #2914

* Fix phpDocs #2914

* Rename compat-gutenberg.php to gutenberg-chrome.php #2914

* Fix undefined index HTTP_USER_AGENT #2952

* version bump to 3.2.10

* Update readme.txt

* Delete duplicate file

* Fix file paths

* Fix Grunt issues #2990

* Fix Grunt issues #2983

* Fix undefined class error #2983
michaeltorbert pushed a commit that referenced this pull request Oct 30, 2019
* Refactor & move get_robots_meta() #2684

* Grunt fixes #2684

* PHPCS fixes #2684

* Fix minor bugs #2684

* tmp

* Remove tmp unit tests #2684

* Fix Grunt issues #2684

* Fix Scrutinizer issues #2684

* Fix phpDoc

* Add remote XDebug listener script for VScode #2684

* Skip test_title_format_macros #2684

* Fix fatal error and Grunt #2684

* Remove check for AIOSEOP Pro #2684

* PR comments #2684

* 3.3 (#17)

* Add PHPCompatibility sniffs to PHPCS & fix issues (#2907)

* Add PHPCompatibility sniffs to PHPCS #2851

* Ignore Composer & VScode for Git #2851

* Fix PHP compatibility issues (1) #2851

* Don't check PHP compatibility of unit tests #2851

* Fix PHP compatibility issues (2) #2851

* Move parse_ini_string() to compatibility/php-functions.php #2851

* Fix typo #2851

* Fix typo (2) #2851

* Add Grunt task set for Travis CI builds #2851

* Add Travis CI support for PHPCompatibility #2851

* Print installed sniffs after "composer install" in Travis CI #2851

* Delete composer.lock #2851

* Move parse_ini_string() from aioseop_functions.php to compatibility/php-functions.php #2851

* Remove compat-gutenberg.php

* Readd compat-gutenberg.php

* Fix Grunt #2851

* Fix path to compat files #2851

* Add package-lock.json to .gitignore #2851

* Add composer.lock to .gitignore #2851

* Fix phpDoc in compatibility/php-funcitons.php #2851

* Change schema person's name & logo to add the option of manually ente… (#2920)

* Change schema person's name & logo to add the option of manually entered name & image

* Grunt

* Add Schema to AMP plugin (#2879)

* Fix loose comparator in AMP Head causing a return with empty description

* Move AMP hooks to separate function for AMP hooks

* Add remove hook for AMP Schema

* Add AIOSEOP's Schema to AMP

* Dev-change aioseop_amp_description filter to only affect meta descriptions

* Add filter aioseop_amp_schema to enable/disable schema on AMP posts

* Dev-Fix disable schema filter and no meta desc.

* Invert if statement and add third decimal to phpDoc since tags #506

* Add third decimal to phpDoc since tag (2) #506

* Fix Grunt issue

* Fix Grunt issue (2)

* Change bin path for phpcs (#2966)

* Change bin path for phpcs #2965

* Delete phpcs and phpcompatibility script entries #2965

* Add new line to init-grunt.sh #2965

* Refactor operations in All_in_One_SEO_Pack_Opengraph::add_meta() (#2941)

* Change variable variables to direct variables

* Change early initialize thumbnail variable to use image variable

* Change operations from call filter to call method

* Add filter documentation

* Change to group operations together

* Add dev notes

* Grunt

* Dev-Fix filter params

* Dev-Add dev note

* Dev-Fix error on SSL enabled site

* Dev-Change duplicate code to function

* Only output meta descriptions if autogenerate descriptions is enabled (#2947)

* Fix issue 2439

* Dev-Change to strict comparator

* Dev-Fix empty value check

* Dev-Change applied changes

The excerpt was being added elsewhere as a final fallback

* Revert previous changes #2439

* Refactor code #2439

* Remove unneeded check #2439

* Fix Grunt issue

* Fix SEO for search results page (#2964)

* Added/updated help text for new Schema fields (#2959)

* #2958 Added/updated help text for new Schema fields

* Add missing i18n domains #2958

* Resolves #2411 (#2955)

* 3.2.10 to 3.3 (#2986)

* Update help text for Sitemap Indexes setting (#2961)

* Only show Welcome Screen on major version updates (#2922)

* add get_major_version function #2662

* only show welcome screen on major version updates #2662

* remove function

* move function to aioseop_functions.php

* Remove class keywords #2662

* Grunt & WPCS

* Fix conflict between Chromium v77.0.3865.75 and Gutenberg (#2921)

* Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914

* Grunt fixes #2914

* Revert removed package tag #2914

* Target WP 5.0 <= X < 5.3 #2914

* Move echo statement inside version check #2914

* Do proper version checks #2914

* Fix phpDoc #2914

* Add filter hook to disable schema.org markup (#2915)

* Add filter hook to disable schema.org markup

* fix return value for schema filter

* Grunt fix #2913

* reversing schema filter logic and using a boolean instead of string

* Update help text for Sitemap Indexes setting #2954

* Remove version check for Gutenberg/Chrome compatibility fix and check if user agent is set (#2928)

* Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914

* Grunt fixes #2914

* Revert removed package tag #2914

* Target WP 5.0 <= X < 5.3 #2914

* Move echo statement inside version check #2914

* Do proper version checks #2914

* Fix phpDoc #2914

* Only show Welcome Screen on major version updates (#2922)

* add get_major_version function #2662

* only show welcome screen on major version updates #2662

* remove function

* move function to aioseop_functions.php

* Remove class keywords #2662

* Grunt & WPCS

* Fix conflict between Chromium v77.0.3865.75 and Gutenberg (#2921)

* Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914

* Grunt fixes #2914

* Revert removed package tag #2914

* Target WP 5.0 <= X < 5.3 #2914

* Move echo statement inside version check #2914

* Do proper version checks #2914

* Fix phpDoc #2914

* Add filter hook to disable schema.org markup (#2915)

* Add filter hook to disable schema.org markup

* fix return value for schema filter

* Grunt fix #2913

* reversing schema filter logic and using a boolean instead of string

* Remove WP v5.3 version check and move function out of action hook #2914

* Invert version_compare and prefix functions #2914

* Fix phpDocs #2914

* Rename compat-gutenberg.php to gutenberg-chrome.php #2914

* Fix undefined index HTTP_USER_AGENT #2952

* version bump to 3.2.10

* Update readme.txt

* Delete duplicate file

* Fix file paths

* Fix Grunt issues #2990

* Skip failing unit test #2684

* Remove launch.json

* PR comments #2684

* Change identation

* Grunt fixes
arnaudbroes added a commit that referenced this pull request Nov 4, 2019
* Refactor aioseop-count-chars.js #2755

* Clear preview snippet description when "Autogenerated Descriptions" is disabled #2975

* Fix #2927, #2747, #2337

* Set character treshold to 55 for OG:title and OG:description #2413

* Change let to var + minify

* Use minified JavaScript files instead

* Fix variable naming

* Fix Grunt issues

* Revert minified js

* 3.3 (#17)

* Add PHPCompatibility sniffs to PHPCS & fix issues (#2907)

* Add PHPCompatibility sniffs to PHPCS #2851

* Ignore Composer & VScode for Git #2851

* Fix PHP compatibility issues (1) #2851

* Don't check PHP compatibility of unit tests #2851

* Fix PHP compatibility issues (2) #2851

* Move parse_ini_string() to compatibility/php-functions.php #2851

* Fix typo #2851

* Fix typo (2) #2851

* Add Grunt task set for Travis CI builds #2851

* Add Travis CI support for PHPCompatibility #2851

* Print installed sniffs after "composer install" in Travis CI #2851

* Delete composer.lock #2851

* Move parse_ini_string() from aioseop_functions.php to compatibility/php-functions.php #2851

* Remove compat-gutenberg.php

* Readd compat-gutenberg.php

* Fix Grunt #2851

* Fix path to compat files #2851

* Add package-lock.json to .gitignore #2851

* Add composer.lock to .gitignore #2851

* Fix phpDoc in compatibility/php-funcitons.php #2851

* Change schema person's name & logo to add the option of manually ente… (#2920)

* Change schema person's name & logo to add the option of manually entered name & image

* Grunt

* Add Schema to AMP plugin (#2879)

* Fix loose comparator in AMP Head causing a return with empty description

* Move AMP hooks to separate function for AMP hooks

* Add remove hook for AMP Schema

* Add AIOSEOP's Schema to AMP

* Dev-change aioseop_amp_description filter to only affect meta descriptions

* Add filter aioseop_amp_schema to enable/disable schema on AMP posts

* Dev-Fix disable schema filter and no meta desc.

* Invert if statement and add third decimal to phpDoc since tags #506

* Add third decimal to phpDoc since tag (2) #506

* Fix Grunt issue

* Fix Grunt issue (2)

* Change bin path for phpcs (#2966)

* Change bin path for phpcs #2965

* Delete phpcs and phpcompatibility script entries #2965

* Add new line to init-grunt.sh #2965

* Refactor operations in All_in_One_SEO_Pack_Opengraph::add_meta() (#2941)

* Change variable variables to direct variables

* Change early initialize thumbnail variable to use image variable

* Change operations from call filter to call method

* Add filter documentation

* Change to group operations together

* Add dev notes

* Grunt

* Dev-Fix filter params

* Dev-Add dev note

* Dev-Fix error on SSL enabled site

* Dev-Change duplicate code to function

* Only output meta descriptions if autogenerate descriptions is enabled (#2947)

* Fix issue 2439

* Dev-Change to strict comparator

* Dev-Fix empty value check

* Dev-Change applied changes

The excerpt was being added elsewhere as a final fallback

* Revert previous changes #2439

* Refactor code #2439

* Remove unneeded check #2439

* Fix Grunt issue

* Fix SEO for search results page (#2964)

* Added/updated help text for new Schema fields (#2959)

* #2958 Added/updated help text for new Schema fields

* Add missing i18n domains #2958

* Resolves #2411 (#2955)

* 3.2.10 to 3.3 (#2986)

* Update help text for Sitemap Indexes setting (#2961)

* Only show Welcome Screen on major version updates (#2922)

* add get_major_version function #2662

* only show welcome screen on major version updates #2662

* remove function

* move function to aioseop_functions.php

* Remove class keywords #2662

* Grunt & WPCS

* Fix conflict between Chromium v77.0.3865.75 and Gutenberg (#2921)

* Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914

* Grunt fixes #2914

* Revert removed package tag #2914

* Target WP 5.0 <= X < 5.3 #2914

* Move echo statement inside version check #2914

* Do proper version checks #2914

* Fix phpDoc #2914

* Add filter hook to disable schema.org markup (#2915)

* Add filter hook to disable schema.org markup

* fix return value for schema filter

* Grunt fix #2913

* reversing schema filter logic and using a boolean instead of string

* Update help text for Sitemap Indexes setting #2954

* Remove version check for Gutenberg/Chrome compatibility fix and check if user agent is set (#2928)

* Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914

* Grunt fixes #2914

* Revert removed package tag #2914

* Target WP 5.0 <= X < 5.3 #2914

* Move echo statement inside version check #2914

* Do proper version checks #2914

* Fix phpDoc #2914

* Only show Welcome Screen on major version updates (#2922)

* add get_major_version function #2662

* only show welcome screen on major version updates #2662

* remove function

* move function to aioseop_functions.php

* Remove class keywords #2662

* Grunt & WPCS

* Fix conflict between Chromium v77.0.3865.75 and Gutenberg (#2921)

* Fix conflict between Chromium v77.0.3865.75 and Gutenberg #2914

* Grunt fixes #2914

* Revert removed package tag #2914

* Target WP 5.0 <= X < 5.3 #2914

* Move echo statement inside version check #2914

* Do proper version checks #2914

* Fix phpDoc #2914

* Add filter hook to disable schema.org markup (#2915)

* Add filter hook to disable schema.org markup

* fix return value for schema filter

* Grunt fix #2913

* reversing schema filter logic and using a boolean instead of string

* Remove WP v5.3 version check and move function out of action hook #2914

* Invert version_compare and prefix functions #2914

* Fix phpDocs #2914

* Rename compat-gutenberg.php to gutenberg-chrome.php #2914

* Fix undefined index HTTP_USER_AGENT #2952

* version bump to 3.2.10

* Update readme.txt

* Delete duplicate file

* Fix file paths

* Fix Grunt issues #2990

* Add characterCounter to ignored JS variables

* Fix bugs

* Update character counter when editor changes #2977

* Fix bug where counter background colour doesn't change

* PR comments

* Support non-default plugin path

* Remove unused code

* Remove unneeded variable declaration

* Include post-new.php as edit page

* Use legacy code for taxonomies

* Fix Grunt issues

* Revert minified scripts

* Variable alignment

* Use let (ES6) and align variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants