84% auto-rename-media-on-upload

Code Review | Auto Rename Media On Upload

WordPress plugin Auto Rename Media On Upload scored84%from 54 tests.

About plugin

  • Plugin page: auto-rename-media...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.1.1
  • WordPress version: 6.3.1
  • First release: Oct 29, 2019
  • Latest release: Mar 14, 2023
  • Number of updates: 15
  • Update frequency: every 82.1 days
  • Top authors: jsherk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,885 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.11ms] Passed 4 tests

An overview of server-side resources used by Auto Rename Media On Upload
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.59 ▼0.04
Dashboard /wp-admin3.39 ▲0.0953.49 ▲2.46
Posts /wp-admin/edit.php3.44 ▲0.0948.11 ▲0.04
Add New Post /wp-admin/post-new.php5.97 ▲0.0983.35 ▼14.88
Media Library /wp-admin/upload.php3.32 ▲0.0936.81 ▲2.70
Auto Rename Media On Upload /wp-admin/options-general.php?page=auto-rename-media-on-upload3.2733.78

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Auto Rename Media On Upload
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.35 ▼0.181.86 ▼0.0943.40 ▲2.62
Dashboard /wp-admin2,196 ▲195.66 ▲0.0693.20 ▲7.5542.21 ▼2.47
Posts /wp-admin/edit.php2,104 ▲42.00 ▲0.0533.85 ▼3.8434.32 ▼1.34
Add New Post /wp-admin/post-new.php1,529 ▲323.62 ▲0.39656.91 ▼38.5756.30 ▲3.02
Media Library /wp-admin/upload.php1,407 ▲104.20 ▲0.0792.14 ▼8.4440.69 ▼2.92
Auto Rename Media On Upload /wp-admin/options-general.php?page=auto-rename-media-on-upload1,0931.9626.2432.92

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 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • armoup_options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 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 50% from 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
Please take a closer look at 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/auto-rename-media-on-upload/auto-rename-media-on-upload.php:47

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: There are too many tags (17 tag instead of maximum 10)
The official readme.txt is a good inspiration

auto-rename-media-on-upload/auto-rename-media-on-upload.php Passed 13 tests

The entry point to "Auto Rename Media On Upload" version 1.1.0 is a PHP file that has certain tags in its header comment area
123 characters long description:
Automatically renames any media files you upload by adding a prefix to the beginning of the filename based on the filetype.

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
Good job! No executable or dangerous file extensions detected601 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP115523601

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of 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.21
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dbut-small.png5.33KB2.67KB▼ 49.92%
stars-small.png1.50KB1.51KB0.00%
dbut.png13.46KB6.06KB▼ 55.01%