62% scouttroop

Code Review | ScoutTroop

WordPress plugin ScoutTroop scored62%from 54 tests.

About plugin

  • Plugin page: scouttroop
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.2-4.2.2
  • WordPress version: 6.3.1
  • First release: Jun 3, 2015
  • Latest release: Jun 23, 2015
  • Number of updates: 14
  • Update frequency: every 1.4 days
  • Top authors: fildawg (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /958 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.73MB] [CPU: ▼35.76ms] Passed 4 tests

Analyzing server-side resources used by ScoutTroop
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1643.41 ▲1.77
Dashboard /wp-admin3.21 ▼0.0925.65 ▼29.74
Posts /wp-admin/edit.php3.21 ▼0.1423.26 ▼26.83
Add New Post /wp-admin/post-new.php3.21 ▼2.6724.65 ▼79.18
Media Library /wp-admin/upload.php3.21 ▼0.0129.16 ▼7.30
/wp-admin/admin.php?page=scouttroop/scouttroop.php3.2127.72
Leadership Roles /wp-admin/admin.php?page=scouttroop/scouttroop.php/leadership3.2123.84
Adult Roles /wp-admin/admin.php?page=scouttroop/scouttroop.php/adult3.2122.16
Patrols /wp-admin/admin.php?page=scouttroop/scouttroop.php/patrols3.2126.68
Ranks /wp-admin/admin.php?page=scouttroop/scouttroop.php/rank_assignment3.2124.37
Patrol Admin /wp-admin/admin.php?page=scouttroop/scouttroop.php/patrol_admin3.2128.45

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for ScoutTroop
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲9513.72 ▼0.641.80 ▼0.3543.62 ▲0.97
Dashboard /wp-admin2,250 ▲594.92 ▼0.18106.27 ▼15.3075.99 ▲26.08
Posts /wp-admin/edit.php2,136 ▲502.02 ▲0.0337.41 ▼0.9333.36 ▼0.58
Add New Post /wp-admin/post-new.php1,700 ▲18022.46 ▼0.56782.67 ▲136.7164.41 ▲8.36
Media Library /wp-admin/upload.php1,420 ▲324.24 ▲0.15101.65 ▼13.7584.18 ▲35.66
/wp-admin/admin.php?page=scouttroop/scouttroop.php8212.0225.0425.45
Leadership Roles /wp-admin/admin.php?page=scouttroop/scouttroop.php/leadership9482.0627.6627.90
Adult Roles /wp-admin/admin.php?page=scouttroop/scouttroop.php/adult9952.0326.1027.98
Patrols /wp-admin/admin.php?page=scouttroop/scouttroop.php/patrols9942.0724.5528.81
Ranks /wp-admin/admin.php?page=scouttroop/scouttroop.php/rank_assignment9912.0325.9328.23
Patrol Admin /wp-admin/admin.php?page=scouttroop/scouttroop.php/patrol_admin8542.2126.4131.61

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 36 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=scouttroop/scouttroop.php/patrol_admin
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=scouttroop/scouttroop.php/rank_assignment
    • > Notice in wp-content/plugins/scouttroop/includes/scouttroop_rank_assignment.php+80
    Undefined index: scout
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=scouttroop/scouttroop.php/patrol_admin
    • > Notice in wp-content/plugins/scouttroop/scouttroop.php+116
    Trying to access array offset on value of type bool

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 take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/scouttroop/scouttroop.php
    • > /wp-content/plugins/scouttroop/uninstall.php
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > 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/scouttroop/includes/scouttroop_leadership_assignment.php on line 3
    • > 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/scouttroop/includes/scouttroop_adult_assignment.php on line 3
    • > 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/scouttroop/includes/scouttroop_leadership_assignment.php on line 3
    • > 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/scouttroop/includes/scouttroop_rank_assignment.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/scouttroop/includes/scouttroop_patrol_assignment.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/scouttroop/includes/scouttroop_leadership_assignment.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/scouttroop/includes/scouttroop_rank_assignment.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/scouttroop/includes/scouttroop_adult_assignment.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/scouttroop/includes/scouttroop_rank_assignment.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/scouttroop/includes/shortcodes.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (Add/edit list of Patrols.), #2 (Assign roles to adults.), #3 (Assign scouts to patrols.), #4 (Assign rank to scouts.), #5 (Assign scouts to leadership positions.), #6 (Scouts by rank grid)
You can take inspiration from this readme.txt

scouttroop/scouttroop.php Passed 13 tests

The main PHP file in "ScoutTroop" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
34 characters long description:
A brief description of the plugin.

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
No dangerous file extensions were detected809 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP815385808
Markdown1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity15.25
▷ Minimum class complexity10.00
▷ Maximum class complexity20.00
Average method complexity2.39
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods42
▷ Static methods00.00%
▷ Public methods4095.24%
▷ Protected methods24.76%
▷ Private methods00.00%
Functions22
▷ Named functions22100.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
14 PNG files occupy 0.36MB with 0.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png18.12KB6.89KB▼ 62.00%
assets/second_class-small.png17.17KB6.54KB▼ 61.91%
assets/star-small.png16.76KB6.25KB▼ 62.73%
assets/life-small.png17.44KB6.38KB▼ 63.41%
screenshot-4.png34.04KB9.66KB▼ 71.62%