63% vampire-character

Code Review | Vampire Character Manager

WordPress plugin Vampire Character Manager scored63%from 54 tests.

About plugin

  • Plugin page: vampire-character
  • Plugin version: 2.13
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.4-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 11, 2015
  • Latest release: Nov 5, 2023
  • Number of updates: 133
  • Update frequency: every 21.9 days
  • Top authors: magent (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,613 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲4.92MB] [CPU: ▲18.76ms] Passed 4 tests

Server-side resources used by Vampire Character Manager
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /6.64 ▲3.1854.18 ▲13.23
Dashboard /wp-admin9.24 ▲5.9486.50 ▲32.49
Posts /wp-admin/edit.php9.28 ▲5.9392.17 ▲46.99
Add New Post /wp-admin/post-new.php10.54 ▲4.6577.53 ▼17.67
Media Library /wp-admin/upload.php9.16 ▲5.9394.59 ▲64.64
Data Tables /wp-admin/admin.php?page=vtmcharacter-data9.0680.71
Player Admin /wp-admin/admin.php?page=vtmcharacter-player9.0771.23
Configuration /wp-admin/admin.php?page=vtmcharacter-config9.0774.24
XP Approval /wp-admin/admin.php?page=vtmcharacter-xp9.0776.89
Backgrounds /wp-admin/admin.php?page=vtmcharacter-bg9.0674.92
Assign XP /wp-admin/admin.php?page=vtmcharacter-xpassign9.0770.34
Character Approval /wp-admin/admin.php?page=vtmcharacter-chargen9.0775.26
Path Changes /wp-admin/admin.php?page=vtmcharacter-paths9.0870.38
Character Admin /wp-admin/admin.php?page=character-plugin9.0470.26
Character Options /wp-admin/options-general.php?page=vtmoptions9.0770.94

