83% cart-link-for-woocommerce

Code Review | Custom Cart Link for WooCommerce

WordPress plugin Custom Cart Link for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: cart-link-for-woo...
  • Plugin version: 1.5.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.4
  • WordPress version: 6.3.1
  • First release: Dec 30, 2021
  • Latest release: Nov 2, 2023
  • Number of updates: 30
  • Update frequency: every 22.9 days
  • Top authors: sebastian.pisula (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

500+ active /4,105 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.00MB] [CPU: ▼9.09ms] Passed 4 tests

Server-side resources used by Custom Cart Link for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.28 ▼9.23
Dashboard /wp-admin3.31 ▼0.0346.71 ▼14.45
Posts /wp-admin/edit.php3.36 ▲0.0145.17 ▼4.01
Add New Post /wp-admin/post-new.php5.89 ▲0.0193.35 ▼8.65
Media Library /wp-admin/upload.php3.24 ▲0.0135.23 ▼0.24

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 50 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Cart Link for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3314.34 ▼0.371.60 ▼0.0439.48 ▼3.96
Dashboard /wp-admin2,200 ▲225.48 ▼0.2588.59 ▼21.9339.91 ▼0.43
Posts /wp-admin/edit.php2,106 ▲62.00 ▲0.0039.88 ▼0.7036.47 ▼1.07
Add New Post /wp-admin/post-new.php1,533 ▲623.05 ▼0.14670.67 ▼6.7854.72 ▲1.50
Media Library /wp-admin/upload.php1,399 ▲54.19 ▲0.0199.69 ▲0.7142.59 ▲0.12

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Please fix the following items
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'IC\\Plugin\\CartLinkWooCommerce\\Campaign\\CampaignActions\\AbstractAction' not found in wp-content/plugins/cart-link-for-woocommerce/src/Campaign/CampaignActions/AddProductsAction.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/cart-link-for-woocommerce/views/html-metabox-actions.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/cart-link-for-woocommerce/src/Campaign/Metabox/Products/ProductsTable.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/cart-link-for-woocommerce/views/html-notice-woocommerce-required.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/cart-link-for-woocommerce/views/html-table-products.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/cart-link-for-woocommerce/views/html-notice-no-campaigns.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/cart-link-for-woocommerce/views/html-filter-campaign-field.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'IC\\Plugin\\CartLinkWooCommerce\\Campaign\\CampaignActions\\AbstractAction' not found in wp-content/plugins/cart-link-for-woocommerce/src/Campaign/CampaignActions/ClearCartAction.php:7

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed: You can look at the official readme.txt

cart-link-for-woocommerce/index.php 85% from 13 tests

The main PHP script in "Custom Cart Link for WooCommerce" version 1.5.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("cart-link-for-woocommerce.php" instead of "index.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 230 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin1,774 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
PHP444919551,767
JSON1005
CSS1001
JavaScript1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity5.97
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.03
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces10
Interfaces0
Traits0
Classes32
▷ Abstract classes13.12%
▷ Concrete classes3196.88%
▷ Final classes00.00%
Methods156
▷ Static methods1811.54%
▷ Public methods13989.10%
▷ Protected methods21.28%
▷ Private methods159.62%
Functions8
▷ Named functions337.50%
▷ Anonymous functions562.50%
Constants26
▷ Global constants00.00%
▷ Class constants26100.00%
▷ Public constants26100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin