67% conditional-logic-for-woo-product-add-ons

Code Review | Conditional Logic for Woo Product Add-ons

WordPress plugin Conditional Logic for Woo Product Add-ons scored67%from 54 tests.

About plugin

  • Plugin page: conditional-logic...
  • Plugin version: 2.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.4.0
  • WordPress version: 6.3.1
  • First release: Jan 27, 2023
  • Latest release: Nov 16, 2023
  • Number of updates: 9
  • Update frequency: every 32.8 days
  • Top authors: meowcrew (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /2,010 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.55MB] [CPU: ▼1.11ms] Passed 4 tests

A check of server-side resources used by Conditional Logic for Woo Product Add-ons
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.07 ▲0.6037.07 ▼3.03
Dashboard /wp-admin3.92 ▲0.6151.36 ▲4.26
Posts /wp-admin/edit.php3.97 ▲0.6154.00 ▲6.05
Add New Post /wp-admin/post-new.php6.44 ▲0.5589.95 ▼11.53
Media Library /wp-admin/upload.php3.68 ▲0.4537.29 ▲5.85
Contact Us /wp-admin/admin.php?page=clfwpao-contact-us3.7137.14
Conditional Logic for Woo Product Add-Ons /wp-admin/admin.php?page=conditional-logic-for-woocommerce-product-add-ons3.9141.49
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius4.0334.39
Freemius Account /wp-admin/admin.php?page=clfwpao-account4.3540.71

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 219 new files
Database: no new tables, 10 new options
New WordPress options
can_compress_scripts
recovery_mode_email_last_sent
widget_recent-posts
widget_theysaidso_widget
fs_active_plugins
db_upgraded
fs_accounts
widget_recent-comments
theysaidso_admin_options
fs_debug_mode

Browser metrics Passed 4 tests

An overview of browser requirements for Conditional Logic for Woo Product Add-ons
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲5114.32 ▲0.111.69 ▼0.1831.79 ▼12.18
Dashboard /wp-admin2,218 ▲385.63 ▲0.1092.97 ▲2.8745.71 ▲3.73
Posts /wp-admin/edit.php2,127 ▲272.13 ▲0.1142.26 ▲5.5938.83 ▲0.22
Add New Post /wp-admin/post-new.php1,537 ▲1023.08 ▲0.10616.95 ▲13.9855.73 ▼4.98
Media Library /wp-admin/upload.php1,414 ▲114.18 ▼0.0096.44 ▼2.7645.09 ▲3.41
Contact Us /wp-admin/admin.php?page=clfwpao-contact-us1,5623.0551.7188.37
Conditional Logic for Woo Product Add-Ons /wp-admin/admin.php?page=conditional-logic-for-woocommerce-product-add-ons9791.6525.6258.75
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0671.6926.5027.86
Freemius Account /wp-admin/admin.php?page=clfwpao-account7011.126.3121.26

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/conditional-logic-for-woo-product-add-ons/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 10 options in the database
    • fs_debug_mode
    • theysaidso_admin_options
    • fs_accounts
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • db_upgraded
    • widget_theysaidso_widget
    • fs_active_plugins
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=clfwpao-account
    • > Error in wp-content/plugins/conditional-logic-for-woo-product-add-ons/freemius/templates/account.php+47
    Uncaught Error: Call to a member function get_name() on bool in wp-content/plugins/conditional-logic-for-woo-product-add-ons/freemius/templates/account.php:47
    Stack trace:
    #0 wp-content/plugins/conditional-logic-for-woo-product-add-ons/freemius/includes/fs-core-functions.php(57): require()
    #1 wp-content/plugins/conditional-logic-for-woo-product-add-ons/freemius/includes/class-freemius.php(23459): fs_get_template()
    #2 wp-content/plugins/conditional-logic-for-woo-product-add-ons/license.php(57): Freemius->_account_page_render()
    #3 wp-includes/class-wp-hook.php(310): {closure}()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 {main}
    thrown

SRP 50% 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
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Trait 'MeowCrew\\AddonsConditions\\Core\\ServiceContainerTrait' not found in wp-content/plugins/conditional-logic-for-woo-product-add-ons/src/AddonsConditionsPlugin.php on line 16
    • > PHP Fatal error
      Trait 'MeowCrew\\AddonsConditions\\Core\\ServiceContainerTrait' not found in wp-content/plugins/conditional-logic-for-woo-product-add-ons/src/Frontend/AddToCartManager.php on line 10
    • > PHP Fatal error
      Trait 'MeowCrew\\AddonsConditions\\Core\\ServiceContainerTrait' not found in wp-content/plugins/conditional-logic-for-woo-product-add-ons/src/Admin/Admin.php on line 14
    • > PHP Fatal error
      Trait 'MeowCrew\\AddonsConditions\\Core\\ServiceContainerTrait' not found in wp-content/plugins/conditional-logic-for-woo-product-add-ons/src/Frontend/Frontend.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: product add-ons, woocommerce product fields, woocommerce, woocommerce product options, woocommerce product addons

conditional-logic-for-woo-product-add-ons/conditional-logic-for-product-addons.php 77% from 13 tests

The main PHP file in "Conditional Logic for Woo Product Add-ons" ver. 2.1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("conditional-logic-for-woo-product-add-ons.php" instead of "conditional-logic-for-product-addons.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: Please don't use more than 140 characters for the plugin description (currently 179 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin35,964 lines of code in 173 files:
LanguageFilesBlank linesComment linesLines of code
PHP1528,56918,08735,151
JavaScript519067643
PO File13943102
CSS1411663
JSON1005

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity71.36
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.51
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces6
Interfaces1
Traits1
Classes65
▷ Abstract classes23.08%
▷ Concrete classes6396.92%
▷ Final classes00.00%
Methods1,374
▷ Static methods23717.25%
▷ Public methods96670.31%
▷ Protected methods201.46%
▷ Private methods38828.24%
Functions111
▷ Named functions10190.99%
▷ Anonymous functions109.01%
Constants150
▷ Global constants9865.33%
▷ Class constants5234.67%
▷ Public constants52100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/conditional-logic-for-woocommerce-product-add-ons.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%