-1

In my wordpress project, I am facing a problem. I am unable to upload featured images for my posts. While uploading images it is showing error as "Unable to upload image,try again later" and there is no console error. After research by deactivating all plugins i came into conclusion that issue was with my custom plugin. When i deactivated that plugin evrything works perfectly. How can i solve the issue.

After again activating that same plugin i got following error

The plugin generated 445 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

How can i solve the issue? Am new to wordpress and i dont know how to solve it?

  • Are you able to post the `445 characters of unexpected output` here? I think if you can see what that output is it will lead you to the issue/solution... Most likely something is trying to `echo` something at the wrong time/hook in your plugin. – mikerojas Mar 30 '20 at 15:57
  • Possible duplicate of [https://stackoverflow.com/questions/4074477/the-plugin-generated-x-characters-of-unexpected-output-during-activation-wordpr](https://stackoverflow.com/questions/4074477/the-plugin-generated-x-characters-of-unexpected-output-during-activation-wordpr) – M.D Mar 30 '20 at 15:59
  • I didint get what you mean, how can i get that 445 characters – Joshy Kaithkad Mar 30 '20 at 15:59
  • Can you post your plugin code? You said you narrowed it to that so we if we can see that code we can help debug the issue. – mikerojas Mar 30 '20 at 16:01
  • Plugin have lots of code, how can i complete – Joshy Kaithkad Mar 30 '20 at 16:22
  • Does this answer your question? [The plugin generated X characters of unexpected output during activation (WordPress)](https://stackoverflow.com/questions/4074477/the-plugin-generated-x-characters-of-unexpected-output-during-activation-wordpr) – AMC Mar 30 '20 at 18:22
  • Does this answer your question? [How would you implement a secure static login credentials system in Java?](https://stackoverflow.com/questions/103203/how-would-you-implement-a-secure-static-login-credentials-system-in-java) – Sabee Mar 30 '20 at 18:30

1 Answers1

0

The most common causes are:

  1. White space before or after the PHP opening or closing tags
  2. A file encoded in UTF-8
  3. Another issue when something is called at the wrong time, or a call that cannot be resolved without intervention
  4. Using the WordPress add_option function. Switching to update_option instead can resolve the problem. For detail click here
M.D
  • 270
  • 2
  • 11
  • I checked for white space and nothing found. I didnt get your 2nd option,What is that? – Joshy Kaithkad Mar 30 '20 at 16:22
  • If the files were encoded in UTF-8 (the universal language encoding that is the standard) but the server threw errors. Converted the files to ANSI encoding, and the problem may be fixed. http://www.differencebetween.net/technology/protocols-formats/difference-between-ansi-and-utf-8/ – M.D Mar 30 '20 at 18:16
  • How can i convert that – Joshy Kaithkad Mar 31 '20 at 04:10
  • It is editor specific, google for your editor. For notepad++ https://superuser.com/questions/762473/ansi-to-utf-8-in-notepad – M.D Mar 31 '20 at 04:19
  • 1
    Check https://stackoverflow.com/questions/38795347/wordpress-plugin-activited-header-already-send-error?rq=1 – M.D Mar 31 '20 at 04:20
  • 1
    This also https://stackoverflow.com/questions/4074477/the-plugin-generated-x-characters-of-unexpected-output-during-activation-wordpr – M.D Mar 31 '20 at 04:20