83% add-prefix-on-file-upload

Code Review | Add Prefix on File Upload

WordPress plugin Add Prefix on File Upload scored 83% from 54 tests.

About plugin

  • Plugin page: add-prefix-on-fil...
  • Plugin version: 0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Feb 6, 2023
  • Latest release: Feb 6, 2023
  • Number of updates: 4
  • Update frequency: every 1.3 days
  • Top authors: drfdesignerstudio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 144 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: ▼2.93ms] Passed 4 tests

Server-side resources used by Add Prefix on File Upload
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.15 ▼2.72
Dashboard /wp-admin3.31 ▲0.0154.63 ▲4.94
Posts /wp-admin/edit.php3.36 ▲0.0151.62 ▼0.36
Add New Post /wp-admin/post-new.php5.89 ▲0.0197.61 ▼2.42
Media Library /wp-admin/upload.php3.24 ▲0.0136.91 ▼6.23
Add Prefix on File Upload /wp-admin/options-general.php?page=add-prefix-file-upload3.2037.01

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Add Prefix on File Upload
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲1513.22 ▼1.611.83 ▲0.1442.16 ▼7.88
Dashboard /wp-admin2,210 ▲15.87 ▼0.04107.24 ▲10.5538.57 ▲0.42
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0440.43 ▲5.9435.81 ▲0.16
Add New Post /wp-admin/post-new.php1,545 ▲13418.28 ▲0.46624.53 ▼142.2556.46 ▲5.59
Media Library /wp-admin/upload.php1,392 ▲104.23 ▲0.0296.94 ▼5.1844.91 ▲2.78
Add Prefix on File Upload /wp-admin/options-general.php?page=add-prefix-file-upload7762.0324.9725.58

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-prefix-on-file-upload/add-prefix-file-upload.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Real example1), #2 (Real example2)
The official readme.txt might help

add-prefix-on-file-upload/add-prefix-file-upload.php 85% from 13 tests

The main PHP script in "Add Prefix on File Upload" version 0.5 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("add-prefix-on-file-upload.php" instead of "add-prefix-file-upload.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin48 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1142848

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.04
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%
Functions4
▷ Named functions4100.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
No PNG files were detected