84% file-media-renamer

Code Review | File Media Renamer

WordPress plugin File Media Renamer scored84%from 54 tests.

About plugin

  • Plugin page: file-media-renamer
  • Plugin version: 1.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.0.2
  • WordPress version: 6.3.1
  • First release: Jan 6, 2020
  • Latest release: Oct 18, 2022
  • Number of updates: 34
  • Update frequency: every 30.4 days
  • Top authors: bradleydalina (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

2,000+ active /10,650 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼5.90ms] Passed 4 tests

An overview of server-side resources used by File Media Renamer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2440.07 ▼2.25
Dashboard /wp-admin3.41 ▲0.0743.64 ▼14.75
Posts /wp-admin/edit.php3.52 ▲0.1746.13 ▼1.17
Add New Post /wp-admin/post-new.php5.99 ▲0.1189.79 ▼5.41
Media Library /wp-admin/upload.php3.34 ▲0.1134.78 ▲1.40

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

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

Browser metrics Passed 4 tests

File Media Renamer: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.21 ▼1.095.15 ▲3.2442.04 ▼5.90
Dashboard /wp-admin2,206 ▲184.90 ▼0.02108.15 ▲0.4042.71 ▼2.67
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0140.46 ▲4.4934.83 ▼1.39
Add New Post /wp-admin/post-new.php1,542 ▲1118.37 ▼4.56600.12 ▼89.3657.98 ▲0.58
Media Library /wp-admin/upload.php1,386 ▼24.23 ▼0.0499.02 ▼5.5843.74 ▼5.26

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/file-media-renamer/file-media-renamer.php
    • > /wp-content/plugins/file-media-renamer/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed: The official readme.txt is a good inspiration

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

The entry point to "File Media Renamer" version 1.3 is a PHP file that has certain tags in its header comment area
111 characters long description:
This plugin allows you rename uploaded files available in wordpress media and change the postname or slug name.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin517 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP248118517

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity44.00
▷ Minimum class complexity44.00
▷ Maximum class complexity44.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods844.44%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
failed.png2.41KB1.38KB▼ 42.94%
success.png2.43KB1.37KB▼ 43.53%