56% surecart

Code Review | WordPress Ecommerce For Creating Fast Online Stores - By SureCart

WordPress plugin WordPress Ecommerce For Creating Fast Online Stores - By SureCart scored56%from 54 tests.

About plugin

  • Plugin page: surecart
  • Plugin version: 2.11.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: Jul 20, 2022
  • Latest release: Dec 2, 2023
  • Number of updates: 209
  • Update frequency: every 2.4 days
  • Top authors: 2winfactor (100%)

Code review

54 tests

User reviews

145 reviews

Install metrics

9,000+ active /340,577 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲8.17MB] [CPU: ▲72.31ms] 50% from 4 tests

An overview of server-side resources used by WordPress Ecommerce For Creating Fast Online Stores - By SureCart
It is recommended to improve the following
  • RAM: Try to keep total memory usage under 10MB (currently 15.31MB on /wp-admin/site-editor.php?path=/wp_template_part/all)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 8.17MB on /wp-admin/site-editor.php?path=/wp_template_part/all)
PageMemory (MB)CPU Time (ms)
Home /11.44 ▲7.9890.04 ▲45.29
Dashboard /wp-admin11.49 ▲8.18121.57 ▲66.80
Posts /wp-admin/edit.php11.62 ▲8.26129.35 ▲82.34
Add New Post /wp-admin/post-new.php15.35 ▲9.46201.34 ▲110.52
Media Library /wp-admin/upload.php11.49 ▲8.26128.80 ▲94.80
Complete Signup /wp-admin/admin.php?page=sc-complete-signup11.64114.66
Scheduled Actions /wp-admin/tools.php?page=action-scheduler11.72123.98
Settings /wp-admin/admin.php?page=sc-settings11.71115.00
Get Started /wp-admin/admin.php?page=sc-getting-started11.63109.76
Template Parts /wp-admin/site-editor.php?path=/wp_template_part/all15.31161.81

