83% order-attachments-for-woocommerce

Code Review | Order Attachments for WooCommerce

WordPress plugin Order Attachments for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: order-attachments...
  • Plugin version: 2.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.2
  • WordPress version: 6.3.1
  • First release: Jan 14, 2022
  • Latest release: Apr 21, 2023
  • Number of updates: 18
  • Update frequency: every 25.7 days
  • Top authors: sldesignpl (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

600+ active /3,418 total downloads

Benchmarks

Plugin footprint 83% 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.00MB] [CPU: ▼5.30ms] Passed 4 tests

Server-side resources used by Order Attachments for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0041.23 ▼1.00
Dashboard /wp-admin3.31 ▲0.0155.22 ▼3.68
Posts /wp-admin/edit.php3.36 ▲0.0054.98 ▲4.11
Add New Post /wp-admin/post-new.php5.90 ▲0.0089.30 ▼20.62
Media Library /wp-admin/upload.php3.24 ▲0.0046.69 ▲7.43

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Order Attachments for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3714.58 ▲0.461.59 ▼0.1640.76 ▼3.57
Dashboard /wp-admin2,207 ▲365.65 ▲0.0393.31 ▼7.7939.28 ▼3.87
Posts /wp-admin/edit.php2,113 ▲102.01 ▼0.0241.86 ▲3.7236.57 ▼2.25
Add New Post /wp-admin/post-new.php1,535 ▲923.03 ▼0.19707.51 ▲35.0962.52 ▲8.91
Media Library /wp-admin/upload.php1,412 ▲124.21 ▲0.03115.31 ▲7.0650.27 ▲5.94

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

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

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/order-attachments-for-woocommerce/class/class-wcoa-attachment-table.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/order-attachments-for-woocommerce/class/class-wcoa-attachment-table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/order-attachments-for-woocommerce/templates/admin/admin-main-page-content.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/order-attachments-for-woocommerce/class/class-wcoa-attachment-redirect-handler.php:7
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/order-attachments-for-woocommerce/class/class-wcoa-attachment-table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'WCOA_Attachment' not found in wp-content/plugins/order-attachments-for-woocommerce/templates/frontend/frontend-my-account-attachments.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WCOA_Attachment_Redirect_Handler' not found in wp-content/plugins/order-attachments-for-woocommerce/templates/frontend/frontend-redirect-handler.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/order-attachments-for-woocommerce/class/class-wcoa-options.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/order-attachments-for-woocommerce/class/class-wcoa-my-account.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/order-attachments-for-woocommerce/class/class-wcoa-ajax.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention: The official readme.txt might help

order-attachments-for-woocommerce/wcoa.php 85% from 13 tests

The main PHP file in "Order Attachments for WooCommerce" ver. 2.1.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("order-attachments-for-woocommerce.php" instead of "wcoa.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
No dangerous file extensions were detected977 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP1525849807
JavaScript1374105
CSS215064
SVG1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity7.50
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.81
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods64
▷ Static methods2539.06%
▷ Public methods5382.81%
▷ Protected methods11.56%
▷ Private methods1015.62%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected