84% betting-payback-calculator

Code Review | Betting Payback Calculator

WordPress plugin Betting Payback Calculator scored84%from 54 tests.

About plugin

  • Plugin page: betting-payback-c...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.0.2
  • WordPress version: 6.3.1
  • First release: May 16, 2017
  • Latest release: Dec 28, 2018
  • Number of updates: 3
  • Update frequency: every 197.4 days
  • Top authors: sorengolf (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,356 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.75ms] Passed 4 tests

A check of server-side resources used by Betting Payback Calculator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.79 ▼1.86
Dashboard /wp-admin3.32 ▲0.0147.47 ▼5.12
Posts /wp-admin/edit.php3.43 ▲0.0751.10 ▼1.08
Add New Post /wp-admin/post-new.php5.90 ▲0.0190.35 ▼6.94
Media Library /wp-admin/upload.php3.24 ▲0.0139.64 ▲2.71
Betting Payback /wp-admin/options-general.php?page=betting_payback_calculator_options3.2229.57

Server storage [IO: ▲0.02MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Betting Payback Calculator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.41 ▼0.201.77 ▼0.3543.54 ▼2.89
Dashboard /wp-admin2,207 ▲225.77 ▼0.24102.73 ▼14.1542.46 ▼5.54
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0135.68 ▼1.8035.73 ▲4.98
Add New Post /wp-admin/post-new.php1,536 ▲323.10 ▲0.11675.47 ▼8.5350.51 ▼12.58
Media Library /wp-admin/upload.php1,392 ▲14.20 ▼0.1995.24 ▼6.0844.82 ▼0.37
Betting Payback /wp-admin/options-general.php?page=betting_payback_calculator_options1,2532.4454.9130.01

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/betting-payback-calculator/betting-payback-calculator.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: margin, payback percentage, 1x2, odds, payback...

betting-payback-calculator/betting-payback-calculator.php Passed 13 tests

"Betting Payback Calculator" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
62 characters long description:
Calculate the theoretical payback percentage for a set of odds

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin306 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP511628300
JavaScript1215
JSON1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity13.33
▷ Minimum class complexity3.00
▷ Maximum class complexity22.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27.41%
▷ Public methods2592.59%
▷ Protected methods00.00%
▷ Private methods27.41%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin