Skip to content

Commit

Permalink
add short and long description
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidsector9 committed Sep 28, 2023
1 parent 740ab49 commit 237b873
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# WordPress Compatibility Tool

> Short description here.
> Perform PHP and WP minimum 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:

Expand Down Expand Up @@ -39,6 +40,24 @@ In your project's `composer.json`, add the following:
Replace `<New_Name_Space>` with a unique namespace specific to your project.
The `WP_Compat_Validation_Tools` will be replaced by `<New_Name_Space>` to avoid namespace collisions in case multiple plugins use this package as their dependency.

## 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( '<Your 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

**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!
Expand Down

0 comments on commit 237b873

Please sign in to comment.