| 开发者 | redshape |
|---|---|
| 更新时间 | 2026年2月28日 03:44 |
| PHP版本: | 7.0 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
redshape-easylabels folder to the /wp-content/plugins/ directoryNo, labels and notes are visible only in the WordPress backend for internal content organization.
Yes, you can enable the system for any post type from the settings page.
Yes, you can configure permissions by user role from the Permissions settings section.
There is no limit to the number of labels you can create.
Yes, the plugin ships with standard WordPress .po/.mo translation files for 10 languages (IT, EN, FR, DE, ES, RU, ZH, JA, KO, HI). The files live in the languages/ folder and follow the conventional naming redshape-easy-labels-{locale}.mo, making the plugin fully compatible with Loco Translate, GlotPress, WPML, WP-CLI i18n tools, and any other standard WordPress translation workflow. Translation files are also regenerated automatically on plugin activation.
Yes, from the Backup & Restore section you can export all settings to a JSON file and import them on another site. The system automatically filters content types that don't exist on the destination site.
Toggle the Multi switch in the quick filters to enable multi-select mode. Click label badges to apply filters immediately (AJAX) without page reload, and choose AND or OR mode. AND returns posts that match all selected labels, while OR returns posts that match at least one selected label.
plugin_language option now controls only the operational interface (content labels, filter bar, notes, modals, dashboard widgets)switch_to_locale() call in prepare_view_data() — post-type names on the settings page now correctly follow the WordPress site localecursor: pointer added to header bars for clarity1px solid #c3c4c7 and hover border to 1px solid #2271b1 with box-shadow: 0 4px 12px rgba(0,0,0,0.08); removed transform: translateY animations and non-standard border thicknesses/colours from post-type cards, language cards, support cards and setting sectionsphpcs:disable/enable block in redshape-easy-labels.php to correctly suppress NonceVerification.Recommended across the multi-line $is_settings_page expression (reading-only $_GET['page'] to determine admin context)admin-page.php to use the $redshape_easylabels_ plugin prefix, resolving PrefixAllGlobals PHPCS warningsclass-redshape-easylabels.php which caused an early return that left Redshape_Easylabels undefined, then plugins_loaded still tried to instantiate it and crashed; check is now in the main entry file redshape-easy-labels.php so if any file is missing the plugins_loaded hook is never registered — WordPress shows a clear admin notice listing the missing filesclass-redshape-easylabels-helpers.php, etc.) — class-redshape-easylabels.php now checks all 10 required files with file_exists() before loading them; if any are missing a clear admin notice lists them and the plugin exits cleanly instead of crashing WordPressNonPrefixedVariableFound warning — removed global variable $_redshape_easylabels_lang_gen in redshape-easy-labels.php, replaced with an inline file_exists() callclass-redshape-easylabels-language-generator.php was missing from a partial deploy — require_once is now conditional on file_exists(); all call-sites guarded with class_exists('Redshape_Easylabels_Language_Generator')save_settings() accessed $current_options['default_labels'] and $current_options['role_settings'] without isset; on PHP 8 a missing key returns null, causing update_option to overwrite labels and widgets with null/empty values; replaced with defensive isset reads and added automatic migration from the legacy labels key to default_labelspost and page — enqueue_settings_page_scripts() read $settings['role_settings']['enabled_post_types'] which is always null because get_settings() flattens role_settings keys to root level; corrected to read $settings['enabled_post_types'] directly$(document).on('click') bubbling (ineffective inside Gutenberg's iframe) and capture-phase attempt with a transparent full-screen backdrop div (z-index 99998) that intercepts any click outside the dropdown; added centralised closeAllDropdowns() helper used by all 8 close paths'Label name is required' translation key in 8 non-Italian locales (fr_FR, de_DE, es_ES, ru_RU, zh_CN, ja_JP, ko_KR, hi_IN) — JS validation error was always displayed in English regardless of plugin language settingupdate-core.php?force-check=1) without leaving the adminclass-redshape-easylabels.php, 4619 lines) into 8 focused single-responsibility classes — Redshape_Easylabels_Helpers (static shared utilities), Redshape_Easylabels_Admin_Columns, Redshape_Easylabels_Bulk_Actions, Redshape_Easylabels_Filter_Bar, Redshape_Easylabels_Meta_Box, Redshape_Easylabels_Ajax, Redshape_Easylabels_Dashboard_Widget, Redshape_Easylabels_SettingsRedshape_Easylabels class is now a lean coordinator that instantiates sub-classes and wires up shared hooksadmin.js (Clicca per rimuovere, Aggiungi etichetta, Errore critico. Ricarica la pagina., Errore di elaborazione risposta) — all now routed through the __() JS helper using English keys; translations added for all 10 supported languages.po/.mo files — now fully compatible with Loco Translate, GlotPress, WPML, and WP-CLI i18n toolsRedshape_Easylabels_Language_Generator class that builds .po and .mo files from the existing translation data (pure PHP, no external dependencies)bin/generate-languages.php CLI script to regenerate all language files from the command line during developmentload_textdomain() now loads the correct .mo based on the per-plugin language setting (plugin_language option), independently of the WordPress site localeclass-redshape-easylabels-content-i18n.php (\~2300 lines, \~70% identical to the main i18n class, never loaded, using a stale option key content_labels_options)_content_labels) to one post-meta row per label (_content_label) — meta queries now use exact-match = instead of LIKE '%...%', enabling MySQL index usagemaybe_upgrade_storage() one-time migration function converts existing data transparently on first admin load after updateget_post_label_ids() and set_post_label_ids() private helpers to centralise all label read/write operationsfilter_posts_by_label(), add_quick_filter_bar(), and counter queries updated to use the new storage formatRedshape_Easylabels_Cache) updated to use the new meta key and exact-match queriesuninstall.php now cleans up both _content_label (new) and _content_labels (legacy) meta keysadmin-page.php — all DB reads, locale switching, wp_localize_script, and static data arrays extracted into a new prepare_view_data() private method in Redshape_Easylabels_Settings; the template is now pure display HTML/PHP with no business logicmanage_{$pt}_posts_columns / manage_{$pt}_posts_custom_column are now registered (fires for all post types); the redundant manage_{$pt}s_columns / manage_{$pt}s_custom_column hooks that caused double-fire on built-in types have been removed, along with the workaround guards they requiredGROUP BY meta_value query in Redshape_Easylabels_Helpers::get_label_counts_for_post_type() — used by both the AJAX filter-count endpoint and the dashboard widget renderer; eliminates the N-query loop that previously ran one SELECT COUNT(DISTINCT) per label; no maybe_unserialize() needed since _content_label stores flat string values\' escaping into a proper file assets/js/admin-bulk-actions.js; translated alert strings passed via wp_localize_script as redshapeEasylabelsBulk.i18nredshape_easylabels_cl_e() docblock now explicitly states it strips HTML; added companion redshape_easylabels_cl_html_e() that passes the translated string through wp_kses() with a minimal inline-tag allowlist (strong, em, code, span, br, a) so legitimate markup in translations is preserved instead of silently entity-encodedRedshape_Easylabels_Cache::invalidate_all() — replaced the version-number trick (broken without persistent object cache: each PHP process starts with empty memory, so the counter was never shared between requests) with wp_cache_flush_group() (WP 6.1+ / Redis / Memcached) plus a per-label fallback for standard setups; also removed the cache_version lookup from generate_cache_key() which added an extra wp_cache_get() on every cache read/writeinitializeInlineLabels() in admin.js — replaced setTimeout retry polling (two blind delays of 300–500 ms) with a MutationObserver that watches document.body and fires exactly once when .wp-list-table .row-title appears, then disconnects; eliminates missed renders and unnecessary CPU wake-upsredshape_easylabels_deactivate() was empty; now calls Redshape_Easylabels_Cache::invalidate_all() on deactivation so stale label counts don't persist in Redis / Memcached between sessionsget_cache_stats() was reading from the wrong option key (labels instead of default_labels) — always returned total_labels: 0; removed stale cache_version entry from the returned array (that key was deleted earlier in 1.4.0); loop now uses the associative key as label ID instead of $label['id']ajax_add_label_to_post() now validates that the requested label ID exists in the plugin configuration before writing to post meta, preventing arbitrary strings from being stored via AJAX by any user with edit_post capabilityget_all_post_labels() SQL query fetched all _content_label rows across the entire database with no post-type filter; query now JOINs wp_posts and filters by post_type, significantly reducing data volume on multi-post-type sites__() keys ('Il nome dell\'etichetta è obbligatorio') in the Quick Create Label handlers in admin.js replaced with the existing English key 'Label name is required' so all 10 locales translate correctlyDOMNodeInserted event (deprecated, removed in Chrome 124+) replaced with a MutationObserver that watches for new .content-label-badge elements and adds the draggable class on insertioninitializeDragAndDrop() and initFilterDragAndDrop() were started via 4 chained setTimeout calls (500 ms, 800 ms, 1500 ms, 3000 ms + $(window).on('load')); replaced with a single $(window).on('load') for the sortable initializer and a MutationObserver for the filter container — eliminates blind waits and missed renders@since 1.4.1 tag to @since 1.4.0 in all 9 class file docblocks (coordinator, helpers, ajax, settings, admin-columns, bulk-actions, filter-bar, meta-box, dashboard-widget)!defined('ABSPATH') guard in uninstall.php — WordPress defines ABSPATH and WP_UNINSTALL_PLUGIN simultaneously; the second check was unreachable dead code