10% golf-scores

Code Review | Golf Scores

WordPress plugin Golf Scores scored10%from 54 tests.

About plugin

  • Plugin page: golf-scores
  • Plugin version: 1.1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3.1
  • WordPress version: 6.3.1
  • First release: Nov 18, 2013
  • Latest release: Nov 7, 2015
  • Number of updates: 15
  • Update frequency: every 48.0 days
  • Top authors: TKServer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,179 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/golf-scores/golfScores.php+96
    Methods with the same name as their class will not be constructors in a future version of PHP; golfScores has a deprecated constructor

Server metrics [RAM: ▼1.77MB] [CPU: ▼52.60ms] Passed 4 tests

An overview of server-side resources used by Golf Scores
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.21 ▼1.254.29 ▼36.47
Dashboard /wp-admin2.23 ▼1.076.30 ▼43.46
Posts /wp-admin/edit.php2.23 ▼1.126.69 ▼37.25
Add New Post /wp-admin/post-new.php2.23 ▼3.654.89 ▼93.22
Media Library /wp-admin/upload.php2.23 ▼1.006.86 ▼25.50
Enter Score /wp-admin/admin.php?page=scores_form2.235.08
Golf Scores /wp-admin/admin.php?page=golfscores2.236.62
Golf Scores /wp-admin/options-general.php?page=golfScores-plugin2.236.86

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 12 new files
Database: 1 new table, 8 new options
New tables
wp_golfScores
New WordPress options
theysaidso_admin_options
widget_golfscores
widget_theysaidso_widget
can_compress_scripts
db_upgraded
golfScores_database_version
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Golf Scores
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,049 ▲31414.45 ▲0.0615.09 ▲13.2737.15 ▼9.63
Dashboard /wp-admin2,237 ▲495.90 ▲0.02109.65 ▼5.7443.23 ▼7.37
Posts /wp-admin/edit.php2,117 ▲282.01 ▼0.0435.46 ▼0.6732.15 ▼1.39
Add New Post /wp-admin/post-new.php1,539 ▲2517.50 ▼0.18681.87 ▼8.7359.82 ▲18.50
Media Library /wp-admin/upload.php1,413 ▲284.22 ▲0.0297.46 ▼11.1041.16 ▼4.60
Enter Score /wp-admin/admin.php?page=scores_form1,0291.9431.3838.03
Golf Scores /wp-admin/admin.php?page=golfscores1,1202.0622.9529.04
Golf Scores /wp-admin/options-general.php?page=golfScores-plugin1,0542.0726.7929.30

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/golf-scores/golfScores.php+96
    Methods with the same name as their class will not be constructors in a future version of PHP; golfScores has a deprecated constructor
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_golfScores
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_golfscores
    • golfScores_database_version

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=golfScores-plugin
    • > Deprecated in wp-content/plugins/golf-scores/golfScores.php+96
    Methods with the same name as their class will not be constructors in a future version of PHP; golfScores has a deprecated constructor
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=golfScores-plugin
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in golfScores is deprecated since version 4.3.0! Use __construct() instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=scores_form
    • > Notice in wp-content/plugins/golf-scores/golfScores.php+826
    Undefined index: holes
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=scores_form
    • > Notice in wp-content/plugins/golf-scores/golfScores.php+828
    Undefined index: gross_score
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=scores_form
    • > Notice in wp-content/plugins/golf-scores/golfScores.php+829
    Undefined index: handicap
    • > GET request to /wp-admin/admin.php?page=scores_form
    • > Notice in wp-content/plugins/golf-scores/golfScores.php+823
    Undefined index: user_id
    • > GET request to /wp-admin/admin.php?page=scores_form
    • > Notice in wp-content/plugins/golf-scores/golfScores.php+824
    Undefined index: course
    • > GET request to /wp-admin/admin.php?page=scores_form
    • > Notice in wp-content/plugins/golf-scores/golfScores.php+825
    Undefined index: tee
    • > GET request to /wp-admin/admin.php?page=scores_form
    • > Notice in wp-content/plugins/golf-scores/golfScores.php+827
    Undefined index: golfScoresDate
    • > GET request to /wp-admin/admin.php?page=scores_form
    • > Notice in wp-content/plugins/golf-scores/golfScores.php+830
    Undefined variable: net_score
    • > GET request to /wp-admin/admin.php?page=scores_form
    • > Notice in wp-content/plugins/golf-scores/golfScores.php+831
    Undefined index: comments
    • > GET request to /wp-admin/admin.php?page=scores_form
    • > Notice in wp-content/plugins/golf-scores/golfScores.php+832
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=scores_form
    • > Notice in wp-content/plugins/golf-scores/golfScores.php+836
    Undefined index: nonce
    • > GET request to /wp-admin/admin.php?page=scores_form
    • > Notice in wp-content/plugins/golf-scores/functions.php+9
    Trying to get property 'display_name' of non-object
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=scores_form
    • > Notice in wp-content/plugins/golf-scores/golfScores.php+990
    Undefined variable: holes
    • > GET request to /wp-admin/options-general.php?page=golfScores-plugin
    • > Notice in wp-content/plugins/golf-scores/golfScores.php+194
    Undefined index: golfScores_hidden
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=golfScores-plugin
    • > User deprecated in wp-includes/functions.php+5737
    Function WP_User->id was called with an argument that is deprecated since version 2.1.0! Use WP_User->ID instead.

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
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/golf-scores/details.php
    • > /wp-content/plugins/golf-scores/golfScores.php
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined index: MyDate in wp-content/plugins/golf-scores/submitForm.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/golf-scores/scoresAdmin.php on line 8
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/golf-scores/scoresAdmin.php on line 8
    • > PHP Notice
      Undefined index: sid in wp-content/plugins/golf-scores/details.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/golf-scores/scoresAdmin.php on line 8
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/golf-scores/editForm.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/golf-scores/functions.php:360
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/golf-scores/details.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_row() on null in wp-content/plugins/golf-scores/editForm.php:6
    • > PHP Notice
      Undefined index: score_id in wp-content/plugins/golf-scores/submitForm.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: golf score tracker, golf scores, golf

golf-scores/golfScores.php 85% from 13 tests

The main PHP file in "Golf Scores" ver. 1.1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 451 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("golf-scores.php" instead of "golfScores.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin1,746 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP63583441,653
CSS112187
JavaScript1036

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity9.33
▷ Minimum class complexity8.00
▷ Maximum class complexity10.00
Average method complexity1.82
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions30
▷ Named functions30100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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.03MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugin-icon.png15.67KB0.61KB▼ 96.11%
assets/images/golfscores.png15.67KB0.61KB▼ 96.11%