lihi 短網址會將 lihi 短連結服務整合到 WordPress 管理後台。編輯者可以從文章與媒體列表畫面建立短網址、選擇重新導向網域、加入標籤,並為非媒體項目加入 UTM 參數,然後不離開 WordPress 即可複製結果。既有短網址會變成複製控制項,管理員也可以開啟對應的 lihi 控制台頁面編輯連結。這個外掛為開放原始碼,維護於 weedgood/lihi-wp-plugin。
這個外掛只會在 wp-admin 中執行;不會新增任何前台輸出,也不會在公開頁面載入指令碼。
功能
- 在所有公開內容類型列表畫面(文章、頁面、自訂內容類型)新增含有 建立 按鈕的 lihi 短網址 欄位。
- 在媒體庫列表檢視與媒體格狀檢視的附件詳細資料面板中,新增相同的建立 / 複製控制項。
- 一鍵複製:透過 AJAX 按需產生短網址並寫入剪貼簿;如果瀏覽器阻擋剪貼簿存取,會顯示手動複製提示。
- 建立視窗:建立新短網址前,可選擇重新導向網域、加入建議或自訂標籤,並為非媒體項目加入 UTM 參數。
- UTM source 與 medium 會從 lihi 帳號選項載入,而 campaign、term 與 content 則保留為自由文字欄位;媒體項目會隱藏 UTM 控制項並送出空白 UTM 值。
- 當項目已有短網址時會重複使用既有短網址,因此重複點擊的結果相同。
- 複製按鈕在複製前仍會確認上游短網址存在;如果短網址已被移除,按鈕會回到 建立 並再次開啟建立視窗。
- 成功查詢或建立短網址後,會在項目上標記
lihi_already = 1文章中繼資料;前端會將這些按鈕呈現為「複製」。 - 管理員可以透過瀏覽器驗證的穿透流程,在 lihi 控制台開啟既有短網址、個人網域管理與 UTM 選項管理。
- Settings page under Settings → lihi Short URL with Login and Register tabs, connected-account details, work-group switching, Logout, and a lihi dashboard shortcut. Login is selected by default, and the service heading breaks cleanly between its two sentences. Directly sanitized query-backed tab links and native WordPress AJAX POST forms keep tab switching and submission usable without JavaScript; JavaScript adds instant keyboard tabs, an accessible work-group modal layered above the dashboard workspace, inline errors, and delayed success feedback. Successful work-group changes reload the settings page after the confirmation so all group-scoped state is fresh. Logout makes one short best-effort server-session revocation and always continues with local credential cleanup.
- Registration checks the request country before sending a verification email. Allowed registrations retain the registration request’s IP and device metadata for account creation; clicking the verification link does not replace them. After verifying, the administrator returns to the separate Login form; registration never logs the account in.
- Login uses server-side PKCE and stores the email, opaque server-issued session identifier, access token, and rotating refresh token together in one non-autoloaded WordPress option. A renewable 20-second database lease serializes Login and Refresh; only the current byte-exact lease owner can write credentials under the captured activation generation.
- Every refreshable protected lihi API request can refresh a rejected access token and retry once. Login and Refresh recheck activation after each remote response before renewing the lease; concurrent requests wait up to 18 seconds for a 15-second HTTP operation to finish. Any attempted refresh failure removes credentials still belonging to that Login session and asks the administrator to sign in again, while a newer Login remains untouched.
- 已本地化;內含繁體中文(
zh_TW)。
外部服務
這個外掛會連線至 lihi 短網址服務,以識別 WordPress 網站、驗證網站管理員,並建立或查詢短網址。沒有網際網路連線時,外掛無法運作。
Service: lihi WordPress API auth endpoints (https://app.lihi.com/api/wordpress/v1/auth)
- When data is sent: when an administrator submits Register, Login, or Logout on Settings → lihi Short URL; when Login exchanges its short-lived authorization code; when any protected API rejects the access token and the plugin attempts one token refresh; and once during plugin uninstall when a local session is available.
- What is sent for Register: the entered email and password plus the WordPress site’s hostname. The request also carries normal network metadata such as source IP and User-Agent, which lihi uses to check registration availability and record the registration country and device. Account-creation consent is checked locally before the request. A successful registration only sends a verification email; it returns no login credentials and does not connect the plugin.
- What is sent for Login: the entered email and password, the WordPress site’s hostname, and a PKCE challenge generated by WordPress PHP. The server returns a short-lived authorization code; WordPress sends that code with the matching verifier retained only in PHP memory to exchange it for a server-issued UUID, access token, and refresh token.
- What is sent for refresh: the stored server-issued UUID and current refresh token. A successful refresh returns a new access token and a rotated refresh token.
- What is sent for Logout or uninstall: the stored access token in the Authorization header. No request body is sent. This one-shot request is not refreshed or retried; network or API failure is ignored so local Logout/uninstall cleanup still finishes.
- What WordPress stores: one non-autoloaded credential option containing the email, UUID, access token, and raw refresh token. The password, PKCE verifier, challenge, and authorization code are not stored after the request.
Service: lihi WordPress API protected endpoints (https://app.lihi.com/api/wordpress/v1)
- When data is sent: when a connected administrator opens the settings page to display account information, opens the work-group switcher, or confirms a work-group change; when the Create modal loads redirect-domain and UTM options; when an administrator opens the lihi dashboard through passthrough; and when a user clicks “Create”, “Copy”, or “Edit” to generate, look up, copy, or edit a short URL. Media Create modals hide UTM controls and submit blank UTM values.
- What is sent: the stored access token; when switching work groups, the selected numeric group ID or
nullfor the personal work group; the post or attachment URL (permalinkor attachment file URL, with entered UTM parameters appended); the post type namespace including the WordPress hostname; the post ID; the selected redirect domain; selected tags as a comma-separated string; and, when requesting browser passthrough, a browser-generated PKCE challenge plus an optional target such as a short URL or lihi dashboard path.
Service: browser-facing lihi pages (https://lihi.io, https://app.lihi.com, and https://lihidomain.com)
- When data is sent: only after a user clicks the lihi dashboard, password-reset, personal-domain, or verification-email link.
- What is sent: the browser’s normal request metadata. Connected dashboard links additionally carry the short-lived passthrough nonce and browser verifier described above; verification links carry the one-time registration token from the email. Public home, password-reset, and public domain-information links receive no account credentials from the plugin.
使用此外掛即表示你同意上述資料會傳送至 lihi 服務。請檢閱 lihi 服務的法律文件:
- 使用條款:https://knowledge.lihi.io/terms/
- 隱私權政策:https://knowledge.lihi.io/privacy-policy/