68% wc-j-upsellator

Code Review | J Cart Upsell and Cross-sell for WooCommerce

WordPress plugin J Cart Upsell and Cross-sell for WooCommerce scored68%from 54 tests.

About plugin

  • Plugin page: wc-j-upsellator
  • Plugin version: 3.4.7
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Apr 2, 2021
  • Latest release: Nov 10, 2023
  • Number of updates: 102
  • Update frequency: every 9.3 days
  • Top authors: jakjako (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

100+ active /6,522 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.43MB] [CPU: ▼2.93ms] Passed 4 tests

An overview of server-side resources used by J Cart Upsell and Cross-sell for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4436.98 ▼4.52
Dashboard /wp-admin3.74 ▲0.4049.66 ▼9.04
Posts /wp-admin/edit.php3.79 ▲0.4451.79 ▲9.96
Add New Post /wp-admin/post-new.php6.42 ▲0.5486.26 ▼4.96
Media Library /wp-admin/upload.php3.67 ▲0.4337.71 ▲6.82
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius4.0235.06

Server storage [IO: ▲4.58MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 320 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
fs_active_plugins
fs_debug_mode
can_compress_scripts
fs_accounts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

J Cart Upsell and Cross-sell for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲9614.05 ▼0.311.53 ▼0.1227.74 ▼16.26
Dashboard /wp-admin2,251 ▲745.66 ▲0.0486.44 ▲0.7745.15 ▲6.03
Posts /wp-admin/edit.php2,153 ▲532.12 ▲0.1737.56 ▲1.2134.86 ▲5.08
Add New Post /wp-admin/post-new.php1,550 ▲2122.96 ▼0.23636.04 ▲17.7461.25 ▲8.60
Media Library /wp-admin/upload.php1,447 ▲534.30 ▲0.1295.24 ▼0.9243.93 ▲2.71
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,1011.6522.7126.48

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/wc-j-upsellator/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 9 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • fs_active_plugins
    • fs_accounts
    • can_compress_scripts
    • widget_recent-comments
    • fs_debug_mode

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wc-j-upsellator/templates/modal/footer.php
    • > /wp-content/plugins/wc-j-upsellator/templates/modal/notices.php
  • 34× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function woo_j_env() in wp-content/plugins/wc-j-upsellator/config/configuration.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_price_decimals() in wp-content/plugins/wc-j-upsellator/views/wctimeline_total_placeholder.template.php:2
    • > PHP Notice
      Undefined variable: items in wp-content/plugins/wc-j-upsellator/templates/modal/footer.php on line 3
    • > PHP Notice
      Undefined variable: triggerable_gifts in wp-content/plugins/wc-j-upsellator/views/partials/wctimeline_items_list.template.php on line 146
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wc-j-upsellator/views/partials/wctimeline_items_list.template.php on line 5
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/wc-j-upsellator/views/partials/wctimeline_items_list.template.php on line 146
    • > PHP Notice
      Undefined variable: upsells in wp-content/plugins/wc-j-upsellator/views/partials/wctimeline_items_list.template.php on line 158
    • > PHP Fatal error
      Uncaught Error: Call to a member function render() on null in wp-content/plugins/wc-j-upsellator/views/partials/wctimeline_items_list.template.php:158
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wc-j-upsellator/app/Shortcodes/DynamicBar.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wc-j-upsellator/app/Shortcodes/Upsells.php:5

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

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention: You can look at the official readme.txt

wc-j-upsellator/wc-j-upsellator.php 92% from 13 tests

The main PHP file in "J Cart Upsell and Cross-sell for WooCommerce" ver. 3.4.7 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin49,422 lines of code in 250 files:
LanguageFilesBlank linesComment linesLines of code
PHP21310,36218,17442,746
CSS17555693,699
JavaScript16580911,538
PO File14757121,282
SVG2380109
JSON11048

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
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.58
Average class complexity47.85
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.24
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces14
Interfaces1
Traits7
Classes99
▷ Abstract classes33.03%
▷ Concrete classes9696.97%
▷ Final classes11.04%
Methods1,577
▷ Static methods22514.27%
▷ Public methods1,08768.93%
▷ Protected methods493.11%
▷ Private methods44127.96%
Functions135
▷ Named functions12794.07%
▷ Anonymous functions85.93%
Constants165
▷ Global constants10463.03%
▷ Class constants6136.97%
▷ Public constants61100.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
15 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png5.68KB1.83KB▼ 67.77%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/buy-me-a-coffee.png2.36KB2.38KB0.00%
assets/admin/css/images/ui-icons_ffffff_256x240.png6.33KB4.18KB▼ 33.99%
assets/admin/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png0.32KB0.18KB▼ 42.38%