10% prediction-league

Code Review | Prediction League

WordPress plugin Prediction League scored10%from 54 tests.

About plugin

  • Plugin page: prediction-league
  • Plugin version: 2.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9.1
  • WordPress version: 6.3.1
  • First release: Jul 29, 2014
  • Latest release: Jul 29, 2014
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: jimmi2times (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,971 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Error in wp-content/plugins/prediction-league/admin.php+42
    Uncaught Error: Call to undefined function mysql_real_escape_string() in wp-content/plugins/prediction-league/admin.php:42
    Stack trace:
    #0 wp-admin/includes/plugin.php(2318): include_once()
    #1 wp-admin/includes/plugin.php(663): plugin_sandbox_scrape()

Server metrics [RAM: ▲0.00MB] [CPU: ▼1.52ms] Passed 4 tests

This is a short check of server-side resources used by Prediction League
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0033.66 ▼4.46
Dashboard /wp-admin3.31 ▲0.0043.47 ▼0.81
Posts /wp-admin/edit.php3.36 ▲0.0044.24 ▲0.14
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.74 ▼0.28
Media Library /wp-admin/upload.php3.23 ▲0.0034.12 ▼0.52

Server storage [IO: ▲0.47MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 47 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Prediction League: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.37 ▼0.011.84 ▲0.3050.62 ▲11.33
Dashboard /wp-admin2,192 ▲155.63 ▼0.0388.42 ▲0.5642.17 ▲2.30
Posts /wp-admin/edit.php2,097 ▼31.98 ▼0.0238.89 ▲2.6434.80 ▲0.03
Add New Post /wp-admin/post-new.php1,526 ▼023.13 ▼0.08650.29 ▼32.8052.19 ▼12.01
Media Library /wp-admin/upload.php1,403 ▲34.19 ▼0.0294.56 ▼18.3241.92 ▼4.93

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/prediction-league/styles.php
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pl_get_number_of_competitions() in wp-content/plugins/prediction-league/view.php:20
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/prediction-league/view.php on line 19
    • > PHP Notice
      Undefined offset: 2 in wp-content/plugins/prediction-league/styles.php on line 8
    • > PHP Warning
      implode(): Invalid arguments passed in wp-content/plugins/prediction-league/import_competition.php on line 151
    • > PHP Notice
      Undefined offset: 1 in wp-content/plugins/prediction-league/styles.php on line 7
    • > PHP Warning
      file(): Filename cannot be empty in wp-content/plugins/prediction-league/import_competition.php on line 151
    • > PHP Notice
      Undefined index: pluginurl in wp-content/plugins/prediction-league/styles.php on line 10
    • > PHP Notice
      Undefined variable: pl_options in wp-content/plugins/prediction-league/view.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/prediction-league/admin.php:17
    • > PHP Notice
      Undefined index: colors in wp-content/plugins/prediction-league/styles.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 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
5 plugin tags: bracket game, soccer, football, prediction league, tippspiel

prediction-league/admin.php 92% from 13 tests

The main PHP script in "Prediction League" version 2.1.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("prediction-league.php" instead of "admin.php")

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
Success! There were no dangerous files found in this plugin6,981 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
XML2003,362
PHP73134262,634
JavaScript5261285836
HTML2120112
CSS1222137

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions81
▷ Named functions81100.00%
▷ Anonymous functions00.00%
Constants226
▷ Global constants226100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 compressed PNG files occupy 0.02MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
color_picker/color_picker_files/images/mask.png12.36KB18.69KB0.00%
graphics/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%