78% woo-save-and-share-cart

Code Review | Save and Share Cart for WooCommerce

WordPress plugin Save and Share Cart for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: woo-save-and-shar...
  • Plugin version: 2.0.5
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.0.0
  • WordPress version: 6.3.1
  • First release: Nov 13, 2018
  • Latest release: Jun 21, 2022
  • Number of updates: 25
  • Update frequency: every 52.7 days
  • Top authors: wpgurudev (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

700+ active /8,691 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.20MB] [CPU: ▼17.03ms] Passed 4 tests

An overview of server-side resources used by Save and Share Cart for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4536.57 ▼8.18
Dashboard /wp-admin3.84 ▲0.4958.13 ▼11.80
Posts /wp-admin/edit.php3.89 ▲0.5361.65 ▲11.25
Add New Post /wp-admin/post-new.php3.66 ▼2.2354.24 ▼55.85
Media Library /wp-admin/upload.php3.70 ▲0.4747.23 ▲7.72
Add New /wp-admin/post-new.php?post_type=wcssc-cart3.6647.94
All Saved Carts /wp-admin/edit.php?post_type=wcssc-cart3.8151.53

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 224 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
wcssc_user

Browser metrics Passed 4 tests

A check of browser resources used by Save and Share Cart for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,481 ▼29014.32 ▼0.340.51 ▼1.5318.74 ▼26.31
Dashboard /wp-admin2,219 ▲395.62 ▲0.0587.21 ▼4.9740.39 ▼9.36
Posts /wp-admin/edit.php2,127 ▲272.03 ▲0.0240.85 ▲3.9733.20 ▼0.88
Add New Post /wp-admin/post-new.php1,549 ▲2321.18 ▼1.89673.89 ▼2.4765.49 ▲5.78
Media Library /wp-admin/upload.php1,427 ▲274.24 ▲0.05109.34 ▲8.1750.32 ▲2.87
Add New /wp-admin/post-new.php?post_type=wcssc-cart6,20422.56878.9430.76
All Saved Carts /wp-admin/edit.php?post_type=wcssc-cart1,1021.9736.8633.68

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • wcssc_user
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/post-new.php?post_type=wcssc-cart
    • > User notice in wp-includes/functions.php+5905
    Function register_rest_route was called incorrectly. REST API $args should be an array of arrays. Non-array value detected for wcssc/v1/get-link. Please see Debugging in WordPress for more information. (This message was added in version 6.1.0.)
    • > GET request to /wp-admin/post-new.php?post_type=wcssc-cart
    • > User notice in wp-includes/functions.php+5905
    Function register_rest_route was called incorrectly. REST API $args should be an array of arrays. Non-array value detected for wcssc/v1/save-cart. Please see Debugging in WordPress for more information. (This message was added in version 6.1.0.)
    • > GET request to /wp-admin/post-new.php?post_type=wcssc-cart
    • > User notice in wp-includes/functions.php+5905
    Function register_rest_route was called incorrectly. REST API $args should be an array of arrays. Non-array value detected for wcssc/v1/email-cart. Please see Debugging in WordPress for more information. (This message was added in version 6.1.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wcssc-cart
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 114× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-save-and-share-cart/vendor/phar-io/manifest/tests/xml/ComponentElementCollectionTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-save-and-share-cart/vendor/phar-io/manifest/tests/xml/LicenseElementTest.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Ankit\\WCSSC\\Section\\wp_die() in wp-content/plugins/woo-save-and-share-cart/Includes/Admin/Sections/SaveCart.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PharIo\\Version\\AbstractVersionConstraint' not found in wp-content/plugins/woo-save-and-share-cart/vendor/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'PharIo\\Manifest\\Exception' not found in wp-content/plugins/woo-save-and-share-cart/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'PharIo\\Version\\Exception' not found in wp-content/plugins/woo-save-and-share-cart/vendor/phar-io/version/src/exceptions/InvalidVersionException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\TypeFilter\\TypeFilter' not found in wp-content/plugins/woo-save-and-share-cart/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-save-and-share-cart/vendor/phar-io/manifest/tests/xml/RequiresElementTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-save-and-share-cart/vendor/phar-io/manifest/tests/values/BundledComponentCollectionTest.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-save-and-share-cart/vendor/phar-io/manifest/tests/exceptions/ManifestDocumentLoadingExceptionTest.php:8

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes: Please take inspiration from this readme.txt

woo-save-and-share-cart/woo-save-share-cart.php 85% from 13 tests

This is the main PHP file of "Save and Share Cart for WooCommerce" version 2.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-save-and-share-cart.php" instead of "woo-save-share-cart.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin9,501 lines of code in 204 files:
LanguageFilesBlank linesComment linesLines of code
PHP1731,4333,2136,493
JSON7502,019
Markdown51950327
CSS1530287
XML1294192
Ant217074
PO File1262965
YAML28136
JavaScript10518

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity2.58
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.46
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces24
Interfaces9
Traits0
Classes150
▷ Abstract classes32.00%
▷ Concrete classes14798.00%
▷ Final classes32.04%
Methods547
▷ Static methods254.57%
▷ Public methods47085.92%
▷ Protected methods274.94%
▷ Private methods509.14%
Functions20
▷ Named functions1470.00%
▷ Anonymous functions630.00%
Constants9
▷ Global constants555.56%
▷ Class constants444.44%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/myclabs/deep-copy/doc/clone.png12.09KB5.48KB▼ 54.70%
vendor/myclabs/deep-copy/doc/graph.png6.29KB3.03KB▼ 51.86%
vendor/myclabs/deep-copy/doc/deep-copy.png10.64KB5.23KB▼ 50.84%
vendor/myclabs/deep-copy/doc/deep-clone.png13.68KB6.54KB▼ 52.22%