78% wcp-contact-form

Code Review | WCP Contact Form

WordPress plugin WCP Contact Form scored 78% from 54 tests.

About plugin

  • Plugin page: wcp-contact-form
  • Plugin version: 3.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.6
  • WordPress version: 5.8.1
  • First release: Apr 14, 2015
  • Latest release: Sep 6, 2016
  • Number of updates: 79
  • Update frequency: every 6.5 days
  • Top authors: webcodin (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

4,000+ active / 95,865 total downloads

Benchmarks

Plugin footprint 83% 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: ▲1.55MB] [CPU: ▼149.45ms] Passed 4 tests

Analyzing server-side resources used by WCP Contact Form
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.33 ▲1.6162.54 ▲29.42
Dashboard /wp-admin4.58 ▲1.5366.44 ▲24.04
Posts /wp-admin/edit.php4.61 ▲1.5170.30 ▲28.88
Add New Post /wp-admin/post-new.php7.17 ▲1.74100.98 ▼670.41
Media Library /wp-admin/upload.php4.56 ▲1.5554.90 ▲19.70

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 238 new files
Database: no new tables, 4 new options
New WordPress options
scfp_form_settings
widget_scfp_form_widget
scfp_style_settings
wcp-contact-form-version

Browser metrics Passed 4 tests

A check of browser resources used by WCP Contact Form
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,926 ▲33016.58 ▲1.0912.00 ▲2.4546.10 ▲0.10
Dashboard /wp-admin3,060 ▲1266.56 ▲0.63139.77 ▼10.20111.24 ▼1.41
Posts /wp-admin/edit.php2,832 ▲932.45 ▼0.2470.73 ▲7.08102.78 ▲10.89
Add New Post /wp-admin/post-new.php1,695 ▼2,01721.88 ▲1.30266.10 ▼163.83131.46 ▲15.52
Media Library /wp-admin/upload.php1,898 ▲915.31 ▲0.29125.86 ▼27.42116.41 ▼5.48

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 4 options
    • scfp_style_settings
    • wcp-contact-form-version
    • scfp_form_settings
    • widget_scfp_form_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 9× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wcp-contact-form/templates/admin/form/header.php
    • > /wp-content/plugins/wcp-contact-form/agp-core/templates/admin/options/render-tabs.php
    • > /wp-content/plugins/wcp-contact-form/inc/cool-php-captcha/resources/tools/dictionary-import/importwords.php
    • > /wp-content/plugins/wcp-contact-form/templates/email/mail-template.php
    • > /wp-content/plugins/wcp-contact-form/templates/admin/form/extended-settings/common/blank.php
    • > /wp-content/plugins/wcp-contact-form/agp-core/templates/admin/options/fields/select.php
    • > /wp-content/plugins/wcp-contact-form/agp-core/templates/admin/fields/repeater/header.php
    • > /wp-content/plugins/wcp-contact-form/templates/admin/options/fields/checkboxes.php
    • > /wp-content/plugins/wcp-contact-form/templates/admin/options/fields/select.php
  • 297× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Trying to get property 'field' of non-object in wp-content/plugins/wcp-contact-form/templates/admin/options/fields/text.php on line 4
    • > PHP Notice
      Trying to get property 'key' of non-object in wp-content/plugins/wcp-contact-form/templates/admin/options/fields/select.php on line 21
    • > PHP Notice
      Trying to get property 'field' of non-object in wp-content/plugins/wcp-contact-form/agp-core/templates/admin/options/fields/text.php on line 3
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/wcp-contact-form/templates/variables/data.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wcp-contact-form/templates/scfp.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Less_Tree' not found in wp-content/plugins/wcp-contact-form/vendor/oyejorge/less.php/lib/Less/Tree/Paren.php:9
    • > PHP Notice
      Trying to get property 'field' of non-object in wp-content/plugins/wcp-contact-form/agp-core/templates/admin/options/fields/text.php on line 4
    • > PHP Notice
      Trying to get property 'field' of non-object in wp-content/plugins/wcp-contact-form/templates/admin/options/fields/select.php on line 3
    • > PHP Notice
      Trying to get property 'field' of non-object in wp-content/plugins/wcp-contact-form/agp-core/templates/admin/options/fields/hidden.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'Less_Tree' not found in wp-content/plugins/wcp-contact-form/vendor/oyejorge/less.php/lib/Less/Tree/Extend.php:9

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: There are too many tags (31 tag instead of maximum 10)
The official readme.txt is a good inspiration

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

The principal PHP file in "WCP Contact Form" v. 3.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 146 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin15,693 lines of code in 205 files:
LanguageFilesBlank linesComment linesLines of code
PHP1823,53996,59514,175
CSS626330672
JavaScript7865372
Markdown41000254
JSON400109
LESS120096
SVG10015

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity25.82
▷ Minimum class complexity1.00
▷ Maximum class complexity391.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes92
▷ Abstract classes1010.87%
▷ Concrete classes8289.13%
▷ Final classes00.00%
Methods1,009
▷ Static methods646.34%
▷ Public methods87286.42%
▷ Protected methods302.97%
▷ Private methods10710.60%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants450.00%
▷ Class constants450.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
3 PNG files occupy 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icons/icon-128x128.png17.79KB6.30KB▼ 64.58%
assets/images/icons/refresh-icon.png3.28KB0.77KB▼ 76.47%
assets/js/ico.png3.13KB0.24KB▼ 92.27%