Brian Henry
Forum Replies Created
-
Hey,
It caused me issues when I was regexing the hyperlinks from all the plugins. Yours was the only (of a test set of ~15) that used single quotes.
I just did some searching and it seems single quotes are valid HTML, double preferred ( https://google.github.io/styleguide/htmlcssguide.html#HTML_Quotation_Marks )
This validates at https://validator.w3.org/nu/#textarea
<!DOCTYPE html> <html lang="en"> <head> <title>Single quotes</title> </head> <body> <a href='https://example.com'>Single quotes</a> </body> </html>
My bad!
- This reply was modified 3 years, 2 months ago by Brian Henry.
Forum: Plugins
In reply to: [Sezzle Woocommerce Payment] Sezzle redirect URL UXThank you.
Forum: Plugins
In reply to: [Klaviyo] Undefined index in 2.5.0Thanks.
For now I added some checks, but I don’t know if the values’ absences causes problems elsewhere.
wck-cart-rebuild:138
$item = array( 'Quantity' => $values['quantity'], 'ProductID' => $parent_product_id, 'VariantID' => $product->get_id(), 'Name' => $product->get_name(), 'URL' => $product->get_permalink(), 'Images' => array( array( 'URL' => $image ) ), 'Categories' => $categories, 'Variation' => $values['variation'], ); if( isset( $values['line_subtotal'] ) ) { $item['SubTotal'] = $values['line_subtotal']; } if( isset( $values['line_subtotal_tax'] ) ) { $item['Total'] = $values['line_subtotal_tax']; } if( isset( $values['line_total'] ) ) { $item['LineTotal'] = $values['line_total']; } if( isset($values['line_tax'] ) ) { $item['Tax'] = $values['line_tax']; } if( isset($values['line_total'] ) && isset( $values['line_tax'] ) ) { $item['TotalWithTax'] = $values['line_total'] + $values['line_tax']; } $event_data['$extra']['Items'][] = $item;
`
Forum: Plugins
In reply to: [Woo Manage Fraud Orders] Issue with pluginI’m also looking into this.
I wrote the changes in the recent update:
https://github.com/prasidhda/woo-manage-fraud-orders/pull/13/filesI also wrote a set of tests to help ensure nothing would break:
https://github.com/prasidhda/woo-manage-fraud-orders/tree/master/tests/e2e/specsRight now, I don’t see particularly why anything has broken, but I plan to look into it more again tomorrow. If you can give more detail of your configuration and the details of the user when their order was rejected, we’ll be able to create a test case so this never happens again.
I see from your post history you’re relative technically competent, so rest assured, we’re working on it!
Forum: Plugins
In reply to: [Woo Manage Fraud Orders] Cannot ActivateIt’s not good practice to trigger a fatal error (or to use
die
orexit
).trigger_error() found. Debug code should not normally be used in production. (WordPress.PHP.DevelopmentFunctions.error_log_trigger_error)
Imagine you’re troubleshooting a problem on a site. You disable all the plugins, address the cause of the problem and are about to re-enable all the plugins. So you select-all on the plugins screen, and choose enable. Any plugins that come alphabetically before WooCommerce will be activated before it. If they check for WooCommerce and trigger a fatal error, the process stops and no further plugins are activated, even though the user wanted to activate all their plugins including WooCommerce.
I’ve had this happen on a live site and it just added to the stress of fixing the issue.
So why do plugins do this check? It’s partly so WooCommerce’s functions (e.g.
wc_get_order()
) aren’t accessed when WooCommerce’s files have not been loaded. The correct way to get around this is to use WooCommerce’s hooks – i.e. you can safely infer that WooCommerce is loaded when your code is running on the ‘woocommerce_process_shop_order_meta’ hook!If a plugin wants to communicate to a user that a required plugin is missing, a much better way is to use an admin notice. Even then, I don’t think a plugin like this, with “Woo” in its name, really needs to tell the users they need WooCommerce!
I’ll open a PR to remove this if it’s welcome.
Forum: Plugins
In reply to: [Set WooCommerce Payment Gateway by URL] amzon pay pluggin conflictHey,
So it turns out I had come across the problem but not pushed the fix to www.remarpro.com
If you edit
bh-wc-set-gateway-by-url/includes/class-bh-wc-set-gateway-by-url.php
Line 145 to change fromwoocommerce_init
towoocommerce_loaded
, I think it should work.I’m working on some tests for the plugin and will release an updated, fixed version very soon.
Forum: Plugins
In reply to: [Set WooCommerce Payment Gateway by URL] amzon pay pluggin conflictIt’s not a known issue, thanks for reporting. I’ll try get it fixed in the next week.
I took a look at
functions.php(4107)
– another plugin must be settingREST_REQUEST
to true.From
grep
, it looks to bewoocommerce-zapier
or (less likely) WooCommerce itself.Forum: Plugins
In reply to: [Magic Emails & Autologin URLs] got ForbiddenCould you post the URL (without the domain) and I’ll be able to understand a bit better.
The error message itself is from the web server rather than WordPress. So maybe how the plugin is modifying the URL is breaking it. Once I see the URL I should be able to fix it.
Thanks.
Thanks. I’ll check it out during the week.
Hey,
Thanks for your reply. After your message I updated our plugin (now at 3.5.1). We’re still getting in our logs (as above):
PHP Deprecated: media_buttons_context is <strong>deprecated</strong> since version 3.5.0! Use media_buttons instead. in /path/to/wp-includes/functions.php on line 5234
To be clear: I’m on PHP 7.4. I just replied to this PHP 8 thread because the log messages matched.
An error handler surrounding your own code, as suggested above, only checks for errors that occur while your own code is executing.
It would be but hubris to leave it out, knowing now what problems can occur.
Add this to the beginning of your deactivator:
$fopen_error_handler = function ( $errno, $errstr, $errfile, $errline ) { if ( false !== strpos( $errstr, "failed to open stream: Too many open files" ) ) { die(); } return false; }; set_error_handler( $fopen_error_handler, E_ALL );
And add this to its end:
restore_error_handler();
And YOU can help users avoid the issues your plugin is documented as causing.
“we didn’t design the car to do that, it was the road’s fault. We don’t need to add seatbelts.”
- This reply was modified 3 years, 9 months ago by Brian Henry.
> We do not disable other plugins in ANY case.
You don’t mean to. But you definitely do.
The problem appears to be accidental
$$
on line 631:if($cit!='MWQBO_5min' && $$cit!='MWQBO_10min' && $cit!='MWQBO_30min' && $cit!='MWQBO_60min'){
should be
if($cit!='MWQBO_5min' && $cit!='MWQBO_10min' && $cit!='MWQBO_30min' && $cit!='MWQBO_60min'){