Changeset 3479991
- Timestamp:
- 03/11/2026 11:10:29 AM (4 weeks ago)
- Location:
- advanced-media-offloader/trunk
- Files:
-
- 4 edited
-
advanced-media-offloader.php (modified) (1 diff)
-
includes/Observers/PostContentImageTagObserver.php (modified) (2 diffs)
-
readme.txt (modified) (6 diffs)
-
vendor/composer/installed.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
advanced-media-offloader/trunk/advanced-media-offloader.php
r3474384 r3479991 4 4 * Plugin URI: https://wpfitter.com/plugins/advanced-media-offloader/ 5 5 * Description: Save server space & speed up your site by automatically offloading media to Amazon S3, Cloudflare R2, DigitalOcean Spaces, Backblaze B2 and more. 6 * Version: 4.4. 06 * Version: 4.4.1 7 7 * Requires at least: 5.6 8 8 * Requires PHP: 8.1 -
advanced-media-offloader/trunk/includes/Observers/PostContentImageTagObserver.php
r3203942 r3479991 44 44 45 45 /** 46 * Modify the image srcset. 47 * @param array $sources 48 * @param array $size_array 49 * @param array $image_src 50 * @param array $image_meta 51 * @param int $attachment_id 52 * @return array 46 * Rewrite the src attribute of content images to the offloaded URL. 47 * 48 * @param string $filtered_image Full img tag with attributes that will replace the source img tag. 49 * @param string $context Additional context, like the current filter name or the function name from where this was called. 50 * @param int $attachment_id The image attachment ID. May be 0 in case the image is not an attachment. 51 * @return string The modified image tag HTML. 53 52 */ 54 53 public function run($filtered_image, $context, $attachment_id) … … 57 56 return $filtered_image; 58 57 } 59 60 58 $src_attr = $this->get_image_src($filtered_image); 61 59 if (empty($src_attr)) { 62 60 return $filtered_image; 63 61 } 64 65 $offloaded_image_url = wp_get_attachment_url($attachment_id); 66 $filtered_image = str_replace($src_attr, $offloaded_image_url, $filtered_image); 67 62 $domain = $this->cloudProvider->getDomain(); 63 if (empty($domain)) { 64 return $filtered_image; 65 } 66 $normalized_domain = rtrim($domain, '/'); 67 // Already on the offloaded domain — nothing to do 68 if (strpos($src_attr, $normalized_domain) === 0) { 69 return $filtered_image; 70 } 71 // Swap domain but keep the original filename (preserves size suffix) 72 $subDir = $this->get_attachment_subdir($attachment_id); 73 $offloaded_src = $normalized_domain . '/' . ltrim($subDir, '/') . basename($src_attr); 74 $filtered_image = str_replace($src_attr, $offloaded_src, $filtered_image); 68 75 return $filtered_image; 69 76 } -
advanced-media-offloader/trunk/readme.txt
r3474384 r3479991 6 6 Tested up to: 6.9 7 7 Requires PHP: 8.1 8 Stable tag: 4.4. 08 Stable tag: 4.4.1 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 35 35 * **MinIO** - Any S3-compatible storage (MinIO, OVHcloud Object Storage, Scaleway, Linode, Vultr, IBM COS, and more) 36 36 37 Not sure which provider to choose? Check our [cloud storage pricing comparison](https://wpfitter.com/blog/best-cloud-storage-for-wordpress-media-pricing-comparison/?utm_source=wp-plugin&utm_medium=readme&utm_campaign=advanced-media-offloader&utm_content=pricing-comparison) for real-world cost breakdowns. 38 37 39 == Features == 38 40 39 41 * **Automatic Offloading** - New media uploads are automatically sent to your cloud storage 40 * **Smart Policies** - Create advanced rules to control exactly which files are offloaded and when, giving you granular control over your storage. ([Learn more](https://wpfitter.com/blog/implementing-smart-retention-policies-with-advanced-media-offloader/ ))41 * **Bulk Migration & WP CLI** - Easily move existing media to the cloud with powerful command-line support for bulk operations and automation ([Learn more](https://wpfitter.com/blog/advmo-bulk-offload-with-wp-cli ))42 * **Smart Policies** - Create advanced rules to control exactly which files are offloaded and when, giving you granular control over your storage. ([Learn more](https://wpfitter.com/blog/implementing-smart-retention-policies-with-advanced-media-offloader/?utm_source=wp-plugin&utm_medium=readme&utm_campaign=advanced-media-offloader&utm_content=smart-policies)) 43 * **Bulk Migration & WP CLI** - Easily move existing media to the cloud with powerful command-line support for bulk operations and automation ([Learn more](https://wpfitter.com/blog/advmo-bulk-offload-with-wp-cli?utm_source=wp-plugin&utm_medium=readme&utm_campaign=advanced-media-offloader&utm_content=bulk-offload-cli)) 42 44 * **Thumbnail Regeneration Compatibility** - Compatible with WP-CLI `wp media regenerate` command and the Regenerate Thumbnails plugin. Regenerated thumbnails automatically offload to cloud storage. Note: Not compatible with Full Cloud Migration retention policy. 43 45 * **Smart URL Rewriting** - All media URLs are automatically rewritten to serve from cloud storage … … 46 48 * **Mirror Deletion** - Optionally remove files from cloud storage when deleted from WordPress 47 49 * **Custom Paths** - Configure custom path prefixes in your cloud storage 48 * **Developer-Friendly** - Extensive action and filter hooks for extending functionality ([View Documentation](https://wpfitter.com/documents/advanced-media-offloader/development-hooks/)) 50 * **Image Optimizer Compatibility** - Works with [Modern Image Formats](https://wordpress.org/plugins/webp-uploads/) (recommended), Imagify, and EWWW Image Optimizer. Optimized WebP and AVIF files are automatically offloaded alongside originals. ([Learn more](https://wpfitter.com/blog/ewww-imagify-support-added-to-advanced-media-offloader/?utm_source=wp-plugin&utm_medium=readme&utm_campaign=advanced-media-offloader&utm_content=image-optimizer-compatibility)) 51 * **Developer-Friendly** - Extensive action and filter hooks for extending functionality ([View Documentation](https://wpfitter.com/documents/advanced-media-offloader/development-hooks/?utm_source=wp-plugin&utm_medium=readme&utm_campaign=advanced-media-offloader&utm_content=developer-hooks)) 49 52 50 53 = Developer Documentation = … … 52 55 For developers looking to extend or customize the plugin behavior, we provide comprehensive documentation for all available hooks: 53 56 54 **[View Developer Hooks Documentation →](https://wpfitter.com/documents/advanced-media-offloader/development-hooks/ )**57 **[View Developer Hooks Documentation →](https://wpfitter.com/documents/advanced-media-offloader/development-hooks/?utm_source=wp-plugin&utm_medium=readme&utm_campaign=advanced-media-offloader&utm_content=developer-hooks)** 55 58 56 59 Quick example - skip offloading files larger than 5MB: … … 197 200 198 201 == Changelog == 202 = 4.4.1 = 203 * Fixed: Custom/intermediate image sizes in src attribute being replaced with the full-size URL when using page builders like Elementor 204 199 205 = 4.4.0 = 200 206 * Added: Imagify compatibility for WebP/AVIF offloading … … 395 401 396 402 == Upgrade Notice == 403 = 4.4.1 = 404 Fixed custom image sizes being replaced with the full-size URL in page builder content. 405 397 406 = 4.4.0 = 398 407 New compatibility with Imagify and EWWW Image Optimizer for WebP/AVIF offloading. -
advanced-media-offloader/trunk/vendor/composer/installed.php
r3474384 r3479991 3 3 namespace WPFitter; 4 4 5 return array('root' => array('name' => '__root__', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => ' 647dd9b4677e11dffe0836889dc46b576adf7691', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \false), 'versions' => array('__root__' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '647dd9b4677e11dffe0836889dc46b576adf7691', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'aws/aws-crt-php' => array('pretty_version' => 'v1.2.7', 'version' => '1.2.7.0', 'reference' => 'd71d9906c7bb63a28295447ba12e74723bd3730e', 'type' => 'library', 'install_path' => __DIR__ . '/../aws/aws-crt-php', 'aliases' => array(), 'dev_requirement' => \false), 'aws/aws-sdk-php' => array('pretty_version' => '3.334.6', 'version' => '3.334.6.0', 'reference' => '2b0be3aded849d3b7bb0b53ea3295c7cecdeeee7', 'type' => 'library', 'install_path' => __DIR__ . '/../aws/aws-sdk-php', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/guzzle' => array('pretty_version' => '7.9.2', 'version' => '7.9.2.0', 'reference' => 'd281ed313b989f213357e3be1a179f02196ac99b', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/promises' => array('pretty_version' => '2.0.4', 'version' => '2.0.4.0', 'reference' => 'f9c436286ab2892c7db7be8c8da4ef61ccf7b455', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/promises', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/psr7' => array('pretty_version' => '2.7.0', 'version' => '2.7.0.0', 'reference' => 'a70f5c95fb43bc83f07c9c948baa0dc1829bf201', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), 'dev_requirement' => \false), 'mtdowling/jmespath.php' => array('pretty_version' => '2.8.0', 'version' => '2.8.0.0', 'reference' => 'a2a865e05d5f420b50cc2f85bb78d565db12a6bc', 'type' => 'library', 'install_path' => __DIR__ . '/../mtdowling/jmespath.php', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-client' => array('pretty_version' => '1.0.3', 'version' => '1.0.3.0', 'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-client', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-client-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/http-factory' => array('pretty_version' => '1.1.0', 'version' => '1.1.0.0', 'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-factory-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/http-message' => array('pretty_version' => '2.0', 'version' => '2.0.0.0', 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-message-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'ralouphie/getallheaders' => array('pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'type' => 'library', 'install_path' => __DIR__ . '/../ralouphie/getallheaders', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.5.1', 'version' => '3.5.1.0', 'reference' => '74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-mbstring' => array('pretty_version' => 'v1.31.0', 'version' => '1.31.0.0', 'reference' => '85181ba99b2345b0ef10ce42ecac37612d9fd341', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false)));5 return array('root' => array('name' => '__root__', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'd8937fefe8390552898cd8789ae3fc96b4ff2842', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \false), 'versions' => array('__root__' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'd8937fefe8390552898cd8789ae3fc96b4ff2842', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'aws/aws-crt-php' => array('pretty_version' => 'v1.2.7', 'version' => '1.2.7.0', 'reference' => 'd71d9906c7bb63a28295447ba12e74723bd3730e', 'type' => 'library', 'install_path' => __DIR__ . '/../aws/aws-crt-php', 'aliases' => array(), 'dev_requirement' => \false), 'aws/aws-sdk-php' => array('pretty_version' => '3.334.6', 'version' => '3.334.6.0', 'reference' => '2b0be3aded849d3b7bb0b53ea3295c7cecdeeee7', 'type' => 'library', 'install_path' => __DIR__ . '/../aws/aws-sdk-php', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/guzzle' => array('pretty_version' => '7.9.2', 'version' => '7.9.2.0', 'reference' => 'd281ed313b989f213357e3be1a179f02196ac99b', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/promises' => array('pretty_version' => '2.0.4', 'version' => '2.0.4.0', 'reference' => 'f9c436286ab2892c7db7be8c8da4ef61ccf7b455', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/promises', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/psr7' => array('pretty_version' => '2.7.0', 'version' => '2.7.0.0', 'reference' => 'a70f5c95fb43bc83f07c9c948baa0dc1829bf201', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), 'dev_requirement' => \false), 'mtdowling/jmespath.php' => array('pretty_version' => '2.8.0', 'version' => '2.8.0.0', 'reference' => 'a2a865e05d5f420b50cc2f85bb78d565db12a6bc', 'type' => 'library', 'install_path' => __DIR__ . '/../mtdowling/jmespath.php', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-client' => array('pretty_version' => '1.0.3', 'version' => '1.0.3.0', 'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-client', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-client-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/http-factory' => array('pretty_version' => '1.1.0', 'version' => '1.1.0.0', 'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-factory-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/http-message' => array('pretty_version' => '2.0', 'version' => '2.0.0.0', 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-message-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'ralouphie/getallheaders' => array('pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'type' => 'library', 'install_path' => __DIR__ . '/../ralouphie/getallheaders', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.5.1', 'version' => '3.5.1.0', 'reference' => '74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-mbstring' => array('pretty_version' => 'v1.31.0', 'version' => '1.31.0.0', 'reference' => '85181ba99b2345b0ef10ce42ecac37612d9fd341', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false)));
Note: See TracChangeset
for help on using the changeset viewer.