Apply Filters

Episode 32 – Add-on Plugins, Planning Large Plugins and Custom Tables


Listen Later

Episode 32 includes a discussion on add-on plugins, issue tracking across add-ons and the core repository, planning large plugins, custom tables, and, of course, what we have been working on recently.
This episode was sponsored by WP Ninjas, the creators of Ninja Demo and the highly popular Ninja Forms plugin.
Show Notes:
Easy Digital Downloads v2.2 released
Restrict Content Pro now on a public repository
Amazon S3 and Cloudfront v0.7 released
Review us on iTunes
Transcript
INTRO: Welcome to Apply Filters, the podcast all about WordPress development. Now here’s your hosts, Pippin Williamson and Brad Touesnard.
BRAD: Welcome to Episode 32. Today we’re going to be talking about what we’ve been up to lately: managing the code of the core plugin with add-ons, which can be a challenge, and laying out and planning the code for larger plugins and kind of the structure of a large plugin. Pippin, man, what have you been up to?
PIPPIN: Well, the last week or two have been a little bit busier than normal. We’re ramping up for a large EDD release, which is version 2.2. It’s a release that we’ve been working on since, well, 2.1, which went out in, I think, August, so it’s been about three or so months that we’ve been working on it. It was a pretty large update, not a whole lot of user facing changes. A lot of just background refinement still, few UI things, a couple of new features here and there, like minor stuff.
BRAD: What are some of the major plumbing? I guess I call it plumbing because it’s, like, the background.
PIPPIN: Yeah. One of the biggest ones that we did was we introduced a new product class called EDD Download. Previous, prior to 2.2, if you wanted to interact with a product as a developer, like let’s say in an extension or a theme, and you wanted to go get the sales of that product, the earnings of it, or you wanted to get all the price options or the download files attached to it, et cetera, there was just a whole mishmash of helper functions to use.
And so, we’ve now created a new class that makes all of that data much more accessible. It also makes it much easier to create new products as well. So since a product is a custom post type, you used to be able to just say, like, WP insert post. Set the post type to download. Set all the different stuff. And then update all of the post meta that you need.
BRAD: Right.
PIPPIN: Now you can do it much more simply and you can just say new EDD Download.
BRAD: Right, so you’ve created basically, like, an API that —
PIPPIN: Yep, to interface with the product.
BRAD: Right, and keeps kind of away from the lower level.
PIPPIN: Yep, exactly.
BRAD: Like WP insert post and all that stuff.
PIPPIN: And there’s a couple of big advantages to it. Number one is it just makes it a lot easier for someone who is new to the plugin or to the project to come onboard and figure out how to do something with a product. But, number two; it also makes it a lot easier for us to change things behind the scenes later on.
BRAD: Mm-hmm.
PIPPIN: If we want to change the database schema, if we want to do something like that, maybe we decide to move all of the data to a custom post type. We can do that much easier because we don’t have to worry about people manually calling get_post_meta on something.
BRAD: Right.
PIPPIN: Because instead they’re using our product helper class that we can adjust the methods there and everything will just work.
BRAD: Right, yeah.
PIPPIN: So it’s something I wish we had done a long time ago, but we just now got around to it. And there were a bunch of other little changes. We found a few security flaws that we patched up. We made a couple of small UI changes. Overall, it was a pretty solid release.
BRAD: Cool.
PIPPIN: There were no database schema changes. There was no data migration or anything like that, so it wasn’t as risky of a rele
...more
View all episodesView all episodes
Download on the App Store

Apply FiltersBy Apply Filters