74% local-avatars-by-nocksoft

Code Review | Local Avatars by Nocksoft

WordPress plugin Local Avatars by Nocksoft scored74%from 54 tests.

About plugin

  • Plugin page: local-avatars-by-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.0
  • WordPress version: 6.3.1
  • First release: Sep 6, 2022
  • Latest release: Sep 6, 2022
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: nocksoft (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /298 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.73ms] Passed 4 tests

Server-side resources used by Local Avatars by Nocksoft
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.48 ▼13.23
Dashboard /wp-admin3.38 ▲0.0854.27 ▼0.21
Posts /wp-admin/edit.php3.50 ▲0.1559.46 ▲4.73
Add New Post /wp-admin/post-new.php5.97 ▲0.0888.30 ▼10.20
Media Library /wp-admin/upload.php3.29 ▲0.0640.68 ▲6.02
Local Avatars /wp-admin/options-general.php?page=nstla3.2939.93

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 14 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
nstla_setting_localavatar_default
widget_recent-posts
can_compress_scripts
nstla_setting_redirectgravatar_all
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Local Avatars by Nocksoft
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,932 ▲17114.43 ▲0.151.84 ▲0.2443.81 ▼0.40
Dashboard /wp-admin2,341 ▲1616.19 ▲0.59119.69 ▲30.4343.09 ▲1.88
Posts /wp-admin/edit.php2,269 ▲1693.33 ▲1.3753.31 ▲17.5637.55 ▲1.19
Add New Post /wp-admin/post-new.php1,531 ▲323.21 ▲0.28625.13 ▼12.0536.87 ▼21.39
Media Library /wp-admin/upload.php1,406 ▲124.09 ▼0.0379.71 ▼20.3842.29 ▼0.57
Local Avatars /wp-admin/options-general.php?page=nstla1,0093.0839.2462.86

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Incomplete uninstall procedure, leaving 14 files (0.15MB) in the plugin directory
    • (new file) js/imagepicker.js
    • (new file) php/settings-global.php
    • (new file) php/settings-defaults.php
    • (new file) languages/local-avatars-by-nocksoft-de_DE.po
    • (new file) img/local-avatar-pingu.png
    • (new file) languages/local-avatars-by-nocksoft-de_DE.mo
    • (new file) img/local-avatar-mystery.png
    • (new file) local-avatars-by-nocksoft.php
    • (new file) php/avatars.php
    • (new file) LICENSE
    • ...
  • Zombie WordPress options were found after uninstall: 8 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • nstla_setting_redirectgravatar_all
    • nstla_setting_localavatar_default
    • widget_recent-comments
    • widget_theysaidso_widget
    • 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
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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/local-avatars-by-nocksoft/php/avatars.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/local-avatars-by-nocksoft/php/settings-global.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/local-avatars-by-nocksoft/php/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/local-avatars-by-nocksoft/local-avatars-by-nocksoft.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/local-avatars-by-nocksoft/php/settings-user.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
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
3 plugin tags: avatar, gravatar, local avatar

local-avatars-by-nocksoft/local-avatars-by-nocksoft.php Passed 13 tests

The principal PHP file in "Local Avatars by Nocksoft" v. 1.0.0 is loaded by WordPress automatically on each request
31 characters long description:
Adds support for local avatars.

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 detected312 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP77436247
JavaScript19037
PO File1131428

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions1493.33%
▷ Anonymous functions16.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/local-avatar-pingu.png97.43KB34.96KB▼ 64.12%
img/local-avatar-mystery.png18.56KB9.16KB▼ 50.62%