84% 2048-number-game

Code Review | 2048

WordPress plugin 2048 scored84%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: 6.3.1
  • 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 /7,181 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.00MB] [CPU: ▼8.06ms] Passed 4 tests

This is a short check of server-side resources used by 2048
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.33 ▲3.86
Dashboard /wp-admin3.31 ▲0.0050.53 ▼3.41
Posts /wp-admin/edit.php3.36 ▲0.0052.01 ▼1.98
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.62 ▼25.77
Media Library /wp-admin/upload.php3.23 ▲0.0037.49 ▼1.07

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 34 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for 2048
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▼0.181.83 ▲0.0243.30 ▼2.72
Dashboard /wp-admin2,195 ▲155.63 ▲0.0396.00 ▲5.7341.30 ▼0.98
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0634.54 ▼5.5934.40 ▼5.60
Add New Post /wp-admin/post-new.php1,526 ▼023.26 ▲0.35670.73 ▲4.8672.33 ▲5.10
Media Library /wp-admin/upload.php1,403 ▼04.11 ▼0.20100.74 ▼3.4745.87 ▲3.58

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > 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 a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Screenshots: No descriptions were found for these screenshots #2, #3, #4, #5, #6 in 2048-number-game/assets to your readme.txt
The official readme.txt is a good inspiration

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

"2048" version 0.3.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
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 | There should be no dangerous file extensions present in any WordPress plugin
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

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
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%