48% studiocart

Code Review | eCommerce Shopping Cart and Funnel Builder - Studiocart

WordPress plugin eCommerce Shopping Cart and Funnel Builder - Studiocart scored 48% from 54 tests.

About plugin

  • Plugin page: studiocart
  • Plugin version: 2.5.20
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.1-6.2
  • WordPress version: 6.3.1
  • First release: Apr 26, 2020
  • Latest release: Jul 5, 2023
  • Number of updates: 25
  • Update frequency: every 46.7 days
  • Top authors: ncstudio (96%)creativenicci (8%)

Code review

54 tests

User reviews

7 reviews

Install metrics

70+ active / 5,018 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲1.45MB] [CPU: ▲15.27ms] Passed 4 tests

Server-side resources used by eCommerce Shopping Cart and Funnel Builder - Studiocart
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /6.20 ▲2.7457.34 ▲14.73
Dashboard /wp-admin4.72 ▲1.4262.49 ▲14.96
Posts /wp-admin/edit.php4.80 ▲1.4461.76 ▲13.95
Add New Post /wp-admin/post-new.php7.38 ▲1.49113.13 ▲17.42
Media Library /wp-admin/upload.php4.66 ▲1.4460.68 ▲26.66
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius5.0252.22

Server storage [IO: ▲8.79MB] [DB: ▲0.02MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 633 new files
Database: 1 new table, 12 new options
New tables
wp_ncs_tax_rate
New WordPress options
theysaidso_admin_options
_sc_api_key
fs_active_plugins
_sc_log_file
can_compress_scripts
widget_theysaidso_widget
fs_accounts
db_upgraded
widget_recent-comments
fs_debug_mode
...

Browser metrics Passed 4 tests

A check of browser resources used by eCommerce Shopping Cart and Funnel Builder - Studiocart
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,997 ▲24014.06 ▼0.3512.27 ▲10.1333.57 ▼11.38
Dashboard /wp-admin2,253 ▲655.86 ▲0.9897.13 ▼4.8043.14 ▼2.75
Posts /wp-admin/edit.php2,139 ▲502.02 ▲0.0335.94 ▼0.4538.43 ▲2.52
Add New Post /wp-admin/post-new.php1,552 ▲1923.40 ▲0.26611.97 ▼63.4046.66 ▼7.05
Media Library /wp-admin/upload.php1,435 ▲504.23 ▲0.03105.60 ▲6.6553.51 ▲4.30
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0981.7127.4930.43

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/studiocart/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie tables were found after uninstall: 1 table
    • wp_ncs_tax_rate
  • This plugin did not uninstall successfully, leaving 12 options in the database
    • _sc_log_file
    • fs_debug_mode
    • _sc_decimal_number
    • db_upgraded
    • _sc_api_key
    • fs_active_plugins
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • fs_accounts
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 7× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/studiocart/includes/vendor/activecampaign/api-php/examples.php
    • > /wp-content/plugins/studiocart/models/ScrtSubscription.php
    • > /wp-content/plugins/studiocart/models/ScrtOrder.php
    • > /wp-content/plugins/studiocart/includes/vendor/stripe/stripe-php/update_certs.php
    • > /wp-content/plugins/studiocart/public/partials/ncs-cart-public-display.php
    • > /wp-content/plugins/studiocart/admin/partials/ncs-cart-admin-section-messages.php
    • > /wp-content/plugins/studiocart/includes/vendor/stripe/stripe-php/build.php
  • 317× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/studiocart/public/templates/my-account/forms/change-card.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/studiocart/includes/vendor/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php:7
    • > PHP Notice
      Undefined variable: count in wp-content/plugins/studiocart/admin/partials/ncs-cart-admin-field-repeater.php on line 25
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/studiocart/includes/vendor/stripe/stripe-php/lib/Service/MandateService.php:7
    • > PHP Notice
      Undefined index: mc_currency in wp-content/plugins/studiocart/public/webhooks/paypal.php on line 78
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/studiocart/public/templates/checkout-shortcode-2-step.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/studiocart/includes/vendor/stripe/stripe-php/lib/SetupAttempt.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/studiocart/includes/vendor/stripe/stripe-php/lib/Service/PriceService.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/studiocart/public/templates/order-confirmation.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/studiocart/includes/vendor/stripe/stripe-php/lib/Service/AccountService.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: sales funnel, ecommerce, shopping cart, elementor

studiocart/studiocart.php 85% from 13 tests

The main file in "eCommerce Shopping Cart and Funnel Builder - Studiocart" v. 2.5.20 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 142 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
It is important to fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/studiocart/includes/vendor/stripe/stripe-php/data/ca-certificates.crt
124,053 lines of code in 557 files:
LanguageFilesBlank linesComment linesLines of code
PHP47214,71030,90775,389
JSON122034,354
JavaScript241,0941,2826,102
CSS2754683,197
Sass254503,025
Markdown71,03301,828
JSX212970
XML10031
SVG70023
make18023
Bourne Shell1308
YAML1003

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity22.46
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces29
Interfaces9
Traits7
Classes324
▷ Abstract classes123.70%
▷ Concrete classes31296.30%
▷ Final classes00.00%
Methods2,689
▷ Static methods43316.10%
▷ Public methods2,11378.58%
▷ Protected methods572.12%
▷ Private methods51919.30%
Functions273
▷ Named functions24589.74%
▷ Anonymous functions2810.26%
Constants924
▷ Global constants10811.69%
▷ Class constants81688.31%
▷ Public constants816100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.17MB with 0.10MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/checkmark.png150.34KB13.27KB▼ 91.18%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%