=== TA4A Newsroom Pulse & Payroll ===
Contributors: ta4a
Donate link: https://www.ta4a.net/
Tags: newsroom, editorial, payroll, author stats, analytics
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

High-performance newsroom analytics, editor performance tracking, and monthly payroll calculation for enterprise WordPress publishers.

== Description ==

**TA4A Newsroom Pulse & Payroll** is an enterprise-grade editorial analytics and compensation management platform built specifically for large-scale news agencies, digital publishers, and multi-author magazines.

Engineered to handle massive archives exceeding **370,000+ articles** and editorial teams of **200+ editors and journalists**, it eliminates database bottlenecks by utilizing an ultra-fast, dedicated aggregation engine.

Calculate monthly author compensation, track production quotas, evaluate 24-hour publishing shifts, and export verified payroll sheets to Excel and CSV with a single click.

### 🌟 Key Features

* **⚡ Big Data Architecture (370k+ Posts Optimized):** Zero performance degradation. Utilizes an indexed micro-table (`wp_ta4a_newsroom_stats`) with lightning-fast sub-millisecond aggregation queries.
* **💰 Automated Monthly Payroll Engine:** Calculate remuneration for 200+ authors in seconds. Supports flat rates, tiered rates based on word count, and monthly production target bonuses.
* **📊 Sitewide Editorial Analytics:** Track publishing velocity, total content volume, active journalists, and 24-hour hourly heatmap coverage.
* **👤 Author Self-Service Portal:** Journalists can monitor their own personal article counts, target progress, and estimated earnings without exposing other authors' compensation.
* **📥 One-Click Payroll Export:** Download comprehensive payroll sheets formatted for Microsoft Excel (with UTF-8 BOM Arabic support) or print clean PDF summaries.
* **🔄 Safe Historical Data Synchronizer:** Index decades of historical archives in gentle, background micro-batches (500 posts per chunk) without server strain.

== Installation ==

1. Upload the `ta4a-newsroom-pulse` folder to the `/wp-content/plugins/` directory, or install the ZIP file via **Plugins > Add New > Upload Plugin**.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Navigate to **Newsroom Pulse > Payroll Settings** to define your currency, rates, and target bonuses.
4. If you have an existing archive of posts, visit **Newsroom Pulse > Historical Indexer** and click **Start Synchronization**.

== Frequently Asked Questions ==

= Does this plugin slow down websites with hundreds of thousands of posts? =
No. Standard WordPress plugins perform heavy queries on `wp_posts` and `wp_postmeta`. TA4A Newsroom Pulse uses a lightweight, indexed summary table updated incrementally when articles are published. Even with over 500,000 articles, dashboard and payroll queries complete in under 50 milliseconds.

= Can authors see each other's earnings? =
No. Role-based permission controls strictly separate access. Only administrators can view sitewide financials and payroll sheets. Authors and contributors can only view their own personal statistics.

= Does the Excel export support Arabic characters? =
Yes. CSV exports include the UTF-8 Byte Order Mark (BOM), ensuring Arabic names and titles display without character encoding issues in all spreadsheet applications.

== Changelog ==

= 1.2.3 =
* Fix: Solved AJAX connection error in Audit & Inspection Modal caused by origin/protocol/www host mismatches.
* Fix: Prevented duplicate dashboard rendering on wide screens and admin submenu hooks.
* Feature: Added real-time search and pagination (50 posts/page) inside the audit inspection modal.
* Feature: Added live dynamic counter badges on modal tabs (All, Excluded, Approved).
* Enhancement: Optimized UTF-8 title sanitization and increased article audit query limit to 5,000 posts.

= 1.0.0 =
* Initial public release with big-data aggregation, payroll calculation, and author self-service portal.

