WordPress has many built-in capabilities to use WordPress as a framework. Here is a Brief Discussion on How to Use WordPress as Web Application Backend. There are advantages of using WordPress For web application. As existing user of WordPress all of us are aware of the classes used by WordPress to create plugins. Using that idea for larger wen application would allow us to use WordPress for more complicated web applications. It is not that none has used WordPress as Web Application backend, there are known few, may be unknown many.
WordPress is powerful Web Application with large user base. It is very difficult to get such powerful PHP-Mysql web application as template of your web application. Basic idea is to keep dashboard, menu items from sidebar and add your custom menu and dashboard. Here is a good post on what we are talking about :
1 | https://www.elegantthemes.com/blog/resources/8-awesome-wordpress-web-apps-paving-the-way-for-wordpress-as-a-saas-platform |
Debranding to Use WordPress as Web Application Backend
If visually it becomes obvious that it is WordPress, then chance of breech of security becomes obvious. Here is a WordPress Plugin to remove certain too obvious branding :
---
1 | https://wordpress.org/plugins/remove-wp-branding/ |
Other few features can be easily removed.
Integrating API to Make WordPress as Powerful Web Application Backend
As we have discussed before, we can add Restful API to WordPress to allow us to control wordPress via REST API.
Selectively Removing Some WordPress Menu From WordPress Sidebar Menu
It self, except to Admin and editor, WordPress limits the items on Sidebar menu. We can however use some plugins :
1 | https://wordpress.org/plugins/admin-menu-editor/ |
WordPress does have docs on it :
1 | https://codex.wordpress.org/Function_Reference/remove_menu_page |
You can remove with our basic example and our WordPress Plugin to avoid snippet on theme’s functions.php :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | // http://example.com/wp-admin/index.php?page=iconize-plugin-update-notifier remove_submenu_page( 'index.php', 'iconize-plugin-update-notifier' ); // EXAMPLE FOR WOOCOMMERCE DASHBOARD SUBMENU remove_submenu_page( 'index.php', 'wc-about' ); remove_submenu_page( 'index.php', 'wc-credits' ); remove_submenu_page( 'index.php', 'wc-translators' ); remove_menu_page( 'edit.php?post_type=product' ); remove_menu_page( 'woocommerce' ); remove_menu_page( 'order-post-types-shop_order' ); remove_menu_page( 'order-post-types-shop_coupons' ); // CUSTOM POST TYPE TOP LEVELS remove_menu_page( 'edit.php?post_type={$POST_TYPE}' ); //LOOK FOR WHAT COMES AFTER POST TYPE IN THE URL remove_menu_page( 'edit.php?post_type=testimonials-widget' ); //TESTIMONIALS WIDGET // CUSTOM POST TYPE SUBMENU remove_submenu_page( 'edit.php?post_type={$POST_TYPE}', '{$SUBMENU_URL_VARIABLE}' ); // SO IF BELOW IS THE URL // http://example.com/wp-admin/edit.php?post_type=testimonials-widget&page=testimonialswidget_settings // YOU NEED TO SEE WHATS AFTER PAGE remove_submenu_page( 'edit.php?post_type=testimonials-widget', 'testimonialswidget_settings' ); //TESTIMONIALS WIDGET // GRAVITY FORMS remove_menu_page( 'gf_edit_forms' ); remove_submenu_page( 'gf_edit_forms', 'gf_settings' ); remove_submenu_page( 'gf_edit_forms', 'gf_export' ); remove_submenu_page( 'gf_edit_forms', 'gf_update' ); remove_submenu_page( 'gf_edit_forms', 'gf_addons' ); remove_submenu_page( 'gf_edit_forms', 'gf_help' ); // OTHER EXAMPLES remove_menu_page( 'revslider' ); // REVSLIDER remove_menu_page( 'shortcodes-ultimate' ); // SHORTCODES ULTIMATE remove_menu_page( 'wp-admin-microblog/wp-admin-microblog.php' ); // ADMIN MICROBLOG remove_menu_page( 'snippets' ); //CODE SNIPPETS remove_submenu_page( 'cleverness-to-do-list', 'cleverness-to-do-list-settings' ); //Cleverness TODO |
So, we are left with few menus and options which is practically a web form to login and land to dashboard with widgets with sidebar menu with our wanted limited menu items.
Using WordPress Admin Themes and Adding Extra Features
There are many reasons why MVC pattern is a popular pattern in software design. There are several frameworks that replicate the MVC pattern using WordPress as the controller. These include ExoWP by New Clarity, and WPMVC. Using or replicating the MVC pattern in the app is not just a way to take advantage of this successful design pattern, it may also make it easier for developers. There are several WordPress admin themes :
1 | https://wordpress.org/plugins/tags/admin-theme |
Adding Your Web App to WordPress Admin Themes as Final Step
In most easy form, your application is a WordPress Plugin. Only that Plugin’s dashboard, widgets, menu, admin page are allowed view to basic user role.
We know how to create WordPress Dashboard Widget Plugin, we have sample WordPress Plugin framework.
You can use different plugins for each module like for Clients, Vendors, Core Accounting, etc and create Pages Templates within the plugins as the system pages. Few plugins already exist for complex usage :
1 2 | http://hasanhalabi.github.io/wpafa.github.io/ https://wordpress.org/plugins/piklist/ |