84% wp-sanitize-file-name-plus

Code Review | WP Sanitize File Name Plus

WordPress plugin WP Sanitize File Name Plus scored84%from 54 tests.

About plugin

  • Plugin page: wp-sanitize-file-...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9
  • WordPress version: 6.3.1
  • First release: Jun 25, 2014
  • Latest release: Dec 21, 2017
  • Number of updates: 27
  • Update frequency: every 47.2 days
  • Top authors: Yslo (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active /25,534 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼7.76ms] Passed 4 tests

Analyzing server-side resources used by WP Sanitize File Name Plus
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0035.46 ▼5.18
Dashboard /wp-admin3.31 ▼0.0445.55 ▼11.51
Posts /wp-admin/edit.php3.36 ▲0.0047.71 ▼0.94
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.04 ▼13.40
Media Library /wp-admin/upload.php3.23 ▲0.0034.62 ▲0.79

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by WP Sanitize File Name Plus
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.18 ▼0.071.57 ▼0.4939.54 ▼2.82
Dashboard /wp-admin2,192 ▲155.57 ▼0.0696.03 ▲9.3646.75 ▲5.51
Posts /wp-admin/edit.php2,097 ▼32.03 ▲0.0239.43 ▲2.3835.33 ▼1.26
Add New Post /wp-admin/post-new.php1,526 ▼023.17 ▲0.07656.63 ▼2.2658.19 ▲0.24
Media Library /wp-admin/upload.php1,400 ▼34.19 ▲0.0398.54 ▼3.2844.21 ▲0.90

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-sanitize-file-name-plus/wp-sanitize-file-name-plus.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
10 plugin tags: filename, image, core, security, uploads...

wp-sanitize-file-name-plus/wp-sanitize-file-name-plus.php Passed 13 tests

"WP Sanitize File Name Plus" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
62 characters long description:
This plugin remove latin special characters used in file name.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected87 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP27987

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected