84% wp-avatar

Code Review | WP Avatar

WordPress plugin WP Avatar scored84%from 54 tests.

About plugin

  • Plugin page: wp-avatar
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.2
  • WordPress version: 6.3.1
  • First release: Nov 15, 2017
  • Latest release: May 18, 2019
  • Number of updates: 27
  • Update frequency: every 20.5 days
  • Top authors: tomiup (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

700+ active /6,488 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▲107.70ms] Passed 4 tests

Analyzing server-side resources used by WP Avatar
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.14153.69 ▲107.69
Dashboard /wp-admin3.52 ▲0.22717.96 ▲661.02
Posts /wp-admin/edit.php3.49 ▲0.13161.10 ▲110.31
Add New Post /wp-admin/post-new.php5.95 ▲0.07208.07 ▲106.61
Media Library /wp-admin/upload.php3.28 ▲0.05146.30 ▲106.17

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Avatar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,994 ▲23314.89 ▲0.621.88 ▲0.1737.56 ▼6.59
Dashboard /wp-admin2,390 ▲2256.19 ▲0.52103.85 ▲5.5987.46 ▲44.76
Posts /wp-admin/edit.php2,283 ▲1803.34 ▲1.3655.98 ▲18.3874.71 ▲37.66
Add New Post /wp-admin/post-new.php1,545 ▲1723.54 ▲0.82595.93 ▼69.55164.83 ▲104.50
Media Library /wp-admin/upload.php1,417 ▲204.09 ▼0.0883.41 ▼16.0395.57 ▲47.91

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-avatar/inc/plugin-functions.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-avatar/inc/plugin-core.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-avatar/wp-avatar.php:25

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 issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: user avatar, wp avatar, avatar, profile, user

wp-avatar/wp-avatar.php Passed 13 tests

The main PHP script in "WP Avatar" version 1.0.0 is automatically included on every request by WordPress
101 characters long description:
Allows you to use any photos uploaded into your Media Library as an avatar instead of using Gravatar.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin749 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP4130203584
JavaScript1281185
CSS215080

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity23.00
▷ Minimum class complexity1.00
▷ Maximum class complexity77.00
Average method complexity4.79
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods29
▷ Static methods13.45%
▷ Public methods2793.10%
▷ Protected methods00.00%
▷ Private methods26.90%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin