Skip to content

Prepare for V3.7#357

Merged
benbalter merged 98 commits intowp-document-revisions:mainfrom
NeilWJames:main
May 2, 2025
Merged

Prepare for V3.7#357
benbalter merged 98 commits intowp-document-revisions:mainfrom
NeilWJames:main

Conversation

@NeilWJames
Copy link
Copy Markdown
Collaborator

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

NeilWJames and others added 30 commits April 30, 2024 21:36
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
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
@codecov-commenter

This comment was marked as outdated.

@benbalter benbalter requested a review from Copilot May 2, 2025 19:55
Copy link
Copy Markdown
Collaborator

@benbalter benbalter left a comment

Choose a reason for hiding this comment

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

Wow, I appreciate all the additional tests. Thank you for doing this! :rocket

@benbalter benbalter merged commit dd23356 into wp-document-revisions:main May 2, 2025
9 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.txt with 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.
Copy link

Copilot AI May 2, 2025

Choose a reason for hiding this comment

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

Fix the typo in this comment: change 'documrnt' to 'document'.

Suggested change
* Filters whether to validate the document structure for a documrnt.
* Filters whether to validate the document structure for a document.

Copilot uses AI. Check for mistakes.
jQuery(function() {window.WPDocumentRevisions.bindPostDocumentUploadCB()});
}
});
document.addEventListener('load', function() {window.WPDocumentRevisions.bindPostDocumentUploadCB()});
Copy link

Copilot AI May 2, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
document.addEventListener('load', function() {window.WPDocumentRevisions.bindPostDocumentUploadCB()});
window.addEventListener('load', function() {window.WPDocumentRevisions.bindPostDocumentUploadCB()});

Copilot uses AI. Check for mistakes.
Comment on lines 36 to +39
steps:
- name: Start DB
run: sudo systemctl start mysql

Copy link

Copilot AI May 2, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
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:

Copilot uses AI. Check for mistakes.
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