Preserve Code Formatting Security & Risk Analysis

wordpress.org/plugins/preserve-code-formatting

Preserve formatting of code for display by preventing its modification by WordPress and other plugins while also retaining whitespace.

400 active installs v5.0 PHP + WP 5.5+ Updated Aug 15, 2025
codecontentescapeformattingpost
98
A · Safe
CVEs total1
Unpatched0
Last CVEAug 1, 2025
Safety Verdict

Is Preserve Code Formatting Safe to Use in 2026?

Generally Safe

Score 98/100

Preserve Code Formatting has a strong security track record. Known vulnerabilities have been patched promptly. It's a solid choice for most WordPress installations.

1 known CVELast CVE: Aug 1, 2025Updated 9mo ago
Risk Assessment

The "preserve-code-formatting" plugin v5.0 exhibits a generally good security posture with no identified attack surface points and a high percentage of properly escaped output. The absence of critical or high severity taint flows and the exclusive use of prepared statements for SQL queries are positive indicators. However, the presence of the `unserialize` function, even without immediate observable taint flows, introduces a potential risk. This function can be dangerous if used with untrusted data, leading to object injection vulnerabilities. The plugin's vulnerability history includes one high-severity CVE related to "Deserialization of Untrusted Data," which strongly aligns with the risk posed by `unserialize`. While this specific vulnerability is marked as patched, the past occurrence highlights a recurring area of concern and suggests that developers should be particularly vigilant about how serialized data is handled in future versions. The plugin's strengths lie in its limited attack surface and good output escaping practices, but the `unserialize` function and its historical vulnerability pattern warrant ongoing attention.

Key Concerns

  • Dangerous function detected (unserialize)
  • Past high severity CVE for deserialization
Vulnerabilities
1 published

Preserve Code Formatting Security Vulnerabilities

CVEs by Year

1 CVE in 2025
2025
Patched Has unpatched

Severity Breakdown

High
1

1 total CVE

CVE-2025-49386high · 7.5Deserialization of Untrusted Data

Preserve Code Formatting <= 4.0.1 - Authenticated (Contributor+) PHP Object Injection

Aug 1, 2025 Patched in 5.0 (103d)
Version History

Preserve Code Formatting Release Timeline

v5.0Current
v4.0.11 CVE
v4.01 CVE
v3.9.21 CVE
v3.9.11 CVE
v3.91 CVE
v3.81 CVE
v3.71 CVE
v3.61 CVE
v3.51 CVE
v3.21 CVE
v3.11 CVE
v3.01 CVE
v2.5.41 CVE
v2.5.31 CVE
v2.5.21 CVE
v2.5.11 CVE
v2.51 CVE
v2.01 CVE
Code Analysis
Analyzed Mar 16, 2026

Preserve Code Formatting Code Analysis

Dangerous Functions
1
Raw SQL Queries
0
0 prepared
Unescaped Output
3
58 escaped
Nonce Checks
0
Capability Checks
1
File Operations
0
External Requests
0
Bundled Libraries
0

Dangerous Functions Found

unserialize$plugins = unserialize( $r['body']['plugins'] );c2c-plugin.php:362

Output Escaping

95% escaped61 total outputs
Attack Surface

Preserve Code Formatting Attack Surface

Entry Points0
Unprotected0
WordPress Hooks 21
actioninitc2c-plugin.php:189
actionadmin_initc2c-plugin.php:192
actionadmin_headc2c-plugin.php:193
filterplugin_row_metac2c-plugin.php:253
filterhttp_request_argsc2c-plugin.php:256
actionadmin_menuc2c-plugin.php:260
filtercontextual_helpc2c-plugin.php:263
actionadmin_enqueue_scriptsc2c-plugin.php:265
filterthe_contentpreserve-code-formatting.php:274
filterthe_contentpreserve-code-formatting.php:275
filtercontent_save_prepreserve-code-formatting.php:276
filtercontent_save_prepreserve-code-formatting.php:277
filterthe_excerptpreserve-code-formatting.php:279
filterthe_excerptpreserve-code-formatting.php:280
filterexcerpt_save_prepreserve-code-formatting.php:281
filterexcerpt_save_prepreserve-code-formatting.php:282
filtercomment_textpreserve-code-formatting.php:286
filtercomment_textpreserve-code-formatting.php:287
filterpre_comment_contentpreserve-code-formatting.php:288
filterpre_comment_contentpreserve-code-formatting.php:289
actionplugins_loadedpreserve-code-formatting.php:784
Maintenance & Trust

Preserve Code Formatting Maintenance & Trust

Maintenance Signals

WordPress version tested6.8.5
Last updatedAug 15, 2025
PHP min version
Downloads49K

Community Trust

Rating94/100
Number of ratings3
Active installs400
Developer Profile

Preserve Code Formatting Developer Profile

Scott Reilly

63 plugins · 92K total installs

71
trust score
Avg Security Score
88/100
Avg Patch Time
374 days
View full developer profile
Detection Fingerprints

How We Detect Preserve Code Formatting

Patterns used to identify this plugin on WordPress sites during automated security audits and web crawling.

Asset Fingerprints

Asset Paths
/wp-content/plugins/preserve-code-formatting/css/preserve-code-formatting.css/wp-content/plugins/preserve-code-formatting/js/preserve-code-formatting.js
Script Paths
/wp-content/plugins/preserve-code-formatting/js/preserve-code-formatting.js
Version Parameters
preserve-code-formatting/css/preserve-code-formatting.css?ver=preserve-code-formatting/js/preserve-code-formatting.js?ver=

HTML / DOM Fingerprints

HTML Comments
<!-- CODE BLOCK START --><!-- CODE BLOCK END -->
FAQ

Frequently Asked Questions about Preserve Code Formatting