=== DealRelations Listings ===
Contributors: dealrelations
Text Domain: dealrelations-listings
Tags: listings, marketplace, directory, business brokers, business for sale
Requires at least: 5.4
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.3.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A plugin to pull business listings from JSON feeds and display them in a responsive grid with detail pages.

== Description ==
DealRelations Listings lets you display business listings from one or more JSON feeds in a responsive grid using the `[dealrelations_listings]` shortcode.  
Each card links to a detail page with pricing, revenue, profits, description, and a customizable inquiry button.  

The plugin only fetches data from the feeds you configure. It does not collect or send visitor data.

Features:
* Display listings from multiple JSON feeds
* Adjust grid columns for responsive layouts
* Search listings and paginate results
* View full details with back navigation
* Customize inquiry button text and color


== Installation ==
1. Upload the `dealrelations-listings` folder to `/wp-content/plugins/`, or install it via the WordPress plugin installer.  
2. Activate through **Plugins → Installed Plugins**.  
3. Add the shortcode `[dealrelations_listings]` to any page or post.
Note: [deal_listings] also works for backward compatibility but is deprecated. Please use [dealrelations_listings] for new sites.


== Frequently Asked Questions ==

= How do I add multiple feeds? =
Go to **Settings → Deal Listings** and enter one feed URL per line.  
You can add a label with a pipe, e.g. `BrokerA|https://example.com/feed.json`.

= How do I change the inquiry button? =
Add shortcode attributes, e.g. `[dealrelations_listings button_text="Contact Seller" button_color="#10b981"]`.

= Can I show only one feed? =
Yes. Use the `feed` attribute, e.g. `[dealrelations_listings feed="BrokerA" per_page="12" columns="3"]`.

= Does it work with Elementor or the block editor? =
Yes. Insert the shortcode in any block, widget, or editor that supports shortcodes.


== Screenshots ==
1. Listings grid with images, price, revenue, and profits.  
2. Single listing page with gallery, stats, and inquiry button.  
3. Admin settings with feed setup and shortcode examples.  

== External Services ==
This plugin connects to external JSON feeds to fetch listing data.

**Service provider:** DealRelations Inc. – https://dealrelations.com  
**Example feed URL:** https://demo.dealrelations.com/listing_feeds/38.json (demo only — site owners must use their own account feeds).  
**Purpose:** To display business listings in WordPress.  

**What data is sent:**  
A standard HTTP request from your WordPress site to the configured feed URL.  
No visitor or personal data is sent.  

**What data is received:**  
Public listing data fields, which may include:  
- fields.id  
- fields.link_title  
- fields.price  
- fields.sales  
- fields.profits  
- fields.description  
- fields.agent_name  
- fields.comma_separated_picture_urls  
- structured_data  
- json_url  

**Terms and Privacy:**
- Privacy Policy: https://dealrelations.com/pages/privacy-policy 

DealRelations Inc. may count feed requests to prevent abuse or enforce service limits. No visitor data is collected or transmitted.


== Changelog ==

= 1.3.4 =
* Removed all caching functionality - listings now always fetch fresh data from API
* Eliminated transient storage and cache_minutes setting
* Fixed stale listing data issues - edits in DealRelations now appear immediately on WordPress
* Simplified admin settings by removing cache configuration

= 1.3.3 =
* Implemented AJAX search using WordPress proxy to DealRelations API - searches all listings without page reload
* Merged pagination improvements and json_url performance optimization
* Fixed undefined $listing variable in templates
* Added header fallback template for better theme compatibility

= 1.3.1 =
* Simplified header/footer logic
* Removed block theme detection
* Fixed Elementor compatibility

= 1.3.0 =
* Feature: Added support for disabling caching (`cache_minutes = 0`) via settings or shortcode.
* Enhancement: Admin field now allows entering 0 as a valid cache duration.


= 1.1.3 =
* Added External Services documentation for WordPress.org compliance.

= 1.1.2 =
* Security: added ABSPATH checks to template files.  

= 1.1.0 =
* Initial release.  


== Upgrade Notice ==

= 1.1.3 =
Compliance update: documented external service usage.

= 1.1.2 =
Security update.  

= 1.1.0 =
Initial release.  


== Privacy ==
This plugin fetches listings from external JSON feeds configured by the site administrator. The feeds contain business listing data such as title, description, price, and contact details. No personal user data is ever collected or sent externally — the plugin only fetches public feed data.
