RulesEngine – WordPress Access and Content Controller

RulesEngine - WordPress Access and Content Controller

RulesEngine - WordPress Access and Content Controller RulesEngine is a all in one wordpress plugin used for defining rules for hiding, appending html, image content, generating shortcodes, replacing, redirecting and switching for respective wordpress components such as Pages, Posts, Categories, Themes, Widgets and URL Redirection.

RulesEngine follows “define once and use in many ways” strategy, which enables admin to define the logical rule at once by using rule criteria such as User Role, User Profile, Mobile Device, Tablet, Geo location, Date and Time, Request URL, Browser Type etc and uses them in defining the child rules like Page, Post, Category, Theme, Widget and URL Redirection.

RulesEngine consists of a parent rule called the Logical Rule and 6 child rules

  1. Page Rules
  2. Post Rules
  3. Category Rules
  4. Widget Rules
  5. Theme Rules
  6. Rules for URL Redirection.

In future releases many more rules are planned.

A logical rule is defined by 10 different categories like User Role, User Profile, Pages, Posts Geo location etc, 23 subcategories like Email, Registered Date, Country, Date and Time etc and with 9 conditions like equals, not equal, greater than etc. Click here to view the complete list of categories and subcategories. Many more categories and subcategories are planned in future releases.

Click here for RulesEngine video tutorial.
Click here for RulesEngine demos.

What’s new in RulesEngine v3.3

  • Now RulesEngine supports WooCommerce categories.
  • WooCommerce categories can be hidden on a specific page, this feature is very useful if you marketplace has multiple product pages.
  • WooCommerce categories can be hidden based on User Role, userid, language etc.
  • WooCommerce categories can be hidden based on Country, IP Address etc.
  • WooCommerce categories can be hidden based on Date, Time, Month etc.
  • Many more we can define the rules to control the WooCommerce categories.

RulesEngine - WordPress Access and Content Controller

