Changeset 3056306
- Timestamp:
- 03/21/2024 06:56:00 PM (2 years ago)
- Location:
- ilab-media-tools
- Files:
-
- 32 added
- 18 edited
- 1 copied
-
tags/4.6.0 (copied) (copied from ilab-media-tools/trunk)
-
tags/4.6.0/classes/Tools/Storage/Driver/BunnyCDN (added)
-
tags/4.6.0/classes/Tools/Storage/Driver/BunnyCDN/BunnyCDNClient.php (added)
-
tags/4.6.0/classes/Tools/Storage/Driver/BunnyCDN/BunnyCDNSettings.php (added)
-
tags/4.6.0/classes/Tools/Storage/Driver/BunnyCDN/BunnyCDNStorage.php (added)
-
tags/4.6.0/classes/Tools/Storage/StorageFile.php (modified) (1 diff)
-
tags/4.6.0/classes/Tools/Storage/StorageTool.php (modified) (3 diffs)
-
tags/4.6.0/classes/Tools/Video/Driver/Mux/MuxHooks.php (modified) (2 diffs)
-
tags/4.6.0/classes/Utilities/Wildcard.php (added)
-
tags/4.6.0/config/storage.config.php (modified) (4 diffs)
-
tags/4.6.0/config/storage/bunnycdn.config.php (added)
-
tags/4.6.0/config/wizard.config.php (modified) (2 diffs)
-
tags/4.6.0/ilab-media-tools.php (modified) (2 diffs)
-
tags/4.6.0/lib/mcloud-illuminate/support/Collection.php (modified) (6 diffs)
-
tags/4.6.0/lib/mcloud-illuminate/support/Traits/EnumeratesValues.php (modified) (1 diff)
-
tags/4.6.0/public/img/wizard-icon-bunnycdn.svg (added)
-
tags/4.6.0/readme.txt (modified) (2 diffs)
-
tags/4.6.0/views/wizard/cloud-storage/providers/bunnycdn (added)
-
tags/4.6.0/views/wizard/cloud-storage/providers/bunnycdn/description.blade.php (added)
-
tags/4.6.0/views/wizard/cloud-storage/providers/bunnycdn/form.blade.php (added)
-
tags/4.6.0/views/wizard/cloud-storage/providers/bunnycdn/intro.blade.php (added)
-
tags/4.6.0/views/wizard/cloud-storage/providers/bunnycdn/success.blade.php (added)
-
tags/4.6.0/views/wizard/cloud-storage/providers/bunnycdn/test.blade.php (added)
-
tags/4.6.0/views/wizard/cloud-storage/providers/bunnycdn/tutorial (added)
-
tags/4.6.0/views/wizard/cloud-storage/providers/bunnycdn/tutorial/step-1.blade.php (added)
-
tags/4.6.0/views/wizard/cloud-storage/providers/bunnycdn/tutorial/step-2.blade.php (added)
-
trunk/classes/Tools/Storage/Driver/BunnyCDN (added)
-
trunk/classes/Tools/Storage/Driver/BunnyCDN/BunnyCDNClient.php (added)
-
trunk/classes/Tools/Storage/Driver/BunnyCDN/BunnyCDNSettings.php (added)
-
trunk/classes/Tools/Storage/Driver/BunnyCDN/BunnyCDNStorage.php (added)
-
trunk/classes/Tools/Storage/StorageFile.php (modified) (1 diff)
-
trunk/classes/Tools/Storage/StorageTool.php (modified) (3 diffs)
-
trunk/classes/Tools/Video/Driver/Mux/MuxHooks.php (modified) (2 diffs)
-
trunk/classes/Utilities/Wildcard.php (added)
-
trunk/config/storage.config.php (modified) (4 diffs)
-
trunk/config/storage/bunnycdn.config.php (added)
-
trunk/config/wizard.config.php (modified) (2 diffs)
-
trunk/ilab-media-tools.php (modified) (2 diffs)
-
trunk/lib/mcloud-illuminate/support/Collection.php (modified) (6 diffs)
-
trunk/lib/mcloud-illuminate/support/Traits/EnumeratesValues.php (modified) (1 diff)
-
trunk/public/img/wizard-icon-bunnycdn.svg (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/views/wizard/cloud-storage/providers/bunnycdn (added)
-
trunk/views/wizard/cloud-storage/providers/bunnycdn/description.blade.php (added)
-
trunk/views/wizard/cloud-storage/providers/bunnycdn/form.blade.php (added)
-
trunk/views/wizard/cloud-storage/providers/bunnycdn/intro.blade.php (added)
-
trunk/views/wizard/cloud-storage/providers/bunnycdn/success.blade.php (added)
-
trunk/views/wizard/cloud-storage/providers/bunnycdn/test.blade.php (added)
-
trunk/views/wizard/cloud-storage/providers/bunnycdn/tutorial (added)
-
trunk/views/wizard/cloud-storage/providers/bunnycdn/tutorial/step-1.blade.php (added)
-
trunk/views/wizard/cloud-storage/providers/bunnycdn/tutorial/step-2.blade.php (added)
Legend:
- Unmodified
- Added
- Removed
-
ilab-media-tools/tags/4.6.0/classes/Tools/Storage/StorageFile.php
r2471780 r3056306 156 156 } 157 157 158 #[\ReturnTypeWillChange] 158 159 public function jsonSerialize() { 159 160 return [ -
ilab-media-tools/tags/4.6.0/classes/Tools/Storage/StorageTool.php
r3048361 r3056306 2492 2492 2493 2493 $webpKey = null; 2494 $extraFiles = []; 2495 $extraFormats = []; 2494 2496 $additionalPaths = apply_filters( 2495 2497 'as3cf_attachment_file_paths', … … 2505 2507 $webpBasename = basename( $webpPath ); 2506 2508 $webpKey = $prefix . $webpBasename; 2507 2508 if ( !$this->client->exists( $webpKey ) ) { 2509 Logger::info( 2510 "\tUploading {$filename} .webp version to S3", 2511 [], 2512 __METHOD__, 2513 __LINE__ 2514 ); 2515 $this->client->upload( 2516 $webpKey, 2517 $webpPath, 2518 $privacy, 2519 StorageToolSettings::cacheControl(), 2520 StorageToolSettings::expires(), 2521 'image/webp' 2522 ); 2523 $canDelete = apply_filters( 'media-cloud/storage/delete_uploads', true ); 2524 if ( !empty($canDelete) && StorageToolSettings::deleteOnUpload() ) { 2525 $this->deleteCache[] = $webpPath; 2526 } 2527 } 2528 2509 $extraFiles[] = [ 2510 'format' => 'webp', 2511 'path' => $webpPath, 2512 'key' => $webpKey, 2513 ]; 2514 // if (!$this->client->exists($webpKey)) { 2515 // Logger::info("\tUploading $filename .webp version to S3", [], __METHOD__, __LINE__); 2516 // $this->client->upload($webpKey, $webpPath, $privacy, StorageToolSettings::cacheControl(), StorageToolSettings::expires(), 'image/webp'); 2517 // $canDelete = apply_filters('media-cloud/storage/delete_uploads', true); 2518 // if (!empty($canDelete) && StorageToolSettings::deleteOnUpload()) { 2519 // $this->deleteCache[] = $webpPath; 2520 // } 2521 // } 2522 } 2523 2524 2525 if ( $uploadType === 'image' ) { 2526 Logger::info( "Testing for webp and avif for {$filename}" ); 2527 $parsed = pathinfo( $filename ); 2528 $webP = $parsed['dirname'] . '/' . $parsed['filename'] . '.webp'; 2529 $webPBase = $parsed['dirname'] . '/' . $parsed['basename'] . '.webp'; 2530 $avif = $parsed['dirname'] . '/' . $parsed['filename'] . '.avif'; 2531 $avifBase = $parsed['dirname'] . '/' . $parsed['basename'] . '.avif'; 2532 Logger::info( "Looking for " . $upload_path . '/' . $webP ); 2533 2534 if ( file_exists( $upload_path . '/' . $webP ) ) { 2535 Logger::info( "Found " . $upload_path . '/' . $webP ); 2536 $extraFiles[] = [ 2537 'format' => 'webp', 2538 'path' => $upload_path . '/' . $webP, 2539 'key' => $prefix . $parsed['filename'] . '.webp', 2540 ]; 2541 } 2542 2543 Logger::info( "Looking for " . $upload_path . '/' . $avif ); 2544 2545 if ( file_exists( $upload_path . '/' . $avif ) ) { 2546 Logger::info( "Found " . $upload_path . '/' . $avif ); 2547 $extraFiles[] = [ 2548 'format' => 'avif', 2549 'path' => $upload_path . '/' . $avif, 2550 'key' => $prefix . $parsed['filename'] . '.avif', 2551 ]; 2552 } 2553 2554 Logger::info( "Looking for " . $upload_path . '/' . $webPBase ); 2555 2556 if ( file_exists( $upload_path . '/' . $webPBase ) ) { 2557 Logger::info( "Found " . $upload_path . '/' . $webPBase ); 2558 $extraFiles[] = [ 2559 'format' => 'webp', 2560 'path' => $upload_path . '/' . $webPBase, 2561 'key' => $prefix . $parsed['basename'] . '.webp', 2562 ]; 2563 } 2564 2565 Logger::info( "Looking for " . $upload_path . '/' . $avifBase ); 2566 2567 if ( file_exists( $upload_path . '/' . $avifBase ) ) { 2568 Logger::info( "Found " . $upload_path . '/' . $avifBase ); 2569 $extraFiles[] = [ 2570 'format' => 'avif', 2571 'path' => $upload_path . '/' . $avifBase, 2572 'key' => $prefix . $parsed['basename'] . '.avif', 2573 ]; 2574 } 2575 2576 } 2577 2578 2579 if ( !empty($extraFiles) ) { 2580 Logger::info( "Found " . count( $extraFiles ) . ' extra files.' ); 2581 foreach ( $extraFiles as $extraFile ) { 2582 2583 if ( isset( $extraFormats[$extraFile['format']] ) ) { 2584 Logger::info( "Format exists already " . $extraFile['format'] ); 2585 continue; 2586 } 2587 2588 $extraKey = $extraFile['key']; 2589 $extraPath = $extraFile['path']; 2590 Logger::info( "Uploading {$extraKey} at {$extraPath}" ); 2591 2592 if ( !$this->client->exists( $extraKey ) ) { 2593 Logger::info( 2594 "\tUploading {$extraKey} version to S3", 2595 [], 2596 __METHOD__, 2597 __LINE__ 2598 ); 2599 $this->client->upload( 2600 $extraKey, 2601 $extraPath, 2602 $privacy, 2603 StorageToolSettings::cacheControl(), 2604 StorageToolSettings::expires(), 2605 'image/webp' 2606 ); 2607 $extraFormats[$extraFile['format']] = $extraKey; 2608 $canDelete = apply_filters( 'media-cloud/storage/delete_uploads', true ); 2609 if ( !empty($canDelete) && StorageToolSettings::deleteOnUpload() ) { 2610 $this->deleteCache[] = $extraPath; 2611 } 2612 } else { 2613 $extraFormats[$extraFile['format']] = $extraKey; 2614 Logger::info( "{$extraKey} already exists." ); 2615 } 2616 2617 } 2529 2618 } 2530 2619 … … 2549 2638 'optimized' => $didOptimize, 2550 2639 'options' => $options, 2551 'formats' => [],2640 'formats' => $extraFormats, 2552 2641 ]; 2553 if ( !empty($webpKey) ) { 2554 $data['s3']['formats']['webp'] = $webpKey; 2555 } 2642 Logger::info( "New data:" . json_encode( $extraFormats, JSON_PRETTY_PRINT ) ); 2643 // if (!empty($webpKey)) { 2644 // $data['s3']['formats']['webp'] = $webpKey; 2645 // } 2556 2646 2557 2647 if ( file_exists( $upload_path . '/' . $filename ) ) { -
ilab-media-tools/tags/4.6.0/classes/Tools/Video/Driver/Mux/MuxHooks.php
r2795243 r3056306 607 607 /** @var StorageTool $storageTool */ 608 608 $storageTool = ToolsManager::instance()->tools['storage']; 609 $url = $storageTool->client()->presignedUrl( $meta['s3']['key'], 30 ); 609 610 if ( isset( $meta['s3'] ) ) { 611 $url = $storageTool->client()->presignedUrl( $meta['s3']['key'], 30 ); 612 } else { 613 $otherMeta = wp_get_attachment_metadata( $attachmentId, true ); 614 Logger::info( "URL FOR IMPORT:" . json_encode( $otherMeta, JSON_PRETTY_PRINT ) ); 615 616 if ( isset( $otherMeta['s3'] ) ) { 617 $url = $storageTool->client()->presignedUrl( $otherMeta['s3']['key'], 30 ); 618 } else { 619 $url = wp_get_attachment_url( $attachmentId ); 620 } 621 622 } 623 624 Logger::info( "URL FOR IMPORT:" . $url ); 610 625 } else { 611 626 $url = wp_get_attachment_url( $attachmentId ); … … 614 629 $url = str_replace( home_url(), constant( 'MEDIACLOUD_VIDEO_SERVER' ), $url ); 615 630 } 631 Logger::info( "URL FOR IMPORT 2:" . $url ); 616 632 } 617 633 -
ilab-media-tools/tags/4.6.0/config/storage.config.php
r2972143 r3056306 97 97 ] 98 98 ], 99 'bunnycdn' => [ 100 'name' => 'Bunny CDN (beta)', 101 'class' => \MediaCloud\Plugin\Tools\Storage\Driver\BunnyCDN\BunnyCDNStorage::class, 102 'config' => '/storage/bunnycdn.config.php', 103 'help' => [ 104 [ 'title' => 'Sign Up For Bunny CDN Account', 'url' => 'https://bunny.net?ref=33lsyjqfr3' ], 105 [ 'title' => 'Setup Wizard', 'wizard' => 'bunnycdn' ], 106 [ 'title' => 'Read Documentation', 'url' => 'https://docs.mediacloud.press/articles/documentation/cloud-storage/setting-up-digitalocean-spaces' ], 107 ] 108 ], 99 109 'dreamhost' => [ 100 110 'name' => 'DreamHost Cloud Storage', … … 114 124 ] 115 125 ], 126 'other-s3' => [ 127 'name' => 'Other S3 Compatible Service', 128 'class' => "\\MediaCloud\\Plugin\\Tools\\Storage\\Driver\\S3\\OtherS3Storage", 129 'config' => '/storage/other-s3.config.php', 130 'help' => [ 131 [ 'title' => 'Setup Wizard', 'wizard' => 'other-s3' ], 132 ] 133 ], 134 'backblaze-s3' => [ 135 'name' => 'Backblaze S3 Compatible', 136 'class' => \MediaCloud\Plugin\Tools\Storage\Driver\S3\BackblazeS3Storage::class, 137 'config' => '/storage/backblaze-s3.config.php', 138 'help' => [ 139 [ 'title' => 'Setup Wizard', 'wizard' => 'backblaze-s3' ] 140 ] 141 ], 142 'supabase' => [ 143 'name' => 'Supabase Storage (Beta)', 144 'class' => \MediaCloud\Plugin\Tools\Storage\Driver\Supabase\SupabaseStorage::class, 145 'config' => '/storage/supabase.config.php', 146 'help' => [ 147 [ 'title' => 'Setup Wizard', 'wizard' => 'supabase' ], 148 [ 'title' => 'Read Documentation', 'url' => 'https://docs.mediacloud.press/articles/documentation/cloud-storage/setting-up-backblaze' ], 149 ] 150 ], 116 151 'wasabi' => [ 117 152 'name' => 'Wasabi (Deprecated)', … … 123 158 ] 124 159 ], 125 'other-s3' => [126 'name' => 'Other S3 Compatible Service',127 'class' => "\\MediaCloud\\Plugin\\Tools\\Storage\\Driver\\S3\\OtherS3Storage",128 'config' => '/storage/other-s3.config.php',129 'help' => [130 [ 'title' => 'Setup Wizard', 'wizard' => 'other-s3' ],131 ]132 ],133 'backblaze-s3' => [134 'name' => 'Backblaze S3 Compatible',135 'class' => \MediaCloud\Plugin\Tools\Storage\Driver\S3\BackblazeS3Storage::class,136 'config' => '/storage/backblaze-s3.config.php',137 'help' => [138 [ 'title' => 'Setup Wizard', 'wizard' => 'backblaze-s3' ]139 ]140 ],141 160 'backblaze' => [ 142 161 'name' => 'Backblaze (Deprecated)', … … 145 164 'help' => [ 146 165 [ 'title' => 'Setup Wizard', 'wizard' => 'backblaze' ], 147 [ 'title' => 'Read Documentation', 'url' => 'https://docs.mediacloud.press/articles/documentation/cloud-storage/setting-up-backblaze' ],148 ]149 ],150 'supabase' => [151 'name' => 'Supabase Storage (Beta)',152 'class' => \MediaCloud\Plugin\Tools\Storage\Driver\Supabase\SupabaseStorage::class,153 'config' => '/storage/supabase.config.php',154 'help' => [155 [ 'title' => 'Setup Wizard', 'wizard' => 'supabase' ],156 166 [ 'title' => 'Read Documentation', 'url' => 'https://docs.mediacloud.press/articles/documentation/cloud-storage/setting-up-backblaze' ], 157 167 ] -
ilab-media-tools/tags/4.6.0/config/wizard.config.php
r2972143 r3056306 27 27 ->option('google', 'Google Cloud Storage', 'wizard.cloud-storage.providers.google.description', 'wizard-icon-google.svg', 'cloud-storage-google') 28 28 ->option('cloudflare', 'Cloudflare R2', 'wizard.cloud-storage.providers.cloudflare.description', 'wizard-icon-cloudflare.svg', 'cloud-storage-cloudflare') 29 ->option('bunnycdn', 'Bunny CDN', 'wizard.cloud-storage.providers.bunnycdn.description', 'wizard-icon-bunnycdn.svg', 'cloud-storage-bunnycdn') 29 30 ->option('do', 'DigitalOcean Spaces', 'wizard.cloud-storage.providers.do.description', 'wizard-icon-do.svg', 'cloud-storage-do') 30 31 ->option('dreamhost', 'DreamHost Cloud Storage', 'wizard.cloud-storage.providers.dreamhost.description', 'wizard-icon-dreamhost.svg', 'cloud-storage-dreamhost') 31 32 // ->option('wasabi', 'Wasabi', 'wizard.cloud-storage.providers.wasabi.description', 'wizard-icon-wasabi.png', 'cloud-storage-wasabi') 32 ->option('backblaze-s3', 'Backblaze', 'wizard.cloud-storage.providers.backblaze.description', 'wizard-icon-backblaze.svg', 'cloud-storage-backblaze-s3')33 33 ->option('minio', 'Minio', 'wizard.cloud-storage.providers.minio.description', 'wizard-icon-minio.png', 'cloud-storage-minio') 34 34 ->option('other-s3', 'S3 Compatible', 'wizard.cloud-storage.providers.other-s3.description', 'wizard-icon-other-s3.svg', 'cloud-storage-other-s3') 35 ->option('backblaze-s3', 'Backblaze', 'wizard.cloud-storage.providers.backblaze.description', 'wizard-icon-backblaze.svg', 'cloud-storage-backblaze-s3') 35 36 ->endGroup() 36 37 ->endStep() … … 48 49 \MediaCloud\Plugin\Tools\Storage\Driver\S3\MinioStorage::configureWizard($builder); 49 50 \MediaCloud\Plugin\Tools\Storage\Driver\S3\BackblazeS3Storage::configureWizard($builder); 50 51 \MediaCloud\Plugin\Tools\Storage\Driver\BunnyCDN\BunnyCDNStorage::configureWizard($builder); 51 52 return $builder->build(); 52 53 -
ilab-media-tools/tags/4.6.0/ilab-media-tools.php
r3048361 r3056306 6 6 Description: Automatically upload media to Amazon S3 and integrate with Imgix, a real-time image processing CDN. Boosts site performance and simplifies workflows. 7 7 Author: interfacelab 8 Version: 4. 5.258 Version: 4.6.0 9 9 Requires PHP: 7.4 10 10 Author URI: http://interfacelab.io … … 118 118 } 119 119 // Version Defines 120 define( 'MEDIA_CLOUD_VERSION', '4. 5.25' );120 define( 'MEDIA_CLOUD_VERSION', '4.6.0' ); 121 121 define( 'MEDIA_CLOUD_INFO_VERSION', '4.0.2' ); 122 122 define( 'MCLOUD_IS_BETA', false ); -
ilab-media-tools/tags/4.6.0/lib/mcloud-illuminate/support/Collection.php
r2684586 r3056306 1292 1292 * @return \ArrayIterator 1293 1293 */ 1294 #[\ReturnTypeWillChange] 1294 1295 public function getIterator() 1295 1296 { … … 1302 1303 * @return int 1303 1304 */ 1305 #[\ReturnTypeWillChange] 1304 1306 public function count() 1305 1307 { … … 1347 1349 * @return bool 1348 1350 */ 1349 public function offsetExists($key) 1351 #[\ReturnTypeWillChange] 1352 public function offsetExists($key) 1350 1353 { 1351 1354 return array_key_exists($key, $this->items); … … 1358 1361 * @return mixed 1359 1362 */ 1363 #[\ReturnTypeWillChange] 1360 1364 public function offsetGet($key) 1361 1365 { … … 1370 1374 * @return void 1371 1375 */ 1372 public function offsetSet($key, $value) 1376 #[\ReturnTypeWillChange] 1377 public function offsetSet($key, $value) 1373 1378 { 1374 1379 if (is_null($key)) { … … 1385 1390 * @return void 1386 1391 */ 1387 public function offsetUnset($key) 1392 #[\ReturnTypeWillChange] 1393 public function offsetUnset($key) 1388 1394 { 1389 1395 unset($this->items[$key]); -
ilab-media-tools/tags/4.6.0/lib/mcloud-illuminate/support/Traits/EnumeratesValues.php
r2686317 r3056306 766 766 * @return array 767 767 */ 768 public function jsonSerialize() 768 #[\ReturnTypeWillChange] 769 public function jsonSerialize() 769 770 { 770 771 return array_map(function ($value) { -
ilab-media-tools/tags/4.6.0/readme.txt
r3048361 r3056306 1 === Media Cloud for Amazon S3, Cloudflare R2, Google Cloud Storage, DigitalOcean Spacesand more ===1 === Media Cloud for Bunny CDN, Amazon S3, Cloudflare R2, Google Cloud Storage, DigitalOcean and more === 2 2 Contributors: mediacloud, interfacelab, freemius 3 Tags: offload, amazon, s3, cloudflare, imgix, uploads, video, video encoding, google cloud storage, digital ocean spaces, wasabi, media, cdn, rekognition, cloudfront, images, crop, image editing, image editor, optimize, image optimization, media library, offload, offload s3, smush, imagify, shortpixel3 Tags: offload, amazon, s3, cloudflare, bunnycdn, imgix, uploads, video, video encoding, google cloud storage, digital ocean spaces, wasabi, media, cdn, rekognition, cloudfront, images, crop, image editing, image editor, optimize, image optimization, media library, offload, offload s3, smush, imagify, shortpixel 4 4 Requires at least: 4.9 5 Tested up to: 6. 4.25 Tested up to: 6.5 6 6 License: GPLv3 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-3.0.html 8 Stable tag: 4. 5.258 Stable tag: 4.6.0 9 9 Requires PHP: 7.4 10 10 … … 105 105 106 106 == Changelog == 107 108 = 4.6.0 - 03/212024 = 109 110 * Migrating media now migrates .webp and .avif files regardless of what plugin generated them. 111 * Added beta support for Bunny CDN as a storage provider. 112 * Note that Bunny CDN doesn't support ACLs so it can't do signed URLs like other cloud storage providers, so it is not suitable for WooCommerce, EDD or anything else where you want to protect individual files. 113 * You can protect directories though and any files in a specified directory will be signed. This is probably a moving target feature wise. 114 * Also note that this works differently then Bunny's WordPress plugin. Bunny's plugin works via pull where Media Cloud is push (it uploads your media to Bunny CDN). Which way is better is up to you to decide, though you can't use Bunny's plugin in a dev environment or on a localhost during dev. 115 * Documentation is non existent at the moment but that will be remedied later next week. 116 * Fixed Migrate to Mux task. 117 * Fixes for some PHP 8.2 errors and notices. 118 119 120 = 4.5.27 - 03/13/2024 = 121 122 * Fix for assets tool where bucket name appears in URL. 123 * PUSH Asset mode deprecated. PUSH mode was meant for edge cases and PULL mode is superior in every way. Will display warning 124 if you have it enabled in PUSH mode. 125 126 127 = 4.5.26 - 03/10/2024 = 128 129 * Fix for assets tool. 107 130 108 131 = 4.5.25 - 03/10/2024 = -
ilab-media-tools/trunk/classes/Tools/Storage/StorageFile.php
r2471780 r3056306 156 156 } 157 157 158 #[\ReturnTypeWillChange] 158 159 public function jsonSerialize() { 159 160 return [ -
ilab-media-tools/trunk/classes/Tools/Storage/StorageTool.php
r3048361 r3056306 2492 2492 2493 2493 $webpKey = null; 2494 $extraFiles = []; 2495 $extraFormats = []; 2494 2496 $additionalPaths = apply_filters( 2495 2497 'as3cf_attachment_file_paths', … … 2505 2507 $webpBasename = basename( $webpPath ); 2506 2508 $webpKey = $prefix . $webpBasename; 2507 2508 if ( !$this->client->exists( $webpKey ) ) { 2509 Logger::info( 2510 "\tUploading {$filename} .webp version to S3", 2511 [], 2512 __METHOD__, 2513 __LINE__ 2514 ); 2515 $this->client->upload( 2516 $webpKey, 2517 $webpPath, 2518 $privacy, 2519 StorageToolSettings::cacheControl(), 2520 StorageToolSettings::expires(), 2521 'image/webp' 2522 ); 2523 $canDelete = apply_filters( 'media-cloud/storage/delete_uploads', true ); 2524 if ( !empty($canDelete) && StorageToolSettings::deleteOnUpload() ) { 2525 $this->deleteCache[] = $webpPath; 2526 } 2527 } 2528 2509 $extraFiles[] = [ 2510 'format' => 'webp', 2511 'path' => $webpPath, 2512 'key' => $webpKey, 2513 ]; 2514 // if (!$this->client->exists($webpKey)) { 2515 // Logger::info("\tUploading $filename .webp version to S3", [], __METHOD__, __LINE__); 2516 // $this->client->upload($webpKey, $webpPath, $privacy, StorageToolSettings::cacheControl(), StorageToolSettings::expires(), 'image/webp'); 2517 // $canDelete = apply_filters('media-cloud/storage/delete_uploads', true); 2518 // if (!empty($canDelete) && StorageToolSettings::deleteOnUpload()) { 2519 // $this->deleteCache[] = $webpPath; 2520 // } 2521 // } 2522 } 2523 2524 2525 if ( $uploadType === 'image' ) { 2526 Logger::info( "Testing for webp and avif for {$filename}" ); 2527 $parsed = pathinfo( $filename ); 2528 $webP = $parsed['dirname'] . '/' . $parsed['filename'] . '.webp'; 2529 $webPBase = $parsed['dirname'] . '/' . $parsed['basename'] . '.webp'; 2530 $avif = $parsed['dirname'] . '/' . $parsed['filename'] . '.avif'; 2531 $avifBase = $parsed['dirname'] . '/' . $parsed['basename'] . '.avif'; 2532 Logger::info( "Looking for " . $upload_path . '/' . $webP ); 2533 2534 if ( file_exists( $upload_path . '/' . $webP ) ) { 2535 Logger::info( "Found " . $upload_path . '/' . $webP ); 2536 $extraFiles[] = [ 2537 'format' => 'webp', 2538 'path' => $upload_path . '/' . $webP, 2539 'key' => $prefix . $parsed['filename'] . '.webp', 2540 ]; 2541 } 2542 2543 Logger::info( "Looking for " . $upload_path . '/' . $avif ); 2544 2545 if ( file_exists( $upload_path . '/' . $avif ) ) { 2546 Logger::info( "Found " . $upload_path . '/' . $avif ); 2547 $extraFiles[] = [ 2548 'format' => 'avif', 2549 'path' => $upload_path . '/' . $avif, 2550 'key' => $prefix . $parsed['filename'] . '.avif', 2551 ]; 2552 } 2553 2554 Logger::info( "Looking for " . $upload_path . '/' . $webPBase ); 2555 2556 if ( file_exists( $upload_path . '/' . $webPBase ) ) { 2557 Logger::info( "Found " . $upload_path . '/' . $webPBase ); 2558 $extraFiles[] = [ 2559 'format' => 'webp', 2560 'path' => $upload_path . '/' . $webPBase, 2561 'key' => $prefix . $parsed['basename'] . '.webp', 2562 ]; 2563 } 2564 2565 Logger::info( "Looking for " . $upload_path . '/' . $avifBase ); 2566 2567 if ( file_exists( $upload_path . '/' . $avifBase ) ) { 2568 Logger::info( "Found " . $upload_path . '/' . $avifBase ); 2569 $extraFiles[] = [ 2570 'format' => 'avif', 2571 'path' => $upload_path . '/' . $avifBase, 2572 'key' => $prefix . $parsed['basename'] . '.avif', 2573 ]; 2574 } 2575 2576 } 2577 2578 2579 if ( !empty($extraFiles) ) { 2580 Logger::info( "Found " . count( $extraFiles ) . ' extra files.' ); 2581 foreach ( $extraFiles as $extraFile ) { 2582 2583 if ( isset( $extraFormats[$extraFile['format']] ) ) { 2584 Logger::info( "Format exists already " . $extraFile['format'] ); 2585 continue; 2586 } 2587 2588 $extraKey = $extraFile['key']; 2589 $extraPath = $extraFile['path']; 2590 Logger::info( "Uploading {$extraKey} at {$extraPath}" ); 2591 2592 if ( !$this->client->exists( $extraKey ) ) { 2593 Logger::info( 2594 "\tUploading {$extraKey} version to S3", 2595 [], 2596 __METHOD__, 2597 __LINE__ 2598 ); 2599 $this->client->upload( 2600 $extraKey, 2601 $extraPath, 2602 $privacy, 2603 StorageToolSettings::cacheControl(), 2604 StorageToolSettings::expires(), 2605 'image/webp' 2606 ); 2607 $extraFormats[$extraFile['format']] = $extraKey; 2608 $canDelete = apply_filters( 'media-cloud/storage/delete_uploads', true ); 2609 if ( !empty($canDelete) && StorageToolSettings::deleteOnUpload() ) { 2610 $this->deleteCache[] = $extraPath; 2611 } 2612 } else { 2613 $extraFormats[$extraFile['format']] = $extraKey; 2614 Logger::info( "{$extraKey} already exists." ); 2615 } 2616 2617 } 2529 2618 } 2530 2619 … … 2549 2638 'optimized' => $didOptimize, 2550 2639 'options' => $options, 2551 'formats' => [],2640 'formats' => $extraFormats, 2552 2641 ]; 2553 if ( !empty($webpKey) ) { 2554 $data['s3']['formats']['webp'] = $webpKey; 2555 } 2642 Logger::info( "New data:" . json_encode( $extraFormats, JSON_PRETTY_PRINT ) ); 2643 // if (!empty($webpKey)) { 2644 // $data['s3']['formats']['webp'] = $webpKey; 2645 // } 2556 2646 2557 2647 if ( file_exists( $upload_path . '/' . $filename ) ) { -
ilab-media-tools/trunk/classes/Tools/Video/Driver/Mux/MuxHooks.php
r2795243 r3056306 607 607 /** @var StorageTool $storageTool */ 608 608 $storageTool = ToolsManager::instance()->tools['storage']; 609 $url = $storageTool->client()->presignedUrl( $meta['s3']['key'], 30 ); 609 610 if ( isset( $meta['s3'] ) ) { 611 $url = $storageTool->client()->presignedUrl( $meta['s3']['key'], 30 ); 612 } else { 613 $otherMeta = wp_get_attachment_metadata( $attachmentId, true ); 614 Logger::info( "URL FOR IMPORT:" . json_encode( $otherMeta, JSON_PRETTY_PRINT ) ); 615 616 if ( isset( $otherMeta['s3'] ) ) { 617 $url = $storageTool->client()->presignedUrl( $otherMeta['s3']['key'], 30 ); 618 } else { 619 $url = wp_get_attachment_url( $attachmentId ); 620 } 621 622 } 623 624 Logger::info( "URL FOR IMPORT:" . $url ); 610 625 } else { 611 626 $url = wp_get_attachment_url( $attachmentId ); … … 614 629 $url = str_replace( home_url(), constant( 'MEDIACLOUD_VIDEO_SERVER' ), $url ); 615 630 } 631 Logger::info( "URL FOR IMPORT 2:" . $url ); 616 632 } 617 633 -
ilab-media-tools/trunk/config/storage.config.php
r2972143 r3056306 97 97 ] 98 98 ], 99 'bunnycdn' => [ 100 'name' => 'Bunny CDN (beta)', 101 'class' => \MediaCloud\Plugin\Tools\Storage\Driver\BunnyCDN\BunnyCDNStorage::class, 102 'config' => '/storage/bunnycdn.config.php', 103 'help' => [ 104 [ 'title' => 'Sign Up For Bunny CDN Account', 'url' => 'https://bunny.net?ref=33lsyjqfr3' ], 105 [ 'title' => 'Setup Wizard', 'wizard' => 'bunnycdn' ], 106 [ 'title' => 'Read Documentation', 'url' => 'https://docs.mediacloud.press/articles/documentation/cloud-storage/setting-up-digitalocean-spaces' ], 107 ] 108 ], 99 109 'dreamhost' => [ 100 110 'name' => 'DreamHost Cloud Storage', … … 114 124 ] 115 125 ], 126 'other-s3' => [ 127 'name' => 'Other S3 Compatible Service', 128 'class' => "\\MediaCloud\\Plugin\\Tools\\Storage\\Driver\\S3\\OtherS3Storage", 129 'config' => '/storage/other-s3.config.php', 130 'help' => [ 131 [ 'title' => 'Setup Wizard', 'wizard' => 'other-s3' ], 132 ] 133 ], 134 'backblaze-s3' => [ 135 'name' => 'Backblaze S3 Compatible', 136 'class' => \MediaCloud\Plugin\Tools\Storage\Driver\S3\BackblazeS3Storage::class, 137 'config' => '/storage/backblaze-s3.config.php', 138 'help' => [ 139 [ 'title' => 'Setup Wizard', 'wizard' => 'backblaze-s3' ] 140 ] 141 ], 142 'supabase' => [ 143 'name' => 'Supabase Storage (Beta)', 144 'class' => \MediaCloud\Plugin\Tools\Storage\Driver\Supabase\SupabaseStorage::class, 145 'config' => '/storage/supabase.config.php', 146 'help' => [ 147 [ 'title' => 'Setup Wizard', 'wizard' => 'supabase' ], 148 [ 'title' => 'Read Documentation', 'url' => 'https://docs.mediacloud.press/articles/documentation/cloud-storage/setting-up-backblaze' ], 149 ] 150 ], 116 151 'wasabi' => [ 117 152 'name' => 'Wasabi (Deprecated)', … … 123 158 ] 124 159 ], 125 'other-s3' => [126 'name' => 'Other S3 Compatible Service',127 'class' => "\\MediaCloud\\Plugin\\Tools\\Storage\\Driver\\S3\\OtherS3Storage",128 'config' => '/storage/other-s3.config.php',129 'help' => [130 [ 'title' => 'Setup Wizard', 'wizard' => 'other-s3' ],131 ]132 ],133 'backblaze-s3' => [134 'name' => 'Backblaze S3 Compatible',135 'class' => \MediaCloud\Plugin\Tools\Storage\Driver\S3\BackblazeS3Storage::class,136 'config' => '/storage/backblaze-s3.config.php',137 'help' => [138 [ 'title' => 'Setup Wizard', 'wizard' => 'backblaze-s3' ]139 ]140 ],141 160 'backblaze' => [ 142 161 'name' => 'Backblaze (Deprecated)', … … 145 164 'help' => [ 146 165 [ 'title' => 'Setup Wizard', 'wizard' => 'backblaze' ], 147 [ 'title' => 'Read Documentation', 'url' => 'https://docs.mediacloud.press/articles/documentation/cloud-storage/setting-up-backblaze' ],148 ]149 ],150 'supabase' => [151 'name' => 'Supabase Storage (Beta)',152 'class' => \MediaCloud\Plugin\Tools\Storage\Driver\Supabase\SupabaseStorage::class,153 'config' => '/storage/supabase.config.php',154 'help' => [155 [ 'title' => 'Setup Wizard', 'wizard' => 'supabase' ],156 166 [ 'title' => 'Read Documentation', 'url' => 'https://docs.mediacloud.press/articles/documentation/cloud-storage/setting-up-backblaze' ], 157 167 ] -
ilab-media-tools/trunk/config/wizard.config.php
r2972143 r3056306 27 27 ->option('google', 'Google Cloud Storage', 'wizard.cloud-storage.providers.google.description', 'wizard-icon-google.svg', 'cloud-storage-google') 28 28 ->option('cloudflare', 'Cloudflare R2', 'wizard.cloud-storage.providers.cloudflare.description', 'wizard-icon-cloudflare.svg', 'cloud-storage-cloudflare') 29 ->option('bunnycdn', 'Bunny CDN', 'wizard.cloud-storage.providers.bunnycdn.description', 'wizard-icon-bunnycdn.svg', 'cloud-storage-bunnycdn') 29 30 ->option('do', 'DigitalOcean Spaces', 'wizard.cloud-storage.providers.do.description', 'wizard-icon-do.svg', 'cloud-storage-do') 30 31 ->option('dreamhost', 'DreamHost Cloud Storage', 'wizard.cloud-storage.providers.dreamhost.description', 'wizard-icon-dreamhost.svg', 'cloud-storage-dreamhost') 31 32 // ->option('wasabi', 'Wasabi', 'wizard.cloud-storage.providers.wasabi.description', 'wizard-icon-wasabi.png', 'cloud-storage-wasabi') 32 ->option('backblaze-s3', 'Backblaze', 'wizard.cloud-storage.providers.backblaze.description', 'wizard-icon-backblaze.svg', 'cloud-storage-backblaze-s3')33 33 ->option('minio', 'Minio', 'wizard.cloud-storage.providers.minio.description', 'wizard-icon-minio.png', 'cloud-storage-minio') 34 34 ->option('other-s3', 'S3 Compatible', 'wizard.cloud-storage.providers.other-s3.description', 'wizard-icon-other-s3.svg', 'cloud-storage-other-s3') 35 ->option('backblaze-s3', 'Backblaze', 'wizard.cloud-storage.providers.backblaze.description', 'wizard-icon-backblaze.svg', 'cloud-storage-backblaze-s3') 35 36 ->endGroup() 36 37 ->endStep() … … 48 49 \MediaCloud\Plugin\Tools\Storage\Driver\S3\MinioStorage::configureWizard($builder); 49 50 \MediaCloud\Plugin\Tools\Storage\Driver\S3\BackblazeS3Storage::configureWizard($builder); 50 51 \MediaCloud\Plugin\Tools\Storage\Driver\BunnyCDN\BunnyCDNStorage::configureWizard($builder); 51 52 return $builder->build(); 52 53 -
ilab-media-tools/trunk/ilab-media-tools.php
r3048361 r3056306 6 6 Description: Automatically upload media to Amazon S3 and integrate with Imgix, a real-time image processing CDN. Boosts site performance and simplifies workflows. 7 7 Author: interfacelab 8 Version: 4. 5.258 Version: 4.6.0 9 9 Requires PHP: 7.4 10 10 Author URI: http://interfacelab.io … … 118 118 } 119 119 // Version Defines 120 define( 'MEDIA_CLOUD_VERSION', '4. 5.25' );120 define( 'MEDIA_CLOUD_VERSION', '4.6.0' ); 121 121 define( 'MEDIA_CLOUD_INFO_VERSION', '4.0.2' ); 122 122 define( 'MCLOUD_IS_BETA', false ); -
ilab-media-tools/trunk/lib/mcloud-illuminate/support/Collection.php
r2684586 r3056306 1292 1292 * @return \ArrayIterator 1293 1293 */ 1294 #[\ReturnTypeWillChange] 1294 1295 public function getIterator() 1295 1296 { … … 1302 1303 * @return int 1303 1304 */ 1305 #[\ReturnTypeWillChange] 1304 1306 public function count() 1305 1307 { … … 1347 1349 * @return bool 1348 1350 */ 1349 public function offsetExists($key) 1351 #[\ReturnTypeWillChange] 1352 public function offsetExists($key) 1350 1353 { 1351 1354 return array_key_exists($key, $this->items); … … 1358 1361 * @return mixed 1359 1362 */ 1363 #[\ReturnTypeWillChange] 1360 1364 public function offsetGet($key) 1361 1365 { … … 1370 1374 * @return void 1371 1375 */ 1372 public function offsetSet($key, $value) 1376 #[\ReturnTypeWillChange] 1377 public function offsetSet($key, $value) 1373 1378 { 1374 1379 if (is_null($key)) { … … 1385 1390 * @return void 1386 1391 */ 1387 public function offsetUnset($key) 1392 #[\ReturnTypeWillChange] 1393 public function offsetUnset($key) 1388 1394 { 1389 1395 unset($this->items[$key]); -
ilab-media-tools/trunk/lib/mcloud-illuminate/support/Traits/EnumeratesValues.php
r2686317 r3056306 766 766 * @return array 767 767 */ 768 public function jsonSerialize() 768 #[\ReturnTypeWillChange] 769 public function jsonSerialize() 769 770 { 770 771 return array_map(function ($value) { -
ilab-media-tools/trunk/readme.txt
r3048361 r3056306 1 === Media Cloud for Amazon S3, Cloudflare R2, Google Cloud Storage, DigitalOcean Spacesand more ===1 === Media Cloud for Bunny CDN, Amazon S3, Cloudflare R2, Google Cloud Storage, DigitalOcean and more === 2 2 Contributors: mediacloud, interfacelab, freemius 3 Tags: offload, amazon, s3, cloudflare, imgix, uploads, video, video encoding, google cloud storage, digital ocean spaces, wasabi, media, cdn, rekognition, cloudfront, images, crop, image editing, image editor, optimize, image optimization, media library, offload, offload s3, smush, imagify, shortpixel3 Tags: offload, amazon, s3, cloudflare, bunnycdn, imgix, uploads, video, video encoding, google cloud storage, digital ocean spaces, wasabi, media, cdn, rekognition, cloudfront, images, crop, image editing, image editor, optimize, image optimization, media library, offload, offload s3, smush, imagify, shortpixel 4 4 Requires at least: 4.9 5 Tested up to: 6. 4.25 Tested up to: 6.5 6 6 License: GPLv3 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-3.0.html 8 Stable tag: 4. 5.258 Stable tag: 4.6.0 9 9 Requires PHP: 7.4 10 10 … … 105 105 106 106 == Changelog == 107 108 = 4.6.0 - 03/212024 = 109 110 * Migrating media now migrates .webp and .avif files regardless of what plugin generated them. 111 * Added beta support for Bunny CDN as a storage provider. 112 * Note that Bunny CDN doesn't support ACLs so it can't do signed URLs like other cloud storage providers, so it is not suitable for WooCommerce, EDD or anything else where you want to protect individual files. 113 * You can protect directories though and any files in a specified directory will be signed. This is probably a moving target feature wise. 114 * Also note that this works differently then Bunny's WordPress plugin. Bunny's plugin works via pull where Media Cloud is push (it uploads your media to Bunny CDN). Which way is better is up to you to decide, though you can't use Bunny's plugin in a dev environment or on a localhost during dev. 115 * Documentation is non existent at the moment but that will be remedied later next week. 116 * Fixed Migrate to Mux task. 117 * Fixes for some PHP 8.2 errors and notices. 118 119 120 = 4.5.27 - 03/13/2024 = 121 122 * Fix for assets tool where bucket name appears in URL. 123 * PUSH Asset mode deprecated. PUSH mode was meant for edge cases and PULL mode is superior in every way. Will display warning 124 if you have it enabled in PUSH mode. 125 126 127 = 4.5.26 - 03/10/2024 = 128 129 * Fix for assets tool. 107 130 108 131 = 4.5.25 - 03/10/2024 =
Note: See TracChangeset
for help on using the changeset viewer.