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

Release: v2.4.1 #1019

Merged
merged 98 commits into from
Jan 3, 2024
Merged

Release: v2.4.1 #1019

merged 98 commits into from
Jan 3, 2024

Conversation

attackant
Copy link
Member

@attackant attackant commented Oct 30, 2023

Feature branch for the v2.4.1 release.

BrookeDot and others added 4 commits June 19, 2023 13:37
PHP's `strtotime()` uses the epoch time which is expecting the time format in UTC instead of local time. 

This PR updates `$date` to use `$post->post_date_gmt` instead of `$post->post_date` for proper timezone conversations. 

Fixes #1006
The node-tests workflow steps have been replaced with a shared GitHub Action from 'alleyinteractive'. This simplifies the workflow file making it more readable and maintainable. Additional configurations like ci mode, node version, and working directory are enabled; hence enhancing the node-tests setup process.
The PHPUnit GitHub workflow was significantly simplified by reducing the amount of work done in the YAML file. The previous workflow was manually setting up the test environment (downloading WordPress, setting up MySQL, etc.) within this file.

The updated workflow uses a custom GitHub action that handles these setup steps, resulting in a cleaner and easier to read workflow file.

Moreover, the PHP versions and WordPress version for testing have been updated to reflect more current versions.
@attackant attackant added this to the v2.4.1 milestone Oct 30, 2023
@attackant attackant self-assigned this Oct 30, 2023
@attackant attackant linked an issue Oct 30, 2023 that may be closed by this pull request
Added new script 'test' to composer.json file. This script combines two existing scripts, 'phpcs' and 'phpunit', making it more efficient to run both scripts for testing. Also, 'phpcs' script has been updated with '--basepath=.' argument to set the base directory for relative paths."
The basepath option was removed from the phpcs command in composer.json. The basepath option was found to be unnecessary because phpcs runs relative to the project root by default. Thus, removing this option simplifies the command without changing its functionality.
@attackant attackant linked an issue Oct 30, 2023 that may be closed by this pull request
This commit updates the composer.json file. The dependencies versions have been changed to more recent versions and the required PHP version has been updated too. These changes support more recent and secure code usage conventions.
Refactored the PHP Coding Standards action block in Github workflow file (.github/workflows/phpcs.yml). Removed redundant steps, and migrated job definition to use the prepared PHP coding standards action. This change provides a cleaner and less error-prone setup, allowing more focus on PHP Coding Standards execution.
Removed the WordPress version matrix from the PHP Code Sniffer (PHPCS) GitHub Actions workflow. This is because we no longer need to test against different WordPress versions, simplifying the workflow and reducing the resources needed for testing.
The "command: phpcs" line was removed from the phpcs.yml workflow file. This change was necessary as the command is already specified in the php-coding-standards.yml workflow from alleyinteractive repository and doesn’t need to be defined twice. This refactoring helps to avoid confusion and potential command conflicts in the future.
…deprecations

Added null checks in `function-coauthors.php` and `class-components.php` to prevent possible undefined behaviour when handling non-initialized variables. This makes the code more robust and resilient to potential errors. Moreover, added private string variables in `test-class-table.php` and private `Admin_Apple_Themes` variable to the `test-class-admin-apple-themes.php` which improves the readability and structure of these files.
Copy link

@renatonascalves renatonascalves left a comment

Choose a reason for hiding this comment

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

a few suggestions

composer.json Outdated Show resolved Hide resolved
includes/apple-exporter/builders/class-components.php Outdated Show resolved Hide resolved
tests/mocks/function-coauthors.php Outdated Show resolved Hide resolved
.github/workflows/node-tests.yml Show resolved Hide resolved
.github/workflows/phpcs.yml Show resolved Hide resolved
.github/workflows/phpcs.yml Show resolved Hide resolved
.github/workflows/phpcs.yml Outdated Show resolved Hide resolved
.github/workflows/phpunit.yml Show resolved Hide resolved
tests/admin/test-class-admin-apple-themes.php Show resolved Hide resolved
PHP version requirement in composer.json was changed from "^8.0" to "^7.4" to ensure compatibility with older PHP environments. This will allow the project to be integrated into systems that have not yet updated to the newest PHP version.
This update adjusts the GitHub Action for running PHP CodeSniffer to trigger only for non-draft pull requests on 'develop' branch. The purpose is to minimize unnecessary runs and provide feedback only when code is ready for review.
This commit updates the GitHub workflow for PHPunit, PHPCS, and node tests. The workflows are now triggered only pull requests towards the develop branch and exclude draft pull requests. This prevents unnecessary running of these workflows on every pull request. Additionally, the PHP version for PHPCS has been updated from 8.0 to 8.2 to align with the latest PHP version usage.
An addition to the test matrix in the GitHub Actions configuration for PHPUnit was made to include multisite setups. This change ensures that the codebase is compatible with WordPress multisite environments.
Amended default conditions from null checks to empty checks in function-coauthors.php and class-components.php. Previously, there were no defaults set when running unit tests which led to unexpected fails. This change will ensure that unit tests pass even when certain parameters are not explicitly set.
…modules"

