84% caspers-leave-notice

Code Review | Casper's Leave Notice

WordPress plugin Casper's Leave Notice scored84%from 54 tests.

About plugin

  • Plugin page: caspers-leave-notice
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.2
  • WordPress version: 6.3.1
  • First release: Jun 25, 2016
  • Latest release: Jul 18, 2019
  • Number of updates: 11
  • Update frequency: every 101.7 days
  • Top authors: XAce90 (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

500+ active /3,271 total downloads


Plugin footprint 83% 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.05MB] [CPU: ▼2.68ms] Passed 4 tests

Analyzing server-side resources used by Casper's Leave Notice
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0440.66 ▼3.30
Dashboard /wp-admin3.36 ▲0.0650.41 ▼4.65
Posts /wp-admin/edit.php3.48 ▲0.1250.76 ▼2.82
Add New Post /wp-admin/post-new.php5.94 ▲0.0594.15 ▲0.06
Media Library /wp-admin/upload.php3.29 ▲0.0538.88 ▲1.25
External Links /wp-admin/options-general.php?page=cpleavenotice3.3140.83

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 9 new options
New WordPress options

Browser metrics Passed 4 tests

Casper's Leave Notice: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,937 ▲17613.48 ▼0.8710.90 ▲9.1243.18 ▲0.82
Dashboard /wp-admin2,199 ▲195.52 ▼0.1390.95 ▲0.5640.04 ▼5.28
Posts /wp-admin/edit.php2,101 ▼22.01 ▼0.0335.54 ▼11.6935.58 ▼0.71
Add New Post /wp-admin/post-new.php1,531 ▲522.98 ▼0.43697.05 ▲51.2457.30 ▲5.64
Media Library /wp-admin/upload.php1,398 ▼24.24 ▲0.0697.80 ▼18.8344.92 ▼2.48
External Links /wp-admin/options-general.php?page=cpleavenotice1,5596.72154.4866.44

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/caspers-leave-notice/functions/scripts-and-support.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/caspers-leave-notice/functions/admin/admin-page.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/caspers-leave-notice/functions/options.php:45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/caspers-leave-notice/caspers-leave-notice.php:13

User-side errors Passed 1 test

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


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
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === caspers-leave-notice === )
The official readme.txt might help

caspers-leave-notice/caspers-leave-notice.php Passed 13 tests

The primary PHP file in "Casper's Leave Notice" version 1.2.3 is used by WordPress to initiate all plugin functionality
117 characters long description:
Warns your users when they are leaving your site. You can edit the content of the warning, as well as add exceptions.

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 detected466 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions20100.00%
▷ Anonymous functions00.00%
▷ Global constants00.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 files were detected