90% pryc-wp-sanitize-file-name-when-upload

Code Review | PRyC WP: Sanitize file name (when upload)

WordPress plugin PRyC WP: Sanitize file name (when upload) scored90%from 54 tests.

About plugin

  • Plugin page: pryc-wp-sanitize-...
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Sep 8, 2017
  • Latest release: Jun 20, 2023
  • Number of updates: 10
  • Update frequency: every 211.1 days
  • Top authors: PRyCpl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /978 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

This is a short check of server-side resources used by PRyC WP: Sanitize file name (when upload)
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.62 ▼0.64
Dashboard /wp-admin3.31 ▼0.0346.91 ▼15.71
Posts /wp-admin/edit.php3.36 ▲0.0144.78 ▲1.26
Add New Post /wp-admin/post-new.php5.89 ▲0.0197.86 ▼1.13
Media Library /wp-admin/upload.php3.23 ▲0.0133.65 ▲0.95

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for PRyC WP: Sanitize file name (when upload)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.35 ▼0.951.70 ▼0.0349.76 ▲6.61
Dashboard /wp-admin2,206 ▲155.77 ▲0.8793.90 ▼19.3836.06 ▼9.56
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0135.17 ▼4.5731.82 ▼7.98
Add New Post /wp-admin/post-new.php1,542 ▲918.25 ▼4.91594.06 ▼65.9254.25 ▲5.39
Media Library /wp-admin/upload.php1,388 ▲64.21 ▼0.0095.91 ▼0.3444.29 ▲0.36

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: ascii, uploads, filename, wordpress, upload...

pryc-wp-sanitize-file-name-when-upload/pryc-wp-sanitize-file-name-when-upload.php Passed 13 tests

This is the main PHP file of "PRyC WP: Sanitize file name (when upload)" version 1.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
95 characters long description:
Plugin sanitize file name when upload files - remove space, ASCII characters, lowercase, etc...

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
Success! There were no dangerous files found in this plugin15 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1151215

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.08
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin