We published the (Business rules for WordPress) plugin on the WordPress plugins directory with a slogan ( Just another workflow plugin ).
Business rules plugin is a simple easy to use WordPress plugin that helps you create your workflow inside your WordPress site.
Why do we need business rules or workflow plugins at our WordPress?
We need workflow plugin for our WordPress sites or any other content management system (CMS) to create a workflow for your daily work, for example:-
- publish any post from a specific author.
- Restrict page/post on some user roles.
- Change the content/title of a post to match your guidelines.
- Send notification emails when something happens at your site.
Above all, one workflow plugin may let you forget to install multiple plugins!
Business rules plugin consists of three main parts as follows:
1. Business rule trigger
This is the main entrance of the business rule, so you need to choose one and only one trigger for each created rule.
The trigger is the thing that fires the business rule to start working, please check the following examples:-
- WordPress initialize
- Admin initialize
- Create Post
- Update post
- After creating attachment
- Deleting an attachment
- Deleting a post
- Trash post
- Trash post comment
- Un-trash post
- Un-trash post comment
We will talk in details about each business rule trigger in a specific article.
2. Business rule condition
Each business rules or workflow may have one or more conditions which the rule evaluator will evaluate it to make the workflow continues working.
So if one condition (at least) fails, the whole workflow will fail. Please check the following examples:-
- Current logged-in user ( choose a specific user from a list of users )
- Current logged-in user role ( choose specific role from a list of current user roles )
- Current page URL
- Current post ( choose a post from a list of posts )
- Current admin screen ( choose one of the admin screens )
- The current user has a specific capability ( choose one of the capabilities )
- The current user has meta ( choose meta key, operator, and value )
- Current locale direction ( LTR or RTL )
- Is on the admin interface.
- Is multisite
- Has SSL
And many other conditions, also we will make dedicated article talking about business rules conditions.
3. Business rule action
Each business rule ( workflow ) must have at least one action to be performed after workflow is triggered and all conditions evaluated successfully.
Check the following examples of business rule actions:-
- Show admin notice
- Debug ( this is for debugging purposes only to just die when the rule works properly )
- Redirect to ( put the URL to be redirected to )
- Create post
- Update post
- Trash post
- Send email
- Create user
- Update user
- Update user meta
- Delete user meta
- Delete user
- Add image size
- Remove image size
- Require login
- Add/Update option
- Delete option
- Flush rewrite rules
- Show admin bar
- Replace in the post title
- Replace in the post content
- Replace in the post excerpt
- Make post/page password protected
And many other actions, also we will make dedicated article talking about business rules actions.
Next steps
We have a road map to the next releases, we plan to release every two weeks ( our sprint duration ).
We are open-source and you can follow us and contribute here: https://github.com/engahmeds3ed/wp-rules/
Kindly find below some of our features list:-
- Integrate with WooCommerce, WP Rocket, and JetPack plugins.
- Add schedule trigger with custom duration.
- Add a log for each workflow added.
- Add dashboard widget to show the latest evaluated workflows.
I’m truly enjoying the design and layout of your website. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a developer to create your theme? Great work!