57% wp-championship

Code Review | wp-championship

WordPress plugin wp-championship scored57%from 54 tests.

About plugin

  • Plugin page: wp-championship
  • Plugin version: 10.1
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.3
  • WordPress version: 6.3.1
  • First release: May 27, 2008
  • Latest release: Sep 2, 2023
  • Number of updates: 217
  • Update frequency: every 25.7 days
  • Top authors: tuxlog (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /27,880 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼6.64ms] Passed 4 tests

This is a short check of server-side resources used by wp-championship
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0736.51 ▼0.13
Dashboard /wp-admin3.38 ▲0.0345.16 ▼14.76
Posts /wp-admin/edit.php3.43 ▲0.0745.31 ▲0.18
Add New Post /wp-admin/post-new.php5.96 ▲0.0781.09 ▼11.85
Media Library /wp-admin/upload.php3.30 ▲0.0737.00 ▲1.89
Labels /wp-admin/admin.php?page=wp-championship/cs_admin_labels.php3.3753.24
Player /wp-admin/admin.php?page=wp-championship/cs_admin_users.php3.2737.40
Stats /wp-admin/admin.php?page=wp-championship/cs_admin_stats.php3.2533.47
Preliminary /wp-admin/admin.php?page=wp-championship/cs_admin_match.php3.2735.74
Guessing-game /wp-admin/users.php?page=wpcs-usertipp3.2944.33
Finals /wp-admin/admin.php?page=wp-championship/cs_admin_finals.php3.2733.65
Teams /wp-admin/admin.php?page=wp-championship/cs_admin_team.php3.2733.21
Guessing-game /wp-admin/admin.php?page=wp-championship/cs_admin.php3.2943.23

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 385 new files
Database: 5 new tables, 26 new options
New tables
cs_users
cs_tippgroup
cs_team
cs_match
cs_tipp
New WordPress options
cs_pts_looser
cs_pts_goalsum
cs_pts_tipp
cs_final_teams
cs_goalsum
cs_modus
widget_wp-championship-tippgroup
cs_lock_round1
cs_rank_trend
theysaidso_admin_options
...

Browser metrics Passed 4 tests

An overview of browser requirements for wp-championship
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,965 ▲17913.52 ▼0.837.65 ▲5.7440.23 ▲0.88
Dashboard /wp-admin2,250 ▲755.60 ▼0.1181.15 ▼22.2974.95 ▲35.71
Posts /wp-admin/edit.php2,152 ▲552.01 ▼0.0034.85 ▼2.8035.30 ▲0.33
Add New Post /wp-admin/post-new.php1,571 ▲4023.18 ▲0.26743.25 ▲116.8257.91 ▲6.11
Media Library /wp-admin/upload.php1,455 ▲524.17 ▼0.0092.60 ▼3.1669.44 ▲27.51
Labels /wp-admin/admin.php?page=wp-championship/cs_admin_labels.php1,6701.9633.5332.80
Player /wp-admin/admin.php?page=wp-championship/cs_admin_users.php1,1092.0023.5930.10
Stats /wp-admin/admin.php?page=wp-championship/cs_admin_stats.php8962.0325.6526.69
Preliminary /wp-admin/admin.php?page=wp-championship/cs_admin_match.php9772.0025.6529.44
Guessing-game /wp-admin/users.php?page=wpcs-usertipp9142.0026.7331.88
Finals /wp-admin/admin.php?page=wp-championship/cs_admin_finals.php1,1312.0024.6629.20
Teams /wp-admin/admin.php?page=wp-championship/cs_admin_team.php1,0382.1321.8724.30
Guessing-game /wp-admin/admin.php?page=wp-championship/cs_admin.php1,3851.7825.9434.63

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The plugin did not uninstall successfully, leaving 5 tables in the database
    • cs_tippgroup
    • cs_match
    • cs_users
    • cs_tipp
    • cs_team
  • Zombie WordPress options were found after uninstall: 26 options
    • cs_rank_trend
    • cs_pts_goalsum
    • cs_pts_oneside
    • can_compress_scripts
    • cs_pts_deuce
    • widget_theysaidso_widget
    • cs_pts_supertipp
    • widget_wp-championship-tippgroup
    • theysaidso_admin_options
    • widget_recent-comments
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=wp-championship/cs_admin_stats.php
    • > Notice in wp-content/plugins/wp-championship/functions.php+1341
    Trying to get property 'wteam' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-championship/cs_admin_stats.php
    • > Notice in wp-content/plugins/wp-championship/functions.php+1359
    Trying to get property 'name' of non-object

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-championship/func-pie.php
    • > /wp-content/plugins/wp-championship/cs-usertipp.php
    • > /wp-content/plugins/wp-championship/cs-stats.php
  • 14× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined offset: 0 in wp-content/plugins/wp-championship/func-pie.php on line 76
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/class-IXR.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-championship/class-wpc-xmlrpc.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_file_name() in wp-content/plugins/wp-championship/cs-userstats.php:25
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-championship/class-wpc-xmlrpc.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-championship/wpc-autoupdate.php:73
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-championship/globals.php on line 35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_file_name() in wp-content/plugins/wp-championship/cs-groupstats.php:24
    • > PHP Warning
      require_once(ABSPATHwp-includes/class-IXR.php): failed to open stream: No such file or directory in wp-content/plugins/wp-championship/class-wpc-xmlrpc.php on line 25
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-championship/globals.php on line 35
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-championship/class-cs-widget-tippgroup.php:27

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/users.php?page=wpcs-usertipp
    • > Javascript (severe) in unknown
    /wp-admin/users.php?page=wpcs-usertipp 147:31 Uncaught SyntaxError: Unexpected token '&'

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
8 plugin tags: soccer, team, plugin, game, guessing...

wp-championship/wp-championship.php Passed 13 tests

Analyzing the main PHP file in "wp-championship" version 10.1
103 characters long description:
wp-championship is a plugin for wordpress letting you play a guessing game of a tournament e.g. soccer.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin12,932 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PHP271,2592,1677,757
SQL202244403,406
PO File26268111,286
JavaScript55964245
CSS23827222
make13316

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity55.00
▷ Minimum class complexity25.00
▷ Maximum class complexity107.00
Average method complexity8.71
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods14.76%
▷ Public methods1361.90%
▷ Protected methods838.10%
▷ Private methods00.00%
Functions77
▷ Named functions6787.01%
▷ Anonymous functions1012.99%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
234 PNG files occupy 0.62MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icons/wm2018/cr.png3.20KB2.73KB▼ 14.77%
icons/borussia-moenchengladbach-wappen.png2.29KB1.72KB▼ 25.05%
icons/wm2022/switzerland.png0.43KB0.24KB▼ 43.61%
worldcup-icon.png0.81KB0.91KB0.00%
icons/hrv.png2.56KB2.07KB▼ 19.07%