wpmetabox / meta-box

The best plugin for WordPress custom fields and custom meta boxes
https://metabox.io
1.19k stars 422 forks source link

[REQ] Modular Approach #1128

Closed ahmadawais closed 6 years ago

ahmadawais commented 7 years ago

This is a very nice plugin. I use and recommend it all the time. Could it be possible to make a modular version of it? Include the code for only the type of metaboxes being included?

rilwis commented 7 years ago

Thanks @ahmadawais for your suggestion. We're on the road of re-structuring the plugin to make it better. The hard part is keeping backward compatibility. So we do it slowly step-by-step, making sure it works all the time.

I'm not very clear about the "modular version" that you mean? Is that what we're doing now: separating other codes into extensions and keep only the core code for the Meta Box?

ahmadawais commented 7 years ago

Let's say I want to build a simple plugin that has only 3 meta boxes. Using your plugin (since I always embed the plugin) is an overkill. If it had been modular and I could only include the files for the meta boxes I use, just like you do in Node — that'd be great!

rilwis commented 7 years ago

I got it. Currently, if you use PHP >= 5.3, then the autoload is used and only required files are loaded. That's not 100% modular as you expect, but at some points. We'll work more on that to make all features modular.

JasonTheAdams commented 6 years ago

I think breaking the code into classes which only get autoloaded when needed is completely acceptable. No reason to break it into multiple plugins or whatever, in my opinion. The size of the plugin really isn't a big deal (if it is, there's a bigger problem). So long as only the necessary classes needed to accomplish the given task are loaded, that's the best one can ask for.

Just my 0.02. 😄

rilwis commented 6 years ago

Yes, that’s what we have now. I also think it’s ok at the moment. Most PHP apps do the same.

Let me close this issue. If you have any idea, please leave a comment. Thanks.