78% thank-you-nhs

Code Review | Thank You NHS

WordPress plugin Thank You NHS scored78%from 54 tests.

About plugin

  • Plugin page: thank-you-nhs
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-5.4.1
  • WordPress version: 6.3.1
  • First release: May 1, 2020
  • Latest release: May 5, 2020
  • Number of updates: 15
  • Update frequency: every 0.3 days
  • Top authors: andrewchadwicksl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /522 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.85ms] Passed 4 tests

Server-side resources used by Thank You NHS
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.55 ▼6.05
Dashboard /wp-admin3.32 ▲0.0145.94 ▼0.58
Posts /wp-admin/edit.php3.37 ▲0.0154.77 ▲8.85
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.29 ▼6.03
Media Library /wp-admin/upload.php3.24 ▲0.0135.29 ▲1.27
NHS Banner Settings /wp-admin/options-general.php?page=thank_you_nhs_options3.2528.93

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Thank You NHS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲6213.17 ▼1.065.34 ▲2.9943.31 ▼0.33
Dashboard /wp-admin2,213 ▲255.84 ▲0.9597.70 ▼8.8241.84 ▲2.07
Posts /wp-admin/edit.php2,096 ▲42.04 ▼0.0141.31 ▼4.2642.12 ▲8.37
Add New Post /wp-admin/post-new.php1,517 ▼2117.58 ▼5.39689.13 ▲68.6450.20 ▼13.56
Media Library /wp-admin/upload.php1,392 ▲14.25 ▲0.04103.39 ▲2.1043.43 ▲0.40
NHS Banner Settings /wp-admin/options-general.php?page=thank_you_nhs_options2,7011.7629.3526.24

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=thank_you_nhs_options
    • > Notice in wp-content/plugins/thank-you-nhs/thank-you-nhs-settings.php+43
    Trying to access array offset on value of type bool

SRP 50% 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
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/thank-you-nhs/js/script.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/thank-you-nhs/thank-you-nhs-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/thank-you-nhs/thank-you-nhs.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/thank-you-nhs/css/styles.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt is a good inspiration

thank-you-nhs/thank-you-nhs.php Passed 13 tests

The principal PHP file in "Thank You NHS" v. 1.0 is loaded by WordPress automatically on each request
89 characters long description:
Adding rainbows to your site to spread hope and say thank you to the NHS and key workers.

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 plugin1,151 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
SVG303953
PHP42831198

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods450.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/rainbow-cursor.png2.63KB1.76KB▼ 33.20%
images/rainbow-pointer.png2.86KB1.84KB▼ 35.76%