94% ys-sanitize-output

Code Review | YS Sanitize Output

WordPress plugin YS Sanitize Output scored 94% from 54 tests.

About plugin

  • Plugin page: ys-sanitize-output
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.3-3.9.1
  • WordPress version: 5.8.1
  • First release: Jun 4, 2014
  • Latest release: Jun 6, 2014
  • Number of updates: 6
  • Update frequency: every 0.3 days
  • Top authors: ysahin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,260 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼141.47ms] Passed 4 tests

An overview of server-side resources used by YS Sanitize Output
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0235.68 ▲1.29
Dashboard /wp-admin3.06 ▲0.0148.08 ▲1.60
Posts /wp-admin/edit.php3.12 ▲0.0142.95 ▲0.05
Add New Post /wp-admin/post-new.php5.43 ▼0.0099.79 ▼563.75
Media Library /wp-admin/upload.php3.01 ▼0.0033.24 ▼3.46

Server storage [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for YS Sanitize Output
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,556 ▼2615.96 ▲0.328.68 ▼0.0044.38 ▼3.62
Dashboard /wp-admin2,970 ▲365.92 ▼0.12145.64 ▼2.22113.04 ▲4.63
Posts /wp-admin/edit.php2,739 ▲32.83 ▲0.1171.01 ▲8.8889.00 ▲5.45
Add New Post /wp-admin/post-new.php1,615 ▼020.92 ▼0.41288.82 ▼20.60107.44 ▲5.12
Media Library /wp-admin/upload.php1,807 ▼05.03 ▲0.01153.70 ▼1.08113.95 ▼1.16

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ys-sanitize-output/ysSanitizeOutput.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === ys-sanitize-output === )
The official readme.txt is a good inspiration

ys-sanitize-output/ysSanitizeOutput.php 92% from 13 tests

The main file in "YS Sanitize Output" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ys-sanitize-output.php" instead of "ysSanitizeOutput.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected26 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11926

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected