83% universal-email-preference-center

Code Review | Universal email preference center

WordPress plugin Universal email preference center scored83%from 54 tests.

About plugin

  • Plugin page: universal-email-p...
  • Plugin version: 1.3.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.2
  • WordPress version: 6.3.1
  • First release: Mar 24, 2023
  • Latest release: May 2, 2023
  • Number of updates: 17
  • Update frequency: every 2.4 days
  • Top authors: roofboard (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /986 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲5.50MB] [CPU: ▲23.30ms] 75% from 4 tests

Analyzing server-side resources used by Universal email preference center
Please fix the following
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.50MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.30 ▲5.8468.06 ▲22.38
Dashboard /wp-admin9.32 ▲6.0276.45 ▲22.42
Posts /wp-admin/edit.php9.32 ▲5.9682.34 ▲27.61
Add New Post /wp-admin/post-new.php10.08 ▲4.19121.13 ▲20.79
Media Library /wp-admin/upload.php9.32 ▲6.0972.84 ▲36.33
Freemius Debug [v.2.5.3] /wp-admin/admin.php?page=freemius9.3264.81

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 217 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
fs_accounts
fs_gdpr
fs_debug_mode
fs_active_plugins
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Universal email preference center
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲16214.17 ▼0.376.05 ▲4.3629.21 ▼18.39
Dashboard /wp-admin2,243 ▲695.26 ▼0.41110.16 ▲17.7445.83 ▲5.97
Posts /wp-admin/edit.php2,151 ▲512.49 ▲0.4644.95 ▲5.1232.76 ▼1.97
Add New Post /wp-admin/post-new.php1,558 ▲2722.78 ▼0.32691.79 ▼11.1735.22 ▼28.71
Media Library /wp-admin/upload.php1,445 ▲454.97 ▲0.80108.92 ▲0.8947.82 ▼0.41
Freemius Debug [v.2.5.3] /wp-admin/admin.php?page=freemius1,1142.0739.7830.69

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • fs_gdpr
    • fs_accounts
    • db_upgraded
    • widget_theysaidso_widget
    • fs_debug_mode
    • fs_active_plugins

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 18× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: email in wp-content/plugins/universal-email-preference-center/public/partials/preference-center-free.php on line 1
    • > PHP Notice
      Undefined variable: valid in wp-content/plugins/universal-email-preference-center/public/partials/universal-email-preference-center-public-display.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/universal-email-preference-center/public/partials/universal-email-preference-center-public-display.php:27
    • > PHP Notice
      Undefined variable: valid in wp-content/plugins/universal-email-preference-center/admin/partials/tabs/lists.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/universal-email-preference-center/admin/partials/universal-email-preference-center-admin-display.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/universal-email-preference-center/admin/partials/tabs/lists.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/universal-email-preference-center/admin/partials/settings-styles.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/universal-email-preference-center/includes/manager/layouts/active-campagin-lists.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/universal-email-preference-center/admin/partials/sidebar.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/universal-email-preference-center/includes/manager/layouts/iterable-lists.php:64

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Settings Screen), #4 (Preference Center Email Lookup), #5 (Preference Center Lists)
  • Donate link: Please fix this invalid url: "wpressapi.com"
Please take inspiration from this readme.txt

universal-email-preference-center/universal-email-preference-center.php Passed 13 tests

The primary PHP file in "Universal email preference center" version 1.3.0 is used by WordPress to initiate all plugin functionality
91 characters long description:
Base Program allows users to update their email preferences on ActiveCampaign and Iterable.

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
Everything looks great! No dangerous files found in this plugin35,744 lines of code in 161 files:
LanguageFilesBlank linesComment linesLines of code
PHP1398,25817,64134,872
JavaScript684138462
Markdown1680214
CSS152618196

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,089)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity82.86
▷ Minimum class complexity1.00
▷ Maximum class complexity3,089.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes56
▷ Abstract classes23.57%
▷ Concrete classes5496.43%
▷ Final classes00.00%
Methods1,323
▷ Static methods19915.04%
▷ Public methods93670.75%
▷ Protected methods171.28%
▷ Private methods37027.97%
Functions102
▷ Named functions9795.10%
▷ Anonymous functions54.90%
Constants148
▷ Global constants10168.24%
▷ Class constants4731.76%
▷ Public constants47100.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
5 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
includes/freemius/assets/img/universal-email-preference-center-premium.png25.67KB17.07KB▼ 33.48%
includes/freemius/assets/img/universal-email-preference-center-css.png3.12KB2.85KB▼ 8.43%
admin/img/icon.png25.67KB17.07KB▼ 33.48%
includes/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%