66% constant-contact-forms-by-mailmunch

Code Review | Constant Contact Forms by MailMunch

WordPress plugin Constant Contact Forms by MailMunch scored66%from 54 tests.

About plugin

  • Plugin page: constant-contact-...
  • Plugin version: 2.0.11
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Dec 9, 2014
  • Latest release: Nov 2, 2023
  • Number of updates: 60
  • Update frequency: every 54.2 days
  • Top authors: mailmunch (100%)

Code review

54 tests

User reviews

48 reviews

Install metrics

5,000+ active /98,211 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.35MB] [CPU: ▲1.78ms] 75% from 4 tests

Server-side resources used by Constant Contact Forms by MailMunch
The following require your attention
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,031.45ms on /wp-admin/admin.php?page=constantcontact-mailmunch-autoresponders)
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3840.79 ▼0.60
Dashboard /wp-admin3.69 ▲0.3849.65 ▼0.44
Posts /wp-admin/edit.php3.74 ▲0.3851.79 ▲2.91
Add New Post /wp-admin/post-new.php6.23 ▲0.34100.47 ▲11.52
Media Library /wp-admin/upload.php3.55 ▲0.3238.70 ▲5.24
Landing Pages /wp-admin/edit.php?post_type=mailmunch_page3.6639.88
Add New Page /wp-admin/post-new.php?post_type=mailmunch_page3.802,699.65
Constant Contact /wp-admin/options-general.php?page=constantcontact-mailmunch3.60433.69
Settings /wp-admin/admin.php?page=constantcontact-mailmunch-settings3.60368.29
Forms /wp-admin/admin.php?page=constantcontact-mailmunch3.60443.42
Autoresponders /wp-admin/admin.php?page=constantcontact-mailmunch-autoresponders3.641,031.45

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 95 new files
Database: no new tables, 11 new options
New WordPress options
widget_recent-comments
widget_recent-posts
cc_mm_user_token
widget_theysaidso_widget
theysaidso_admin_options
cc_mm_site_id
can_compress_scripts
db_upgraded
widget_cc_mm_widget
cc_mm_activation_date
...

Browser metrics Passed 4 tests

An overview of browser requirements for Constant Contact Forms by MailMunch
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,083 ▲33713.56 ▼0.7214.78 ▲12.8826.10 ▼18.50
Dashboard /wp-admin2,325 ▲1545.70 ▲0.0483.19 ▼15.3080.39 ▲37.44
Posts /wp-admin/edit.php2,174 ▲772.04 ▲0.0640.25 ▲6.3735.08 ▲1.71
Add New Post /wp-admin/post-new.php1,599 ▲7118.16 ▼5.17679.79 ▲24.4554.69 ▼10.33
Media Library /wp-admin/upload.php1,471 ▲774.37 ▲0.21100.54 ▲2.0167.46 ▲26.68
Landing Pages /wp-admin/edit.php?post_type=mailmunch_page1,1592.0034.0930.13
Add New Page /wp-admin/post-new.php?post_type=mailmunch_page1,5752.5548.1470.65
Constant Contact /wp-admin/options-general.php?page=constantcontact-mailmunch1,1052.0825.1820.79
Settings /wp-admin/admin.php?page=constantcontact-mailmunch-settings9822.1755.0453.17
Forms /wp-admin/admin.php?page=constantcontact-mailmunch1,1082.0537.9033.02
Autoresponders /wp-admin/admin.php?page=constantcontact-mailmunch-autoresponders1,8327.96339.5829.58

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_cc_mm_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=mailmunch_page
    • > Notice in wp-content/plugins/constant-contact-forms-by-mailmunch/includes/class-constantcontact-mailmunch-post-type.php+91
    Undefined offset: 0
    • > GET request to /wp-admin/post-new.php?post_type=mailmunch_page
    • > Notice in wp-content/plugins/constant-contact-forms-by-mailmunch/includes/class-constantcontact-mailmunch-post-type.php+91
    Trying to get property 'id' of non-object

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 items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/constant-contact-forms-by-mailmunch/public/partials/constantcontact-mailmunch-public-display.php
  • 48× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Services\\BaseService' not found in wp-content/plugins/constant-contact-forms-by-mailmunch/includes/Ctct/Services/LibraryService.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Components\\Component' not found in wp-content/plugins/constant-contact-forms-by-mailmunch/includes/Ctct/Components/EmailMarketing/MessageFooter.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Components\\Component' not found in wp-content/plugins/constant-contact-forms-by-mailmunch/includes/Ctct/Components/Account/AccountInfo.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Components\\Component' not found in wp-content/plugins/constant-contact-forms-by-mailmunch/includes/Ctct/Components/Activities/AddContacts.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Components\\Component' not found in wp-content/plugins/constant-contact-forms-by-mailmunch/includes/Ctct/Components/Contacts/CustomField.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Components\\Component' not found in wp-content/plugins/constant-contact-forms-by-mailmunch/includes/Ctct/Components/Activities/ExportContacts.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Services\\BaseService' not found in wp-content/plugins/constant-contact-forms-by-mailmunch/includes/Ctct/Services/ActivityService.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Services\\BaseService' not found in wp-content/plugins/constant-contact-forms-by-mailmunch/includes/Ctct/Services/CampaignTrackingService.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Components\\Component' not found in wp-content/plugins/constant-contact-forms-by-mailmunch/includes/Ctct/Components/Contacts/Contact.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/constant-contact-forms-by-mailmunch/admin/partials/constantcontact-mailmunch-connect.php:1

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=constantcontact-mailmunch-autoresponders
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=constantcontact-mailmunch-autoresponders 202:34 Uncaught ReferenceError: currentUser is not defined
    • > GET request to /wp-admin/admin.php?page=constantcontact-mailmunch-autoresponders
    • > Console-api (warning) in unknown
    https://static.hotjar.com/c/hotjar-1291326.js?sv=7 2:6897 "Hotjar not launching due to suspicious userAgent:" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/118.0.5993.117 Safari/537.36"

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: constant contact subscribe, constant contact signup, constantcontact, constant contact form, constant contact newsletter...

constant-contact-forms-by-mailmunch/constantcontact-mailmunch.php 77% from 13 tests

The principal PHP file in "Constant Contact Forms by MailMunch" v. 2.0.11 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 181 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("constant-contact-forms-by-mailmunch.php" instead of "constantcontact-mailmunch.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin4,749 lines of code in 81 files:
LanguageFilesBlank linesComment linesLines of code
PHP799482,9424,049
CSS1732468
JavaScript12828232

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity5.59
▷ Minimum class complexity1.00
▷ Maximum class complexity58.00
Average method complexity1.95
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces13
Interfaces2
Traits0
Classes64
▷ Abstract classes23.12%
▷ Concrete classes6296.88%
▷ Final classes00.00%
Methods327
▷ Static methods3510.70%
▷ Public methods31496.02%
▷ Protected methods20.61%
▷ Private methods113.36%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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
6 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/check.png1.64KB1.53KB▼ 6.95%
admin/img/smallcheck.png0.85KB0.79KB▼ 7.47%
admin/img/close.png0.26KB0.27KB0.00%
admin/img/constantcontact_logo.png9.06KB4.03KB▼ 55.56%
admin/img/icon.png0.83KB0.96KB0.00%