73% wagering-requirement-calculator

Code Review | Wagering Requirement Calculator

WordPress plugin Wagering Requirement Calculator scored73%from 54 tests.

About plugin

  • Plugin page: wagering-requirem...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 29, 2021
  • Latest release: May 20, 2021
  • Number of updates: 6
  • Update frequency: every 9.0 days
  • Top authors: zmkirill (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /354 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▼1.93MB] [CPU: ▼58.43ms] Passed 4 tests

Server-side resources used by Wagering Requirement Calculator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.404.96 ▼38.00
Dashboard /wp-admin2.09 ▼1.226.23 ▼49.90
Posts /wp-admin/edit.php2.09 ▼1.277.72 ▼48.56
Add New Post /wp-admin/post-new.php2.09 ▼3.806.55 ▼97.24
Media Library /wp-admin/upload.php2.09 ▼1.157.28 ▼27.92

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Wagering Requirement Calculator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,107 ▲34614.40 ▼0.015.82 ▲4.0647.18 ▲5.70
Dashboard /wp-admin2,289 ▲1145.32 ▼0.3093.65 ▼26.3338.90 ▼3.65
Posts /wp-admin/edit.php2,200 ▲1002.35 ▲0.3839.74 ▲1.3233.50 ▼10.00
Add New Post /wp-admin/post-new.php1,541 ▲1323.37 ▲0.20633.71 ▼76.8571.68 ▲14.97
Media Library /wp-admin/upload.php1,500 ▲1004.74 ▲0.66104.51 ▲2.7248.19 ▲4.76

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > 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-calc-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
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% 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 | 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 wp_enqueue_script() in wp-content/plugins/wagering-requirement-calculator/index.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Contributors: Contributors not specified
You can take inspiration from this readme.txt

wagering-requirement-calculator/index.php 85% from 13 tests

This is the main PHP file of "Wagering Requirement Calculator" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: A good plugin description is longer than 10 characters (currently 4 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wagering-requirement-calculator.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected134 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP149133
CSS1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin