83% order-attachment-for-woocommerce

Code Review | Order Attachment for Woocommerce

WordPress plugin Order Attachment for Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: order-attachment-...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-5.3
  • WordPress version: 6.3.1
  • First release: Jul 4, 2017
  • Latest release: Jan 24, 2020
  • Number of updates: 74
  • Update frequency: every 13.9 days
  • Top authors: phoeniixx (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active /8,694 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.74ms] Passed 4 tests

A check of server-side resources used by Order Attachment for Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0240.04 ▲4.16
Dashboard /wp-admin3.33 ▼0.0247.75 ▼14.16
Posts /wp-admin/edit.php3.38 ▲0.0245.08 ▼2.24
Add New Post /wp-admin/post-new.php5.91 ▲0.0280.09 ▼13.48
Media Library /wp-admin/upload.php3.25 ▲0.0232.77 ▼1.09

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Order Attachment for Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲8914.36 ▼0.021.77 ▲0.1137.58 ▲0.78
Dashboard /wp-admin2,206 ▲255.51 ▼0.2198.59 ▼5.5240.03 ▼2.01
Posts /wp-admin/edit.php2,126 ▲261.97 ▼0.0736.61 ▼3.6637.32 ▼3.02
Add New Post /wp-admin/post-new.php1,379 ▼14917.44 ▼5.88578.14 ▼73.2539.42 ▼10.13
Media Library /wp-admin/upload.php1,423 ▲234.19 ▼0.1196.17 ▼7.1242.80 ▼1.93

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/order-attachment-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/order-attachment-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/order-attachment-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: These screenshots lack descriptions #1, #2, #3 in order-attachment-for-woocommerce/assets to your readme.txt
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
The official readme.txt might help

order-attachment-for-woocommerce/plugin.php 77% from 13 tests

The principal PHP file in "Order Attachment for Woocommerce" v. 3.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.0" instead of "2.6.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("order-attachment-for-woocommerce.php" instead of "plugin.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected2,697 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP66711,6572,290
CSS14144407

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity48.14
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.27
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods101
▷ Static methods54.95%
▷ Public methods7877.23%
▷ Protected methods2322.77%
▷ Private methods00.00%
Functions13
▷ Named functions1292.31%
▷ Anonymous functions17.69%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
13 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/arrow-prv.png1.52KB1.36KB▼ 10.85%
assets/css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
assets/css/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
assets/images/premium-head.png6.61KB5.20KB▼ 21.37%
assets/images/button2.png3.58KB2.59KB▼ 27.61%