63% kofc-state

Code Review | Knights of Columbus - State

WordPress plugin Knights of Columbus - State scored63%from 54 tests.

About plugin

  • Plugin page: kofc-state
  • Plugin version: 2.4.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Apr 23, 2019
  • Latest release: May 6, 2023
  • Number of updates: 20
  • Update frequency: every 73.8 days
  • Top authors: falcon13 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /686 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 gracefully, with no errors

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

A check of server-side resources used by Knights of Columbus - State
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0735.94 ▼0.10
Dashboard /wp-admin3.39 ▲0.0545.11 ▼12.10
Posts /wp-admin/edit.php3.46 ▲0.1143.71 ▼0.79
Add New Post /wp-admin/post-new.php6.00 ▲0.1182.55 ▼13.21
Media Library /wp-admin/upload.php3.32 ▲0.0935.38 ▼1.87
Knights /wp-admin/admin.php?page=kofc-state-knight-edit3.3330.94
KofC State Plugin /wp-admin/options-general.php?page=kofc-state-options3.3230.24
All Councils /wp-admin/edit.php?post_type=council3.3836.72
Knights /wp-admin/admin.php?page=kofc-state3.3428.72
All Assemblies /wp-admin/edit.php?post_type=assembly3.3832.63
Star Council Requirements /wp-admin/admin.php?page=kofc-state-starreq3.3328.13
Add Assembly /wp-admin/post-new.php?post_type=assembly3.4344.83
All Knights /wp-admin/edit.php?post_type=knight3.3842.78
Add Council /wp-admin/post-new.php?post_type=council3.4443.53
Add Knight /wp-admin/post-new.php?post_type=knight3.4345.72

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 67 new files
Database: 6 new tables, 7 new options
New tables
wp_otgkofcs_knights
wp_otgkofcs_messages
wp_otgkofcs_district_scores
wp_otgkofcs_star_requirements
wp_otgkofcs_star_reqs_met
wp_otgkofcs_council_scores
New WordPress options
otgkofcs_number_of_districts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Knights of Columbus - State: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,016 ▲27013.62 ▼0.777.49 ▲5.8740.36 ▲0.45
Dashboard /wp-admin2,335 ▲1545.86 ▲0.2697.32 ▼2.2540.09 ▼3.64
Posts /wp-admin/edit.php2,244 ▲1442.48 ▲0.4747.24 ▲12.8432.26 ▼4.46
Add New Post /wp-admin/post-new.php1,643 ▲11723.64 ▲0.09697.04 ▲20.1944.74 ▼7.88
Media Library /wp-admin/upload.php1,537 ▲1344.38 ▲0.12110.98 ▼0.8739.66 ▼4.67
Knights /wp-admin/admin.php?page=kofc-state-knight-edit1,0022.0135.4227.25
KofC State Plugin /wp-admin/options-general.php?page=kofc-state-options9972.0535.4726.66
All Councils /wp-admin/edit.php?post_type=council1,2712.3143.0529.67
Knights /wp-admin/admin.php?page=kofc-state9932.0838.7928.35
All Assemblies /wp-admin/edit.php?post_type=assembly1,2682.3042.6531.86
Star Council Requirements /wp-admin/admin.php?page=kofc-state-starreq9342.0342.7133.55
Add Assembly /wp-admin/post-new.php?post_type=assembly2,4467.86178.3567.17
All Knights /wp-admin/edit.php?post_type=knight1,2922.3140.9128.38
Add Council /wp-admin/post-new.php?post_type=council2,5187.86166.4953.88
Add Knight /wp-admin/post-new.php?post_type=knight2,4107.95172.4556.91

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 6 tables in the database
    • wp_otgkofcs_council_scores
    • wp_otgkofcs_star_reqs_met
    • wp_otgkofcs_district_scores
    • wp_otgkofcs_star_requirements
    • wp_otgkofcs_messages
    • wp_otgkofcs_knights
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • otgkofcs_number_of_districts
    • theysaidso_admin_options

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
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=kofc-state-knight-edit
    • > Notice in wp-content/plugins/kofc-state/helpers/validation_helper.php+34
    Undefined index: knight_id
    • > GET request to /wp-admin/admin.php?page=kofc-state-starreq
    • > Notice in wp-content/plugins/kofc-state/helpers/validation_helper.php+34
    Undefined index: delete

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
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/kofc-state/views/admin/message_view.php
    • > /wp-content/plugins/kofc-state/views/scoreboard_knights.php
    • > /wp-content/plugins/kofc-state/views/scoreboard_councils.php
  • 36× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/kofc-state/views/admin/message_view.php on line 20
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/kofc-state/kofc-state.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otgkofcs_display_messages() in wp-content/plugins/kofc-state/views/admin/star_scores.php:14
    • > PHP Notice
      Undefined variable: message in wp-content/plugins/kofc-state/views/admin/message_view.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/kofc-state/views/scoreboard_star_reqs.php:10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/kofc-state/views/admin/message_view.php on line 16
    • > PHP Notice
      Undefined variable: message in wp-content/plugins/kofc-state/views/admin/message_view.php on line 16
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/kofc-state/kofc-state.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/kofc-state/kofc-state.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otgkofcs_display_messages() in wp-content/plugins/kofc-state/views/admin/scores_coun_dist.php:14

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: widget, shortcode, knights of columbus

kofc-state/kofc-state.php Passed 13 tests

The main PHP file in "Knights of Columbus - State" ver. 2.4.3 adds more information about the plugin and also serves as the entry point for this plugin
65 characters long description:
Functionality for State Councils Including Recruiting Scoreboards

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin3,119 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP284257792,627
CSS44432456
JavaScript3104236

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity15.00
▷ Minimum class complexity3.00
▷ Maximum class complexity27.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods64
▷ Static methods00.00%
▷ Public methods64100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions42
▷ Named functions4197.62%
▷ Anonymous functions12.38%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
31 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
images/twitter2_64px.png7.71KB2.64KB▼ 65.83%
images/ui-bg_highlight-soft_100_eeeeee_1x100.png0.27KB0.14KB▼ 47.84%
images/facebook.png7.52KB3.21KB▼ 57.40%
images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%