From 2f38bf9f4af3e82b08edcdc160cd587d02f51dc6 Mon Sep 17 00:00:00 2001 From: Filip Ilic Date: Thu, 9 Apr 2026 10:08:44 +0200 Subject: [PATCH 1/6] plugin name change Signed-off-by: Filip Ilic --- pp-glossary.php | 6 +++--- readme.txt | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pp-glossary.php b/pp-glossary.php index 7393aba..5774691 100644 --- a/pp-glossary.php +++ b/pp-glossary.php @@ -1,9 +1,9 @@ Date: Thu, 9 Apr 2026 13:14:40 +0200 Subject: [PATCH 2/6] Rename code identifiers from pp-glossary to your-glossary Renames namespace (Your_Glossary), constants (YOUR_GLOSSARY_*), function prefixes (your_glossary_*), text domain (your-glossary), CSS classes, asset handles, filter names, and config files. Database identifiers kept unchanged for backwards compatibility: post type slug (pp_glossary), meta key (_pp_glossary_data), option name (pp_glossary_settings), block name (pp-glossary/glossary-list). Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Filip Ilic --- .wordpress-org/blueprints/blueprint.json | 2 +- assets/css/glossary.css | 24 +++--- assets/js/admin.js | 16 ++-- assets/js/glossary.js | 2 +- blocks/glossary-list/block.json | 2 +- blocks/glossary-list/editor.js | 6 +- composer.json | 2 +- includes/class-assets.php | 18 ++--- includes/class-blocks.php | 32 ++++---- includes/class-content-filter.php | 24 +++--- includes/class-meta-boxes.php | 94 ++++++++++++------------ includes/class-migrations.php | 6 +- includes/class-post-type.php | 52 ++++++------- includes/class-schema.php | 6 +- includes/class-settings.php | 66 ++++++++--------- includes/class-term-linker.php | 12 +-- includes/functions.php | 34 ++++----- phpcs.xml | 10 +-- phpstan.neon.dist | 2 +- pp-glossary.php | 62 ++++++++-------- uninstall.php | 8 +- 21 files changed, 240 insertions(+), 240 deletions(-) diff --git a/.wordpress-org/blueprints/blueprint.json b/.wordpress-org/blueprints/blueprint.json index c52c89c..eb97ef8 100644 --- a/.wordpress-org/blueprints/blueprint.json +++ b/.wordpress-org/blueprints/blueprint.json @@ -4,7 +4,7 @@ "networking": true }, "plugins": [ - "pp-glossary" + "your-glossary" ], "steps": [ { diff --git a/assets/css/glossary.css b/assets/css/glossary.css index 4117952..a9d17f4 100644 --- a/assets/css/glossary.css +++ b/assets/css/glossary.css @@ -1,14 +1,14 @@ /** * Glossary Styles * - * @package PP_Glossary + * @package Your_Glossary */ /* ========================================================================== Screen Reader Only (visually hidden but accessible) ========================================================================== */ -.pp-glossary-sr-only { +.your-glossary-sr-only { clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; @@ -28,7 +28,7 @@ dfn { font-style: normal; } -dfn.pp-glossary-term span { +dfn.your-glossary-term span { color: inherit; text-decoration: underline; text-decoration-style: dotted; @@ -42,12 +42,12 @@ dfn.pp-glossary-term span { border-bottom: none; } -dfn.pp-glossary-term span:hover, -dfn.pp-glossary-term span:focus { +dfn.your-glossary-term span:hover, +dfn.your-glossary-term span:focus { text-decoration-color: var(--glossary-underline-hover-color, rgba(0, 0, 0, 0.7)); } -dfn.pp-glossary-term span:focus-visible { +dfn.your-glossary-term span:focus-visible { outline: 2px solid var(--glossary-focus-color, #005a87); outline-offset: 2px; border-radius: 2px; @@ -57,7 +57,7 @@ dfn.pp-glossary-term span:focus-visible { Nested Glossary Links (within definitions) ========================================================================== */ -.pp-glossary-link { +.your-glossary-link { color: inherit; text-decoration: underline; text-decoration-style: dotted; @@ -66,12 +66,12 @@ dfn.pp-glossary-term span:focus-visible { text-underline-offset: 3px; } -.pp-glossary-link:hover, -.pp-glossary-link:focus { +.your-glossary-link:hover, +.your-glossary-link:focus { text-decoration-color: var(--glossary-underline-hover-color, rgba(0, 0, 0, 0.7)); } -.pp-glossary-link:focus-visible { +.your-glossary-link:focus-visible { outline: 2px solid var(--glossary-focus-color, #005a87); outline-offset: 2px; border-radius: 2px; @@ -146,7 +146,7 @@ aside[popover] > p a:focus-visible { Glossary Block Styles ========================================================================== */ -.pp-glossary-block { +.your-glossary-block { margin: 2rem 0; } @@ -301,7 +301,7 @@ aside[popover] > p a:focus-visible { display: none; } - dfn.pp-glossary-term span { + dfn.your-glossary-term span { text-decoration: none; cursor: inherit; } diff --git a/assets/js/admin.js b/assets/js/admin.js index dedbc55..58c74f6 100644 --- a/assets/js/admin.js +++ b/assets/js/admin.js @@ -1,12 +1,12 @@ /** * Admin synonyms management for Glossary entries. * - * @package PP_Glossary + * @package Your_Glossary */ document.addEventListener( 'DOMContentLoaded', function () { - const addButton = document.getElementById( 'pp-glossary-add-synonym' ); - const container = document.getElementById( 'pp-glossary-synonyms-container' ); + const addButton = document.getElementById( 'your-glossary-add-synonym' ); + const container = document.getElementById( 'your-glossary-synonyms-container' ); if ( ! addButton || ! container ) { return; @@ -19,19 +19,19 @@ document.addEventListener( 'DOMContentLoaded', function () { e.preventDefault(); const row = document.createElement( 'div' ); - row.className = 'pp-glossary-synonym-row'; + row.className = 'your-glossary-synonym-row'; row.style.cssText = 'margin-bottom: 10px; display: flex; gap: 10px;'; const input = document.createElement( 'input' ); input.type = 'text'; - input.name = 'pp_glossary_synonyms[]'; + input.name = 'your_glossary_synonyms[]'; input.value = ''; input.className = 'regular-text'; input.placeholder = placeholder; const button = document.createElement( 'button' ); button.type = 'button'; - button.className = 'button pp-glossary-remove-synonym'; + button.className = 'button your-glossary-remove-synonym'; button.textContent = removeText; row.appendChild( input ); @@ -40,9 +40,9 @@ document.addEventListener( 'DOMContentLoaded', function () { } ); container.addEventListener( 'click', function ( e ) { - if ( e.target.classList.contains( 'pp-glossary-remove-synonym' ) ) { + if ( e.target.classList.contains( 'your-glossary-remove-synonym' ) ) { e.preventDefault(); - e.target.closest( '.pp-glossary-synonym-row' ).remove(); + e.target.closest( '.your-glossary-synonym-row' ).remove(); } } ); } ); diff --git a/assets/js/glossary.js b/assets/js/glossary.js index 92a0c23..16476ed 100644 --- a/assets/js/glossary.js +++ b/assets/js/glossary.js @@ -3,7 +3,7 @@ * * Handles click and keyboard-based popover display and accessibility features. * - * @package PP_Glossary + * @package Your_Glossary */ (function () { diff --git a/blocks/glossary-list/block.json b/blocks/glossary-list/block.json index fd1a4a8..98f6cb6 100644 --- a/blocks/glossary-list/block.json +++ b/blocks/glossary-list/block.json @@ -7,7 +7,7 @@ "icon": "book-alt", "description": "Display an alphabetical list of all glossary entries.", "keywords": ["glossary", "terms", "definitions", "dictionary"], - "textdomain": "pp-glossary", + "textdomain": "your-glossary", "supports": { "html": false, "align": ["wide", "full"] diff --git a/blocks/glossary-list/editor.js b/blocks/glossary-list/editor.js index 61c5049..a215ab2 100644 --- a/blocks/glossary-list/editor.js +++ b/blocks/glossary-list/editor.js @@ -12,7 +12,7 @@ return el( 'div', { - className: 'pp-glossary-block-editor', + className: 'your-glossary-block-editor', style: { padding: '2rem', backgroundColor: '#f9f9f9', @@ -22,8 +22,8 @@ }, }, el('span', { className: 'dashicons dashicons-book-alt', style: { fontSize: '48px', color: '#0073aa' } }), - el('h3', {}, __('Glossary List', 'pp-glossary')), - el('p', {}, __('The glossary entries will be displayed here on the frontend.', 'pp-glossary')) + el('h3', {}, __('Glossary List', 'your-glossary')), + el('p', {}, __('The glossary entries will be displayed here on the frontend.', 'your-glossary')) ); }, diff --git a/composer.json b/composer.json index b930e52..f01493d 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "progress-planner/glossary", + "name": "progress-planner/your-glossary", "description": "An accessible WordPress glossary plugin with auto-linking definitions, popovers, and structured data.", "type": "wordpress-plugin", "license": "GPL-2.0-or-later", diff --git a/includes/class-assets.php b/includes/class-assets.php index aa19d77..72e1c3d 100644 --- a/includes/class-assets.php +++ b/includes/class-assets.php @@ -2,10 +2,10 @@ /** * Frontend Assets for Glossary. * - * @package PP_Glossary + * @package Your_Glossary */ -namespace PP_Glossary; +namespace Your_Glossary; // If this file is called directly, abort. if ( ! defined( 'WPINC' ) ) { @@ -30,22 +30,22 @@ public static function init(): void { public static function enqueue_assets(): void { // Only enqueue assets if terms have been found in the post content or on Glossary page. - if ( ! class_exists( '\\PP_Glossary\\Content_Filter' ) || ! Content_Filter::$terms_found_on_page ) { + if ( ! class_exists( '\\Your_Glossary\\Content_Filter' ) || ! Content_Filter::$terms_found_on_page ) { return; } wp_enqueue_style( - 'pp-glossary', - \PP_GLOSSARY_PLUGIN_URL . 'assets/css/glossary.css', + 'your-glossary', + \YOUR_GLOSSARY_PLUGIN_URL . 'assets/css/glossary.css', [], - \PP_GLOSSARY_VERSION + \YOUR_GLOSSARY_VERSION ); wp_enqueue_script( - 'pp-glossary', - \PP_GLOSSARY_PLUGIN_URL . 'assets/js/glossary.js', + 'your-glossary', + \YOUR_GLOSSARY_PLUGIN_URL . 'assets/js/glossary.js', [], - \PP_GLOSSARY_VERSION, + \YOUR_GLOSSARY_VERSION, [ 'strategy' => 'defer', ] diff --git a/includes/class-blocks.php b/includes/class-blocks.php index c7be84c..7912144 100644 --- a/includes/class-blocks.php +++ b/includes/class-blocks.php @@ -2,10 +2,10 @@ /** * Block Registration for Glossary * - * @package PP_Glossary + * @package Your_Glossary */ -namespace PP_Glossary; +namespace Your_Glossary; // If this file is called directly, abort. if ( ! defined( 'WPINC' ) ) { @@ -30,18 +30,18 @@ public static function init(): void { public static function register_blocks(): void { // Register the editor script. wp_register_script( - 'pp-glossary-block-editor', - PP_GLOSSARY_PLUGIN_URL . 'blocks/glossary-list/editor.js', + 'your-glossary-block-editor', + YOUR_GLOSSARY_PLUGIN_URL . 'blocks/glossary-list/editor.js', [ 'wp-blocks', 'wp-element', 'wp-block-editor', 'wp-components', 'wp-i18n' ], - PP_GLOSSARY_VERSION, + YOUR_GLOSSARY_VERSION, true ); // Register the block type. register_block_type( - PP_GLOSSARY_PLUGIN_DIR . 'blocks/glossary-list', + YOUR_GLOSSARY_PLUGIN_DIR . 'blocks/glossary-list', [ - 'editor_script' => 'pp-glossary-block-editor', + 'editor_script' => 'your-glossary-block-editor', 'render_callback' => [ __CLASS__, 'render_glossary_list_block' ], ] ); @@ -65,7 +65,7 @@ public static function render_glossary_list_block() { ob_start(); ?> -
> +
> '; } ?> -