89% purchase-orders-for-woocommerce

Code Review | Purchase Orders for WooCommerce

WordPress plugin Purchase Orders for WooCommerce scored 89% from 54 tests.

About plugin

  • Plugin page: purchase-orders-f...
  • Plugin version: 1.8.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 20, 2017
  • Latest release: Sep 6, 2023
  • Number of updates: 63
  • Update frequency: every 34.6 days
  • Top authors: mcgregormedia (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active / 18,304 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: ▼9.92ms] Passed 4 tests

Analyzing server-side resources used by Purchase Orders for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.51 ▼3.10
Dashboard /wp-admin3.31 ▲0.0047.31 ▼8.93
Posts /wp-admin/edit.php3.36 ▲0.0044.26 ▼9.76
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.30 ▼17.89
Media Library /wp-admin/upload.php3.23 ▲0.0033.23 ▼1.94

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Purchase Orders for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6813.60 ▼0.994.89 ▲2.7939.65 ▼10.41
Dashboard /wp-admin2,206 ▲214.88 ▼0.98102.84 ▼20.1738.40 ▼10.36
Posts /wp-admin/edit.php2,092 ▲32.01 ▼0.0135.56 ▼3.9633.28 ▲2.80
Add New Post /wp-admin/post-new.php1,538 ▲13923.22 ▲5.29679.03 ▲67.8649.73 ▲0.19
Media Library /wp-admin/upload.php1,385 ▼64.18 ▼0.1398.41 ▲0.0242.48 ▲1.44

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
The SRP test was a success

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 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: payment gateway, woocommerce, purchase order

purchase-orders-for-woocommerce/purchase-orders-for-woocommerce.php 85% from 13 tests

The main file in "Purchase Orders for WooCommerce" v. 1.8.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.8" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin872 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2306194510
PO File2128134362

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity96.00
▷ Minimum class complexity96.00
▷ Maximum class complexity96.00
Average method complexity8.92
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods1191.67%
▷ Protected methods00.00%
▷ Private methods18.33%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected