84% player-leaderboard

Code Review | Player Leaderboard

WordPress plugin Player Leaderboard scored84%from 54 tests.

About plugin

  • Plugin page: player-leaderboard
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9.2
  • WordPress version: 6.3.1
  • First release: Feb 5, 2021
  • Latest release: Mar 18, 2022
  • Number of updates: 7
  • Update frequency: every 58.1 days
  • Top authors: tharkun69 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,059 total downloads

Benchmarks

Plugin footprint 83% 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.04MB] [CPU: ▼1.73ms] Passed 4 tests

Analyzing server-side resources used by Player Leaderboard
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.21 ▼2.79
Dashboard /wp-admin3.35 ▲0.0445.39 ▼10.48
Posts /wp-admin/edit.php3.46 ▲0.1056.64 ▲11.82
Add New Post /wp-admin/post-new.php5.93 ▲0.0497.61 ▲6.08
Media Library /wp-admin/upload.php3.27 ▲0.0434.23 ▲0.28
New Result /wp-admin/admin.php?page=player-leaderboard-result3.4532.89
New Player /wp-admin/admin.php?page=player-leaderboard-player3.4940.37
New Results /wp-admin/admin.php?page=player-leaderboard-results-multiple3.3333.36
Players /wp-admin/admin.php?page=player-leaderboard-players3.2934.04
Results /wp-admin/admin.php?page=player-leaderboard-results3.3033.40
New Competition /wp-admin/admin.php?page=player-leaderboard-competition3.5733.33

Server storage [IO: ▲0.43MB] [DB: ▲0.08MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 41 new files
Database: 3 new tables, 7 new options
New tables
wp_player_leaderboard_player
wp_player_leaderboard_result
wp_player_leaderboard_competition
New WordPress options
widget_recent-comments
player_leaderboard_db_version
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Player Leaderboard
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,973 ▲23813.88 ▼0.6812.83 ▲10.7437.15 ▼8.57
Dashboard /wp-admin2,223 ▲354.87 ▼0.01109.17 ▼5.6141.17 ▼3.31
Posts /wp-admin/edit.php2,103 ▲142.01 ▲0.0439.83 ▼0.1834.02 ▼0.04
Add New Post /wp-admin/post-new.php1,540 ▲2623.44 ▲5.94602.98 ▼76.5651.34 ▲1.09
Media Library /wp-admin/upload.php1,405 ▲144.25 ▲0.05103.08 ▲2.5444.38 ▲1.04
New Result /wp-admin/admin.php?page=player-leaderboard-result7932.0336.9023.64
New Player /wp-admin/admin.php?page=player-leaderboard-player8352.0036.2724.20
New Results /wp-admin/admin.php?page=player-leaderboard-results-multiple7931.9726.6624.47
Players /wp-admin/admin.php?page=player-leaderboard-players8032.0027.3424.98
Results /wp-admin/admin.php?page=player-leaderboard-results8162.0025.6426.12
New Competition /wp-admin/admin.php?page=player-leaderboard-competition2,2462.6671.4731.39

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • player_leaderboard_db_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 21× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/player-leaderboard/public/partials/player-leaderboard-public-standing.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/player-leaderboard/admin/partials/player-leaderboard-results.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/player-leaderboard/admin/partials/player-leaderboard-players.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/player-leaderboard/admin/partials/player-leaderboard-results-multiple.php:16
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/player-leaderboard/public/partials/player-leaderboard-public-ranking.php on line 18
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/player-leaderboard/admin/class-player-leaderboard-players.php on line 20
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/player-leaderboard/admin/class-player-leaderboard-players.php on line 20
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/player-leaderboard/admin/class-player-leaderboard-results.php on line 20
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/player-leaderboard/admin/class-player-leaderboard-players.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/player-leaderboard/admin/class-player-leaderboard-admin.php:16

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: tennis, squash, rangliste, table tennis, ranking...

player-leaderboard/player-leaderboard.php Passed 13 tests

The main PHP file in "Player Leaderboard" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
34 characters long description:
Management of a player leaderboard

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin6,589 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP206721,0795,582
PO File1218429425
CSS59352352
JavaScript2290230

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity76.29
▷ Minimum class complexity2.00
▷ Maximum class complexity204.00
Average method complexity5.75
▷ Minimum method complexity1.00
▷ Maximum method complexity100.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods111
▷ Static methods87.21%
▷ Public methods8677.48%
▷ Protected methods00.00%
▷ Private methods2522.52%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
8 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
public/css/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
public/images/plus.png1.74KB1.47KB▼ 15.30%
public/css/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
public/images/minus.png0.94KB1.25KB0.00%