77% conditional-extra-fees-for-woocommerce

Code Review | Conditional cart fee / Extra charge rule for WooCommerce extra fees

WordPress plugin Conditional cart fee / Extra charge rule for WooCommerce extra fees scored77%from 54 tests.

About plugin

  • Plugin page: conditional-extra...
  • Plugin version: 1.1.20
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4.0
  • WordPress version: 6.3.1
  • First release: May 13, 2021
  • Latest release: Nov 30, 2023
  • Number of updates: 91
  • Update frequency: every 10.2 days
  • Top authors: rajeshsingh520 (97.8%)jyotsnasingh520 (3.3%)

Code review

54 tests

User reviews

23 reviews

Install metrics

1,000+ active /32,642 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: ▼6.74ms] Passed 4 tests

This is a short check of server-side resources used by Conditional cart fee / Extra charge rule for WooCommerce extra fees
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0132.21 ▼7.23
Dashboard /wp-admin3.32 ▲0.0144.84 ▼5.48
Posts /wp-admin/edit.php3.37 ▲0.0147.63 ▲0.95
Add New Post /wp-admin/post-new.php5.90 ▲0.0178.44 ▼12.87
Media Library /wp-admin/upload.php3.24 ▲0.0134.46 ▼1.37

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Conditional cart fee / Extra charge rule for WooCommerce extra fees
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲7014.37 ▲0.021.89 ▲0.1840.00 ▼3.53
Dashboard /wp-admin2,201 ▲215.62 ▼0.0494.59 ▲2.5443.62 ▼1.04
Posts /wp-admin/edit.php2,107 ▲71.95 ▼0.0741.34 ▼4.9136.80 ▼0.02
Add New Post /wp-admin/post-new.php1,532 ▲323.14 ▲0.32602.15 ▼15.0657.14 ▼5.38
Media Library /wp-admin/upload.php1,406 ▲64.20 ▼0.0195.53 ▼14.5841.17 ▼8.88

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/conditional-extra-fees-for-woocommerce/includes/pisol.class.form.php
    • > /wp-content/plugins/conditional-extra-fees-for-woocommerce/admin/help.php
  • 95× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'pisol_cefw_additional_charges_form' not found in wp-content/plugins/conditional-extra-fees-for-woocommerce/admin/additional-charges/template/shippingclass-quantity-based-charges.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/conditional-extra-fees-for-woocommerce/admin/selection_rules/rules/product_quantity.php:8
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/conditional-extra-fees-for-woocommerce/admin/additional-charges/template/category-subtotal-based-charges.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/conditional-extra-fees-for-woocommerce/admin/selection_rules/rules/selected_delivery_day.php:8
    • > PHP Warning
      Use of undefined constant PI_CEFW_SELECTION_RULE_SLUG - assumed 'PI_CEFW_SELECTION_RULE_SLUG' (this will throw an Error in a future version of PHP) in wp-content/plugins/conditional-extra-fees-for-woocommerce/admin/selection_rules/rules/selected_delivery_date.php on line 160
    • > PHP Warning
      Use of undefined constant PI_CEFW_SELECTION_RULE_SLUG - assumed 'PI_CEFW_SELECTION_RULE_SLUG' (this will throw an Error in a future version of PHP) in wp-content/plugins/conditional-extra-fees-for-woocommerce/admin/selection_rules/rules/cart-subtotal-before-discount.php on line 125
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/conditional-extra-fees-for-woocommerce/admin/additional-charges/template/quantity-based-charges.php on line 9
    • > PHP Warning
      Use of undefined constant PI_CEFW_SELECTION_RULE_SLUG - assumed 'PI_CEFW_SELECTION_RULE_SLUG' (this will throw an Error in a future version of PHP) in wp-content/plugins/conditional-extra-fees-for-woocommerce/admin/selection_rules/rules/product_quantity.php on line 311
    • > PHP Warning
      Use of undefined constant PI_CEFW_SELECTION_RULE_SLUG - assumed 'PI_CEFW_SELECTION_RULE_SLUG' (this will throw an Error in a future version of PHP) in wp-content/plugins/conditional-extra-fees-for-woocommerce/admin/selection_rules/rules/width.php on line 142
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/conditional-extra-fees-for-woocommerce/admin/additional-charges/template/category-weight-based-charges.php on line 9

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #6, #7 in conditional-extra-fees-for-woocommerce/assets to your readme.txt
  • Tags: There are too many tags (11 tag instead of maximum 10)
  • Donate link: Invalid URI ("piwebsolution.com")
The official readme.txt might help

conditional-extra-fees-for-woocommerce/conditional-fees-rule-woocommerce.php 85% from 13 tests

"Conditional cart fee / Extra charge rule for WooCommerce extra fees" version 1.1.20's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("conditional-extra-fees-for-woocommerce.php" instead of "conditional-fees-rule-woocommerce.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin21,048 lines of code in 91 files:
LanguageFilesBlank linesComment linesLines of code
CSS52,0787810,558
PHP731,5696356,389
SVG7863,461
JavaScript612376640

PHP code Passed 2 tests

This is a very shot review of 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.31
Average class complexity16.70
▷ Minimum class complexity1.00
▷ Maximum class complexity67.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes47
▷ Abstract classes00.00%
▷ Concrete classes47100.00%
▷ Final classes00.00%
Methods400
▷ Static methods6616.50%
▷ Public methods39498.50%
▷ Protected methods10.25%
▷ Private methods51.25%
Functions13
▷ Named functions1292.31%
▷ Anonymous functions17.69%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
40 PNG files occupy 0.61MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/images/ui-bg_glass_100_f6f6f6_1x400.png0.29KB0.12KB▼ 59.47%
admin/css/images/ui-bg_glass_55_1c1c1c_1x400.png0.29KB0.16KB▼ 45.15%
admin/css/images/ui-icons_bbbbbb_256x240.png6.91KB4.18KB▼ 39.46%
admin/additional-charges/image/shippingclass-quantity.png47.60KB13.71KB▼ 71.19%
admin/css/images/ui-bg_flat_65_ffffff_40x100.png0.24KB0.08KB▼ 64.78%