Removed unnecessary aliases from class imports for improved readability and simplified access statements. Change usage of 'dirname( FILE )' to '__DIR__' for cleaner calls. Also made minor formatting updates, such as making spaces consistent around parentheses and adding increment from prefix to postfix form in for loops for better standardization. The changes were done to increase the code quality without affecting the functional behavior of the codebase.
This commit updates the PHP Code Sniffer suppression annotations in the apple-exporter components class. Previously, there was an incorrect ignore annotation `VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable` in `node_matches` method which has now been replaced with `Generic.CodeAnalysis.UnusedFunctionParameter.Found`. This change better reflects the actual warning being suppressed.

Also, a new annotation for `WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase` has been added around the method for finding iframe nodes in
This change was necessary to ensure the codebase conforms to the WordPress Naming Conventions. Comments were added to ignore PHP Code Sniffer warnings about non-snake case variables when checking if a node is an 'audio' node. This had to be done since those checks are part of the application's logic
In this commit, we have made several changes to ensure safe output and to follow proper PHP coding standards.
1. We have started using 'esc_html' function to escape the outputs of the exception messages in the 'class-request.php' file. This is to prevent potential security leaks from unescaped outputs.
2. We also added comments to ignore phpcs warnings for certain lines which were raising warnings due to variable naming issues. Especially for lines using `nodeName` and `keyPath` properties, as they do not follow WordPress's snake case convention, but they are necessary for our function to work correctly. Further, they are properties of node, which we do not have control over, hence
Escaping functions have been added to all error messages in class-push.php. This change is made to prevent potential Cross-Site Scripting (XSS) vulnerabilities by ensuring any user-supplied data is properly escaped before it is output, following best practices for WordPress development. This does not affect the functionality of the error messages but enhances the security.
Code was updated across video, tweet, and embed-web-video classes to align with PHP Code Sniffer's WordPress naming conventions. Ignored variable checks were placed on non-snake cased node properties, and text strings were escaped in delete and meta classes. Aimed to enhance code quality and prevent potential scripting attacks."
The project has been updated to add comments to ignore the 'not using snake case' warnings from PHP Code Sniffer. This was necessary as the property names used in the Node class provided by the core PHP library, do not follow snake case convention. These warnings were leading to unnecessary noise in the linting reports and were misleading as it could lead developers to think that there's something wrong with the project's own codebase. As this convention is not something developer can change, it is now simply ignored by the linter."
@srtfisher srtfisher changed the title Release/v2.4.1 Release: v2.4.1 Nov 15, 2023
srtfisher and others added 10 commits November 15, 2023 14:45
…sands from being displayed as entities

The update made in class-link-button.php fixes an issue with HTML entities being displayed in the link button text. By using the 'html_entity_decode' function, these HTML entities are now properly decoded, improving the visual output and user experience.
This update upgrades the versions of several dependencies in package-lock.json. Affected packages include "@babel/code-frame" and "@babel/highlight", as well as several related packages. Also, multiple packages had their "resolved" URLs and "integrity" hashes updated to match their new version numbers.
Changes were made in .phpcs.xml file to rename the custom properties whitelist rule to allowed_custom_properties
Updated the minimum required PHP version to 8.0 and WordPress version to 6.3 in .phpcs.xml and readme.txt. This ensures compatibility with newer versions of PHP and WordPress, and reflects requirement changes in the project setup.
Corrected the syntax for incrementing the list_index in class-markdown.php. The updated code ensures that the variable is incremented in a clear and well-recognized format, improving code readability and maintaining consistency across the project.
The 'Tested up to' version information in readme.txt has been updated from version 6.3.2 to 6.4.2. This change reflects the latest version that the software has been confirmed as compatible with, providing users with updated and accurate information.
.phpcs.xml Outdated Show resolved Hide resolved
attackant and others added 5 commits January 3, 2024 08:58
Co-authored-by: Renato Alves <[email protected]>
The parameters in the function "filter_update_post_metadata" have been refactored for better readability and stricter typing. In addition, the condition to check the count of 'old_value' has been enhanced to prevent potential errors when 'old_value' is not an array.
The strict typing in the parameters of the function "filter_update_post_metadata" has been removed to offer more flexibility. Simultaneously, the condition which checks the count of 'old_value' has been modified to avoid errors if 'old_value' is not an array.
@attackant attackant dismissed stale reviews from kevinfodness and renatonascalves January 3, 2024 20:58

changes done

@attackant attackant merged commit 357fefa into develop Jan 3, 2024
16 checks passed
@attackant attackant deleted the release/v2.4.1 branch January 3, 2024 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants