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

Deprecated function notice: wc_get_log_file_path #43

Open
garrettm30 opened this issue Jul 10, 2024 · 3 comments
Open

Deprecated function notice: wc_get_log_file_path #43

garrettm30 opened this issue Jul 10, 2024 · 3 comments

Comments

@garrettm30
Copy link

The old WooCommerce function wc_get_log_file_path(), used in seven locations in this 2Checkout plugin, is now deprecated, and it is throwing deprecation notices that fill up the error logs in the development environment.

[10-Jul-2024 20:34:55 UTC] PHP Deprecated: Function wc_get_log_file_path is deprecated since version 8.6.0 with no alternative available. in /Users/USERNAME/Sites/site.test/wp-includes/functions.php on line 6078
[10-Jul-2024 20:34:57 UTC] The wc_get_log_file_path function is deprecated since version 8.6.0.

In fact, it does not look like the function is actually being put to use, as they are passed as values in sprintf calls with strings that have no variables (unless they are added in translation?): For example:

sprintf(__('Log 2Checkout events', 'woocommerce'), wc_get_log_file_path('twocheckout'))

So to keep my error log clean on my end, I just removed the sprintf calls with the deprecated function and kept the translatable string part.

@dachilla
Copy link

dachilla commented Jul 12, 2024

Same here. Which version are you using?

I just updated to the latest version on a staging environment and the error persists.

I get random 503 errors due to this.

@garrettm30
Copy link
Author

Which version are you using?

I am using 2.3.1, the version that is the latest release here at GitHub as of February 8.

I get random 503 errors due to this.

A deprecation notice should not throw 503 errors. Have you checked your server PHP error log to see if any other error is there?

@dachilla
Copy link

[13-Jul-2024 02:05:10 UTC] PHP Notice: Undefined index: HASH in public_html/wp-content/plugins/twocheckout-inline/src/Twocheckout/class-two-checkout-ipn-helper.php on line 198

Ths is all I get. It's the only error showing in my logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants