From 8ab3c351a1363f2f47accb1429729fb53301be88 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Fri, 12 Jul 2024 16:25:39 -0400 Subject: [PATCH 1/4] Rename the plugin --- .gitattributes | 2 ++ README.md | 4 ++-- wp-command-palette.php | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitattributes b/.gitattributes index e4189e2..eb5eb43 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,6 +12,8 @@ /tests export-ignore /configure.php export-ignore /Makefile export-ignore +/tests export-ignore +/types export-ignore # # Auto detect text files and perform LF normalization. diff --git a/README.md b/README.md index 61ec187..9293044 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# WP Command Palette +# Command Palette Extension Contributors: alleyinteractive Tags: alleyinteractive, wp-command-palette -Stable tag: 0.1.0 +Stable tag: 0.1.1 Requires at least: 6.4 diff --git a/wp-command-palette.php b/wp-command-palette.php index 1539736..1ca6e5d 100644 --- a/wp-command-palette.php +++ b/wp-command-palette.php @@ -1,9 +1,9 @@ Date: Fri, 12 Jul 2024 16:31:23 -0400 Subject: [PATCH 2/4] Ignoring some moe --- .gitattributes | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index eb5eb43..b928c32 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,13 +5,20 @@ # # Via WPCS. # +/.editorconfig expore-ignore +/.eslintignore expore-ignore +/.eslintrc.json expore-ignore /.github export-ignore -/.phpcs.xml export-ignore +/.npmrc expore-ignore +/.nvmrc expore-ignore +/.phpcs expore-ignore /.phpcs export-ignore -/phpunit.xml export-ignore -/tests export-ignore +/.phpcs.xml expore-ignore +/.phpcs.xml export-ignore +/.phpunit.result.cache expore-ignore /configure.php export-ignore /Makefile export-ignore +/phpunit.xml export-ignore /tests export-ignore /types export-ignore From 3f99a4be27a81b8c99b39f52b704a022e2ecf6f7 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Tue, 13 Aug 2024 16:51:49 -0400 Subject: [PATCH 3/4] WIP --- README.md | 2 +- readme.txt | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 readme.txt diff --git a/README.md b/README.md index 9293044..40af453 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Contributors: alleyinteractive -Tags: alleyinteractive, wp-command-palette +Tags: command-palette, alleyinteractive, wp-command-palette Stable tag: 0.1.1 diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..0c19d01 --- /dev/null +++ b/readme.txt @@ -0,0 +1,70 @@ +=== Command Palette Extension === +Contributors: alleyinteractive +Tags: command-palette, alleyinteractive, wp-command-palette +Stable tag: 0.1.1 +Requires at least: 6.4 +Tested up to: 6.5 +Requires PHP: 8.1 +License: GPL v2 or later + +Extend the WordPress Command Palette with all the available admin menu items. + +## Installation + +You can install the package via Composer or download it from WordPress.org: + +```bash +composer require alleyinteractive/wp-command-palette +``` + +## Usage + +Activate the plugin in WordPress and use it like so: + +![Screenshot of plugin](./assets/screenshot.png) + +When activated, the plugin will read all the available WordPress admin menu/bar +items and allow you to easily search for them in the +[WordPress Command Palette](https://make.wordpress.org/core/2023/07/17/introducing-the-wordpress-command-palette-api/). You can open the command palette +by pressing `cmd + k` or `ctrl + k` on Windows. The plugin requires WordPress 6.4 or higher. + +At some point in the future Gutenberg +[will be adding](https://github.com/WordPress/gutenberg/pull/54515) +site-wide command palette support. This plugin will be updated to support that +when it is available. + +## Testing + +Run `npm run lint` to run ESLint against all JavaScript files. Linting will also +happen when running development or production builds. + +Run `composer test` to run tests against the PHP code in the plugin. + +## Releasing the Plugin + +The plugin uses a [built release workflow](./.github/workflows/built-release.yml) +to compile and tag releases. Whenever a new version is detected in the root +`composer.json` file or in the plugin's headers, the workflow will automatically +build the plugin and tag it with a new version. The built tag will contain all +the required front-end assets the plugin may require. This works well for +publishing to WordPress.org or for submodule-ing. + +When you are ready to release a new version of the plugin, you can run +`npm run release` to start the process of setting up a new release. + +## Changelog + +Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. + +## Credits + +This project is actively maintained by [Alley +Interactive](https://github.com/alleyinteractive). Like what you see? [Come work +with us](https://alley.com/careers/). + +- [Sean Fisher](https://github.com/srtfisher) +- [All Contributors](../../contributors) + +## License + +The GNU General Public License (GPL) license. Please see [License File](LICENSE) for more information. From 43c93a81abd9f63f868727e5c30c789e73d48f11 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Tue, 13 Aug 2024 16:58:12 -0400 Subject: [PATCH 4/4] Remove constant --- .deployignore | 1 - src/assets.php | 2 +- wp-command-palette.php | 5 ----- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.deployignore b/.deployignore index 56180bf..e215dfa 100644 --- a/.deployignore +++ b/.deployignore @@ -17,6 +17,5 @@ phpunit.xml configure.php DOCKER_ENV phpunit.xml -tests .phpcs Makefile diff --git a/src/assets.php b/src/assets.php index 72b77e4..7536d0e 100644 --- a/src/assets.php +++ b/src/assets.php @@ -62,7 +62,7 @@ function get_entry_dir_path( string $dir_entry_name, bool $dir = false ): string // The relative path from the plugin root. $asset_build_dir = "/build/{$dir_entry_name}/"; // Set the absolute file path from the root directory. - $asset_dir_path = WP_COMMAND_PALETTE_DIR . $asset_build_dir; + $asset_dir_path = dirname( __DIR__ ) . $asset_build_dir; if ( validate_path( $asset_dir_path ) ) { // Negotiate the base path. diff --git a/wp-command-palette.php b/wp-command-palette.php index 1ca6e5d..40fc5ca 100644 --- a/wp-command-palette.php +++ b/wp-command-palette.php @@ -21,10 +21,5 @@ exit; } -/** - * Root directory to this plugin. - */ -define( 'WP_COMMAND_PALETTE_DIR', __DIR__ ); - // Load the plugin's main files. require_once __DIR__ . '/src/assets.php';