94% lh-email

Code Review | LH Email

WordPress plugin LH Email scored 94% from 54 tests.

About plugin

  • Plugin page: lh-email
  • Plugin version: 1.12
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9
  • WordPress version: 5.8.1
  • First release: Feb 11, 2016
  • Latest release: Feb 21, 2018
  • Number of updates: 5
  • Update frequency: every 148.4 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 582 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.11MB] [CPU: ▼142.01ms] Passed 4 tests

Server-side resources used by LH Email
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.2038.79 ▲7.08
Dashboard /wp-admin3.15 ▲0.0954.88 ▼0.37
Posts /wp-admin/edit.php3.20 ▲0.0951.10 ▼2.20
Add New Post /wp-admin/post-new.php5.59 ▲0.1699.76 ▼568.93
Media Library /wp-admin/upload.php3.09 ▲0.0938.93 ▲3.48
Newsletters /wp-admin/edit.php?post_type=lh-email-newsletter3.1353.13
Send Email /wp-admin/tools.php?page=lh-email/lh-email.php3.1234.12

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 17 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for LH Email
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,692 ▲12015.88 ▲0.399.60 ▼0.9446.17 ▼0.12
Dashboard /wp-admin2,982 ▲485.90 ▼0.11139.11 ▼33.11116.20 ▼4.10
Posts /wp-admin/edit.php2,767 ▲282.72 ▲0.0169.45 ▼2.25131.85 ▲30.90
Add New Post /wp-admin/post-new.php1,678 ▼518.80 ▲0.02347.66 ▼52.53116.78 ▼1.61
Media Library /wp-admin/upload.php1,816 ▲95.04 ▲0.01164.26 ▲10.10128.50 ▲8.72
Newsletters /wp-admin/edit.php?post_type=lh-email-newsletter1,4162.6360.7874.69
Send Email /wp-admin/tools.php?page=lh-email/lh-email.php2,0977.95173.09133.22

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/lh-email/lh-email.php:562
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/lh-email/partials/components/send-newsletter.php:2
    • > PHP Fatal error
      require_once(): Failed opening required '../../../autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/lh-email/csstoinlinestyles/tests/index.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/lh-email/lh_email-template.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/lh-email/partials/tools.php:5
    • > PHP Warning
      require_once(../../../autoload.php): failed to open stream: No such file or directory in wp-content/plugins/lh-email/csstoinlinestyles/tests/index.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: emails, newsletter, newsletters, smtp, email...

lh-email/lh-email.php Passed 13 tests

This is the main PHP file of "LH Email" version 1.12, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
31 characters long description:
Do email newsletters the LH way

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,191 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP7501329815
CSS134130168
HTML1917123
Markdown328059
JSON10026

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity30.00
▷ Minimum class complexity1.00
▷ Maximum class complexity56.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods35
▷ Static methods25.71%
▷ Public methods2262.86%
▷ Protected methods00.00%
▷ Private methods1337.14%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected