78% mailchimp-and-constant-contact-integration

Code Review | Mailchimp and Constant Contact Integration

WordPress plugin Mailchimp and Constant Contact Integration scored78%from 54 tests.

About plugin

  • Plugin page: mailchimp-and-con...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.4
  • WordPress version: 6.3.1
  • First release: Jul 9, 2014
  • Latest release: Dec 11, 2015
  • Number of updates: 17
  • Update frequency: every 30.6 days
  • Top authors: WEB4PRO_co (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,457 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Mailchimp and Constant Contact Integration
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.32 ▲1.05
Dashboard /wp-admin3.31 ▼0.0347.38 ▼16.16
Posts /wp-admin/edit.php3.36 ▲0.0147.26 ▼5.39
Add New Post /wp-admin/post-new.php5.89 ▲0.0195.17 ▼8.85
Media Library /wp-admin/upload.php3.23 ▲0.0137.59 ▲0.06

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Mailchimp and Constant Contact Integration
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.25 ▼1.501.63 ▼0.1841.66 ▼1.04
Dashboard /wp-admin2,203 ▲155.84 ▼0.02103.37 ▲1.2541.60 ▼3.61
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0336.41 ▼4.6332.41 ▼2.90
Add New Post /wp-admin/post-new.php1,535 ▲723.17 ▲4.98658.01 ▲44.8059.52 ▲7.73
Media Library /wp-admin/upload.php1,385 ▼34.31 ▲0.1197.08 ▲2.2441.75 ▼5.90

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
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% 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 no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/mailchimp-and-constant-contact-integration/class/api/ct/examples/createAndScheduleCampaign.php
    • > /wp-content/plugins/mailchimp-and-constant-contact-integration/class/api/ct/examples/addOrUpdateContact.php
    • > /wp-content/plugins/mailchimp-and-constant-contact-integration/class/api/ct/examples/getAccessToken.php
  • 47× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Components\\Component' not found in wp-content/plugins/mailchimp-and-constant-contact-integration/class/api/ct/src/Ctct/Components/Contacts/CustomField.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Components\\Component' not found in wp-content/plugins/mailchimp-and-constant-contact-integration/class/api/ct/src/Ctct/Components/Contacts/Contact.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Components\\Component' not found in wp-content/plugins/mailchimp-and-constant-contact-integration/class/api/ct/src/Ctct/Components/Tracking/SendActivity.php:14
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/mailchimp-and-constant-contact-integration/class/api/ct/examples/addOrUpdateContact.php on line 129
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Services\\BaseService' not found in wp-content/plugins/mailchimp-and-constant-contact-integration/class/api/ct/src/Ctct/Services/ContactService.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/mailchimp-and-constant-contact-integration/class/api/ct/test/Services/EmailCampaignServiceUnitTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Services\\BaseService' not found in wp-content/plugins/mailchimp-and-constant-contact-integration/class/api/ct/src/Ctct/Services/CampaignTrackingService.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Components\\Component' not found in wp-content/plugins/mailchimp-and-constant-contact-integration/class/api/ct/src/Ctct/Components/Tracking/UnsubscribeActivity.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Components\\Component' not found in wp-content/plugins/mailchimp-and-constant-contact-integration/class/api/ct/src/Ctct/Components/Account/VerifiedEmailAddress.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Components\\Component' not found in wp-content/plugins/mailchimp-and-constant-contact-integration/class/api/ct/src/Ctct/Components/EmailMarketing/Schedule.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: constant contact, integration, mailchimp, woocommerce

mailchimp-and-constant-contact-integration/integrations.php 92% from 13 tests

The main PHP file in "Mailchimp and Constant Contact Integration" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("mailchimp-and-constant-contact-integration.php" instead of "integrations.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin31,306 lines of code in 208 files:
LanguageFilesBlank linesComment linesLines of code
HTML1038,310024,069
PHP669521,9874,778
JavaScript3128189992
JSON3000911
CSS211421482
Markdown214060
XML1008
YAML1006

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity4.03
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces11
Interfaces2
Traits0
Classes58
▷ Abstract classes23.45%
▷ Concrete classes5696.55%
▷ Final classes00.00%
Methods312
▷ Static methods5818.59%
▷ Public methods30698.08%
▷ Protected methods20.64%
▷ Private methods41.28%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants750.00%
▷ Class constants750.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
13 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
class/api/ct/docs/resources/inherit.png0.15KB0.10KB▼ 29.61%
screenshot-3.png15.28KB11.33KB▼ 25.82%
class/api/ct/docs/resources/tree-hasnext.png0.13KB0.09KB▼ 31.25%
class/api/ct/docs/resources/tree-last.png0.17KB0.11KB▼ 36.05%
class/api/ct/docs/resources/collapsed.png0.23KB0.14KB▼ 39.08%