62% lailo-ai-avatar

Code Review | Lailo - AI Avatar

WordPress plugin Lailo - AI Avatar scored62%from 54 tests.

About plugin

  • Plugin page: lailo-ai-avatar
  • Plugin version: 1.4.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9
  • WordPress version: 6.3.1
  • First release: Sep 26, 2020
  • Latest release: Apr 20, 2022
  • Number of updates: 41
  • Update frequency: every 13.9 days
  • Top authors: maxilorent (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /760 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.94MB] [CPU: ▼35.94ms] Passed 4 tests

A check of server-side resources used by Lailo - AI Avatar
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.21 ▼4.36
Dashboard /wp-admin3.01 ▼0.3026.39 ▼28.67
Posts /wp-admin/edit.php3.01 ▼0.3521.62 ▼27.69
Add New Post /wp-admin/post-new.php3.01 ▼2.8824.13 ▼69.47
Media Library /wp-admin/upload.php3.01 ▼0.2221.62 ▼17.92
Add Template /wp-admin/admin.php?page=lailo_avatar_settings_page3.0123.87
Error /wp-admin/admin.php?page=lailo_avatar_error_page3.0125.37

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Lailo - AI Avatar
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲1314.28 ▼0.252.03 ▼0.0042.40 ▼5.19
Dashboard /wp-admin2,208 ▲375.70 ▲0.0386.85 ▼17.5936.51 ▼10.02
Posts /wp-admin/edit.php2,113 ▲162.00 ▼0.0335.17 ▲0.3832.50 ▼3.70
Add New Post /wp-admin/post-new.php1,535 ▲722.94 ▼0.08651.82 ▼20.1262.66 ▲0.69
Media Library /wp-admin/upload.php1,413 ▲134.17 ▼0.0395.82 ▼13.4244.03 ▼0.53
Add Template /wp-admin/admin.php?page=lailo_avatar_settings_page1,3312.0024.3939.75
Error /wp-admin/admin.php?page=lailo_avatar_error_page7882.0025.6924.90

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=lailo_avatar_error_page
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
    • > GET request to /wp-admin/admin.php?page=lailo_avatar_settings_page
    • > Notice in wp-content/plugins/lailo-ai-avatar/includes/template/lailo_settings.php+204
    Undefined index: selected_template
  • 30 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=lailo_avatar_settings_page
    • > Notice in wp-content/plugins/lailo-ai-avatar/includes/template/lailo_settings.php+552
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/lailo-ai-avatar/includes/template/lailo_error_page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/lailo-ai-avatar/includes/admin/lailo_admin_page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/lailo-ai-avatar/includes/template/lailo_settings.php:200
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/lailo-ai-avatar/includes/lailo_init.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_col() on null in wp-content/plugins/lailo-ai-avatar/uninstall.php:6
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/lailo-ai-avatar/includes/admin/lailo_template_table.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/lailo-ai-avatar/includes/admin/lailo_template_table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/lailo-ai-avatar/includes/lailo_admin.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/lailo-ai-avatar/includes/admin/lailo_template_table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lailo-ai-avatar/includes/functions/lailo_update_settings.php:3

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 browser errors
    • > GET request to /wp-admin/admin.php?page=lailo_avatar_settings_page
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=lailo_avatar_settings_page 566 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: ki, lailo, character, ai, live...

lailo-ai-avatar/lailoavatar.php 92% from 13 tests

"Lailo - AI Avatar" version 1.4.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("lailo-ai-avatar.php" instead of "lailoavatar.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected1,157 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP10192901,082
JavaScript17375

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity4.00
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods16
▷ Static methods318.75%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin