10% leaderboard-lite

Code Review | LeaderBoard Plugin

WordPress plugin LeaderBoard Plugin scored10%from 54 tests.

About plugin

  • Plugin page: leaderboard-lite
  • Plugin version: 1.24
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.2.1
  • WordPress version: 6.3.1
  • First release: Apr 16, 2019
  • Latest release: Jul 10, 2019
  • Number of updates: 41
  • Update frequency: every 2.2 days
  • Top authors: crossfitatgg (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /2,330 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/leaderboard-lite/admin/ajax/event-competitors.php+5
    Undefined variable: wpdb

Server metrics [RAM: ▲0.62MB] [CPU: ▲8.87ms] Passed 4 tests

This is a short check of server-side resources used by LeaderBoard Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.25 ▲0.7854.88 ▲11.25
Dashboard /wp-admin3.96 ▲0.6557.48 ▲6.98
Posts /wp-admin/edit.php4.01 ▲0.6556.41 ▲11.24
Add New Post /wp-admin/post-new.php6.47 ▲0.59108.39 ▲11.84
Media Library /wp-admin/upload.php3.80 ▲0.5741.72 ▲6.00
Scores /wp-admin/admin.php?page=event_scores3.8149.04
Categories /wp-admin/edit-tags.php?taxonomy=article_cats&post_type=lbd_article3.8243.10
Add New /wp-admin/post-new.php?post_type=lbd_article4.0058.64
Event LB /wp-admin/admin.php?page=event_leaderboard3.7939.07
Workouts /wp-admin/admin.php?page=event_workouts3.8344.21
All Articles /wp-admin/edit.php?post_type=lbd_article3.8749.83
Divisions /wp-admin/admin.php?page=event_divisions3.7942.73
Competitions /wp-admin/admin.php?page=event_competitions3.8345.29
Events /wp-admin/admin.php?page=event_events3.8439.48
Competitors /wp-admin/admin.php?page=event_competitors3.8136.01

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 410 new files
Database: 8 new tables, 15 new options
New tables
wp_lbd_event_registration_transaction
wp_lbd_event_scores
wp_lbd_event_divisions
wp_lbd_event_registeredEvents
wp_lbd_event_participants
wp_lbd_event_workouts
wp_lbd_event_competitions
wp_lbd_event_events
New WordPress options
widget_recent-posts
can_compress_scripts
LeaderBoard_eventspage
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
LBD_db_version
widget_recent-comments
LeaderBoard_Payment
LeaderBoard_eventMyAccount
...

Browser metrics Passed 4 tests

Checking browser requirements for LeaderBoard Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,471 ▲68519.58 ▲5.20224.05 ▲222.1448.12 ▲6.08
Dashboard /wp-admin2,443 ▲2726.45 ▲0.87110.25 ▲17.2237.04 ▼4.42
Posts /wp-admin/edit.php2,384 ▲2874.00 ▲1.9752.40 ▲15.2735.48 ▲0.59
Add New Post /wp-admin/post-new.php1,624 ▲9623.50 ▼0.12664.63 ▼10.2345.93 ▼18.80
Media Library /wp-admin/upload.php1,518 ▲1184.56 ▲0.3383.06 ▼30.2044.55 ▼2.52
Scores /wp-admin/admin.php?page=event_scores1,2653.6147.8141.92
Categories /wp-admin/edit-tags.php?taxonomy=article_cats&post_type=lbd_article1,5583.5944.1327.14
Add New /wp-admin/post-new.php?post_type=lbd_article2,8008.01172.0557.87
Event LB /wp-admin/admin.php?page=event_leaderboard1,0953.4842.5223.25
Workouts /wp-admin/admin.php?page=event_workouts1,7276.98123.6336.50
All Articles /wp-admin/edit.php?post_type=lbd_article1,4043.7245.2526.85
Divisions /wp-admin/admin.php?page=event_divisions1,1893.6146.4727.52
Competitions /wp-admin/admin.php?page=event_competitions1,6886.99126.1336.18
Events /wp-admin/admin.php?page=event_events3,5266.99126.9839.44
Competitors /wp-admin/admin.php?page=event_competitors1,3553.6645.4822.59

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • LBD_db_version

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=event_competitors
    • > Notice in wp-content/plugins/leaderboard-lite/admin/pages/event-competitors.php+123
    Trying to access array offset on value of type bool

SRP 0% 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
  • 7× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/leaderboard-lite/Stripe/stripe-php/tests/bootstrap.php
    • > /wp-content/plugins/leaderboard-lite/Stripe/stripe-php/update_certs.php
    • > /wp-content/plugins/leaderboard-lite/front-end/stripe-php/update_certs.php
    • > /wp-content/plugins/leaderboard-lite/Stripe/container.php
    • > /wp-content/plugins/leaderboard-lite/front-end/stripe-php/build.php
    • > /wp-content/plugins/leaderboard-lite/Stripe/stripe-php/tests/bootstrap.no_autoload.php
    • > /wp-content/plugins/leaderboard-lite/Stripe/stripe-php/build.php
  • 182× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\StripeObject' not found in wp-content/plugins/leaderboard-lite/front-end/stripe-php/lib/Collection.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/leaderboard-lite/front-end/stripe-php/lib/SKU.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/leaderboard-lite/Stripe/stripe-php/tests/Stripe/ProductTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/leaderboard-lite/Stripe/stripe-php/tests/Stripe/Util/RequestOptionsTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/leaderboard-lite/Stripe/stripe-php/lib/AlipayAccount.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/leaderboard-lite/Stripe/stripe-php/tests/Stripe/BalanceTransactionTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/leaderboard-lite/Stripe/stripe-php/tests/Stripe/TransferReversalTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/leaderboard-lite/Stripe/stripe-php/lib/ThreeDSecure.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/leaderboard-lite/Stripe/stripe-php/lib/RecipientTransfer.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/leaderboard-lite/front-end/stripe-php/lib/Source.php:28

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=event_competitors
    • > Network (severe)
    wp-admin/admin-ajax.php?ver=26.12.18 - Failed to load resource: the server responded with a status of 400 (Bad Request)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid URI found ("#")
You can look at the official readme.txt

leaderboard-lite/init.php 85% from 13 tests

The main PHP file in "LeaderBoard Plugin" ver. 1.24 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("leaderboard-lite.php" instead of "init.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Almost there! Just fix the following issues
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/leaderboard-lite/front-end/stripe-php/data/ca-certificates.crt
      • wp-content/plugins/leaderboard-lite/Stripe/stripe-php/data/ca-certificates.crt
18,516 lines of code in 207 files:
LanguageFilesBlank linesComment linesLines of code
PHP1831,3872,36012,590
JavaScript9481422,692
CSS5156901,982
SVG100655
Markdown32090475
JSON10036
YAML27136
XML20030
SQL10020

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity3.67
▷ Minimum class complexity1.00
▷ Maximum class complexity56.00
Average method complexity1.64
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces6
Interfaces4
Traits14
Classes201
▷ Abstract classes146.97%
▷ Concrete classes18793.03%
▷ Final classes00.00%
Methods860
▷ Static methods22926.63%
▷ Public methods78491.16%
▷ Protected methods303.49%
▷ Private methods465.35%
Functions87
▷ Named functions7990.80%
▷ Anonymous functions89.20%
Constants291
▷ Global constants72.41%
▷ Class constants28497.59%
▷ Public constants284100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
40 PNG files occupy 0.28MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/list-icon-6.png11.37KB4.30KB▼ 62.18%
img/username.png1.05KB0.25KB▼ 76.46%
front-end/img/list-icon-3.png7.14KB3.31KB▼ 53.60%
img/text.png14.20KB6.77KB▼ 52.35%
front-end/img/list-icon-2.png6.95KB3.13KB▼ 54.88%