68% football-pool

Code Review | Football Pool

WordPress plugin Football Pool scored68%from 54 tests.

About plugin

  • Plugin page: football-pool
  • Plugin version: 2.11.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3.1
  • WordPress version: 6.3.1
  • First release: Apr 4, 2012
  • Latest release: Sep 18, 2023
  • Number of updates: 665
  • Update frequency: every 6.3 days
  • Top authors: AntoineH (100%)

Code review

54 tests

User reviews

77 reviews

Install metrics

1,000+ active /76,703 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
Install script ran successfully

Server metrics [RAM: ▲2.48MB] [CPU: ▲20.20ms] Passed 4 tests

An overview of server-side resources used by Football Pool
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.15 ▲1.6956.76 ▲13.59
Dashboard /wp-admin6.13 ▲2.7875.20 ▲10.76
Posts /wp-admin/edit.php6.17 ▲2.8285.36 ▲35.46
Add New Post /wp-admin/post-new.php8.61 ▲2.73124.52 ▲28.93
Media Library /wp-admin/upload.php5.95 ▲2.7264.80 ▲27.52
Help /wp-admin/admin.php?page=footballpool-help5.9569.99
Teams /wp-admin/admin.php?page=footballpool-teams5.9576.07
Venues /wp-admin/admin.php?page=footballpool-venues5.9565.92
Rankings /wp-admin/admin.php?page=footballpool-rankings5.9563.76
Groups /wp-admin/admin.php?page=footballpool-groups5.9565.34
Shoutbox /wp-admin/admin.php?page=footballpool-shoutbox5.9566.12
Users /wp-admin/admin.php?page=footballpool-users5.9657.74
Audit Log /wp-admin/admin.php?page=footballpool-predictions-audit-log5.9566.06
Match Types /wp-admin/admin.php?page=footballpool-matchtypes5.9566.35
Plugin Options /wp-admin/admin.php?page=footballpool-options6.0866.15

