78% md5-media-renamer

Code Review | MD5 Media Renamer

WordPress plugin MD5 Media Renamer scored 78% from 54 tests.

About plugin

  • Plugin page: md5-media-renamer
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.6
  • WordPress version: 6.3.1
  • First release: Aug 14, 2013
  • Latest release: Aug 23, 2013
  • Number of updates: 30
  • Update frequency: every 1.3 days
  • Top authors: natexim (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active / 4,299 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.86ms] Passed 4 tests

An overview of server-side resources used by MD5 Media Renamer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.23 ▼0.41
Dashboard /wp-admin3.32 ▲0.0250.70 ▲0.69
Posts /wp-admin/edit.php3.37 ▲0.0248.05 ▼1.05
Add New Post /wp-admin/post-new.php5.90 ▲0.0286.30 ▼10.67
Media Library /wp-admin/upload.php3.24 ▲0.0234.74 ▲1.00

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for MD5 Media Renamer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.50 ▲0.121.74 ▼0.2043.40 ▼3.66
Dashboard /wp-admin2,206 ▲214.87 ▼1.04108.38 ▲5.1142.85 ▼2.73
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0034.37 ▼1.7033.36 ▼0.63
Add New Post /wp-admin/post-new.php1,542 ▲918.56 ▼4.62658.70 ▼43.7251.22 ▼6.70
Media Library /wp-admin/upload.php1,382 ▼34.24 ▲0.0299.56 ▼11.1441.94 ▼4.57

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/md5-media-renamer/md5-media-renamer.php
  • 38× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ML79_PLUGIN_AUTHOR_URL - assumed 'ML79_PLUGIN_AUTHOR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/md5-media-renamer/notices/notice-activate.php on line 22
    • > PHP Warning
      Use of undefined constant ML79_PLUGIN_URL - assumed 'ML79_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/md5-media-renamer/notices/notice-activate.php on line 125
    • > PHP Warning
      Use of undefined constant ML79_PLUGIN_URL - assumed 'ML79_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/md5-media-renamer/notices/notice-activate.php on line 111
    • > PHP Warning
      Use of undefined constant ML79_PLUGIN_URL - assumed 'ML79_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/md5-media-renamer/notices/notice-activate.php on line 90
    • > PHP Warning
      Use of undefined constant ML79_PLUGIN_URL - assumed 'ML79_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/md5-media-renamer/notices/notice-activate.php on line 122
    • > PHP Warning
      Use of undefined constant ML79_PLUGIN_URL - assumed 'ML79_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/md5-media-renamer/notices/notice-activate.php on line 99
    • > PHP Warning
      Use of undefined constant ML79_PLUGIN_URL - assumed 'ML79_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/md5-media-renamer/notices/notice-activate.php on line 96
    • > PHP Warning
      Use of undefined constant ML79_PLUGIN_URL - assumed 'ML79_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/md5-media-renamer/notices/notice-activate.php on line 85
    • > PHP Warning
      Use of undefined constant ML79_PLUGIN_URL - assumed 'ML79_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/md5-media-renamer/notices/notice-activate.php on line 47
    • > PHP Warning
      Use of undefined constant ML79_PLUGIN_URL - assumed 'ML79_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/md5-media-renamer/notices/notice-activate.php on line 114

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, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Please fix this invalid url: ""
The official readme.txt is a good inspiration

md5-media-renamer/md5-media-renamer.php Passed 13 tests

"MD5 Media Renamer" version 1.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
134 characters long description:
Sanitize and rename automatically media files during upload using PHP time() as prefix and the file name encrypted in MD5() as suffix.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected202 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP22353202

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.59
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%
Constants9
▷ Global constants9100.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
13 PNG files occupy 0.20MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
cpanel/images/notices/logo.png13.63KB6.03KB▼ 55.74%
cpanel/images/notices/tumblr.png4.37KB1.59KB▼ 63.70%
cpanel/images/notices/googleplus.png2.71KB1.70KB▼ 37.16%
cpanel/images/notices/stumble.png3.09KB1.72KB▼ 44.34%
cpanel/images/notices/linkedin.png2.35KB1.55KB▼ 34.15%