47% contact-form-monster

Code Review | Contact Form Monster

WordPress plugin Contact Form Monster scored47%from 54 tests.

About plugin

  • Plugin page: contact-form-monster
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.6
  • WordPress version: 6.3.1
  • First release: Feb 21, 2020
  • Latest release: Jan 22, 2021
  • Number of updates: 5
  • Update frequency: every 67.2 days
  • Top authors: devfelixmoira (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /1,461 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼2.53ms] Passed 4 tests

A check of server-side resources used by Contact Form Monster
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2042.11 ▲1.22
Dashboard /wp-admin3.52 ▲0.2144.94 ▼4.64
Posts /wp-admin/edit.php3.57 ▲0.2148.60 ▼1.57
Add New Post /wp-admin/post-new.php6.05 ▲0.1687.55 ▼4.19
Media Library /wp-admin/upload.php3.38 ▲0.1437.46 ▲0.27
Contact Form /wp-admin/admin.php?page=YcfMenu3.3434.37
Add New /wp-admin/admin.php?page=addNewForm3.3230.05

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 34 new files
Database: 2 new tables, 7 new options
New tables
wp_ycf_form
wp_ycf_fields
New WordPress options
can_compress_scripts
db_upgraded
YcfFormDraft
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Contact Form Monster: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲5613.25 ▼1.131.66 ▼0.2746.03 ▲2.53
Dashboard /wp-admin2,233 ▲455.80 ▲0.8994.18 ▼7.3838.63 ▼3.53
Posts /wp-admin/edit.php2,116 ▲271.99 ▼0.0133.07 ▼6.5335.16 ▼1.81
Add New Post /wp-admin/post-new.php1,564 ▲3118.54 ▼4.82603.78 ▲4.8465.18 ▲13.02
Media Library /wp-admin/upload.php1,415 ▲334.17 ▼0.0395.12 ▼3.1143.93 ▲0.98
Contact Form /wp-admin/admin.php?page=YcfMenu8502.2641.7244.75
Add New /wp-admin/admin.php?page=addNewForm1,7057.35157.4741.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'YcfMenu' not found
  • Zombie tables were found after uninstall: 2 tables
    • wp_ycf_fields
    • wp_ycf_form
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • YcfFormDraft
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=addNewForm
    • > Notice in wp-content/plugins/contact-form-monster/classes/YcfPages.php+19
    Undefined index: formId
  • 21 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=addNewForm
    • > Notice in wp-content/plugins/contact-form-monster/classes/YcfContactFormData.php+132
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=addNewForm
    • > Notice in wp-content/plugins/contact-form-monster/views/expmAddNew.php+34
    Undefined variable: hiddenInputContent

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
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/contact-form-monster/views/tab_option/ysfFormFields.php
  • 14× 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 esc_html() in wp-content/plugins/contact-form-monster/views/tab_option/ycfFormOptions.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/contact-form-monster/views/expmAddNew.php:6
    • > PHP Warning
      Use of undefined constant YCF_CLASSES_FORM - assumed 'YCF_CLASSES_FORM' (this will throw an Error in a future version of PHP) in wp-content/plugins/contact-form-monster/classes/form/YcfBuilder.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/contact-form-monster/config.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/contact-form-monster/config.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-monster/files/YCFContactFormAdminPost.php:11
    • > PHP Fatal error
      require_once(): Failed opening required 'YCF_CLASSES_FORMYcfForm.php' (include_path='.:/usr/share/php') in wp-content/plugins/contact-form-monster/classes/form/YcfBuilder.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-monster/files/YcfSendEmail.php:15
    • > PHP Notice
      Undefined variable: formData in wp-content/plugins/contact-form-monster/views/tab_option/ysfFormFields.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-monster/files/YcfAjax.php:11

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=YcfMenu
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).sortable is not a function" "TypeError: jQuery(...).sortable is not a function\n at ycfBackend.addToHiddenContent (/wp-content/plugins/contact-form-monster/js/ycfBackend.js?ver=6.3.1:236:35)\n at ycfBackend.init (/wp-content/plugins/contact-form-monster/js/ycfBackend.js?ver=6.3.1:8:7)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/contact-form-monster/js/ycfBackend.js?ver=6.3.1:251:6)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=YcfMenu
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).sortable is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: form builder, tags contact form, form maker, contact us, contact forms

contact-form-monster/contact-form-monster.php Passed 13 tests

The main PHP script in "Contact Form Monster" version 1.0.0 is automatically included on every request by WordPress
34 characters long description:
Contact Form Monster Forms plugin.

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
Good job! No executable or dangerous file extensions detected8,250 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
CSS43186,956
PHP22254151,047
JavaScript46524247

PHP code Passed 2 tests

This is a very shot 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.17
Average class complexity5.40
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods72
▷ Static methods1622.22%
▷ Public methods6995.83%
▷ Protected methods00.00%
▷ Private methods34.17%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants14100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/Recycle-bin.png1.87KB1.13KB▼ 39.61%
img/conf-home.png1.55KB1.36KB▼ 11.87%