83% bea-sanitize-filename

Code Review | BEA - Sanitize Filename

WordPress plugin BEA - Sanitize Filename scored 83% from 54 tests.

About plugin

  • Plugin page: bea-sanitize-file...
  • Plugin version: 2.0.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Feb 3, 2018
  • Latest release: Sep 27, 2022
  • Number of updates: 35
  • Update frequency: every 48.5 days
  • Top authors: MaximeCulea (91.43%)momo360modena (8.57%)beapi (5.71%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active / 9,658 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by BEA - Sanitize Filename
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0234.48 ▼3.94
Dashboard /wp-admin3.32 ▲0.0145.37 ▲0.14
Posts /wp-admin/edit.php3.37 ▲0.0148.14 ▲1.89
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.27 ▼12.98
Media Library /wp-admin/upload.php3.24 ▲0.0132.10 ▼3.82

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for BEA - Sanitize Filename
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.201.68 ▼0.1138.98 ▼5.09
Dashboard /wp-admin2,206 ▲185.88 ▲0.94104.67 ▼0.1938.78 ▼1.83
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0239.74 ▲4.4634.31 ▲0.53
Add New Post /wp-admin/post-new.php1,534 ▲1523.38 ▲0.20668.37 ▼9.1760.27 ▲3.61
Media Library /wp-admin/upload.php1,388 ▼04.22 ▼0.1092.15 ▼13.9940.90 ▼7.46

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 did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/bea-sanitize-filename/bea-sanitize-filename.php:52

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: sanitize, media, uploads

bea-sanitize-filename/bea-sanitize-filename.php 85% from 13 tests

The entry point to "BEA - Sanitize Filename" version 2.0.7 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin684 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
Markdown31830661
PHP1175723

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.14
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 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.80MB with 0.53MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
.wordpress.org/banner-1544x500.png345.19KB33.25KB▼ 90.37%
.wordpress.org/banner-github.png80.44KB80.57KB0.00%
.wordpress.org/icon-256x256.png47.19KB12.91KB▼ 72.64%
.wordpress.org/banner-772x250.png298.17KB15.59KB▼ 94.77%
.wordpress.org/icon-128x128.png47.19KB12.91KB▼ 72.64%