10% uploads-protector

Code Review | Uploads Protector

WordPress plugin Uploads Protector scored10%from 54 tests.

About plugin

  • Plugin page: uploads-protector
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.2.2
  • WordPress version: 6.3.1
  • First release: Aug 23, 2019
  • Latest release: Aug 23, 2019
  • Number of updates: 3
  • Update frequency: every 0.7 days
  • Top authors: tsucharoku (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /445 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/uploads-protector/uploads-protector.php+62
    Undefined index: path

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

Analyzing server-side resources used by Uploads Protector
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.76 ▼1.76
Dashboard /wp-admin3.32 ▲0.0245.97 ▼11.86
Posts /wp-admin/edit.php3.38 ▲0.0250.75 ▲5.83
Add New Post /wp-admin/post-new.php5.91 ▲0.0292.25 ▼5.32
Media Library /wp-admin/upload.php3.25 ▲0.0133.95 ▼5.34

Server storage [IO: ▲0.01MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Please fix the following
  • You have illegally modified 1 file (0.97KB) outside of "wp-content/plugins/uploads-protector/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Uploads Protector
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7914.82 ▲0.292.01 ▲0.2943.29 ▼1.52
Dashboard /wp-admin2,209 ▲215.88 ▼0.0093.18 ▼22.5737.30 ▼6.41
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0038.49 ▼4.0434.70 ▼0.52
Add New Post /wp-admin/post-new.php1,543 ▲118.50 ▲0.27603.60 ▼57.5548.45 ▼8.33
Media Library /wp-admin/upload.php1,385 ▼04.23 ▲0.01100.57 ▲0.2143.31 ▲0.80

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Looking good! No server-side errors or output on direct access of PHP files

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Contributors: The plugin contributors field is missing
You can look at the official readme.txt

uploads-protector/uploads-protector.php Passed 13 tests

"Uploads Protector" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
35 characters long description:
Protect files in uploads directory.

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
Good job! No executable or dangerous file extensions detected134 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP24310134

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity10.50
▷ Minimum class complexity3.00
▷ Maximum class complexity18.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods531.25%
▷ Protected methods00.00%
▷ Private methods1168.75%
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