10% additional-order-costs-for-woocommerce

Code Review | Additional Order Costs for WooCommerce

WordPress plugin Additional Order Costs for WooCommerce scored10%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: 6.3.1
  • 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 /569 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin did not install without 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.10MB] [CPU: ▼5.74ms] Passed 4 tests

A check of server-side resources used by Additional Order Costs for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.16 ▼6.27
Dashboard /wp-admin3.44 ▲0.0951.52 ▼20.19
Posts /wp-admin/edit.php3.48 ▲0.1347.98 ▼2.42
Add New Post /wp-admin/post-new.php6.03 ▲0.14101.32 ▲7.51
Media Library /wp-admin/upload.php3.36 ▲0.1340.80 ▲5.94
Additional Order Costs Options /wp-admin/admin.php?page=aoc_wc_options3.7240.25

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 360 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

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 /2,838 ▲9213.74 ▼0.642.01 ▼0.4344.90 ▼1.78
Dashboard /wp-admin2,219 ▲314.93 ▲0.01114.75 ▼3.3441.29 ▼4.89
Posts /wp-admin/edit.php2,102 ▲132.20 ▲0.1836.95 ▼1.0632.17 ▼2.97
Add New Post /wp-admin/post-new.php1,525 ▼1723.20 ▲4.83708.47 ▲66.8960.31 ▲6.08
Media Library /wp-admin/upload.php1,401 ▲164.25 ▲0.05100.25 ▼4.0245.24 ▲2.82
Additional Order Costs Options /wp-admin/admin.php?page=aoc_wc_options8392.2930.5630.29

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

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
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 39× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > 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_Colorpicker.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/additional-order-costs-for-woocommerce/cmb2/includes/types/CMB2_Type_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/additional-order-costs-for-woocommerce/cmb2/includes/types/CMB2_Type_Text_Date.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_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/additional-order-costs-for-woocommerce/cmb2/includes/CMB2_Field.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/additional-order-costs-for-woocommerce/cmb2/includes/types/CMB2_Type_File_List.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_Multicheck.php:13
    • > 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_Text_Datetime_Timestamp_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/additional-order-costs-for-woocommerce/cmb2/includes/CMB2.php:21
    • > 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_Select.php:13

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

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: woocommerce costs, reporting, order costs, additional costs

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

The main file in "Additional Order Costs for WooCommerce" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 150 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin46,955 lines of code in 214 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP712,2976,8167,735
CSS132501,1904,545
JavaScript84006031,676
Markdown22190676

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
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
Namespaces0
Interfaces0
Traits0
Classes78
▷ Abstract classes911.54%
▷ Concrete classes6988.46%
▷ Final classes00.00%
Methods577
▷ Static methods10217.68%
▷ Public methods48083.19%
▷ Protected methods9015.60%
▷ Private methods71.21%
Functions41
▷ Named functions41100.00%
▷ Anonymous functions00.00%
Constants16
▷ 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
cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
cmb2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
cmb2/images/ico-delete.png0.70KB0.72KB0.00%