94% rename-media

Code Review | Rename Media

WordPress plugin Rename Media scored 94% from 54 tests.

About plugin

  • Plugin page: rename-media
  • Plugin version: 0.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-4.1
  • WordPress version: 5.8.1
  • First release: Dec 3, 2010
  • Latest release: Nov 21, 2014
  • Number of updates: 13
  • Update frequency: every 111.5 days
  • Top authors: johnny5 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 10,319 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

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

Analyzing server-side resources used by Rename Media
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1339.79 ▲13.75
Dashboard /wp-admin3.07 ▲0.0149.20 ▲6.85
Posts /wp-admin/edit.php3.12 ▲0.0149.09 ▲0.97
Add New Post /wp-admin/post-new.php5.43 ▼0.0193.71 ▼558.29
Media Library /wp-admin/upload.php3.01 ▲0.0132.86 ▲4.14

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Rename Media
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8316.25 ▲0.708.50 ▲0.7746.67 ▲0.75
Dashboard /wp-admin2,967 ▲335.88 ▼0.07139.44 ▼10.85119.38 ▼4.07
Posts /wp-admin/edit.php2,736 ▼32.69 ▲0.0166.08 ▼15.1388.04 ▼7.08
Add New Post /wp-admin/post-new.php1,500 ▼18318.54 ▼0.26384.96 ▲0.80118.09 ▲3.87
Media Library /wp-admin/upload.php1,804 ▼65.00 ▼0.03149.51 ▲0.11121.81 ▲6.98

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

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
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/rename-media/rename-media.php:71

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Add an image for screenshot #1 (Changing the media title will result in the filename also changing)
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === rename-media === )
The official readme.txt is a good inspiration

rename-media/rename-media.php Passed 13 tests

"Rename Media" version 0.1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
75 characters long description:
Rename underlying media files from the WordPress media management interface

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
Success! There were no dangerous files found in this plugin41 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1201338
Markdown1103

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
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%
Functions1
▷ Named functions1100.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
1 PNG file occupies 0.10MB with 0.07MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png97.95KB25.13KB▼ 74.34%