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

Code Review | Additional Email for order by Category

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

About plugin

  • Plugin page: additional-email-...
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • 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 / 553 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼316.98ms] Passed 4 tests

Server-side resources used by Additional Email for order by Category
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0556.93 ▲2.66
Dashboard /wp-admin3.47 ▲0.0635.88 ▼54.59
Posts /wp-admin/edit.php3.69 ▲0.0558.49 ▼23.85
Add New Post /wp-admin/post-new.php6.93 ▼0.0493.54 ▼1,189.59
Media Library /wp-admin/upload.php3.34 ▲0.0525.53 ▲0.10
Add Template /wp-admin/admin.php?page=aefo_add3.2923.51
Additional Email /wp-admin/admin.php?page=aefo_list3.3322.25
Add Template /wp-admin/admin.php?page=aefo_edit3.2922.61

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 3 new files
Database: 1 new table, 2 new options
New tables
wp_woocommerce_order_additional_email_by_category
New WordPress options
aefo_version
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

Checking browser requirements for Additional Email for order by Category
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,797 ▲3916.19 ▲0.596.43 ▼1.642.16 ▼0.62
Dashboard /wp-admin2,926 ▲726.12 ▼0.11118.90 ▼15.52157.54 ▼7.48
Posts /wp-admin/edit.php2,722 ▲283.24 ▲0.0064.43 ▼1.04146.34 ▲1.31
Add New Post /wp-admin/post-new.php1,720 ▲3017.32 ▼3.34455.27 ▼16.57165.22 ▼29.62
Media Library /wp-admin/upload.php1,728 ▲275.51 ▼0.04187.44 ▲50.25194.19 ▼50.78
Add Template /wp-admin/admin.php?page=aefo_add8631.9736.2870.49
Additional Email /wp-admin/admin.php?page=aefo_list8621.9736.34138.75
Add Template /wp-admin/admin.php?page=aefo_edit8621.9735.3670.48

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_woocommerce_order_additional_email_by_category
  • The uninstall procedure has failed, leaving 2 options in the database
    • recovery_mode_email_last_sent
    • aefo_version

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=aefo_edit
    • > Notice in wp-content/plugins/additional-email-for-order-by-category/index.php+145
    Undefined index: submit
    • > 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(307): AdditionalEmailForOrder->aefo_add()
    #1 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(474): 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(307): AdditionalEmailForOrder->aefo_list()
    #2 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(474): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > 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(307): AdditionalEmailForOrder->aefo_edit()
    #1 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(474): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown

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
  • 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 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Requires at least: Invalid version format
You can look at the official readme.txt

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

"Additional Email for order by Category" version 2.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to 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 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected360 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23818360

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin