83% campaign-monitor-for-formcraft

Code Review | Campaign Monitor Add-On for FormCraft

WordPress plugin Campaign Monitor Add-On for FormCraft scored83%from 54 tests.

About plugin

  • Plugin page: campaign-monitor-...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.2.3
  • WordPress version: 6.3.1
  • First release: Jun 3, 2015
  • Latest release: Oct 11, 2019
  • Number of updates: 12
  • Update frequency: every 132.7 days
  • Top authors: nish@ncrafts.net (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /3,553 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼10.41ms] Passed 4 tests

This is a short check of server-side resources used by Campaign Monitor Add-On for FormCraft
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.39 ▼3.32
Dashboard /wp-admin3.31 ▼0.0344.42 ▼19.36
Posts /wp-admin/edit.php3.36 ▲0.0150.98 ▼1.59
Add New Post /wp-admin/post-new.php5.89 ▲0.0181.57 ▼17.37
Media Library /wp-admin/upload.php3.24 ▲0.0137.31 ▲3.38

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 38 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Campaign Monitor Add-On for FormCraft: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.25 ▼1.051.79 ▲0.1844.41 ▲0.56
Dashboard /wp-admin2,206 ▲186.03 ▲0.13107.64 ▲0.1042.15 ▼0.57
Posts /wp-admin/edit.php2,089 ▼02.03 ▼0.0140.00 ▼2.5234.30 ▼1.63
Add New Post /wp-admin/post-new.php1,533 ▲323.05 ▲4.77679.08 ▲77.0753.64 ▼5.60
Media Library /wp-admin/upload.php1,382 ▼64.20 ▼0.01102.93 ▼5.8343.92 ▼0.58

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/campaign-monitor-for-formcraft/formcraft-cm-main.php:19
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/campaign-monitor-for-formcraft/formcraft-cm-main.php on line 14
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/campaign-monitor-for-formcraft/formcraft-cm-main.php on line 16
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/campaign-monitor-for-formcraft/formcraft-cm-main.php on line 17
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/campaign-monitor-for-formcraft/formcraft-cm-main.php on line 15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

campaign-monitor-for-formcraft/formcraft-cm-main.php 85% from 13 tests

The principal PHP file in "Campaign Monitor Add-On for FormCraft" v. 1.2 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("campaign-monitor-for-formcraft.php" instead of "formcraft-cm-main.php")

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
No dangerous file extensions were detected2,590 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP225322,9242,072
Markdown41520362
JavaScript10081
JSON10040
CSS12018
YAML12017

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity8.69
▷ Minimum class complexity1.00
▷ Maximum class complexity114.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes29
▷ Abstract classes00.00%
▷ Concrete classes29100.00%
▷ Final classes00.00%
Methods202
▷ Static methods20.99%
▷ Public methods19797.52%
▷ Protected methods00.00%
▷ Private methods52.48%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants35
▷ Global constants35100.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 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/logo.png2.02KB1.10KB▼ 45.34%
bookmark.png2.32KB1.28KB▼ 44.83%