88% constant-contact-forms

Code Review | Constant Contact Forms

WordPress plugin Constant Contact Forms scored 88% from 54 tests.

About plugin

  • Plugin page: constant-contact-...
  • Plugin version: 1.12.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.0-5.7.0
  • WordPress version: 5.8.1
  • First release: Sep 19, 2016
  • Latest release: Sep 23, 2021
  • Number of updates: 84
  • Update frequency: every 22.2 days
  • Top authors: constantcontact (97.62%)ggwicz (3.57%)

Code review

54 tests

User reviews

68 reviews

Install metrics

40,000+ active / 1,811,301 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲2.39MB] [CPU: ▼114.80ms] 75% from 4 tests

This is a short check of server-side resources used by Constant Contact Forms
Please fix the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,003.05ms on /wp-admin/edit.php?post_type=ctct_forms&page=ctct_options_settings_general)
PageMemory (MB)CPU Time (ms)
Home /4.84 ▲2.0163.66 ▲30.46
Dashboard /wp-admin5.53 ▲2.4878.44 ▲30.34
Posts /wp-admin/edit.php5.75 ▲2.6477.69 ▲28.47
Add New Post /wp-admin/post-new.php8.08 ▲2.65117.84 ▼543.36
Media Library /wp-admin/upload.php5.42 ▲2.4159.35 ▲25.34
About /wp-admin/edit.php?post_type=ctct_forms&page=ctct_options_about5.712,995.74
Add Form /wp-admin/post-new.php?post_type=ctct_forms6.391,017.80
Forms /wp-admin/edit.php?post_type=ctct_forms5.781,018.67
Connect Now /wp-admin/edit.php?post_type=ctct_forms&page=ctct_options_connect5.711,005.64
Settings /wp-admin/edit.php?post_type=ctct_forms&page=ctct_options_settings_general6.011,003.05

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 1,086 new files
Database: no new tables, 5 new options
New WordPress options
ctct_key
widget_ctct_form
ctct_connect_verification
ctct_plugin_version
ctct_plugin_activated_date

Browser metrics Passed 4 tests

An overview of browser requirements for Constant Contact Forms
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,020 ▲42417.72 ▲2.1727.86 ▲17.0150.75 ▲0.20
Dashboard /wp-admin3,172 ▲2387.28 ▲1.28150.22 ▼0.06135.58 ▲29.33
Posts /wp-admin/edit.php2,905 ▲1663.06 ▲0.3476.22 ▼4.66103.38 ▲14.59
Add New Post /wp-admin/post-new.php1,781 ▲9821.55 ▲2.78419.80 ▲35.22117.00 ▲12.14
Media Library /wp-admin/upload.php1,968 ▲2175.56 ▲0.55144.01 ▼18.17134.54 ▲20.89
About /wp-admin/edit.php?post_type=ctct_forms&page=ctct_options_about2,28510.43288.61159.85
Add Form /wp-admin/post-new.php?post_type=ctct_forms5,1098.13249.04214.10
Forms /wp-admin/edit.php?post_type=ctct_forms1,8042.6869.2188.04
Connect Now /wp-admin/edit.php?post_type=ctct_forms&page=ctct_options_connect1,4252.8259.57127.53
Settings /wp-admin/edit.php?post_type=ctct_forms&page=ctct_options_settings_general1,6042.8670.1992.46

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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 items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/constant-contact-forms/vendor/google/recaptcha/examples/index.php
  • 432× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/constant-contact-forms/vendor/monolog/monolog/tests/Monolog/Formatter/LogglyFormatterTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/constant-contact-forms/vendor/monolog/monolog/tests/Monolog/Handler/DoctrineCouchDBHandlerTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\ParseException' not found in wp-content/plugins/constant-contact-forms/vendor/guzzlehttp/guzzle/src/Exception/XmlParseException.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'React\\Promise\\ExtendedPromiseInterface' not found in wp-content/plugins/constant-contact-forms/vendor/react/promise/src/LazyPromise.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/constant-contact-forms/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/constant-contact-forms/vendor/monolog/monolog/tests/Monolog/Processor/TagProcessorTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Components\\Component' not found in wp-content/plugins/constant-contact-forms/vendor/constantcontact/constantcontact/src/Ctct/Components/EmailMarketing/TestSend.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Select' not found in wp-content/plugins/constant-contact-forms/vendor/cmb2/cmb2/includes/types/CMB2_Type_Select_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/constant-contact-forms/vendor/cmb2/cmb2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/constant-contact-forms/vendor/monolog/monolog/tests/Monolog/Handler/PushoverHandlerTest.php:23

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 on the user side

Optimizations

Plugin configuration 97% 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
These attributes need your attention:
  • Tags: You are using too many tags: 19 tag instead of maximum 10
The official readme.txt might help

constant-contact-forms/constant-contact-forms.php Passed 13 tests

"Constant Contact Forms" version 1.12.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
71 characters long description:
Be a better marketer. All it takes is Constant Contact email marketing.

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
Success! There were no dangerous files found in this plugin103,315 lines of code in 886 files:
LanguageFilesBlank linesComment linesLines of code
PHP58912,18827,00953,239
PO File12014,31518,50232,323
CSS185251,1935,980
Markdown291,26503,796
Sass356711072,937
JavaScript366741,3142,707
JSON36001,540
reStructuredText9263333517
make4509196
XML30040
Python14019
SVG30211
YAML1206
Bourne Shell1203
HTML1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity9.24
▷ Minimum class complexity1.00
▷ Maximum class complexity225.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces53
Interfaces33
Traits17
Classes538
▷ Abstract classes224.09%
▷ Concrete classes51695.91%
▷ Final classes101.94%
Methods3,940
▷ Static methods3498.86%
▷ Public methods3,41986.78%
▷ Protected methods3097.84%
▷ Private methods2125.38%
Functions467
▷ Named functions11123.77%
▷ Anonymous functions35676.23%
Constants135
▷ Global constants1410.37%
▷ Class constants12189.63%
▷ Public constants121100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
31 PNG files occupy 0.67MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/cc-login.png12.26KB5.94KB▼ 51.56%
assets/images/ctct-admin-notice-logo.png5.72KB2.64KB▼ 53.85%
vendor/cmb2/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
vendor/cmb2/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
vendor/cmb2/cmb2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%