84% simple-local-avatars

Code Review | Simple Local Avatars

WordPress plugin Simple Local Avatars scored84%from 54 tests.

About plugin

  • Plugin page: simple-local-avatars
  • Plugin version: 2.7.6
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4
  • WordPress version: 6.3.1
  • First release: Jan 17, 2011
  • Latest release: Nov 29, 2023
  • Number of updates: 58
  • Update frequency: every 81.0 days
  • Top authors: jakemgold (58.62%)10up (24.14%)10upbot (13.79%)helen (8.62%)

Code review

54 tests

User reviews

75 reviews

Install metrics

100,000+ active /1,485,384 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.03MB] [CPU: ▼3.33ms] Passed 4 tests

This is a short check of server-side resources used by Simple Local Avatars
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.24 ▼4.13
Dashboard /wp-admin3.35 ▲0.0048.96 ▼14.37
Posts /wp-admin/edit.php3.40 ▲0.0451.89 ▲6.70
Add New Post /wp-admin/post-new.php5.93 ▲0.0493.45 ▲6.57
Media Library /wp-admin/upload.php3.27 ▲0.0436.19 ▼1.38

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Simple Local Avatars
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.72 ▲0.321.58 ▼0.3038.11 ▼5.53
Dashboard /wp-admin2,195 ▲145.63 ▼0.0598.62 ▼14.5942.22 ▲0.30
Posts /wp-admin/edit.php2,103 ▲31.96 ▼0.0639.38 ▲2.1535.88 ▲0.23
Add New Post /wp-admin/post-new.php1,526 ▼023.16 ▲0.03607.18 ▼49.3351.07 ▼4.11
Media Library /wp-admin/upload.php1,403 ▲34.31 ▲0.11100.94 ▼10.9743.05 ▼8.38

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/simple-local-avatars/simple-local-avatars.php:65

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: users, profile, user photos, gravatar, avatar

simple-local-avatars/simple-local-avatars.php Passed 13 tests

Analyzing the main PHP file in "Simple Local Avatars" version 2.7.6
126 characters long description:
Adds an avatar upload field to user profiles. Generates requested sizes on demand, just like Gravatar! Simple and lightweight.

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
There were no executable files found in this plugin1,047 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP32355041,046
JavaScript1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity184.00
▷ Minimum class complexity184.00
▷ Maximum class complexity184.00
Average method complexity4.80
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods47
▷ Static methods24.26%
▷ Public methods4595.74%
▷ Protected methods00.00%
▷ Private methods24.26%
Functions7
▷ Named functions457.14%
▷ Anonymous functions342.86%
Constants4
▷ Global constants4100.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