• Resolved j2fb

    (@j2fb)


    Hello,

    Since the last update, we are getting the following error when optimizing an image, any suggestions?

    “Fatal error: Uncaught Error: Call to undefined function wp_generate_attachment_metadata() in plugins/robin-image-optimizer/includes/classes/class-rio-attachment.php:142”

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello.

    I checked it out. This feature exists in WordPress and on my test site it does not cause errors.
    How do you run the optimization?

    Thread Starter j2fb

    (@j2fb)

    It seems we are getting this error when inserting the images as attachments programmatically. Otherwise, we aren’t getting the error when manually adding images to the media library. Any suggestions? 🙂

    So you are adding images not from the admin panel?

    Then you can attach a file with this function in your code.
    require ABSPATH . 'wp-admin/includes/image.php';

    We will try to fix this in the next update.

    Thread Starter j2fb

    (@j2fb)

    Thanks, but it turns out we are also getting this error when uploading images to woocommerce products through the media library, in our admin panel. Any ideas?

    This function is always available in the admin panel. I don’t know exactly how you add images.
    Now I tried to add images in the standard way – everything is fine.

    Thread Starter j2fb

    (@j2fb)

    I see.. I’m adding the images on the WooCommerce edit product page. It’s strange because it worked fine until the latest update 🙁

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Call to undefined function wp_generate_attachment_metadata’ is closed to new replies.