Title: Great functionality, not so great code
Last modified: December 1, 2021

---

# Great functionality, not so great code

 *  [valebubble](https://wordpress.org/support/users/valebubble/)
 * (@valebubble)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/great-functionality-not-so-great-code/)
 * This plugin is simple but very focused and achieves what it needs to.
    That said,
   the underlying code is messy and at times poorly written.
 * For example, the attachments div has no class or id so you can’t target it with
   css. It forces its style using the “style” attribute which is pretty bad for 
   customizability. I had to use a filter and wrap it in another div just to have
   a class I could target with custom CSS.
 * Another big issue: in the admin options, I am not able to use a custom template
   for the attachment title. Selecting the “Custom” option does nothing because 
   the plugin:
    – Uses a script HTML tag to load jQuery from an external CDN, in
   the middle of the page. This is not the WordPress standard way of loading jQuery(
   or any script at all) and can potentially cause many issues. – Attempts to use
   the “$” variable instead of using “jQuery”. This causes an error (TypeError: 
   $ is not a function) that blocks the execution of javascript and prevents the
   options from working correctly.
 * So if the plugin works for you out-of-the-box, that’s great. If you need to adapt
   it somehow, be aware that the code is very hard to work with.

The topic ‘Great functionality, not so great code’ is closed to new replies.

 * ![](https://ps.w.org/wp-attachments/assets/icon-256x256.png?rev=2617427)
 * [WP Attachments](https://wordpress.org/plugins/wp-attachments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-attachments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-attachments/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-attachments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-attachments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-attachments/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [valebubble](https://wordpress.org/support/users/valebubble/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/great-functionality-not-so-great-code/)