84% uploaded-file-name-sanitizer

Code Review | Uploaded file name sanitizer

WordPress plugin Uploaded file name sanitizer scored 84% from 54 tests.

About plugin

  • Plugin page: uploaded-file-nam...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2.2
  • WordPress version: 6.3.1
  • First release: Mar 4, 2016
  • Latest release: Mar 1, 2016
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: devliudaseu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 971 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.13MB] [CPU: ▼17.45ms] Passed 4 tests

An overview of server-side resources used by Uploaded file name sanitizer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▼0.0334.66 ▼26.39
Dashboard /wp-admin3.31 ▲0.0043.51 ▼11.19
Posts /wp-admin/edit.php3.36 ▼0.4948.25 ▼7.68
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.85 ▼24.53
Media Library /wp-admin/upload.php3.23 ▲0.0033.68 ▼5.70

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Uploaded file name sanitizer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.56 ▼0.801.73 ▼0.2737.69 ▼8.78
Dashboard /wp-admin2,203 ▲155.77 ▼0.1493.39 ▼14.8137.26 ▼7.25
Posts /wp-admin/edit.php2,089 ▼01.96 ▼0.0538.58 ▲2.6435.38 ▲1.58
Add New Post /wp-admin/post-new.php1,514 ▼017.83 ▼3.62653.09 ▼37.5854.23 ▼0.16
Media Library /wp-admin/upload.php1,388 ▲34.16 ▲0.0196.50 ▼29.4642.51 ▼63.66

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 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/uploaded-file-name-sanitizer/uploaded-file-name-sanitizer.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: upload, file name, sanitizer, filename

uploaded-file-name-sanitizer/uploaded-file-name-sanitizer.php Passed 13 tests

This is the main PHP file of "Uploaded file name sanitizer" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
66 characters long description:
Replaces chars which are not in 'a-z', '0-9' and ' '(space) range.

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
There were no executable files found in this plugin9 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1199

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.17
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%
Functions1
▷ Named functions1100.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 images were found in this plugin