84% woo-preview-emails

Code Review | Preview E-mails for WooCommerce

WordPress plugin Preview E-mails for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-preview-emails
  • Plugin version: 2.1.6
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3.0
  • WordPress version: 6.3.1
  • First release: Dec 1, 2015
  • Latest release: Aug 22, 2023
  • Number of updates: 157
  • Update frequency: every 18.0 days
  • Top authors: digamberpradhan (85.99%)codemanas (14.65%)

Code review

54 tests

User reviews

79 reviews

Install metrics

30,000+ active /404,133 total downloads

Benchmarks

Plugin footprint 83% from 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 gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.32ms] Passed 4 tests

A check of server-side resources used by Preview E-mails for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0645.02 ▲0.18
Dashboard /wp-admin3.37 ▲0.0251.26 ▼20.78
Posts /wp-admin/edit.php3.48 ▲0.1356.80 ▲5.81
Add New Post /wp-admin/post-new.php5.95 ▲0.0697.83 ▼4.50
Media Library /wp-admin/upload.php3.29 ▲0.0643.06 ▼4.18

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Preview E-mails for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.25 ▼0.121.82 ▼0.1448.23 ▲5.21
Dashboard /wp-admin2,195 ▲185.65 ▲0.0598.11 ▼2.4042.04 ▼3.43
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0538.28 ▼0.6436.06 ▲1.67
Add New Post /wp-admin/post-new.php1,526 ▼323.18 ▼0.04668.15 ▼28.5656.44 ▲1.05
Media Library /wp-admin/upload.php1,403 ▲64.19 ▼0.0495.47 ▼29.3143.86 ▼7.01

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

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
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      require_once(WOO_PREVIEW_EMAILS_DIR/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/woo-preview-emails/includes/Bootstrap.php on line 43
    • > PHP Warning
      Use of undefined constant WOO_PREVIEW_EMAILS_DIR - assumed 'WOO_PREVIEW_EMAILS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-preview-emails/includes/Bootstrap.php on line 43
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/woo-preview-emails/views/result/style.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'WOO_PREVIEW_EMAILS_DIR/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-preview-emails/includes/Bootstrap.php on line 43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/woo-preview-emails/views/form.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/woo-preview-emails/views/result/scripts.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Codemanas\\WooPreviewEmails\\plugins_url() in wp-content/plugins/woo-preview-emails/includes/Main.php:20

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 Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: preview, woocommerce, emails

woo-preview-emails/woocommerce-preview-emails.php 85% from 13 tests

This is the main PHP file of "Preview E-mails for WooCommerce" version 2.1.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-preview-emails.php" instead of "woocommerce-preview-emails.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("6.0" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin999 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP13140305876
CSS2240122
JavaScript1011

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity21.60
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity3.22
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods47
▷ Static methods919.15%
▷ Public methods4493.62%
▷ Protected methods00.00%
▷ Private methods36.38%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin