84% safety-exit

Code Review | Safety Exit

WordPress plugin Safety Exit scored84%from 54 tests.

About plugin

  • Plugin page: safety-exit
  • Plugin version: 1.6.5
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Sep 7, 2018
  • Latest release: Jul 4, 2023
  • Number of updates: 51
  • Update frequency: every 35.9 days
  • Top authors: tcordero (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /8,137 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.35ms] Passed 4 tests

Analyzing server-side resources used by Safety Exit
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.51 ▼1.73
Dashboard /wp-admin3.33 ▲0.0340.65 ▼10.88
Posts /wp-admin/edit.php3.38 ▲0.0341.03 ▼9.43
Add New Post /wp-admin/post-new.php5.91 ▲0.0394.40 ▲2.12
Media Library /wp-admin/upload.php3.25 ▲0.0334.73 ▲0.63

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

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

Browser metrics Passed 4 tests

Safety Exit: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,972 ▲23713.60 ▼0.725.55 ▲3.8351.81 ▲2.36
Dashboard /wp-admin2,253 ▲654.91 ▼0.99114.62 ▲6.8743.62 ▲4.77
Posts /wp-admin/edit.php2,136 ▲502.02 ▲0.0340.94 ▲4.2437.08 ▲3.65
Add New Post /wp-admin/post-new.php1,546 ▲2723.27 ▲0.25580.77 ▼94.5359.10 ▲0.56
Media Library /wp-admin/upload.php1,429 ▲384.24 ▲0.0699.03 ▼0.3941.80 ▼4.43

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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 fix the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/safety-exit/lib/views/global-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/safety-exit/lib/views/button-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_parse_args() in wp-content/plugins/safety-exit/lib/views/frontend-button.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: safety exit, no domestic violence, panic button, exit, domestic violence...

safety-exit/safety-exit.php Passed 13 tests

This is the main PHP file of "Safety Exit" version 1.6.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
123 characters long description:
This plugin will inject a button on your website that will allow a website user to quickly navigate away from your website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected1,037 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP65484505
CSS6825404
JavaScript52541119
SVG2009

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity13.00
▷ Minimum class complexity3.00
▷ Maximum class complexity23.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.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
No PNG files were detected