=== Default Permalink ===
Contributors: redwoodcity
Donate link: http://www.redwoodcity.jp/entry/default-permalink
Tags: permalink, url, default, multi-byte, slug
Requires at least: 4.7
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.5
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Prevents multi-byte (URL-encoded) slugs in the default permalink. Multi-byte URL can still be used when the user explicitly specifies it.

== Description ==

When a post title contains multi-byte characters (such as Japanese), WordPress generates a URL-encoded slug like `%e3%81%82...`, which results in a long and unreadable permalink.

This plugin replaces such auto-generated slugs with `{post_type}-{post_ID}` (e.g. `post-123`). A multi-byte slug is kept as-is when the user has explicitly specified it.

= Usage =

1. Go to "Settings" -> "Default Permalink" in the WordPress admin.
1. Check "Enable" and save changes.

== Installation ==

1. Upload the `default-permalink` folder to the `/wp-content/plugins/` directory.
1. Activate the plugin through the 'Plugins' menu in WordPress.
1. Enable the plugin's behavior from "Settings" -> "Default Permalink".

== Changelog ==

= 1.5 =
* Added an admin notice shown after a slug has been automatically replaced.
* Added a bulk conversion tool for existing multi-byte slugs. Old URLs are redirected (301) by the WordPress core old-slug mechanism.
* Hardened: slug replacement is skipped when no post ID is available (prevents colliding "post-0" slugs on direct wp_insert_post calls).

= 1.4 =
* Added slug format options: post type and ID (post-123), post date and ID (20260613-123), or a random string (a1b2c3d4).
* Added target post type selection.

= 1.3 =
* Added uninstall cleanup: plugin options are deleted when the plugin is uninstalled.
* Added a Settings link on the Plugins screen.
* Added the default_permalink_slug filter for customizing the generated slug.

= 1.2 =
* Confirmed compatibility with the latest WordPress.
* Replaced the deprecated get_page() with get_post() (fixes a fatal error on PHP 8).
* Hardened the settings page: output escaping, sanitize callback for the option, checked() helper.
* Made the settings page strings translatable and load the plugin text domain.

= 1.1 =
* Added Japanese translation.

= 1.0 =
* Initial release.
