10% contact-form-7-campaign-monitor-extension

Code Review | Contact Form 7 Campaign Monitor Extension

WordPress plugin Contact Form 7 Campaign Monitor Extension scored10%from 54 tests.

About plugin

  • Plugin page: contact-form-7-ca...
  • Plugin version: 0.4.67
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.4.9
  • WordPress version: 6.3.1
  • First release: Dec 5, 2014
  • Latest release: Nov 24, 2023
  • Number of updates: 178
  • Update frequency: every 18.5 days
  • Top authors: rnzo (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

2,000+ active /227,850 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/contact-form-7-campaign-monitor-extension/lib/tools.php+106
    max(): Array must contain at least one element

Server metrics [RAM: ▼1.09MB] [CPU: ▼39.25ms] Passed 4 tests

This is a short check of server-side resources used by Contact Form 7 Campaign Monitor Extension
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.88 ▼0.5815.86 ▼28.72
Dashboard /wp-admin2.92 ▼0.3819.22 ▼32.65
Posts /wp-admin/edit.php2.92 ▼0.4319.56 ▼27.07
Add New Post /wp-admin/post-new.php2.92 ▼2.9720.87 ▼68.56
Media Library /wp-admin/upload.php2.92 ▼0.3118.09 ▼17.41

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Contact Form 7 Campaign Monitor Extension
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲11814.30 ▼0.092.06 ▲0.2639.13 ▼4.95
Dashboard /wp-admin2,263 ▲835.67 ▲0.0591.10 ▲6.4549.99 ▲5.40
Posts /wp-admin/edit.php2,168 ▲712.14 ▲0.2040.60 ▲2.3141.33 ▲8.52
Add New Post /wp-admin/post-new.php1,570 ▲4423.22 ▼0.01664.51 ▲34.4258.33 ▲6.45
Media Library /wp-admin/upload.php1,468 ▲714.22 ▼0.0598.64 ▼3.6748.32 ▲4.58

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/contact-form-7-campaign-monitor-extension/lib/tools.php+106
    max(): Array must contain at least one element
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 16× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/contact-form-7-campaign-monitor-extension/lib/tools.php:79
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/contact-form-7-campaign-monitor-extension/lib/xin.php:19
    • > PHP Warning
      Use of undefined constant WPCF7_VERSION - assumed 'WPCF7_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/contact-form-7-campaign-monitor-extension/lib/view.php on line 131
    • > PHP Fatal error
      require_once(): Failed opening required 'SPARTAN_CME_PLUGIN_DIR/lib/activate.php' (include_path='.:/usr/share/php') in wp-content/plugins/contact-form-7-campaign-monitor-extension/lib/settings.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/contact-form-7-campaign-monitor-extension/campaign-monitor-lite.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-7-campaign-monitor-extension/lib/activate.php:39
    • > PHP Warning
      Use of undefined constant SPARTAN_CME_VERSION - assumed 'SPARTAN_CME_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/contact-form-7-campaign-monitor-extension/lib/view.php on line 131
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-7-campaign-monitor-extension/lib/functions.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/contact-form-7-campaign-monitor-extension/lib/view.php:131
    • > PHP Notice
      Undefined variable: cm_invalid in wp-content/plugins/contact-form-7-campaign-monitor-extension/lib/view.php on line 131

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, but this is not an exhaustive test

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (campaignmonitor-screenshot-1.png), #2 (campaignmonitor-screenshot-2.png)
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt is a good inspiration

contact-form-7-campaign-monitor-extension/campaign-monitor-lite.php 69% from 13 tests

"Contact Form 7 Campaign Monitor Extension" version 0.4.67's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("contact-form-7-campaign-monitor-extension.php" instead of "campaign-monitor-lite.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0" instead of "5.6")
  • Description: Please keep the plugin description shorter than 140 characters (currently 148 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin1,437 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP125601981,027
CSS28441274
JavaScript110711135
SVG1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions48
▷ Named functions4593.75%
▷ Anonymous functions36.25%
Constants11
▷ Global constants11100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/cm-logo.png1.35KB1.21KB▼ 10.97%
assets/images/postal-marks.png0.33KB0.35KB0.00%