=== WKSS Japan Address Helper ===
Contributors: wkss
Tags: woocommerce, japan, address, postcode, zipcode
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.8
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Helps WooCommerce stores in Japan fill address fields from Japanese postal codes.

== Description ==

WKSS Japan Address Helper helps WooCommerce stores in Japan fill address fields from Japanese postal codes.

For normal customer address lookup, this plugin does not use AjaxZip3 or any external lookup API. Address lookup is performed against a local postal code database stored in WordPress.

The plugin connects to Japan Post only when an administrator manually runs the postal code database update from the settings screen.

= Main Features =

* Supports WooCommerce checkout, cart, and account address forms.
* Supports WooCommerce Blocks checkout and cart address field updates.
* Helps fill prefecture, city, and town address fields from Japanese postal codes.
* Uses a local postal code database for normal address lookup.
* Does not send customer address lookup data to Japan Post or any external service during checkout or address entry.
* Downloads official Japan Post postal code CSV data only when an administrator manually runs the postal database update.
* Provides a tabbed settings screen for basic settings, address validation, postal code data, and implementation notes.
* Adds address validation options to warn or block checkout when an address may be missing street/block details.
* Address validation can target billing address, shipping address, or both.
* Warning and blocking messages can be edited from the settings screen.
* Adds a settings link to the plugin list.
* Shows the plugin version on the settings screen.

== External Services ==

This plugin can download a postal code CSV file from Japan Post only when an administrator clicks the postal database update button in the settings screen.

= What the service is used for =

* Downloading official Japanese postal code CSV data from Japan Post.

= What data is sent and when =

* The server sends a request to Japan Post to download the ZIP file only when an administrator manually runs the postal database update.
* No customer address, checkout data, or personal information is sent to Japan Post during address lookup.
* The plugin does not contact Japan Post or any external service during customer checkout or address entry.

= Service provider =

* Japan Post
* Service information: https://www.post.japanpost.jp/service/search/zipcode/download/utf-zip.html
* Terms: https://www.post.japanpost.jp/
* Privacy policy: https://www.post.japanpost.jp/privacy.html

Customer address lookup uses the local postal code database stored in WordPress.

== Requirements ==

* WordPress 6.0 or later
* PHP 7.4 or later
* WooCommerce

== Installation ==

1. Install the plugin from the WordPress plugin screen, or upload the plugin ZIP file.
2. Activate the plugin through the Plugins screen in WordPress.
3. Make sure WooCommerce is active.
4. Open the WKSS Japan Address Helper settings screen.
5. Update the postal code database if needed.
6. Configure address validation options if you want to warn or block checkout when address details may be incomplete.

== Frequently Asked Questions ==

= Does this plugin send customer address data to an external service? =

No. Customer address lookup uses the local postal code database stored in WordPress.

= Does this plugin use AjaxZip3? =

No. This plugin does not use AjaxZip3 for normal customer address lookup.

= When does this plugin access Japan Post? =

Only when an administrator manually runs the postal code database update from the settings screen.

= Does this plugin support WooCommerce Blocks? =

Yes. The plugin supports WooCommerce Blocks checkout and cart address field updates.

= Is WooCommerce required? =

Yes. This plugin is designed for WooCommerce address fields.

= Can address validation stop checkout? =

Yes. The address validation feature can be set to off, warning mode, or blocking mode. It can target billing address, shipping address, or both.

== Changelog ==

= 1.1.8 =
* Updated the readme content in English for WordPress.org Plugin Check compatibility.
* Updated the plugin short description for WordPress.org compatibility.
* Kept the v1.1.6 and v1.1.7 feature set while preparing the package for WordPress.org release.

= 1.1.7 =
* Updated WordPress.org release metadata after v1.1.6 internal testing.
* Updated the tested WordPress version header.
* Prepared the readme short description for WordPress.org Plugin Check compatibility.

= 1.1.6 =
* Added a tabbed settings screen.
* Added address validation settings.
* Added warning mode and blocking mode for incomplete address detection.
* Added billing, shipping, and both-address validation targets.
* Added configurable warning and blocking messages.
* Organized postal code database tools and implementation notes into dedicated settings tabs.

= 1.1.4 =
* Updated the WordPress.org plugin card short description and main description.
* Prepared WordPress.org plugin directory icon assets.

= 1.1.3 =
* Reduced Plugin Check errors related to filesystem access, uploaded CSV handling, and prepared SQL checks.
* Removed the explicit time limit call during CSV import.

= 1.1.2 =
* Added explicit nonce verification before admin form processing.
* Reduced Plugin Check warnings for form handling and prepared SQL usage.

= 1.1.1 =
* Added SHA-256 hash comparison for downloaded postal data to skip unchanged ZIP files before extraction and CSV import.

= 1.1.0 =
* Changed postal CSV import to stream line-by-line to reduce memory usage during updates.
* Added a current-data check to skip unnecessary re-imports when the same postal data is already stored.
* Added a force re-import button for manual maintenance.

= 1.0.9 =
* Improved settings screen layout for postal database details.
* Split the lead description into clearer lines.
* Improved source URL display to avoid narrow table label wrapping.
* Rechecked plugin metadata, readme stable tag, and PHP syntax.

= 1.0.8 =
* Updated Japan Post data source discovery to use the current UTF-8 ZIP download page.
* Improved relative ZIP URL resolution.
* Improved postal database update error messages.

= 1.0.7 =
* Updated Japan Post download page handling.
* Added support for CSV or ZIP links discovered from the Japan Post download page.

= 1.0.6 =
* Added Japan Post download page discovery before fallback direct URLs.
* Improved handling of redirects and response headers for postal data downloads.

= 1.0.5 =
* Improved Japan Post CSV ZIP download handling.
* Added fallback download URLs and ZIP validation for postal database updates.
* Added Shift_JIS/CP932 conversion support for legacy KEN_ALL.CSV imports.

= 1.0.4 =
* Renamed the plugin to WKSS Japan Address Helper.
* Updated the plugin slug and text domain to wkss-japan-address-helper.
* Documented the Japan Post external service used for manual postal database updates.
* Updated plugin URLs to CustomBox.
* Improved settings screen wording for local database lookup and manual Japan Post data updates.

= 1.0.3 =
* Removed Plugin URI to avoid matching the Author URI in WordPress.org submission.

= 1.0.2 =
* Improved Plugin Check compatibility.
* Replaced direct file operations with WordPress filesystem methods where possible.
* Reworked postal code database inserts to avoid unsafe interpolated SQL parameters.
* Rewrote readme content in standard English.

= 1.0.1 =
* Improved WordPress.org plugin check compatibility.
* Hardened file handling, database inserts, uploaded CSV handling, and readme language.

= 1.0.0 =
* Raised version to first public release candidate.
* Unified plugin header, readme, author, license, WordPress/PHP requirements, and stable tag for release preparation.

= 0.3.0 =
* Removed AjaxZip3 dependency.
* Rebuilt lookup logic around a local postal code database.
* Added CSV download, manual CSV import, and postal data deletion tools.
* Improved support for classic WooCommerce fields and WooCommerce Blocks fields.
