# NOTA Prepublish Checker

**[English](#english) | [日本語](#日本語)**

A lightweight WordPress plugin that automatically checks posts and pages for common mistakes before they go live — missing featured image, no category, thin content, unintended noindex, and more.

- No external API, no account, no license key
- Admin UI in both English and Japanese
- Works with Gutenberg and Classic Editor

---

## English

### What it does

Before a post or page is published, NOTA Prepublish Checker runs nine simple checks and shows the results:

- On the **editor screen** (meta box): summary badge + per-item status (NG / warning / OK)
- In the **posts list** (new column): count badges plus exact item names that failed
- On **save** (admin notice): consolidated list of items that still need attention

All checks run locally inside your WordPress admin. Publishing is not blocked (warning only).

### Checks included

| # | Check | Status when failing |
|---|-------|---------------------|
| 1 | Title missing | Error |
| 2 | Featured image not set | Error |
| 3 | Category missing / only default | Error / Warning |
| 4 | Tags missing or below minimum | Error / Warning |
| 5 | Excerpt missing | Warning |
| 6 | noindex (core + 4 major SEO plugins) | Warning |
| 7 | Content length below minimum | Warning |
| 8 | Too few links in content | Warning |
| 9 | Too few images in content | Warning |

Thresholds (content length, tags, links, images), the set of checks, and target post types are all configurable from **Settings → Prepublish Checker**.

### Installation

1. Copy `wp-prepublish-checker` to `/wp-content/plugins/`, or upload the ZIP via **Plugins → Add New → Upload Plugin**.
2. Activate the plugin.
3. Open **Settings → Prepublish Checker** to review defaults.
4. Edit any post to see the **Prepublish Checker** meta box.

### Requirements

- WordPress 6.0 or later
- PHP 7.4 or later

### Current limitations

- Publishing is not blocked on errors (warning only).
- noindex detection covers WordPress core + Yoast SEO, All in One SEO, SEOPress, Rank Math.
- Very complex page-builder output may not be fully counted for content statistics.
- Real-time Gutenberg block updates not provided; results refresh on save / via the Re-check button.

### Pro-candidate features (future)

- Per-category required rules
- Required custom fields
- Category-specific required tags
- Enforced publish block on errors
- Bulk re-check and CSV export
- Per-role rule control
- Per-post-type detailed rules
- Advanced SEO-plugin integration
- Team-shared rule sets

### Internationalization

Full i18n support. Bundled languages:

- `ja` (Japanese)
- `en_US` (English, US)

A `.pot` template is included in `/languages/`. Additional translations can be added as `.po/.mo` files using the same text domain (`wp-prepublish-checker`).

### License

GPL-2.0-or-later

---

## 日本語

投稿や固定ページを公開する前に、設定漏れや入力漏れを自動でチェックする軽量な WordPress プラグインです。

- 外部 API 不要、ログイン不要、ライセンスキー不要
- 日本語と英語の管理画面UI
- Gutenberg・Classic Editor の両方に対応

### できること

- 編集画面のメタボックスに、件数サマリーと各項目の状態（NG / 注意 / OK）を表示
- 投稿一覧の新しい列に、件数バッジとNG/注意の項目名を直接表示
- 保存時、問題がある項目の一覧を管理画面通知として表示

現バージョンでは公開そのものはブロックしません（警告のみ）。

### チェック項目（全9種）

1. タイトル未入力
2. アイキャッチ画像未設定
3. カテゴリ未設定 / デフォルトのみ
4. タグ未設定・不足
5. 抜粋未入力
6. noindex 状態（WordPress コア + 主要SEOプラグイン4種）
7. 本文文字数不足
8. 本文内リンク数不足
9. 本文内画像数不足

各項目の ON/OFF、しきい値（最低文字数・タグ数・リンク数・画像数）、対象投稿タイプは **設定 > 公開前チェック** から変更できます。

### インストール

1. `wp-prepublish-checker` フォルダを `/wp-content/plugins/` に配置、または **プラグイン > 新規追加 > プラグインのアップロード** から ZIP を読み込み
2. プラグインを有効化
3. **設定 > 公開前チェック** で初期設定を確認
4. 投稿編集画面で **公開前チェック** メタボックスを確認

### 動作環境

- WordPress 6.0 以上
- PHP 7.4 以上

### 現時点の制限

- 公開そのものは止まらない（強い警告のみ）
- noindex 判定は WordPress コア + 主要SEOプラグイン4種（Yoast SEO, All in One SEO, SEOPress, Rank Math）
- ページビルダーの複雑な出力は、本文カウントが完全でない場合があります
- Gutenberg でのリアルタイム更新は非対応（保存時または「再チェック」ボタンで更新）

### 将来の Pro 候補機能

- カテゴリごとの必須ルール
- 必須カスタムフィールド
- 特定カテゴリでの必須タグ
- エラー時の公開ブロック
- 一括再チェック／CSVエクスポート
- 権限別のルール制御
- 投稿タイプ別の詳細ルール
- 高度な SEO プラグイン連携
- チーム共有ルール

### 多言語対応

完全な国際化対応済み。同梱言語:

- `ja`（日本語）
- `en_US`（英語）

`/languages/` に `.pot` テンプレートを同梱。追加翻訳はテキストドメイン `wp-prepublish-checker` で `.po/.mo` を追加するだけで動作します。

### ライセンス

GPL-2.0-or-later
