84% natural-contact-form

Code Review | Natural Contact Form

WordPress plugin Natural Contact Form scored84%from 54 tests.

About plugin

  • Plugin page: natural-contact-form
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-4.8
  • WordPress version: 6.3.1
  • First release: Oct 3, 2016
  • Latest release: Aug 1, 2017
  • Number of updates: 7
  • Update frequency: every 43.3 days
  • Top authors: kirkbowers (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /814 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.43MB] [CPU: ▲1.11ms] Passed 4 tests

Analyzing server-side resources used by Natural Contact Form
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.91 ▲0.4547.51 ▲0.52
Dashboard /wp-admin3.76 ▲0.4656.92 ▲6.66
Posts /wp-admin/edit.php3.81 ▲0.4657.56 ▲3.19
Add New Post /wp-admin/post-new.php6.30 ▲0.4195.22 ▼5.94
Media Library /wp-admin/upload.php3.62 ▲0.3947.09 ▲10.67
Add New Form /wp-admin/admin.php?page=natural_contact_form_new3.5939.47
All Forms /wp-admin/admin.php?page=natural_contact_form_all_forms3.5936.60
Edit Form /wp-admin/admin.php?page=natural_contact_form_edit3.5736.33
MailChimp API Key Form /wp-admin/admin.php?page=natural_contact_form_mailchimp_api_key3.5739.62
MailChimp Settings Form /wp-admin/admin.php?page=natural_contact_form_mailchimp_settings3.5739.73
Delete Form /wp-admin/admin.php?page=natural_contact_form_delete3.5738.91

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 37 new files
Database: 1 new table, 8 new options
New tables
wp_com_kirkbowers_naturalcontactform_contact_forms
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
com_kirkbowers_naturalcontactform_contact_forms_version
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

This is an overview of browser requirements for Natural Contact Form
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,956 ▲19513.63 ▼0.995.93 ▲3.8438.87 ▼3.97
Dashboard /wp-admin2,254 ▲515.88 ▼0.00100.07 ▼1.6238.80 ▼6.60
Posts /wp-admin/edit.php2,133 ▲362.06 ▲0.0942.87 ▲1.8134.57 ▼2.76
Add New Post /wp-admin/post-new.php1,554 ▲2323.52 ▲0.47701.32 ▲43.46103.16 ▲26.18
Media Library /wp-admin/upload.php1,433 ▲364.29 ▲0.06107.39 ▲3.8847.37 ▼2.44
Add New Form /wp-admin/admin.php?page=natural_contact_form_new8791.7327.5325.22
All Forms /wp-admin/admin.php?page=natural_contact_form_all_forms8551.7231.1229.21
Edit Form /wp-admin/admin.php?page=natural_contact_form_edit7311.579.5632.69
MailChimp API Key Form /wp-admin/admin.php?page=natural_contact_form_mailchimp_api_key7131.399.1420.87
MailChimp Settings Form /wp-admin/admin.php?page=natural_contact_form_mailchimp_settings7131.579.9617.86
Delete Form /wp-admin/admin.php?page=natural_contact_form_delete6931.3910.1820.76

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • db_upgraded

Smoke tests 75% 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)
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=natural_contact_form_delete
    • > Notice in wp-content/plugins/natural-contact-form/include/pages/delete_form.php+9
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=natural_contact_form_edit
    • > Error in wp-content/plugins/natural-contact-form/include/pages/edit_form.php+310
    Uncaught Error: Call to a member function get() on null in wp-content/plugins/natural-contact-form/include/pages/edit_form.php:310
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): com\kirkbowers\naturalcontactform\display_page_edit_form()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=natural_contact_form_mailchimp_api_key
    • > Error in wp-content/plugins/natural-contact-form/include/lib/edit-forms/include/array_field_edit_form.php+40
    Uncaught Error: Call to a member function get() on null in wp-content/plugins/natural-contact-form/include/lib/edit-forms/include/array_field_edit_form.php:40
    Stack trace:
    #0 wp-content/plugins/natural-contact-form/include/pages/mailchimp_api_key_form.php(17): com\kirkbowers\editforms\ArrayFieldEditForm->set_containing_model()
    #1 wp-includes/class-wp-hook.php(310): com\kirkbowers\naturalcontactform\display_page_mailchimp_api_key_form()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=natural_contact_form_mailchimp_settings
    • > Error in wp-content/plugins/natural-contact-form/include/lib/edit-forms/include/array_field_edit_form.php+40
    Uncaught Error: Call to a member function get() on null in wp-content/plugins/natural-contact-form/include/lib/edit-forms/include/array_field_edit_form.php:40
    Stack trace:
    #0 wp-content/plugins/natural-contact-form/include/pages/mailchimp_settings_form.php(17): com\kirkbowers\editforms\ArrayFieldEditForm->set_containing_model()
    #1 wp-includes/class-wp-hook.php(310): com\kirkbowers\naturalcontactform\display_page_mailchimp_settings_form()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=natural_contact_form_delete
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Everything seems fine, however this is by no means an exhaustive test

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 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
7 plugin tags: optin, opt in, spam protection, mailchimp, contact form...

natural-contact-form/natural-contact-form.php 92% from 13 tests

The principal PHP file in "Natural Contact Form" v. 1.1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 193 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin2,493 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP276694512,348
JavaScript33014131
CSS22014

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity15.67
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods102
▷ Static methods4140.20%
▷ Public methods7270.59%
▷ Protected methods1918.63%
▷ Private methods1110.78%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin