83% betpress

Code Review | BetPress

WordPress plugin BetPress scored83%from 54 tests.

About plugin

  • Plugin page: betpress
  • Plugin version: 1.0.1 Lite...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.4.1
  • WordPress version: 6.3.1
  • First release: Jan 24, 2016
  • Latest release: Jan 26, 2016
  • Number of updates: 10
  • Update frequency: every 0.7 days
  • Top authors: web-able (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /11,841 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 gracefully, with no errors

Server metrics [RAM: ▲0.67MB] [CPU: ▲1.16ms] Passed 4 tests

Server-side resources used by BetPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6644.05 ▲3.61
Dashboard /wp-admin4.02 ▲0.7157.75 ▲7.65
Posts /wp-admin/edit.php4.07 ▲0.7156.68 ▲5.67
Add New Post /wp-admin/post-new.php6.55 ▲0.6691.78 ▼10.59
Media Library /wp-admin/upload.php3.88 ▲0.6544.73 ▲5.93
Bettings /wp-admin/admin.php?page=betpress-sports-and-events3.9038.27
BetPress /wp-admin/admin.php?page=betpress-settings3.9838.89
PayPal log /wp-admin/admin.php?page=bp-paypal3.8639.16
Auto insert data /wp-admin/admin.php?page=bp-auto-insert3.8643.98
Leaderboards /wp-admin/admin.php?page=bp-leaderboards3.8635.27

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 81 new files
Database: 8 new tables, 54 new options
New tables
wp_bp_bet_options
wp_bp_events
wp_bp_paypal
wp_bp_bet_events_cats
wp_bp_bet_events
wp_bp_slips
wp_bp_leaderboards
wp_bp_sports
New WordPress options
bp_featured_button_text_color
bp_min_stake
bp_lb_table_text_color
bp_cat_title_text_color
bp_paypal_success_message
bp_slip_subrow_bg_color
bp_one_win_per_cat
bp_event_title_bg_color
bp_db_version
bp_paypal_txn_ids
...

Browser metrics Passed 4 tests

Checking browser requirements for BetPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,051 ▲26513.95 ▼0.787.21 ▲5.4437.43 ▼7.45
Dashboard /wp-admin2,317 ▲1405.95 ▲0.29105.78 ▲9.2744.51 ▲5.17
Posts /wp-admin/edit.php2,177 ▲742.41 ▲0.3745.66 ▲4.7436.73 ▲3.55
Add New Post /wp-admin/post-new.php1,589 ▲6323.56 ▲0.32658.02 ▲14.1236.14 ▼28.55
Media Library /wp-admin/upload.php1,478 ▲784.57 ▲0.37101.65 ▼2.7444.37 ▼1.30
Bettings /wp-admin/admin.php?page=betpress-sports-and-events1,1232.1234.5532.53
BetPress /wp-admin/admin.php?page=betpress-settings4,7733.71155.9328.77
PayPal log /wp-admin/admin.php?page=bp-paypal9612.1029.4926.43
Auto insert data /wp-admin/admin.php?page=bp-auto-insert9552.1228.9628.08
Leaderboards /wp-admin/admin.php?page=bp-leaderboards9982.1032.0028.90

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_betpress_betslip
    • theysaidso_admin_options

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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/betpress/controllers/betpress-activation.php:253

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)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt is a good inspiration

betpress/BetPress.php 85% from 13 tests

"BetPress" version 1.0.1 Lite...'s main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Version: The version number should be digits and periods (ex. "1.0.3" instead of "1.0.1 Lite...")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("betpress.php" instead of "BetPress.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected17,144 lines of code in 70 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript102,1971,7529,784
PHP543,2711595,311
CSS410335823
PO File1308358687
HTML1154539

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions128
▷ Named functions128100.00%
▷ Anonymous functions00.00%
Constants28
▷ Global constants28100.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
8 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/delete-16.png0.43KB0.34KB▼ 21.90%
Documentation/assets/images/logo-wa.png4.79KB2.44KB▼ 49.01%
includes/images/edit-16.png0.62KB0.58KB▼ 6.92%
Documentation/assets/css/img/warning.png0.59KB0.50KB▼ 14.99%
includes/images/down-arrow-16.png0.28KB0.24KB▼ 15.97%