10% add-local-avatar

Code Review | Add Local Avatar

WordPress plugin Add Local Avatar scored 10% from 54 tests.

About plugin

  • Plugin page: add-local-avatar
  • Plugin version: 12.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-3.8
  • WordPress version: 5.8.1
  • First release: Apr 3, 2008
  • Latest release: Dec 16, 2013
  • Number of updates: 91
  • Update frequency: every 22.9 days
  • Top authors: peterwsterling (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

3,000+ active / 341,967 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/add-local-avatar/avatars.php+1410
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.35MB] [CPU: ▼197.09ms] Passed 4 tests

Analyzing server-side resources used by Add Local Avatar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼0.556.83 ▼28.55
Dashboard /wp-admin2.30 ▼0.756.56 ▼50.72
Posts /wp-admin/edit.php2.30 ▼0.806.92 ▼46.34
Add New Post /wp-admin/post-new.php2.30 ▼3.137.50 ▼662.75
Media Library /wp-admin/upload.php2.30 ▼0.706.78 ▼28.09

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 27 new files
Database: no new tables, 1 new option
New WordPress options
plugin_avatars

Browser metrics Passed 4 tests

Checking browser requirements for Add Local Avatar
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,875 ▲28116.82 ▲1.2216.34 ▲7.8046.51 ▲1.43
Dashboard /wp-admin2,966 ▲356.09 ▲0.14140.22 ▼60.58135.77 ▲13.66
Posts /wp-admin/edit.php2,770 ▲312.71 ▼0.0062.85 ▼19.1886.06 ▼14.54
Add New Post /wp-admin/post-new.php1,597 ▼1818.75 ▼2.28396.67 ▲103.24103.98 ▼3.74
Media Library /wp-admin/upload.php1,762 ▼455.03 ▲0.01141.20 ▼8.98137.33 ▲19.93
Avatars /wp-admin/avatars.php260.900.0611.67

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/add-local-avatar/avatars.php+1410
    Array and string offset access syntax with curly braces is deprecated
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • plugin_avatars

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% 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 take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/add-local-avatar/avatars.php:52

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/avatars.php
    • > Network (severe)
    wp-admin/avatars.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (An example of the main avatars administration page. Manage users global and local avatars etc.), #2 (The avatars options configuration section of the main avatars administration page.), #3 (The WordPress profile page shows the new floating section showing the current avatar. Click manage to change.), #4 (Avatar Management popup. Allowing upload of local avatars, with crop option, and setting of a Twitter ID.), #5 (Sample avatars: local, global, retro, gravatar, blank, wavatar, identicon, monsters, twitter - the lot!), #6 (Example of the optional simple sidebar widget allowing users to manage their own avatar. Available from the plugin's homepage.)
Please take inspiration from this readme.txt

add-local-avatar/avatars.php 92% from 13 tests

The primary PHP file in "Add Local Avatar" version 12.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("add-local-avatar.php" instead of "avatars.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected3,064 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PO File88001,3251,710
PHP22451631,305
CSS28049

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity90.00
▷ Minimum class complexity19.00
▷ Maximum class complexity161.00
Average method complexity6.93
▷ Minimum method complexity1.00
▷ Maximum method complexity62.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods2893.33%
▷ Protected methods00.00%
▷ Private methods26.67%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants16100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin