=== TechArk MetaBatch Importer ===
Contributors: gotechark, denilmehta08
Donate link: https://gotechark.com/
Tags: metadata, meta tags, bulk editor, bulk update, csv import, seo, rankmath, aioseo, yoast
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.03
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Bulk update SEO metadata across WordPress content using a CSV file. Supports Yoast SEO, All in One SEO, and Rank Math.

== Description ==

**TechArk MetaBatch Importer** allows administrators to efficiently manage and update SEO-related metadata using a streamlined CSV-based workflow.

Instead of manually editing meta titles and descriptions one by one, you can upload a CSV file containing URLs and metadata values, select the fields to update, and apply changes in a single operation.

This plugin is designed to be a universal updater, automatically detecting and working with the most popular SEO plugins on the market. It is ideal for large websites where manual metadata updates would otherwise take significant time.

The plugin works alongside supported SEO plugins and does not replace or modify their core functionality.

---

== Features ==

- **Multi-Plugin Support:** Native compatibility with Yoast SEO, All in One SEO (AIOSEO), and Rank Math.
- **Smart CSV Column Auto-Selection:** Automatically reads CSV column headers upon upload and auto-checks the corresponding metadata fields with visual feedback.
- **Open Graph (OG) Image Support:** Bulk update social sharing preview images with automatic media attachment ID mapping.
- **Universal Delimiter Detection:** Automatically supports comma (`,`), semicolon (`;`), and tab (`\t`) delimited CSV files.
- **Interactive Result & History Modals:** Dedicated popup dialogs showing detailed import breakdowns (Updated, Skipped, and Failed) with instant search filtering and one-click "Copy All URLs" to clipboard.
- **Semicolon-to-Comma Auto-Sanitization:** Automatically converts semicolons to commas for Meta & OG titles and descriptions across database postmeta, Yoast indexables, and frontend display filters.
- **AJAX Powered:** Bulk update metadata without full page reloads.
- **Smart SEO Plugin Detection:** Automatically identifies the active SEO plugin and maps metadata fields accordingly.
- **Cross-Domain URL Matching:** Intelligent fallback resolves live domain URLs to local/staging environments seamlessly.
- **Cache Purge Integration:** Automatically purges post cache and integrates with NitroPack, WP Rocket, W3 Total Cache, LiteSpeed, and WP Super Cache.
- **Full PHP Compatibility:** Tested and optimized for PHP 7.4 through PHP 8.4+.

---

== How It Works ==

1. Download the sample CSV file from the plugin interface.
2. Add URLs and metadata values to the CSV file.
3. Upload the CSV file using drag and drop or file browse.
4. The plugin automatically detects columns present in your CSV and pre-selects the corresponding update fields.
5. Review the instant CSV preview table.
6. Click **Upload & Update Metadata** to apply changes via AJAX.
7. View detailed results in the popup modal or inspect past imports anytime in **Import History**.

---

== CSV File Requirements ==

- The CSV file must include a **URL** column.
- Supported columns: `URL`, `Meta Title`, `Meta Description`, `OG Title`, `OG Description`, `OG Image`, `Focus Keyword`, `Twitter Title`, `Twitter Description`.
- Supports both standard comma (`,`) and semicolon (`;`) delimited CSV files.
- UTF-8 encoding is recommended for non-English characters.

---

== SEO Plugin Compatibility ==

TechArk MetaBatch Importer is compatible with the latest versions of:
- **Yoast SEO**
- **Rank Math SEO**
- **All in One SEO (AIOSEO)**

*Trademarks are the property of their respective owners. This plugin is an independent tool and is not affiliated with Yoast BV, Rank Math SEO, or AIOSEO.*

---

== Installation ==

1. Upload the `metabatch` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Navigate to **TechArk MetaBatch** in your WordPress admin sidebar.

---

== Frequently Asked Questions ==

= Does this work with Rank Math or AIOSEO? =
Yes! Both Rank Math and All in One SEO are fully supported alongside Yoast SEO.

---

= What happens if I upload the same data twice? =
The plugin uses a smart comparison check; if the metadata in your CSV matches what is already saved in the database, it skips the row to avoid unnecessary database writes and logs it in the Skipped URLs list.

---

= Can I update Open Graph (social share) images? =
Yes! Include an `OG Image` column with image URLs in your CSV. The plugin automatically updates the meta tags and resolves the image to WordPress attachment IDs.

---

= Does it support semicolon-separated CSV files? =
Yes. The plugin automatically detects whether your CSV uses commas, semicolons, or tabs as the delimiter.

---

= Does it support page reloads? =
Version 1.1.0+ uses AJAX for a smoother, faster experience without refreshing the page.

---

== Screenshots ==

1. Universal SEO plugin detection and AJAX upload wizard with column auto-selection.
2. Interactive Import History table with dedicated popup URL inspector.
3. Live CSV preview table and field selection.

---

== Changelog ==

= 1.1.03 =
- Added smart CSV header auto-detection that automatically pre-selects metadata field checkboxes based on uploaded CSV columns.
- Added Open Graph (OG) Image bulk update support with media attachment ID resolution across Yoast, Rank Math, and AIOSEO.
- Added universal CSV delimiter auto-detection for comma (`,`), semicolon (`;`), and tab (`\t`) files.
- Added automatic semicolon-to-comma sanitization for Meta and OG titles/descriptions across database and frontend display filters.
- Redesigned Import History table with uniform row heights and dedicated History URLs Viewer modal dialog (search filter & one-click copy-all).
- Added dedicated Import Result popup modal with live counts for Updated, Skipped, and Failed URLs.
- Added full PHP 7.4 through PHP 8.4+ compatibility, resolving PHP 8.4 fgetcsv escape deprecations and PHP 8.1+ null-safe string handling.
- Added cross-domain URL matching fallback for local and staging environments.
- Added automatic post cache and cache plugin purging (NitroPack, WP Rocket, W3TC, LiteSpeed, WP Super Cache).
- Enhanced server error protection with row-level error handling and execution timeout extension.

= 1.1.02 =
- Performance and query optimizations.
- Enhanced upload result tracking and change detection.

= 1.1.01 =
- Added full support for Rank Math SEO.
- Added full support for All in One SEO (AIOSEO).
- Enhanced button-locking logic to prevent empty uploads.

= 1.0.0 =
- Initial release.
