[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cocart_get_cart is deprecated #305

Closed
6 of 12 tasks
boutzamat opened this issue Jan 27, 2022 · 1 comment
Closed
6 of 12 tasks

cocart_get_cart is deprecated #305

boutzamat opened this issue Jan 27, 2022 · 1 comment
Labels
priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc.

Comments

@boutzamat
Copy link
boutzamat commented Jan 27, 2022

Describe the bug

When fetching the cart via API (logged in user), WP generates an error in the error log:
2022/01/27 12:36:51 [error] 85459#85459: *4973 FastCGI sent in stderr: "PHP message: cocart_get_cart is deprecated since version 3.0.0 with no alternative available" while reading response header from upstream, client: 192.168.100.100, server: vuecommerce.lan, request: "GET /wp-json/cocart/v2/cart HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.1-fpm.sock:", host: "vuecommerce.lan", referrer: "http://sometestsite.lan/"

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • The issue still exists against the latest master branch of CoCart on GitHub (this is not the same version as on WordPress.org!)
  • I have attempted to find the simplest possible steps to reproduce the issue.
  • I have included a failing test as a pull request (Optional)
  • I have installed the requirements to run this plugin.

Steps to reproduce the issue

  1. Install CoCart lite + WC (latest version 6.1.1 as of right now)
  2. Make a request to the "get cart" endpoint: /wp-json/cocart/v2/cart
  3. Check the error log on the server

Expected/actual behaviour

The functionality actually works as intended, i experience no issues at all. The only real issue is that the error gets logged even if WP_DEBUG is set to false, which can lead to the log file growing too big in production.

Screenshots

Isolating the problem

  • This bug happens with only WooCommerce and CoCart plugin are active.
  • This bug happens with a default WordPress theme active.
  • This bug happens with the WordPress theme Storefront active.
  • This bug happens with the latest release of WooCommerce active.
  • This bug happens only when I authenticate as a customer.
  • This bug happens only when I authenticate as administrator.
  • I can reproduce this bug consistently using the steps above.

WordPress Environment

``` ` ### WordPress Environment ###

WordPress address (URL): http://vuecommerce.lan
Site address (URL): http://vuecommerce.lan
WC Version: 6.1.1
REST API Version: ✔ 6.1.1
WC Blocks Version: ✔ 6.5.2
Action Scheduler Version: ✔ 3.4.0
WC Admin Version: ✔ 3.0.3
Log Directory Writable: ✔
WP Version: 5.9
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: –
WP Cron: –
Language: en_US
External object cache: –

Server Environment

Server Info: nginx/1.14.2
PHP Version: 8.1.1
PHP Post Max Size: 8 MB
PHP Time Limit: 30
PHP Max Input Vars: 1000
cURL Version: 7.64.0
OpenSSL/1.1.1d

SUHOSIN Installed: –
MySQL Version: 5.5.5-10.3.31-MariaDB-0+deb10u1
Max Upload Size: 2 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ❌ Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected.
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Database

WC Database Version: 6.1.1
WC Database Prefix: wp_
Total Database Size: 4.60MB
Database Data Size: 3.12MB
Database Index Size: 1.48MB
wp_woocommerce_sessions: Data: 0.05MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_actions: Data: 0.02MB + Index: 0.11MB + Engine InnoDB
wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_logs: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_cocart_carts: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_options: Data: 2.03MB + Index: 0.06MB + Engine InnoDB
wp_postmeta: Data: 0.13MB + Index: 0.06MB + Engine InnoDB
wp_posts: Data: 0.06MB + Index: 0.06MB + Engine InnoDB
wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_usermeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wc_admin_notes: Data: 0.05MB + Index: 0.00MB + Engine InnoDB
wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB

Post Type Counts

attachment: 23
customize_changeset: 1
nav_menu_item: 5
page: 7
post: 2
product: 18
product_variation: 7
revision: 2
shop_coupon: 1
shop_order: 1

Security

Secure connection (HTTPS): ❌
Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates.
Hide errors from visitors: ✔

Active Plugins (3)

CoCart Lite: by Sébastien Dumont – 3.0.17
What The File: by Never5 – 1.5.4
WooCommerce: by Automattic – 6.1.1

Inactive Plugins (0)

Settings

API Enabled: –
Force SSL: –
Currency: DKK (DKK)
Currency Position: right_space
Thousand Separator: .
Decimal Separator: ,
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)

Connected to WooCommerce.com: –

WC Pages

Shop base: #6 - /shop/
Cart: #7 - /kurv/
Checkout: #8 - /kasse/
My account: #9 - /min-konto/
Terms and conditions: ❌ Page not set

Theme

Name: vuecommerce
Version: 1.0.0
Author URL: https://boutzamat.dk
Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
WooCommerce Support: ✔

Templates

Overrides: –

Action Scheduler

Complete: 29
Oldest: 2022-01-24 08:38:33 +0100
Newest: 2022-01-27 01:05:01 +0100

CoCart

Version: 3.0.17
Database Version: 3.0.17
Install Date: 26. January 2022
Carts in Session: 1
Carts Active: 1 out of 1 in session.
Carts Expiring Soon: 0 out of 1 in session.
Carts Expired: 0 out of 1 in session.
Carts Source (by CoCart): 0
Carts Source (by Web): 1
Carts Source (by Other): 0

Status report information

Generated at: 2022-01-27 13:57:51 +01:00
`

</details>

## Additional context

<!--Any additional context or details you think might be helpful.-->
@boutzamat boutzamat added the priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. label Jan 27, 2022
@seb86
Copy link
Member
seb86 commented Jan 28, 2022

This PR seems to have fixed the issue according to @boutzamat

Closing issue.

@seb86 seb86 closed this as completed Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc.
Projects
None yet
Development

No branches or pull requests

2 participants