84% wenprise-better-emails

Code Review | Wenprise Better Emails

WordPress plugin Wenprise Better Emails scored84%from 54 tests.

About plugin

  • Plugin page: wenprise-better-e...
  • Plugin version: 1.3.1
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Jan 6, 2018
  • Latest release: May 10, 2023
  • Number of updates: 12
  • Update frequency: every 162.6 days
  • Top authors: iwillhappy1314 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /2,260 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼7.03ms] Passed 4 tests

Analyzing server-side resources used by Wenprise Better Emails
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1043.25 ▲0.56
Dashboard /wp-admin3.40 ▲0.0550.90 ▼12.84
Posts /wp-admin/edit.php3.52 ▲0.1651.31 ▼1.31
Add New Post /wp-admin/post-new.php5.98 ▲0.0985.18 ▼14.52
Media Library /wp-admin/upload.php3.33 ▲0.0939.41 ▲3.99

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 103 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Wenprise Better Emails
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲3914.25 ▼0.121.75 ▲0.1845.32 ▼7.13
Dashboard /wp-admin2,198 ▲185.58 ▼0.0995.98 ▲5.9041.91 ▼2.09
Posts /wp-admin/edit.php2,097 ▼31.97 ▲0.0136.85 ▲1.4932.86 ▼1.03
Add New Post /wp-admin/post-new.php1,526 ▼023.64 ▲0.16657.16 ▼58.5852.68 ▼2.60
Media Library /wp-admin/upload.php1,403 ▲64.21 ▼0.05107.92 ▲1.4047.59 ▲2.09

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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 following issues need your attention
  • 65× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\CssSelector\\Parser\\ParserInterface' not found in wp-content/plugins/wenprise-better-emails/vendor/symfony/css-selector/Parser/Shortcut/HashParser.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\Tests\ode\\AbstractNodeTest' not found in wp-content/plugins/wenprise-better-emails/vendor/symfony/css-selector/Tests/Node/AttributeNodeTest.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_specialchars_decode() in wp-content/plugins/wenprise-better-emails/templates/admin/comment.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\XPath\\Extension\\AbstractExtension' not found in wp-content/plugins/wenprise-better-emails/vendor/symfony/css-selector/XPath/Extension/CombinationExtension.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\Tests\ode\\AbstractNodeTest' not found in wp-content/plugins/wenprise-better-emails/vendor/symfony/css-selector/Tests/Node/NegationNodeTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wenprise-better-emails/vendor/symfony/css-selector/Tests/Parser/Shortcut/ClassParserTest.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wenprise-better-emails/vendor/symfony/css-selector/Tests/CssSelectorConverterTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wenprise-better-emails/vendor/symfony/css-selector/Tests/Parser/Shortcut/HashParserTest.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\CssSelector\\XPath\\TranslatorInterface' not found in wp-content/plugins/wenprise-better-emails/vendor/symfony/css-selector/XPath/Translator.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\ode\\AbstractNode' not found in wp-content/plugins/wenprise-better-emails/vendor/symfony/css-selector/Node/AttributeNode.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === wenprise-better-emails === )
The official readme.txt might help

wenprise-better-emails/wenprise-better-emails.php Passed 13 tests

"Wenprise Better Emails" version 1.3.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
92 characters long description:
使用 HTML 邮件,美化 WordPress 评论审核通知邮件,评论回复通知邮件。

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
No dangerous file extensions were detected5,299 lines of code in 102 files:
LanguageFilesBlank linesComment linesLines of code
PHP951,1062,5974,543
HTML200356
CSS13945214
JSON100145
Markdown26030
XML10011

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity4.40
▷ Minimum class complexity1.00
▷ Maximum class complexity65.00
Average method complexity1.74
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces20
Interfaces6
Traits0
Classes78
▷ Abstract classes45.13%
▷ Concrete classes7494.87%
▷ Final classes22.70%
Methods387
▷ Static methods112.84%
▷ Public methods36193.28%
▷ Protected methods123.10%
▷ Private methods143.62%
Functions22
▷ Named functions836.36%
▷ Anonymous functions1463.64%
Constants14
▷ Global constants17.14%
▷ Class constants1392.86%
▷ Public constants13100.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
No PNG images were found in this plugin