84% football-predictor

Code Review | Football Predictor

WordPress plugin Football Predictor scored 84% from 54 tests.

About plugin

  • Plugin page: football-predictor
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 6.3-6.3
  • WordPress version: 6.3.1
  • First release: Feb 10, 2018
  • Latest release: Aug 9, 2023
  • Number of updates: 22
  • Update frequency: every 91.2 days
  • Top authors: BigTonny (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,689 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
Installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼8.37ms] Passed 4 tests

Server-side resources used by Football Predictor
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0737.04 ▼8.39
Dashboard /wp-admin3.45 ▲0.1545.85 ▼6.17
Posts /wp-admin/edit.php3.51 ▲0.1548.51 ▼5.78
Add New Post /wp-admin/post-new.php5.99 ▲0.1082.74 ▼13.12
Media Library /wp-admin/upload.php3.31 ▲0.0932.89 ▲2.91
Overview /wp-admin/admin.php?page=fp_menu3.3043.03
Predictions /wp-admin/admin.php?page=fp_predictions3.3041.28
Teams and Matches /wp-admin/admin.php?page=fp_config3.2842.88

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 79 new files
Database: 5 new tables, 19 new options
New tables
wp_fp_prediction
wp_fp_stage
wp_fp_team
wp_fp_venue
wp_fp_match
New WordPress options
fp_group_stats
fp_db_version
fp_nag
widget_recent-comments
fp_show_predictions
fp_adjust_knockout
widget_recent-posts
widget_football-predictorstandings
theysaidso_admin_options
can_compress_scripts
...

Browser metrics Passed 4 tests

An overview of browser requirements for Football Predictor
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,947 ▲21213.85 ▼0.436.99 ▲5.1839.98 ▼11.53
Dashboard /wp-admin2,243 ▲525.22 ▲0.1599.19 ▼5.6784.87 ▲44.69
Posts /wp-admin/edit.php2,132 ▲402.61 ▲0.6050.43 ▲12.0237.44 ▲2.93
Add New Post /wp-admin/post-new.php1,564 ▲3023.68 ▲0.53758.94 ▲78.7736.25 ▼27.74
Media Library /wp-admin/upload.php1,418 ▲274.56 ▲0.4099.89 ▲2.9967.68 ▲25.20
Overview /wp-admin/admin.php?page=fp_menu1,2002.3746.6930.81
Predictions /wp-admin/admin.php?page=fp_predictions1,4252.2138.1371.49
Teams and Matches /wp-admin/admin.php?page=fp_config1,5062.0739.5043.96

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 14 options in the database
    • fp_user_predictions
    • fp_match_predictions
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_football-predictorstandings
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • widget_football-predictoruser
    • ...

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
The smoke test was a success, however most plugin functionality was not tested

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 fix the following
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'FootballAdmin' not found in wp-content/plugins/football-predictor/admin/class-fp-results.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'FootballAdmin' not found in wp-content/plugins/football-predictor/admin/class-fp-overview.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'FootballAdmin' not found in wp-content/plugins/football-predictor/admin/class-fp-scoring.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'FootballAdmin' not found in wp-content/plugins/football-predictor/admin/class-fp-venues.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'FootballAdmin' not found in wp-content/plugins/football-predictor/admin/class-fp-matches.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'FootballAdmin' not found in wp-content/plugins/football-predictor/admin/class-fp-predictions.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'FootballAdmin' not found in wp-content/plugins/football-predictor/admin/class-fp-teams.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'FootballAdmin' not found in wp-content/plugins/football-predictor/admin/class-fp-stages.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Football' not found in wp-content/plugins/football-predictor/admin/class-fp-admin.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'FootballAdmin' not found in wp-content/plugins/football-predictor/admin/class-fp-menu.php:9

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 97% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Tags: There are too many tags (15 tag instead of maximum 10)
The official readme.txt is a good inspiration

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

The main PHP script in "Football Predictor" version 1.0.7 is automatically included on every request by WordPress
80 characters long description:
To manage and perform a marvel football competition for the FIFA World Cup 2018.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected4,770 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP188356934,033
CSS47765586
JavaScript33048151

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity26.74
▷ Minimum class complexity1.00
▷ Maximum class complexity160.00
Average method complexity4.62
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods135
▷ Static methods10.74%
▷ Public methods10577.78%
▷ Protected methods00.00%
▷ Private methods3022.22%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
51 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
images/predictions.png3.45KB0.84KB▼ 75.74%
images/hrv.png0.51KB0.63KB0.00%
images/irn.png0.50KB0.68KB0.00%
images/rus.png0.41KB0.64KB0.00%