94% 2048-number-game

Code Review | 2048

WordPress plugin 2048 scored 94% from 54 tests.

About plugin

  • Plugin page: 2048-number-game
  • Plugin version: 0.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.9.1
  • WordPress version: 5.9.2
  • First release: Apr 8, 2014
  • Latest release: Jul 3, 2014
  • Number of updates: 11
  • Update frequency: every 7.8 days
  • Top authors: envigeek (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 5,001 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.02MB] [CPU: ▼304.02ms] Passed 4 tests

Analyzing server-side resources used by 2048
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0151.69 ▲1.40
Dashboard /wp-admin3.41 ▲0.0032.97 ▼0.62
Posts /wp-admin/edit.php3.64 ▲0.0036.99 ▼0.50
Add New Post /wp-admin/post-new.php6.88 ▼0.0994.48 ▼1,214.40
Media Library /wp-admin/upload.php3.29 ▲0.0023.54 ▼0.56

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 34 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

2048: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,767 ▲1015.81 ▼0.195.88 ▼0.652.22 ▼0.20
Dashboard /wp-admin2,895 ▲346.13 ▼0.07121.11 ▼13.75153.81 ▼10.16
Posts /wp-admin/edit.php2,694 ▲33.24 ▲0.0061.36 ▼4.22137.03 ▼4.99
Add New Post /wp-admin/post-new.php1,668 ▲717.88 ▲0.98417.91 ▼8.20152.20 ▼12.05
Media Library /wp-admin/upload.php1,701 ▲35.41 ▼0.11137.45 ▲2.38181.42 ▼1.85

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

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 everything seems fine, this is not an exhaustive test

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 fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/2048-number-game/2048-number-game.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention: You can take inspiration from this readme.txt

2048-number-game/2048-number-game.php Passed 13 tests

The entry point to "2048" version 0.3.1 is a PHP file that has certain tags in its header comment area
68 characters long description:
2048 is a number combination game with the aim to achieve 2048 tile.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected5,047 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
SVG3001,979
PHP41581441,171
CSS47101,053
JavaScript1318064816
HTML12028

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity57.33
▷ Minimum class complexity10.00
▷ Maximum class complexity91.00
Average method complexity4.93
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods43
▷ Static methods36.98%
▷ Public methods3888.37%
▷ Protected methods24.65%
▷ Private methods36.98%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
2048-icon.png0.59KB0.54KB▼ 9.09%