10% blackjack-lite

Code Review | Blackjack

WordPress plugin Blackjack scored10%from 54 tests.

About plugin

  • Plugin page: blackjack-lite
  • Plugin version: 1.90
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-4.8
  • WordPress version: 6.3.1
  • First release: Apr 21, 2014
  • Latest release: Aug 1, 2017
  • Number of updates: 50
  • Update frequency: every 24.0 days
  • Top authors: manojtd (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

50+ active /7,803 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/blackjack-lite/EzOptions.php+480
    Methods with the same name as their class will not be constructors in a future version of PHP; EzMiniTab has a deprecated constructor

Server metrics [RAM: ▲0.06MB] [CPU: ▼16.13ms] Passed 4 tests

Analyzing server-side resources used by Blackjack
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0942.26 ▼7.28
Dashboard /wp-admin3.41 ▲0.0750.27 ▼24.50
Posts /wp-admin/edit.php3.47 ▲0.1146.18 ▼7.76
Add New Post /wp-admin/post-new.php5.93 ▲0.0585.34 ▼24.98
Media Library /wp-admin/upload.php3.28 ▲0.0436.38 ▲1.13

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Blackjack
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.35 ▼0.021.88 ▲0.0244.07 ▲1.97
Dashboard /wp-admin2,199 ▲195.55 ▼0.1196.29 ▲8.4844.91 ▲2.89
Posts /wp-admin/edit.php2,101 ▲42.00 ▼0.0036.70 ▼3.2734.09 ▲0.27
Add New Post /wp-admin/post-new.php1,529 ▲323.63 ▼0.10666.27 ▼16.6251.36 ▼2.72
Media Library /wp-admin/upload.php1,404 ▲74.13 ▼0.1199.58 ▼1.1545.30 ▲3.65
Blackjack Lite /wp-admin/blackjack-lite.php260.420.1115.32

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/blackjack-lite/ezDenyLite.php on line 22
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/blackjack-lite/ezDenyLite.php on line 22
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/blackjack-lite/ezDenyLite.php on line 22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/blackjack-lite/EzOptions.php:544
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/blackjack-lite/myPlugins.php:300

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/blackjack-lite.php
    • > Network (severe)
    wp-admin/blackjack-lite.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Blackjack Game in the lite version.), #2 (Blackjack Game in the Pro version.)
You can take inspiration from this readme.txt

blackjack-lite/blackjack-lite.php Passed 13 tests

"Blackjack" version 1.90's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
105 characters long description:
Lite Version: Blackjack game. No complicated setup, no server load or submit, just a shortcode on a page!

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
Success! There were no dangerous files found in this plugin2,947 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP5243791,829
JavaScript2511341,117
CSS1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity10.69
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods96
▷ Static methods55.21%
▷ Public methods96100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.23MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png82.39KB22.28KB▼ 72.96%
screenshot-1.png28.29KB7.10KB▼ 74.89%
img/ezsupport.png3.13KB2.01KB▼ 35.75%
images/playing-card-deck.png30.02KB29.45KB▼ 1.87%
ezpaypal.png9.22KB3.44KB▼ 62.72%