77% user-avatar-reloaded

Code Review | User Avatar - Reloaded

WordPress plugin User Avatar - Reloaded scored77%from 54 tests.

About plugin

  • Plugin page: user-avatar-reloaded
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.1
  • WordPress version: 6.3.1
  • First release: May 28, 2021
  • Latest release: Sep 14, 2023
  • Number of updates: 27
  • Update frequency: every 31.2 days
  • Top authors: saadiqbal (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

800+ active /4,862 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼9.18ms] Passed 4 tests

This is a short check of server-side resources used by User Avatar - Reloaded
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1337.21 ▼6.19
Dashboard /wp-admin3.48 ▲0.1746.99 ▼2.51
Posts /wp-admin/edit.php3.57 ▲0.2148.60 ▼17.11
Add New Post /wp-admin/post-new.php6.16 ▲0.2881.83 ▼9.74
Media Library /wp-admin/upload.php3.41 ▲0.1832.00 ▼3.66
Settings /wp-admin/admin.php?page=wp-user-avatar3.4539.99
Library /wp-admin/admin.php?page=wp-user-avatar-library3.5735.90

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 37 new files
Database: no new tables, 20 new options
New WordPress options
wp_user_avatar_resize_crop
avatar_default_wp_user_avatar
wp_user_avatar_media_updated
wp_user_avatar_upload_size_limit
wp_user_avatar_resize_w
wp_user_avatar_edit_avatar
wp_user_avatar_resize_h
wp_user_avatar_users_updated
can_compress_scripts
wp_user_avatar_resize_upload
...

Browser metrics Passed 4 tests

User Avatar - Reloaded: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,865 ▲13013.26 ▼1.321.71 ▼0.2438.50 ▼9.51
Dashboard /wp-admin2,281 ▲935.82 ▲0.93108.35 ▼7.7969.06 ▲25.11
Posts /wp-admin/edit.php2,115 ▲261.99 ▼0.0239.73 ▲0.1635.49 ▲2.80
Add New Post /wp-admin/post-new.php1,550 ▲1718.38 ▼4.95702.59 ▲20.8759.72 ▲6.89
Media Library /wp-admin/upload.php1,417 ▲324.21 ▲0.0496.33 ▼10.4569.75 ▲24.80
Settings /wp-admin/admin.php?page=wp-user-avatar1,3433.4450.2564.11
Library /wp-admin/admin.php?page=wp-user-avatar-library1,1632.0130.5342.00

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_wp_user_avatar_profile
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 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
Please fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/user-avatar-reloaded/wp-user-avatar-reloaded.php
    • > /wp-content/plugins/user-avatar-reloaded/uninstall.php
    • > /wp-content/plugins/user-avatar-reloaded/includes/tinymce/window.php
  • 16× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-avatar-reloaded/includes/class-wp-user-avatar-update.php:116
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-avatar-reloaded/includes/wpua-tinymce.php:22
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/admin.php' (include_path='.:/usr/share/php') in wp-content/plugins/user-avatar-reloaded/includes/wpua-media-page.php on line 36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-avatar-reloaded/includes/class-wp-user-avatar.php:494
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-avatar-reloaded/includes/class-wp-user-avatar-shortcode.php:264
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/user-avatar-reloaded/includes/class-wp-user-avatar-widget.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-avatar-reloaded/includes/class-wp-user-avatar-functions.php:733
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-avatar-reloaded/includes/mo-notice.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-avatar-reloaded/includes/class-wp-user-avatar-admin.php:412
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-avatar-reloaded/includes/wpua-functions.php:107

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 86% 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
Please fix the following attributes:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
You can take inspiration from this readme.txt

user-avatar-reloaded/wp-user-avatar-reloaded.php 77% from 13 tests

The main PHP script in "User Avatar - Reloaded" version 1.2.2 is automatically included on every request by WordPress
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("user-avatar-reloaded.php" instead of "wp-user-avatar-reloaded.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 211 characters long)

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
Success! There were no dangerous files found in this plugin3,771 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP182991,4552,274
CSS246461,062
PO File196113226
JavaScript4214209
HTML1020

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity35.18
▷ Minimum class complexity3.00
▷ Maximum class complexity115.00
Average method complexity4.88
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods96
▷ Static methods77.29%
▷ Public methods9093.75%
▷ Protected methods00.00%
▷ Private methods66.25%
Functions25
▷ Named functions2288.00%
▷ Anonymous functions312.00%
Constants7
▷ Global constants7100.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
9 PNG files occupy 0.10MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/wp-user-avatar-banner.png40.19KB16.38KB▼ 59.25%
images/wpua.png11.74KB6.40KB▼ 45.50%
images/wpua-icon.png1.27KB0.54KB▼ 57.32%
images/wpua-32x32.png1.56KB0.67KB▼ 56.94%
images/wpua-20x20.png0.55KB0.67KB0.00%