88% activecampaign-for-woocommerce

Code Review | ActiveCampaign for WooCommerce

WordPress plugin ActiveCampaign for WooCommerce scored 88% from 54 tests.

About plugin

  • Plugin page: activecampaign-fo...
  • Plugin version: 1.6.11
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-5.9
  • WordPress version: 5.9.2
  • First release: Aug 14, 2018
  • Latest release: Mar 16, 2022
  • Number of updates: 66
  • Update frequency: every 20.4 days
  • Top authors: acteamintegrations (100%)

Code review

54 tests

User reviews

41 reviews

Install metrics

7,000+ active / 145,729 total downloads

Benchmarks

Plugin footprint Passed 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.02MB] [CPU: ▼292.94ms] Passed 4 tests

This is a short check of server-side resources used by ActiveCampaign for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.4056.37 ▲34.84
Dashboard /wp-admin3.41 ▲0.0034.01 ▼0.91
Posts /wp-admin/edit.php3.65 ▲0.0037.80 ▼1.47
Add New Post /wp-admin/post-new.php6.89 ▼0.0991.02 ▼1,168.29
Media Library /wp-admin/upload.php3.30 ▲0.0022.93 ▼1.09

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 500 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for ActiveCampaign for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲3815.89 ▲0.095.76 ▼0.622.86 ▼0.15
Dashboard /wp-admin2,895 ▲426.14 ▼0.03118.19 ▼6.50153.62 ▼15.17
Posts /wp-admin/edit.php2,691 ▼03.24 ▲0.0163.74 ▼7.69135.20 ▼7.58
Add New Post /wp-admin/post-new.php1,661 ▼016.20 ▼0.48388.53 ▼50.84157.13 ▲0.77
Media Library /wp-admin/upload.php1,698 ▼35.50 ▼0.01137.94 ▼4.63186.65 ▲4.50

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/activecampaign-for-woocommerce/public/partials/activecampaign-for-woocommerce-public-display.php
  • 202× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'AcVendor\\Invoker\\Exception\\InvocationException' not found in wp-content/plugins/activecampaign-for-woocommerce/ac_vendor/php-di/invoker/src/Exception/NotCallableException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Activecampaign_For_Woocommerce_Executable_Interface' not found in wp-content/plugins/activecampaign-for-woocommerce/includes/commands/class-activecampaign-for-woocommerce-add-cart-id-to-order-command.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'Brick\\Money\\ExchangeRateProvider' not found in wp-content/plugins/activecampaign-for-woocommerce/vendor/brick/money/src/ExchangeRateProvider/ProviderChain.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'AcVendor\\Brick\\Money\\ExchangeRateProvider' not found in wp-content/plugins/activecampaign-for-woocommerce/ac_vendor/brick/money/src/ExchangeRateProvider/ProviderChain.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Activecampaign_For_Woocommerce_Executable_Interface' not found in wp-content/plugins/activecampaign-for-woocommerce/includes/commands/class-activecampaign-for-woocommerce-set-connection-id-cache-command.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'Brick\\Money\\Context' not found in wp-content/plugins/activecampaign-for-woocommerce/vendor/brick/money/src/Context/CustomContext.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'AcVendor\\Brick\\Money\\ExchangeRateProvider' not found in wp-content/plugins/activecampaign-for-woocommerce/ac_vendor/brick/money/src/ExchangeRateProvider/PDOProvider.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'AcVendor\\Brick\\Math\\BigNumber' not found in wp-content/plugins/activecampaign-for-woocommerce/ac_vendor/brick/math/src/BigDecimal.php:17
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/activecampaign-for-woocommerce/admin/views/activecampaign-for-woocommerce-abandoned-cart-display.php:27
    • > PHP Fatal error
      Uncaught Error: Interface 'AcVendor\\Psr\\Http\\Client\\ClientExceptionInterface' not found in wp-content/plugins/activecampaign-for-woocommerce/ac_vendor/psr/http-client/src/RequestExceptionInterface.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

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
6 plugin tags: ecommerce, marketing, abandoned cart, activecampaign, email...

activecampaign-for-woocommerce/activecampaign-for-woocommerce.php 92% from 13 tests

The main file in "ActiveCampaign for WooCommerce" v. 1.6.11 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.7" instead of "3.6.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin39,370 lines of code in 452 files:
LanguageFilesBlank linesComment linesLines of code
PHP3817,80821,48532,939
Markdown321,88604,860
JSON2000826
JavaScript66143471
YAML6231201
XML39348
PO File11115
make1409
CSS2051

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 210)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity12.52
▷ Minimum class complexity1.00
▷ Maximum class complexity303.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity210.00
Code structure
Namespaces51
Interfaces56
Traits7
Classes285
▷ Abstract classes113.86%
▷ Concrete classes27496.14%
▷ Final classes7828.47%
Methods2,360
▷ Static methods28211.95%
▷ Public methods2,00985.13%
▷ Protected methods371.57%
▷ Private methods31413.31%
Functions203
▷ Named functions5527.09%
▷ Anonymous functions14872.91%
Constants156
▷ Global constants2314.74%
▷ Class constants13385.26%
▷ Public constants11888.72%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png6.93KB2.91KB▼ 58.03%