Title: Code suggestions
Last modified: October 24, 2017

---

# Code suggestions

 *  Resolved [Brian Layman](https://wordpress.org/support/users/brianlayman/)
 * (@brianlayman)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/code-suggestions-2/)
 * Nice job on the design. This works great. I’m using a customized version of your
   code on heavy.com now and I wanted to let you know some of the changes I made.
 * 1. I turned this into a class (actually I merged it with an existing class) so
   that there are no conflicts in function call names.
    2. I escaped all of the 
   variables added into the messages with esc_attr() before saving it to the database
   and then upon display I wrapped the whole message in esc_html(). Without this,
   your plugin should not be considered safe. 3. I changed your get_option(), update_option()
   and delete_option() to get_transient(), set_transient() and delete_transient()
   so that it would use the caching system that is available on well optimized sites
   rather than forcing a DB write of the value.
 * Hope that helps!

Viewing 1 replies (of 1 total)

 *  anonymized-15272943
 * (@anonymized-15272943)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/code-suggestions-2/#post-9978023)
 * Hey Brian,
 * Thanks for the feedback. Will consider this for the next version!
 * Cheers,
 * Martin

Viewing 1 replies (of 1 total)

The topic ‘Code suggestions’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/minimum-featured-image-size_6eceb3.
   svg)
 * [Minimum Featured Image Size](https://wordpress.org/plugins/minimum-featured-image-size/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/minimum-featured-image-size/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/minimum-featured-image-size/)
 * [Active Topics](https://wordpress.org/support/plugin/minimum-featured-image-size/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/minimum-featured-image-size/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/minimum-featured-image-size/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: anonymized-15272943
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/code-suggestions-2/#post-9978023)
 * Status: resolved