Plugin Directory

Changeset 3756452


Ignore:
Timestamp:
10/20/2026 10:37:47 AM (27 hours ago)
Author:
webban
Message:

1.0.1: fix three normalizer false positives; guard uninstall; bilingual readme (EN/FA)

Location:
matnban/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • matnban/trunk/includes/class-matnban-normalizer.php

    r3747573 r3756452  
    193193                        /* «می» به‌عنوان اسم مستقل (ماهِ مِی، جامِ می، قدِ می…) به واژهٔ بعدی نچسبد */
    194194                        $MI_NOUN = '(?<!ماه )(?<!جام )(?<!قد )(?<!باده )(?<!پیمانه )';
    195                         $text = preg_replace( '/' . $MI_NOUN . $B . '(ن?می)' . $SP . '(?=[' . $AL . ']{2,})/u', '$1' . $Z, $text, -1, $n );
     195                        /* «می را» (می + حرف را): می این‌جا اسم/مفعول است، نه پیشوند فعل — نمی‌چسبد */
     196                        $RA = '(?!را(?![' . $AL . ']))';
     197                        $text = preg_replace( '/' . $MI_NOUN . $B . '(ن?می)' . $SP . $RA . '(?=[' . $AL . ']{2,})/u', '$1' . $Z, $text, -1, $n );
    196198                        $this->add_stat( 'prefix_mi', $n );
    197199                }
    … …  
    208210
    209211                if ( $this->on( 'suffix_tar' ) ) {
    210                         $text = preg_replace( '/(?<=[' . $AL . '])' . $SP . '(تر|ترین)' . $E . '/u', $Z . '$1', $text, -1, $n );
     212                        /* واژهٔ قبلی دست‌کم دو حرف داشته باشد تا «خشک و تر» (تر = خیس) دست نخورد — اصلاح ۱.۰.۱ */
     213                        $text = preg_replace( '/(?<=[' . $AL . '][' . $AL . '])' . $SP . '(تر|ترین)' . $E . '/u', $Z . '$1', $text, -1, $n );
    211214                        $this->add_stat( 'suffix_tar', $n );
    212215                }
    213216
    214217                if ( $this->on( 'suffix_verb' ) ) {
    215                         $text = preg_replace( '/(?<=ه)' . $SP . '(ام|ای|ایم|اید|اند)' . $E . '/u', $Z . '$1', $text, -1, $n );
     218                        /* «که ای کاش»، «چه ای»، «نه ای» ندا/قید است، نه شناسهٔ فعل — اصلاح ۱.۰.۱ */
     219                        $text = preg_replace( '/(?<!(?<![' . $AL . '\x{200C}])که)(?<!(?<![' . $AL . '\x{200C}])چه)(?<!(?<![' . $AL . '\x{200C}])نه)(?<=ه)' . $SP . '(ام|ای|ایم|اید|اند)' . $E . '/u', $Z . '$1', $text, -1, $n );
    216220                        $this->add_stat( 'suffix_verb', $n );
    217221                }
  • matnban/trunk/matnban.php

    r3747573 r3756452  
    44 * Plugin URI:        https://webbanwp.ir/
    55 * Description:       Persian writing & typography assistant — automatic Persian spelling and half-space (ZWNJ) correction, Arabic character cleanup, readability analysis and a site-wide writing health report.
    6  * Version:           1.0.0
     6 * Version:           1.0.1
    77 * Requires at least: 5.8
    88 * Requires PHP:      8.1
    … …  
    1919}
    2020
    21 define( 'MATNBAN_VERSION', '1.0.0' );
     21define( 'MATNBAN_VERSION', '1.0.1' );
    2222define( 'MATNBAN_FILE', __FILE__ );
    2323define( 'MATNBAN_DIR', plugin_dir_path( __FILE__ ) );
  • matnban/trunk/readme.txt

    r3751905 r3756452  
    55Tested up to: 7.1
    66Requires PHP: 8.1
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Persian writing & typography assistant — one-click spelling and half-space (ZWNJ) correction, Arabic character cleanup and readability analysis.
     11Persian writing assistant — ZWNJ (half-space) fixes, Arabic character cleanup, readability and a site-wide writing report. دستیار نگارش فارسی وردپرس.
    1212
    1313== Description ==
    … …  
    2121= Features =
    2222
    23 * One-click correction in the post editor — 16+ rules: ZWNJ for verb prefixes (mi, nami, bi) and suffixes (ha, tar, tarin), the ezafe ye, Arabic character and digit conversion to Persian, Persian quotes and punctuation, kashida removal, and cleanup of invisible direction marks (RLM/LRM) that break copied text
     23* One-click correction in the post editor — 17 rules: ZWNJ for verb prefixes (mi, nami, bi) and suffixes (ha, tar, tarin), the ezafe ye, Arabic character and digit conversion to Persian, Persian quotes and punctuation, kashida removal, and cleanup of invisible direction marks (RLM/LRM) that break copied text
    2424* Optional automatic correction on save, or on display (display mode never modifies the database)
    2525* Persian readability panel in the post editor: sentence-length analysis and keyword density with Persian stemming — the focus keyphrase is read automatically from Yoast SEO or Rank Math when present
    2626* Site-wide writing health report: scan all posts, list the ones with issues, export to CSV
    2727* Guidance for Persian-friendly image filenames and alt text
     28* Every rule can be switched off individually; the plugin never touches HTML, code, shortcodes, links or English text
    2829
    2930All processing happens locally on your site with PHP. This plugin sends no requests to any external service.
    3031
    31 A premium version with bulk post fixing, an AI assistant (using your own API key) and a smart English slug generator is sold separately at https://webbanwp.ir/ — the code for those features is not included in this plugin.
     32A premium version with bulk post fixing, a 30-day undo, an AI assistant (using your own API key) and a smart English slug generator is sold separately at https://webbanwp.ir/ — the code for those features is not included in this plugin.
     33
     34= فارسی — معرفی کوتاه =
     35
     36**متن‌بان** دستیار نگارش فارسی برای وردپرس است؛ همان‌طور که افزونه‌های سئو کارِ کلمهٔ کلیدی را انجام می‌دهند، متن‌بان کارِ نگارش فارسی را انجام می‌دهد.
     37
     38نگارش فارسی قاعده‌هایی دارد که ویرایشگرهای عمومی بی‌صدا خرابش می‌کنند: نیم‌فاصلهٔ جاافتاده در فعل‌های پیشوندی («می رود»)، حروف عربیِ هم‌شکل با فارسی («ي»، «ك») که جست‌وجو و غلط‌یاب را از کار می‌اندازد، ارقام عربی («٤٥»)، گیومهٔ اشتباه، کشیدهٔ تزئینی، و نشانه‌های جهتِ نامرئی که از پیام‌رسان‌ها کپی می‌شوند. متن‌بان همهٔ این‌ها را اصلاح می‌کند — با یک کلیک، یا خودکار.
     39
     40= امکانات =
     41
     42* اصلاح یک‌کلیکی در ویرایشگر مطلب — ۱۷ قاعده: نیم‌فاصلهٔ «می/نمی»، «بی»، «ها»، «تر/ترین»، شناسهٔ فعل و یای میانجی؛ تبدیل حروف و ارقام عربی به فارسی؛ علائم نگارشی و گیومهٔ فارسی؛ حذف کشیده، فاصله‌های تکراری و نویسه‌های نامرئی
     43* اصلاح خودکار هنگام ذخیره (اختیاری) یا هنگام نمایش؛ حالت نمایش هیچ تغییری در دیتابیس نمی‌دهد
     44* پنل خوانایی فارسی در ویرایشگر: طول جمله، تنوع آغاز جمله‌ها و چگالی کلمهٔ کلیدی با ریشه‌یابی فارسی. کلمهٔ کلیدی به‌طور خودکار از Yoast SEO یا Rank Math خوانده می‌شود
     45* گزارش سلامت نگارش کل سایت: اسکن همهٔ مطالب، فهرست مطالب نیازمند توجه، و خروجی CSV
     46* راهنمای نام فایل و متن جانشین (alt) تصاویر برای فارسی
     47* هر قاعده جداگانه خاموش/روشن می‌شود؛ افزونه هرگز به HTML، کد، شورت‌کد، لینک و متن انگلیسی دست نمی‌زند
     48
     49همهٔ پردازش‌ها محلی و با PHP روی سایت خودتان انجام می‌شود؛ این افزونه هیچ درخواستی به بیرون نمی‌فرستد.
     50
     51نسخهٔ حرفه‌ای (اصلاح گروهی کل آرشیو، بازگردانی ۳۰ روزه، دستیار هوش مصنوعی و نامک انگلیسی هوشمند) محصولی جداگانه در https://webbanwp.ir/ است و کد آن در این افزونه نیست.
    3252
    3353== Installation ==
    … …  
    37573. In the post editor, open the Matnban panel and click the fix button.
    38584. For the site-wide report: Matnban → Site Report → Scan posts.
     59
     60= نصب به فارسی =
     61
     62۱. از پیشخوان ← افزونه‌ها ← افزودن، «Matnban» را جست‌وجو و نصب کنید؛ یا فایل zip را بارگذاری کنید.
     63۲. به پیشخوان ← متن‌بان بروید و قاعده‌ها را مرور کنید (پیش‌فرض‌ها بر پایهٔ رسم‌الخط استاندارد فارسی است).
     64۳. در ویرایشگر مطلب، پنل متن‌بان را باز کنید و دکمهٔ اصلاح را بزنید.
     65۴. برای گزارش کل سایت: متن‌بان ← گزارش سایت ← اسکن مطالب.
    3966
    4067== Frequently Asked Questions ==
    … …  
    5077
    5178= What is the difference between this and the premium version? =
    52 This repository version is free and fully functional on its own: manual fixing, automatic fixing, readability analysis and the site report are all included. The premium version (a separate product sold at webbanwp.ir, whose code is not included here) adds bulk fixing, an AI assistant and smart English slugs.
     79This repository version is free and fully functional on its own: manual fixing, automatic fixing, readability analysis and the site report are all included. The premium version (a separate product sold at webbanwp.ir, whose code is not included here) adds bulk fixing, a 30-day undo, an AI assistant and smart English slugs.
     80
     81= متن من جایی ذخیره یا ارسال می‌شود؟ =
     82نه. همهٔ اصلاح‌ها با PHP روی سایت خودتان انجام می‌شود و افزونه هیچ درخواست بیرونی ندارد.
     83
     84= با Yoast SEO یا Rank Math تداخل دارد؟ =
     85نه؛ مکمل آن‌هاست. کلمهٔ کلیدی را از هر کدام‌که نصب باشد می‌خواند و تحلیل فارسی را روی همان انجام می‌دهد.
     86
     87= نیم‌فاصله‌های درست متن من خراب می‌شود؟ =
     88نه. نیم‌فاصله‌های استاندارد حفظ می‌شوند؛ فقط شکل‌های نادرست (پیشوندی که با فاصلهٔ معمولی جدا شده) به نیم‌فاصلهٔ درست تبدیل می‌شود.
     89
     90= تفاوتش با نسخهٔ حرفه‌ای چیست؟ =
     91این نسخه رایگان و کامل است: اصلاح دستی، اصلاح خودکار، تحلیل خوانایی و گزارش سایت همه در آن هست. نسخهٔ حرفه‌ای (محصولی جداگانه در webbanwp.ir که کدش اینجا نیست) اصلاح گروهی، بازگردانی ۳۰ روزه، دستیار هوش مصنوعی و نامک انگلیسی هوشمند را اضافه می‌کند.
    5392
    5493== Screenshots ==
    5594
    56 1. The Matnban panel in the post editor — one-click Persian writing correction and readability analysis
    57 2. The site-wide writing health report
    58 3. Writing rules with before/after examples
     951. The Matnban panel in the post editor — one-click Persian writing correction and readability analysis (پنل متن‌بان در ویرایشگر: اصلاح یک‌کلیکی و تحلیل خوانایی)
     962. The site-wide writing health report (گزارش سلامت نگارش کل سایت)
     973. Writing rules with before/after examples (قاعده‌های نگارشی با نمونهٔ پیش و پس از اصلاح)
    5998
    6099== Changelog ==
     100
     101= 1.0.1 =
     102* Fixed three false positives that could corrupt correct text:
     103  * "خشک و تر" (and similar) is no longer joined into "خشک و‌تر" — the suffix rule now requires a word of at least two letters before "تر/ترین".
     104  * "گفت که ای کاش" is no longer changed to "گفت که‌ای کاش" — "که/چه/نه" before "ای/ام/اند" are treated as particles, not verb endings.
     105  * "این می را ببین" is no longer changed to "این می‌را ببین" — a bare "می" followed by "را" is a noun, not the verb prefix.
     106* Added regression tests for all three cases plus two positive cases that must keep working.
     107* Readme is now bilingual (English + Persian).
     108
     109= 1.0.1 (فارسی) =
     110* رفع سه خطای تشخیص که می‌توانست متن درست را تغییر دهد: «خشک و تر»، «گفت که ای کاش» و «این می را ببین» دیگر اصلاح نمی‌شوند.
     111* افزودن آزمون رگرسیون برای همان سه مورد، به‌همراه دو نمونهٔ درست که باید همچنان اصلاح شوند.
     112* راهنمای افزونه (readme) دوزبانه شد: انگلیسی + فارسی.
    61113
    62114= 1.0.0 =
    63115* Initial release on WordPress.org
    64116* Conversion of invisible direction marks (RLM/LRM) misused in place of ZWNJ
     117
     118== Upgrade Notice ==
     119
     120= 1.0.1 =
     121Fixes three false positives that could alter correct text. Recommended update. — رفع سه خطای تشخیص که ممکن بود متن درست را تغییر دهد؛ به‌روزرسانی توصیه می‌شود.
  • matnban/trunk/uninstall.php

    r3747573 r3756452  
    11<?php
     2/**
     3 * حذف افزونهٔ رایگان متن‌بان.
     4 * اگر متن‌بان پرو نصب باشد، تنظیمات و گزارش مشترک پاک نمی‌شود
     5 * (پرو همان آپشن‌ها را می‌خواند؛ حذف رایگان نباید داده‌های پرو را نابود کند).
     6 */
    27if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
    38        exit;
    49}
    5 delete_option( 'matnban_settings' );
    6 delete_option( 'matnban_report' );
    7 delete_option( 'matnban_scan_progress' );
    8 delete_option( 'matnban_cron_progress' );
    9 delete_metadata( 'post', 0, '_matnban_scan', '', true );
    10 delete_metadata( 'post', 0, '_matnban_in_summary', '', true );
     10
     11$matnban_keep_shared = false;
     12if ( defined( 'WP_PLUGIN_DIR' ) ) {
     13        foreach ( array( 'matnban-pro/matnban.php', 'matnban-pro-pro/matnban.php' ) as $matnban_pro_file ) {
     14                if ( file_exists( WP_PLUGIN_DIR . '/' . $matnban_pro_file ) ) {
     15                        $matnban_keep_shared = true;
     16                        break;
     17                }
     18        }
     19}
     20if ( function_exists( 'is_plugin_active' ) ) {
     21        include_once ABSPATH . 'wp-admin/includes/plugin.php';
     22        if ( is_plugin_active( 'matnban-pro/matnban.php' ) ) {
     23                $matnban_keep_shared = true;
     24        }
     25}
     26
     27if ( ! $matnban_keep_shared ) {
     28        delete_option( 'matnban_settings' );
     29        delete_option( 'matnban_report' );
     30        delete_option( 'matnban_scan_progress' );
     31        delete_option( 'matnban_cron_progress' );
     32        delete_metadata( 'post', 0, '_matnban_scan', '', true );
     33        delete_metadata( 'post', 0, '_matnban_in_summary', '', true );
     34}
     35
    1136wp_clear_scheduled_hook( 'matnban_weekly_scan' );
    1237wp_clear_scheduled_hook( 'matnban_scan_continue' );
    1338
    14 $GLOBALS['wpdb']->query( "DELETE FROM {$GLOBALS['wpdb']->options} WHERE option_name LIKE '\_transient\_matnban\_orig\_%' OR option_name LIKE '\_transient\_timeout\_matnban\_orig\_%'" );
     39if ( ! $matnban_keep_shared ) {
     40        $GLOBALS['wpdb']->query( "DELETE FROM {$GLOBALS['wpdb']->options} WHERE option_name LIKE '\_transient\_matnban\_orig\_%' OR option_name LIKE '\_transient\_timeout\_matnban\_orig\_%'" );
     41}
Note: See TracChangeset for help on using the changeset viewer.