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
1c868137
Commit
1c868137
authored
3 years ago
by
Grzegorz Rola
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/readme' into 'master'
chore(readme): documentation See merge request
!35
parents
d8f13148
21fb530d
No related branches found
No related tags found
1 merge request
!35
chore(readme): documentation
Pipeline
#11182
failed with stages
in 4 minutes and 33 seconds
Changes
1
Pipelines
2
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 @
1c868137
[

](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
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.
and if the requirements are not met shows proper notice to user.
...
@@ -9,4 +19,45 @@ Requirements may be:
...
@@ -9,4 +19,45 @@ Requirements may be:
-
Minimal WooCommerce version
-
Minimal WooCommerce version
-
Required PHP module
-
Required PHP module
-
Required PHP setting
-
Required PHP setting
-
OpenSSL version
-
OpenSSL version
\ No newline at end of file
## 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