=== Barar Menu Visibility Rules ===
Contributors: atikhosenpro
Tags: menu, navigation, visibility, WooCommerce, conditional
Requires at least: 6.0
Tested up to: 7.0
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Control WordPress menu visibility with conditional rules for roles, devices, pages, post types, scheduling, URLs, referral, geolocation, and WooCommerce.

== Description ==

Barar Menu Visibility Rules gives you granular control over which menu items are shown to your visitors. No coding required — configure everything directly in the WordPress menu editor.

== Features ==

* **User Status** — Show items to everyone, logged-in users, or logged-out users
* **User Roles** — Target specific WordPress user roles (admin, editor, subscriber, etc.)
* **Specific Pages** — Show or hide items on specific pages or URLs
* **Devices** — Display items based on desktop, tablet, or mobile devices
* **Page Categories** — Control visibility on category archive pages
* **Post Types** — Show or hide on specific post type archives and single views
* **Date & Time** — Schedule menu items to appear within specific date and time ranges
* **URL Parameters** — Toggle visibility based on URL query parameters (e.g., ?campaign=summer)
* **Referral URL** — Show or hide items based on the HTTP Referer header
* **Country** — Target visitors by country using IP geolocation
* **City** — Target visitors by city using IP geolocation
* **WooCommerce Cart** — Show items based on cart status (requires WooCommerce)

Combine multiple conditions using AND/OR logic for advanced targeting. Lightweight, secure, and compatible with all modern WordPress themes.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/barar-menu-visibility-rules/`, or install through the WordPress plugins screen.
2. Activate the plugin through the Plugins screen.
3. Go to Appearance > Menus and configure visibility rules on individual menu items.

== Frequently Asked Questions ==

=== Does this work with any theme? ===

Yes, this plugin works with any WordPress theme that uses the standard WordPress menu system.

=== Does it support WooCommerce? ===

Yes. When WooCommerce is active, a cart status condition type becomes available.

=== Can I combine multiple conditions? ===

Yes. You can add multiple conditions per menu item and choose between AND (all conditions must match) or OR (any condition must match) logic.

=== Does this plugin use external services? ===

Country and city conditions use ip-api.com (free) to determine visitor location based on IP address. Geolocation data is cached locally for 1 hour. No personal data is stored or transmitted beyond the IP address lookup. CloudFlare users can also use CF-IPCountry header.

=== How does country/city detection work? ===

The plugin detects visitor location using their IP address, checked against CloudFlare headers (if available) or the ip-api.com geolocation service. This data is cached per IP for one hour. If geolocation is unavailable, the condition is skipped (menu item remains visible).

== Screenshots ==

1. Visibility rule configuration interface in the menu editor.

== Upgrade Notice ==

= 1.0.0 =
Initial release.

== Changelog ==

= 1.0.0 =
* Initial release