68% additional-email-for-order-by-category

Code Review | Additional Email for order by Category

WordPress plugin Additional Email for order by Category scored68%from 54 tests.

About plugin

  • Plugin page: additional-email-...
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 17, 2016
  • Latest release: Mar 4, 2017
  • Number of updates: 14
  • Update frequency: every 8.1 days
  • Top authors: meldin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /708 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

A check of server-side resources used by Additional Email for order by Category
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0438.79 ▼14.55
Dashboard /wp-admin3.36 ▲0.0546.10 ▼7.67
Posts /wp-admin/edit.php3.41 ▲0.0548.20 ▲1.80
Add New Post /wp-admin/post-new.php5.94 ▲0.0585.50 ▼1.11
Media Library /wp-admin/upload.php3.28 ▲0.0536.14 ▲1.04
Add Template /wp-admin/admin.php?page=aefo_edit3.2234.78
Add Template /wp-admin/admin.php?page=aefo_add3.2231.74
Additional Email /wp-admin/admin.php?page=aefo_list3.2730.55

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: 1 new table, 8 new options
New tables
wp_woocommerce_order_additional_email_by_category
New WordPress options
db_upgraded
widget_recent-comments
recovery_mode_email_last_sent
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
aefo_version
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Additional Email for order by Category
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.26 ▼1.371.70 ▼2.1240.98 ▼15.06
Dashboard /wp-admin2,236 ▲484.85 ▼0.0599.12 ▼17.2837.46 ▼5.88
Posts /wp-admin/edit.php2,116 ▲271.99 ▲0.0033.96 ▼3.3633.66 ▲3.87
Add New Post /wp-admin/post-new.php1,536 ▲317.39 ▼5.91680.33 ▼17.5148.17 ▼5.91
Media Library /wp-admin/upload.php1,415 ▲274.27 ▼0.02104.83 ▼5.3844.96 ▼3.17
Add Template /wp-admin/admin.php?page=aefo_edit7001.148.6518.32
Add Template /wp-admin/admin.php?page=aefo_add7011.146.3915.78
Additional Email /wp-admin/admin.php?page=aefo_list7011.146.6319.15

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_woocommerce_order_additional_email_by_category
  • The uninstall procedure has failed, leaving 8 options in the database
    • aefo_version
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=aefo_add
    • > Notice in wp-content/plugins/additional-email-for-order-by-category/index.php+54
    Undefined index: submit
    • > GET request to /wp-admin/admin.php?page=aefo_edit
    • > Notice in wp-content/plugins/additional-email-for-order-by-category/index.php+155
    Undefined index: aefo_item
    • > GET request to /wp-admin/admin.php?page=aefo_edit
    • > Error in wp-content/plugins/additional-email-for-order-by-category/index.php+202
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/additional-email-for-order-by-category/index.php:202
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): AdditionalEmailForOrder->aefo_edit()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=aefo_add
    • > Error in wp-content/plugins/additional-email-for-order-by-category/index.php+106
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/additional-email-for-order-by-category/index.php:106
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): AdditionalEmailForOrder->aefo_add()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=aefo_list
    • > Error in wp-content/plugins/additional-email-for-order-by-category/class.php+15
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/additional-email-for-order-by-category/class.php:15
    Stack trace:
    #0 wp-content/plugins/additional-email-for-order-by-category/index.php(270): AEFO_List->__construct()
    #1 wp-includes/class-wp-hook.php(310): AdditionalEmailForOrder->aefo_list()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/additional-email-for-order-by-category/index.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/additional-email-for-order-by-category/class.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% 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:
  • Requires at least: The plugin version is formatted incorrectly
The official readme.txt might help

additional-email-for-order-by-category/index.php 92% from 13 tests

The primary PHP file in "Additional Email for order by Category" version 2.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("additional-email-for-order-by-category.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected360 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23818360

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity17.00
▷ Minimum class complexity12.00
▷ Maximum class complexity22.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

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