Skip to content

Commit 4e16ef7

Browse files
authored
Test
1 parent 340242a commit 4e16ef7

2 files changed

Lines changed: 218 additions & 0 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: WordPress VIP Coding Standards Failure - PHP ${{ env.PHP_VERSION }}
3+
labels: ['vip-standards', 'coding-standards', 'needs-review', 'php-${{ env.PHP_VERSION }}']
4+
assignees: []
5+
---
6+
7+
## WordPress VIP Coding Standards Failure
8+
9+
**PHP Version:** ${{ env.PHP_VERSION }}
10+
**Run ID:** ${{ env.RUN_ID }}
11+
**Workflow:** [View Failed Run](${{ env.WORKFLOW_URL }})
12+
13+
### Issue Description
14+
15+
The WordPress VIP coding standards check has failed during the automated workflow. This scan specifically checks for enterprise-level WordPress development standards required for WordPress VIP platform compatibility.
16+
17+
### VIP Standards Focus Areas
18+
19+
The WordPress VIP Go coding standards check for:
20+
21+
🏢 **Enterprise Platform Requirements:**
22+
- File system operation restrictions (VIP platform limitations)
23+
- Performance and caching best practices for high-traffic sites
24+
- Security vulnerabilities specific to enterprise WordPress environments
25+
- User experience guidelines for enterprise-level WordPress
26+
27+
🚀 **Performance & Caching:**
28+
- Uncached function usage patterns
29+
- Database query optimization
30+
- Remote data fetching best practices
31+
- Resource-heavy operation detection
32+
33+
🔒 **VIP-Specific Security:**
34+
- File operation security in restricted environments
35+
- Admin bar removal restrictions for VIP support users
36+
- Cookie and caching constraint validations
37+
- Restricted function usage for platform stability
38+
39+
### Important Notes
40+
41+
⚠️ **VIP Standards Context:**
42+
- Many VIP standards are specific to the WordPress VIP hosting platform
43+
- Not all VIP recommendations may apply to standard WordPress installations
44+
- Some restrictions are platform-specific (e.g., file system limitations)
45+
- This scan helps ensure compatibility with enterprise WordPress environments
46+
47+
### Next Steps
48+
49+
1. **Review the workflow logs** to identify specific VIP standard violations
50+
2. **Evaluate applicability** - determine which issues apply to your hosting environment
51+
3. **Prioritize fixes** based on your deployment target:
52+
- **High Priority:** Security and performance issues
53+
- **Medium Priority:** General code quality improvements
54+
- **Low Priority:** VIP platform-specific restrictions (if not targeting VIP)
55+
4. **Update code** to address applicable VIP standard violations
56+
5. **Re-run the workflow** to verify fixes
57+
58+
### Resources
59+
60+
- [WordPress VIP Code Quality Standards](https://docs.wpvip.com/technical-references/code-quality-and-best-practices/)
61+
- [VIP Coding Standards GitHub](https://github.com/Automattic/VIP-Coding-Standards)
62+
- [WordPress VIP Platform Documentation](https://docs.wpvip.com/)
63+
- [VIP Go File System Documentation](https://docs.wpvip.com/technical-references/vip-go-files-system/)
64+
65+
### Workflow Information
66+
67+
**Failed Workflow Run:** [View Details](${{ env.WORKFLOW_URL }})
68+
**PHP Version Tested:** ${{ env.PHP_VERSION }}
69+
**Standards Used:** WordPress-VIP-Go ruleset
70+
71+
This issue was automatically created when the WordPress VIP coding standards check failed. Please review the specific violations in the workflow logs and address them according to your project's deployment requirements.

.github/workflows/wp-compatibility-test.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,153 @@ jobs:
164164
filename: .github/ISSUE_TEMPLATE/phpcs-failure.md
165165
update_existing: false
166166

167+
vip-phpcs:
168+
name: WordPress VIP Coding Standards (PHP ${{ matrix.php-version }})
169+
runs-on: ubuntu-latest
170+
strategy:
171+
matrix:
172+
php-version: ['7.4', '8.0', '8.3', '8.4']
173+
fail-fast: false
174+
175+
steps:
176+
- name: Checkout code
177+
uses: actions/checkout@v5
178+
179+
- name: Setup PHP ${{ matrix.php-version }}
180+
uses: shivammathur/setup-php@v2
181+
with:
182+
php-version: ${{ matrix.php-version }}
183+
extensions: mysqli, curl, zip, intl, gd, mbstring, fileinfo, xml
184+
coverage: none
185+
tools: composer:v2, phpcs
186+
187+
- name: Install Composer dependencies
188+
uses: ramsey/composer-install@v3
189+
with:
190+
dependency-versions: highest
191+
composer-options: "--prefer-dist --no-progress"
192+
193+
- name: Install WordPress VIP Coding Standards
194+
run: |
195+
# Install PHPCS and WordPress VIP Coding Standards
196+
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
197+
composer global require --dev squizlabs/php_codesniffer:"^3.7"
198+
composer global require --dev wp-coding-standards/wpcs:"^3.0"
199+
composer global require --dev automattic/vipwpcs:"^3.0"
200+
composer global require --dev dealerdirect/phpcodesniffer-composer-installer:"^1.0"
201+
202+
# Add composer bin to PATH
203+
echo "$HOME/.composer/vendor/bin" >> $GITHUB_PATH
204+
205+
# Verify installation and show available standards
206+
phpcs -i
207+
208+
# Verify VIP standards are available
209+
phpcs -i | grep -i vip || echo "VIP standards not found, checking installation..."
210+
211+
- name: Create VIP-specific PHPCS configuration
212+
run: |
213+
cat > phpcs-vip.xml << 'EOF'
214+
<?xml version="1.0"?>
215+
<ruleset name="WordPress VIP Go Coding Standards">
216+
<description>WordPress VIP Go coding standards for enterprise-level WordPress development</description>
217+
218+
<!-- Files to check -->
219+
<file>.</file>
220+
221+
<!-- Exclude patterns -->
222+
<exclude-pattern>*/vendor/*</exclude-pattern>
223+
<exclude-pattern>*/node_modules/*</exclude-pattern>
224+
<exclude-pattern>*/tests/*</exclude-pattern>
225+
<exclude-pattern>*/assets/*</exclude-pattern>
226+
<exclude-pattern>*/languages/*</exclude-pattern>
227+
<exclude-pattern>*/.git/*</exclude-pattern>
228+
<exclude-pattern>*/.github/*</exclude-pattern>
229+
230+
<!-- Use WordPress VIP Go coding standards -->
231+
<rule ref="WordPress-VIP-Go">
232+
<!-- Allow short array syntax [] instead of array() -->
233+
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
234+
235+
<!-- Allow longer lines for readability in some cases -->
236+
<exclude name="Generic.Files.LineLength.TooLong"/>
237+
238+
<!-- Adjust severity for some VIP-specific rules that may not apply to all plugins -->
239+
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.file_ops_fwrite"/>
240+
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.file_ops_file_put_contents"/>
241+
</rule>
242+
243+
<!-- VIP-specific security and performance rules -->
244+
<rule ref="WordPressVIPMinimum.Security"/>
245+
<rule ref="WordPressVIPMinimum.Performance"/>
246+
<rule ref="WordPressVIPMinimum.UserExperience"/>
247+
248+
<!-- WordPress internationalization with plugin text domain -->
249+
<rule ref="WordPress.WP.I18n">
250+
<properties>
251+
<property name="text_domain" type="array">
252+
<element value="optimizations-ace-mc"/>
253+
</property>
254+
</properties>
255+
</rule>
256+
257+
<!-- WordPress PHP compatibility -->
258+
<rule ref="PHPCompatibilityWP">
259+
<include-pattern>*\.php$</include-pattern>
260+
</rule>
261+
<config name="minimum_supported_wp_version" value="6.5"/>
262+
<config name="testVersion" value="7.4-"/>
263+
264+
<!-- Show progress -->
265+
<arg value="p"/>
266+
267+
<!-- Show sniff codes in all reports -->
268+
<arg value="s"/>
269+
270+
<!-- Use colors in output -->
271+
<arg name="colors"/>
272+
273+
<!-- Set report width for better readability -->
274+
<arg name="report-width" value="120"/>
275+
</ruleset>
276+
EOF
277+
278+
- name: Run WordPress VIP PHPCS
279+
run: |
280+
echo "🚀 Running WordPress VIP Go Coding Standards scan..."
281+
echo "📋 This scan checks for VIP-specific requirements including:"
282+
echo " • File system operation restrictions"
283+
echo " • Performance and caching best practices"
284+
echo " • Security vulnerabilities specific to VIP platform"
285+
echo " • User experience guidelines for enterprise WordPress"
286+
echo " • Uncached function usage patterns"
287+
echo ""
288+
289+
# Run VIP-specific PHPCS scan using our custom configuration
290+
phpcs --standard=phpcs-vip.xml --extensions=php --ignore=vendor,tests,node_modules . || {
291+
echo ""
292+
echo "⚠️ WordPress VIP coding standards issues found."
293+
echo "💡 Note: These are VIP-specific recommendations for enterprise WordPress platforms."
294+
echo "🔧 Many of these may not apply to standard WordPress installations."
295+
echo "📖 For more info: https://docs.wpvip.com/technical-references/code-quality-and-best-practices/"
296+
echo ""
297+
exit 0
298+
}
299+
300+
echo "✅ WordPress VIP coding standards check completed successfully!"
301+
302+
- name: Create issue on VIP PHPCS failure
303+
if: ${{ failure() }}
304+
uses: JasonEtco/create-an-issue@v2
305+
env:
306+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
307+
PHP_VERSION: ${{ matrix.php-version }}
308+
RUN_ID: ${{ github.run_id }}
309+
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
310+
with:
311+
filename: .github/ISSUE_TEMPLATE/vip-phpcs-failure.md
312+
update_existing: false
313+
167314
phpmd:
168315
name: PHPMD Code Quality Check (PHP ${{ matrix.php-version }})
169316
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)