CodeCanyon

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 v4.5
RulesEngine verion 4.5 is a major release and included below features.
  • New WordPress and WooCommerce category added, so that customer can define logical rule using categories. Using the categories, Customers can control page, widgets, redirect, posts etc.
  • New subcategory “Referral URL” added, which enables customers to define rules using the source of request. The Referral URL can also from Third-Party websites.
  • “At least Once” rule evaluation feature added in Logical Rules, which is useful if the customer want to perform action repeatedly if the rule is satisfied at-least once.

Customer_feeback_heading Review1Review2Review3

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)
  • Simple_Rule
  • 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.
  • SubscriberHiddenPages
    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 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.
    • Soft Hide Pages/Menus, useful if you want to hide pages/menu but want them to accessible using direct url.
    • 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 Country, City or Region.
    • 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 ….

  • Post Rule:
    • Hide Posts.
    • Posts by Country, City or Region.
    • 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.
    • Soft Hide Categories. (Categories will be hidden but accessible using direct URL
    • 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 Country, City or Region.
    • 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 Continent, Country, City or Region.
    • 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 Continent, Country, City or Region.
    • 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 Continent, Country, City or Region.
    • 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 v4.9 – 30 May 2016
    RulesEngine verion 4.8 includes below features.
    1.Additional conditions (Contains Any Of) support add for IP Address.
    2.Bug fixes.
    
    RulesEngine v4.8 – 05 May 2016
    RulesEngine verion 4.8 includes below features.
    1.Additional conditions (Contains and does not contains) support add for Referral URL.
    2.Bug fixes.
    
    RulesEngine v4.5 – 12 March 2016
    RulesEngine verion 4.5 is a major release and included below features.
    
    1.New WordPress and WooCommerce category added, so that customer can define logical rule using categories. Using the categories customers can control page, widgets, redirect, posts etc.
    
    2.New subcategory called Referral URL added, which enables customers to define rules using the source of request. The Referral URL can also from Third-Party websites.
    
    3."At least Once" rule evaluation feature added in Logical Rules, which is useful if the customer want to perform action repeatedly if the rule is satisfied at-least once.
    
    4.Bug fixes.
    
    RulesEngine v4.1 – 12 February 2016
    1.Fixed Plugin activation issue on only SSL enabled servers.
    2.Increased rule value column to fit more values.
    3.Fixed compatibility issue with Download Manager plugin.
    4.Enhanced Guest User category to support Not Equal condition.
    5.Other minor bug fixes.
    
    RulesEngine v4.0 – 1 Jan 2016
      Minor Bug fixes.
    
    RulesEngine v3.9 – November 16, 2015
    1.Category rules hide feature: This feature will enable customers to hide the category but can be accessible using the direct URL and product/posts belongs to the soft hide category can be searched.
    2.Redirect Rules. Now we can now add www in the redirect target url
    3.WordPress 4.3.1 support.
    4.Minor Bug fixes.
    
    RulesEngine v3.7 – September 27, 2015
    1.Soft Page Hide feature added: Using Soft Page Hide, we can hide the page/menu but can be accessible using 
    direct URL.
    2.WordPress 4.3 support.
    3.Bug fixes.
    
    RulesEngine v3.5 – August 09, 2015
    Two new categories City and Region added. Now we can have
        1.Pages by City or Region.
        2.Posts by City or Region.
        3.Widgets by City or Region.
        4.Categories by City or Region.
        5.WooCommerce Categories by City or Region, extremely useful for Retail Online stores.
        6.Switch Theme by City or Region, Surprise your customer with custom theme specific to City.
        7.Redirect Users from a particular City or Region.     
    
    RulesEngine v3.4 – July 27, 2015
          1.Products excluded from hidden categories.
          2.Hidden categories products are excluded from search.   
          3.Categories are grouped by Parent Categories.
    
    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.
    
    by
    by
    by
    by
    by
    by