diff --git a/.gitattributes b/.gitattributes index 92411d5..ba5fafc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,6 +10,8 @@ /.eslintrc.json export-ignore /.gitattributes export-ignore /.gitignore export-ignore +/.husky export-ignore +/.lintstagedrc.json export-ignore /.npmrc export-ignore /.nvmrc export-ignore /.stylelintignore export-ignore diff --git a/.gitignore b/.gitignore index 18d344d..b4f7c85 100755 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ release vendor .idea *.log +.phpunit.result.cache # Editors *.esproj diff --git a/CHANGELOG.md b/CHANGELOG.md index 6587fe0..f408f21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,35 @@ All notable changes to this project will be documented in this file, per [the Ke ## [Unreleased] + + +## [2.1.0] - 2023-03-XX + +### Added +- Compatibility with the [WooCommerce Subscriptions](https://woocommerce.com/products/woocommerce-subscriptions/) add-on. Props [@ecaron](https://github.com/ecaron) and [@felipeelia](https://github.com/felipeelia) via [#51](https://github.com/10up/ElasticPressLabs/pull/51). +- Users Feature (migrated from the main ElasticPress plugin). Props [@felipeelia](https://github.com/felipeelia), [@MARQAS](https://github.com/MARQAS), and [@burhandodhy](https://github.com/burhandodhy) via [#50](https://github.com/10up/ElasticPressLabs/pull/50) and [#59](https://github.com/10up/ElasticPressLabs/pull/50). +- Load PHP classes via `spl_autoload_register()`. Props [@burhandodhy](https://github.com/burhandodhy) via [#57](https://github.com/10up/ElasticPressLabs/pull/57). + +## Changed +- Code standards are now applied to the test suite too. Props [@felipeelia](https://github.com/felipeelia) via [#54](https://github.com/10up/ElasticPressLabs/pull/54). +- Hide subfeatures if the required plugins are not activated. Props [@burhandodhy](https://github.com/burhandodhy) via [#56](https://github.com/10up/ElasticPressLabs/pull/56). + +### Fixed +- Adjusted the method used to determine if classes are loaded. Props [@ecaron](https://github.com/ecaron) via [#51](https://github.com/10up/ElasticPressLabs/pull/51). +- Ensure feature classes are only loaded once. Props [@ecaron](https://github.com/ecaron) via [#43](https://github.com/10up/ElasticPressLabs/pull/43). +- PHP Lint on PHP 8. Props [@felipeelia](https://github.com/felipeelia) via [#49](https://github.com/10up/ElasticPressLabs/pull/49). + +### Security +- Bumped `loader-utils` from 2.0.2 to 2.0.4. Props [@dependabot](https://github.com/dependabot) via [#46](https://github.com/10up/ElasticPressLabs/pull/46). +- Bumped `json5` from 1.0.1 to 1.0.2. Props [@dependabot](https://github.com/dependabot) via [#47](https://github.com/10up/ElasticPressLabs/pull/46). + ## [2.0.0] - 2022-10-17 ### Added @@ -41,6 +70,7 @@ All notable changes to this project will be documented in this file, per [the Ke - Initial plugin release. [Unreleased]: https://github.com/10up/ElasticPressLabs/compare/trunk...develop +[2.1.0]: https://github.com/10up/ElasticPressLabs/compare/2.0.0...2.1.0 [2.0.0]: https://github.com/10up/ElasticPressLabs/compare/1.2.0...2.0.0 [1.2.0]: https://github.com/10up/ElasticPressLabs/compare/1.1.0...1.2.0 [1.1.0]: https://github.com/10up/ElasticPressLabs/compare/1.0.0...1.1.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e11709d..54dab28 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,7 +24,7 @@ For more on how 10up writes and manages code, check out our [10up Engineering Be ## Workflow -The `develop` branch is the development branch which means it contains the next version to be released. `trunk` contains the corresponding stable development version. Always work on the `develop` branch and open up PRs against `develop`. +The `develop` branch is the development branch which means it contains the next version to be released. `trunk` contains the corresponding stable development version. Always work on the `develop` branch and open up PRs against `develop`. ## Release instructions @@ -32,14 +32,14 @@ The `develop` branch is the development branch which means it contains the next 1. Version bump: Bump the version number in `elasticpresslabs.php`, `/languages/ElasticPressLabs.pot`, `package-lock.json`, `package.json`, `readme.txt`, and any other relevant files if it does not already reflect the version being released. In `elasticpresslabs.php` update both the plugin "Version:" property and the plugin `ELASTICPRESS_LABS_VERSION` constant. 1. Changelog: Add/update the changelog in `CHANGELOG.md` and `readme.txt`, ensuring to link the [X.Y.Z] release reference in the footer of `CHANGELOG.md` (e.g., https://github.com/10up/ElasticPressLabs/compare/X.Y.Z-1...X.Y.Z). 1. Props: Update `CREDITS.md` file with any new contributors, confirm maintainers are accurate. -1. Readme updates: Make any other readme changes as necessary. `README.md` is geared toward GitHub and `readme.txt` contains WordPress.org-specific content. The two are slightly different. +1. Readme updates: Make any other readme changes as necessary. `README.md` is geared toward GitHub and `readme.txt` contains WordPress.org-specific content. The two are slightly different. 1. New files: Check to be sure any new files/paths that are unnecessary in the production version are included in `.gitattributes`. -1. Merge: Merge the release branch/PR into `develop`, then make a non-fast-forward merge from `develop` into `trunk` (`git checkout trunk && git merge --no-ff develop`). `trunk` contains the stable development version. +1. POT file: Run `wp i18n make-pot . languages/ElasticPressLabs.pot` and commit the file. In case of errors, try to disable Xdebug (see [#3079](https://github.com/10up/ElasticPress/pull/3079#issuecomment-1291028290).) +1. Release date: Double check the release date in both changelog files. +1. Merge: Merge the release branch/PR into `develop`, then make a non-fast-forward merge from `develop` into `trunk` (`git checkout trunk && git merge --no-ff develop`). `trunk` contains the stable development version. 1. Test: While still on the `trunk` branch, test for functionality locally. 1. Push: Push your `trunk` branch to GitHub (e.g. `git push origin trunk`). 1. Release: Create a [new release](https://github.com/10up/elasticpresslabs/releases/new), naming the tag and the release with the new version number, and targeting the `trunk` branch. Paste the release changelog from `CHANGELOG.md` into the body of the release and include a link to the closed issues on the [milestone](https://github.com/10up/elasticpresslabs/milestone/#?closed=1). -1. SVN: Wait for the [GitHub Action](https://github.com/10up/ElasticPresslabs/actions) to finish deploying to the WordPress.org repository. If all goes well, users with SVN commit access for that plugin will receive an emailed diff of changes. -1. Check WordPress.org: Ensure that the changes are live on https://wordpress.org/plugins/elasticpresslabs/. This may take a few minutes. 1. Close milestone: Edit the [milestone](https://github.com/10up/elasticpresslabs/milestone/#) with release date (in the `Due date (optional)` field) and link to GitHub release (in the `Description` field), then close the milestone. 1. Punt incomplete items: If any open issues or PRs which were milestoned for `X.Y.Z` do not make it into the release, update their milestone to `X.Y.Z+1`, `X.Y+1.0`, `X+1.0.0` or `Future Release`. @@ -53,12 +53,12 @@ There may be cases where we have an urgent/important fix that ideally gets into 1. Props: Update `CREDITS.md` file with any new contributors, confirm maintainers are accurate. 1. Readme updates: Make any other readme changes as necessary. `README.md` is geared toward GitHub and `readme.txt` contains WordPress.org-specific content. The two are slightly different. 1. New files: Check to be sure any new files/paths that are unnecessary in the production version are included in `.gitattributes`. +1. POT file: Run `wp i18n make-pot . lang/elasticpress.pot` and commit the file. +1. Release date: Double check the release date in both changelog files. 1. Merge: Merge the release branch/PR into `trunk`. `trunk` contains the stable development version. 1. Test: While still on the `trunk` branch, test for functionality locally. 1. Push: Push your `trunk` branch to GitHub (e.g. `git push origin trunk`). 1. Release: Create a [new release](https://github.com/10up/elasticpresslabs/releases/new), naming the tag and the release with the new version number, and targeting the `trunk` branch. Paste the release changelog from `CHANGELOG.md` into the body of the release and include a link to the closed issues on the [milestone](https://github.com/10up/elasticpresslabs/milestone/#?closed=1). -1. SVN: Wait for the [GitHub Action](https://github.com/10up/ElasticPressLabs/actions) to finish deploying to the WordPress.org repository. If all goes well, users with SVN commit access for that plugin will receive an emailed diff of changes. -1. Check WordPress.org: Ensure that the changes are live on https://wordpress.org/plugins/elasticpresslabs/. This may take a few minutes. 1. Close milestone: Edit the [milestone](https://github.com/10up/elasticpresslabs/milestone/#) with release date (in the `Due date (optional)` field) and link to GitHub release (in the `Description` field), then close the milestone. 1. Punt incomplete items: If any open issues or PRs which were milestoned for `X.Y.Z` do not make it into the hotfix release, update their milestone to `X.Y.Z+1`, `X.Y+1.0`, `X+1.0.0` or `Future Release`. 1. Apply hotfix changes to `develop`: Make a non-fast-forward merge from `trunk` into `develop` (`git checkout develop && git merge --no-ff trunk`) to ensure your hotfix change(s) are in sync with active development. \ No newline at end of file diff --git a/CREDITS.md b/CREDITS.md index 8013075..210e8f1 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -20,6 +20,7 @@ Thank you to all the people who have already contributed to this repository via [Oscar Sanchez S. (@oscarssanchez)](https://github.com/oscarssanchez), [Burhan Nasir (@burhandodhy)](https://github.com/burhandodhy), [Mohammed Razzaq (@MARQAS)](https://github.com/MARQAS), +[Eric Caron (@ecaron)](https://github.com/ecaron), and [Felipe Elia (@felipeelia)](https://github.com/felipeelia). diff --git a/elasticpresslabs.php b/elasticpresslabs.php index 9d2166c..efd1f24 100644 --- a/elasticpresslabs.php +++ b/elasticpresslabs.php @@ -3,7 +3,7 @@ * Plugin Name: ElasticPress Labs * Plugin URI: https://github.com/10up/ElasticPressLabs * Description: A developer focused interface to commonly ElasticPress plugin issues. - * Version: 2.0.0 + * Version: 2.1.0 * Requires at least: 5.6 * Requires PHP: 7.0 * Author: 10up @@ -18,7 +18,7 @@ */ // Useful global constants. -define( 'ELASTICPRESS_LABS_VERSION', '2.0.0' ); +define( 'ELASTICPRESS_LABS_VERSION', '2.1.0' ); define( 'ELASTICPRESS_LABS_URL', plugin_dir_url( __FILE__ ) ); define( 'ELASTICPRESS_LABS_PATH', plugin_dir_path( __FILE__ ) ); define( 'ELASTICPRESS_LABS_INC', ELASTICPRESS_LABS_PATH . 'includes/' ); diff --git a/languages/ElasticPressLabs.pot b/languages/ElasticPressLabs.pot index c5cf769..6911bc0 100644 --- a/languages/ElasticPressLabs.pot +++ b/languages/ElasticPressLabs.pot @@ -1,17 +1,17 @@ -# Copyright (C) 2022 10up -# This file is distributed under the same license as the ElasticPress Labs plugin. +# Copyright (C) 2023 10up +# This file is distributed under the GPL v2 or later. msgid "" msgstr "" -"Project-Id-Version: ElasticPress Labs 2.0.0\n" -"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/elasticpresslabs\n" +"Project-Id-Version: ElasticPress Labs 2.1.0\n" +"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/elasticpress-labs\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2022-10-17T14:03:31+00:00\n" +"POT-Creation-Date: 2023-02-28T13:04:54+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"X-Generator: WP-CLI 2.4.0\n" +"X-Generator: WP-CLI 2.7.1\n" "X-Domain: elasticpress-labs\n" #. Plugin Name of the plugin @@ -165,14 +165,31 @@ msgid "Version" msgstr "" #: includes/classes/Feature/SearchAlgorithm.php:138 +#: includes/classes/Feature/WooCommerceSubscriptionSearch.php:141 msgid "Changes in this feature will be reflected only on the next page reload or expiration of any front-end caches." msgstr "" -#: includes/functions/core.php:217 +#: includes/classes/Feature/WooCommerceSubscriptionSearch.php:33 +msgid "WooCommerce Admin Subscription Search" +msgstr "" + +#: includes/classes/Feature/WooCommerceSubscriptionSearch.php:45 +msgid "Have WooCommerce Subscription admin search use EP." +msgstr "" + +#: includes/classes/Feature/WooCommerceSubscriptionSearch.php:54 +msgid "By default, WooCommerce Subscriptions does not use ElasticPress. This tells it to index and search those, just like ElasticPress does for orders." +msgstr "" + +#: includes/classes/Feature/WooCommerceSubscriptionSearch.php:139 +msgid "This feature requires the WooCommerce and Protected Content features to be enabled." +msgstr "" + +#: includes/functions/core.php:219 msgid "ElasticPress Labs needs ElasticPress to work." msgstr "" #. translators: Min. EP version -#: includes/functions/core.php:232 +#: includes/functions/core.php:234 msgid "ElasticPress Labs needs at least ElasticPress %s to work properly." msgstr "" diff --git a/package-lock.json b/package-lock.json index b1f1276..3b5f094 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "elasticpress-labs", - "version": "2.0.0", + "version": "2.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "elasticpress-labs", - "version": "2.0.0", + "version": "2.1.0", "license": "GPL-2.0-or-later", "devDependencies": { "10up-toolkit": "^4.2.2", diff --git a/package.json b/package.json index abcabbf..8ae9265 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "elasticpress-labs", - "version": "2.0.0", + "version": "2.1.0", "description": "ElasticPress Labs", "author": { "name": "10up", diff --git a/readme.txt b/readme.txt index 2a9e4a6..2eaf255 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: 10up Tags: Elasticsearch, ElasticPress, search, boolean, Co-Authors Plus Requires at least: 5.6 -Tested up to: 6.0 +Tested up to: 6.1 Stable tag: 2.0.0 Requires PHP: 7.0 License: GPLv2 or later @@ -28,6 +28,30 @@ This plugin provides a simple interface to enable and disable features. == Changelog == += 2.1.0 - 2023-03-XX = + +__Added:__ + +* Compatibility with the [WooCommerce Subscriptions](https://woocommerce.com/products/woocommerce-subscriptions/) add-on. Props [@ecaron](https://github.com/ecaron) and [@felipeelia](https://github.com/felipeelia). +* Users Feature (migrated from the main ElasticPress plugin). Props [@felipeelia](https://github.com/felipeelia), [@MARQAS](https://github.com/MARQAS), and [@burhandodhy](https://github.com/burhandodhy). +* Load PHP classes via `spl_autoload_register()`. Props [@burhandodhy](https://github.com/burhandodhy). + +__Changed:__ + +* Code standards are now applied to the test suite too. Props [@felipeelia](https://github.com/felipeelia). +* Hide subfeatures if the required plugins are not activated. Props [@burhandodhy](https://github.com/burhandodhy). + +__Fixed:__ + +* Adjusted the method used to determine if classes are loaded. Props [@ecaron](https://github.com/ecaron). +* Ensure feature classes are only loaded once. Props [@ecaron](https://github.com/ecaron). +* PHP Lint on PHP 8. Props [@felipeelia](https://github.com/felipeelia). + +__Security:__ + +* Bumped `loader-utils` from 2.0.2 to 2.0.4. Props [@dependabot](https://github.com/dependabot). +* Bumped `json5` from 1.0.1 to 1.0.2. Props [@dependabot](https://github.com/dependabot). + = 2.0.0 - 2022-10-17 = __Added:__