90% wp-media-files-name-rename

Code Review | Rename WP Media Files Name

WordPress plugin Rename WP Media Files Name scored 90% from 54 tests.

About plugin

  • Plugin page: wp-media-files-na...
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Apr 28, 2018
  • Latest release: Aug 27, 2023
  • Number of updates: 18
  • Update frequency: every 108.2 days
  • Top authors: sajjad67 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

400+ active / 4,035 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.02MB] [CPU: ▼10.04ms] Passed 4 tests

This is a short check of server-side resources used by Rename WP Media Files Name
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0332.40 ▼8.75
Dashboard /wp-admin3.33 ▲0.0344.09 ▼2.27
Posts /wp-admin/edit.php3.38 ▲0.0252.83 ▲4.08
Add New Post /wp-admin/post-new.php5.93 ▲0.0484.52 ▼30.68
Media Library /wp-admin/upload.php3.25 ▲0.0235.73 ▲1.53

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Rename WP Media Files Name
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲7213.21 ▼1.171.80 ▲0.0743.38 ▼1.95
Dashboard /wp-admin2,207 ▲165.81 ▲0.9198.14 ▼4.9440.22 ▼5.66
Posts /wp-admin/edit.php2,096 ▲72.07 ▲0.0741.35 ▲7.4334.44 ▲0.82
Add New Post /wp-admin/post-new.php1,522 ▲823.51 ▲5.87590.98 ▼68.5462.19 ▲9.99
Media Library /wp-admin/upload.php1,389 ▼24.24 ▲0.0296.20 ▼16.5841.50 ▼7.44

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: post, attachment, edit-post, edit-attachment, edit-media-file...

wp-media-files-name-rename/wp-media-files-rename.php 92% from 13 tests

The entry point to "Rename WP Media Files Name" version 1.0.6 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-media-files-name-rename.php" instead of "wp-media-files-rename.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin7,703 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
CSS11,019177,568
PHP15369108
JavaScript19027

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity4.00
▷ Minimum method complexity4.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods1100.00%
▷ Public methods1100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants2
▷ Global constants2100.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
There were not PNG files found in your plugin