Server storage [IO: ▲2.49MB] [DB: ▲0.03MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 192 new files
Database: 19 new tables, 12 new options
New tables
pool_wp_stadiums
pool_wp_predictions_audit_log
pool_wp_matchtypes
pool_wp_bonusquestions_type
pool_wp_shoutbox
pool_wp_rankings_bonusquestions
pool_wp_matches
pool_wp_predictions
pool_wp_teams
pool_wp_seasons
...
New WordPress options
widget_recent-comments
footballpool_plugin_options
widget_footballpoollastgameswidget
can_compress_scripts
theysaidso_admin_options
widget_footballpoolgroupwidget
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_footballpoolnextpredictionwidget
...

Browser metrics Passed 4 tests

An overview of browser requirements for Football Pool
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,409 ▲64815.69 ▲1.687.72 ▲5.8440.48 ▼7.47
Dashboard /wp-admin2,554 ▲3546.91 ▲1.08136.27 ▲19.2378.63 ▲41.07
Posts /wp-admin/edit.php2,436 ▲3393.77 ▲1.7459.04 ▲20.5636.34 ▼1.00
Add New Post /wp-admin/post-new.php1,626 ▲9523.29 ▲0.05694.69 ▼15.6337.92 ▼22.68
Media Library /wp-admin/upload.php1,573 ▲1764.53 ▲0.3088.02 ▼30.7947.59 ▼5.00
Help /wp-admin/admin.php?page=footballpool-help6,5293.4748.11129.04
Teams /wp-admin/admin.php?page=footballpool-teams1,3133.4750.7828.16
Venues /wp-admin/admin.php?page=footballpool-venues1,2423.4548.5825.55
Rankings /wp-admin/admin.php?page=footballpool-rankings1,2643.4649.2629.55
Groups /wp-admin/admin.php?page=footballpool-groups1,2433.4549.2227.20
Shoutbox /wp-admin/admin.php?page=footballpool-shoutbox1,2383.4650.3829.63
Users /wp-admin/admin.php?page=footballpool-users1,4633.4643.5024.38
Audit Log /wp-admin/admin.php?page=footballpool-predictions-audit-log1,2433.4249.5728.21
Match Types /wp-admin/admin.php?page=footballpool-matchtypes1,2543.3845.6925.12
Plugin Options /wp-admin/admin.php?page=footballpool-options3,4134.46103.8258.04

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie tables were found after uninstall: 19 tables
    • pool_wp_rankings
    • pool_wp_seasons
    • pool_wp_matches
    • pool_wp_rankings_matches
    • pool_wp_groups
    • pool_wp_league_users
    • pool_wp_predictions_audit_log
    • pool_wp_matchtypes
    • pool_wp_predictions
    • pool_wp_teams
    • ...
  • Zombie WordPress options detected upon uninstall: 12 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_footballpoolrankingwidget
    • widget_footballpoolshoutboxwidget
    • footballpool_plugin_options
    • widget_footballpoolgroupwidget
    • db_upgraded
    • widget_footballpoolnextpredictionwidget
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 8× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/football-pool/assets/admin/tinymce/tinymce-dialog.php
    • > /wp-content/plugins/football-pool/widgets/widget-football-pool-group.php
    • > /wp-content/plugins/football-pool/admin/timezone-test.php
    • > /wp-content/plugins/football-pool/widgets/widget-football-pool-shoutbox.php
    • > /wp-content/plugins/football-pool/widgets/widget-football-pool-ranking.php
    • > /wp-content/plugins/football-pool/classes/class-football-pool-widget.php
    • > /wp-content/plugins/football-pool/widgets/widget-football-pool-next-prediction.php
    • > /wp-content/plugins/football-pool/widgets/widget-football-pool-lastgames.php
  • 25× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI' not found in wp-content/plugins/football-pool/cli/class-football-pool-cli-create-test-data.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Football_Pool_Admin' not found in wp-content/plugins/football-pool/admin/class-football-pool-admin-predictions-audit-log.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Football_Pool_Admin' not found in wp-content/plugins/football-pool/admin/class-football-pool-admin-games.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Football_Pool_Admin' not found in wp-content/plugins/football-pool/admin/class-football-pool-admin-teams.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Football_Pool_Admin' not found in wp-content/plugins/football-pool/admin/class-football-pool-admin-options.php:10
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/football-pool/define.php on line 32
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/football-pool/define.php on line 32
    • > PHP Fatal error
      Uncaught Error: Class 'Football_Pool_Teams' not found in wp-content/plugins/football-pool/classes/class-football-pool-team.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/football-pool/define.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI' not found in wp-content/plugins/football-pool/cli/class-football-pool-cli-import-match-results.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: sports, fifa, prediction, football, world cup...

football-pool/football-pool.php Passed 13 tests

This is the main PHP file of "Football Pool" version 2.11.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
123 characters long description:
This plugin adds a fantasy sports pool to your blog. Play against other users, predict outcomes of matches and earn points.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin23,037 lines of code in 97 files:
LanguageFilesBlank linesComment linesLines of code
PHP562,5703,11618,432
Sass14304191,920
JavaScript161762501,665
CSS93880960
SVG21760

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 106)
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity45.88
▷ Minimum class complexity1.00
▷ Maximum class complexity316.00
Average method complexity4.67
▷ Minimum method complexity1.00
▷ Maximum method complexity106.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes49
▷ Abstract classes12.04%
▷ Concrete classes4897.96%
▷ Final classes00.00%
Methods597
▷ Static methods35859.97%
▷ Public methods38764.82%
▷ Protected methods193.18%
▷ Private methods19131.99%
Functions48
▷ Named functions2756.25%
▷ Anonymous functions2143.75%
Constants101
▷ Global constants4847.52%
▷ Class constants5352.48%
▷ Public constants53100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
58 PNG files occupy 0.87MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/images/example-bonus-user-answers-2.png36.99KB16.20KB▼ 56.20%
assets/libs/jquery-ui/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
assets/libs/jquery-ui/images/ui-icons_469bdd_256x240.png4.44KB4.17KB▼ 6.02%
assets/images/league-money-green.png1.29KB1.32KB0.00%
assets/favicons/apple-touch-icon-72x72.png8.06KB3.58KB▼ 55.60%