84% live-2d

Code Review | Live2DWebCanvas

WordPress plugin Live2DWebCanvas scored 84% from 54 tests.

About plugin

  • Plugin page: live-2d
  • Plugin version: 1.9.11
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3
  • WordPress version: 6.3.1
  • First release: Jun 25, 2020
  • Latest release: Sep 28, 2023
  • Number of updates: 164
  • Update frequency: every 7.3 days
  • Top authors: jiangweifang (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active / 11,372 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.83MB] [CPU: ▲0.85ms] Passed 4 tests

An overview of server-side resources used by Live2DWebCanvas
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.22 ▲0.7645.51 ▲1.38
Dashboard /wp-admin4.17 ▲0.8653.96 ▲1.03
Posts /wp-admin/edit.php4.22 ▲0.8648.42 ▲3.45
Add New Post /wp-admin/post-new.php6.75 ▲0.8793.57 ▼2.47
Media Library /wp-admin/upload.php4.09 ▲0.8642.28 ▲5.96
Live 2D Settings /wp-admin/options-general.php?page=live-2d-options4.0037.66

Server storage [IO: ▲3.71MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 65 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
live_2d_advanced_option_name
theysaidso_admin_options
widget_recent-posts
db_upgraded
live_2d_settings_option_name
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Live2DWebCanvas
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,954 ▲20817.15 ▲2.78155.69 ▲153.6979.32 ▲36.10
Dashboard /wp-admin2,226 ▲385.86 ▼0.17114.39 ▼4.4347.61 ▲2.68
Posts /wp-admin/edit.php2,109 ▲202.06 ▲0.0436.45 ▼1.3438.62 ▲4.33
Add New Post /wp-admin/post-new.php1,553 ▲2023.28 ▼0.14682.05 ▲72.1755.02 ▲8.30
Media Library /wp-admin/upload.php1,408 ▲204.19 ▼0.13101.52 ▼9.0046.65 ▼0.28
Live 2D Settings /wp-admin/options-general.php?page=live-2d-options3,6203.98124.55144.57

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 14× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/live-2d/src/live2d-SDK.php on line 2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/live-2d/src/live2d-SDK.php on line 2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/live-2d/src/live2d-SDK.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/live-2d/src/live2d-SDK.php on line 2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/live-2d/src/live2d-SDK.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/live-2d/src/live2d-SDK.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/live-2d/src/live2d-SDK.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/live-2d/src/live2d-SDK.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/live-2d/src/live2d-SDK.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/live-2d/src/live2d-SDK.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: moe, 2d, comic, anime, chatgpt...

live-2d/wordpress-live2d.php 92% from 13 tests

The primary PHP file in "Live2DWebCanvas" version 1.9.11 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("live-2d.php" instead of "wordpress-live2d.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
Good job! No executable or dangerous file extensions detected16,572 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
CSS195,7569412,978
PHP203925212,960
PO File2206352470
Markdown1370158
JavaScript60126

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity21.00
▷ Minimum class complexity1.00
▷ Maximum class complexity71.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods145
▷ Static methods2617.93%
▷ Public methods12686.90%
▷ Protected methods00.00%
▷ Private methods1913.10%
Functions11
▷ Named functions981.82%
▷ Anonymous functions218.18%
Constants13
▷ Global constants538.46%
▷ Class constants861.54%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin