78% email-header-footer

Code Review | Email Header Footer

WordPress plugin Email Header Footer scored 78% from 54 tests.

About plugin

  • Plugin page: email-header-footer
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.9.7
  • WordPress version: 5.9.2
  • First release: Jun 4, 2016
  • Latest release: Mar 3, 2019
  • Number of updates: 20
  • Update frequency: every 50.2 days
  • Top authors: pmbaldha (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active / 2,700 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲4.09MB] [CPU: ▼280.16ms] 75% from 4 tests

A check of server-side resources used by Email Header Footer
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,812.15ms on /wp-admin/options-general.php?page=ehf_setting)
PageMemory (MB)CPU Time (ms)
Home /7.78 ▲4.2779.65 ▲26.81
Dashboard /wp-admin7.80 ▲4.4056.63 ▲18.04
Posts /wp-admin/edit.php7.80 ▲4.1660.26 ▲13.92
Add New Post /wp-admin/post-new.php10.49 ▲3.52113.44 ▼1,174.01
Media Library /wp-admin/upload.php7.80 ▲4.5148.89 ▲21.42
Freemius Debug [v.2.2.4] /wp-admin/admin.php?page=freemius7.8044.77
Email Header Footer /wp-admin/options-general.php?page=ehf_setting7.801,812.15
Install recommended Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins7.9147.23

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 200 new files
Database: no new tables, 5 new options
New WordPress options
fs_active_plugins
fs_debug_mode
fs_api_cache
fs_gdpr
fs_accounts

Browser metrics Passed 4 tests

An overview of browser requirements for Email Header Footer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,841 ▲8715.98 ▲1.165.95 ▲0.022.35 ▼0.11
Dashboard /wp-admin2,966 ▲1126.16 ▲0.03120.32 ▼17.95237.58 ▼6.11
Posts /wp-admin/edit.php2,773 ▲793.25 ▲0.0268.94 ▲4.72177.81 ▲33.09
Add New Post /wp-admin/post-new.php1,681 ▼2920.29 ▼1.19486.32 ▼1.49146.87 ▼37.76
Media Library /wp-admin/upload.php1,783 ▲855.56 ▲0.08152.16 ▼2.27236.57 ▲47.54
Freemius Debug [v.2.2.4] /wp-admin/admin.php?page=freemius1,4772.7459.63194.40
Email Header Footer /wp-admin/options-general.php?page=ehf_setting1,2712.5093.29189.07
Install recommended Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins1,4882.7456.86195.05

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 5 options
    • fs_gdpr
    • fs_active_plugins
    • fs_accounts
    • fs_debug_mode
    • fs_api_cache

Smoke tests 50% from 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/email-header-footer/freemius/templates/ajax-loader.php
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/email-header-footer/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/email-header-footer/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/email-header-footer/freemius/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/email-header-footer/freemius/templates/account/partials/addon.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/email-header-footer/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/email-header-footer/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/email-header-footer/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/email-header-footer/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/email-header-footer/freemius/templates/account/partials/addon.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (11 tag instead of maximum 10)
You can take inspiration from this readme.txt

email-header-footer/email-header-footer.php Passed 13 tests

The main file in "Email Header Footer" v. 1.2.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
110 characters long description:
Email Header Footer is a wordpress plugin that lets you customize email by setting header and footer of email.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin42,966 lines of code in 157 files:
LanguageFilesBlank linesComment linesLines of code
PHP1066,78216,25728,234
PO File105,5506,66712,010
Sass28399772,515
JavaScript33459194
CSS100013

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 2,360)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity71.63
▷ Minimum class complexity1.00
▷ Maximum class complexity2,360.00
Average method complexity4.29
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes52
▷ Abstract classes23.85%
▷ Concrete classes5096.15%
▷ Final classes00.00%
Methods1,147
▷ Static methods17114.91%
▷ Public methods81070.62%
▷ Protected methods383.31%
▷ Private methods29926.07%
Functions107
▷ Named functions107100.00%
▷ Anonymous functions00.00%
Constants119
▷ Global constants9680.67%
▷ Class constants2319.33%
▷ Public constants23100.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
3 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/email-header-footer.png14.00KB5.06KB▼ 63.85%