diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml index b0b2114..163b833 100644 --- a/.github/workflows/playground.yml +++ b/.github/workflows/playground.yml @@ -42,7 +42,8 @@ jobs: - name: Update plugin version with PR number run: | set -euxo pipefail - PLUGIN_FILE="${{ steps.prep.outputs.PKG_DIR }}/${{ github.event.repository.name }}.php" + # Find the main plugin file (contains "Plugin Name:" header). + PLUGIN_FILE=$(grep -rl "Plugin Name:" "${{ steps.prep.outputs.PKG_DIR }}"/*.php | head -1) PR_NUMBER="${{ github.event.number }}" # Extract current version diff --git a/.wordpress-org/blueprints/blueprint.json b/.wordpress-org/blueprints/blueprint.json index c52c89c..ca018ea 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": [ { @@ -19,7 +19,7 @@ }, { "step": "runPHP", - "code": " 10 ) ); ?>" + "code": " 10 ) ); ?>" } ] } 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..10827aa 100644 --- a/blocks/glossary-list/block.json +++ b/blocks/glossary-list/block.json @@ -1,13 +1,13 @@ { "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, - "name": "pp-glossary/glossary-list", + "name": "your-glossary/glossary-list", "title": "Glossary List", "category": "widgets", "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..99b4b32 100644 --- a/blocks/glossary-list/editor.js +++ b/blocks/glossary-list/editor.js @@ -7,12 +7,12 @@ const { __ } = wp.i18n; const { createElement: el } = wp.element; - registerBlockType('pp-glossary/glossary-list', { + registerBlockType('your-glossary/glossary-list', { edit: function (props) { 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/composer.lock b/composer.lock index 46564f6..e5c2326 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "05176bd1587392b1d386e2e93a9afcbc", + "content-hash": "3d15c57111c190b7288d50cb5e2cae67", "packages": [ { "name": "composer/installers", 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(); ?> -