84% leira-letter-avatar

Code Review | Leira Letter Avatar

WordPress plugin Leira Letter Avatar scored84%from 54 tests.

About plugin

  • Plugin page: leira-letter-avatar
  • Plugin version: 1.3.7
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0
  • WordPress version: 6.3.1
  • First release: May 18, 2020
  • Latest release: Aug 28, 2022
  • Number of updates: 37
  • Update frequency: every 22.6 days
  • Top authors: arielhr1987 (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

3,000+ active /16,153 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▼2.61ms] Passed 4 tests

This is a short check of server-side resources used by Leira Letter Avatar
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1742.50 ▼4.82
Dashboard /wp-admin3.67 ▲0.3755.98 ▲3.31
Posts /wp-admin/edit.php3.72 ▲0.3754.59 ▲0.80
Add New Post /wp-admin/post-new.php6.19 ▲0.3089.76 ▼9.71
Media Library /wp-admin/upload.php3.53 ▲0.3042.90 ▲5.57
Letter Avatar /wp-admin/options-general.php?page=leira_letter_avatar3.5242.93

Server storage [IO: ▲34.18MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
Please fix the following
  • Try to limit filesystem usage to 25MB (currently using 34.18MB)
Filesystem: 51 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Leira Letter Avatar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲4914.22 ▼0.131.76 ▼0.2643.63 ▼0.65
Dashboard /wp-admin2,201 ▲215.62 ▲0.0196.47 ▼4.1743.18 ▼0.16
Posts /wp-admin/edit.php2,106 ▲62.03 ▲0.0332.45 ▼3.0638.71 ▼2.28
Add New Post /wp-admin/post-new.php1,533 ▲723.23 ▲0.24706.29 ▲71.0252.51 ▲0.17
Media Library /wp-admin/upload.php1,403 ▲34.16 ▲0.1099.87 ▼7.4847.15 ▲3.36
Letter Avatar /wp-admin/options-general.php?page=leira_letter_avatar1,2932.4360.0034.71

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

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
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
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/leira-letter-avatar/public/partials/leira-letter-avatar-public-display.php
    • > /wp-content/plugins/leira-letter-avatar/admin/partials/leira-letter-avatar-admin-display.php

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

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: image, frontend, admin, letter, avatar...

leira-letter-avatar/leira-letter-avatar.php Passed 13 tests

Analyzing the main PHP file in "Leira Letter Avatar" version 1.3.7
61 characters long description:
Enables custom avatars for users base on its initial letters.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin1,429 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP143181,1801,211
PO File13946117
Sass215154
JavaScript286833
CSS221214

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity21.00
▷ Minimum class complexity1.00
▷ Maximum class complexity105.00
Average method complexity3.71
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods68
▷ Static methods34.41%
▷ Public methods6189.71%
▷ Protected methods22.94%
▷ Private methods57.35%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin