Skip to content

Commit

Permalink
Extend logs to investigate issue 712
Browse files Browse the repository at this point in the history
  • Loading branch information
balexey88 committed May 9, 2024
1 parent 1923a1c commit 102791a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions lib/classes/class-utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
}
}
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion wp-stateless-media.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 102791a

Please sign in to comment.