10% general-contact-form

Code Review | General Contact Form

WordPress plugin General Contact Form scored10%from 54 tests.

About plugin

  • Plugin page: general-contact-form
  • Plugin version: 1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5
  • WordPress version: 6.3.1
  • First release: Jan 10, 2013
  • Latest release: Jan 17, 2013
  • Number of updates: 12
  • Update frequency: every 0.7 days
  • Top authors: v_wordpress (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,715 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5453
    Function get_settings is deprecated since version 2.1.0! Use get_option() instead.

Server metrics [RAM: ▲0.10MB] [CPU: ▼6.06ms] Passed 4 tests

A check of server-side resources used by General Contact Form
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0748.12 ▲3.19
Dashboard /wp-admin3.42 ▲0.1245.73 ▼8.09
Posts /wp-admin/edit.php3.45 ▲0.1049.65 ▼0.73
Add New Post /wp-admin/post-new.php6.11 ▲0.2284.70 ▼10.93
Media Library /wp-admin/upload.php3.36 ▲0.1335.46 ▼4.50
Contact Form /wp-admin/admin.php?page=my-top-level-handle3.3236.79
Records /wp-admin/admin.php?page=my-submenu-handle3.2533.33
/wp-admin/options-general.php?page=general-contact-form/search_records.php3.2831.81
/wp-admin/options-general.php?page=general-contact-form/update_fields.php3.3233.82
/wp-admin/options-general.php?page=general-contact-form/delete_fields.php3.2730.68
/wp-admin/options-general.php?page=general-contact-form/add_fields.php3.2928.06
/wp-admin/options-general.php?page=general-contact-form/more_records.php3.2831.52
/wp-admin/options-general.php?page=general-contact-form/delete_records.php3.2728.83

Server storage [IO: ▲0.62MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Please fix the following
  • There were 1 file (4.00KB) illegally modified outside of "wp-content/plugins/general-contact-form/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 21 new files
Database: 2 new tables, 13 new options
New tables
wp_CF_fields
wp_CF_records
New WordPress options
widget_recent-comments
widget_recent-posts
CF_title
db_upgraded
CF_fields
can_compress_scripts
CF_records
CF_On_MyEmail
widget_theysaidso_widget
CF_On_SendEmail
...

Browser metrics Passed 4 tests

An overview of browser requirements for General Contact Form
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,864 ▲10313.68 ▼0.691.75 ▼0.2842.61 ▼2.20
Dashboard /wp-admin2,266 ▲664.85 ▼1.03108.43 ▼8.5939.73 ▼3.92
Posts /wp-admin/edit.php2,149 ▲522.05 ▲0.0541.83 ▲6.8134.26 ▼1.69
Add New Post /wp-admin/post-new.php1,559 ▲1422.69 ▼0.84672.08 ▲19.7950.60 ▼8.68
Media Library /wp-admin/upload.php1,445 ▲454.23 ▼0.00107.74 ▼11.1747.41 ▼0.85
Contact Form /wp-admin/admin.php?page=my-top-level-handle1,0772.0729.5232.61
Records /wp-admin/admin.php?page=my-submenu-handle8362.0624.9326.33
/wp-admin/options-general.php?page=general-contact-form/search_records.php8272.0224.9230.98
/wp-admin/options-general.php?page=general-contact-form/update_fields.php1,0292.0324.9528.35
/wp-admin/options-general.php?page=general-contact-form/delete_fields.php1,0982.0423.6932.44
/wp-admin/options-general.php?page=general-contact-form/add_fields.php1,0392.0329.1128.24
/wp-admin/options-general.php?page=general-contact-form/more_records.php8522.0623.6127.94
/wp-admin/options-general.php?page=general-contact-form/delete_records.php8382.0223.5028.78

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
The following items require your attention
  • Zombie tables detected upon uninstall: 2 tables
    • wp_CF_fields
    • wp_CF_records
  • This plugin does not fully uninstall, leaving 13 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • CF_On_MySubject
    • CF_On_SendEmail
    • CF_fields
    • CF_records
    • db_upgraded
    • CF_On_MyEmail
    • can_compress_scripts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/delete_records.php
    • > Notice in wp-content/plugins/general-contact-form/delete_records.php+4
    Undefined index: val
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/delete_fields.php
    • > Warning in wp-content/plugins/general-contact-form/contact_admin.php+24
    Use of undefined constant add - assumed 'add' (this will throw an Error in a future version of PHP)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/delete_records.php
    • > Warning in wp-content/plugins/general-contact-form/index.php+205
    Use of undefined constant del - assumed 'del' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/delete_fields.php
    • > Warning in wp-content/plugins/general-contact-form/contact_admin.php+32
    Use of undefined constant updt - assumed 'updt' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/delete_fields.php
    • > Notice in wp-content/plugins/general-contact-form/contact_admin.php+38
    Undefined index: CF_submit
    • > GET request to /wp-admin/admin.php?page=my-submenu-handle
    • > Notice in wp-content/plugins/general-contact-form/index.php+204
    Undefined index: check
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/delete_records.php
    • > Notice in wp-content/plugins/general-contact-form/index.php+209
    Undefined index: start
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/delete_records.php
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/delete_records.php
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.)
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/search_records.php
    • > Notice in wp-content/plugins/general-contact-form/search_records.php+3
    Undefined index: search
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/update_fields.php
    • > Notice in wp-content/plugins/general-contact-form/update_fields.php+14
    Undefined index: CF_update_submit
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/update_fields.php
    • > Notice in wp-content/plugins/general-contact-form/update_fields.php+163
    Undefined variable: result
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/update_fields.php
    • > Notice in wp-content/plugins/general-contact-form/update_fields.php+82
    Trying to get property 'id' of non-object
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/update_fields.php
    • > Notice in wp-content/plugins/general-contact-form/update_fields.php+90
    Trying to get property 'fieldid' of non-object
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/update_fields.php
    • > Notice in wp-content/plugins/general-contact-form/update_fields.php+98
    Trying to get property 'fieldname' of non-object
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/update_fields.php
    • > Notice in wp-content/plugins/general-contact-form/update_fields.php+106
    Trying to get property 'display' of non-object
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/update_fields.php
    • > Notice in wp-content/plugins/general-contact-form/update_fields.php+115
    Trying to get property 'required' of non-object
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/update_fields.php
    • > Notice in wp-content/plugins/general-contact-form/update_fields.php+125
    Trying to get property 'type' of non-object
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/update_fields.php
    • > Notice in wp-content/plugins/general-contact-form/update_fields.php+139
    Trying to get property 'values' of non-object
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/update_fields.php
    • > Notice in wp-content/plugins/general-contact-form/update_fields.php+149
    Trying to get property 'validation' of non-object
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/update_fields.php
    • > Notice in wp-content/plugins/general-contact-form/update_fields.php+163
    Trying to get property 'size' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/delete_fields.php
    • > Notice in wp-content/plugins/general-contact-form/delete_fields.php+16
    Undefined variable: col_name
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/add_fields.php
    • > Notice in wp-content/plugins/general-contact-form/add_fields.php+17
    Undefined index: CF_new_submit
    • > GET request to /wp-admin/options-general.php?page=general-contact-form/add_fields.php
    • > Notice in wp-content/plugins/general-contact-form/add_fields.php+90
    Undefined variable: key_id

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/general-contact-form/captcha.php
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/general-contact-form/index.php:120
    • > PHP Notice
      Undefined index: search in wp-content/plugins/general-contact-form/search_records.php on line 3
    • > PHP Notice
      Undefined index: val in wp-content/plugins/general-contact-form/delete_fields.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/general-contact-form/update_fields.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/general-contact-form/more_records.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/general-contact-form/contact_admin.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/general-contact-form/update_records.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/general-contact-form/add_fields.php:15
    • > PHP Notice
      Undefined index: val in wp-content/plugins/general-contact-form/delete_records.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/general-contact-form/delete_fields.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Contact Form Admin Panel screenshot1.png), #2 (Contact Form display features screenshot2.png), #3 (Adding new fields screenshot3.png), #4 (Contact Form front end display screenshot4.png)
Please take inspiration from this readme.txt

general-contact-form/index.php 85% from 13 tests

Analyzing the main PHP file in "General Contact Form" version 1.7
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 400 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("general-contact-form.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin1,107 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP11129681,107

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
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
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.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
4 PNG files occupy 0.33MB with 0.20MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot2.png22.81KB8.31KB▼ 63.56%
screenshot3.png91.13KB44.29KB▼ 51.40%
screenshot4.png6.30KB1.79KB▼ 71.65%
screenshot1.png221.10KB109.58KB▼ 50.44%