74% golf-society

Code Review | GolfSoc

WordPress plugin GolfSoc scored 74% from 54 tests.

About plugin

  • Plugin page: golf-society
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 22, 2023
  • Latest release: Aug 12, 2023
  • Number of updates: 17
  • Update frequency: every 10.8 days
  • Top authors: Malcolm-OPH (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 431 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.92MB] [CPU: ▲154.33ms] Passed 4 tests

Analyzing server-side resources used by GolfSoc
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.54 ▲1.08198.84 ▲156.65
Dashboard /wp-admin4.25 ▲0.95197.67 ▲149.66
Posts /wp-admin/edit.php4.30 ▲0.95199.55 ▲149.06
Add New Post /wp-admin/post-new.php6.79 ▲0.90260.53 ▲161.96
Media Library /wp-admin/upload.php4.11 ▲0.88350.58 ▲315.88
Tools /wp-admin/admin.php?page=golf-society_tools4.71192.32
Handicaps /wp-admin/admin.php?page=golf-society_handicaps4.67186.44
Courses /wp-admin/admin.php?page=golf-society_courses4.75190.42
Competitions /wp-admin/admin.php?page=golf-society_competitions4.95189.16
Overview /wp-admin/admin.php?page=golf-society_adminmenu4.83191.17
Settings /wp-admin/admin.php?page=golf-society_settings5.12193.17
Players /wp-admin/admin.php?page=golf-society_players4.74187.32

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 98 new files
Database: 9 new tables, 6 new options
New tables
wp_golfsoc_sessions
wp_golfsoc_courses
wp_golfsoc_teecolours
wp_golfsoc_tees
wp_golfsoc_scores
wp_golfsoc_handicaps
wp_golfsoc_settings
wp_golfsoc_players
wp_golfsoc_competitions
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for GolfSoc
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,990 ▲25513.57 ▼0.717.59 ▲5.8340.75 ▼8.46
Dashboard /wp-admin2,270 ▲794.91 ▼0.04106.56 ▲1.3839.54 ▼4.63
Posts /wp-admin/edit.php2,150 ▲612.03 ▲0.0337.03 ▼1.3729.42 ▼5.13
Add New Post /wp-admin/post-new.php1,562 ▲2820.91 ▼2.45629.70 ▲40.9439.54 ▼11.85
Media Library /wp-admin/upload.php1,446 ▲614.27 ▲0.0397.69 ▲0.8643.92 ▲0.06
Tools /wp-admin/admin.php?page=golf-society_tools1,0822.2125.2731.15
Handicaps /wp-admin/admin.php?page=golf-society_handicaps8262.2126.9224.73
Courses /wp-admin/admin.php?page=golf-society_courses8262.0625.8527.52
Competitions /wp-admin/admin.php?page=golf-society_competitions8262.2124.9630.56
Overview /wp-admin/admin.php?page=golf-society_adminmenu9202.1823.0829.23
Settings /wp-admin/admin.php?page=golf-society_settings1,8241.7525.3932.41
Players /wp-admin/admin.php?page=golf-society_players8232.2124.7627.21

Uninstaller [IO: ▲0.08MB] [DB: ▲0.01MB] 50% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie tables detected upon uninstall: 9 tables
    • wp_golfsoc_scores
    • wp_golfsoc_tees
    • wp_golfsoc_competitions
    • wp_golfsoc_courses
    • wp_golfsoc_players
    • wp_golfsoc_sessions
    • wp_golfsoc_teecolours
    • wp_golfsoc_settings
    • wp_golfsoc_handicaps
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 97× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      include(): Failed opening 'GOLFSOC_INCLUDE_PATHgolfsoclib_table.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/golf-society/admin/golfsoc_manage_settings.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'GolfSocLibExportAdminClass' not found in wp-content/plugins/golf-society/admin/golfsoc_csv_export.php:31
    • > PHP Warning
      Use of undefined constant GOLFSOC_INCLUDE_PATH - assumed 'GOLFSOC_INCLUDE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/golf-society/admin/golfsoc_manage_tools.php on line 24
    • > PHP Fatal error
      require_once(): Failed opening required 'GOLFSOC_INCLUDE_PATHgolfsoc_adminlist.php' (include_path='.:/usr/share/php') in wp-content/plugins/golf-society/include/golfsoc_playerlist.php on line 23
    • > PHP Warning
      Use of undefined constant GOLFSOC_INCLUDE_PATH - assumed 'GOLFSOC_INCLUDE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/golf-society/admin/golfsoc_manage_overview.php on line 23
    • > PHP Warning
      include(): Failed opening 'GOLFSOC_INCLUDE_PATHgolfsoc_testemail.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/golf-society/admin/golfsoc_manage_tools.php on line 24
    • > PHP Warning
      Use of undefined constant GOLFSOC_INCLUDE_PATH - assumed 'GOLFSOC_INCLUDE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/golf-society/admin/golfsoc_showemail.php on line 3
    • > PHP Warning
      include(GOLFSOC_INCLUDE_PATHgolfsoc_testemail.php): failed to open stream: No such file or directory in wp-content/plugins/golf-society/admin/golfsoc_manage_tools.php on line 24
    • > PHP Fatal error
      require_once(): Failed opening required 'GOLFSOC_INCLUDE_PATHgolfsoc_playerlist.php' (include_path='.:/usr/share/php') in wp-content/plugins/golf-society/admin/golfsoc_manage_competitions.php on line 23
    • > PHP Warning
      Use of undefined constant GOLFSOC_INCLUDE_PATH - assumed 'GOLFSOC_INCLUDE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/golf-society/admin/golfsoc_csv_exportphs.php on line 24

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Screenshot 1: Overview Page), #2 (Screenshot 2: Players Admin Page), #3 (Screenshot 3: Courses Admin Page), #4 (Screenshot 4: Competitions Admin Page), #5 (Screenshot 5: Handicaps Admin Page), #6 (Screenshot 6: Tools Admin Page), #7 (Screenshot 7: General Settings Page), #8 (Screenshot 8: Golf Settings Page), #9 (Screenshot 9: EMail Settings Page), #10 (Screenshot 10: Page Template Settings Page), #11 (Screenshot 11: Player Summary), #12 (Screenshot 12: Handicap History), #13 (Screenshot 13: Competitions Record), #14 (Screenshot 14: Competition Results), #15 (Screenshot 15: Course Rating), #16 (Screenshot 16: Playing Handicaps)
Please take inspiration from this readme.txt

golf-society/golfsoc.php 92% from 13 tests

The entry point to "GolfSoc" version 1.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("golf-society.php" instead of "golfsoc.php")

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
Everything looks great! No dangerous files found in this plugin14,477 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
PHP523,3422,05111,871
JavaScript65212522,315
CSS36930291

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity33.74
▷ Minimum class complexity1.00
▷ Maximum class complexity241.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes47
▷ Abstract classes00.00%
▷ Concrete classes47100.00%
▷ Final classes00.00%
Methods717
▷ Static methods11015.34%
▷ Public methods71599.72%
▷ Protected methods00.00%
▷ Private methods20.28%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants273
▷ Global constants19270.33%
▷ Class constants8129.67%
▷ Public constants81100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
11 PNG files occupy 0.12MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/Golfer-50.png11.24KB2.64KB▼ 76.54%
templates/images/Golfer-wide.png10.00KB4.35KB▼ 56.48%
templates/images/Golfer.png13.43KB6.75KB▼ 49.73%
images/Golfer-25.png8.79KB1.42KB▼ 83.87%
templates/images/Golfer-50.png11.24KB2.64KB▼ 76.54%