bradyvercher / gistpress

WordPress plugin to add Gist oEmbed and shortcode support with caching.
GNU General Public License v2.0
143 stars 28 forks source link

Split up main class #38

Closed GaryJones closed 1 year ago

GaryJones commented 10 years ago

The main class is getting too big and needs to be split up.

There are several groups of methods emerging. I'd like to see all of the processing and display of given HTML, split up from the URL determination and fetching / API calls, split up from the oembed stuff, and shortcode stuff. That is, we should be able to:

The process_gist_html() method, for instance, is 50+ lines long, and while it defers to process_gist_line_numbers() for another 30+ lines, both could be split up into ~4 methods each for code that is far easier to understand, and having a separate class would allow this.

GaryJones commented 10 years ago

The cache should have an interface and be an object too - storing and retrieving, so that the implementation (the fact it's stored in transients, but it could equally have subclasses that stored it in flat files, for instance) is encapsulated.