Drag & Drop for Post Thumbnails
Brilliant plugin, what is the zero character? (6 posts)

  1. c.note
    Posted 2 years ago #

    This is a really great plugin but I noticed a zero character appears at the bottom of the Feature Image widget box just after I drag and upload an image. Doesn't have any affect on the actions but it planted a seed of doubt.

    Screenshot at tinypic


  2. Tobias Nygren
    Plugin Author

    Posted 2 years ago #

    Hi c.note!

    Sorry for my late reply. This little zerochar is bugging me to death. I don't know why this happens yet, but I tried a lot of things and I think the problem is related to the way I parse the output. Hopefully I will figure this out until next release. (FYI: I'm using nonces to authenticate just as the rest of the admin, so this is as secure as rest of wp admin).

  3. RonStrilaeff
    Posted 2 years ago #

    Tobias, I have a clue on the origin of that stray zero char ...

    Stick this in your browser's address bar:

    Use any other wordpress site's domain name ... the admin-ajax.php must be returning a false or zero after some internal function.

  4. Tobias Nygren
    Plugin Author

    Posted 2 years ago #

    Thank you so much for digging Ron! That means I have to filter the return data, I have to look in to this asap.

    "If the AJAX request fails when the request url is wp-admin/admin-ajax.php, it will return either -1 or 0 depending on the reason it failed. Additionally, if an AJAX request succeeds, it will return a 0."

  5. RonStrilaeff
    Posted 2 years ago #

    I'm working with some ajax post/response logic and notice that occasionally I get a zero char in my response when the php-ajax side does not execute a die() or exit() statement. It can be successful, but still not terminated properly. Hope this is another useful clue.

  6. Jonathan Lundström
    Posted 2 years ago #

    Hello Tobias!

    This problem is easily resolved by using die(); instead of a traditional return/echo in the admin ajax function. If you do not run die it will continue to execute, therefore returning unwanted numerics. Let me know how this works out for you :)

    Best regards,

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Drag & Drop for Post Thumbnails
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.