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.