Server storage [IO: ▲63.85MB] [DB: ▲0.04MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
These are issues you should consider
  • Filesystem usage must be lower than 25MB (currently using 63.85MB)
Filesystem: 5,859 new files
Database: 6 new tables, 18 new options
New tables
wp_actionscheduler_logs
wp_actionscheduler_actions
wp_actionscheduler_groups
wp_surecart_integrations
wp_actionscheduler_claims
wp_surecart_incoming_webhooks
New WordPress options
widget_recent-comments
surecart_integrations_database_version
db_upgraded
surecart_checkout_page_id
surecart_shop_page_id
widget_theysaidso_widget
action_scheduler_hybrid_store_demarkation
surecart_cart_sc_cart_id
can_compress_scripts
surecart_incoming_webhooks_database_version
...

Browser metrics Passed 4 tests

A check of browser resources used by WordPress Ecommerce For Creating Fast Online Stores - By SureCart
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,260 ▲47315.15 ▲0.8031.36 ▲29.5640.37 ▼2.28
Dashboard /wp-admin2,260 ▲835.52 ▼0.0383.14 ▼16.7639.26 ▼14.48
Posts /wp-admin/edit.php2,169 ▲692.02 ▼0.0640.37 ▼3.9638.06 ▼2.16
Add New Post /wp-admin/post-new.php1,656 ▲11120.10 ▼4.82742.02 ▲65.4665.59 ▼1.42
Media Library /wp-admin/upload.php1,468 ▲684.27 ▲0.0498.65 ▲3.2843.93 ▲1.90
Complete Signup /wp-admin/admin.php?page=sc-complete-signup1,0383.3642.4551.52
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,3171.7937.3035.18
Settings /wp-admin/admin.php?page=sc-settings1,91313.20275.57171.69
Get Started /wp-admin/admin.php?page=sc-getting-started1,39612.04135.7741.41
Template Parts /wp-admin/site-editor.php?path=/wp_template_part/all1,05918.81404.1628.39

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure failed, leaving 6 tables in the database
    • wp_actionscheduler_actions
    • wp_actionscheduler_logs
    • wp_actionscheduler_groups
    • wp_surecart_integrations
    • wp_surecart_incoming_webhooks
    • wp_actionscheduler_claims
  • Zombie WordPress options were found after uninstall: 19 options
    • theysaidso_admin_options
    • can_compress_scripts
    • surecart_shop_page_id
    • surecart_dashboard_page_id
    • surecart_incoming_webhooks_database_version
    • widget_theysaidso_widget
    • surecart_checkout_page_id
    • action_scheduler_hybrid_store_demarkation
    • surecart_checkout_sc_form_id
    • widget_recent-posts
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/site-editor.php?path=/wp_template_part/all
    • > Notice in wp-content/plugins/surecart/app/src/WordPress/Assets/AssetsService.php+104
    Trying to get property 'wordpress_plugin_tracking_enabled' of non-object

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 items
  • 15× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/surecart/views/admin/customers/edit.php
    • > /wp-content/plugins/surecart/views/admin/products/edit.php
    • > /wp-content/plugins/surecart/views/layouts/partials/admin-settings-styles.php
    • > /wp-content/plugins/surecart/views/admin/abandoned-orders/edit.php
    • > /wp-content/plugins/surecart/views/admin/licenses/edit.php
    • > /wp-content/plugins/surecart/views/admin/upgrade-paths/edit.php
    • > /wp-content/plugins/surecart/views/layouts/partials/admin-header.php
    • > /wp-content/plugins/surecart/views/layouts/partials/customer-dashboard/dashboard-navigation.php
    • > /wp-content/plugins/surecart/views/admin/invoices/edit.php
    • > /wp-content/plugins/surecart/views/admin/subscriptions/edit.php
  • 709× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'SureCartBlocks\\Controllers\\BaseController' not found in wp-content/plugins/surecart/packages/blocks/Controllers/SubscriptionController.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'SureCart\\Rest\\RestServiceProvider' not found in wp-content/plugins/surecart/app/src/Rest/OrderRestServiceProvider.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_RecurringSchedule' not found in wp-content/plugins/surecart/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_IntervalSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'SureCart\\Models\\Model' not found in wp-content/plugins/surecart/app/src/Models/Account.php:8
    • > PHP Fatal error
      Trait 'SureCartAppCore\\Concerns\\ReadsJsonTrait' not found in wp-content/plugins/surecart/core/app-core/src/Config/Config.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Store_Deprecated' not found in wp-content/plugins/surecart/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Store.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'SureCartCore\\Helpers\\HasAttributesInterface' not found in wp-content/plugins/surecart/core/core/src/Routing/RouteInterface.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'SureCart\\Permissions\\Models\\ModelPermissionsController' not found in wp-content/plugins/surecart/app/src/Permissions/Models/CustomerPermissionsController.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'SureCartCore\\ServiceProviders\\ServiceProviderInterface' not found in wp-content/plugins/surecart/packages/blocks/Blocks/BlockServiceProvider.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'SureCart\\Models\\Model' not found in wp-content/plugins/surecart/app/src/Models/ShippingMethod.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/site-editor.php?path=/wp_template_part/all
    • > Console-api (severe) in wp-includes/js/dist/data.min.js?ver=ff7eb3945f963be850ff+1:19276
    Store \"core/interface\" is already registered.

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: elementor, learndash, cart, beaver builder, stripe...

surecart/surecart.php Passed 13 tests

The main file in "WordPress Ecommerce For Creating Fast Online Stores - By SureCart" v. 2.11.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
115 characters long description:
A simple yet powerful headless e-commerce platform designed to grow your business with effortlessly selling online.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected469,294 lines of code in 3,782 files:
LanguageFilesBlank linesComment linesLines of code
PO File2373,117115,874187,860
JSON13300115,692
JavaScript1,4843,8139,77574,204
PHP1,10711,89736,89352,649
CSS1721,73575518,441
TypeScript5012067,89013,502
SVG331314,706
Markdown1685301,848
YAML9587250
reStructuredText19613997
HTML4296729
XML12016

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity5.50
▷ Minimum class complexity1.00
▷ Maximum class complexity96.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces187
Interfaces47
Traits40
Classes865
▷ Abstract classes354.05%
▷ Concrete classes83095.95%
▷ Final classes131.57%
Methods4,159
▷ Static methods3849.23%
▷ Public methods3,56685.74%
▷ Protected methods47211.35%
▷ Private methods1212.91%
Functions394
▷ Named functions4812.18%
▷ Anonymous functions34687.82%
Constants99
▷ Global constants3737.37%
▷ Class constants6262.63%
▷ Public constants6198.39%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
17 PNG files occupy 2.49MB with 1.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/forms/default.png146.11KB55.20KB▼ 62.22%
templates/forms/sections.png123.55KB47.93KB▼ 61.21%
images/abandoned-hero.png35.32KB34.71KB▼ 1.73%
images/starter-templates/scratch.png83.22KB33.88KB▼ 59.28%
templates/forms/full-page.png150.14KB61.74KB▼ 58.88%