72% forms-for-campaign-monitor

Code Review | Campaign Monitor for WordPress

WordPress plugin Campaign Monitor for WordPress scored 72% from 53 tests.

About plugin

  • Plugin page: forms-for-campaig...
  • Plugin version: 2.8.8
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.8
  • WordPress version: 5.8.1
  • First release: Feb 18, 2016
  • Latest release: Jul 7, 2021
  • Number of updates: 135
  • Update frequency: every 14.6 days
  • Top authors: vibhorchhabra (100%)

Code review

53 tests

User reviews

35 reviews

Install metrics

4,000+ active / 82,956 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.54MB] [CPU: ▼270.90ms] Passed 4 tests

Analyzing server-side resources used by Campaign Monitor for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.9240.83 ▲19.07
Dashboard /wp-admin3.60 ▲0.5456.43 ▲9.35
Posts /wp-admin/edit.php3.65 ▲0.5449.58 ▲7.36
Add New Post /wp-admin/post-new.php5.96 ▲0.5394.05 ▼1,094.82
Media Library /wp-admin/upload.php3.54 ▲0.5333.51 ▼5.48
A/B Testing Editing /wp-admin/admin.php?page=campaign_monitor_ab_testing_editing3.7035.10
Form Builder /wp-admin/admin.php?page=campaign_monitor_create_builder3.6935.83
Forms /wp-admin/admin.php?page=campaign-monitor-for-wordpress3.7328.61
Create Form /wp-admin/admin.php?page=campaign_monitor_create_form3.4728.99
Settings /wp-admin/admin.php?page=campaign_monitor_settings_page3.5234.22
Update /wp-admin/admin.php?page=campaign_monitor_update_page3.4525.34
A/B Testing /wp-admin/admin.php?page=campaign_monitor_ab_testing3.5933.71

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 115 new files
Database: no new tables, 1 new option
New WordPress options
forms_for_campaign_monitor_post_errors

Browser metrics Passed 4 tests

This is an overview of browser requirements for Campaign Monitor for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,819 ▲21316.29 ▲0.3519.17 ▲9.4150.06 ▲1.91
Dashboard /wp-admin2,960 ▲1076.16 ▲0.33132.98 ▲0.76125.74 ▲25.30
Posts /wp-admin/edit.php2,738 ▲352.59 ▼0.1163.45 ▼10.4091.15 ▲5.92
Add New Post /wp-admin/post-new.php4,005 ▲2,35220.79 ▲2.26420.70 ▲42.75111.34 ▲2.52
Media Library /wp-admin/upload.php1,753 ▼194.99 ▼0.02124.37 ▼17.55136.32 ▲15.19
A/B Testing Editing /wp-admin/admin.php?page=campaign_monitor_ab_testing_editing1,1122.8265.1148.02
Form Builder /wp-admin/admin.php?page=campaign_monitor_create_builder3,8593.96121.9386.57
Forms /wp-admin/admin.php?page=campaign-monitor-for-wordpress1,0952.6154.9056.14
Create Form /wp-admin/admin.php?page=campaign_monitor_create_form1,2742.1557.7664.40
Settings /wp-admin/admin.php?page=campaign_monitor_settings_page1,3192.0854.9670.49
Update /wp-admin/admin.php?page=campaign_monitor_update_page1,1582.6259.9760.24
A/B Testing /wp-admin/admin.php?page=campaign_monitor_ab_testing1,2302.1053.0869.13

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 1 option in the database
    • 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
Smoke test failed, please fix the following
    • > 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/forms-for-campaign-monitor/forms/views/admin/create.php
    • > /wp-content/plugins/forms-for-campaign-monitor/campaign-monitor.php
  • 24× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > 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: Interface 'SunriseIntegration\\CampaignMonitor\\IRequest' not found in wp-content/plugins/forms-for-campaign-monitor/forms/SunriseIntegration/CampaignMonitor/Http/Request/Post.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'forms\\core\\ReCaptcha\\RequestMethod' not found in wp-content/plugins/forms-for-campaign-monitor/forms/core/ReCaptcha/RequestMethod/CurlPost.php:39
    • > 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: Class 'forms\\core\\Collection' not found in wp-content/plugins/forms-for-campaign-monitor/forms/core/Font.php:5
    • > 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 'forms\\core\\Application' not found in wp-content/plugins/forms-for-campaign-monitor/forms/views/admin/create.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'SunriseIntegration\\CampaignMonitor\\AbstractObject' not found in wp-content/plugins/forms-for-campaign-monitor/forms/SunriseIntegration/CampaignMonitor/Http/Headers.php:10
    • > 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-edit.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'SunriseIntegration\\CampaignMonitor\\IRequest' not found in wp-content/plugins/forms-for-campaign-monitor/forms/SunriseIntegration/CampaignMonitor/Http/Request/Curl.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid url: ""
You can take inspiration from this readme.txt

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

Analyzing the main PHP file in "Campaign Monitor for WordPress" version 2.8.8
It is important to 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 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin11,952 lines of code in 75 files:
LanguageFilesBlank linesComment linesLines of code
PHP592,3122,3418,608
PO File37911,2581,801
JavaScript5287841,005
CSS36910493
SVG31029
JSON10015
Markdown1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
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 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
25 PNG files occupy 0.27MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
forms/views/admin/images/Crossed-Out-Circle.png1.16KB0.90KB▼ 22.50%
forms/views/admin/images/cm-logo-horizontal.png1.86KB2.20KB0.00%
forms/views/admin/images/option-bar.png1.10KB0.51KB▼ 53.39%
forms/views/admin/images/Illustrations-10.png85.28KB47.95KB▼ 43.78%
forms/views/admin/images/option-slide-out.png1.72KB0.76KB▼ 55.88%