83% conditional-add-to-cart

Code Review | Conditional Add To Cart for WooCommerce

WordPress plugin Conditional Add To Cart for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: conditional-add-t...
  • Plugin version: 0.2.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 16, 2020
  • Latest release: Apr 4, 2023
  • Number of updates: 33
  • Update frequency: every 35.1 days
  • Top authors: nlemsieh (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

600+ active /7,048 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼4.41ms] Passed 4 tests

This is a short check of server-side resources used by Conditional Add To Cart for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1636.38 ▼3.09
Dashboard /wp-admin3.47 ▲0.1747.83 ▼2.33
Posts /wp-admin/edit.php3.58 ▲0.2346.42 ▲1.78
Add New Post /wp-admin/post-new.php6.07 ▲0.1890.34 ▼13.99
Media Library /wp-admin/upload.php3.39 ▲0.1637.05 ▲3.28
Conditional Add to Cart /wp-admin/admin.php?page=conditional-add-to-cart3.4134.99

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Conditional Add To Cart for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲9013.50 ▼0.882.05 ▲0.1740.95 ▼5.02
Dashboard /wp-admin2,217 ▲265.08 ▲0.21109.50 ▼4.6437.66 ▼12.20
Posts /wp-admin/edit.php2,103 ▲142.44 ▲0.4039.66 ▲0.0135.02 ▼2.32
Add New Post /wp-admin/post-new.php1,534 ▲2018.32 ▲0.77606.49 ▼17.7057.48 ▲7.71
Media Library /wp-admin/upload.php1,402 ▲144.44 ▲0.2098.04 ▼2.6641.73 ▼3.94
Conditional Add to Cart /wp-admin/admin.php?page=conditional-add-to-cart1,3045.53106.4528.18

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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 fix the following
  • 13× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_editor() in wp-content/plugins/conditional-add-to-cart/templates/action.php:46
    • > PHP Fatal error
      Uncaught Error: Class 'ConditionalAddToCart\\Conditions\\Condition' not found in wp-content/plugins/conditional-add-to-cart/includes/Conditions/ConditionProduct.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'ConditionalAddToCart\\Conditions\\Condition' not found in wp-content/plugins/conditional-add-to-cart/includes/Conditions/ConditionCategory.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'ConditionalAddToCart\\Conditions\\Condition' not found in wp-content/plugins/conditional-add-to-cart/includes/Conditions/ConditionCountry.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ConditionalAddToCart\\Conditions\\Condition' not found in wp-content/plugins/conditional-add-to-cart/includes/Conditions/ConditionUserRole.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ConditionalAddToCart\\Conditions\\Condition' not found in wp-content/plugins/conditional-add-to-cart/includes/Conditions/ConditionCartContainsProduct.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ConditionalAddToCart\\Conditions\\Condition' not found in wp-content/plugins/conditional-add-to-cart/includes/Conditions/ConditionSessionStatus.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ConditionalAddToCart\\Core\\Utility\\Condition' not found in wp-content/plugins/conditional-add-to-cart/templates/condition.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/conditional-add-to-cart/templates/settings.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'ConditionalAddToCart\\Conditions\\Condition' not found in wp-content/plugins/conditional-add-to-cart/includes/Conditions/ConditionCartSubtotal.php:6

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)
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Donate link: Invalid URI ("paypal.me/nlemsieh")
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
You can take inspiration from this readme.txt

conditional-add-to-cart/conditional-add-to-cart.php 85% from 13 tests

The main PHP script in "Conditional Add To Cart for WooCommerce" version 0.2.4 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Domain Path: The domain path folder was not found ("/languages")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,786 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP343794521,642
JavaScript22820109
CSS28035

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity7.71
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes24
▷ Abstract classes00.00%
▷ Concrete classes24100.00%
▷ Final classes00.00%
Methods124
▷ Static methods2721.77%
▷ Public methods12298.39%
▷ Protected methods10.81%
▷ Private methods10.81%
Functions30
▷ Named functions13.33%
▷ Anonymous functions2996.67%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin