diff --git a/lib/classes/class-utility.php b/lib/classes/class-utility.php index fdc9b8098..9295d7b0a 100644 --- a/lib/classes/class-utility.php +++ b/lib/classes/class-utility.php @@ -271,6 +271,10 @@ public static function add_media($metadata, $attachment_id, $force = false, $arg } $image_sizes = self::get_path_and_url($metadata, $attachment_id); + + Helper::debug( '$image_sizes: ' ); + Helper::debug( json_encode($image_sizes) ); + foreach ($image_sizes as $size => $img) { if ((isset($_REQUEST['size']) && $_REQUEST['size'] == $size) || empty($_REQUEST['size'])) { // GCS metadata @@ -333,8 +337,12 @@ public static function add_media($metadata, $attachment_id, $force = false, $arg 'contentDisposition' => $_contentDisposition )); + Helper::debug( '$media: ' ); + Helper::debug( json_encode($media) ); + $cloud_meta = self::generate_cloud_meta($cloud_meta, $media, $size, $img, $bucketLink); } catch (\Throwable $th) { + Helper::debug($th->getMessage()); //throw $th; } } else { @@ -447,6 +455,7 @@ public static function get_path_and_url($metadata, $attachment_id) { $metadata['height'] = $_image_size[1]; } } catch (\Exception $e) { + Helper::debug($e->getMessage()); // lets do nothing. } } diff --git a/readme.txt b/readme.txt index ce727e019..8b88f46b1 100644 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ License: GPLv2 or later Requires PHP: 8.0 Requires at least: 5.0 Tested up to: 6.5.2 -Stable tag: 4.0.3 +Stable tag: 4.0.3-test712 Upload and serve your WordPress media files from Google Cloud Storage. diff --git a/wp-stateless-media.php b/wp-stateless-media.php index 3cb1299cd..6f99c247f 100644 --- a/wp-stateless-media.php +++ b/wp-stateless-media.php @@ -4,7 +4,7 @@ * Plugin URI: https://stateless.udx.io/ * Description: Upload and serve your WordPress media files from Google Cloud Storage. * Author: UDX - * Version: 4.0.3 + * Version: 4.0.3-test712 * Text Domain: stateless-media * Author URI: https://udx.io * License: GPLv2 or later