73% battle-by-alex-lundin

Code Review | WP Battle by Alex Lundin

WordPress plugin WP Battle by Alex Lundin scored73%from 54 tests.

About plugin

  • Plugin page: battle-by-alex-lu...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.1
  • WordPress version: 6.3.1
  • First release: Nov 24, 2022
  • Latest release: Dec 6, 2022
  • Number of updates: 3
  • Update frequency: every 6.3 days
  • Top authors: alexlundin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /190 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.25MB] [CPU: ▼4.09ms] Passed 4 tests

Analyzing server-side resources used by WP Battle by Alex Lundin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2637.23 ▼3.62
Dashboard /wp-admin3.55 ▲0.2148.04 ▼17.78
Posts /wp-admin/edit.php3.67 ▲0.3154.47 ▲5.86
Add New Post /wp-admin/post-new.php6.15 ▲0.27100.26 ▲2.63
Media Library /wp-admin/upload.php3.48 ▲0.2540.07 ▲2.42

Server storage [IO: ▲7.40MB] [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: 28 new files
Database: 2 new tables, 6 new options
New tables
wp_battle_items_table
wp_battle_comments_table
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for WP Battle by Alex Lundin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,861 ▲9013.27 ▼0.977.31 ▲5.2539.62 ▼3.34
Dashboard /wp-admin2,230 ▲424.83 ▼1.0599.45 ▼14.4347.24 ▲0.67
Posts /wp-admin/edit.php2,113 ▲422.02 ▼0.1139.38 ▼0.0735.23 ▼2.30
Add New Post /wp-admin/post-new.php6,370 ▲4,84227.65 ▲4.34896.81 ▲210.0048.60 ▼13.24
Media Library /wp-admin/upload.php1,412 ▲274.24 ▼0.0394.79 ▼3.5243.04 ▲2.06
Battles /wp-admin/admin.php?page=asl_battles#/9577.09205.4941.62
Comments /wp-admin/admin.php?page=asl_battles#/comments9276.75204.8232.73

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_battle_items_table
    • wp_battle_comments_table
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/battle-by-alex-lundin/admin/partials/asl-battle-admin-display.php
    • > /wp-content/plugins/battle-by-alex-lundin/public/partials/asl-battle-public-display.php

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)
There were no browser issues found

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
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
You can take inspiration from this readme.txt

battle-by-alex-lundin/asl-battle.php 85% from 13 tests

The main PHP file in "WP Battle by Alex Lundin" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("battle-by-alex-lundin.php" instead of "asl-battle.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin2,241 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP142175221,223
CSS31258767
JavaScript327107251

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity9.57
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity2.02
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods48
▷ Static methods36.25%
▷ Public methods4389.58%
▷ Protected methods00.00%
▷ Private methods510.42%
Functions11
▷ Named functions763.64%
▷ Anonymous functions436.36%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin