83% howescape-unity3d-webgl

Code Review | HoweScape Unity3d WebGL

WordPress plugin HoweScape Unity3d WebGL scored83%from 54 tests.

About plugin

  • Plugin page: howescape-unity3d...
  • Plugin version: 2.3.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.0.1
  • WordPress version: 6.3.1
  • First release: Mar 8, 2016
  • Latest release: Oct 8, 2022
  • Number of updates: 67
  • Update frequency: every 35.9 days
  • Top authors: pthowe (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active /12,388 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼9.07ms] Passed 4 tests

Analyzing server-side resources used by HoweScape Unity3d WebGL
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2442.64 ▲0.23
Dashboard /wp-admin3.55 ▲0.2046.95 ▼14.58
Posts /wp-admin/edit.php3.66 ▲0.3050.93 ▲1.14
Add New Post /wp-admin/post-new.php6.13 ▲0.2484.45 ▼23.05
Media Library /wp-admin/upload.php3.47 ▲0.2444.33 ▲5.30
HoweScape Unity3d Game Settings /wp-admin/options-general.php?page=hs_unity3d_web_gl_setting3.4434.08

Server storage [IO: ▲90.21MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Please fix the following
  • The filesystem usage should be lower than 25MB (currently using 90.21MB)
Filesystem: 103 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for HoweScape Unity3d WebGL
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6214.89 ▲0.541.95 ▲0.2544.29 ▲3.23
Dashboard /wp-admin2,212 ▲245.85 ▲0.90107.87 ▼9.0840.49 ▼14.74
Posts /wp-admin/edit.php2,095 ▲61.99 ▼0.0740.74 ▼0.4536.61 ▼1.83
Add New Post /wp-admin/post-new.php1,524 ▼2123.40 ▲5.05695.47 ▲91.4955.41 ▲7.07
Media Library /wp-admin/upload.php1,394 ▲64.20 ▲0.01111.90 ▲5.2746.90 ▲0.02
HoweScape Unity3d Game Settings /wp-admin/options-general.php?page=hs_unity3d_web_gl_setting8232.0727.9029.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/howescape-unity3d-webgl/include/hs_unity3d_constants.php:111
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/howescape-unity3d-webgl/hs_unity3d_web_gl.php:21
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/howescape-unity3d-webgl/include/hs_unity3d_constants.php on line 10
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/howescape-unity3d-webgl/include/hs_unity3d_constants.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Screenshots: Screenshot #3 (Screen capture of Space-Shooter game from unity3d.com tutorials) image required
You can look at the official readme.txt

howescape-unity3d-webgl/hs_unity3d_web_gl.php 77% from 13 tests

Analyzing the main PHP file in "HoweScape Unity3d WebGL" version 2.3.6
Please take the time to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Main file name: Name the main plugin file the same as the plugin slug ("howescape-unity3d-webgl.php" instead of "hs_unity3d_web_gl.php")
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis Passed 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
There were no executable files found in this plugin1,378,437 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1433,6508321,377,258
PHP2104372873
CSS81945147
XML243377
PO File1131442
JSON30040

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.22
Average class complexity116.00
▷ Minimum class complexity116.00
▷ Maximum class complexity116.00
Average method complexity6.48
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants84
▷ Global constants84100.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
31 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
game_support_dir/GeneralTemplateData/ProgressBar.Dark.png2.73KB0.08KB▼ 97.06%
game_support_dir/GeneralTemplateData/progress-bar-empty-dark.png0.09KB0.11KB0.00%
game_support_dir/TemplateData_2021_3_9f1/webgl-logo.png2.88KB1.81KB▼ 37.09%
game_support_dir/GeneralTemplateData/progress-bar-full-light.png0.08KB0.08KB0.00%
game_support_dir/GeneralTemplateData/progressEmpty.Dark.png0.15KB0.11KB▼ 26.45%