62% contact-form-with-shortcode

Code Review | Contact Form With Shortcode

WordPress plugin Contact Form With Shortcode scored62%from 54 tests.

About plugin

  • Plugin page: contact-form-with...
  • Plugin version: 4.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-5.9.3
  • WordPress version: 6.3.1
  • First release: Aug 27, 2014
  • Latest release: May 14, 2022
  • Number of updates: 88
  • Update frequency: every 32.0 days
  • Top authors: avi.megladon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /17,176 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.68MB] [CPU: ▲1.06ms] Passed 4 tests

Server-side resources used by Contact Form With Shortcode
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.11 ▲0.6545.84 ▲2.97
Dashboard /wp-admin4.01 ▲0.6755.02 ▼11.52
Posts /wp-admin/edit.php4.06 ▲0.7056.96 ▲8.77
Add New Post /wp-admin/post-new.php6.63 ▲0.7498.29 ▲6.64
Media Library /wp-admin/upload.php3.93 ▲0.7145.86 ▲6.14
Newsletter /wp-admin/edit.php?post_type=newsletter_form3.9748.51
Subscription Forms /wp-admin/edit.php?post_type=subscribe_form3.9742.48
Contact Forms Data /wp-admin/admin.php?page=contact_form_ap_db_data3.9140.31
Contact Forms /wp-admin/edit.php?post_type=contact_form3.9745.92
Subscribers /wp-admin/admin.php?page=contact_widget_ap_subscribers3.9140.23
Contact Form Usage /wp-admin/admin.php?page=contact_form_settings3.9241.39

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 159 new files
Database: 2 new tables, 8 new options
New tables
wp_contact_subscribers
wp_contact_stored_data
New WordPress options
widget_recent-comments
db_upgraded
widget_subscribe_form_wid
can_compress_scripts
widget_recent-posts
widget_contact_form_wid
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Contact Form With Shortcode: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,196 ▲46114.10 ▼0.2517.35 ▲14.9745.19 ▼5.91
Dashboard /wp-admin2,259 ▲795.69 ▲0.0294.21 ▲7.4539.77 ▲1.79
Posts /wp-admin/edit.php2,165 ▲652.27 ▲0.3035.52 ▼1.2035.19 ▲0.74
Add New Post /wp-admin/post-new.php1,578 ▲5223.16 ▼0.29631.79 ▼83.5535.20 ▼35.06
Media Library /wp-admin/upload.php1,455 ▲584.27 ▲0.0995.76 ▼30.3341.56 ▼4.07
Newsletter /wp-admin/edit.php?post_type=newsletter_form1,1372.1736.6230.91
Subscription Forms /wp-admin/edit.php?post_type=subscribe_form1,1342.1834.1629.43
Contact Forms Data /wp-admin/admin.php?page=contact_form_ap_db_data1,1601.9528.9831.21
Contact Forms /wp-admin/edit.php?post_type=contact_form1,1372.2034.3129.01
Subscribers /wp-admin/admin.php?page=contact_widget_ap_subscribers1,1021.9529.1530.82
Contact Form Usage /wp-admin/admin.php?page=contact_form_settings1,2901.8428.6548.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_contact_subscribers
    • wp_contact_stored_data
  • The uninstall procedure has failed, leaving 8 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_contact_form_wid
    • widget_subscribe_form_wid
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% 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)
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=contact_form_ap_db_data
    • > Notice in wp-content/plugins/contact-form-with-shortcode/view/admin/contact-db-search-form.php+11
    Undefined index: con_id
    • > GET request to /wp-admin/admin.php?page=contact_widget_ap_subscribers
    • > Notice in wp-content/plugins/contact-form-with-shortcode/view/admin/subscriber-search-form.php+3
    Undefined index: form_id

SRP 0% from 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
Please fix the following items
  • 14× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/contact-form-with-shortcode/view/admin/pro-add.php
    • > /wp-content/plugins/contact-form-with-shortcode/view/frontend/contact-validation-scripts.php
    • > /wp-content/plugins/contact-form-with-shortcode/view/admin/subscribe-meta-email-body-fields.php
    • > /wp-content/plugins/contact-form-with-shortcode/view/frontend/fields/date-scripts.php
    • > /wp-content/plugins/contact-form-with-shortcode/view/admin/sorting-scripts.php
    • > /wp-content/plugins/contact-form-with-shortcode/captcha/captcha.php
    • > /wp-content/plugins/contact-form-with-shortcode/view/admin/subscribe-meta-email-body-admin-fields.php
    • > /wp-content/plugins/contact-form-with-shortcode/template/default.php
    • > /wp-content/plugins/contact-form-with-shortcode/view/frontend/contact-submit-scripts.php
    • > /wp-content/plugins/contact-form-with-shortcode/view/frontend/fields/checkbox-scripts.php
  • 100× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/contact-form-with-shortcode/view/admin/subscriber-list-edit-form.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/contact-form-with-shortcode/view/admin/fields/edit-time.php:1
    • > PHP Notice
      Undefined variable: subscribe_mail_body_admin in wp-content/plugins/contact-form-with-shortcode/view/admin/subscribe-meta-email-body-admin-fields.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/contact-form-with-shortcode/view/admin/subscriber-edit-form.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/contact-form-with-shortcode/view/admin/subscribers-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/contact-form-with-shortcode/view/admin/help-support.php:3
    • > PHP Warning
      Use of undefined constant CFWS_DIR_PATH - assumed 'CFWS_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/contact-form-with-shortcode/config/config-general.php on line 5
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/contact-form-with-shortcode/view/frontend/subscription-widget.php on line 7
    • > PHP Notice
      Undefined variable: name in wp-content/plugins/contact-form-with-shortcode/view/frontend/fields/checkbox-scripts.php on line 6
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/contact-form-with-shortcode/view/admin/sorting-scripts.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: A description for screenshot #2 is required in contact-form-with-shortcode/assets to your readme.txt
  • Tags: There are too many tags (30 tag instead of maximum 10)
Please take inspiration from this readme.txt

contact-form-with-shortcode/contact.php 85% from 13 tests

The main PHP script in "Contact Form With Shortcode" version 4.2.5 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 173 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("contact-form-with-shortcode.php" instead of "contact.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
Success! There were no dangerous files found in this plugin8,034 lines of code in 110 files:
LanguageFilesBlank linesComment linesLines of code
PHP96697724,856
CSS574711,647
JavaScript82706291,493
PO File118038

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity12.42
▷ Minimum class complexity1.00
▷ Maximum class complexity52.00
Average method complexity2.34
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes24
▷ Abstract classes00.00%
▷ Concrete classes24100.00%
▷ Final classes00.00%
Methods205
▷ Static methods115.37%
▷ Public methods205100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions24
▷ Named functions2291.67%
▷ Anonymous functions28.33%
Constants3
▷ Global constants3100.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
34 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-bg_gloss-wave_35_f6a828_500x100.png5.68KB1.83KB▼ 67.77%
img/switch.png0.53KB0.64KB0.00%
css/images/ui-icons_72a7cf_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-bg_flat_10_000000_40x100.png0.20KB0.08KB▼ 57.56%
css/images/ui-bg_diagonals-thick_18_b81900_40x40.png0.41KB0.15KB▼ 62.44%