73% random-avatars-of-user

Code Review | Customize Random Avatar

WordPress plugin Customize Random Avatar scored73%from 54 tests.

About plugin

  • Plugin page: random-avatars-of...
  • Plugin version: 3.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.5
  • WordPress version: 6.3.1
  • First release: Feb 2, 2015
  • Latest release: Sep 9, 2020
  • Number of updates: 22
  • Update frequency: every 93.0 days
  • Top authors: biztechc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,893 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.17MB] [CPU: ▼12.92ms] Passed 4 tests

Analyzing server-side resources used by Customize Random Avatar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.39 ▼0.0729.50 ▼8.26
Dashboard /wp-admin3.31 ▼0.0348.26 ▼10.78
Posts /wp-admin/edit.php3.25 ▼0.1135.72 ▼7.13
Add New Post /wp-admin/post-new.php5.44 ▼0.4466.46 ▼25.51
Media Library /wp-admin/upload.php3.18 ▼0.0430.76 ▼7.09

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

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

Browser metrics Passed 4 tests

Customize Random Avatar: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7414.21 ▼0.272.18 ▲0.6542.73 ▲3.71
Dashboard /wp-admin2,197 ▲205.65 ▼0.0187.66 ▲0.1641.16 ▼0.67
Posts /wp-admin/edit.php2,099 ▼12.02 ▲0.0233.21 ▼5.5434.94 ▲0.22
Add New Post /wp-admin/post-new.php1,530 ▲423.08 ▼0.19659.32 ▼20.1063.48 ▲1.22
Media Library /wp-admin/upload.php1,405 ▲54.15 ▼0.0998.53 ▼6.6444.67 ▼1.10

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/random-avatars-of-user/display-user-avatar.php+496
    Undefined variable: current_blog_id
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/random-avatars-of-user/display-user-avatar.php:18

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 90% from 29 tests

readme.txt 94% 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
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (screenshot-1.png), #2 (screenshot-2.png)
Please take inspiration from this readme.txt

random-avatars-of-user/display-user-avatar.php 85% from 13 tests

The entry point to "Customize Random Avatar" version 3.0.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("random-avatars-of-user.php" instead of "display-user-avatar.php")
  • Description: Make the plugin description longer than 10 characters (currently 0 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected544 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2116122540
CSS1004

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
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%
Functions14
▷ Named functions14100.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
2 PNG files occupy 0.14MB with 0.08MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png102.92KB32.22KB▼ 68.70%
screenshot-2.png36.20KB16.56KB▼ 54.24%