72% zipline-smart-avatars

Code Review | Smart Avatars

WordPress plugin Smart Avatars scored72%from 54 tests.

About plugin

  • Plugin page: zipline-smart-ava...
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 14, 2023
  • Latest release: Nov 16, 2023
  • Number of updates: 7
  • Update frequency: every 35.9 days
  • Top authors: matttjones (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /220 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.28ms] Passed 4 tests

An overview of server-side resources used by Smart Avatars
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.80 ▼3.12
Dashboard /wp-admin3.31 ▲0.0045.94 ▼3.87
Posts /wp-admin/edit.php3.36 ▲0.0048.98 ▲0.60
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.66 ▼8.93
Media Library /wp-admin/upload.php3.23 ▲0.0032.91 ▼5.19
Smart Avatars /wp-admin/options-general.php?page=zl-smart-avatars3.0023.66
Redux /wp-admin/options-general.php?page=redux-framework3.0023.20

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 904 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
zipline_smart_avatars
db_upgraded
widget_recent-posts
zipline_smart_avatars-transients
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Smart Avatars
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲314.72 ▲0.461.84 ▼0.1941.09 ▼1.72
Dashboard /wp-admin2,195 ▲155.61 ▼0.0287.43 ▼11.4840.25 ▼2.50
Posts /wp-admin/edit.php2,097 ▼31.96 ▲0.0038.71 ▲0.6237.25 ▲4.86
Add New Post /wp-admin/post-new.php1,526 ▼023.09 ▼0.25646.22 ▼46.2259.65 ▼1.14
Media Library /wp-admin/upload.php1,397 ▼34.14 ▼0.10100.36 ▼12.1842.05 ▼5.04
Smart Avatars /wp-admin/options-general.php?page=zl-smart-avatars280.410.203.79
Redux /wp-admin/options-general.php?page=redux-framework280.410.084.12

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 8 options in the database
    • zipline_smart_avatars-transients
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • zipline_smart_avatars
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 25% 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 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/zipline-smart-avatars/src/templates/spinner.php
  • 49× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/zipline-smart-avatars/vendor-lib/redux-core/inc/fields/slides/field_slides.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/zipline-smart-avatars/vendor-lib/redux-core/inc/fields/editor/field_editor.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/zipline-smart-avatars/vendor-lib/redux-core/inc/fields/color_gradient/field_color_gradient.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Automattic\\Jetpack\\Autoloader\\jpZiplineSmartAvatars\\wp_normalize_path() in wp-content/plugins/zipline-smart-avatars/vendor/jetpack-autoloader/class-path-processor.php:73
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/zipline-smart-avatars/vendor-lib/redux-core/inc/fields/password/field_password.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/zipline-smart-avatars/vendor-lib/redux-core/inc/fields/select/field_select.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/zipline-smart-avatars/vendor-lib/redux-core/inc/fields/button_set/field_button_set.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/zipline-smart-avatars/vendor-lib/redux-core/inc/fields/slider/field_slider.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/zipline-smart-avatars/vendor-lib/redux-core/inc/fields/raw/field_raw.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/zipline-smart-avatars/vendor-lib/redux-core/inc/fields/sorter/field_sorter.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=zl-smart-avatars
    • > Network (severe)
    wp-admin/options-general.php?page=zl-smart-avatars - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/options-general.php?page=redux-framework
    • > Network (severe)
    wp-admin/options-general.php?page=redux-framework - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed: Please take inspiration from this readme.txt

zipline-smart-avatars/zl-smart-avatars.php 85% from 13 tests

The main PHP script in "Smart Avatars" version 1.1.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("zipline-smart-avatars.php" instead of "zl-smart-avatars.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected79,178 lines of code in 596 files:
LanguageFilesBlank linesComment linesLines of code
PHP2367,25613,55627,916
JavaScript1406,1293,45225,674
Sass951,8988812,888
CSS1066,72230810,671
SVG107711,720
JSON300180
Markdown6590129

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 110)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity31.58
▷ Minimum class complexity1.00
▷ Maximum class complexity341.00
Average method complexity5.48
▷ Minimum method complexity1.00
▷ Maximum method complexity110.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes171
▷ Abstract classes42.34%
▷ Concrete classes16797.66%
▷ Final classes00.00%
Methods1,173
▷ Static methods34329.24%
▷ Public methods93179.37%
▷ Protected methods14112.02%
▷ Private methods1018.61%
Functions22
▷ Named functions1254.55%
▷ Anonymous functions1045.45%
Constants110
▷ Global constants00.00%
▷ Class constants110100.00%
▷ Public constants110100.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
68 PNG files occupy 0.18MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor-lib/redux-core/assets/img/jquery-ui-bootstrap/ui-icons_454545_256x240.png4.10KB4.11KB0.00%
vendor-lib/redux-core/assets/img/raw/menu_icon.png1.41KB0.50KB▼ 64.62%
assets/images/avatars/demo-avatars/Avatar5.png12.89KB4.87KB▼ 62.19%
vendor-lib/redux-core/assets/img/raw/3cm.png2.96KB0.29KB▼ 90.35%
vendor-lib/redux-core/assets/img/jquery-ui-bootstrap/ui-icons_cd0a0a_256x240.png4.10KB4.11KB0.00%