74% contact-form-7-campaignmonitor-addon

Code Review | Contact Form 7 - Campaign Monitor Addon

WordPress plugin Contact Form 7 - Campaign Monitor Addon scored74%from 54 tests.

About plugin

  • Plugin page: contact-form-7-ca...
  • Plugin version: 1.06
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.3.1
  • WordPress version: 6.3.1
  • First release: Jul 30, 2010
  • Latest release: Feb 13, 2012
  • Number of updates: 34
  • Update frequency: every 16.6 days
  • Top authors: joshuabettigole (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /23,858 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.22ms] Passed 4 tests

An overview of server-side resources used by Contact Form 7 - Campaign Monitor Addon
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.82 ▼0.61
Dashboard /wp-admin3.35 ▲0.0145.25 ▼14.97
Posts /wp-admin/edit.php3.40 ▲0.0446.53 ▼0.88
Add New Post /wp-admin/post-new.php5.93 ▲0.0581.95 ▼16.43
Media Library /wp-admin/upload.php3.27 ▲0.0436.67 ▲2.70

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Contact Form 7 - Campaign Monitor Addon
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.26 ▼1.114.82 ▲3.0044.18 ▼0.16
Dashboard /wp-admin2,203 ▲155.79 ▼0.0999.67 ▼17.2739.79 ▼5.79
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0436.54 ▼2.6334.18 ▼1.01
Add New Post /wp-admin/post-new.php1,533 ▲521.03 ▼2.32663.54 ▲1.8959.45 ▲4.36
Media Library /wp-admin/upload.php1,388 ▼04.20 ▼0.02110.56 ▲9.3445.94 ▲0.88

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 did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/contact-form-7-campaignmonitor-addon/cf7-campaignmonitor.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Campaign Monitor Addon Configuration), #2 (Form Configuration with Opt In)
Please take inspiration from this readme.txt

contact-form-7-campaignmonitor-addon/cf7-campaignmonitor.php 92% from 13 tests

The entry point to "Contact Form 7 - Campaign Monitor Addon" version 1.06 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("contact-form-7-campaignmonitor-addon.php" instead of "cf7-campaignmonitor.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Almost there! Just fix the following issues
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/contact-form-7-campaignmonitor-addon/class/GoDaddyClass2CA.crt
1,065 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP73275561,034
JavaScript15031

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity12.85
▷ Minimum class complexity1.00
▷ Maximum class complexity114.00
Average method complexity3.70
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods57
▷ Static methods00.00%
▷ Public methods57100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants21
▷ Global constants21100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png23.01KB9.04KB▼ 60.73%
screenshot-2.png17.81KB5.14KB▼ 71.15%