72% forms-for-campaign-monitor

Code Review | Campaign Monitor for WordPress

WordPress plugin Campaign Monitor for WordPress scored72%from 54 tests.

About plugin

  • Plugin page: forms-for-campaig...
  • Plugin version: 2.8.12
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-6.3
  • WordPress version: 6.3.1
  • First release: Feb 18, 2016
  • Latest release: Jul 28, 2023
  • Number of updates: 140
  • Update frequency: every 19.4 days
  • Top authors: vibhorchhabra (100%)

Code review

54 tests

User reviews

37 reviews

Install metrics

4,000+ active /101,879 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
Installer ran successfully

Server metrics [RAM: ▲0.51MB] [CPU: ▼4.30ms] Passed 4 tests

An overview of server-side resources used by Campaign Monitor for WordPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.29 ▲0.8251.71 ▲14.39
Dashboard /wp-admin3.85 ▲0.5048.05 ▼13.40
Posts /wp-admin/edit.php3.90 ▲0.5448.32 ▲1.64
Add New Post /wp-admin/post-new.php6.37 ▲0.4888.25 ▼11.01
Media Library /wp-admin/upload.php3.77 ▲0.5442.26 ▲5.56
A/B Testing Editing /wp-admin/admin.php?page=campaign_monitor_ab_testing_editing3.9340.30
Forms /wp-admin/admin.php?page=campaign-monitor-for-wordpress3.9638.92
Form Builder /wp-admin/admin.php?page=campaign_monitor_create_builder3.9238.49
Settings /wp-admin/admin.php?page=campaign_monitor_settings_page3.7537.77
A/B Testing /wp-admin/admin.php?page=campaign_monitor_ab_testing3.7638.39
Update /wp-admin/admin.php?page=campaign_monitor_update_page3.6932.65
Create Form /wp-admin/admin.php?page=campaign_monitor_create_form3.7035.00

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 115 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
forms_for_campaign_monitor_post_errors
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Campaign Monitor for WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,926 ▲18013.45 ▼1.0812.26 ▲10.7140.78 ▲1.46
Dashboard /wp-admin2,228 ▲565.63 ▼0.0481.97 ▼26.1369.08 ▲27.08
Posts /wp-admin/edit.php2,127 ▲272.15 ▲0.1636.03 ▼3.7136.34 ▼2.01
Add New Post /wp-admin/post-new.php1,708 ▲17322.23 ▲4.27716.58 ▲56.6752.40 ▼32.05
Media Library /wp-admin/upload.php1,427 ▲274.21 ▲0.07111.73 ▼2.7450.22 ▲1.07
A/B Testing Editing /wp-admin/admin.php?page=campaign_monitor_ab_testing_editing8892.0246.7223.94
Forms /wp-admin/admin.php?page=campaign-monitor-for-wordpress8852.0136.0823.13
Form Builder /wp-admin/admin.php?page=campaign_monitor_create_builder2,7613.0775.7840.46
Settings /wp-admin/admin.php?page=campaign_monitor_settings_page1,0102.1824.4127.80
A/B Testing /wp-admin/admin.php?page=campaign_monitor_ab_testing9592.0025.6626.01
Update /wp-admin/admin.php?page=campaign_monitor_update_page9062.0030.3527.07
Create Form /wp-admin/admin.php?page=campaign_monitor_create_form9891.9924.3740.68

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • forms_for_campaign_monitor_post_errors

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=campaign_monitor_create_builder
    • > Warning in wp-content/plugins/forms-for-campaign-monitor/forms/core/Form.php+232
    Invalid argument supplied for foreach()

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 take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/forms-for-campaign-monitor/forms/views/admin/create.php
    • > /wp-content/plugins/forms-for-campaign-monitor/campaign-monitor.php
  • 24× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'forms\\core\\Settings' not found in wp-content/plugins/forms-for-campaign-monitor/forms/views/admin/settings.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'forms\\core\\Settings' not found in wp-content/plugins/forms-for-campaign-monitor/forms/views/admin/connect.php:9
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/forms-for-campaign-monitor/forms/views/templates/webfont.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'forms\\core\\Application' not found in wp-content/plugins/forms-for-campaign-monitor/forms/views/admin/create.php:13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/forms-for-campaign-monitor/forms/views/admin/ab-testing.php:13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/forms-for-campaign-monitor/forms/views/public/recaptcha.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'forms\\core\\ReCaptcha\\RequestMethod' not found in wp-content/plugins/forms-for-campaign-monitor/forms/core/ReCaptcha/RequestMethod/Post.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'SunriseIntegration\\CampaignMonitor\\AbstractObject' not found in wp-content/plugins/forms-for-campaign-monitor/forms/SunriseIntegration/CampaignMonitor/Authorization.php:7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/forms-for-campaign-monitor/forms/views/admin/builder.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'forms\\core\\Config' not found in wp-content/plugins/forms-for-campaign-monitor/forms/core/Options.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Donate link: Please fix this invalid URI: "N/A"
You can look at the official readme.txt

forms-for-campaign-monitor/campaign-monitor.php 92% from 13 tests

The main PHP script in "Campaign Monitor for WordPress" version 2.8.12 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("forms-for-campaign-monitor.php" instead of "campaign-monitor.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected11,949 lines of code in 75 files:
LanguageFilesBlank linesComment linesLines of code
PHP592,3142,3508,605
PO File37911,2581,801
JavaScript5287841,005
CSS36910493
SVG31029
JSON10015
Markdown1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity11.43
▷ Minimum class complexity1.00
▷ Maximum class complexity174.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity64.00
Code structure
Namespaces7
Interfaces2
Traits0
Classes45
▷ Abstract classes1022.22%
▷ Concrete classes3577.78%
▷ Final classes00.00%
Methods443
▷ Static methods10323.25%
▷ Public methods42495.71%
▷ Protected methods102.26%
▷ Private methods92.03%
Functions10
▷ Named functions660.00%
▷ Anonymous functions440.00%
Constants42
▷ Global constants00.00%
▷ Class constants42100.00%
▷ Public constants42100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
25 PNG files occupy 0.27MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
forms/views/admin/images/option-bar.png1.10KB0.51KB▼ 53.39%
forms/views/public/images/PowerdByCampMon@2x.png7.85KB2.99KB▼ 61.88%
forms/views/admin/images/cm-logo-horizontal.png1.86KB2.20KB0.00%
forms/views/admin/images/option-lightbox.png1.74KB0.79KB▼ 54.87%
forms/views/admin/images/cm-logo.png2.33KB2.63KB0.00%