56% safetymails-forms

Code Review | SafetyForms – Create forms with Real-time Email Validation

WordPress plugin SafetyForms – Create forms with Real-time Email Validation scored56%from 54 tests.

About plugin

  • Plugin page: safetymails-forms
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.2
  • WordPress version: 6.3.1
  • First release: Jul 12, 2018
  • Latest release: Jul 1, 2019
  • Number of updates: 3
  • Update frequency: every 118.3 days
  • Top authors: henoliv (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /605 total downloads

Benchmarks

Plugin footprint 65% 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.16MB] [CPU: ▼4.83ms] Passed 4 tests

Analyzing server-side resources used by SafetyForms – Create forms with Real-time Email Validation
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1542.52 ▼4.33
Dashboard /wp-admin3.47 ▲0.1649.54 ▲1.27
Posts /wp-admin/edit.php3.58 ▲0.2248.90 ▼2.61
Add New Post /wp-admin/post-new.php6.07 ▲0.1788.95 ▼13.64
Media Library /wp-admin/upload.php3.39 ▲0.1642.51 ▲9.08
All Forms /wp-admin/admin.php?page=safetymail-form3.3639.26
Edit Form /wp-admin/admin.php?page=safetymail-form-edit3.3332.45
New Form /wp-admin/admin.php?page=safetymail-form-new3.3934.11
Settings /wp-admin/admin.php?page=safetymail-form-config3.3634.89

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 37 new files
Database: 2 new tables, 6 new options
New tables
wp_safety_forms_config
wp_safety_forms
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for SafetyForms – Create forms with Real-time Email Validation
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,020 ▲25916.13 ▲2.0249.12 ▲46.9225.76 ▼22.94
Dashboard /wp-admin2,291 ▲1176.58 ▲1.05106.56 ▲18.7553.31 ▲13.21
Posts /wp-admin/edit.php2,182 ▲823.58 ▲1.5849.19 ▲9.7247.20 ▲6.01
Add New Post /wp-admin/post-new.php6,440 ▲4,90325.30 ▲6.96951.49 ▲308.7759.16 ▼11.22
Media Library /wp-admin/upload.php1,493 ▲966.15 ▲1.98121.57 ▲18.8558.05 ▲13.56
All Forms /wp-admin/admin.php?page=safetymail-form1,0363.2547.2835.73
Edit Form /wp-admin/admin.php?page=safetymail-form-edit1,2183.9947.2250.93
New Form /wp-admin/admin.php?page=safetymail-form-new1,2163.7847.0337.68
Settings /wp-admin/admin.php?page=safetymail-form-config9793.3241.8535.11

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_safety_forms_config
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=safetymail-form-edit
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-edit.php+174
    Undefined index: id
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=safetymail-form-edit
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-edit.php+28
    Undefined index: name
    • > GET request to /wp-admin/admin.php?page=safetymail-form-edit
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-edit.php+67
    Undefined index: invalid_callback
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=safetymail-form-edit
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-edit.php+89
    Undefined index: action
    • > GET request to /wp-admin/admin.php?page=safetymail-form-edit
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-edit.php+94
    Undefined index: action_content
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=safetymail-form-edit
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-edit.php+104
    Undefined index: show_status
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=safetymail-form-edit
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-edit.php+144
    Undefined index: html
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=safetymail-form-edit
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-edit.php+116
    Undefined index: protected
    • > GET request to /wp-admin/admin.php?page=safetymail-form-edit
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-edit.php+124
    Undefined index: subject
    • > GET request to /wp-admin/admin.php?page=safetymail-form-edit
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-edit.php+129
    Undefined index: email_recipient
    • > GET request to /wp-admin/admin.php?page=safetymail-form-edit
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-edit.php+134
    Undefined index: email_replyto
    • > GET request to /wp-admin/admin.php?page=safetymail-form-edit
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-edit.php+157
    Undefined index: api_key
    • > GET request to /wp-admin/admin.php?page=safetymail-form-edit
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-edit.php+162
    Undefined index: api_ticket
    • > GET request to /wp-admin/admin.php?page=safetymail-form-edit
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-edit.php+173
    Undefined index: element
    • > GET request to /wp-admin/admin.php?page=safetymail-form-config
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-config.php+30
    Undefined index: host
    • > GET request to /wp-admin/admin.php?page=safetymail-form-config
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-config.php+48
    Undefined index: sender_name
    • > GET request to /wp-admin/admin.php?page=safetymail-form-config
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-config.php+53
    Undefined index: email_sender
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=safetymail-form-config
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-config.php+76
    Undefined index: require_auth
    • > GET request to /wp-admin/admin.php?page=safetymail-form-config
    • > Notice in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-config.php+73
    Undefined index: user

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 fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/safetymails-forms/public/partials/safetymail-form-public-display.php
  • 15× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-config.php on line 30
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/safetymails-forms/includes/class-safetymail-form-activator.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/safetymails-forms/includes/class-safetymail-form-list.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/safetymails-forms/includes/class-safetymail-form-activator.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-edit.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-new.php:17
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/safetymails-forms/includes/class-safetymail-form-deactivator.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-config.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/safetymails-forms/admin/partials/safetymail-form-admin-display.php:17
    • > 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/safetymails-forms/includes/class-safetymail-form-list.php on line 4

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=safetymail-form-edit
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=safetymail-form-edit 291:13 Uncaught SyntaxError: Unexpected end of input

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: builder, email, form

safetymails-forms/safetymail-form.php 77% from 13 tests

This is the main PHP file of "SafetyForms – Create forms with Real-time Email Validation" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 191 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("safetymails-forms.php" instead of "safetymail-form.php")

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
Everything looks great! No dangerous files found in this plugin1,757 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP162606721,070
JavaScript73666485
PO File15151119
CSS4152050
HTML17033

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.12
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.61
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods54
▷ Static methods611.11%
▷ Public methods4990.74%
▷ Protected methods00.00%
▷ Private methods59.26%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants120.00%
▷ Class constants480.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.11MB with 0.08MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/logo.png115.87KB37.82KB▼ 67.36%