We had this error with our custom plugin. Here is our internal report of the bug and the "fix"
Plesk WordPress Toolkit - Plugin Version Validation Bug Report
Summary
Plesk WordPress Toolkit incorrectly rejects valid WordPress plugins with the error "The underscore character is not allowed in the plugin version." The validation scans the entire plugin file for version strings instead of only checking the plugin header comment block.
Bug Description
Current Behavior:
This bug prevents legitimate WordPress plugins from being uploaded when they contain logging or debugging code that references version constants - a common and valid WordPress development practice.
Simple Replication Example
Create a minimal WordPress plugin file named `test-plugin.php`:
Result:
- Plugin has valid version `1.0.0` in header
- Plesk rejects upload with error: "The underscore character is not allowed in the plugin version"
- Plesk incorrectly validates `TEST_PLUGIN_VERSION` constant name instead of just the header version
Suggested Fix
Limit version validation to the WordPress plugin header comment block only:
This aligns with WordPress core's plugin header parsing logic, which only reads the header comment block.
WordPress Standard Reference
WordPress only parses plugin headers from the first 8 KB of the file and only within PHP comment blocks. See: Header Requirements – Plugin Handbook | Developer.WordPress.org
Version constants and version logging are standard WordPress development practices and should not interfere with plugin upload validation.
Workaround
Developers must avoid using the string `"Version: "` anywhere in their code, even in legitimate logging statements. This is an unnecessary restriction that doesn't exist in WordPress itself.
Environment
Plesk WordPress Toolkit - Plugin Version Validation Bug Report
Summary
Plesk WordPress Toolkit incorrectly rejects valid WordPress plugins with the error "The underscore character is not allowed in the plugin version." The validation scans the entire plugin file for version strings instead of only checking the plugin header comment block.
Bug Description
Current Behavior:
- Plesk scans the entire PHP file for the pattern `Version:`
- When found anywhere in the code (not just the header), it validates the text that follows
- If a constant name with underscores appears after `Version:`, Plesk rejects the plugin
- This occurs even when the actual plugin version in the header is valid
- Version validation should ONLY scan the plugin header comment block (lines 1-20 typically)
- Code within the plugin should not be subject to version validation
- Only the `Version:` field in the WordPress plugin header should be validated
This bug prevents legitimate WordPress plugins from being uploaded when they contain logging or debugging code that references version constants - a common and valid WordPress development practice.
Simple Replication Example
Create a minimal WordPress plugin file named `test-plugin.php`:
<?php
/**
* Plugin Name: Test Plugin
* Description: Demonstrates Plesk validation bug
* Version: 1.0.0
* Author: Test Author
*/
// Prevent direct access
if (!defined('ABSPATH')) {
exit;
}
// Define version constant (standard WordPress practice)
define('TEST_PLUGIN_VERSION', '1.0.0');
// Log initialization with version (triggers Plesk bug)
error_log('Test Plugin starting - Version: ' . TEST_PLUGIN_VERSION);
Result:
- Plugin has valid version `1.0.0` in header
- Plesk rejects upload with error: "The underscore character is not allowed in the plugin version"
- Plesk incorrectly validates `TEST_PLUGIN_VERSION` constant name instead of just the header version
Suggested Fix
Limit version validation to the WordPress plugin header comment block only:
- Parse only the DocBlock comment at the start of the file.
- Validate only the `Version:` field within that comment block
- Ignore any occurrences of "Version:" in the actual PHP code
This aligns with WordPress core's plugin header parsing logic, which only reads the header comment block.
WordPress Standard Reference
WordPress only parses plugin headers from the first 8 KB of the file and only within PHP comment blocks. See: Header Requirements – Plugin Handbook | Developer.WordPress.org
Version constants and version logging are standard WordPress development practices and should not interfere with plugin upload validation.
Workaround
Developers must avoid using the string `"Version: "` anywhere in their code, even in legitimate logging statements. This is an unnecessary restriction that doesn't exist in WordPress itself.
Environment
- Plesk WordPress Toolkit (current version as of 2025)
- All WordPress versions