78% one-user-avatar

Code Review | One User Avatar | User Profile Picture

WordPress plugin One User Avatar | User Profile Picture scored78%from 54 tests.

About plugin

  • Plugin page: one-user-avatar
  • Plugin version: 2.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: May 25, 2021
  • Latest release: Aug 17, 2023
  • Number of updates: 18
  • Update frequency: every 45.2 days
  • Top authors: onedesigns (100%)

Code review

54 tests

User reviews

39 reviews

Install metrics

70,000+ active /199,074 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
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.98ms] Passed 4 tests

Server-side resources used by One User Avatar | User Profile Picture
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1037.96 ▲3.30
Dashboard /wp-admin3.41 ▲0.0749.61 ▼13.17
Posts /wp-admin/edit.php3.46 ▲0.1150.28 ▲3.11
Add New Post /wp-admin/post-new.php6.00 ▲0.1178.61 ▼9.16
Media Library /wp-admin/upload.php3.34 ▲0.1136.53 ▲3.45
Settings /wp-admin/admin.php?page=one-user-avatar3.4342.27
Library /wp-admin/admin.php?page=wp-user-avatar-library3.4348.49

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 54 new files
Database: no new tables, 22 new options
New WordPress options
wp_user_avatar_disable_gravatar
wp_user_avatar_force_file_uploader
wp_user_avatar_resize_upload
wp_user_avatar_resize_crop
wp_user_avatar_upload_size_limit
wp_user_avatar_edit_avatar
avatar_default_wp_user_avatar
can_compress_scripts
widget_recent-comments
wp_user_avatar_allow_upload
...

Browser metrics Passed 4 tests

One User Avatar | User Profile Picture: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7314.22 ▼0.131.71 ▲0.1140.46 ▼4.54
Dashboard /wp-admin2,238 ▲605.74 ▲0.1683.88 ▼16.9881.32 ▲37.59
Posts /wp-admin/edit.php2,146 ▲462.00 ▼0.0135.64 ▼0.4032.91 ▼1.82
Add New Post /wp-admin/post-new.php1,702 ▲17622.19 ▼0.80658.79 ▲49.0656.99 ▲6.73
Media Library /wp-admin/upload.php1,441 ▲384.20 ▼0.0096.00 ▲1.5777.06 ▲31.41
Settings /wp-admin/admin.php?page=one-user-avatar1,3253.1244.8964.96
Library /wp-admin/admin.php?page=wp-user-avatar-library1,3063.3139.9870.01

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • wp_user_avatar_disable_um_avatars
    • widget_recent-comments
    • widget_wp_user_avatar_profile
    • wp_user_avatar_force_file_uploader
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 items
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/one-user-avatar/uninstall.php
    • > /wp-content/plugins/one-user-avatar/one-user-avatar.php
    • > /wp-content/plugins/one-user-avatar/includes/wpua-tinymce-window.php
  • 16× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/admin.php' (include_path='.:/usr/share/php') in wp-content/plugins/one-user-avatar/includes/wpua-media-page.php on line 43
    • > PHP Fatal error
      Uncaught Error: Class 'One_User_Avatar' not found in wp-content/plugins/one-user-avatar/includes/class-wp-user-avatar-setup.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/one-user-avatar/includes/class-wp-user-avatar-functions.php:924
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/one-user-avatar/includes/class-wp-user-avatar-list-table.php:17
    • > PHP Warning
      require_once(ABSPATHwp-admin/admin.php): failed to open stream: No such file or directory in wp-content/plugins/one-user-avatar/includes/wpua-media-page.php on line 43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/one-user-avatar/includes/class-wp-user-avatar.php:695
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/one-user-avatar/includes/wpua-tinymce.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/one-user-avatar/includes/class-wp-user-avatar-subscriber.php:84
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/one-user-avatar/includes/class-wp-user-avatar-admin.php:595
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/one-user-avatar/includes/class-wp-user-avatar-widget.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% 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
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
You can take inspiration from this readme.txt

one-user-avatar/one-user-avatar.php Passed 13 tests

The principal PHP file in "One User Avatar | User Profile Picture" v. 2.4.0 is loaded by WordPress automatically on each request
133 characters long description:
Use any image from your WordPress Media Library as a custom user avatar. Add your own Default Avatar. Fork of WP User Avatar v2.2.16.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin6,125 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP197841,6932,720
PO File99331,2712,310
Markdown12710661
JavaScript58257305
CSS22514129

PHP code Passed 2 tests

An short overview of 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.40
Average class complexity37.55
▷ Minimum class complexity3.00
▷ Maximum class complexity120.00
Average method complexity5.17
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods97
▷ Static methods88.25%
▷ Public methods9193.81%
▷ Protected methods00.00%
▷ Private methods66.19%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/wpua-96x96.png2.34KB2.09KB▼ 10.76%
assets/images/wpua.png11.74KB6.40KB▼ 45.50%
assets/images/wpua-150x150.png3.45KB2.69KB▼ 21.95%
assets/images/wpua-20x20.png0.55KB0.67KB0.00%
assets/images/wpua-300x300.png7.29KB4.56KB▼ 37.46%