To know more about category and logical rules, click on below section.

      WooCommerce Category Rules
      WooCommerce Category Demo
      Logical Rules

    How it works

    Below is the example of Pages By Role hiding of page for a user with “Subscriber Role”.

    • First we should define a logical rule with role as Subscriber (see below screenshot)
    • RulesEngine - WordPress Access and Content Controller

    • Below screenshot depicts how we can leverage a defined “Subscriber Rule” Logical rule for defining rules for Pages. Below rule is used for hiding “Ad Manager” and “Contact Us” Pages for users with Subscriber role.
    • RulesEngine - WordPress Access and Content Controller
      We can further use the same “Subscriber Role” logical rule to define other child rules (Posts, Categories, Theme etc).

    Defining a complex rule.

    • RulesEngine is very flexible for defining very complex logical rules using “AND” “OR” and “Brackets” operators. (e.g: Role is Administrator and Country is USA and Month is January, Page is Home etc, see below sreenshots.) See Logical rule section for more info.
    • RulesEngine - WordPress Access and Content Controller
      RulesEngine also provides an utility method through which we can get the evaluated logical rule value in a single statement.
      RulesEngine::is_rule_valid(“Logical Rule Name”);

     if(RulesEngine::is_rule_valid("USA and Asia Rule")) {     echo "Condition satisfied"; } where "USA and Asia Rule" is the name of the Logical Rule. 

    RulesEngine makes code very easy to maintain. we can add or update values in rule condition without modifying code.

    Below is the code representation of above complex logical Rule. This code is hard to maintain and we need a developer to update the below logic.

      if(($month === "January" || $month === "December") &&     ($country === "United States" || $continent === "Asia") &&     ($user_profile === $login_status || $user_role !== "Administrator") &&     ($page_title === "home")) {      echo "Condition satisfied"; } 

    Features:

  • Page Rule:
    • Hide Pages/Menus.
    • Append dynamic html content or image at any desired location using generated “Shortcode”.
    • Define rule for Including Third-Party “Shortcode”.
    • Append dynamic html content or image to the top/bottom of the page.
    • Show modal dialog with dynamic content.
    • Replace page content.
    • Define Redirect URL for pages that are hidden.
    • Excludes hidden and replaced pages from search.
    • Activate or Deactivate page rule.

    Leveraging Logical Rules: Page rules leverages logical rules, it mean we can use the logical rules for defining page rules.

    Simple User Cases:

    • Pages by User Id.
    • Pages by User Role.
    • Pages by Request URL.
    • Pages by Date, Time, Month and Day of the week.
    • Pages by Tablet.
    • Pages by Mobile.
    • Page by device iphone, blackberry and more…
    • Many more we can define ….

    Complex Use Cases : Complex rules are defined using logical “and” “or” and “brackets”.

    • Pages by User Role and Date and Time.
    • Pages by User Id and Geo location.
    • Pages by User Role or Geo location and Date and Time.
    • Pages by User Email or Geo location and Mobile Device and Date and Time.
    • Pages by User Role and Geo location or Tablet Device or Request URL and Date and Time and More …
    • Many more we can define ….

    RulesEngine - WordPress Access and Content Controller

  • Post Rule:
    • Hide Posts.
    • Append dynamic html content or image at any desired location using generated “Shortcode”.
    • Define rule for Including Third-Party “Shortcode”.
    • Append dynamic html content or image to the top/bottom of the post.
    • Show modal dialog with dynamic content.
    • Replace post content.
    • Excludes hidden and replaced posts from search.
    • Activate or Deactivate post rule.

    Leveraging Logical Rules: Post rules leverages logical rules, it mean we can use the logical rules for defining post rules.

    Simple User Cases:

    • Posts by User Id.
    • Posts by User Role.
    • Posts by Request URL.
    • Posts by Date, Time, Month and Day of the week.
    • Posts by Tablet.
    • Posts by Mobile.
    • Posts by device iphone, blackberry and more…
    • Many more we can define ….

    Complex Use Cases : Complex rules are defined using logical “and” “or” and “brackets”.

    • Posts by User Role and Date and Time.
    • Posts by User Id and Geo location.
    • Posts by User Role or Geo location and Date and Time.
    • Posts by User Email or Geo location and Mobile Device and Date and Time.
    • Posts by User Role and Geo location or Tablet Device or Request URL and Date and Time and More …
    • Many more we can define ….

  • Category Rule:
    • Hide Categories.
    • Activate or Deactivate category rule.

    Leveraging Logical Rules: Category rules leverages logical rules, it mean we can use the logical rules for defining category rules.

    Simple User Cases:

    • Categories by User Id.
    • Categories by User Role.
    • Categories by Page.
    • Categories by Post.
    • Categories by Request URL.
    • Categories by Date, Time, Month and Day of the week.
    • Categories by Tablet.
    • Categories by Mobile.
    • Categories by device iphone, blackberry and more…
    • Many more we can define ….

    Complex Use Cases : Complex rules are defined using logical “and” “or” and “brackets”.

    • Categories by User Role and Date and Time.
    • Categories by User Id and Geo location.
    • Categories by User Role or Geo location and Date and Time.
    • Categories by User Email or Geo location and Mobile Device and Date and Time.
    • Categories by User Role and Geo location or Tablet Device or Request URL and Date and Time and More …
    • Many more we can define ….

  • Widget Rule:
    • Hide Widgets.
    • Activate or Deactivate widget rule.

    Leveraging Logical Rules: Widget rules leverages logical rules, it mean we can use the logical rules for defining widget rules.

    Simple User Cases:

    • Widgets by User Id.
    • Widgets by User Role.
    • Widgets by Page.
    • Widgets by Post.
    • Widgets by Request URL.
    • Widgets by Date, Time, Month and Day of the week.
    • Widgets by Tablet.
    • Widgets by Mobile.
    • Widgets by device iphone, blackberry and more…
    • Many more we can define ….

    Complex Use Cases : Complex rules are defined using logical “and” “or” and “brackets”.

    • Widgets by User Role and Date and Time.
    • Widgets by User Id and Geo location.
    • Widgets by User Role or Geo location and Date and Time.
    • Widgets by User Email or Geo location and Mobile Device and Date and Time.
    • Widgets by User Role and Geo location or Tablet Device or Request URL and Date and Time and More …
    • Many more we can define ….

  • Theme Rule:
    • Theme Rules are used to define rules for showing different themes based on the selected logical rule
    • Activate or Deactivate theme rule.

    Leveraging Logical Rules: Theme rules leverages logical rules, it mean we can use the logical rules for defining theme rules.

    Simple User Cases:

    • Theme by User Id.
    • Theme by User Role.
    • Theme by Date, Time, Month and Day of the week.
    • Theme by Tablet.
    • Theme by Mobile.
    • Theme by device iphone, blackberry and more…
    • Many more we can define ….

    Complex Use Cases: Complex rules are defined using logical “and” “or” and “brackets”.

    • Theme by User Role and Date and Time.
    • Theme by User Id and Geo location.
    • Theme by User Role or Geo location and Date and Time.
    • Theme by User Email or Geo location and Mobile Device and Date and Time.
    • Theme by User Role and Geo location or Tablet Device or Request URL and Date and Time and More …
    • Many more we can define ….

  • Redirect Rule:
    • Redirect Rules are used to define rules for URL redirection based on the selected logical rule.
    • Activate or Deactivate redirect rule.

    Leveraging Logical Rules: Redirect rules leverages logical rules, it mean we can use the logical rules for defining redirect rules.

    Simple User Cases:

    • Redirect by User Id.
    • Redirect by User Role.
    • Redirect by Page.
    • Redirect by Post.
    • Redirect by Request URL.
    • Redirect by Date, Time, Month and Day of the week.
    • Redirect by Tablet.
    • Redirect by Mobile.
    • Redirect by device iphone, blackberry and more…
    • Many more we can define ….

    Complex Use Cases : Complex rules are defined using logical “and” “or” and “brackets”.

    • Redirect by User Role and Date and Time
    • Redirect by User Id and Geo location
    • Redirect by User Role or Geo location and Date and Time
    • Redirect by User Email or Geo location and Mobile Device and Date and Time
    • Redirect by User Role and Geo location or Tablet Device or Request URL and Date and Time and More …
    • Many more we can define ….

    General Features

    • Define a dynamic hook using Rules Engine which will be called by plugin once the rule is satisfied.
    • Access the status of the Logical Rule using the utility method from your code.
      RulesEngine::is_rule_valid("Rule Name");
    • User Friendly easy-to-use Ajax interface.
    • Reduces development effort and easy to maintain
    • Activate or Deactivate Parent Rule (Logical Rule) and Child rules (Page, Post, Theme Rules etc). If Parent Rule is deactivated all the corresponding child rules will become inactive.
    • Translation ready (Localization support)
    • Easy to upgrade.

    Supports commonly used use cases.

    • Simple Ad Manager: Page or Post rule defined with images will act like a simple Ad manager. Using this rule we can use an Ad image with a logical rule defined with Date/Page/Geographic location etc to show image Ad on respective Pages or Posts.
    • Notification Manager: Dynamic html content can be inserted into a Page or Post at desired location and will act like a Notification Manager. We can create a Page or Post rule with “Append content” action to insert a dynamic html and Logical Rule defined with Date/Page/Geographic location etc to show notifications on respective Dates/Pages/Geolocation etc.
    • Restricted Pages: These page are available only authenticated users, guest users will be redirected to login page.
    • Show Greetings or Important messages: Using RulesEngine we can show greetings or important message such as “New Year” or “Christmas” or “Year End Sales” discounts page or System downtime.
    • Themes by Geo Location: Using RuleEngine, we can show a different Theme for a specific geographic location country or continent then define a logical rule using “Geo Location” Criteria. This is useful for theme is very useful for Middle East countries.
    • Themes by Date and Time: Using RuleEngine, we can show a different Theme on special themes on “New Year” or “Christmas” etc… , and these theme should be available for only few days or months, in such cases define a Logical rule using “Date and Time” criteria. You can use Date, Time, Day of Week and Month sub criteria to further refine the rule.
    • Themes by Device Type: Show a light weight theme for Mobile and Tablet devices and default theme for desktop users.
    • Redirect for Mobile Sites:Redirect to mobile sites for requests coming from mobile or tablet devices.
    • Redirect Secure Pages : We can configure Pages as Secure pages and these pages content will be shown only for authenticated users. Guest users will be redirected to Login Page upon clicking on Secure Pages.

    RulesEngine v3.3 – July 17, 2015

           1.WooCommerce categories support for Category Rules.       2.Bug fixes. 

    RulesEngine v3.0 – June 15, 2015

           1.Full edit feature is provided for Logical Rules, Now admin can redefine an existing rule.       2.Dashboard page added for RuleEngine for better usability.       3.Now admin can define Logical rules based on language.(i.e: Switch Theme by language, Hide pages by language etc.)               Note: This feature works for WordPress 4.0 and above.       4.Now admin can define Logical rules based on IP Address.(i.e: Redirect using IP Address, Switch Theme by IP Address etc.)       5.UI Facelift.       6.Wordpress 4.2 support 

    RulesEngine v2.1 – April 18, 2015

           1.Auto cache clearing logic implemented. No need to clear browser cache for create or update of rules.        2.Minor bug fixes. 

    RulesEngine v2.0 – April 14, 2015

           1.Translation ready (Localization support for RulesEngine).       2.Support for wordpress 3.7, 3.8 and 3.9. 

    RulesEngine v1.1 – March 23, 2015

         1.RulesEngine now supports defining the rules for ThirdParty Shortcodes.        This feature is provided in Page and Post rules.     2.Namespace added for Bootstrap css to resolve css conflict issues.     3.Removed Bootstrap css from end user site.     4.Bug fixes. 

    RulesEngine - WordPress Access and Content Controller