83% wp-upload-rename

Code Review | wp_upload_rename

WordPress plugin wp_upload_rename scored83%from 54 tests.

About plugin

  • Plugin page: wp-upload-rename
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.1.1
  • WordPress version: 6.3.1
  • First release: Feb 12, 2014
  • Latest release: May 5, 2019
  • Number of updates: 18
  • Update frequency: every 106.0 days
  • Top authors: zhounan0120 (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /3,682 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.16ms] Passed 4 tests

Server-side resources used by wp_upload_rename
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0336.95 ▼3.15
Dashboard /wp-admin3.34 ▲0.0344.68 ▼3.49
Posts /wp-admin/edit.php3.39 ▲0.0344.20 ▼1.74
Add New Post /wp-admin/post-new.php5.92 ▲0.0383.08 ▼12.27
Media Library /wp-admin/upload.php3.26 ▲0.0334.31 ▼1.64
Upload Rename /wp-admin/options-general.php?page=wp_upload_rename3.2532.01

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for wp_upload_rename
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.35 ▼0.061.55 ▼0.2240.88 ▼3.02
Dashboard /wp-admin2,202 ▲225.61 ▼0.0786.16 ▲2.0139.65 ▼2.42
Posts /wp-admin/edit.php2,104 ▲42.01 ▼0.0233.28 ▼2.7234.60 ▲2.38
Add New Post /wp-admin/post-new.php1,529 ▲123.45 ▲0.27682.02 ▼8.0959.38 ▲1.17
Media Library /wp-admin/upload.php1,401 ▼24.21 ▲0.0194.91 ▼4.3342.60 ▼4.27
Upload Rename /wp-admin/options-general.php?page=wp_upload_rename9961.9922.7325.75

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% 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 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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-upload-rename/options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-upload-rename/wp_upload_rename.php:222

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)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Plugin Name: Please specify the plugin name on the first line ( === wp-upload-rename === )
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

wp-upload-rename/wp_upload_rename.php 92% from 13 tests

The entry point to "wp_upload_rename" version 1.2 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-upload-rename.php" instead of "wp_upload_rename.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected213 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP26640213

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity25.00
▷ Minimum class complexity25.00
▷ Maximum class complexity25.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods888.89%
▷ Protected methods111.11%
▷ 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

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin