66% pramadillo-activecampaign-email-preference-center

Code Review | ActiveCampaign Email Preference Center

WordPress plugin ActiveCampaign Email Preference Center scored66%from 54 tests.

About plugin

  • Plugin page: pramadillo-active...
  • Plugin version: 2.0.12
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.2
  • WordPress version: 6.3.1
  • First release: Sep 17, 2017
  • Latest release: Jul 5, 2023
  • Number of updates: 31
  • Update frequency: every 68.3 days
  • Top authors: mattpramschufer (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /2,765 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲5.42MB] [CPU: ▲16.09ms] 75% from 4 tests

Analyzing server-side resources used by ActiveCampaign Email Preference Center
Please have a look at the following items
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.42MB on /wp-admin/options-general.php?page=activecampaign-preference-center)
PageMemory (MB)CPU Time (ms)
Home /9.27 ▲5.8064.81 ▲22.03
Dashboard /wp-admin9.29 ▲5.9473.52 ▲2.33
Posts /wp-admin/edit.php9.29 ▲5.9384.12 ▲38.47
Add New Post /wp-admin/post-new.php9.92 ▲4.03106.70 ▲5.14
Media Library /wp-admin/upload.php9.29 ▲6.0670.35 ▲34.87
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2963.01
ActiveCampaign Preference Center /wp-admin/options-general.php?page=activecampaign-preference-center9.2965.96

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 219 new files
Database: no new tables, 9 new options
New WordPress options
fs_accounts
fs_active_plugins
db_upgraded
fs_debug_mode
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by ActiveCampaign Email Preference Center
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,921 ▲16013.39 ▼0.968.55 ▲6.8029.70 ▼14.97
Dashboard /wp-admin2,221 ▲475.64 ▲0.1394.58 ▲7.3348.16 ▲7.13
Posts /wp-admin/edit.php2,124 ▲242.01 ▲0.0339.61 ▲4.4238.41 ▲1.36
Add New Post /wp-admin/post-new.php1,545 ▲1922.99 ▲0.12678.58 ▲17.3050.99 ▼10.73
Media Library /wp-admin/upload.php1,423 ▲264.21 ▲0.02100.28 ▼15.5644.17 ▼3.94
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0881.7427.1329.27
ActiveCampaign Preference Center /wp-admin/options-general.php?page=activecampaign-preference-center9861.6926.4962.51

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/pramadillo-activecampaign-email-preference-center/vendor/freemius/wordpress-sdk/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_theysaidso_widget
    • fs_active_plugins
    • fs_debug_mode
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • fs_accounts

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)
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/pramadillo-activecampaign-email-preference-center/public/partials/preference-center-free.php
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/pramadillo-activecampaign-email-preference-center/public/partials/preference-center-free.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/pramadillo-activecampaign-email-preference-center/admin/partials/settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/pramadillo-activecampaign-email-preference-center/admin/partials/settings-styles.php:2
    • > PHP Notice
      Undefined variable: email in wp-content/plugins/pramadillo-activecampaign-email-preference-center/public/partials/preference-center-free.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/pramadillo-activecampaign-email-preference-center/admin/partials/settings-sidebar.php:3
    • > PHP Notice
      Undefined variable: email in wp-content/plugins/pramadillo-activecampaign-email-preference-center/public/partials/preference-center.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/pramadillo-activecampaign-email-preference-center/admin/partials/settings-free.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ac_freemius() in wp-content/plugins/pramadillo-activecampaign-email-preference-center/public/partials/preference-center.php:26
    • > PHP Notice
      Undefined variable: lists in wp-content/plugins/pramadillo-activecampaign-email-preference-center/public/partials/preference-center-free.php on line 6

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

readme.txt 81% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Donate link: Please fix this invalid url: "pramschufer.com"
  • Screenshots: Add images for these screenshots: #4 (Preference Center Email Lookup), #5 (Preference Center Lists)
  • Screenshots: These screenshots lack descriptions #2, #3 in pramadillo-activecampaign-email-preference-center/assets to your readme.txt
You can take inspiration from this readme.txt

pramadillo-activecampaign-email-preference-center/activecampaign-email-preference-center.php 85% from 13 tests

The entry point to "ActiveCampaign Email Preference Center" version 2.0.12 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("pramadillo-activecampaign-email-preference-center.php" instead of "activecampaign-email-preference-center.php")
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin35,930 lines of code in 163 files:
LanguageFilesBlank linesComment linesLines of code
PHP1398,33017,59634,521
PO File42482881,107
JavaScript55159254
JSON20035
CSS130013

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity81.09
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes57
▷ Abstract classes23.51%
▷ Concrete classes5596.49%
▷ Final classes00.00%
Methods1,347
▷ Static methods21515.96%
▷ Public methods94470.08%
▷ Protected methods241.78%
▷ Private methods37928.14%
Functions103
▷ Named functions10299.03%
▷ Anonymous functions10.97%
Constants146
▷ Global constants9867.12%
▷ Class constants4832.88%
▷ Public constants48100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/icon.png12.59KB12.40KB▼ 1.52%
vendor/freemius/wordpress-sdk/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
vendor/freemius/wordpress-sdk/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%