Server storage [IO: ▲1.99MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 119 new files
Database: 66 new tables, 13 new options
New tables
wp_vtm_CHARGEN_TEMPLATE_MAXIMUM
wp_vtm_CHARACTER_TEMPORARY_STAT
wp_vtm_MAIL_STATUS
wp_vtm_SOURCE_BOOK
wp_vtm_CHARACTER
wp_vtm_DOMAIN
wp_vtm_PENDING_XP_SPEND
wp_vtm_CHARACTER_GENERATION
wp_vtm_SECTOR
wp_vtm_CHARACTER_STAT
...
New WordPress options
theysaidso_admin_options
widget_vtmplugin_widget
widget_solar
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
widget_vtmplugin_background_widget
vtm_character_db_version
...

Browser metrics Passed 4 tests

A check of browser resources used by Vampire Character Manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,964 ▲17714.15 ▼0.202.65 ▲0.7441.63 ▼2.70
Dashboard /wp-admin2,333 ▲1565.60 ▼0.1799.95 ▲1.3144.10 ▲1.52
Posts /wp-admin/edit.php2,241 ▲1412.11 ▲0.1241.65 ▲4.4436.80 ▲2.09
Add New Post /wp-admin/post-new.php1,483 ▼4316.65 ▼6.60643.42 ▼75.5146.91 ▼15.47
Media Library /wp-admin/upload.php1,538 ▲1354.23 ▲0.02100.68 ▼3.2143.50 ▼0.42
Data Tables /wp-admin/admin.php?page=vtmcharacter-data1,1451.9327.4629.94
Player Admin /wp-admin/admin.php?page=vtmcharacter-player1,2461.7825.3826.86
Configuration /wp-admin/admin.php?page=vtmcharacter-config1,1031.9326.3031.53
XP Approval /wp-admin/admin.php?page=vtmcharacter-xp1,1281.9331.2028.14
Backgrounds /wp-admin/admin.php?page=vtmcharacter-bg1,1921.8224.7832.42
Assign XP /wp-admin/admin.php?page=vtmcharacter-xpassign9571.7824.4726.70
Character Approval /wp-admin/admin.php?page=vtmcharacter-chargen1,0711.8124.6029.04
Path Changes /wp-admin/admin.php?page=vtmcharacter-paths1,1441.6527.6230.40
Character Admin /wp-admin/admin.php?page=character-plugin1,1081.7723.3226.08
Character Options /wp-admin/options-general.php?page=vtmoptions9372.1424.8827.40

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie tables were found after uninstall: 66 tables
    • wp_vtm_CHARACTER_RITUAL
    • wp_vtm_DISCIPLINE
    • wp_vtm_CONFIG
    • wp_vtm_SECT
    • wp_vtm_CHARACTER_DISCIPLINE_POWER
    • wp_vtm_XP_REASON
    • wp_vtm_DISCIPLINE_POWER
    • wp_vtm_TEMPORARY_STAT_REASON
    • wp_vtm_TEMPORARY_STAT
    • wp_vtm_CHARACTER_COMBO_DISCIPLINE
    • ...
  • Zombie WordPress options detected upon uninstall: 13 options
    • vtm_character_version
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_vtmplugin_background_widget
    • can_compress_scripts
    • widget_solar
    • vtm_character_db_version
    • widget_vtmplugin_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • ...

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
    • > GET request to /wp-admin/admin.php?page=character-plugin
    • > Warning in wp-content/plugins/vampire-character/inc/functions.php+142
    Illegal string offset 'vtm_link_editCharSheet'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=character-plugin
    • > Notice in wp-includes/link-template.php+409
    Trying to get property 'ID' of non-object

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
Please take a closer look at the following
  • 49× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/vampire-character/inc/functions.php:417
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/vampire-character/inc/profile.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/vampire-character/inc/adminpages/characters.php:320
    • > PHP Fatal error
      Uncaught Error: Class 'vtmclass_Report_ListTable' not found in wp-content/plugins/vampire-character/inc/adminpages/masterpath.php:90
    • > PHP Fatal error
      Uncaught Error: Class 'vtmclass_MultiPage_ListTable' not found in wp-content/plugins/vampire-character/inc/adminpages/skill_types.php:140
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/vampire-character/templates/vtmpm.php:6
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/vampire-character/inc/widgets.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/vampire-character/inc/install.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'vtmclass_MultiPage_ListTable' not found in wp-content/plugins/vampire-character/inc/adminpages/nature.php:119
    • > PHP Warning
      Use of undefined constant VTM_CHARACTER_URL - assumed 'VTM_CHARACTER_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/vampire-character/inc/adminpages.php on line 3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=vtmoptions
    • > Javascript (severe) in unknown
    /wp-content/plugins/vampire-character/js/googleapi.js?ver=6.3.1 55:0 Uncaught ReferenceError: google is not defined
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=vtmoptions
    • > Javascript (severe) in unknown
    /wp-content/plugins/vampire-character/js/googleapi.js?ver=6.3.1 45:60 Uncaught TypeError: Cannot read properties of null (reading 'value')

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: character, larp, generation, roleplay, rpg...

vampire-character/vampire-character.php Passed 13 tests

The main PHP script in "Vampire Character Manager" version 2.13 is automatically included on every request by WordPress
36 characters long description:
Management of Characters and Players

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin36,932 lines of code in 63 files:
LanguageFilesBlank linesComment linesLines of code
PHP586,9653,76636,153
CSS37061711
JavaScript115536
HTML11032

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity29.65
▷ Minimum class complexity3.00
▷ Maximum class complexity339.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes46
▷ Abstract classes00.00%
▷ Concrete classes46100.00%
▷ Final classes00.00%
Methods573
▷ Static methods00.00%
▷ Public methods51990.58%
▷ Protected methods549.42%
▷ Private methods00.00%
Functions526
▷ Named functions52399.43%
▷ Anonymous functions30.57%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/adminpages/icons/print.png3.12KB0.28KB▼ 91.11%
inc/adminpages/icons/background.png3.16KB0.31KB▼ 90.30%
inc/adminpages/icons/delete.png3.20KB0.42KB▼ 86.75%
inc/adminpages/icons/profile.png3.12KB0.30KB▼ 90.27%
inc/adminpages/icons/spendxp.png2.89KB0.44KB▼ 84.71%