73% wp-email-template

Code Review | WP Email Template

WordPress plugin WP Email Template scored73%from 54 tests.

About plugin

  • Plugin page: wp-email-template
  • Plugin version: 2.8.2
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Sep 4, 2012
  • Latest release: Nov 23, 2023
  • Number of updates: 217
  • Update frequency: every 18.9 days
  • Top authors: a3rev (100%)

Code review

54 tests

User reviews

35 reviews

Install metrics

3,000+ active /228,866 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: ▲2.76MB] [CPU: ▲12.66ms] Passed 4 tests

Analyzing server-side resources used by WP Email Template
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /6.23 ▲2.7755.50 ▲11.39
Dashboard /wp-admin6.12 ▲2.7762.45 ▼0.59
Posts /wp-admin/edit.php6.17 ▲2.8167.16 ▲18.93
Add New Post /wp-admin/post-new.php8.64 ▲2.75128.44 ▲33.65
Media Library /wp-admin/upload.php5.98 ▲2.7557.87 ▲20.89
Template /wp-admin/admin.php?page=wp_email_template6.1061.58
Send WP Emails /wp-admin/admin.php?page=send_wp_emails6.0759.82

Server storage [IO: ▲6.67MB] [DB: ▲0.06MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 386 new files
Database: 1 new table, 24 new options
New tables
wp_a3_exclude_email_subject
New WordPress options
wp_email_template_clean_on_deletion
wp_email_template_email_footer
can_compress_scripts
wp_et_mandrill_provider_configuration
db_upgraded
wp_et_send_wp_emails_general
wp_email_template_google_font_list
widget_theysaidso_widget
theysaidso_admin_options
wp_et_sparkpost_provider_configuration
...

Browser metrics Passed 4 tests

Checking browser requirements for WP Email Template
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲3014.12 ▼0.611.70 ▼0.2941.80 ▼1.06
Dashboard /wp-admin2,225 ▲545.63 ▼0.0498.24 ▼2.3642.26 ▼1.60
Posts /wp-admin/edit.php2,127 ▲271.96 ▼0.1140.09 ▲2.1435.17 ▲2.26
Add New Post /wp-admin/post-new.php1,549 ▲923.41 ▲0.24692.09 ▲40.3252.76 ▼10.05
Media Library /wp-admin/upload.php1,427 ▲244.17 ▼0.1098.93 ▼1.0342.45 ▼0.51
Template /wp-admin/admin.php?page=wp_email_template2,1234.14100.58106.62
Send WP Emails /wp-admin/admin.php?page=send_wp_emails3,0894.42105.89104.56

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_a3_exclude_email_subject
  • The uninstall procedure has failed, leaving 23 options in the database
    • wp_email_template_exclude_emails
    • wp_email_template_test_send_email
    • wp_et_sparkpost_provider_configuration
    • wp_email_template_email_footer
    • wp_et_send_wp_emails_general
    • a3rev_wp_email_template_version
    • wp_email_template_style_body
    • wp_et_smtp_provider_configuration
    • wp_et_mandrill_provider_configuration
    • widget_recent-comments
    • ...

Smoke tests 75% 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)
Good news, no errors were detected

SRP 50% 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
Please fix the following
  • 111× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/wp-email-template/includes/sparkpost/egeloen/http-adapter/src/Message/MessageInterface.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Ivory\\HttpAdapter\\AbstractHttpAdapter' not found in wp-content/plugins/wp-email-template/includes/sparkpost/egeloen/http-adapter/src/AbstractCurlHttpAdapter.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UriInterface' not found in wp-content/plugins/wp-email-template/includes/sparkpost/zendframework/zend-diactoros/src/Uri.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/wp-email-template/includes/sparkpost/psr/http-message/src/ServerRequestInterface.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'Ivory\\HttpAdapter\\Event\\Subscriber\\AbstractFormatterSubscriber' not found in wp-content/plugins/wp-email-template/includes/sparkpost/egeloen/http-adapter/src/Event/Subscriber/LoggerSubscriber.php:34
    • > PHP Fatal error
      Uncaught Error: Interface 'Ivory\\HttpAdapter\\Event\\History\\JournalEntryFactoryInterface' not found in wp-content/plugins/wp-email-template/includes/sparkpost/egeloen/http-adapter/src/Event/History/JournalEntryFactory.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Ivory\\HttpAdapter\\AbstractHttpAdapter' not found in wp-content/plugins/wp-email-template/includes/sparkpost/egeloen/http-adapter/src/SocketHttpAdapter.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Ivory\\HttpAdapter\\Event\\Retry\\Strategy\\RetryStrategyChainInterface' not found in wp-content/plugins/wp-email-template/includes/sparkpost/egeloen/http-adapter/src/Event/Retry/Strategy/AbstractRetryStrategyChain.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Zend\\Diactoros\\Response' not found in wp-content/plugins/wp-email-template/includes/sparkpost/zendframework/zend-diactoros/src/Response/TextResponse.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Ivory\\HttpAdapter\\AbstractStreamHttpAdapter' not found in wp-content/plugins/wp-email-template/includes/sparkpost/egeloen/http-adapter/src/FileGetContentsHttpAdapter.php:19

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

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
You can take inspiration from this readme.txt

wp-email-template/wp-email-template.php 92% from 13 tests

The main PHP script in "WP Email Template" version 2.8.2 is automatically included on every request by WordPress
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 316 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected58,226 lines of code in 310 files:
LanguageFilesBlank linesComment linesLines of code
PHP2265,96213,71023,010
JSON60013,634
JavaScript241,9571,44512,208
CSS202961523,203
PO File41,3002,2053,137
Markdown1583102,048
LESS57526642
HTML32941258
SVG33047
YAML34223
XML11016

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 410)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity14.92
▷ Minimum class complexity1.00
▷ Maximum class complexity801.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity410.00
Code structure
Namespaces34
Interfaces34
Traits6
Classes204
▷ Abstract classes125.88%
▷ Concrete classes19294.12%
▷ Final classes42.08%
Methods1,778
▷ Static methods1216.81%
▷ Public methods1,44881.44%
▷ Protected methods21111.87%
▷ Private methods1196.69%
Functions61
▷ Named functions3252.46%
▷ Anonymous functions2947.54%
Constants98
▷ Global constants3636.73%
▷ Class constants6263.27%
▷ Public constants62100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
45 PNG files occupy 3.51MB with 2.45MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/slider-container-end-disable.png1.59KB0.55KB▼ 65.24%
admin/assets/images/slider-bg-disable.png1.04KB0.14KB▼ 86.45%
assets/images/follow-twitter.png4.04KB2.07KB▼ 48.62%
assets/images/premium-email-title.png1,235.06KB22.55KB▼ 98.17%
assets/images/icon_linkedin.png1.56KB0.77KB▼ 50.50%