78% psychological-first-aid-training-kit

Code Review | Psychological First Aid Training Kit

WordPress plugin Psychological First Aid Training Kit scored78%from 54 tests.

About plugin

  • Plugin page: psychological-fir...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.1-6.2
  • WordPress version: 6.3.1
  • First release: Apr 20, 2023
  • Latest release: Apr 20, 2023
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: knowhalim (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /180 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼2.62ms] Passed 4 tests

This is a short check of server-side resources used by Psychological First Aid Training Kit
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1037.13 ▼4.64
Dashboard /wp-admin3.39 ▲0.0945.00 ▼2.85
Posts /wp-admin/edit.php3.50 ▲0.1551.39 ▲3.99
Add New Post /wp-admin/post-new.php5.99 ▲0.1190.34 ▼6.99
Media Library /wp-admin/upload.php3.31 ▲0.0937.87 ▲4.01

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Psychological First Aid Training Kit
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲17713.64 ▼0.784.99 ▲3.2243.05 ▼8.20
Dashboard /wp-admin2,213 ▲254.87 ▼1.0196.98 ▼22.7239.93 ▼4.41
Posts /wp-admin/edit.php2,096 ▲72.02 ▲0.0139.62 ▲4.2834.11 ▲1.70
Add New Post /wp-admin/post-new.php1,518 ▼2422.96 ▲4.54583.50 ▼46.6649.63 ▼4.99
Media Library /wp-admin/upload.php1,395 ▲74.18 ▼0.18103.31 ▲6.3443.40 ▼0.60

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/psychological-first-aid-training-kit/admin/partials/pfatraining-kit-admin-display.php
    • > /wp-content/plugins/psychological-first-aid-training-kit/public/partials/pfatraining-kit-public-display.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/psychological-first-aid-training-kit/public/class-pfatraining-kit-public.php:107

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 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: breaking bad news, cism, pfa, psychological, cisd...

psychological-first-aid-training-kit/pfatraining-kit.php 77% from 13 tests

The primary PHP file in "Psychological First Aid Training Kit" version 1.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("psychological-first-aid-training-kit.php" instead of "pfatraining-kit.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 175 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin1,243 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP121685431,237
JavaScript24546
CSS2080

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.07
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.13
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin