93% space-invaders

Code Review | Space Invaders

WordPress plugin Space Invaders scored 93% from 54 tests.

About plugin

  • Plugin page: space-invaders
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-3.3.1
  • WordPress version: 5.8.1
  • First release: Apr 16, 2012
  • Latest release: Apr 20, 2012
  • Number of updates: 6
  • Update frequency: every 38.2 days
  • Top authors: tambourdeville (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active / 1,641 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼164.04ms] Passed 4 tests

An overview of server-side resources used by Space Invaders
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.0137.27 ▼5.74
Dashboard /wp-admin3.07 ▲0.0150.32 ▼16.87
Posts /wp-admin/edit.php3.12 ▲0.0141.54 ▼22.74
Add New Post /wp-admin/post-new.php5.43 ▼0.0194.89 ▼610.65
Media Library /wp-admin/upload.php3.01 ▲0.0137.00 ▼5.88

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Space Invaders
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8316.03 ▲0.569.18 ▼0.4150.23 ▼10.01
Dashboard /wp-admin2,967 ▲335.90 ▼0.18147.63 ▼53.11119.66 ▼22.49
Posts /wp-admin/edit.php2,739 ▼02.69 ▲0.0167.21 ▼20.9595.79 ▼17.46
Add New Post /wp-admin/post-new.php1,591 ▲1018.55 ▲1.19385.75 ▼125.83115.81 ▼515.77
Media Library /wp-admin/upload.php1,807 ▼05.01 ▼0.01165.02 ▼18.68124.17 ▼16.98

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/space-invaders/jump.php:14

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 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (22 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Screenshot #1 (Now you know where are those buttons!) image required
You can take inspiration from this readme.txt

space-invaders/jump.php 92% from 13 tests

The main file in "Space Invaders" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("space-invaders.php" instead of "jump.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected87 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript66760
PHP171027

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ 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
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/jump.png0.20KB0.14KB▼ 27.72%
img/tabulation.png0.27KB0.15KB▼ 42.34%
img/clear.png0.24KB0.16KB▼ 33.06%