cloudinary / cloudinary_wordpress

Cloudinary's WordPress plugin
GNU General Public License v2.0
39 stars 28 forks source link

Getting a crash (HTTP ERROR 500) when trying to edit page with WP Bakery and Cloudinary plugin activated #863

Closed ioannisth closed 1 year ago

ioannisth commented 1 year ago

Bug Description

When I am trying to edit a page with WP Bakery on a live site (running on OpenLiteSpeed web server) with the cloudinary plugin activated, I get HTTP ERROR 500

Expected Behaviour

I should be able to enter the WP Bakery Visual Composer. The default WP editor works fine

Steps to reproduce

  1. Go to pages
  2. Click on a page, then click edit
  3. See error

Screenshots

Additional context

ioannisth commented 1 year ago

Inside wp-content/plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-delivery.php, line 1282 tries to divide by $has_size[1] merely by checking if $has_size is not an empty array not checking for zero values, either for $has_size[1] or $item['height']

if ( ! empty( $has_size ) ) { $file_ratio = round( $has_size[0] / $has_size[1], 2 ); $original_ratio = round( $item['width'] / $item['height'], 2 ); if ( $file_ratio !== $original_ratio ) { $attributes['data-crop'] = $file_ratio; } }

pereirinha commented 1 year ago

Hi @ioannisth

Thank you for raising this issue. Fortunately, this has already been identified, and we have a patch. We are currently in the last tests before we roll out 3.1.0, which will fix this issue.

We are expecting to release the new version shortly.