Skip to content

Conversation

@gabrielcld2
Copy link
Collaborator

Approach

  • Add a new GH actions workflow to check linting
  • Fix various linting issues that Travis was somehow ignoring
  • Certain issues are a bit riskier to fix without proper testing so ignoring these individually

QA notes

  • Verify the status check for the latest commit on this PR
  • It should contain the Github actions runs (and should not contain Travis anymore)

runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ '5.6', '7.4', '8.3' ]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

note: PHP 5.6 is still marked as supported on the wordpress.org plugin page so I think it makes sense to test it.
Testing 8.3 as well because it's currently the latest PHP version officially supported by WP.

Included 7.4 as well so we can confirm it works on the latest minor version of PHP 7. Arguably this one could be skipped?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Adding 8.3 is great, let us keep the other versions for now. We might reduce them at some point.

@gabrielcld2 gabrielcld2 changed the base branch from master to develop August 26, 2025 01:49
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '16'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

note: Using Node 16 as this is the version specific in the .nvmrc file. We might want to consider upgrading it as it's quite an old version, but that's probably out of the scope for this task.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, we have a separate task to upgrade that.

* @return array
*/
public function default_image_transformations( $default ) {
public function default_image_transformations( $default ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.defaultFound
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

note: We could consider renaming all the variables using a reserved keyword... But I'm always a bit wary to do these type of refactor without properly testing (things could easily go wrong if the IDE misses something like a string interpolation, or dynamic calling the variable perhaps). And testing all of these could take a significant amount of time.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree, let us keep the previous names

<!-- Include WP VIP coding standard checks -->
<rule ref="WordPress-VIP-Go" />
<rule ref="WordPress-VIP-Go">
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get" />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

note: There was an error about using wp_remote_get, recommending to use the VIP function instead... but if the plugin isn't used on VIP, that function won't be available! So IMO it makes more sense to ignore that specific rule globally.

"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
"react-hooks/exhaustive-deps": "warn",
"@wordpress/no-global-event-listener": "off"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

note: This rule was showing several warnings in our JS. However it is really only needed in the context of a React application (see here) so I believe it can be disabled

Doing only on push should be enough and avoid duplication of workflows
@gabrielcld2 gabrielcld2 requested review from aatanasov-cloudinary and removed request for aleksandar-cloudinary August 28, 2025 00:00
Copy link
Collaborator

@aatanasov-cloudinary aatanasov-cloudinary left a comment

Choose a reason for hiding this comment

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

@gabrielcld2, looks good!

@aatanasov-cloudinary aatanasov-cloudinary merged commit 9505364 into develop Sep 1, 2025
5 checks passed
This was referenced Sep 2, 2025
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.

4 participants