83% soccer-engine-lite

Code Review | Soccer Engine

WordPress plugin Soccer Engine scored83%from 54 tests.

About plugin

  • Plugin page: soccer-engine-lite
  • Plugin version: 1.10
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 22, 2022
  • Latest release: Mar 21, 2023
  • Number of updates: 6
  • Update frequency: every 65.3 days
  • Top authors: daext (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /1,960 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲2.27MB] [CPU: ▲1.93ms] Passed 4 tests

This is a short check of server-side resources used by Soccer Engine
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.08 ▲1.6247.41 ▲8.11
Dashboard /wp-admin5.82 ▲2.4862.14 ▼3.93
Posts /wp-admin/edit.php5.87 ▲2.5267.75 ▲14.44
Add New Post /wp-admin/post-new.php8.44 ▲2.56100.46 ▼10.92
Media Library /wp-admin/upload.php5.68 ▲2.4655.35 ▲18.66
Ranking Types /wp-admin/admin.php?page=daextsoenl-ranking-types6.4851.53
Options /wp-admin/admin.php?page=daextsoenl-options5.6647.19
Staff Award Types /wp-admin/admin.php?page=daextsoenl-staff-award-types6.4852.62
Player Awards /wp-admin/admin.php?page=daextsoenl-player-awards6.4953.20
Team Contract Types /wp-admin/admin.php?page=daextsoenl-team-contract-types6.4851.96
Unavailable Players /wp-admin/admin.php?page=daextsoenl-unavailable-players6.4952.88
Events /wp-admin/admin.php?page=daextsoenl-events6.5159.21
Unavailable Player Types /wp-admin/admin.php?page=daextsoenl-unavailable-player-types6.4849.17
Agency Contracts /wp-admin/admin.php?page=daextsoenl-agency-contracts6.4953.23
Competitions /wp-admin/admin.php?page=daextsoenl-competitions6.5779.59

Server storage [IO: ▲2.05MB] [DB: ▲0.05MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 435 new files
Database: 35 new tables, 68 new options
New tables
wp_daextsoenl_transfer
wp_daextsoenl_match
wp_daextsoenl_ranking_transition
wp_daextsoenl_competition
wp_daextsoenl_injury
wp_daextsoenl_staff_award_type
wp_daextsoenl_ranking_type
wp_daextsoenl_trophy
wp_daextsoenl_player_position
wp_daextsoenl_team_contract
...
New WordPress options
daextsoenl_table_header_background_color
daextsoenl_responsive_breakpoint_1
daextsoenl_default_trophy_type_logo_background_color
daextsoenl_table_pagination_disabled_background_color
daextsoenl_clock_border_color
daextsoenl_money_format_currency_position
daextsoenl_money_format_currency
daextsoenl_default_competition_logo_color
daextsoenl_money_format_thousands_symbol
daextsoenl_block_margin_top
...

Browser metrics Passed 4 tests

An overview of browser requirements for Soccer Engine
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,118 ▲35714.47 ▲0.192.63 ▲0.9437.67 ▼6.67
Dashboard /wp-admin2,475 ▲2955.69 ▲0.0492.59 ▼0.5540.06 ▼3.56
Posts /wp-admin/edit.php2,377 ▲2742.06 ▲0.0540.62 ▼3.6039.06 ▲1.24
Add New Post /wp-admin/post-new.php1,748 ▲20323.92 ▲0.72701.73 ▲76.4562.96 ▲3.06
Media Library /wp-admin/upload.php1,668 ▲2654.12 ▼0.0798.28 ▼1.4042.57 ▼0.99
Ranking Types /wp-admin/admin.php?page=daextsoenl-ranking-types1,1792.1432.8137.61
Options /wp-admin/admin.php?page=daextsoenl-options5,3634.37192.0336.20
Staff Award Types /wp-admin/admin.php?page=daextsoenl-staff-award-types1,1822.2231.9237.82
Player Awards /wp-admin/admin.php?page=daextsoenl-player-awards1,1312.2540.0133.40
Team Contract Types /wp-admin/admin.php?page=daextsoenl-team-contract-types1,1711.9230.6637.89
Unavailable Players /wp-admin/admin.php?page=daextsoenl-unavailable-players1,1132.2641.3931.23
Events /wp-admin/admin.php?page=daextsoenl-events1,1142.1529.8833.10
Unavailable Player Types /wp-admin/admin.php?page=daextsoenl-unavailable-player-types1,1822.1032.9337.60
Agency Contracts /wp-admin/admin.php?page=daextsoenl-agency-contracts1,1332.3229.9532.39
Competitions /wp-admin/admin.php?page=daextsoenl-competitions7,1265.93211.2533.53

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 41× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/soccer-engine-lite/admin/view/events_wizard.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/soccer-engine-lite/admin/view/staff_types.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/soccer-engine-lite/admin/view/maintenance.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/soccer-engine-lite/admin/view/help.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/soccer-engine-lite/admin/view/transfers.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/soccer-engine-lite/admin/view/agencies.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/soccer-engine-lite/admin/view/unavailable_player_types.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/soccer-engine-lite/admin/view/events.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/soccer-engine-lite/admin/view/ranking_transitions.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/soccer-engine-lite/admin/view/unavailable_players.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

soccer-engine-lite/init.php 92% from 13 tests

This is the main PHP file of "Soccer Engine" version 1.10, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("soccer-engine-lite.php" instead of "init.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin34,403 lines of code in 154 files:
LanguageFilesBlank linesComment linesLines of code
PHP535,6743,57720,955
JavaScript591,1551,0665,257
CSS298322594,744
XML1003,331
SVG110097
Markdown14019

PHP code 0% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 1,182)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 138)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity237.33
▷ Minimum class complexity24.00
▷ Maximum class complexity1,182.00
Average method complexity5.56
▷ Minimum method complexity1.00
▷ Maximum method complexity138.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods466
▷ Static methods71.50%
▷ Public methods38883.26%
▷ Protected methods00.00%
▷ Private methods7816.74%
Functions84
▷ Named functions3136.90%
▷ Anonymous functions5363.10%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
269 compressed PNG files occupy 0.20MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/assets/img/flags/flat/16/VE.png0.29KB0.30KB0.00%
public/assets/img/flags/flat/16/DE.png0.10KB0.12KB0.00%
public/assets/img/flags/flat/16/AW.png0.18KB0.19KB0.00%
public/assets/img/flags/flat/16/PG.png0.43KB0.47KB0.00%
public/assets/img/flags/flat/16/CA.png0.17KB0.17KB0.00%