10% backgammon

Code Review | Plugin Name: backgammon

WordPress plugin Plugin Name: backgammon scored10%from 54 tests.

About plugin

  • Plugin page: backgammon
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 7, 2014
  • Latest release: Sep 13, 2023
  • Number of updates: 25
  • Update frequency: every 130.7 days
  • Top authors: frankkoenen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,484 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/backgammon/widget.php+61
    Function create_function() is deprecated

Server metrics [RAM: ▼1.90MB] [CPU: ▼59.07ms] Passed 4 tests

An overview of server-side resources used by Plugin Name: backgammon
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.365.87 ▼37.27
Dashboard /wp-admin2.12 ▼1.236.14 ▼58.35
Posts /wp-admin/edit.php2.12 ▼1.246.23 ▼48.79
Add New Post /wp-admin/post-new.php2.12 ▼3.778.38 ▼91.85
Media Library /wp-admin/upload.php2.12 ▼1.115.14 ▼34.80
Board Settings /wp-admin/admin.php?page=backgammon_fhk_admin_boardsettings2.127.45
Backgammon /wp-admin/admin.php?page=backgammon_fhk_admin2.127.87
Main Settings /wp-admin/admin.php?page=backgammon_fhk_admin_mainsettings2.125.10

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
widget_backgammon_fhk
backgammon_fhk_admin_lastmessage_admin

Browser metrics Passed 4 tests

An overview of browser requirements for Plugin Name: backgammon
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲15113.20 ▼1.181.92 ▲0.1538.19 ▼6.42
Dashboard /wp-admin2,306 ▲1035.91 ▲0.0995.98 ▼11.5179.80 ▲33.05
Posts /wp-admin/edit.php2,149 ▲492.06 ▲0.0634.95 ▼9.3539.22 ▲1.35
Add New Post /wp-admin/post-new.php1,556 ▲1122.99 ▼0.15624.43 ▼77.7351.33 ▼50.67
Media Library /wp-admin/upload.php1,437 ▲404.14 ▼0.14105.07 ▼10.9590.52 ▲42.93
Board Settings /wp-admin/admin.php?page=backgammon_fhk_admin_boardsettings8342.0126.6833.92
Backgammon /wp-admin/admin.php?page=backgammon_fhk_admin8412.0230.3827.97
Main Settings /wp-admin/admin.php?page=backgammon_fhk_admin_mainsettings8822.0226.1533.10

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/backgammon/widget.php+61
    Function create_function() is deprecated
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-comments
    • widget_backgammon_fhk
    • widget_theysaidso_widget
    • backgammon_fhk_admin_lastmessage_admin
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=backgammon_fhk_admin_mainsettings
    • > Deprecated in wp-content/plugins/backgammon/widget.php+61
    Function create_function() is deprecated
    • > GET request to /wp-admin/admin.php?page=backgammon_fhk_admin_mainsettings
    • > Notice in wp-content/plugins/backgammon/backgammon.php+103
    Undefined index: backgammon_fhk_admin_post_keysave
    • > GET request to /wp-admin/admin.php?page=backgammon_fhk_admin_mainsettings
    • > Notice in wp-content/plugins/backgammon/backgammon.php+108
    Undefined index: backgammon_fhk_admin_post_clear
    • > GET request to /wp-admin/admin.php?page=backgammon_fhk_admin_mainsettings
    • > Warning in wp-content/plugins/backgammon/nonce.lib+3
    file_get_contents(/tmp/noncelib_23c15b6dc776014b82ac7513ce73e261): failed to open stream: No such file or directory
    • > GET request to /wp-admin/admin.php?page=backgammon_fhk_admin_mainsettings
    • > Warning in wp-content/plugins/backgammon/backgammon.php+127
    file_get_contents(): stream does not support seeking
    • > GET request to /wp-admin/admin.php?page=backgammon_fhk_admin_mainsettings
    • > Warning in wp-content/plugins/backgammon/backgammon.php+127
    file_get_contents(): Failed to seek to position -1 in the stream

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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/backgammon/widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/backgammon/backgammon.php:15

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === Plugin Name: backgammon === )
  • Screenshots: Please add images for these screenshots: #1 (Shows the initial widget view prior to establising connection with the SimplyBG server.), #2 (Shows the pin-form for creating a new backgammon match with another opponent.), #3 (Shows an example view of the SimplyBG play-board.)
The official readme.txt is a good inspiration

backgammon/backgammon.php Passed 13 tests

The main PHP script in "Plugin Name: backgammon" version 2.1.1 is automatically included on every request by WordPress
121 characters long description:
This plugin provides a backgammon board embedded in your wordpress site, using widget or shortcode [backgammon_playboard]

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin258 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP3449202
JavaScript17052
CSS2104

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity2.50
▷ Minimum class complexity1.00
▷ Maximum class complexity4.00
Average method complexity1.55
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods11
▷ Static methods763.64%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.73MB with 0.42MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png77.87KB26.62KB▼ 65.82%
screenshot-3.png292.23KB115.27KB▼ 60.56%
banner.png191.52KB89.16KB▼ 53.44%
screenshot-1.png186.51KB92.51KB▼ 50.40%