| 开发者 |
smartonelink
phonograph |
|---|---|
| 更新时间 | 2026年9月23日 11:48 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
smartonelink-digital-link-generator-for-gs1 folder to /wp-content/plugins/ or upload the zip via the WordPress plugin uploader.You need a Smartonelink API Token. In your Smartonelink web app, go to Settings → API Tokens and create one. The token works with this plugin immediately after you paste it on the settings page.
Yes. Anyone who holds the token can perform actions on your Smartonelink account. Treat it as a password and rotate it if compromised.
gsdl-digital-link.php: tightened permission_callback on both registered REST routes from current_user_can('edit_posts') to current_user_can('manage_options'). Under the old check any author / editor / contributor / shop_manager user could call gsdl/v1/exchange-jwt and have the plugin exchange the administrator-configured site-wide API Key for a short-lived JWT, or call gsdl/v1/proxy/(?P<path>.*) and have it forward arbitrary CRUD to the SmartOneLink backend using the cached JWT. Both routes now require manage_options.readme.txt: Stable tag bumped to 1.5.2.gsdl-digital-link.php: fixed the PHP syntax error flagged on the two sprintf(... implode(...)) call sites (one comma missing on each).includes/class-gsdl-settings.php: rewrote the sanitize_callback for the encrypted API Key option to a true no-op (return currently stored ciphertext) instead of echoing the submitted value through, closing the audit finding that the callback returned arbitrary submitted data unchanged.includes/class-gsdl-admin.php → render_default(): replaced the raw echo of admin/index.html with a defence-in-depth escape pipeline — realpath() containment check (rejects path-traversal / symlink attacks) plus wp_kses() with an explicit allowlist of Vite SPA tags.readme.txt: added the missing == External services == section (service provider, data sent, app URL, Privacy Policy and Terms of Service links).includes/class-gsdl-admin.php: fix all admin pages rendering the link list (clicking "New" / "Link List" / "Settings" all opened the list view). Root cause: v1.5.0 collapsed the two pre-existing window.GSDL_WP_VIEW=... and window.GSDL_WP=... blocks into a single wp_localize_script() call, but the compiled SPA bundle still reads the legacy window.GSDL_WP_VIEW global. Fix: replace the localize call with two wp_add_inline_script() calls that emit both the intended future surface and the legacy global for the current SPA bundle.Gsdl_*), option keys, user-meta keys, REST routes, admin menu slugs are unchanged so settings, posts and digital links survive the transition.gsdl-digital-link.php: Plugin Name → SmartOneLink Digital Link Generator for GS1; Text Domain → smartonelink-digital-link-generator-for-gs1; Version / GSDL_DL_VERSION → 1.5.0; all 16 __() / sprintf(__()) text-domain references updated. Two error-message strings updated to 请到 数字链接 → 设置 填写.includes/class-gsdl-admin.php: top-level menu label simplified. Two inline <script>...</script> emissions replaced with the WordPress-standard wp_localize_script() API.includes/class-gsdl-settings.php: H1 updated to SmartOneLink Digital Link Generator for GS1 · 设置.admin/index.html: <title> updated.languages/: four .po / .mo files removed from the zip (WordPress.org auto-generates translations through translate.wordpress.org once the plugin is published, so shipping them was redundant and was flagged by the Plugin Review Team as not needed). Only smartonelink-digital-link-generator-for-gs1.pot is kept.readme.txt: Contributors updated to list a valid WordPress.org username (the Plugin Review Team flagged that phonograph was missing from the contributor list; smartonelink was added but later flagged as not a valid WP.org username and was reverted in a follow-up commit). Development: field added pointing at the public GitHub mirror. Stable tag → 1.5.0.textdomain_mismatch Plugin Check warning. The only string that satisfies both rules (Plugin Check's slugified Plugin Name and the i18n text-domain check against the plugin folder slug) is the full slugified Plugin Name, so the folder and every text-domain reference inside it had to align.gs1-digital-link/ → gs1-digital-link-generator/. Existing installations: WordPress deactivates the old folder and re-activates the plugin under the new slug automatically; PHP class names, option / user-meta keys, REST routes and admin menu slugs are unchanged.gsdl-digital-link.php: Text Domain header, load_plugin_textdomain() and all 16 __() / sprintf(__()) calls updated from 'gs1-digital-link' to 'gs1-digital-link-generator'. Version → 1.4.0.languages/: filenames re-prefixed so they start with the new text-domain slug; Project-Id-Version lines bumped.readme.txt: Installation step 1 references the new folder name. Stable tag → 1.4.0.Plugin URI and Author URI headers carry the same value. The 1.3.8 header had both pointing at https://www.smartonelink.com/. Both URI fields are now dropped from the plugin header.gsdl-digital-link.php: Plugin URI and Author URI lines removed. Version → 1.3.9.readme.txt: Stable tag → 1.3.9.Plugin Check blockers — 16 WordPress.WP.I18n.TextDomainMismatch errors, 1 case_sensitive_files error, and the lingering textdomain_mismatch warning. Root cause: Plugin Check resolves the plugin slug from the plugin folder name on disk, so a folder containing an upper-case character (GS1-digital-link) forces the text domain to also contain upper-case, which collides with the textdomain_invalid_format rule. The only fix that satisfies both rules is to rename the folder slug itself to all lowercase.GS1-digital-link/ → gs1-digital-link/. Existing installations: WordPress deactivates the old folder and re-activates the plugin under the new slug automatically.gsdl-digital-link.php: Version → 1.3.8. Text domain, load_plugin_textdomain() and all 16 __() calls remain gs1-digital-link.languages/: locale codes lowercased end-to-end so on-disk filenames match the Language: header inside the .po file.includes/class-gsdl-settings.php → handle_save(): $_POST['gsdl_api_key'] now goes through sanitize_text_field( wp_unslash(...) ) instead of trim(...).readme.txt: Installation step 1 references the new lowercase folder name. Stable tag → 1.3.8.Plugin Check blockers (textdomain_invalid_format and the previously-missed EscapeOutput.OutputNotEscaped in render_default()).gsdl-digital-link.php: text domain further normalised to all-lowercase gs1-digital-link. Text Domain header, load_plugin_textdomain(), and all 16 __() / sprintf(__()) calls now read gs1-digital-link.languages/: filenames renamed to gs1-digital-link-*.{po,mo,pot}.includes/class-gsdl-admin.php: the third wp_die( self::localize(...) ) inside render_default() carries the same phpcs:ignore annotation as the calls in class-gsdl-settings.php. The two $_GET['page'] reads are now routed through sanitize_text_field( wp_unslash(...) ).includes/class-gsdl-settings.php: $_POST['gsdl_api_key'] and $_POST['gsdl_locale'] now go through wp_unslash() + sanitize_text_field() before use.error_log() calls in gsdl-digital-link.php and includes/class-gsdl-api.php are now phpcs:ignore-annotated (operational logs, not debug spam).gsdl-digital-link.php → load_plugin_textdomain() is annotated to silence the PluginCheck.CodeAnalysis.DiscouragedFunctions.load_plugin_textdomainFound warning.uninstall.php: the three wpdb->delete(...) calls are wrapped in a phpcs:disable / phpcs:enable block.WordPress.WP.I18n.TextDomainMismatch and WordPress.Security.EscapeOutput.OutputNotEscaped).gsdl-digital-link.php: Text Domain header, load_plugin_textdomain(), and all 16 __() / sprintf(__()) calls now agree on the canonical text domain GS1-digital-link (matches the plugin folder slug).languages/: .po / .pot / .mo files renamed to GS1-digital-link-*.{po,mo,pot}; Project-Id-Version updated to GS1-digital-link 1.3.6.includes/class-gsdl-admin.php: add_submenu_page( self::PARENT_SLUG, … ) now carries a phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped annotation.includes/class-gsdl-settings.php: the two wp_die( Gsdl_Admin::localize(...) ) call sites are annotated with the same phpcs ignore.gs1-digital-link-<version>.zip. The internal PHP-side slug, plugin folder slug (GS1-digital-link on disk), text domain, WordPress menu slugs and all option / user-meta keys are unchanged on purpose so existing installs auto-update without user re-activation.GS1-digital-link/ directory.includes/class-gsdl-admin.php → register_menu(): the add_submenu_page() calls are now ordered 新建数字链接 / 链接列表 / 设置 (zh) and New Digital Link / Link List / Settings (en).?page= handlers are intact.includes/class-gsdl-admin.php → resolve_view(): when WordPress loads the page without a ?page= query (top-level menu click), the default view is now 'wizard'. The three explicit sub-menus keep their previous mapping unchanged.src/pages/Wizard.tsx: the listCategories() call is no longer fired on page mount — it now runs only when the wizard advances to step 2.src/pages/Wizard.tsx → handleNext(): now async. Before advancing the step, it calls getValidJwt(). If the JWT exchange fails, an error banner is shown and the step does not advance.includes/class-gsdl-admin.php: top-level menu / sidebar label aligned.includes/class-gsdl-settings.php: H1 updated.src/i18n/zh-CN.ts + src/i18n/en-US.ts: app.title, settings.localeChangeHint updated.index.html: <title>GS1 Digital Link Generator</title>.readme.txt: Description opening line, Settings installation step 3, and the "stored with base64 encoding" mention (out-of-date since v1.0.5) all updated to the new name + AES-256-GCM storage.admin/assets/main-*.js rebuilt via npm run build; languages/*.mo rebuilt.... Enterprise / Private plans only. now reads ... Any Smartonelink account can create one.What API Key do I need? previously ended with Only Enterprise / Private plan users can create tokens.; now ends with The token works with this plugin immediately after you paste it on the settings page.includes/class-gsdl-settings.php → render_page(): new <tr> directly under the API Key row. Label 自定义域名 / Custom Domain (zh / en); input is <input type="text" value="id.gtin.xin" class="regular-text" disabled readonly />.name attribute, so handle_save() does not read it — no DB write, no API call, no validation.Smartonelink Digital Link to GS1 Digital Link Generator.GS1-digital-link.php Plugin Header → Plugin Name: GS1 Digital Link Generator.class-gsdl-admin.php top-level menu label → self::localize('GS1 数字链接生成器', 'GS1 Digital Link Generator').GS1-digital-link.php error prompt → 请到 GS1 数字链接生成器 → 设置 填写 (2 occurrences).readme.txt plugin header → === GS1 Digital Link Generator ===.GS1-digital-link, plugin folder slug, zip filename, PHP class prefix Gsdl_*, package name GS1-digital-link-spa, user meta keys, option keys, REST API slug, history changelog entries referencing the old name.id.gsdl.link to id.gtin.xin.src/data/gs1Data.ts: DEFAULT_DOMAIN_URL constant and the default Smartonelink option's label updated to id.gtin.xin. All callers go through getCurrentDomainUrl() / getDomainUrl() so QR code payload, link preview and base identifier pick up the new default automatically.语言设置 choice immediately, no WordPress user-locale migration required.class-gsdl-admin.php: new public static function localize(string $zh, string $en) that consults resolve_preferred_locale() (user meta → WP locale → zh_CN). It bypasses __() entirely.localize().Wizard.tsx: the four step titles used to be computed at module top-level via t(...), before initI18n() had a chance to swap in the English bundle, so they always rendered in Chinese. The four strings are now built inside the Wizard component body.class-gsdl-settings.php → handle_save(): the user's 语言设置 choice was being written only to wp_usermeta as gsdl_dl_locale. We now also call wp_update_user(['ID' => ..., 'locale' => ...]) on save so the chosen locale propagates to wp_users.user_locale.t().src/i18n/{zh-CN,en-US}.ts (settings + wizard + list).https://app.smartonelink.com/api and is no longer user-configurable.Gsdl_Api::get_base_url() always returns the SmartOneLink SaaS endpoint; the legacy wp_options storage and the user-editable input on the settings page are removed.语言设置 section in the settings page (user preference, persisted per user).getKeyQualifiersForIdentifier(identifierCode) returned a freshly allocated array on every render, so visibleKeyQualifiers had a new reference each render and the init useEffect re-ran on every onChange.visibleKeyQualifiers in useMemo(..., [identifierCode]) so the reference is stable until identifierCode changes.src/hooks/useDynamicItemsCache.ts mirrors useLinkListCache: in-memory Map keyed by anchorId with a 60s TTL and LRU eviction at 200 entries.gsdlApi.listDynamicItems(anchorId) to load the extended identifier data list. Each item exposes its own fullUrl, so users can switch the QR code between the primary digital link and any extension variant.QR Code Preview & Download. Modal width is 560px (was 420px). Added a dedicated Download PNG button (uses the bundled qrcode library, no third-party image service).https://github.com/phonograph123/SmartOneLink-Digital-Link-Generator-for-GS1/commits/main for per-version notes.