Prepare for V3.7#357
Conversation
Merge from Main
Merge from head repository
Merge from Head Repository
Update link to CookBook
Drop builds and compatibility tests with PHP 7.1 and 7.2 Build with MySQL 8 PHPCS uses 8.2 (earliest supported PHP version)
PHP 7.3 does not support MySQL 8
Update POT file
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](peter-evans/create-pull-request@v6...v7) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v4...v5) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
…r-evans/create-pull-request-7 Bump peter-evans/create-pull-request from 6 to 7
…cov/codecov-action-5 Bump codecov/codecov-action from 4 to 5
Update POT file
This comment was marked as outdated.
This comment was marked as outdated.
benbalter
left a comment
There was a problem hiding this comment.
Wow, I appreciate all the additional tests. Thank you for doing this! :rocket
There was a problem hiding this comment.
Pull Request Overview
This PR prepares the plugin for version 3.7, adds new filtering hooks for thumbnail sizing and structure validation, refactors attachment cleanup logic, and expands CI and test coverage to newer PHP versions and WordPress 4.9.
- Bumped version to 3.7.0 and updated
readme.txtwith new tags, requirements, changelog entries, and filters (document_validate,document_thumbnail). - Added dynamic featured‑image sizing (
document_featured_image_size), enhanced attachment deletion logic, and updated hook signatures (clear_cache). - Revised test/bootstrap and CI workflows to run PHPUnit against PHP 7.4–8.3, WordPress 4.9–latest, and enabled functional testing for WP 4.9.
Reviewed Changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| includes/class-wp-document-revisions.php | Version bump, new thumbnail‑size filter, cleanup refactors |
| includes/class-wp-document-revisions-validate-structure.php | Added document_validate filter |
| includes/class-wp-document-revisions-admin.php | Improved attachment‑deletion hooks and event binding changes |
| .github/workflows/ci.yml | Expanded PHP/WordPress matrix, updated MySQL startup logic |
| docs/filters.md | Documented new filters |
Comments suppressed due to low confidence (2)
includes/class-wp-document-revisions.php:571
- [nitpick] There are no existing unit tests covering
document_featured_image_size(). Add tests to verify the filter behavior under different conditions.
public function document_featured_image_size( $size, $post_id ) {
includes/class-wp-document-revisions.php:2831
- This docblock appears without a matching
publishpress_statuses_support()method definition. Either remove the orphaned docblock or add the corresponding method implementation.
* Provides support for PublishPress Statuses and disables the default workflow state taxonomy.
| $guids = array(); | ||
| foreach ( $documents as $rec => $doc ) { | ||
| /** | ||
| * Filters whether to validate the document structure for a documrnt. |
There was a problem hiding this comment.
Fix the typo in this comment: change 'documrnt' to 'document'.
| * Filters whether to validate the document structure for a documrnt. | |
| * Filters whether to validate the document structure for a document. |
| jQuery(function() {window.WPDocumentRevisions.bindPostDocumentUploadCB()}); | ||
| } | ||
| }); | ||
| document.addEventListener('load', function() {window.WPDocumentRevisions.bindPostDocumentUploadCB()}); |
There was a problem hiding this comment.
Listening for 'load' on the document will not fire; use window.addEventListener('load', …) or document.addEventListener('DOMContentLoaded', …) to ensure the callback runs after scripts initialize.
| document.addEventListener('load', function() {window.WPDocumentRevisions.bindPostDocumentUploadCB()}); | |
| window.addEventListener('load', function() {window.WPDocumentRevisions.bindPostDocumentUploadCB()}); |
| steps: | ||
| - name: Start DB | ||
| run: sudo systemctl start mysql | ||
|
|
There was a problem hiding this comment.
Running systemctl start mysql may fail on GitHub Actions images. Consider using the built‑in MySQL service configuration under services: or sudo service mysql start.
| steps: | |
| - name: Start DB | |
| run: sudo systemctl start mysql | |
| services: | |
| mysql: | |
| image: mysql:5.7 | |
| options: --health-cmd="mysqladmin ping --silent" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| MYSQL_DATABASE: wordpress_test | |
| steps: |
This has a couple of functional changes. Addresses #353 and #356
Most of the effort has been to increase the test coverage - both in terms of code coverage, but also the versions of PHP and ensure that WP 4.9 is actually functionally tested.
Neil