10% additional-order-costs-for-woocommerce

Code Review | Additional Order Costs for WooCommerce

WordPress plugin Additional Order Costs for WooCommerce scored 10% from 54 tests.

About plugin

  • Plugin page: additional-order-...
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4
  • WordPress version: 5.9.2
  • First release: Jul 22, 2020
  • Latest release: Jul 22, 2020
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: theritesites (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 256 total downloads


Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure had errors
    • > Warning in wp-content/plugins/additional-order-costs-for-woocommerce/includes/class-aoc-wc-activator.php+28
    Use of undefined constant self - assumed 'self' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▲0.62MB] [CPU: ▼286.65ms] Passed 4 tests

Server-side resources used by Additional Order Costs for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4257.74 ▲5.03
Dashboard /wp-admin4.16 ▲0.7539.36 ▲7.12
Posts /wp-admin/edit.php4.35 ▲0.7041.68 ▲5.75
Add New Post /wp-admin/post-new.php7.60 ▲0.6296.87 ▼1,162.81
Media Library /wp-admin/upload.php4.04 ▲0.7429.78 ▲5.43
Additional Order Costs Options /wp-admin/admin.php?page=aoc_wc_options4.3329.71

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 360 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Additional Order Costs for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,810 ▲6616.07 ▲0.445.92 ▼0.283.50 ▲1.01
Dashboard /wp-admin2,910 ▲496.24 ▲0.04118.49 ▼15.35160.34 ▼2.85
Posts /wp-admin/edit.php2,703 ▲183.27 ▲0.0366.17 ▲2.55140.58 ▲0.38
Add New Post /wp-admin/post-new.php1,682 ▼7819.15 ▼3.52377.54 ▼25.21151.66 ▲0.41
Media Library /wp-admin/upload.php1,713 ▲185.57 ▲0.06144.84 ▲4.64188.29 ▲0.13
Additional Order Costs Options /wp-admin/admin.php?page=aoc_wc_options1,0632.4556.96115.35

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

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)
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 39× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/additional-order-costs-for-woocommerce/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/additional-order-costs-for-woocommerce/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/additional-order-costs-for-woocommerce/cmb2/includes/types/CMB2_Type_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/additional-order-costs-for-woocommerce/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/additional-order-costs-for-woocommerce/cmb2/includes/types/CMB2_Type_Checkbox.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup' not found in wp-content/plugins/additional-order-costs-for-woocommerce/cmb2/includes/CMB2_Options_Hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/additional-order-costs-for-woocommerce/cmb2/includes/types/CMB2_Type_Oembed.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/additional-order-costs-for-woocommerce/cmb2/example-functions.php:105
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/additional-order-costs-for-woocommerce/cmb2/includes/types/CMB2_Type_Counter_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller_Boxes' not found in wp-content/plugins/additional-order-costs-for-woocommerce/cmb2/includes/rest-api/CMB2_REST_Controller_Fields.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found


Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: additional costs, reporting, order costs, woocommerce costs

additional-order-costs-for-woocommerce/additional-order-costs-for-woocommerce.php 92% from 13 tests

The principal PHP file in "Additional Order Costs for WooCommerce" v. 1.0.3 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 150 characters long)

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
Good job! No executable or dangerous file extensions detected46,955 lines of code in 214 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity17.74
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity3.28
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
▷ Abstract classes911.54%
▷ Concrete classes6988.46%
▷ Final classes00.00%
▷ Static methods10217.68%
▷ Public methods48083.19%
▷ Protected methods9015.60%
▷ Private methods71.21%
▷ Named functions41100.00%
▷ Anonymous functions00.00%
▷ Global constants1062.50%
▷ Class constants637.50%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings