Support » Plugin: DCO Comment Attachment » Images are not getting attached to comments

  • Resolved Chrissy

    (@paperkawaii)


    Hi again,

    Like I said in my previous thread, the images are not getting attached.

    It’s taken this long for someone to post an image with their comment, actually two people.

    The images are attached to the post itself but not the comment.

    The first image dimensions and size:
    File size: 576 KB
    Dimensions: 2560 by 1920 pixels

    Second image:
    File size: 382 KB
    Dimensions: 2560 by 1920 pixels

    I have 3MB upload file size set in the plugin options, I also have “Attach to commented post” checked, is that correct?

    Both comments were posted on the same date, June 8th by the same person on two different posts.

    I haven’t manually attached the images yet, just in case you can think of anything I can do to figure out what’s wrong.

    Best wishes,
    Chrissy

    You can view one of the comments on this page, the latest comment: https://origami.guide/origami-hearts/origami-heart/3

    • This topic was modified 1 year ago by Chrissy.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Denis Yanchevskiy

    (@denisco)

    Hello @paperkawaii,

    I’m sorry to be late with the reply.

    I did a little test and posted two comments with 186KB and 30KB images. Any of the images attached to the comment?

    Thread Starter Chrissy

    (@paperkawaii)

    Thanks for that, they both attached fine.

    I have done a couple more tests. I believe it is only when uploading over 1mb images.

    I test commented with an image file under 1mb and it went through fine.

    But a photo that was 2.5mb did not attach. The website also gave an Internal server error for the url https://origami.guide/wp-comments-post.php
    The comment did appear, with no image attached, the image was in the media library.
    I did the test twice with the same result.

    Here are the php stats…

    PHP max input variables 4000
    PHP time limit 1200
    PHP memory limit 860M
    Max input time 1200
    Upload max filesize 500M
    PHP post max size 505M

    I tried increasing the upload size option to 6mb and it had no effect.

    Here is the error in the error log:

    End of script output before headers: wp-comments-post.php, referer: https://origami.guide/origami-hearts/origami-heart/3

    Plugin Author Denis Yanchevskiy

    (@denisco)

    This is similar to reports of restrictions on Bluehost and Hostgator hosting services.

    You can try these recommendations or try to run the site on another hosting.

    Thread Starter Chrissy

    (@paperkawaii)

    The site is running on an 8GB VPS, on Dreamhost.

    Can you let me know the restriction, I can ask them about it.

    Plugin Author Denis Yanchevskiy

    (@denisco)

    Can you let me know the restriction, I can ask them about it.

    Unfortunately, I do not know. I only have reports of the problem (examples: 1, 2, 3, 4, 5, 6) and the recommendations that the users of these hosting services have used.

    One of the users tested the plugin on different hosting and was unable to reproduce the problem.
    I would be glad if you can share the cause of the problem, if you can figure it out.

    Thread Starter Chrissy

    (@paperkawaii)

    Thanks for your reply. I went through those and also tried the replacing of the wp-comments-post.php etc, with no effect.

    I was momentarily excited as after disabling all the plugins, it began to work. However after re-activating one at a time, different plugins seemed to prevent it from working randomly.

    Eventually, I remembered that some hosting company in the past told me that the GD module is faster for large files.. so enabled that instead of ImageMagick.

    So it’s currently working, and as far as I can tell, it was ImageMagick, as silly as that sounds, maybe with the setup that Dreamhost’s VPS uses…

    I reverted all the changes I made back and all of the plugins, so hopefully that’s it.

    šŸ™‚

    edit:

    If anyone wants to try GD instead, add this code to the functions.php of your child theme:

    
    /// Use GD instead of ImageMagick
    
    add_filter( 'wp_image_editors', 'select_wp_image_editors' );
     
    /**
     * The default $editors value:
     * 
     *      array( 'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD' )
     */
    function select_wp_image_editors( $editors ) {
            return array( 'WP_Image_Editor_GD' ); // only return WP_Image_Editor_GD
    }
    • This reply was modified 1 year ago by Chrissy.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Images are not getting attached to comments’ is closed to new replies.