# WritingNepal theme — rules for Claude (both accounts) Ruman works on this theme from **two Claude accounts**. Neither account can see the other's chats, so **this file and the files it points to are the shared memory**. Read it fully before changing anything. ## 0. Current baseline - **Latest delivered: 4.74.1** (24 Oct 2026: fix — share kit no longer opens by itself on the profile; wp_localize_script sends 0 as "0" (truthy in JS), so compare as strings. Remember this for any localized flag.) Before it 4.74 (24 Oct 2026: किताबका खबर — inc/book-news.php + assets/js/book-news.js + assets/css/book-news.css; table wp_wn_book_news (wn_bn_table_v1); single-book.php "खबर" tab replaces External Reviews (button data-tab=news id=news, panel wn_bn_panel_html); who manages = wn_bn_can_manage (book post_author + own book or Publisher, or admin), others suggest (status 0); AJAX wn_bn_boot/preview/save/act/press; press kit /press/{slug}/ (rewrite, option wn_bn_rewrite_v1, post meta _wn_bn_press_off); wn_bn_profile_html in profile About; feed slot wn_bn_feed_position (default 14); WN Tools → किताबका खबर; option wn_bn_settings. Promo kit also reads assets/promo/promo/.) Before it 4.73 (24 Oct 2026: promo kit tabs — results tracking inc/promo-refs.php (table wp_wn_ref_stats day/ref/visits/signups, wn_ref_table_v1; param ?wnp= NOT ?ref= — ?ref= is the Akshar invite link in inc/wn-specials.php; refs fb-{promo id}, fb-a-… for site-made posts, w{user id} for share kits; /p/{id} → page?wnp=fb-{id}; assets/js/ref-track.js cookie wn_promo 7 days; user meta wn_joined_ref), site-made posts inc/promo-auto.php (cron wn_pa_daily, option wn_pa_items/wn_pa_settings), member share kit inc/share-kit.php + assets/js/share-kit.js + assets/css/share-kit.css (profile button wn_sk_button_html, /u/{id} profile short link, option wn_sk_settings), shared canvas renderer assets/js/promo-art.js (WNArt.draw — use it for any new in-browser share picture).) Before it 4.72 (24 Oct 2026: प्रचार सामग्री promo kit — inc/promo-kit.php, wp-admin page wn-promo-kit under Members & messages; default posts in assets/promo/posts.json + assets/promo/{id}.jpg (1440×1800); options wn_pk_settings / wn_pk_state / wn_pk_custom; calendar hook wn_pk_cal_items in inc/admin-calendar.php; zip download wn_pk_zip. EVERY NEW MEMBER-FACING FEATURE: add its promo post — entry in tools/promo/features.js, picture via tools/promo/gen.js → assets/promo/{id}.jpg, row in posts.json (see tools/promo/README.md); mark money features wait:true.) Before it 4.71 (24 Oct 2026: short Catch links — inc/short-links.php: writingnepal.com/c/{id} 301 → permalink (template_redirect priority 0), wn_sl_url() / wn_sl_copy_text() (“Title” / — Writer / short link) / wn_sl_share_text(); used by Catch card (wn_cc_data url/copy/stext), Push button (data-url short, data-copy, data-share-text in inc/link-previews-and-cards.php + catch-card-actions.js) and single-catch.php; option wn_sl_settings on/mode/scheme; WN Tools → छोटो लिंक. ANY NEW share/copy-link button should use these.) Before it 4.70 (24 Oct 2026: one-tap sentence highlights inside छेउको टिपोट — table wp_wn_mn_hl (wn_mn_table_v2), wn_mn_hl_state() in wn_mn_get response key hl, AJAX wn_mn_hl, settings hl_on/hl_counts/hl_popular in wn_mn_settings; private to the reader, counts only for others; JS classes .is-mine/.is-pop.) Before it 4.69 (24 Oct 2026: Catch Cloud तथ्याङ्क — inc/catch-insights.php (wn_ci_data → transient wn_ci_{uid}, months as YYYY-MM keys so labels follow language in JS; follower history = user meta wn_ci_fol_hist + wn_akshar_awarded_keys follow_* times; pushes = other members' Catches linking to the Catch), assets/js/catch-insights.js, assets/css/catch-insights.css; page-catch-cloud.php shows wn_ci_section_html() and falls back to the old teaser; cron wn_ci_daily; WN Tools → Catch Cloud तथ्याङ्क; e-book chapter stats still Premium (not built).) Before it 4.68 (24 Oct 2026: wp-admin sidebar grouped — inc/admin-menu-groups.php. NEW ADMIN PAGES: register them as before (e.g. add_submenu_page('wn-tools', …)) AND add the slug to the right group in wn_amg_groups(); unmapped ones land in Site tools → More. Groups: books, write, community, money, members, site (menu slugs wn-group-*). Only links move; page slugs/hooks unchanged. Per-admin old menus: user meta wn_admin_classic_menu.) Before it 4.67 (24 Oct 2026: मौन पढाइ कुराकानी — inc/silent-chat.php + assets/js/silent-chat.js + assets/css/silent-chat.css, loaded after silent-hour.php; tables wp_wn_shc / wp_wn_shc_rep (wn_shc_table_v1); option wn_shc_settings (mode last|always, last_mins, min_days, hide_at, keep_days, words, rules, intro); aliases/mutes per session in options wn_shc_alias_{slot}/wn_shc_mute_{slot}; user meta wn_shc_rules / wn_shc_banned; AJAX never returns user ids; purge on wn_sh_cron deletes all non-reported messages after the session, reported after keep_days; WN Tools → मौन पढाइ कुराकानी. Privacy + Community rules updated.) Before it 4.66.2 (24 Oct 2026: phone profile tabs #railNavMobile wrap as chips — override block at end of assets/css/profile-wall.css, arrows hidden; 📚 removed from shelf tab.) Before it 4.66.1 (24 Oct 2026: profile menu shortened — inc/site-menu.php wn_menu_html(desktop|phone) used by header.php for BOTH the desktop dropdown and the phone ⋮ sheet; everyday items + one
"सबै गतिविधि (n)" holding wn_menu_activities() (ADD NEW FEATURE LINKS THERE, not in header.php); line SVG icons only, no emoji; New = gold dot via wn_menu_is_new(), option wn_menu_settings, WN Tools → मेनु; CSS at end of assets/css/profile.css.) Before it 4.66 (24 Oct 2026: हायर पेज (Reedsy-style pro pages) — inc/hire-pages.php + page-hire.php (routes /hire/ list, /hire/edit/ editor, /hire/{nicename}/ page via template_redirect), assets/css/hire.css, assets/js/hire.js; user meta wn_hire_page (cleaned by wn_hp_clean) / wn_hire_on / wn_hire_blocked; table wp_wn_hire_reviews (option wn_hire_table_v1, owner marks "worked together" then client reviews); option wn_hp_settings; AJAX wn_hire_save/books/inquiry/done/review; inquiries = wn_messages thread_type hire_inquiry; free, no cut; unverified note; profile badge links to the page via wn_hp_profile_link(); WN Tools → हायर पेज; ALSO functions.php now requires inc/silent-hour.php, which 4.61 never got into this copy.) Before it 4.65 (21 Oct 2026: किताब दराज bookshelf — profile tab data-target="shelf" after Saved (phone + rail) and panel in page-profile.php; wn_nr_shelf_panel_html / wn_nr_shelf_data / wn_nr_shelf_visible (wn_privacy_reading_public) / wn_nr_shelf_buttons_html (single-book.php) in inc/now-reading.php; AJAX wn_nr_shelf want|unwant|reading|read; want list = user meta wn_nr_want; wn_nr_settings shelf_on/shelf_name; picker marks done/want and asks before re-read (askReread); privacy page updated; 4.64.7: now-reading picker has its own Share/रद्द buttons #nrPost/#nrCancel because the phone composer arrow only shows after typing; titles entity-decoded in now-reading.js + inc/now-reading.php; 4.64.6: rebuilt missing assets/js/magic-link.js (email-link button + wn_fresh_auth_nonces refresh) and login/sign-up pop-up .modal-body now scrolls (style.css); 4.64.5: events strip #eventStrip removed from front-page.php; 4.64.4/4.64.3/4.64.1/4.64: FIRST visit to writingnepal.com (no same-site referrer) jumps to /catch/ via an inline head script wn_visitor_first_landing_script() in inc/signup-gate.php — browser-side because Hostinger caches the logged-out homepage; Home/logo clicks show the MAIN homepage (front-page.php); the 4.6 sign-up gate only shows when option wn_visitor_home = home (Settings → Reading → "First visit lands on"; default catch); ?auth=login/signup and ?wn_magic never jump.) Before it 4.63 (19 Oct 2026: "एप डाउनलोड" in profile dropdown + phone menu (.wn-install-trigger, handled in assets/js/install.js); 4.62 19 Oct 2026: silent hour dark focus screen + private notes (table wp_wn_shn, shown only to owner in profile via wn_sh_notes_profile_html); 4.61 19 Oct 2026: मौन पढाइ घण्टा — inc/silent-hour.php, page-silent-hour.php at /silent-hour/ (public, guests too), assets/js/silent-hour.js, assets/css/silent-hour.css; table wp_wn_sh, option wn_sh_settings, cron wn_sh_cron, feed slot 13 (wn_sh_feed_card_html in page-catch.php), WN Tools → मौन पढाइ; 4.60.1 19 Oct 2026: Catch card button also on single Catch page (.post-engage); 4.60 19 Oct 2026: Catch कार्ड — inc/catch-card.php, assets/js/catch-card.js, assets/css/catch-card.css; button injected by JS into .feed-actions (no edit to link-previews file); card PNG drawn in browser; AJAX wn_cc_data/wn_cc_off; option wn_cc_settings; post meta _wn_cc_off; paid Catch = first 2 lines only; WN Tools → Catch कार्ड; 4.59.2 19 Oct 2026: now-reading picker hidden until the book icon is pressed ([hidden] override fix); 4.59.1 19 Oct 2026: now-reading picker moved under .composer-row; finished-books shelf on profile + finished count on book page; 4.59 19 Oct 2026: अहिले पढ्दै — inc/now-reading.php, assets/js/now-reading.js, assets/css/now-reading.css; table wp_wn_nr, option wn_nr_settings, cron wn_nr_cron (30-day expiry), status meta _wn_nr_*; composer book icon injected by JS (page-catch.php untouched); card hooked in wn_render_catch_card(); profile strip in page-profile.php; readers block in single-book.php; WN Tools → अहिले पढ्दै; 4.58.5 19 Oct 2026: Book Duel phone layout fix (equal-width books, no author text over covers); 4.58.4 18 Oct 2026: Book Duel covers fall back to _wn_legacy_cover_url + per-duel cover URLs + Edit button for running duels; 4.58.3 18 Oct 2026: Book Duel button on single-book.php for the live duel's two books; 4.58.2 18 Oct 2026: Book Duel admin — Use as Book A/B buttons keep chosen books across searches; 4.58.1 18 Oct 2026: Book Duel menu links + feed card wn_bd_feed_card_html() (slot wn_bd_settings feed_after, default 11; feed slots now 2 competition, 3–7 daily question, 6 events, 8 WN offers, 9 map, 10 best sellers, 11 duel); 4.58 18 Oct 2026: Book Duel किताब भिडन्त — inc/book-duel.php, page-book-duel.php at /book-duel/, assets/js/book-duel.js, assets/css/book-duel.css, tables wp_wn_bd_sides/args/votes, options wn_bd_settings/wn_bd_duels/wn_bd_active, WN Tools → किताब भिडन्त; 4.57 18 Oct 2026: Readers on Map links — profile dropdown + phone menu in header.php, book club side link, Catch-feed card wn_rd_feed_card_html() (slot = wn_rd_settings feed_after, default 9, 0 = off; feed slots now: 2 competition, 3–7 daily question, 6 events, 8 WN offers, 9 map, 10 best sellers); 4.56.3 18 Oct 2026: unzip check loads the reader first — wn_rd_load_reader(); 4.56.2 18 Oct 2026: clearer .mmdb error messages; lookup reads flat DB-IP layout too; 4.56.1 18 Oct 2026: admin takes the DB-IP file zipped as .mmdb.gz and unzips it on the server — wn_rd_unpack_gz(); 4.56 18 Oct 2026: Where Nepal is reading — inc/nepal-reading.php, page-nepal-reading.php at /nepal-reading/ (members only), assets/js/nepal-reading*.js, assets/css/nepal-reading.css, assets/data/nepal-map.json, inc/vendor/maxmind-db (MaxMind DB reader, Apache-2.0), table wp_wn_rd, user meta wn_rd_optout, WN Tools → नेपाल कहाँ पढ्दै छ; needs a free .mmdb city database added once; 4.55 18 Oct 2026: Time Capsule Catch — inc/time-capsule.php, assets/js/time-capsule.js, assets/css/time-capsule.css; real text moved to meta _wn_tc_body until unlock; table wp_wn_tc_remind; cron wn_tc_cron; WN Tools → समय क्याप्सुल; switch in page-write.php sidebar; 4.54.2 17 Oct 2026: book club part buttons show comment count + lock; 4.54.1 17 Oct 2026: badges removed from profiles and the Settings switch — they now show only on the book club page; 4.54 17 Oct 2026: book club comments get like/reply/share/read-in-full — table wp_wn_mb_likes, column parent_id, wn_mb_table_v2, AJAX wn_mb_like, deep link ?part=N&c=ID; 4.53.4 17 Oct 2026: discussion comments up to 4000 characters; 4.53.3 17 Oct 2026: exact page ranges per chapter in WN Tools → एउटै किताब; 4.53.2 17 Oct 2026: "यो के हो?" explainer page-monthly-book-about.php at /monthly-book/about/; 4.53.1 17 Oct 2026: feed shows one top margin note under full Catches — wn_mn_feed_preview_html() in inc/margin-notes.php, hooked in wn_render_catch_card(); 4.53 17 Oct 2026: एउटै किताब, हजार पाठक — inc/monthly-book.php, page-monthly-book.php (route /monthly-book/ via template_redirect), assets/css/monthly-book.css, assets/js/monthly-book.js, tables wp_wn_mb_prog/wp_wn_mb_posts, options wn_mb_months/wn_mb_active, user meta wn_mb_hide_badges, WN Tools → एउटै किताब; badges First Page/Midpoint/Cover to Cover on profile ; 4.52.3 17 Oct 2026: margin notes read loose text outside

and treat
as a sentence end (old Catches, poems); 4.52.2 17 Oct 2026: Catch page shows only a small "notes are open" label + count (no off/on link; on/off is on Write Catch + Settings default); 4.52.1 17 Oct 2026: margin notes read live on/off + fresh nonce from wn_mn_get so cached Catch pages cannot show stale state; 4.52 17 Oct 2026: margin-notes writer switch — checkbox on Write Catch sidebar + publish pop-up (#mnAllow/#pcMn, field mn_allow), default in Settings → Privacy (user meta wn_mn_default_off, AJAX wn_mn_save_default), help bubbles wn_mn_help_html(); 4.51 17 Oct 2026: Margin notes छेउको टिपोट — inc/margin-notes.php, assets/js/margin-notes.js, assets/css/margin-notes.css, table wp_wn_mn_notes, options wn_mn_table_v1/wn_mn_settings, post meta _wn_mn_off, WN Tools → छेउको टिपोट; full Catches only; feed preview of top note planned next; 4.50 16 Oct 2026: Site ranking in Site Analytics — inc/site-rank.php, Tranco rank + typed visits, options wn_rank_settings/wn_rank_data/wn_rank_history, cron wn_rank_cron; 4.49 13 Oct 2026: grammar check shows admins the failure reason, option wn_ng_last_error; 4.48: 13 Oct 2026: paid extra grammar checks in Akshar — wn_ng_charge() in inc/nepali-grammar.php, off by default; 4.47: 13 Oct 2026: opt-in AI grammar check — inc/nepali-grammar.php, key WN_ANTHROPIC_API_KEY in wp-config.php, off by default, WN Tools → Grammar check (AI); 4.46: 13 Oct 2026: Nepali spelling check + writing hints on Write Catch — inc/nepali-spellcheck.php, assets/js/nepali-spell*.js, assets/data/nepali-spell/; loaded from inc/writing-integrity.php; checks in-browser, ~135 ms; NOT a grammar checker). Before it 4.45.3 (11 Oct 2026: wn_wi_tidy_spacing() display + save-time + CSS, handles Word indents/entities; 4.45.1 10 Oct: /full-catch/ demo page now redirects to /catch/; 4.45 9 Oct: genuine writing inc/writing-integrity.php _wn_ws/_wn_pledge, badge, AI report reason; Write tools focus/find/।/✻; 4.44.1: Top-up check page inc/topup-check.php + callback pages auto-created; Khalti rules — wn_khalti_lookup() paid/failed/hold, admin can test with switch off, top-up page open to members when live; 4.43.1 notifications page photos) — WN Writing Challenges (4.42.1 hint; 4.43 own feed card, option wn_wc_feed, default after Catch 12). NOTE: Ruman also works in a second chat — merge pending for functions.php, site-changelog.php, style.css, wn-release.json (maybe page-catch.php). (`inc/wn-challenges.php`: option `wn_wc_challenges`, table `wn_wc_claims`, approve-by-hand in WN Tools → Akshar Report → Writing Challenges; pays via `wn_sp_pay(user,'challenge',id)`; cards inside `wn_sp_render_offers()` + feed card mode). - 4.41: broadcast push open tracking (`inc/broadcast-opens.php`, table `wn_broadcast_opens`, signed `wn_push_open` from sw.js; `wn_send_push_notification()` now takes `$extra` and returns devices reached). Khalti: live key in wp-config.php; "Invalid token" = account not approved yet — Ruman contacting Khalti; payments switch off meanwhile. - 4.40: red number on the app icon (`wn_la_badge_total()` in inc/live-alerts.php; setAppBadge in live-alerts.js and sw.js push; payload `badge`). Android shows its own dot only. - 4.39: "check before publishing" pop-up on Write Catch (`#publishCheckModal` in page-write.php: title, category changeable, photo, free/paid, when, length; first Publish/Schedule only; skip key localStorage `wnSkipPublishCheck`). - 4.38: live alerts while using the site (`inc/live-alerts.php`, `assets/js/live-alerts.js`: 30 s check, Web Audio sounds, pop-up, `data-wn-badge` badges); push tag/renotify/vibrate (sw.js); Nepali first-launch push prompt with weekly re-ask. - 4.37 (7 Oct 2026) — Site Analytics "Feed scroll" (`inc/feed-scroll-stats.php`, `assets/js/feed-scroll.js`, table `wn_feed_scroll`). - 4.36 (7 Oct 2026) — WN Offers card in the Catch feed (`wn_sp_feed_card_html()`, after Catch #8 by default; feed slots in use: 2 competition, 3–7 daily question, 6 events, 8 WN offers, 10 best sellers). - 4.35 (7 Oct 2026) — competition entry fee (setting `entry_fee`; `wnc_charge_fee()` moves AK member → WN Official, bought AK first; refund per entry in admin); empty reminder email texts fall back to defaults. - 4.34 (7 Oct 2026) — Catch title required to publish (drafts may stay untitled); notification dropdown shows avatar + type badge or a type icon (`wn_notif_icon_html()` in inc/notifications.php). - 4.33.2 (6 Oct 2026) — fix: Catch Cloud script broke (a JS expression slipped into the PHP wnCC array) so tabs didn't click. - 4.33.1 (6 Oct 2026) — My Library explained as a home library (highlights, notes, resume, text size, private). - 4.33 (6 Oct 2026) — Catch Cloud page in simple Nepali (page-catch-cloud.php: `wn_t()` in PHP, `wnCC` object for JS strings, "यो पेज कसरी चल्छ?" box). Ruman wants member pages in EASY everyday Nepali, not formal/technical words. - 4.32.1 — save counts NOT in the profile header (Ruman: keep it uncluttered); shown next to the bookmark on each Catch, a line atop the Catches/Publications tabs, owner-only top 3 (`wn_saves_tab_html()`). - 4.32 — "🔖 N saves" on profiles (`inc/catch-save-stats.php`: per-Catch `_wn_save_count` kept by `wn_after_toggle_save`, one-time backfill, Settings → General switch). - 4.31 — "My manuscripts" card on the writer's own profile (`wn_ms_profile_card_html()` in inc/feedback-and-manuscripts.php, owner-only in page-profile.php): matched by post_author or `_wn_ms_email` = account email; status labels editable at Manuscript Submissions → Page settings (`st_*`, `profile_on`). - 4.30.1 — password forms stay on top; the email link is a small collapsed link underneath (Ruman wants password as the main way). - 4.30 — Email magic links: sign in / sign up with just an email (`inc/magic-link.php`, `assets/js/magic-link.js`; forms via `wn_magic_form_html( 'login'|'signup' )` in front-page.php login + sign-up panels and page-sign-up.php; landing `?wn_magic=` with a POST button; Users → Email sign-in links = settings + log). Also fixed stale nonces on cached pages: `wn_fresh_auth_nonces` refreshes `wnSignup.nonce` / `wnLogin.nonce` on load. - 4.29.3 — Manuscript files moved to the same private encrypted store (`wn_msdoc_*` in inc/id-documents.php, post meta `_wn_msdoc`; signed viewer; kept after review, optional auto-delete of Declined files at Manuscript Submissions → Page settings → File safety). - 4.29.2 — Verified badge checklist in Settings (Nepali-first, with progress): own profile photo, account ≥ 7 days old, ≥ 3 published Catches. ID form only when all ✅; server refuses otherwise. Review lists show age / Catches / photo. Numbers at Verification → ID document safety → Verified badge rule (`wn_iddoc_settings[badge_require_photo|badge_min_days|badge_min_catches]`). - 4.29.1 — profile photo required before the badge ID form (first version of the rule above). - 4.29 — ID documents (verified badge + payout Tax/ID) moved out of the public Media Library into private, encrypted storage (`inc/id-documents.php`): outside public_html where possible, libsodium encryption keyed from wp-config salts, signed admin-only viewer, access log, auto-delete after Approve/Reject (or N days), delete on account deletion, one-time migration of old attachments. Settings: wp-admin → Verification → ID document safety. - 4.28 — Manuscript page (/submit/) in Nepali with the full process and the 3-month rule; settings at Manuscript Submissions → Page settings. - 4.27 — "🔔 Reminder list" box on each competition + CSV. - 4.26 — Paid Catch protection (feeds/search preview only, copy limit, watermark, invisible code, WN Tools → Paid Catch protection). - 4.25 — wp-admin → Users "Joined via" column (`wn_joined_via`). - 4.24 — Akshar Pratiyogita reminder box; visitors can leave an email. - 4.23 — max / min number of entries per competition. - 4.22.1 / 4.22 — "🔔 Remind me" list + hourly cron `wnc_reminders`. - 4.21.1 — two November 2026 competitions seeded once as DRAFTS. - 4.21 — Akshar Pratiyogita (अक्षर प्रतियोगिता): monthly writing competitions, all edited in wp-admin → Akshar Pratiyogita (left menu, trophy icon); pages /pratiyogita/ and /pratiyogita/{slug}/; card in the Catch feed; entries are free Catches; WritingNepal picks winners and one tick publishes results + pays Akshar. Judged by "WritingNepal". - Before it: 4.20 (WN Specials: four official Akshar offers + top-up cap fix), 4.19.3 (Messages key archive + Key check), 4.19.2 (stale device key check). All built on baseline **4.19.1** (zip `writingnepal (7).zip`), which Ruman set as the final matching theme to build all further edits on. If the next zip you get is older than the latest delivered version, ask which releases since 4.19.2 were uploaded. Ruman sometimes uploads only some files — if something "doesn't show", first check the file reached the server (Site Structure → Files on the server). - Update this line every time a new version is delivered. ## 0.1 Always say the version (Ruman's rule) Every reply that edits files must say, plainly: - **"Edited from version X → now version Y"**, and - **every file changed, with its folder path** (e.g. `inc/wallet-gateways.php`). Never deliver an edit without this line. ## 0.2 Always separate files (Ruman's rule) Deliver every changed file **as its own separate file** — never a zip. List each file with its folder path so Ruman knows where to upload it. ## 0.3 Everything editable from wp-admin (Ruman's rule) New features that show content to members (names, texts, dates, amounts, on/off, email texts, limits) must be editable from wp-admin — not hard-coded, and anything collected (lists, sign-ups) must be viewable there. Claude can't log in to wp-admin; to add content for Ruman, seed it once as drafts from the theme (behind a one-time option) and let him review and publish. Make new UI visible in admin previews of drafts too, so Ruman can check it before publishing. ## 0.4 Nepali first (Ruman's preference) Member-facing pages and emails are written Nepali-first. Use `wn_t( $en, $ne )` for page text (phones default to Nepali) and send emails with Nepali on top and English below. When Ruman asks "suggest first", give a recommendation and wait for his go-ahead before building. ## 1. Before you change anything 1. **Find the version** of the files you were given: `style.css` → `Version:`. 2. **Compare it with what's live.** Ruman should give you the *handoff file* (WN Tools → Site Structure → "Download handoff for Claude"). It says the live version, which files on the server don't match, open to-dos, and changes Ruman made himself. - Zip version **older** than live → **stop** and ask for a fresh backup. Editing an old copy silently undoes newer work. - Handoff lists files as **changed/missing** → ask whether that was deliberate before building on those files. - No handoff given → ask for it (or at least the live version number). 3. Read the newest release in `inc/site-changelog.php` to see what was done last and what's still open. ## 2. While changing - Deliver **complete drop-in files**, never snippets. Ruman uploads whole files; manual merges break things. - Keep desktop untouched when fixing mobile (and vice-versa) unless asked. - Lint every PHP file (`php -l`) and JS file (`node --check`). `php -l` does NOT catch runtime errors: after big text replacements on a page, render it with stubbed WordPress functions and click through it in Playwright (Chromium is installed) before delivering. - New DB tables: create with `dbDelta` behind a `wn_*_table_vN` option; never drop or rename existing tables/columns without asking. - Hostinger caches aggressively: bump asset versions via `wn_asset_version()` (filemtime based — just changing the file is enough). Logged-out pages can be served from cache without PHP running — anything that must react to a URL parameter for logged-out visitors needs a small JS fallback, and logged-out AJAX can't rely on nonces printed into the page. - **Bilingual pages (since 4.9):** every footer page (policies, About, FAQ, How it works, Advertise, Media kit…) has a Nepali AND an English block (`wn_lang_attr()` / `wn_page_lang_tabs()` in `inc/language-switch.php`; FAQ text is `q_ne`/`a_ne` in `wn_get_faq_items()`). Any change to one language must be made to the other in the same release. Use `data-anchor="x"` (not `id`) on headings inside those blocks. Short UI strings elsewhere can use `wn_t( $en, $ne )`; Nepali digits via `wn_ms_num()`. There is no BS (Nepali) date converter — let admins type Nepali date labels. - **Paid content:** never output a paid Catch's full text anywhere new without checking `wn_pcp_can_read_full()` (inc/paid-content-protection.php) — writer, admin, unlocked, or e-book bundle owner. - **ID / sensitive documents:** never use `media_handle_upload()` for ID documents. Use `wn_iddoc_store_upload( $user_id, $kind, $field )`, show them with `wn_iddoc_admin_link_html()`, and call `wn_iddoc_after_decision()` on approve/reject (inc/id-documents.php). Badge eligibility: `wn_badge_requirements()` / `wn_badge_requirements_met()`. - **Sign-up:** the sign-up form (AJAX `wn_signup`) can only create an account after the email OTP check (`inc/signup-otp.php`, priority-5 gate). Social logins (Nextend) and admin-created users skip it. Email-link sign-ups (inc/magic-link.php) create the account themselves (the link proves the email), set `wn_joined_via = magic_link`, and leave `wn_role_chosen` unset so /choose-type/ asks the role. Front-page.php and page-sign-up.php have CRLF line endings — edit them CRLF-aware. - **Emails:** use `wn_email_template( $eyebrow, $heading, $body_html, $cta_url, $cta_label )` + `wp_mail` / `wn_send_html_email()`, skip addresses where `wn_is_email_unsubscribed()` is true for bulk/reminder mail, add the "reply unsubscribe" footer line. CSV exports: UTF-8 with BOM so Excel shows Nepali. - **Akshar money rules:** free/reward Akshar must never be added to `wn_akshar_purchased_remaining` (writers get 90% only on bought Akshar). `wn_award_akshar()` applies the 500 AK/day reward cap — never use it for paid Akshar or for rewards with their own budget; use `wn_sp_pay()` (pays once per user/offer/claim key, reason prefixed "WN Offer —"). ## 3. After changing — every time, no exceptions 1. **Bump `Version:` in `style.css`.** `4.0 → 4.1` for features, `4.0 → 4.0.1` for small fixes. (style.css may have CRLF line endings — check the bump actually landed.) 2. **Add a release at the top of `wn_site_releases()`** in `inc/site-changelog.php`: version, date, title, summary, and one entry per change with `area`, `text`, `files`, and flags: - `'user' => true` — users will notice it; - `'public' => '…'` — one friendly sentence for members, if it's worth telling them. These lines become the "What's new" email (inc/weekly-updates.php), so write them for readers/writers, not developers — no file names, no jargon. Leave it out for admin-only or invisible changes; - `'policy' => array( 'terms', 'privacy', … )` — it changes what a policy page says or should say (keys: terms, privacy, cookies, payment, faq, shop, community, akshar-terms); - `'db' => '…'` — new table / column / option / cron / cookie / local storage key. 3. **Policy check.** For every change ask: does Terms, Privacy, Cookie, Payment, Shop, Community or Akshar terms still describe the site truthfully? If not, update the page in the same release and add a *done* entry to `wn_site_actions()`. If it can't be done now (needs Ruman's decision, legal review, or telling users), add an *open* entry with a realistic `due` date. Tell Ruman in plain words. - New data collected, new cookie/local storage → Privacy + Cookies. - Anything about money, fees, payouts, prices → Payment (+ FAQ, Terms). - Anything shown publicly about a user → Terms + Privacy. 4. **Regenerate the fingerprints:** from the theme folder run `php tools/build-release.php` (writes `wn-release.json`). Do this last, after every other file is final. 5. **Deliver** every changed file **separately (no zip)**, including `style.css`, `inc/site-changelog.php` and `wn-release.json`, each with its folder path. After Ruman uploads, WN Tools → Site Structure → "Files on the server" must say ✓ Match. 6. Tell Ruman **"Edited from version X → now version Y"**, the list of changed files with paths, and any to-dos you added. Then update the baseline line in section 0. ## 4. Where things are - `functions.php` — loads everything in `inc/`. - `inc/site-changelog.php` — releases + to-dos (this system's data). - `inc/site-structure.php` — WN Tools → Site Structure page. - `inc/admin-calendar.php` — WN Tools → Calendar (to-dos, reminders). Add a calendar task for anything Ruman must do on a date. - `inc/weekly-updates.php` — "What's new" email to members (built from `'public'` lines; admin ticks which lines go in; monthly / weekly / chosen dates). - `inc/site-analytics.php` — Site Analytics, live, taps, site walk, returning visitors. - `inc/monthly-report.php` — monthly report email. - `inc/writer-earnings.php` — Writer Earnings admin + Best-selling writers card. - `inc/feed-site-promos.php` — Nepali promo cards in the feed. `page-catch.php` — the Catch feed (cards inserted by post count). - `inc/akshar-core.php` — Akshar, unlocks (fires `wn_after_paid_unlock`), suspension. - `inc/wallet-gateways.php` — top-ups, writer earnings, withdrawals, Tax/ID + verified-badge review page (wp-admin → Verification). - `inc/id-documents.php` — private encrypted ID document storage; user meta `_wn_iddoc_badge` / `_wn_iddoc_tax`; options `wn_iddoc_settings`, `wn_iddoc_dir`, `wn_iddoc_log`; cron `wn_iddoc_purge`; wp-admin → Verification → ID document safety (also the badge checklist rules). Badge upload handler is in `inc/admin-and-misc.php`; Settings badge section in `page-settings.php`; front CMS review in `page-wn-cms.php`. Profile photo = user meta `wn_avatar_id` (inc/profile-and-follow.php). - `inc/akshar-offers.php` — member-made Akshar Offers (claim + review). - `inc/wn-specials.php` (+ `assets/css/wn-specials.css`, `assets/js/wn-specials.js`) — WritingNepal's own offers; table `wp_wn_sp_claims`, option `wn_sp_settings`. - `inc/contests.php` (+ `single-wn_contest.php`, `archive-wn_contest.php`, `assets/css/contest.css`, `assets/js/contest.js`) — Akshar Pratiyogita; CPT `wn_contest`, meta `_wnc_settings` / `_wnc_awards` / `_wnc_results_published` / `_wnc_interested` / `_wnc_sent_open|close` / `_wnc_guest_emails` / `_wnc_sent_open_g|close_g` / `_wnc_extended`; entries are Catches with `_wnc_contest`, `_wnc_cat`; cron `wnc_reminders`; `wnc_stage()` (needs Published, may auto-extend) vs `wnc_date_stage()` (dates only); reminder list box + CSV. - `page-submit.php` + `inc/feedback-and-manuscripts.php` (CPT `wn_manuscript`, `wn_handle_submit_manuscript`, `wn_ms_page_settings()` / option `wn_ms_page_settings`) + `assets/css/submit.css` — manuscript submissions. - `inc/paid-content-protection.php` (+ `assets/js/paid-protection.js`, `assets/css/paid-protection.css`) — paid Catch protection; option `wn_pcp_settings`; WN Tools → Paid Catch protection. - `inc/admin-join-method.php` — "Joined via" (user meta `wn_joined_via`). - `inc/signup-otp.php` — sign-up email code (OTP). - `inc/search-login-and-akshar-gifts.php` — `wn_email_template()`, `wn_send_html_email()`, `wn_award_akshar()`. - `inc/email-unsubscribe.php` — do-not-email list. - `inc/link-previews-and-cards.php` — feed cards, OG tags. - `inc/rewards-and-publishing.php` — Catch publishing (`wn_handle_write_publish`). - `inc/e2e-messaging.php` + `assets/js/e2e-crypto.js` + `page-messages.php` — end-to-end encrypted messages (keys, recovery code, stale-key check, key archive `wn_e2e_key_archive`, older-key fallbacks, Key check). - Policy pages: `page-terms-of-use.php`, `page-privacy-policy.php`, `page-cookie-policy.php`, `page-payment-policy.php`, `page-shop-policy.php`, `page-community-rules.php`, `page-akshar-terms.php`; FAQs live in `wn_get_faq_items()` in `inc/theme-setup-and-pwa.php`. ## 5. Vocabulary Catch (never "post"), Catch Cloud, Akshar (100 AK = Rs 1), Glimpse, Grantha, WN Digital Card, Akshar Pratiyogita (अक्षर प्रतियोगिता), पाण्डुलिपि (manuscript). Roles: Writer, Publisher, Catcher (never "Blogger"). Writers keep 90% of real-money sales; minimum withdrawal Rs 100. https://writingnepal.com/wp-sitemap-posts-post-1.xmlhttps://writingnepal.com/wp-sitemap-posts-page-1.xmlhttps://writingnepal.com/wp-sitemap-posts-wn_listing-1.xmlhttps://writingnepal.com/wp-sitemap-posts-wn_contest-1.xmlhttps://writingnepal.com/wp-sitemap-posts-book-1.xmlhttps://writingnepal.com/wp-sitemap-posts-book-2.xmlhttps://writingnepal.com/wp-sitemap-posts-catch-1.xmlhttps://writingnepal.com/wp-sitemap-posts-wn_series-1.xmlhttps://writingnepal.com/wp-sitemap-posts-grantha-1.xmlhttps://writingnepal.com/wp-sitemap-posts-wn_event-1.xmlhttps://writingnepal.com/wp-sitemap-taxonomies-category-1.xmlhttps://writingnepal.com/wp-sitemap-taxonomies-catch_category-1.xmlhttps://writingnepal.com/wp-sitemap-taxonomies-wn_grantha_type-1.xmlhttps://writingnepal.com/wp-sitemap-users-1.xml