This commit is contained in:
Javier Casares 2026-06-05 09:44:44 +00:00
commit a97911a978
6 changed files with 92 additions and 29 deletions

View file

@ -3,9 +3,9 @@ Contributors: robotstxt, javiercasares
Tags: media, upload, s3, cdn, storage, idrivee2, cloud
Requires at least: 4.1
Tested up to: 7.1
Stable tag: 1.2.0
Stable tag: 1.2.1
Requires PHP: 8.1
Version: 1.2.0
Version: 1.2.1
License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
@ -199,6 +199,27 @@ PHP 8.2 or higher is required. The plugin uses strict type declarations and is t
== Changelog ==
= 1.2.1 =
_Release date: 2026-06-05_
**Fixed**
* **Infinite recursion on image upload** — `wp_update_post()` (used to update the attachment GUID to the S3/CDN URL) was firing the `edit_attachment` WordPress action, which re-triggered the upload method, causing infinite recursion. WordPress reported "The server cannot process the image." Fixed by removing the `edit_attachment` hook (unnecessary — `wp_update_attachment_metadata` covers all new-upload scenarios) and adding a per-attachment re-entry guard.
* **Fatal error: `fclose()` on already-closed stream** — The AWS SDK closes file streams automatically after upload. The cleanup block was calling `fclose()` on already-closed streams, throwing a `TypeError`. Fixed by checking `is_resource()` before closing.
**Compatibility**
* WordPress: 4.1 - 7.1
* PHP: 8.1 - 8.5
**Tests**
* PHP Coding Standards: 3.13.5 (0 errors)
* WordPress Coding Standards: 3.3.0 (0 violations)
* PHPStan: Level 9, 0 errors
* PHPUnit: 22 tests, 54 assertions
= 1.2.0 =
_Release date: 2026-06-02_