78% campaign-monitor-synchronization

Code Review | Campaign Monitor Synchronization

WordPress plugin Campaign Monitor Synchronization scored78%from 54 tests.

About plugin

  • Plugin page: campaign-monitor-...
  • Plugin version: 1.0.15
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4
  • WordPress version: 6.3.1
  • First release: Mar 30, 2014
  • Latest release: Dec 11, 2015
  • Number of updates: 12
  • Update frequency: every 51.8 days
  • Top authors: pilotessa (75%)carloroosen (33.33%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /2,635 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼0.80ms] Passed 4 tests

Analyzing server-side resources used by Campaign Monitor Synchronization
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0943.91 ▼1.34
Dashboard /wp-admin3.39 ▲0.0950.94 ▼1.36
Posts /wp-admin/edit.php3.50 ▲0.1552.85 ▼0.33
Add New Post /wp-admin/post-new.php5.97 ▲0.08107.68 ▲8.32
Media Library /wp-admin/upload.php3.31 ▲0.0836.99 ▼0.16
CM Synchronization /wp-admin/options-general.php?page=cms_plugin3.2935.30

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 171 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
cms_settings
db_upgraded

Browser metrics Passed 4 tests

Campaign Monitor Synchronization: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.30 ▼1.081.80 ▼0.6241.22 ▼2.63
Dashboard /wp-admin2,207 ▲195.85 ▲0.9799.37 ▼5.4540.21 ▼1.00
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0140.01 ▼0.9534.44 ▼0.09
Add New Post /wp-admin/post-new.php1,536 ▲323.30 ▲0.08650.18 ▲8.9851.65 ▼6.40
Media Library /wp-admin/upload.php1,392 ▲14.19 ▲0.01104.88 ▼2.9643.84 ▼0.37
CM Synchronization /wp-admin/options-general.php?page=cms_plugin8632.0525.5630.75

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • cms_settings
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% 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
Please fix the following
  • 83× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/samples/list/get_webhooks.php
    • > /wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/samples/list/create_webhook.php
    • > /wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/samples/list/get_unconfirmed_subscribers.php
    • > /wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/samples/authentication/refresh_token.php
    • > /wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/samples/campaign/delete.php
    • > /wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/samples/get_countries.php
    • > /wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/samples/client/suppress.php
    • > /wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/samples/get_timezones.php
    • > /wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/samples/segment/add_rule.php
    • > /wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/samples/segment/create.php
  • 40× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to get property 'Events' of non-object in wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/samples/list/list_webhook_receiver.php on line 25
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/tests/csrest_administrators_test.php on line 3
    • > PHP Notice
      Trying to get property 'DuplicateEmailsInSubmission' of non-object in wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/samples/subscriber/import.php on line 70
    • > PHP Warning
      require_once(wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/tests/csrest_template_test.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/tests/csrest_segments_test.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/tests/csrest_campaigns_test.php on line 3
    • > PHP Warning
      require_once(wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/tests/csrest_administrators_test.php on line 3
    • > PHP Warning
      require_once(wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/tests/class_tests/../../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/tests/class_tests/transport_test.php on line 3
    • > PHP Notice
      Undefined property: stdClass::$ResultData in wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/samples/subscriber/import.php on line 75
    • > PHP Notice
      Trying to get property 'ListID' of non-object in wp-content/plugins/campaign-monitor-synchronization/campaignmonitor-createsend-php/samples/list/list_webhook_receiver.php on line 22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% 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 need to be fixed:
  • Screenshots: Screenshot #1 (Option page) image required
The official readme.txt might help

campaign-monitor-synchronization/campaignmonitor-synchronization.php 92% from 13 tests

Analyzing the main PHP file in "Campaign Monitor Synchronization" version 1.0.15
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("campaign-monitor-synchronization.php" instead of "campaignmonitor-synchronization.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
Everything looks great! No dangerous files found in this plugin7,474 lines of code in 166 files:
LanguageFilesBlank linesComment linesLines of code
PHP1131,4132,3026,130
JSON48001,013
Markdown41260325
YAML1206

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity5.63
▷ Minimum class complexity1.00
▷ Maximum class complexity114.00
Average method complexity1.85
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes54
▷ Abstract classes916.67%
▷ Concrete classes4583.33%
▷ Final classes00.00%
Methods295
▷ Static methods31.02%
▷ Public methods295100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants37
▷ Global constants37100.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
There are no PNG files in this plugin