78% wftda-rankings-widget

Code Review | WFTDA Rankings Widget

WordPress plugin WFTDA Rankings Widget scored78%from 54 tests.

About plugin

  • Plugin page: wftda-rankings-wi...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8
  • WordPress version: 6.3.1
  • First release: Apr 10, 2020
  • Latest release: Sep 20, 2021
  • Number of updates: 12
  • Update frequency: every 44.3 days
  • Top authors: mikestraw (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /476 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.43ms] Passed 4 tests

Server-side resources used by WFTDA Rankings Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0343.46 ▲2.17
Dashboard /wp-admin3.33 ▲0.0350.44 ▼5.06
Posts /wp-admin/edit.php3.38 ▲0.0347.56 ▼2.73
Add New Post /wp-admin/post-new.php5.93 ▲0.0493.53 ▼3.74
Media Library /wp-admin/upload.php3.25 ▲0.0236.31 ▼2.17
League WFTDA Rankings /wp-admin/options-general.php?page=league-wftda-ranking3.2431.60

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 33 new files
Database: no new tables, 13 new options
New WordPress options
lwr_site_url
can_compress_scripts
lwr_refresh_hours
widget_theysaidso_widget
db_upgraded
widget_league_wftda_ranking
widget_recent-posts
lwr_gpa_sf_explanation
lwr_leagues
widget_recent-comments
...

Browser metrics Passed 4 tests

A check of browser resources used by WFTDA Rankings Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲11913.42 ▼0.939.50 ▲7.9441.42 ▼5.65
Dashboard /wp-admin2,197 ▲205.57 ▼0.0987.07 ▼7.4341.05 ▼2.80
Posts /wp-admin/edit.php2,108 ▲51.95 ▼0.0336.19 ▼10.0133.61 ▼2.43
Add New Post /wp-admin/post-new.php1,535 ▲723.16 ▲0.15676.95 ▼9.9264.63 ▲7.02
Media Library /wp-admin/upload.php1,405 ▲24.17 ▼0.01103.84 ▼0.4446.85 ▲1.07
League WFTDA Rankings /wp-admin/options-general.php?page=league-wftda-ranking7732.0224.2724.53

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 13 options in the database
    • widget_league_wftda_ranking
    • lwr_site_url
    • widget_recent-comments
    • lwr_leagues
    • db_upgraded
    • lwr_delete_on_uninstall
    • lwr_gpa_sf_explanation
    • theysaidso_admin_options
    • lwr_refresh_hours
    • 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
Good news, no errors were detected

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 items
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wftda-rankings-widget/admin/partials/league-wftda-ranking-display.php
    • > /wp-content/plugins/wftda-rankings-widget/public/partials/league-wftda-ranking-public-display.php
    • > /wp-content/plugins/wftda-rankings-widget/admin/partials/league-wftda-ranking-shortcode-display.php
    • > /wp-content/plugins/wftda-rankings-widget/admin/partials/league-wftda-ranking-admin-display.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: url in wp-content/plugins/wftda-rankings-widget/widgets/partials/league-wftda-ranking-widget.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wftda-rankings-widget/widgets/partials/league-wftda-ranking-form.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wftda-rankings-widget/widgets/partials/league-wftda-ranking-widget.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wftda-rankings-widget/widgets/class-league-wftda-ranking-widget.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: wftda, sports, stats, roller derby, rankings

wftda-rankings-widget/league-wftda-ranking.php 85% from 13 tests

"WFTDA Rankings Widget" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wftda-rankings-widget.php" instead of "league-wftda-ranking.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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 plugin675 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP19197815457
CSS23012138
Markdown14058
JavaScript2105419
SVG1003

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity3.80
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods42
▷ Static methods24.76%
▷ Public methods3583.33%
▷ Protected methods24.76%
▷ Private methods511.90%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.21MB with 0.15MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png182.84KB53.43KB▼ 70.78%
assets/screenshot-2.png36.14KB9.93KB▼ 72.51%