Changeset 3756452
- Timestamp:
- 10/20/2026 10:37:47 AM (27 hours ago)
- Location:
- matnban/trunk
- Files:
-
- 4 edited
-
includes/class-matnban-normalizer.php (modified) (2 diffs)
-
matnban.php (modified) (2 diffs)
-
readme.txt (modified) (4 diffs)
-
uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
matnban/trunk/includes/class-matnban-normalizer.php
r3747573 r3756452 193 193 /* «می» بهعنوان اسم مستقل (ماهِ مِی، جامِ می، قدِ می…) به واژهٔ بعدی نچسبد */ 194 194 $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 ); 196 198 $this->add_stat( 'prefix_mi', $n ); 197 199 } … … 208 210 209 211 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 ); 211 214 $this->add_stat( 'suffix_tar', $n ); 212 215 } 213 216 214 217 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 ); 216 220 $this->add_stat( 'suffix_verb', $n ); 217 221 } -
matnban/trunk/matnban.php
r3747573 r3756452 4 4 * Plugin URI: https://webbanwp.ir/ 5 5 * 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. 06 * Version: 1.0.1 7 7 * Requires at least: 5.8 8 8 * Requires PHP: 8.1 … … 19 19 } 20 20 21 define( 'MATNBAN_VERSION', '1.0. 0' );21 define( 'MATNBAN_VERSION', '1.0.1' ); 22 22 define( 'MATNBAN_FILE', __FILE__ ); 23 23 define( 'MATNBAN_DIR', plugin_dir_path( __FILE__ ) ); -
matnban/trunk/readme.txt
r3751905 r3756452 5 5 Tested up to: 7.1 6 6 Requires PHP: 8.1 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Persian writing & typography assistant — one-click spelling and half-space (ZWNJ) correction, Arabic character cleanup and readability analysis.11 Persian writing assistant — ZWNJ (half-space) fixes, Arabic character cleanup, readability and a site-wide writing report. دستیار نگارش فارسی وردپرس. 12 12 13 13 == Description == … … 21 21 = Features = 22 22 23 * One-click correction in the post editor — 1 6+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 text23 * 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 24 24 * Optional automatic correction on save, or on display (display mode never modifies the database) 25 25 * 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 26 26 * Site-wide writing health report: scan all posts, list the ones with issues, export to CSV 27 27 * 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 28 29 29 30 All processing happens locally on your site with PHP. This plugin sends no requests to any external service. 30 31 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. 32 A 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/ است و کد آن در این افزونه نیست. 32 52 33 53 == Installation == … … 37 57 3. In the post editor, open the Matnban panel and click the fix button. 38 58 4. For the site-wide report: Matnban → Site Report → Scan posts. 59 60 = نصب به فارسی = 61 62 ۱. از پیشخوان ← افزونهها ← افزودن، «Matnban» را جستوجو و نصب کنید؛ یا فایل zip را بارگذاری کنید. 63 ۲. به پیشخوان ← متنبان بروید و قاعدهها را مرور کنید (پیشفرضها بر پایهٔ رسمالخط استاندارد فارسی است). 64 ۳. در ویرایشگر مطلب، پنل متنبان را باز کنید و دکمهٔ اصلاح را بزنید. 65 ۴. برای گزارش کل سایت: متنبان ← گزارش سایت ← اسکن مطالب. 39 66 40 67 == Frequently Asked Questions == … … 50 77 51 78 = 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. 79 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, 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 که کدش اینجا نیست) اصلاح گروهی، بازگردانی ۳۰ روزه، دستیار هوش مصنوعی و نامک انگلیسی هوشمند را اضافه میکند. 53 92 54 93 == Screenshots == 55 94 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 95 1. The Matnban panel in the post editor — one-click Persian writing correction and readability analysis (پنل متنبان در ویرایشگر: اصلاح یککلیکی و تحلیل خوانایی) 96 2. The site-wide writing health report (گزارش سلامت نگارش کل سایت) 97 3. Writing rules with before/after examples (قاعدههای نگارشی با نمونهٔ پیش و پس از اصلاح) 59 98 60 99 == 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) دوزبانه شد: انگلیسی + فارسی. 61 113 62 114 = 1.0.0 = 63 115 * Initial release on WordPress.org 64 116 * Conversion of invisible direction marks (RLM/LRM) misused in place of ZWNJ 117 118 == Upgrade Notice == 119 120 = 1.0.1 = 121 Fixes three false positives that could alter correct text. Recommended update. — رفع سه خطای تشخیص که ممکن بود متن درست را تغییر دهد؛ بهروزرسانی توصیه میشود. -
matnban/trunk/uninstall.php
r3747573 r3756452 1 1 <?php 2 /** 3 * حذف افزونهٔ رایگان متنبان. 4 * اگر متنبان پرو نصب باشد، تنظیمات و گزارش مشترک پاک نمیشود 5 * (پرو همان آپشنها را میخواند؛ حذف رایگان نباید دادههای پرو را نابود کند). 6 */ 2 7 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { 3 8 exit; 4 9 } 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; 12 if ( 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 } 20 if ( 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 27 if ( ! $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 11 36 wp_clear_scheduled_hook( 'matnban_weekly_scan' ); 12 37 wp_clear_scheduled_hook( 'matnban_scan_continue' ); 13 38 14 $GLOBALS['wpdb']->query( "DELETE FROM {$GLOBALS['wpdb']->options} WHERE option_name LIKE '\_transient\_matnban\_orig\_%' OR option_name LIKE '\_transient\_timeout\_matnban\_orig\_%'" ); 39 if ( ! $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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)