1

Is it ok to use medoo framework (http://medoo.in/) when devloping new plugin. or should I use WP_Query only?

What's right?

  • 1
    this is like asking if you should eat apples or chicken ;) It depends on the type of meal you want to have. – Mark Kaplun Oct 30 '16 at 13:21
  • @MarkKaplun I'm new in this, and wonder if to start learning WP_Query – Adi Oct 30 '16 at 13:25
  • 1
    WP_query is central to 90% of things you might want to do in wordpress, not learning it is not realy an option ;) – Mark Kaplun Oct 30 '16 at 13:32
3

medoo and other similar libraries are generic, that is they are aimed at querying some database in general and the weight of figuring out necessary queries are on you as developer.

WP_Query and other WP APIs that perform requests to database are much more specific. They already contain much of that logic, which allows you to express what you need in API calls, rather than SQL query or abstraction close to it. Related code in core implements enormous amount of SQL query generation with literally years of logic and performance optimizations.

Overall for any WP development you have to use its APIs as much as possible, or you will have to waste incredible amount of time reinventing what they do.

Though bringing your own database abstraction can certainly be beneficial for some use cases. For example if you plan to develop extension which will add and interact with its own database tables, rather than native WP data structures.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.