10% ajax-campaign-monitor-forms

Code Review | Campaign Monitor Ajax Forms

WordPress plugin Campaign Monitor Ajax Forms scored 10% from 54 tests.

About plugin

  • Plugin page: ajax-campaign-mon...
  • Plugin version: 1.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.9
  • WordPress version: 5.8.1
  • First release: Jan 11, 2011
  • Latest release: Nov 10, 2017
  • Number of updates: 83
  • Update frequency: every 30.1 days
  • Top authors: leewillis77 (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active / 24,623 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/class/services_json.php+725
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▲0.06MB] [CPU: ▼143.61ms] Passed 4 tests

Analyzing server-side resources used by Campaign Monitor Ajax Forms
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1534.72 ▲13.44
Dashboard /wp-admin3.15 ▲0.1040.06 ▼4.98
Posts /wp-admin/edit.php3.20 ▲0.0841.81 ▼12.96
Add New Post /wp-admin/post-new.php5.45 ▲0.0188.26 ▼562.70
Media Library /wp-admin/upload.php3.03 ▲0.0336.91 ▲6.20

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 203 new files
Database: no new tables, 1 new option
New WordPress options
widget_widget_cm_ajax

Browser metrics Passed 4 tests

An overview of browser requirements for Campaign Monitor Ajax Forms
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,808 ▲17116.11 ▲0.5411.61 ▲2.7851.16 ▲3.77
Dashboard /wp-admin2,970 ▲375.90 ▼0.04137.59 ▼15.72110.99 ▼5.61
Posts /wp-admin/edit.php2,739 ▼02.71 ▲0.0168.46 ▲0.6286.20 ▼2.83
Add New Post /wp-admin/post-new.php1,502 ▼8918.50 ▼0.26345.25 ▼35.04105.08 ▼3.78
Media Library /wp-admin/upload.php1,807 ▼05.03 ▼0.01181.39 ▲38.97120.42 ▲6.36

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_widget_cm_ajax

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 89× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/samples/campaign/get_email_client_usage.php
    • > /wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/samples/list/delete_webhook.php
    • > /wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/samples/list/get_unconfirmed_subscribers.php
    • > /wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/samples/campaign/create.php
    • > /wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/samples/list/create_webhook.php
    • > /wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/samples/campaign/get_bounces.php
    • > /wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/samples/client/get_segments.php
    • > /wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/samples/list/get_webhooks.php
    • > /wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/samples/segment/clear_rules.php
    • > /wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/samples/template/get.php
  • 50× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to get property 'error' of non-object in wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/samples/authentication/exchange_token.php on line 22
    • > PHP Warning
      require_once(wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/tests/csrest_segments_test.php on line 3
    • > PHP Warning
      require_once(wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/tests/csrest_subscribers_test.php on line 3
    • > PHP Notice
      Trying to get property 'DuplicateEmailsInSubmission' of non-object in wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/samples/subscriber/import.php on line 70
    • > PHP Notice
      Undefined property: stdClass::$ResultData in wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/samples/subscriber/import.php on line 70
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/tests/csrest_template_test.php on line 3
    • > PHP Fatal error
      Uncaught Error: Cannot use object of type stdClass as array in wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/samples/transactional/timeline.php:36
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/tests/csrest_test.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/tests/csrest_lists_test.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/tests/class_tests/../../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/ajax-campaign-monitor-forms/createsend-php/tests/class_tests/response_tests.php on line 3

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 87% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Configuration), #2 (Sign-up form), #3 (Ajax submission), #4 (Feedback), #5 (Inserting a shortcode), #6 (Choosing a shortcode / creating a new shortcode)
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === ajax-campaign-monitor-forms === )
You can take inspiration from this readme.txt

ajax-campaign-monitor-forms/cm-ajax.php 85% from 13 tests

The main PHP file in "Campaign Monitor Ajax Forms" ver. 1.5.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ajax-campaign-monitor-forms.php" instead of "cm-ajax.php")

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
There were no executable files found in this plugin8,251 lines of code in 185 files:
LanguageFilesBlank linesComment linesLines of code
PHP1281,5662,7656,688
JSON48101,017
Markdown41420341
PO File35155167
JavaScript10028
YAML12010

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity5.14
▷ Minimum class complexity1.00
▷ Maximum class complexity114.00
Average method complexity1.78
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes63
▷ Abstract classes1015.87%
▷ Concrete classes5384.13%
▷ Final classes00.00%
Methods334
▷ Static methods20.60%
▷ Public methods334100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants35
▷ Global constants35100.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
7 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png5.55KB2.81KB▼ 49.38%
screenshot-1.png20.24KB7.94KB▼ 60.76%
screenshot-4.png6.88KB3.42KB▼ 50.33%
screenshot-2.png5.47KB2.84KB▼ 48.00%
js/image.png1.43KB1.51KB0.00%