84% sportspress-for-golf

Code Review | SportsPress for Golf

WordPress plugin SportsPress for Golf scored84%from 54 tests.

About plugin

  • Plugin page: sportspress-for-golf
  • Plugin version: 0.9.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.5
  • WordPress version: 6.3.1
  • First release: Sep 23, 2015
  • Latest release: Aug 27, 2020
  • Number of updates: 9
  • Update frequency: every 200.2 days
  • Top authors: brianmiyaji (77.78%)ThemeBoy (33.33%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /6,783 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
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼4.54ms] Passed 4 tests

Analyzing server-side resources used by SportsPress for Golf
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1234.99 ▼4.24
Dashboard /wp-admin3.44 ▲0.1045.49 ▼18.71
Posts /wp-admin/edit.php3.49 ▲0.1447.58 ▲4.41
Add New Post /wp-admin/post-new.php5.96 ▲0.0791.18 ▲0.40
Media Library /wp-admin/upload.php3.30 ▲0.0748.87 ▲13.86
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins3.3734.22

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by SportsPress for Golf
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7314.05 ▼0.301.58 ▼0.0240.37 ▲0.98
Dashboard /wp-admin2,225 ▲485.62 ▲0.0990.73 ▼5.8847.51 ▲7.66
Posts /wp-admin/edit.php2,142 ▲422.03 ▲0.0840.55 ▲6.6739.49 ▲3.44
Add New Post /wp-admin/post-new.php1,552 ▲2623.33 ▲0.29662.49 ▼31.4952.42 ▼7.38
Media Library /wp-admin/upload.php1,438 ▲354.23 ▲0.05106.73 ▲5.3950.85 ▲6.37
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins9772.0628.7532.77

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/sportspress-for-golf/includes/class-tgm-plugin-activation.php:2109

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% 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
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

sportspress-for-golf/sportspress-for-golf.php Passed 13 tests

The main PHP script in "SportsPress for Golf" version 0.9.1 is automatically included on every request by WordPress
41 characters long description:
A suite of golf features for SportsPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin2,075 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP35331,7162,072
CSS1003

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity50.25
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.20
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods123
▷ Static methods108.13%
▷ Public methods9879.67%
▷ Protected methods2318.70%
▷ Private methods21.63%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.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
No PNG files were detected