=== News Sitemap Generator By KumarHarshit.In ===
Contributors: kumarharshit
Donate link: https://kumarharshit.in/
Tags: news, sitemap, google news, xml, seo
Requires at least: 5.0
Tested up to: 6.8
Requires PHP: 7.0
Stable tag: 7.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Plugin URI: https://kumarharshit.in/news-sitemap-generator-plugin
Author: KumarHarshit.In
Author URI: https://kumarharshit.in
News Sitemap Generator — Automatically generate a Google News sitemap with zero configuration.

== Description ==
News Sitemap Generator creates a real-time, Google News-compatible XML sitemap for WordPress posts in 1 click.

**Key Features:**
* Generates sitemap only for posts published within the last 48 hours.
* Fully automated: zero user setup required after activation.
* Real-time caching for performance and scalability (30-minute cache by default).
* Handles all 6 WordPress permalink structures.
* Compatible with Google News, Search Console, Bing Webmaster, and other search engines.
* Includes `<news:news>` tags with publication name, language, publication date, and post title.
* Scales to thousands of posts without server overload.
* Automatically removes posts older than 48 hours from the sitemap.
* Easy access via "📄 View News Sitemap" link in the Plugins page.
* SEO-friendly and Google News compliant.

Ideal for news websites and blogs publishing time-sensitive content who want immediate indexing in search engines.

== Installation ==

1. Go to your WordPress admin dashboard.
2. Navigate to Plugins > Add New.
3. In the search bar, type the full plugin name: 
   "News Sitemap Generator By KumarHarshit.In".
4. Click "Install Now" on the plugin from the search results.
5. Activate the plugin.
6. Ensure your permalinks are set (any structure works; plugin handles all types).
7. View your sitemap via the "📄 View News Sitemap" link in the Plugins page, or access directly:
   - Pretty permalinks: https://example.com/kumarharshit-news-sitemap.xml
   - Plain permalinks: https://example.com/?khnsg_news_sitemap=1
8. No additional configuration required — the plugin will automatically generate and update the sitemap every 30 minutes (default cache).

*Optional (manual installation)*: Download the plugin zip, upload the `news-sitemap-generator-by-kumarharshit-in` folder to `/wp-content/plugins/`, and activate it.

For detailed instructions, screenshots, and updates, visit our plugin page: https://kumarharshit.in/news-sitemap-generator-plugin

== Screenshots ==

1. screenshot-1.png - Shows the "📄 View News Sitemap" link in the Plugins page.
2. screenshot-2.png - Example of the generated Google News XML sitemap for recent posts.
3. screenshot-3.png - Google Search Console showing the submitted News Sitemap with success status and discovered pages.

== Frequently Asked Questions ==

= How often is the sitemap updated? =
The sitemap updates automatically in real time with a safe 30-minute cache (default). No manual work is required.

= Does it support all WordPress permalink types? =
Yes. The plugin handles all 6 permalink structures and automatically updates rewrite rules if permalinks change.

= Can I use this on a news website with thousands of posts? =
Yes. The plugin is optimized for performance and only includes posts from the last 48 hours, so it scales efficiently.

= Do I need to configure anything after activation? =
No configuration is required. Once activated, the plugin generates the sitemap automatically and handles caching, cleanup, and updates.

= Is it compatible with Google News and other search engines? =
Absolutely. The XML sitemap is Google News-compliant and can be submitted to Google Search Console, Bing Webmaster Tools, and other search engines.

== Changelog ==
= 7.0 =
* Fixed critical bug where sitemap showed error on the first visit after cache expiry.
* Fixed issue where sitemap didn’t update correctly when posts became older than 48 hours or when new posts were published.
* Improved caching mechanism (default 30 minutes) for better stability and scalability.
* More reliable real-time updates without broken XML errors.

= 2.0 =
* Fixed “headers already sent” bug affecting first sitemap load after publishing posts.
* Improved cache handling for real-time updates.
* Minor stability fixes, no feature changes.
* Automatic real-time Google News sitemap generation.
* Supports posts published within the last 48 hours only.
* Full support for all WordPress permalink types.
* 5-minute caching for performance and scalability.
* Sitemap accessible from plugin action link.
* SEO-friendly and Google News compliant.

