10% fantasy-sports

Code Review | Fan Victor

WordPress plugin Fan Victor scored 10% from 54 tests.

About plugin

  • Plugin page: fantasy-sports
  • Plugin version: 2.1.52
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.3
  • WordPress version: 5.9.2
  • First release: Oct 1, 2014
  • Latest release: Dec 20, 2018
  • Number of updates: 300
  • Update frequency: every 5.1 days
  • Top authors: quarta77 (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

40+ active / 13,982 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/fantasy-sports/fanvictor.php+207
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼0.27MB] [CPU: ▼328.21ms] Passed 4 tests

Analyzing server-side resources used by Fan Victor
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.07 ▲0.5613.77 ▼36.95
Dashboard /wp-admin4.13 ▲0.7214.85 ▼19.76
Posts /wp-admin/edit.php4.13 ▲0.4913.28 ▼23.06
Add New Post /wp-admin/post-new.php4.13 ▼2.8415.36 ▼1,233.07
Media Library /wp-admin/upload.php4.13 ▲0.8313.75 ▼9.00
Manage Contests /wp-admin/admin.php?page=manage-contests4.2215.08
Manage Withdrawls /wp-admin/admin.php?page=withdrawls4.2215.69
Add Contests /wp-admin/admin.php?page=add-contests4.2215.69
Manage Events /wp-admin/admin.php?page=manage-pools4.2216.33
Add Fighters /wp-admin/admin.php?page=add-fighters4.2215.64
Event Statistics /wp-admin/admin.php?page=statistic4.2215.41
Manage Player Positions /wp-admin/admin.php?page=manage-playerposition4.2215.49
Manage Fighters /wp-admin/admin.php?page=manage-fighters4.2215.76
Manage Sports /wp-admin/admin.php?page=manage-sports4.2215.51
Add Events /wp-admin/admin.php?page=add-pools4.2215.29

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 639 new files
Database: 6 new tables, 46 new options
New tables
wp_user_payment
wp_user_teams
wp_withdrawls
wp_user_extended
wp_fundhistory
wp_firebase_tokens
New WordPress options
fanvictor_paypal_pro_signature
fanvictor_league_size
fanvictor_flutterwave_merchant_key
fanvictor_flutterwave_cvv
fanvictor_fee_percentage
fanvictor_entry_fee
fanvictor_priority_password
fanvictor_no_invite_user_list
paypal_test
fanvictor_priority_credit_card_expiration_date
...

Browser metrics Passed 4 tests

An overview of browser requirements for Fan Victor
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,012 ▲25815.96 ▲0.386.51 ▲0.706.13 ▲3.58
Dashboard /wp-admin2,999 ▲1456.17 ▼0.07117.22 ▼15.90155.97 ▼1.49
Posts /wp-admin/edit.php2,794 ▲1063.23 ▼0.0163.09 ▼0.49138.60 ▼2.36
Add New Post /wp-admin/post-new.php1,766 ▲10522.29 ▲5.44405.08 ▼24.09153.33 ▼5.88
Media Library /wp-admin/upload.php1,805 ▲1105.55 ▲0.02143.19 ▼7.73189.91 ▲3.30
Manage Contests /wp-admin/admin.php?page=manage-contests1,6513.3963.32101.86
Manage Withdrawls /wp-admin/admin.php?page=withdrawls1,4183.1763.20102.96
Add Contests /wp-admin/admin.php?page=add-contests1,1183.3664.51101.21
Manage Events /wp-admin/admin.php?page=manage-pools1,4093.0959.92102.20
Add Fighters /wp-admin/admin.php?page=add-fighters1,1123.1560.9198.66
Event Statistics /wp-admin/admin.php?page=statistic1,4052.8968.47103.71
Manage Player Positions /wp-admin/admin.php?page=manage-playerposition1,3622.4855.10101.63
Manage Fighters /wp-admin/admin.php?page=manage-fighters1,3652.4554.22101.33
Manage Sports /wp-admin/admin.php?page=manage-sports1,3292.8462.1199.84
Add Events /wp-admin/admin.php?page=add-pools1,1153.1559.7298.87

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/fantasy-sports/fanvictor.php+207
    Trying to access array offset on value of type bool
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_user_teams

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 20 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-pools
    • > Notice in wp-content/plugins/fantasy-sports/fanvictor.php+207
    Trying to access array offset on value of type bool
  • 57 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-pools
    • > Notice in wp-content/plugins/fantasy-sports/controller/admin/fanvictor-pools.php+109
    Trying to access array offset on value of type null

