Skip to content

Commit 06ee6d2

Browse files
authored
Added Workflow
1 parent ff6d04f commit 06ee6d2

File tree

2 files changed

+158
-0
lines changed

2 files changed

+158
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: WordPress Plugin Check Failure
3+
labels: bug, plugin-check, automated
4+
assignees:
5+
---
6+
7+
## WordPress Plugin Check Failure
8+
9+
The WordPress Plugin Check action has identified issues with the Simple WP Optimizer plugin.
10+
11+
### Details
12+
13+
- **Test Date:** {{ date | date('YYYY-MM-DD HH:mm:ss') }}
14+
- **Workflow Run:** [View detailed logs]({{ env.WORKFLOW_URL }})
15+
16+
### Next Steps
17+
18+
This issue has been automatically created because the WordPress Plugin Check found issues with the plugin that should be addressed. The check performed the following specific tests:
19+
20+
#### Categories:
21+
- **Accessibility**: Checks for accessibility compliance issues
22+
- **General**: General WordPress coding standards and best practices
23+
- **Performance**: Tests that identify performance bottlenecks
24+
- **Plugin Repo**: Requirements for WordPress.org plugin repository
25+
- **Security**: Security-focused checks to identify vulnerabilities
26+
27+
#### Specific Checks:
28+
- **i18n_usage**: Proper internationalization usage
29+
- **code_obfuscation**: Detecting potentially obfuscated code
30+
- **direct_db_queries**: Identifying direct database queries that bypass WordPress APIs
31+
- **enqueued_scripts_in_footer**: Ensuring scripts are properly enqueued in the footer
32+
- **enqueued_scripts_size**: Checking for excessively large script files
33+
- **enqueued_styles_scope**: Ensuring styles are properly scoped
34+
- **file_type**: Checking for proper file types and formats
35+
- **late_escaping**: Ensuring output is properly escaped
36+
- **localhost**: Checking for references to localhost or development environments
37+
- **no_unfiltered_uploads**: Ensuring uploads are properly filtered
38+
- **performant_wp_query_params**: Checking for inefficient WP_Query parameters
39+
- **plugin_header_text_domain**: Verifying correct text domain in plugin header
40+
- **plugin_readme**: Checking the plugin readme file format
41+
- **plugin_review_phpcs**: PHP CodeSniffer checks for WordPress standards
42+
- **plugin_updater**: Checking plugin update mechanisms
43+
- **trademarks**: Checking for potential trademark violations
44+
45+
#### Recommended Actions:
46+
47+
1. Review the workflow logs for specific error messages and warnings
48+
2. Address each identified issue in the plugin code
49+
3. Test locally using the [WordPress Plugin Check tool](https://github.com/WordPress/plugin-check) to verify fixes
50+
4. Submit a pull request with the necessary changes
51+
52+
Once all issues are fixed, please close this issue and reference it in the changelog.
53+
54+
### About WordPress Plugin Check
55+
56+
The WordPress Plugin Check tool helps plugin authors create plugins that follow WordPress best practices. It checks for issues related to security, performance, and compatibility to ensure plugins work well in the WordPress ecosystem.
57+
58+
---
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: WordPress Plugin Check
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
# Allow manually triggering the workflow
8+
workflow_dispatch:
9+
10+
# Cancels all previous workflow runs for the same branch that have not yet completed
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: read
17+
issues: write
18+
19+
jobs:
20+
plugin-check:
21+
name: WordPress Plugin Check
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Setup PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: '8.0'
32+
extensions: mysqli, curl, zip, intl, gd, mbstring, fileinfo, xml
33+
coverage: none
34+
tools: composer:v2
35+
36+
- name: Install Composer dependencies
37+
uses: ramsey/composer-install@v3
38+
with:
39+
dependency-versions: highest
40+
composer-options: "--prefer-dist --no-progress"
41+
42+
- name: WordPress Plugin Check
43+
uses: WordPress/[email protected]
44+
with:
45+
# Build directory - using repository root
46+
build-dir: './'
47+
48+
# Configure which checks to run
49+
checks: |
50+
i18n_usage
51+
code_obfuscation
52+
direct_db_queries
53+
enqueued_scripts_in_footer
54+
enqueued_scripts_size
55+
enqueued_styles_scope
56+
file_type
57+
late_escaping
58+
localhost
59+
no_unfiltered_uploads
60+
performant_wp_query_params
61+
plugin_header_text_domain
62+
plugin_readme
63+
plugin_review_phpcs
64+
plugin_updater
65+
trademarks
66+
67+
# Configure which categories to check
68+
categories: |
69+
accessibility
70+
general
71+
performance
72+
plugin_repo
73+
security
74+
75+
# Whether to include experimental checks
76+
include-experimental: false
77+
78+
# Don't ignore warnings or errors
79+
ignore-warnings: false
80+
ignore-errors: false
81+
82+
# WordPress version to use
83+
wp-version: 'latest'
84+
85+
- name: Create issue on plugin check failure
86+
if: ${{ failure() }}
87+
uses: JasonEtco/create-an-issue@v2
88+
env:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
RUN_ID: ${{ github.run_id }}
91+
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
92+
with:
93+
filename: .github/ISSUE_TEMPLATE/plugin-check-failure.md
94+
update_existing: false
95+
96+
- name: Mark job as failed after issue creation
97+
if: ${{ failure() }}
98+
run: |
99+
echo "::error::WordPress Plugin Check failed. Created issue for tracking."
100+
exit 1

0 commit comments

Comments
 (0)