Skip to content

Commit

Permalink
Merge pull request #135 from 10up/feature/add-php-checks
Browse files Browse the repository at this point in the history
Add a check to ensure we have a valid PHP version before loading plugin functionality and output an admin notice f needed
  • Loading branch information
peterwilsoncc committed Sep 19, 2023
2 parents dd17ea2 + 256eda3 commit 45d06c3
Show file tree
Hide file tree
Showing 5 changed files with 639 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/php-compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PHP Compatibility

on:
push:
branches:
- develop
- trunk
pull_request:
branches:
- develop

jobs:
php-compatibility:
name: PHP minimum 7.4

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v2
coverage: none

- name: Install dependencies
run: composer install

- name: Run PHP Compatibility on all files.
run: vendor/bin/phpcs includes --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 7.4-

- name: Run PHP Compatibility on main file.
run: vendor/bin/phpcs insecure-content-warning.php --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 5.6-
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ Desktop.ini

tests/cypress/screenshots/
tests/cypress/videos/

vendor
23 changes: 23 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "10up/insecure-content-warning",
"description": "Prevent editors from adding insecure content in the editor.",
"type": "wordpress-plugin",
"homepage": "https://github.com/10up/insecure-content-warning",
"license": "GPL-2.0-only",
"authors": [
{
"name": "10up",
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"require-dev": {
"10up/phpcs-composer": "dev-master"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
Loading

0 comments on commit 45d06c3

Please sign in to comment.