10% greenmail-email-marketing

Code Review | GreenMail Email Marketing

WordPress plugin GreenMail Email Marketing scored10%from 54 tests.

About plugin

  • Plugin page: greenmail-email-m...
  • Plugin version: 1.60
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.2.3
  • WordPress version: 6.3.1
  • First release: Jun 13, 2018
  • Latest release: Sep 25, 2019
  • Number of updates: 37
  • Update frequency: every 12.7 days
  • Top authors: greenmailinc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,225 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/greenmail-email-marketing/greenmail.php+21
    Undefined variable: wpdb

Server metrics [RAM: ▲0.72MB] [CPU: ▲505.44ms] 50% from 4 tests

This is a short check of server-side resources used by GreenMail Email Marketing
It is recommended to improve the following
  • CPU: You should keep total CPU usage under 500.00ms (currently 548.86ms on /wp-admin/edit.php?post_type=greenmail-form)
  • Extra CPU: The extra CPU usage must be under 200.00ms (currently 505.44ms on /wp-admin/edit.php?post_type=greenmail-form)
PageMemory (MB)CPU Time (ms)
Home /4.16 ▲0.70572.68 ▲522.14
Dashboard /wp-admin4.03 ▲0.72577.92 ▲523.16
Posts /wp-admin/edit.php4.14 ▲0.78688.51 ▲636.63
Add New Post /wp-admin/post-new.php6.61 ▲0.72586.51 ▲479.75
Media Library /wp-admin/upload.php3.95 ▲0.72534.12 ▲496.71
Add New Form /wp-admin/post-new.php?post_type=greenmail-form4.201,543.48
Setup /wp-admin/admin.php?page=greenmail3.92544.86
Forms /wp-admin/edit.php?post_type=greenmail-form3.99548.86

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 44 new files
Database: 1 new table, 8 new options
New tables
wp_greenmail_wc_customer_carts
New WordPress options
greenmail_version
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_greenmail_email_marketing_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for GreenMail Email Marketing
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,002 ▲24113.72 ▼0.7712.11 ▲10.4753.07 ▲10.96
Dashboard /wp-admin2,235 ▲584.95 ▼0.5695.72 ▼2.4439.97 ▼1.25
Posts /wp-admin/edit.php2,152 ▲522.23 ▲0.2531.15 ▼6.0232.23 ▼7.72
Add New Post /wp-admin/post-new.php1,723 ▲18720.39 ▼2.61608.31 ▼30.4638.31 ▼14.46
Media Library /wp-admin/upload.php1,450 ▲474.31 ▲0.1199.02 ▼0.9748.00 ▲3.80
Add New Form /wp-admin/post-new.php?post_type=greenmail-form2,5933.1574.0660.45
Setup /wp-admin/admin.php?page=greenmail8871.9626.9429.57
Forms /wp-admin/edit.php?post_type=greenmail-form1,1722.2434.0830.70

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_greenmail_email_marketing_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (The opt-in forms list interface.), #2 (The available opt-in form options.), #3 (WooCommerce Integration: The available 'Checkout Opt-In' settings.), #4 (WooCommerce Integration: The available 'Abandoned Cart Emails' settings.)
You can take inspiration from this readme.txt

greenmail-email-marketing/greenmail.php 92% from 13 tests

The main PHP file in "GreenMail Email Marketing" ver. 1.60 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("greenmail-email-marketing.php" instead of "greenmail.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
No dangerous file extensions were detected4,631 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP307194344,200
CSS1356310
JavaScript3213573
SVG21048

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity35.09
▷ Minimum class complexity3.00
▷ Maximum class complexity116.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods174
▷ Static methods2816.09%
▷ Public methods16795.98%
▷ Protected methods21.15%
▷ Private methods52.87%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
4 compressed PNG files occupy 0.11MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png21.85KB21.66KB▼ 0.88%
screenshot-4.png20.77KB20.98KB0.00%
screenshot-2.png40.82KB40.81KB0.04%
screenshot-3.png25.70KB26.05KB0.00%