SRP 0% 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
  • 12× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/fantasy-sports/views/block/userbalance.html.php
    • > /wp-content/plugins/fantasy-sports/views/Elements/live_entries.php
    • > /wp-content/plugins/fantasy-sports/views/Elements/contest_detail_tab_prize.php
    • > /wp-content/plugins/fantasy-sports/views/Elements/paypal_normal.php
    • > /wp-content/plugins/fantasy-sports/views/dlg_info.php
    • > /wp-content/plugins/fantasy-sports/views/Elements/dashboard_stats_chart.php
    • > /wp-content/plugins/fantasy-sports/views/Elements/qq_template.php
    • > /wp-content/plugins/fantasy-sports/views/Elements/lobby_list.php
    • > /wp-content/plugins/fantasy-sports/views/Elements/live_point.php
    • > /wp-content/plugins/fantasy-sports/views/Elements/user_summary.php
  • 650× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/fantasy-sports/views/Elements/entry/normal.php on line 17
    • > PHP Warning
      Use of undefined constant FANVICTOR__PLUGIN_DIR_VIEW_ELEMENT - assumed 'FANVICTOR__PLUGIN_DIR_VIEW_ELEMENT' (this will throw an Error in a future version of PHP) in wp-content/plugins/fantasy-sports/views/Elements/result/survival.php on line 7
    • > PHP Notice
      Undefined variable: league in wp-content/plugins/fantasy-sports/views/Elements/result/livedraft.php on line 13
    • > PHP Notice
      Undefined variable: players in wp-content/plugins/fantasy-sports/views/Elements/livescore/injuries.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/fantasy-sports/model/admin/emailTemplates/survival_reminder.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/fantasy-sports/views/Elements/livescore/roster.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/fantasy-sports/views/players/class.table-players.php:2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/fantasy-sports/views/Elements/live_point.php on line 24
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/fantasy-sports/lib/moneywave/vendor/guzzlehttp/promises/src/EachPromise.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'HngX\\Moneywave\\MoneywaveApiClient' not found in wp-content/plugins/fantasy-sports/lib/moneywave/vendor/hngx/moneywave-php/src/Resources/Resource.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=add-fighters
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=add-fighters 0:0 Uncaught SyntaxError: Unexpected token u in JSON at position 0
    • > GET request to /wp-admin/admin.php?page=add-pools
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=add-pools 0:0 Uncaught SyntaxError: Unexpected token u in JSON at position 0

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (The lobby bock lists the contests a user can join.), #2 (Game Summary block indicates your all time stats.), #3 (Create a contest from any major sport.), #4 (Live, Upcoming and Historical game blocks available as well.), #5 (Back End administration to create your own pool in any major sport.), #6 (Here are all the admin functions available to site admins.)
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === fantasy-sports === )
The official readme.txt is a good inspiration

fantasy-sports/fanvictor.php 85% from 13 tests

The primary PHP file in "Fan Victor" version 2.1.52 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 333 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("fantasy-sports.php" instead of "fanvictor.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Please fix the following items
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/fantasy-sports/model/api_cert_chain.crt
119,783 lines of code in 537 files:
LanguageFilesBlank linesComment linesLines of code
PHP4164,5796,07741,492
CSS2123418738,039
JavaScript505,52911,90733,424
Markdown1094503,275
Sass1323241,256
LESS1323331,247
SVG200539
JSON700465
YAML17034
make1409
XML3003

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity22.31
▷ Minimum class complexity1.00
▷ Maximum class complexity691.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces13
Interfaces14
Traits3
Classes172
▷ Abstract classes10.58%
▷ Concrete classes17199.42%
▷ Final classes74.09%
Methods1,852
▷ Static methods46425.05%
▷ Public methods1,54983.64%
▷ Protected methods201.08%
▷ Private methods28315.28%
Functions201
▷ Named functions10451.74%
▷ Anonymous functions9748.26%
Constants184
▷ Global constants11059.78%
▷ Class constants7440.22%
▷ Public constants74100.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
52 PNG files occupy 3.78MB with 2.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-6.png44.96KB14.01KB▼ 68.83%
_inc/image/cheesecoin.png7.16KB6.82KB▼ 4.78%
(invalid) _inc/css/ui/image/ui-bg_diagonals-thick_20_666666_40x40.png0.25KB0.00KB▼ 100.00%
_inc/image/fttech.png7.67KB3.58KB▼ 53.30%
assets/screenshot-2.png23.11KB7.97KB▼ 65.52%