eriktdesign
Forum Replies Created
-
Adding on — we also found the plugin to cause this issue on one of our client sites this morning.
Forum: Plugins
In reply to: [LearnDash LMS - Reports] The response is not a valid JSON response.Still waiting to hear back on this issue.
Forum: Plugins
In reply to: [LearnDash LMS - Reports] The response is not a valid JSON response.Any update?
Forum: Plugins
In reply to: [LearnDash LMS - Reports] The response is not a valid JSON response.Hi there,
- Number of users: ~14,000
- Server specifications: This site is hosted on Pantheon, on a Performance Medium plan.
- Memory: 512mb
- Application containers: 2
- PHP Workers: 16
- CPU: Don’t know, Pantheon doesn’t advertise this information. It should be pretty beefy though.
Forum: Plugins
In reply to: [LearnDash LMS - Reports] The response is not a valid JSON response.I wound up kludging a redirect into the site to make the API endpoint go to the right place, but the report is still not getting any data. Can I have some assistance on this?
Hi @rainfallnixfig,
Sorry this took a bit — had to wait for this to come back up in my stack. Here are the System Status report and a selection from the Stripe log.
System status: https://pastebin.com/X0zUcBVA
Selected stripe logs (redacted): https://pastebin.com/MHnNNvfu
Forum: Plugins
In reply to: [Sequential Order Number for WooCommerce] Order Number issue with Amazon PayYeah, it looks like the IPN fails without also adding some kind of filter in the plugin there. I added a PR to the repo: https://github.com/woocommerce/woocommerce-gateway-amazon-pay/pull/133
Forum: Plugins
In reply to: [Sequential Order Number for WooCommerce] Order Number issue with Amazon PayOr maybe yours _will_ work and I’m just tired. I’m going to do some testing with both.
Forum: Plugins
In reply to: [Sequential Order Number for WooCommerce] Order Number issue with Amazon Pay@jurgen-oldenburg Eyyyyy that’s a nice find. I was looking inside the
WC_Amazon_Payments_Advanced_API::get_merchant_metadata()
function and wanting a filter in there, but I see that the filter you found is just after the call to that function — nice.Some notes/thoughts —
* It looks like that filter isn’t applied on scheduled subscription payments, so this solution probably won’t work right with Subscription stores
* Oops, and here I see why I didn’t see that filter — it doesn’t get applied when running an _authorization_ in theWC_Gateway_Amazon_Payments_Advanced::perform_authorization()
function, only when it’s a capture (the store I’m debugging this for uses authorize -> capture on complete).
* I have no idea the implications of this for IPN functionality — mostly because I don’t really know what this plugin uses IPN for. I think just hotwiring the order number in at the payload stage will cause issues if the order subsequently gets updated via the IPN update method because the order ID coming back from the Amazon API won’t match the database.I’m working on some adjustments of my own to make this work in our situation, and I’ll share here since this is the only relevant thread I’ve found. I’m planning on submitting a pull request on the Amazon Pay plugin github to request some filters be added so we can do this kind of thing without hacking the plugin.
So, first I’m adding a filter to the
WC_Amazon_Payments_Advanced_API::get_merchant_metadata()
function, making the return statement look like this:return apply_filters( 'woocommerce_amazon_pa_merchant_metadata', array( 'merchantReferenceId' => $order_id, 'merchantStoreName' => WC_Amazon_Payments_Advanced::get_site_name(), 'customInformation' => $version_note, ) );
Then I’m adding another filter to
WC_Amazon_Payments_Advanced_IPN_Handler::handle_notification_ipn_v2()
after the first switch statement (line 439) that allows us to filter the order ID that’s coming in from IPN:$order_id = apply_filters( 'woocommerce_amazon_pa_ipn_order_id', $order_id );
Annoyingly, there’s already a filter on the
$order
object right below that on line 446, but theis_numeric
check above that will already dump out of the function if the order number returned by the API isn’t numeric (we use a alpha prefix for ours, so no bueno).So anyway, with those two filters added, I’ve popped these two functions into a plugin:
/** * Use the WooCommerce Sequential Order Numbers Pro order number for Amazon API * * @param array $metadata Metadata array that goes to the Amazon API * @return array Filtered data with the merchantReferenceId replaced */ function apcc_use_sequential_order_number_on_submit( $metadata ) { $order = wc_get_order( $metadata['merchantReferenceId'] ); $metadata['merchantReferenceId'] = $order->get_order_number(); return $metadata; } add_filter( 'woocommerce_amazon_pa_merchant_metadata', 'apcc_use_sequential_order_number_on_submit' ); /** * Lookup the IPN requested order by the sequential order number and return the order id * * @param string $order_id merchantReferenceId returned from the API * @return int Internal order ID */ function apcc_lookup_order_by_seq_order_number( $order_number ) { // Use the WooCommerce Sequential Order Numbers Pro helper function to look up the order ID $order_id = wc_seq_order_number_pro()->find_order_by_order_number( $order_number ); // If an order ID is found, return it to the filter if ( $order_id ) return $order_id; // If it wasn't found, this might not be a sequential order number, so sent it back as-is else return $order_number; } add_filter( 'woocommerce_amazon_pa_ipn_order_id', 'apcc_lookup_order_by_seq_order_number' );
This code is actually set up for the _other_ Sequential Order Numbers plugin (sorry @webtoffee I’m sure this one is great too!), but the line with
wc_seq_order_number_pro()->find_order_by_order_number( $order_number )
line can be replaced with whatever function is used to look up orders by the sequential order number in the Webtoffee plugin.I’ve done initial testing with this code in an Amazon Pay sandbox. I’m going to write some of this up and drop it on their Github as well.
Thanks for your work on this — I got so hopeful that with your solution there was a simpler way to do this than mine, but looks like not quite!
- This reply was modified 2 years, 11 months ago by eriktdesign. Reason: formatting
Forum: Plugins
In reply to: [301 Redirects - Easy Redirect Manager] 500 Error loading plugin pageHi,
The plugin was previously installed by another developer. When I re-installed and activated it, I got the 500 error. (Note, this is only on the plugin options page). I deleted the table the plugin was using in the database and reactivated, but that didn’t work.
It’s an e-commerce site with a reasonably large number of Woocommerce products.
Forum: Plugins
In reply to: [301 Redirects - Easy Redirect Manager] 500 Error loading plugin pagePHP error log, with stack trace:
`
[22-Jan-2020 14:37:39 UTC] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 536576 bytes) in /Users/erik/Local Sites/schweitzer/app/public/wp-includes/functions.php on line 4552
[22-Jan-2020 14:37:39 UTC] PHP Stack trace:
[22-Jan-2020 14:37:39 UTC] PHP 1. {main}() /Users/erik/Local Sites/schweitzer/app/public/wp-admin/options-general.php:0
[22-Jan-2020 14:37:39 UTC] PHP 2. require_once() /Users/erik/Local Sites/schweitzer/app/public/wp-admin/options-general.php:10
[22-Jan-2020 14:37:39 UTC] PHP 3. do_action() /Users/erik/Local Sites/schweitzer/app/public/wp-admin/admin.php:254
[22-Jan-2020 14:37:39 UTC] PHP 4. WP_Hook->do_action() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/plugin.php:478
[22-Jan-2020 14:37:39 UTC] PHP 5. WP_Hook->apply_filters() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/class-wp-hook.php:312
[22-Jan-2020 14:37:39 UTC] PHP 6. EPS_Redirects_Plugin_Options->do_admin_page() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/class-wp-hook.php:288
[22-Jan-2020 14:37:39 UTC] PHP 7. EPS_Redirects_Plugin_Options->get_tab() /Users/erik/Local Sites/schweitzer/app/public/wp-content/plugins/eps-301-redirects/libs/eps-plugin-options.php:278
[22-Jan-2020 14:37:39 UTC] PHP 8. do_action() /Users/erik/Local Sites/schweitzer/app/public/wp-content/plugins/eps-301-redirects/libs/eps-plugin-options.php:321
[22-Jan-2020 14:37:39 UTC] PHP 9. WP_Hook->do_action() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/plugin.php:478
[22-Jan-2020 14:37:39 UTC] PHP 10. WP_Hook->apply_filters() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/class-wp-hook.php:312
[22-Jan-2020 14:37:39 UTC] PHP 11. EPS_Redirects_Plugin->admin_tab_redirects() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/class-wp-hook.php:288
[22-Jan-2020 14:37:39 UTC] PHP 12. include() /Users/erik/Local Sites/schweitzer/app/public/wp-content/plugins/eps-301-redirects/plugin.php:564
[22-Jan-2020 14:37:39 UTC] PHP 13. EPS_Redirects::get_inline_edit_entry() /Users/erik/Local Sites/schweitzer/app/public/wp-content/plugins/eps-301-redirects/templates/admin-tab-redirects.php:37
[22-Jan-2020 14:37:39 UTC] PHP 14. include() /Users/erik/Local Sites/schweitzer/app/public/wp-content/plugins/eps-301-redirects/eps-301-redirects.php:505
[22-Jan-2020 14:37:39 UTC] PHP 15. include() /Users/erik/Local Sites/schweitzer/app/public/wp-content/plugins/eps-301-redirects/templates/template.redirect-entry-edit-inline.php:23
[22-Jan-2020 14:37:39 UTC] PHP 16. eps_get_selector() /Users/erik/Local Sites/schweitzer/app/public/wp-content/plugins/eps-301-redirects/templates/template.redirect-entry-edit.php:33
[22-Jan-2020 14:37:39 UTC] PHP 17. eps_get_post_type_selects() /Users/erik/Local Sites/schweitzer/app/public/wp-content/plugins/eps-301-redirects/eps-form-elements.php:46
[22-Jan-2020 14:37:39 UTC] PHP 18. eps_dropdown_pages() /Users/erik/Local Sites/schweitzer/app/public/wp-content/plugins/eps-301-redirects/eps-form-elements.php:155
[22-Jan-2020 14:37:39 UTC] PHP 19. get_posts() /Users/erik/Local Sites/schweitzer/app/public/wp-content/plugins/eps-301-redirects/class.drop-down-pages.php:44
[22-Jan-2020 14:37:39 UTC] PHP 20. WP_Query->query() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/post.php:2039
[22-Jan-2020 14:37:39 UTC] PHP 21. WP_Query->get_posts() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/class-wp-query.php:3413
[22-Jan-2020 14:37:39 UTC] PHP 22. array_map() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/class-wp-query.php:3011
[22-Jan-2020 14:37:39 UTC] PHP 23. get_post() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/class-wp-query.php:3011
[22-Jan-2020 14:37:39 UTC] PHP 24. shutdown_action_hook() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/load.php:0
[22-Jan-2020 14:37:39 UTC] PHP 25. do_action() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/load.php:947
[22-Jan-2020 14:37:39 UTC] PHP 26. WP_Hook->do_action() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/plugin.php:478
[22-Jan-2020 14:37:39 UTC] PHP 27. WP_Hook->apply_filters() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/class-wp-hook.php:312
[22-Jan-2020 14:37:39 UTC] PHP 28. wp_ob_end_flush_all() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/class-wp-hook.php:288
[22-Jan-2020 14:37:39 UTC] PHP 29. ob_end_flush() /Users/erik/Local Sites/schweitzer/app/public/wp-includes/functions.php:4552
`
Yes, thank you, that worked.
Bonus question: Is there a way to enable the discount, but not automatically add the product(s) to the cart? We have some “premiums” that we’d like for users to be able to select — eg, order this product with at > $$, and you can choose a gift.
Forum: Plugins
In reply to: [Block Lab] Adding classname to custom blocks@ryankienstra I tried this solution on the site I’m working on. It works properly for displaying the blocks in the frontend. However, when entering a value in the custom class field and then deselecting the block to enter preview mode, I get: “Error loading block: Invalid parameter(s): atrributes”
Forum: Plugins
In reply to: [Sermon Embed] Soundfaith is now Faithlife SermonsAaaaaand fixed. That was easier than I thought it was going to be.
No, that’s not what I want. I want the notification to go automatically on PUBLISH, but NOT go on UPDATE.