Title: Bad code
Last modified: February 29, 2020

---

# Bad code

 *  Resolved [milkaa66](https://wordpress.org/support/users/milkaa66/)
 * (@milkaa66)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/bad-code-10/)
 * Hey. Faced a problem, when creating a new post, instead of a redirect, the Internal
   Server Error 500.
    For a long time I figured out the problem of why it works 
   on one host, and on the second, a copy of 100% does not work.
 * Explain why this piece of code is needed?
    plugins / wp-user-frontend / includes/
   class-frontend-form-post.php Lines: 470 – 472
 * $ dom = new DOMDocument ();
    @ $ dom-> loadHTML ($ postarr [‘post_content’]);
   $ images = $ dom-> getElementsByTagName (‘img’);
 * They created a problem for me

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Towhidul I Chowdhury](https://wordpress.org/support/users/itowhid06/)
 * (@itowhid06)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/bad-code-10/#post-12496050)
 * Hello [@milkaa66](https://wordpress.org/support/users/milkaa66/),
 * > Explain why this piece of code is needed?
   >  plugins / wp-user-frontend / includes/
   > class-frontend-form-post.php Lines: 470 – 472
 * This piece of code is used to check if the post content contains any images. 
   And If any images are found then those are associated with the post as attachments.
 * Regards
 *  Thread Starter [milkaa66](https://wordpress.org/support/users/milkaa66/)
 * (@milkaa66)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/bad-code-10/#post-12497776)
 * But as the situation showed, this is not always a working option. Perhaps this
   can be redone?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Bad code’ is closed to new replies.

 * ![](https://ps.w.org/wp-user-frontend/assets/icon-256x256.gif?rev=2818776)
 * [User Frontend: AI Powered Frontend Posting, User Directory, Profile, Membership & User Registration](https://wordpress.org/plugins/wp-user-frontend/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-user-frontend/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-user-frontend/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-user-frontend/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-user-frontend/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-user-frontend/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [milkaa66](https://wordpress.org/support/users/milkaa66/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/bad-code-10/#post-12497776)
 * Status: resolved