71% simple-golf-club

Code Review | Simple Golf Club

WordPress plugin Simple Golf Club scored71%from 54 tests.

About plugin

  • Plugin page: simple-golf-club
  • Plugin version: 1.6.21
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Aug 29, 2019
  • Latest release: Jul 4, 2022
  • Number of updates: 42
  • Update frequency: every 24.8 days
  • Top authors: matthewlinton (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,626 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
Installer ran successfully

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

An overview of server-side resources used by Simple Golf Club
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.09 ▲0.6346.04 ▲10.50
Dashboard /wp-admin3.95 ▲0.6150.69 ▼5.47
Posts /wp-admin/edit.php4.00 ▲0.6554.00 ▲7.46
Add New Post /wp-admin/post-new.php6.87 ▲0.9888.25 ▼5.86
Media Library /wp-admin/upload.php3.81 ▲0.5838.93 ▲5.51
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=sgc_scorecard3.9335.54
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=sgc_team3.9342.80
All Locations /wp-admin/edit.php?post_type=sgc_location3.9338.86
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=sgc_location3.9437.98
Add New Location /wp-admin/post-new.php?post_type=sgc_location6.8586.55
All Events /wp-admin/edit.php?post_type=sgc_event3.9339.88
Add New Team /wp-admin/post-new.php?post_type=sgc_team6.8585.98
Add New Event /wp-admin/post-new.php?post_type=sgc_event6.3971.88
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=sgc_event3.9338.88
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=sgc_event3.9438.71

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Golf Club
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,211 ▲45013.62 ▼0.915.10 ▲3.5038.53 ▼1.99
Dashboard /wp-admin2,491 ▲3175.86 ▲0.3086.83 ▼1.7641.95 ▲1.72
Posts /wp-admin/edit.php2,341 ▲2412.30 ▲0.2835.90 ▲0.6036.79 ▲1.78
Add New Post /wp-admin/post-new.php1,711 ▲18523.47 ▲0.03649.91 ▼31.9135.09 ▼22.00
Media Library /wp-admin/upload.php1,619 ▲2194.47 ▲0.2896.44 ▼12.6440.33 ▼6.99
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=sgc_scorecard1,5351.9229.7328.50
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=sgc_team1,6711.9429.6532.47
All Locations /wp-admin/edit.php?post_type=sgc_location1,3602.2733.1130.91
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=sgc_location1,6681.9429.2031.64
Add New Location /wp-admin/post-new.php?post_type=sgc_location7,06223.19876.4234.26
All Events /wp-admin/edit.php?post_type=sgc_event1,3942.2434.7430.14
Add New Team /wp-admin/post-new.php?post_type=sgc_team6,45320.71768.0028.88
Add New Event /wp-admin/post-new.php?post_type=sgc_event7,07320.65756.8690.36
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=sgc_event1,5351.9930.6330.31
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=sgc_event1,6681.9429.0732.37

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

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=sgc_event
    • > Notice in wp-content/plugins/simple-golf-club/admin/class-sgc-admin-events.php+146
    date_default_timezone_set(): Timezone ID '' is invalid

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
Almost there! Just fix the following items
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/simple-golf-club/admin/partials/sgc-widget-events.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_thickbox() in wp-content/plugins/simple-golf-club/admin/partials/sgc-admin-teams.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/simple-golf-club/admin/partials/sgc-admin-settings.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_thickbox() in wp-content/plugins/simple-golf-club/admin/partials/sgc-admin-players.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_thickbox() in wp-content/plugins/simple-golf-club/admin/partials/sgc-admin-locations.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/simple-golf-club/admin/partials/sgc-admin-settings-general.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/simple-golf-club/admin/partials/sgc-admin-settings-about.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_thickbox() in wp-content/plugins/simple-golf-club/admin/partials/sgc-admin-events.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/simple-golf-club/admin/partials/sgc-admin-scorecards.php:25

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/post-new.php?post_type=sgc_team
    • > Network (severe)
    wp-json/wp/v2/sgc_players?order=asc&orderby=title&per_page=16&page=1&search= - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=sgc_event
    • > Network (severe)
    wp-json/wp/v2/sgc_locations?order=asc&orderby=title&per_page=16&page=1&search= - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=sgc_event
    • > Network (severe)
    wp-json/wp/v2/sgc_teams?order=asc&orderby=title&per_page=16&page=1&search= - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
  • Screenshots: Add descriptions for screenshots #10, #11, #7, #8, #9 in simple-golf-club/assets to your readme.txt
Please take inspiration from this readme.txt

simple-golf-club/simplegolfclub.php 77% from 13 tests

"Simple Golf Club" version 1.6.21'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:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("simple-golf-club.php" instead of "simplegolfclub.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 170 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected4,371 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
PHP294331,0273,210
JavaScript13193395831
CSS61427330

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity15.00
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity3.74
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods87
▷ Static methods3439.08%
▷ Public methods7485.06%
▷ Protected methods00.00%
▷ Private methods1314.94%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG files were detected