73% gambling-addiction-test

Code Review | Gambling Addiction Test

WordPress plugin Gambling Addiction Test scored73%from 54 tests.

About plugin

  • Plugin page: gambling-addictio...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 12, 2021
  • Latest release: May 20, 2021
  • Number of updates: 4
  • Update frequency: every 24.5 days
  • Top authors: zmkirill (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /363 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

An overview of server-side resources used by Gambling Addiction Test
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.385.24 ▼35.55
Dashboard /wp-admin2.10 ▼1.206.37 ▼48.68
Posts /wp-admin/edit.php2.10 ▼1.255.48 ▼49.46
Add New Post /wp-admin/post-new.php2.10 ▼3.787.81 ▼91.46
Media Library /wp-admin/upload.php2.10 ▼1.135.76 ▼29.13

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Gambling Addiction Test
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲4113.25 ▼1.134.71 ▲2.6841.87 ▼2.00
Dashboard /wp-admin2,213 ▲254.86 ▼0.01104.32 ▼11.8839.94 ▼7.62
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0537.01 ▼2.7533.71 ▲0.56
Add New Post /wp-admin/post-new.php1,527 ▲718.11 ▼5.07646.75 ▼44.3654.51 ▲0.37
Media Library /wp-admin/upload.php1,395 ▲104.17 ▼0.1999.81 ▼12.0743.18 ▼3.54

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mga-plugin handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/gambling-addiction-test/index.php:17

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Contributors: The plugin contributors field is missing
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
You can take inspiration from this readme.txt

gambling-addiction-test/index.php 85% from 13 tests

The entry point to "Gambling Addiction Test" version 1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: Make the plugin description longer than 10 characters (currently 4 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("gambling-addiction-test.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin334 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1410212
CSS10087
JavaScript15035

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
15 PNG files occupy 0.19MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/14.png5.01KB2.32KB▼ 53.74%
img/6.png4.79KB2.50KB▼ 47.81%
img/1.png25.90KB6.94KB▼ 73.21%
img/12.png5.60KB2.92KB▼ 47.95%
img/13.png12.22KB4.71KB▼ 61.41%