84% simple-user-avatar

Code Review | Simple User Avatar

WordPress plugin Simple User Avatar scored84%from 54 tests.

About plugin

  • Plugin page: simple-user-avatar
  • Plugin version: 4.3
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 7, 2017
  • Latest release: Oct 12, 2023
  • Number of updates: 55
  • Update frequency: every 43.7 days
  • Top authors: matteomanna (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

10,000+ active /130,353 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.33ms] Passed 4 tests

This is a short check of server-side resources used by Simple User Avatar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.87 ▼1.62
Dashboard /wp-admin3.36 ▲0.0646.47 ▼5.44
Posts /wp-admin/edit.php3.41 ▲0.0546.82 ▲0.50
Add New Post /wp-admin/post-new.php5.94 ▲0.0590.82 ▼4.93
Media Library /wp-admin/upload.php3.28 ▲0.0535.67 ▼1.33

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple User Avatar
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.10 ▼0.531.60 ▼0.2037.81 ▼0.84
Dashboard /wp-admin2,198 ▲265.63 ▼0.2390.56 ▼8.4039.16 ▼4.56
Posts /wp-admin/edit.php2,097 ▼01.94 ▼0.0040.59 ▲6.4035.70 ▼0.05
Add New Post /wp-admin/post-new.php1,535 ▲718.45 ▼4.53603.52 ▼66.2962.76 ▼17.64
Media Library /wp-admin/upload.php1,400 ▼04.15 ▼0.0794.54 ▲0.6343.23 ▲1.69

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

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
Even though no errors were found, 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
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-user-avatar/public/class-sua-public.php:101
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-user-avatar/admin/class-sua-admin.php:335

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
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
6 plugin tags: gravatar, avatar, picture, media library, theme...

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

The entry point to "Simple User Avatar" version 4.3 is a PHP file that has certain tags in its header comment area
55 characters long description:
Add a user avatar using images from your Media Library.

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
No dangerous file extensions were detected644 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
Markdown2890332
PHP4119143227
JavaScript1272646
Sass28038
CSS1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity17.00
▷ Minimum class complexity15.00
▷ Maximum class complexity19.00
Average method complexity3.46
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods215.38%
▷ Public methods1292.31%
▷ Protected methods00.00%
▷ Private methods17.69%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
3 compressed PNG files occupy 0.16MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png50.92KB53.20KB0.00%
screenshot-2.png73.24KB76.25KB0.00%
screenshot-3.png39.61KB40.69KB0.00%