Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-basic-requirements
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
wp-basic-requirements
Commits
21fb530d
Commit
21fb530d
authored
2 years ago
by
Grzegorz Rola
Browse files
Options
Downloads
Patches
Plain Diff
chore(readme): documentation
parent
d8f13148
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!35
chore(readme): documentation
Pipeline
#11134
failed with stages
Stage: tools
Stage: tests
in 5 minutes and 47 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+52
-1
52 additions, 1 deletion
README.md
with
52 additions
and
1 deletion
README.md
+
52
−
1
View file @
21fb530d
[

](https://gitlab.com/wpdesk/wp-basic-requirements/pipelines)
[

](https://gitlab.com/wpdesk/wp-basic-requirements/commits/master)
[

](https://packagist.org/packages/wpdesk/wp-basic-requirements)
[

](https://packagist.org/packages/wpdesk/wp-basic-requirements)
[

](https://packagist.org/packages/wpdesk/wp-basic-requirements)
[

](https://packagist.org/packages/wpdesk/wp-basic-requirements)
WP Basic Requirements
=====================
Wp-basic-requirements is a simple library for WordPress plugins to check if the environment meets the requirements
and if the requirements are not met shows proper notice to user.
...
...
@@ -9,4 +19,45 @@ Requirements may be:
-
Minimal WooCommerce version
-
Required PHP module
-
Required PHP setting
-
OpenSSL version
\ No newline at end of file
-
OpenSSL version
## Requirements
PHP 5.2 or later.
## Installation via Composer
In order to install the bindings via
[
Composer
](
http://getcomposer.org/
)
run the following command:
```
bash
composer require wpdesk/wp-basic-requirements
```
## Example usage
Use this code in main WordPress plugin file:
```
php
<?php
$requirements_checker
=
(
new
WPDesk_Basic_Requirement_Checker_Factory
)
->
create_from_requirement_array
(
__FILE__
,
'Example plugin name'
,
[
'php'
=>
'7.0'
,
'wp'
=>
'6.0'
,
'plugins'
=>
[
[
'name'
=>
'woocommerce/woocommerce.php'
,
'nice_name'
=>
'WooCommerce'
,
],
],
]
);
if
(
$requirements_checker
->
are_requirements_met
()
)
{
// plugin stuff goes here
}
else
{
$requirements_checker
->
render_notices
();
}
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment