72% yaymail

Code Review | YayMail - WooCommerce Email Customizer

WordPress plugin YayMail - WooCommerce Email Customizer scored72%from 54 tests.

About plugin

  • Plugin page: yaymail
  • Plugin version: 3.4.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 6, 2020
  • Latest release: Nov 22, 2023
  • Number of updates: 152
  • Update frequency: every 7.3 days
  • Top authors: yaycommerce (100%)

Code review

54 tests

User reviews

179 reviews

Install metrics

30,000+ active /547,789 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲1.67MB] [CPU: ▲8.26ms] Passed 4 tests

An overview of server-side resources used by YayMail - WooCommerce Email Customizer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.11 ▲1.6454.09 ▲12.04
Dashboard /wp-admin4.97 ▲1.6759.78 ▲10.00
Posts /wp-admin/edit.php5.03 ▲1.6659.08 ▲8.65
Add New Post /wp-admin/post-new.php7.58 ▲1.6992.64 ▲3.02
Media Library /wp-admin/upload.php4.94 ▲1.7148.16 ▲11.36
Other plugins /wp-admin/admin.php?page=yaycommerce-other-plugins4.9144.10
Help /wp-admin/admin.php?page=yaycommerce-help4.7035.06

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

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

Browser metrics Passed 4 tests

YayMail - WooCommerce Email Customizer: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲8714.40 ▲0.061.67 ▼0.0643.34 ▼2.42
Dashboard /wp-admin2,254 ▲805.66 ▲0.0191.59 ▼3.6042.57 ▼1.36
Posts /wp-admin/edit.php2,166 ▲602.03 ▲0.0939.40 ▼0.6032.21 ▼4.27
Add New Post /wp-admin/post-new.php1,571 ▲4525.21 ▲1.91609.71 ▼93.2065.45 ▲9.36
Media Library /wp-admin/upload.php1,459 ▲624.31 ▲0.1698.38 ▼2.1542.55 ▼1.79
Other plugins /wp-admin/admin.php?page=yaycommerce-other-plugins1,1371.8433.7831.23
Help /wp-admin/admin.php?page=yaycommerce-help280.410.063.80

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
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • yaymail_settings

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/yaymail/views/templates/emails/additional-order-details.php
  • 64× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/yaymail/includes/Templates/Elements/YayMail/OrderItemDownload.php:2
    • > PHP Notice
      Undefined variable: attrs in wp-content/plugins/yaymail/includes/Templates/Elements/YayMail/Images.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/yaymail/includes/Templates/Elements/YayMail/TextList.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/yaymail/includes/Templates/Elements/YayMail/ElementText.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/yaymail/includes/Templates/Elements/YayMail/AdditionalOrderInformation.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/yaymail/includes/Templates/Elements/YayMail/Hook.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/yaymail/includes/Templates/Elements/YayMail/ImageList.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function self_admin_url() in wp-content/plugins/yaymail/includes/License/views/update-plugin-notification.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/yaymail/includes/Templates/Elements/YayMail/ShippingAddress.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/yaymail/includes/Templates/Elements/YayMail/Images.php on line 3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=yaycommerce-help
    • > Network (severe)
    wp-admin/admin.php?page=yaycommerce-help - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: email customizer, woocommerce emails, email designer, email templates, woocommerce email customizer

yaymail/yaymail.php 92% from 13 tests

The main PHP script in "YayMail - WooCommerce Email Customizer" version 3.4.1 is automatically included on every request by WordPress
The following require your attention:
  • Requires at least: The required version number must match the one declared in readme.txt ("3.0" instead of "3.0.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin35,129 lines of code in 150 files:
LanguageFilesBlank linesComment linesLines of code
PHP1151,36081717,070
JavaScript241,3851,69610,807
PO File52,8304,1406,326
CSS5968923
SVG1003

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 102)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity37.33
▷ Minimum class complexity1.00
▷ Maximum class complexity353.00
Average method complexity5.33
▷ Minimum method complexity1.00
▷ Maximum method complexity102.00
Code structure
Namespaces9
Interfaces0
Traits0
Classes39
▷ Abstract classes00.00%
▷ Concrete classes39100.00%
▷ Final classes00.00%
Methods313
▷ Static methods11235.78%
▷ Public methods29694.57%
▷ Protected methods30.96%
▷ Private methods144.47%
Functions25
▷ Named functions520.00%
▷ Anonymous functions2080.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
70 compressed PNG files occupy 0.16MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/dist/images/SocialIcons/SolidDark/Telegram.png0.57KB0.59KB0.00%
assets/dist/images/SocialIcons/Colorful/Vimeo.png1.70KB1.45KB▼ 14.49%
assets/dist/images/SocialIcons/LineDark/Instagram.png18.58KB10.23KB▼ 44.90%
assets/dist/images/SocialIcons/LineDark/Pinterest.png1.91KB2.13KB0.00%
assets/dist/images/SocialIcons/LineDark/Messenger.png1.98KB2.14KB0.00%