Plugin Directory

Changeset 3056306


Ignore:
Timestamp:
03/21/2024 06:56:00 PM (2 years ago)
Author:
interfacelab
Message:

Update to version 4.6.0 from GitHub

Location:
ilab-media-tools
Files:
32 added
18 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ilab-media-tools/tags/4.6.0/classes/Tools/Storage/StorageFile.php

    r2471780 r3056306  
    156156    }
    157157
     158    #[\ReturnTypeWillChange]
    158159    public function jsonSerialize() {
    159160        return [
  • ilab-media-tools/tags/4.6.0/classes/Tools/Storage/StorageTool.php

    r3048361 r3056306  
    24922492           
    24932493            $webpKey = null;
     2494            $extraFiles = [];
     2495            $extraFormats = [];
    24942496            $additionalPaths = apply_filters(
    24952497                'as3cf_attachment_file_paths',
     
    25052507                $webpBasename = basename( $webpPath );
    25062508                $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                }
    25292618            }
    25302619           
     
    25492638                'optimized' => $didOptimize,
    25502639                'options'   => $options,
    2551                 'formats'   => [],
     2640                'formats'   => $extraFormats,
    25522641            ];
    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            //            }
    25562646           
    25572647            if ( file_exists( $upload_path . '/' . $filename ) ) {
  • ilab-media-tools/tags/4.6.0/classes/Tools/Video/Driver/Mux/MuxHooks.php

    r2795243 r3056306  
    607607            /** @var StorageTool $storageTool */
    608608            $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 );
    610625        } else {
    611626            $url = wp_get_attachment_url( $attachmentId );
     
    614629                $url = str_replace( home_url(), constant( 'MEDIACLOUD_VIDEO_SERVER' ), $url );
    615630            }
     631            Logger::info( "URL FOR IMPORT 2:" . $url );
    616632        }
    617633       
  • ilab-media-tools/tags/4.6.0/config/storage.config.php

    r2972143 r3056306  
    9797            ]
    9898        ],
     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        ],
    99109        'dreamhost' => [
    100110            'name' => 'DreamHost Cloud Storage',
     
    114124            ]
    115125        ],
     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        ],
    116151        'wasabi' => [
    117152            'name' => 'Wasabi (Deprecated)',
     
    123158            ]
    124159        ],
    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         ],
    141160        'backblaze' => [
    142161            'name' => 'Backblaze (Deprecated)',
     
    145164            'help' => [
    146165                [ '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' ],
    156166                [ 'title' => 'Read Documentation', 'url' => 'https://docs.mediacloud.press/articles/documentation/cloud-storage/setting-up-backblaze' ],
    157167            ]
  • ilab-media-tools/tags/4.6.0/config/wizard.config.php

    r2972143 r3056306  
    2727                ->option('google', 'Google Cloud Storage', 'wizard.cloud-storage.providers.google.description', 'wizard-icon-google.svg', 'cloud-storage-google')
    2828                ->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')
    2930                ->option('do', 'DigitalOcean Spaces', 'wizard.cloud-storage.providers.do.description', 'wizard-icon-do.svg', 'cloud-storage-do')
    3031                ->option('dreamhost', 'DreamHost Cloud Storage', 'wizard.cloud-storage.providers.dreamhost.description', 'wizard-icon-dreamhost.svg', 'cloud-storage-dreamhost')
    3132//              ->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')
    3333                ->option('minio', 'Minio', 'wizard.cloud-storage.providers.minio.description', 'wizard-icon-minio.png', 'cloud-storage-minio')
    3434                ->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')
    3536            ->endGroup()
    3637        ->endStep()
     
    4849\MediaCloud\Plugin\Tools\Storage\Driver\S3\MinioStorage::configureWizard($builder);
    4950\MediaCloud\Plugin\Tools\Storage\Driver\S3\BackblazeS3Storage::configureWizard($builder);
    50 
     51\MediaCloud\Plugin\Tools\Storage\Driver\BunnyCDN\BunnyCDNStorage::configureWizard($builder);
    5152return $builder->build();
    5253
  • ilab-media-tools/tags/4.6.0/ilab-media-tools.php

    r3048361 r3056306  
    66Description: Automatically upload media to Amazon S3 and integrate with Imgix, a real-time image processing CDN.  Boosts site performance and simplifies workflows.
    77Author: interfacelab
    8 Version: 4.5.25
     8Version: 4.6.0
    99Requires PHP: 7.4
    1010Author URI: http://interfacelab.io
     
    118118}
    119119// Version Defines
    120 define( 'MEDIA_CLOUD_VERSION', '4.5.25' );
     120define( 'MEDIA_CLOUD_VERSION', '4.6.0' );
    121121define( 'MEDIA_CLOUD_INFO_VERSION', '4.0.2' );
    122122define( 'MCLOUD_IS_BETA', false );
  • ilab-media-tools/tags/4.6.0/lib/mcloud-illuminate/support/Collection.php

    r2684586 r3056306  
    12921292     * @return \ArrayIterator
    12931293     */
     1294    #[\ReturnTypeWillChange]
    12941295    public function getIterator()
    12951296    {
     
    13021303     * @return int
    13031304     */
     1305    #[\ReturnTypeWillChange]
    13041306    public function count()
    13051307    {
     
    13471349     * @return bool
    13481350     */
    1349     public function offsetExists($key)
     1351    #[\ReturnTypeWillChange]
     1352    public function offsetExists($key)
    13501353    {
    13511354        return array_key_exists($key, $this->items);
     
    13581361     * @return mixed
    13591362     */
     1363    #[\ReturnTypeWillChange]
    13601364    public function offsetGet($key)
    13611365    {
     
    13701374     * @return void
    13711375     */
    1372     public function offsetSet($key, $value)
     1376    #[\ReturnTypeWillChange]
     1377    public function offsetSet($key, $value)
    13731378    {
    13741379        if (is_null($key)) {
     
    13851390     * @return void
    13861391     */
    1387     public function offsetUnset($key)
     1392    #[\ReturnTypeWillChange]
     1393    public function offsetUnset($key)
    13881394    {
    13891395        unset($this->items[$key]);
  • ilab-media-tools/tags/4.6.0/lib/mcloud-illuminate/support/Traits/EnumeratesValues.php

    r2686317 r3056306  
    766766     * @return array
    767767     */
    768     public function jsonSerialize()
     768    #[\ReturnTypeWillChange]
     769    public function jsonSerialize()
    769770    {
    770771        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 Spaces and more ===
     1=== Media Cloud for Bunny CDN, Amazon S3, Cloudflare R2, Google Cloud Storage, DigitalOcean and more ===
    22Contributors: 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, shortpixel
     3Tags: 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
    44Requires at least: 4.9
    5 Tested up to: 6.4.2
     5Tested up to: 6.5
    66License: GPLv3 or later
    77License URI: http://www.gnu.org/licenses/gpl-3.0.html
    8 Stable tag: 4.5.25
     8Stable tag: 4.6.0
    99Requires PHP: 7.4
    1010
     
    105105
    106106== 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.
    107130
    108131= 4.5.25 - 03/10/2024 =
  • ilab-media-tools/trunk/classes/Tools/Storage/StorageFile.php

    r2471780 r3056306  
    156156    }
    157157
     158    #[\ReturnTypeWillChange]
    158159    public function jsonSerialize() {
    159160        return [
  • ilab-media-tools/trunk/classes/Tools/Storage/StorageTool.php

    r3048361 r3056306  
    24922492           
    24932493            $webpKey = null;
     2494            $extraFiles = [];
     2495            $extraFormats = [];
    24942496            $additionalPaths = apply_filters(
    24952497                'as3cf_attachment_file_paths',
     
    25052507                $webpBasename = basename( $webpPath );
    25062508                $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                }
    25292618            }
    25302619           
     
    25492638                'optimized' => $didOptimize,
    25502639                'options'   => $options,
    2551                 'formats'   => [],
     2640                'formats'   => $extraFormats,
    25522641            ];
    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            //            }
    25562646           
    25572647            if ( file_exists( $upload_path . '/' . $filename ) ) {
  • ilab-media-tools/trunk/classes/Tools/Video/Driver/Mux/MuxHooks.php

    r2795243 r3056306  
    607607            /** @var StorageTool $storageTool */
    608608            $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 );
    610625        } else {
    611626            $url = wp_get_attachment_url( $attachmentId );
     
    614629                $url = str_replace( home_url(), constant( 'MEDIACLOUD_VIDEO_SERVER' ), $url );
    615630            }
     631            Logger::info( "URL FOR IMPORT 2:" . $url );
    616632        }
    617633       
  • ilab-media-tools/trunk/config/storage.config.php

    r2972143 r3056306  
    9797            ]
    9898        ],
     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        ],
    99109        'dreamhost' => [
    100110            'name' => 'DreamHost Cloud Storage',
     
    114124            ]
    115125        ],
     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        ],
    116151        'wasabi' => [
    117152            'name' => 'Wasabi (Deprecated)',
     
    123158            ]
    124159        ],
    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         ],
    141160        'backblaze' => [
    142161            'name' => 'Backblaze (Deprecated)',
     
    145164            'help' => [
    146165                [ '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' ],
    156166                [ 'title' => 'Read Documentation', 'url' => 'https://docs.mediacloud.press/articles/documentation/cloud-storage/setting-up-backblaze' ],
    157167            ]
  • ilab-media-tools/trunk/config/wizard.config.php

    r2972143 r3056306  
    2727                ->option('google', 'Google Cloud Storage', 'wizard.cloud-storage.providers.google.description', 'wizard-icon-google.svg', 'cloud-storage-google')
    2828                ->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')
    2930                ->option('do', 'DigitalOcean Spaces', 'wizard.cloud-storage.providers.do.description', 'wizard-icon-do.svg', 'cloud-storage-do')
    3031                ->option('dreamhost', 'DreamHost Cloud Storage', 'wizard.cloud-storage.providers.dreamhost.description', 'wizard-icon-dreamhost.svg', 'cloud-storage-dreamhost')
    3132//              ->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')
    3333                ->option('minio', 'Minio', 'wizard.cloud-storage.providers.minio.description', 'wizard-icon-minio.png', 'cloud-storage-minio')
    3434                ->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')
    3536            ->endGroup()
    3637        ->endStep()
     
    4849\MediaCloud\Plugin\Tools\Storage\Driver\S3\MinioStorage::configureWizard($builder);
    4950\MediaCloud\Plugin\Tools\Storage\Driver\S3\BackblazeS3Storage::configureWizard($builder);
    50 
     51\MediaCloud\Plugin\Tools\Storage\Driver\BunnyCDN\BunnyCDNStorage::configureWizard($builder);
    5152return $builder->build();
    5253
  • ilab-media-tools/trunk/ilab-media-tools.php

    r3048361 r3056306  
    66Description: Automatically upload media to Amazon S3 and integrate with Imgix, a real-time image processing CDN.  Boosts site performance and simplifies workflows.
    77Author: interfacelab
    8 Version: 4.5.25
     8Version: 4.6.0
    99Requires PHP: 7.4
    1010Author URI: http://interfacelab.io
     
    118118}
    119119// Version Defines
    120 define( 'MEDIA_CLOUD_VERSION', '4.5.25' );
     120define( 'MEDIA_CLOUD_VERSION', '4.6.0' );
    121121define( 'MEDIA_CLOUD_INFO_VERSION', '4.0.2' );
    122122define( 'MCLOUD_IS_BETA', false );
  • ilab-media-tools/trunk/lib/mcloud-illuminate/support/Collection.php

    r2684586 r3056306  
    12921292     * @return \ArrayIterator
    12931293     */
     1294    #[\ReturnTypeWillChange]
    12941295    public function getIterator()
    12951296    {
     
    13021303     * @return int
    13031304     */
     1305    #[\ReturnTypeWillChange]
    13041306    public function count()
    13051307    {
     
    13471349     * @return bool
    13481350     */
    1349     public function offsetExists($key)
     1351    #[\ReturnTypeWillChange]
     1352    public function offsetExists($key)
    13501353    {
    13511354        return array_key_exists($key, $this->items);
     
    13581361     * @return mixed
    13591362     */
     1363    #[\ReturnTypeWillChange]
    13601364    public function offsetGet($key)
    13611365    {
     
    13701374     * @return void
    13711375     */
    1372     public function offsetSet($key, $value)
     1376    #[\ReturnTypeWillChange]
     1377    public function offsetSet($key, $value)
    13731378    {
    13741379        if (is_null($key)) {
     
    13851390     * @return void
    13861391     */
    1387     public function offsetUnset($key)
     1392    #[\ReturnTypeWillChange]
     1393    public function offsetUnset($key)
    13881394    {
    13891395        unset($this->items[$key]);
  • ilab-media-tools/trunk/lib/mcloud-illuminate/support/Traits/EnumeratesValues.php

    r2686317 r3056306  
    766766     * @return array
    767767     */
    768     public function jsonSerialize()
     768    #[\ReturnTypeWillChange]
     769    public function jsonSerialize()
    769770    {
    770771        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 Spaces and more ===
     1=== Media Cloud for Bunny CDN, Amazon S3, Cloudflare R2, Google Cloud Storage, DigitalOcean and more ===
    22Contributors: 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, shortpixel
     3Tags: 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
    44Requires at least: 4.9
    5 Tested up to: 6.4.2
     5Tested up to: 6.5
    66License: GPLv3 or later
    77License URI: http://www.gnu.org/licenses/gpl-3.0.html
    8 Stable tag: 4.5.25
     8Stable tag: 4.6.0
    99Requires PHP: 7.4
    1010
     
    105105
    106106== 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.
    107130
    108131= 4.5.25 - 03/10/2024 =
Note: See TracChangeset for help on using the changeset viewer.