78% constant-contact-forms

Code Review | Constant Contact Forms

WordPress plugin Constant Contact Forms scored78%from 54 tests.

About plugin

  • Plugin page: constant-contact-...
  • Plugin version: 2.4.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.0-6.4
  • WordPress version: 6.3.1
  • First release: Sep 19, 2016
  • Latest release: Nov 6, 2023
  • Number of updates: 100
  • Update frequency: every 26.4 days
  • Top authors: constantcontact (98%)ggwicz (3%)

Code review

54 tests

User reviews

82 reviews

Install metrics

30,000+ active /2,093,679 total downloads

Benchmarks

Plugin footprint 83% from 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.75MB] [CPU: ▲21.88ms] Passed 4 tests

This is a short check of server-side resources used by Constant Contact Forms
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.86 ▲2.4059.55 ▲18.53
Dashboard /wp-admin6.18 ▲2.8867.69 ▲15.74
Posts /wp-admin/edit.php6.21 ▲2.8580.08 ▲29.32
Add New Post /wp-admin/post-new.php9.05 ▲3.16123.16 ▲23.91
Media Library /wp-admin/upload.php6.10 ▲2.8766.81 ▲29.42
Add Form /wp-admin/post-new.php?post_type=ctct_forms7.0075.47
Settings /wp-admin/edit.php?post_type=ctct_forms&page=ctct_options_settings_general6.3858.49
Connect Now /wp-admin/edit.php?post_type=ctct_forms&page=ctct_options_connect6.0157.83
Forms /wp-admin/edit.php?post_type=ctct_forms6.1657.93
About /wp-admin/edit.php?post_type=ctct_forms&page=ctct_options_about6.0257.45

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 767 new files
Database: no new tables, 13 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_ctct_form
widget_recent-comments
widget_recent-posts
can_compress_scripts
CtctConstantContactState
ctct_key
ctct_plugin_activated_date
CtctConstantContactcode_verifier
...

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 /2,930 ▲16814.27 ▼0.0113.04 ▲11.3140.17 ▼3.79
Dashboard /wp-admin2,302 ▲1255.09 ▼0.5799.35 ▲0.4688.18 ▲51.48
Posts /wp-admin/edit.php2,238 ▲1382.48 ▲0.4744.77 ▲9.5938.57 ▲7.55
Add New Post /wp-admin/post-new.php1,762 ▲23621.54 ▼1.52790.93 ▲115.6639.63 ▼15.73
Media Library /wp-admin/upload.php1,519 ▲1194.71 ▲0.52101.22 ▼11.9089.34 ▲41.85
Add Form /wp-admin/post-new.php?post_type=ctct_forms3,5927.29202.42147.70
Settings /wp-admin/edit.php?post_type=ctct_forms&page=ctct_options_settings_general1,0922.4035.7134.21
Connect Now /wp-admin/edit.php?post_type=ctct_forms&page=ctct_options_connect9682.3532.3342.84
Forms /wp-admin/edit.php?post_type=ctct_forms1,2292.6140.3534.30
About /wp-admin/edit.php?post_type=ctct_forms&page=ctct_options_about1,4409.17322.0670.07

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

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
  • 216× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/constant-contact-forms/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Components\\Component' not found in wp-content/plugins/constant-contact-forms/includes/Ctct/Components/Tracking/TrackingSummary.php:13
    • > PHP Warning
      require_once(wp-content/plugins/constant-contact-forms/vendor/google/recaptcha/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/constant-contact-forms/vendor/google/recaptcha/examples/recaptcha-v3-verify.php on line 38
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/constant-contact-forms/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/constant-contact-forms/vendor/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\Handler' not found in wp-content/plugins/constant-contact-forms/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\MailHandler' not found in wp-content/plugins/constant-contact-forms/vendor/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/constant-contact-forms/vendor/google/recaptcha/tests/ReCaptcha/ReCaptchaTest.php:39
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/constant-contact-forms/vendor/monolog/monolog/src/Monolog/Processor/HostnameProcessor.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/constant-contact-forms/vendor/cmb2/cmb2/includes/CMB2_Field.php:17

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 Passed 29 tests

readme.txt Passed 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
10 plugin tags: newsletter, contacts, constant contact form, constant contact, constant contact official...

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

"Constant Contact Forms" version 2.4.1'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 plugin84,047 lines of code in 578 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP3267,87522,09730,181
JSON9007,246
CSS183691,1935,689
Markdown241,06603,051
Sass356721072,943
JavaScript356241,1822,492
XML30052
YAML210031
make19424
SVG30211
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.38
Average class complexity13.66
▷ Minimum class complexity1.00
▷ Maximum class complexity243.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces30
Interfaces12
Traits5
Classes296
▷ Abstract classes196.42%
▷ Concrete classes27793.58%
▷ Final classes103.61%
Methods2,015
▷ Static methods24712.26%
▷ Public methods1,61280.00%
▷ Protected methods27613.70%
▷ Private methods1276.30%
Functions127
▷ Named functions9776.38%
▷ Anonymous functions3023.62%
Constants116
▷ Global constants32.59%
▷ Class constants11397.41%
▷ Public constants8676.11%

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.25MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/cmb2/cmb2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
assets/images/cc-login.png12.26KB5.94KB▼ 51.56%
vendor/cmb2/cmb2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
vendor/cmb2/cmb2/images/ico-delete.png0.70KB0.72KB0.00%
assets/images/form-display.png134.43KB49.67KB▼ 63.05%