From 6d78cd6ff55daec112787831362b087ae89e603b Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 7 Sep 2023 11:39:46 -0500 Subject: [PATCH 01/11] Create LICENSE.md --- LICENSE.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..87ed6b6 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 10up, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 1ce3293958c60fb1aa8e6a59a344dfd73215b335 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 7 Sep 2023 11:39:50 -0500 Subject: [PATCH 02/11] Create CREDITS.md --- CREDITS.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 CREDITS.md diff --git a/CREDITS.md b/CREDITS.md new file mode 100644 index 0000000..828594c --- /dev/null +++ b/CREDITS.md @@ -0,0 +1,21 @@ +# Credits + +The following acknowledges the Maintainers for this repository, those who have Contributed to this repository (via bug reports, code, design, ideas, project management, translation, testing, etc.), and any Libraries utilized. + +## Maintainers + +The following individuals are responsible for curating the list of issues, responding to pull requests, and ensuring regular releases happen. + +[Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul). + +## Contributors + +Thank you to all the people who have already contributed to this repository via bug reports, code, design, ideas, project management, translation, testing, etc. + +[Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul). + +## Libraries + +The following software libraries are utilized in this repository. + +n/a From 48de308b284062d4f7054830f5e5d36b9fd317c3 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 7 Sep 2023 11:39:56 -0500 Subject: [PATCH 03/11] Create CONTRIBUTING.md --- CONTRIBUTING.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..1455383 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,49 @@ +# Contributing and Maintaining + +First, thank you for taking the time to contribute! + +The following is a set of guidelines for contributors as well as information and instructions around our maintenance process. The two are closely tied together in terms of how we all work together and set expectations, so while you may not need to know everything in here to submit an issue or pull request, it's best to keep them in the same document. + +## Ways to contribute + +Contributing isn't just writing code - it's anything that improves the project. All contributions are managed right here on GitHub. Here are some ways you can help: + +### Reporting bugs + +If you're running into an issue, please take a look through [existing issues](https://github.com/10up/wp-compat-validation-tool/issues) and [open a new one](https://github.com/10up/wp-compat-validation-tool/issues/new) if needed. If you're able, include steps to reproduce, environment information, and screenshots/screencasts as relevant. + +### Suggesting enhancements + +New features and enhancements are also managed via [issues](https://github.com/10up/wp-compat-validation-tool/issues). + +### Pull requests + +Pull requests represent a proposed solution to a specified problem. They should always reference an issue that describes the problem and contains discussion about the problem itself. Discussion on pull requests should be limited to the pull request itself, i.e. code review. + +For more on how 10up writes and manages code, check out our [10up Engineering Best Practices](https://10up.github.io/Engineering-Best-Practices/). + +## 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`. + +## Release instructions + +1. Branch: Starting from `develop`, cut a release branch named `release/X.Y.Z` for your changes. +2. Version bump: Bump the version number in `plugin.php`, `readme.txt`, and any other relevant files if it does not already reflect the version being released. +3. Changelog: Add/update the changelog in `CHANGELOG.md` and `readme.txt`. +4. Props: update `CREDITS.md` file with any new contributors, and confirm maintainers are accurate. +5. New files: Check to be sure any new files/paths that are unnecessary in the production version are included in `.gitattributes` or `.distignore`. +6. Readme updates: Make any other readme changes as necessary. `CHANGELOG.md` and `README.md` are geared toward GitHub and `readme.txt` contains WordPress.org-specific content. The two are slightly different. +7. Merge: Make a non-fast-forward merge from your release branch to `develop` (or merge the pull request), then do the same for `develop` into `trunk`, ensuring you pull the most recent changes into `develop` first (`git checkout develop && git pull origin develop && git checkout trunk && git merge --no-ff develop`). `trunk` contains the stable development version. +8. Push: Push your `trunk` branch to GitHub (e.g. `git push origin trunk`). +9. Compare `trunk` to `develop` to ensure no additional changes were missed. Visit https://github.com/10up/wp-compat-validation-tool/compare/trunk...develop +10. Test the pre-release ZIP locally by downloading it from the **Build release zip** action artifact and installing it locally. Ensure this zip has all the files we expect, that it installs and activates correctly and that all basic functionality is working. +11. Release: Create a [new release](https://github.com/10up/wp-compat-validation-tool/releases/new), naming the tag and the release with the new version number, and targeting the `trunk` branch. Paste the 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/wp-compat-validation-tool/milestone/#?closed=1). +12. Close milestone: Edit the [milestone](https://github.com/10up/wp-compat-validation-tool/milestone/#) with release date (in the `Due date (optional)` field) and link to GitHub release (in the `Description` field), then close the milestone. +13. 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`. + +### What to do if things go wrong + +If you run into issues during the release process and things have NOT fully deployed to WordPress.org / npm / whatever external-to-GitHub location that we might be publishing to, then the best thing to do will be to delete any Tag (e.g., https://github.com/10up/wp-compat-validation-tool/releases/tag/TAGNAME) or Release that's been created, research what's wrong, and once things are resolved work on re-tagging and re-releasing on GitHub and publishing externally where needed. + +If you run into issues during the release process and things HAVE deployed to WordPress.org / npm / whatever external-to-GitHub location that we might be publishing to, then the best thing to do will be to research what's wrong and once things are resolved work on a patch release and tag on GitHub and publishing externally where needed. At the top of the changelog / release notes it's best to note that its a hotfix to resolve whatever issues were found after the previous release. From 0962106f288955937e62c031a9f030e1f4e35e01 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 7 Sep 2023 11:39:59 -0500 Subject: [PATCH 04/11] Create CHANGELOG.md --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ea6db26 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +All notable changes to this project will be documented in this file, per [the Keep a Changelog standard](http://keepachangelog.com/), and will adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] - TBD + +## [0.1.0] - TBD +### Added +- Initial project release! 🎉 + +[Unreleased]: https://github.com/10up/wp-compat-validation-tool/compare/trunk...develop +[0.1.0]: https://github.com/10up/1wp-compat-validation-tool/commit/ From bd1ff3601b2184ca6f8a0a29e61859734845f4d9 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 7 Sep 2023 11:40:02 -0500 Subject: [PATCH 05/11] Create CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..e8bac02 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at opensource@10up.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq From eb872ac6399295cfc88bdf8fcb27909e151934f4 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 7 Sep 2023 11:40:05 -0500 Subject: [PATCH 06/11] Create CODEOWNERS --- .github/CODEOWNERS | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..0fca604 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,8 @@ +# These owners will be the default owners for everything in the repo. Unless a later match takes precedence, @Sidsector9, as primary maintainer will be requested for review when someone opens a Pull Request. +* @Sidsector9 @10up/open-source-practice + +# GitHub and WordPress.org specifics +/.github/ @jeffpaul +/.wordpress-org/ @jeffpaul +CODE_OF_CONDUCT.md @jeffpaul +LICENSE.md @jeffpaul From cfaaa4c35014ba8d447b9ba271f8dab1d0456d64 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 7 Sep 2023 11:40:08 -0500 Subject: [PATCH 07/11] Create no-response.yml --- .github/workflows/no-response.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/no-response.yml diff --git a/.github/workflows/no-response.yml b/.github/workflows/no-response.yml new file mode 100644 index 0000000..ce0c42f --- /dev/null +++ b/.github/workflows/no-response.yml @@ -0,0 +1,30 @@ +name: No Response + +# **What it does**: Closes issues where the original author doesn't respond to a request for information. +# **Why we have it**: To remove the need for maintainers to remember to check back on issues periodically to see if contributors have responded. +# **Who does it impact**: Everyone that works on docs or docs-internal. + +on: + issue_comment: + types: [created] + schedule: + # Schedule for five minutes after the hour, every hour + - cron: '5 * * * *' + +jobs: + noResponse: + runs-on: ubuntu-latest + steps: + - uses: lee-dohm/no-response@v0.5.0 + with: + token: ${{ github.token }} + daysUntilClose: 14 # Number of days of inactivity before an Issue is closed for lack of response + responseRequiredLabel: "needs:feedback" # Label indicating that a response from the original author is required + closeComment: > + This issue has been automatically closed because there has been no response + to our request for more information. With only the + information that is currently in the issue, we don't have enough information + to take action. Please reach out if you have or find the answers we need so + that we can investigate further. See [this blog post on bug reports and the + importance of repro steps](https://www.lee-dohm.com/2015/01/04/writing-good-bug-reports/) + for more information about the kind of information that may be helpful. From 06eca77d909498db8e044201baae8d4c19475ce6 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 7 Sep 2023 11:40:14 -0500 Subject: [PATCH 08/11] Update README.md --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 3a2aefb..1b9b72f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ +# WordPress Compatibility Tool + +> Short description here. + +[![Support Level](https://img.shields.io/badge/support-beta-blueviolet.svg)](#support-level) [![MIT License](https://img.shields.io/github/license/10up/wp-compat-validation-tool.svg)](https://github.com/10up/wp-compat-validation-tool/blob/trunk/LICENSE.md) + +## Overview + +Long description here. + ## Usage In your project's `composer.json`, add the following: @@ -28,3 +38,19 @@ In your project's `composer.json`, add the following: Replace `` with a unique namespace specific to your project. The `WP_Compat_Validation_Tools` will be replaced by `` to avoid namespace collisions in case multiple plugins use this package as their dependency. + +## Support Level + +**Beta:** This project is quite new and we're not sure what our ongoing support level for this will be. Bug reports, feature requests, questions, and pull requests are welcome. If you like this project please let us know, but be cautious using this in a Production environment! + +## Changelog + +A complete listing of all notable changes to 10up Sitemaps is documented in [CHANGELOG.md](https://github.com/10up/wp-compat-validation-tool/blob/develop/CHANGELOG.md). + +## Contributing + +Please read [CODE_OF_CONDUCT.md](https://github.com/10up/wp-compat-validation-tool/blob/develop/CODE_OF_CONDUCT.md) for details on our code of conduct, [CONTRIBUTING.md](https://github.com/10up/wp-compat-validation-tool/blob/develop/CONTRIBUTING.md) for details on the process for submitting pull requests to us, and [CREDITS.md](https://github.com/10up/wp-compat-validation-tool/blob/develop/CREDITS.md) for a listing of maintainers of, contributors to, and libraries used by 10up Sitemaps. + +## Like what you see? + +Work with us at 10up From 1fda83ea10fa56a8af67d13d06482fe6bc9bb42c Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 7 Sep 2023 11:40:31 -0500 Subject: [PATCH 09/11] update namespace --- composer.json | 4 ++-- replace-namespace.sh | 4 ++-- src/Validator.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 094c007..6cbf5ce 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { - "name": "siddharth/wp-compat-validation-tools", + "name": "10up/wp-compat-validation-tool", "autoload": { "psr-4": { - "WP_Compat_Validation_Tools\\": "src/" + "WP_Compat_Validation_Tool\\": "src/" } } } diff --git a/replace-namespace.sh b/replace-namespace.sh index ba85ee8..1c855d5 100755 --- a/replace-namespace.sh +++ b/replace-namespace.sh @@ -17,12 +17,12 @@ NEW_NAMESPACE="$1" find "$SCRIPT_DIR" -type f \( -name "*.php" -o -name "*.json" \) ! -name "$SCRIPT_NAME" | while read -r file; do echo $file # Use perl for the replacement in each file - perl -pi -e "s/WP_Compat_Validation_Tools/$NEW_NAMESPACE/g" "$file" + perl -pi -e "s/WP_Compat_Validation_Tool/$NEW_NAMESPACE/g" "$file" done # Use find to get all files recursively in the vendor/composer directory find "$COMPOSER_DIR" -type f \( -name "*.php" -o -name "*.json" \) ! -name "$SCRIPT_NAME" | while read -r file; do echo $file # Use perl for the replacement in each file - perl -pi -e "s/WP_Compat_Validation_Tools/$NEW_NAMESPACE/g" "$file" + perl -pi -e "s/WP_Compat_Validation_Tool/$NEW_NAMESPACE/g" "$file" done diff --git a/src/Validator.php b/src/Validator.php index 76045ea..1a76482 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -1,5 +1,5 @@ Date: Thu, 7 Sep 2023 11:43:54 -0500 Subject: [PATCH 10/11] Update composer.json --- composer.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/composer.json b/composer.json index 6cbf5ce..4574717 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,17 @@ { "name": "10up/wp-compat-validation-tool", + "description": "A tool to validate WordPress compatibility", + "authors": [ + { + "name": "10up", + "email": "opensource@10up.com", + "homepage": "https://10up.com", + "role": "Developer" + } + ], + "homepage": "https://github.com/10up/wp-compat-validation-tool", + "readme": "https://github.com/10up/wp-compat-validation-tool#readme", + "license": "MIT", "autoload": { "psr-4": { "WP_Compat_Validation_Tool\\": "src/" From c6d599e09f49c3c40a45e43a1a4b3231fc4cf426 Mon Sep 17 00:00:00 2001 From: Siddharth Thevaril Date: Thu, 28 Sep 2023 11:43:32 +0530 Subject: [PATCH 11/11] add short and long description --- README.md | 27 +++++++++++++++++++++++---- composer.json | 2 +- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1b9b72f..de04f41 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,15 @@ # WordPress Compatibility Tool -> Short description here. +> Perform PHP and WP version compatibility checks in your plugin. [![Support Level](https://img.shields.io/badge/support-beta-blueviolet.svg)](#support-level) [![MIT License](https://img.shields.io/github/license/10up/wp-compat-validation-tool.svg)](https://github.com/10up/wp-compat-validation-tool/blob/trunk/LICENSE.md) ## Overview -Long description here. +This library provides API methods to perform version validation checks in WordPress plugins. +Most helpful in situation where the plugin should gracefully exit on activation when system requirements aren't met. -## Usage +## Setup In your project's `composer.json`, add the following: @@ -37,7 +38,25 @@ In your project's `composer.json`, add the following: ``` Replace `` with a unique namespace specific to your project. -The `WP_Compat_Validation_Tools` will be replaced by `` to avoid namespace collisions in case multiple plugins use this package as their dependency. +The `WP_Compat_Validation_Tools` namespace will be replaced by `` to avoid namespace collisions in situations where multiple plugins use this package as their dependencies. + +## Usage + +```php +if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) { + require_once __DIR__ . '/vendor/autoload.php'; + + $compat_checker = new \New_Name_Space\Validator(); + $compat_checker + ->set_plugin_name( '' ) + ->set_php_min_required_version( '7.4' ); + if ( ! $compat_checker->is_plugin_compatible() ) { + return; + } +} +``` + +The `Validator` class should be instantiated immediately after loading the `vendor/autoload.php` class, and the validation checks should be done before loading or instantiating any other composer dependency. ## Support Level diff --git a/composer.json b/composer.json index 4574717..81e19be 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "10up/wp-compat-validation-tool", - "description": "A tool to validate WordPress compatibility", + "description": "Perform PHP and WP version compatibility checks in your plugin.", "authors": [ { "name": "10up",