84% advanced-h2h-for-sportspress

Code Review | Advanced H2H for SportsPress

WordPress plugin Advanced H2H for SportsPress scored84%from 54 tests.

About plugin

  • Plugin page: advanced-h2h-for-...
  • Plugin version: 2.0.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.2
  • WordPress version: 6.3.1
  • First release: Dec 23, 2022
  • Latest release: Mar 31, 2023
  • Number of updates: 8
  • Update frequency: every 26.2 days
  • Top authors: savvasha (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /590 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼5.62ms] Passed 4 tests

Server-side resources used by Advanced H2H for SportsPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0937.15 ▼5.35
Dashboard /wp-admin3.39 ▲0.0845.17 ▼16.76
Posts /wp-admin/edit.php3.44 ▲0.0848.25 ▲7.30
Add New Post /wp-admin/post-new.php5.97 ▲0.0894.48 ▼1.01
Media Library /wp-admin/upload.php3.31 ▲0.0834.78 ▲0.64
Sorting Criteria /wp-admin/edit.php?post_type=sah2h_criteria3.3537.41

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced H2H for SportsPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.56 ▼0.581.73 ▼0.0642.71 ▼3.57
Dashboard /wp-admin2,209 ▲214.83 ▼0.98108.84 ▼14.0642.42 ▼3.87
Posts /wp-admin/edit.php2,092 ▲32.01 ▼0.0340.37 ▲0.1934.55 ▼4.62
Add New Post /wp-admin/post-new.php1,545 ▲3118.08 ▲0.55596.45 ▼204.2353.12 ▼13.31
Media Library /wp-admin/upload.php1,391 ▲34.20 ▲0.0095.15 ▼4.5239.06 ▼3.56
Sorting Criteria /wp-admin/edit.php?post_type=sah2h_criteria1,0551.9832.0628.66

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'SP_League_Table' not found in wp-content/plugins/advanced-h2h-for-sportspress/includes/class-sah2h-league-table.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can take inspiration from this readme.txt

advanced-h2h-for-sportspress/advanced-h2h-for-sportspress.php Passed 13 tests

This is the main PHP file of "Advanced H2H for SportsPress" version 2.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
94 characters long description:
Give your league managers the option to use more advanced head to head criteria for tiebreaks.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,259 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP42582211,116
CSS1202123
JavaScript14720

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 147)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity87.00
▷ Minimum class complexity23.00
▷ Maximum class complexity151.00
Average method complexity54.00
▷ Minimum method complexity5.00
▷ Maximum method complexity147.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods5
▷ Static methods360.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions981.82%
▷ Anonymous functions218.18%
Constants3
▷ Global constants3100.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
PNG images were not found in this plugin