Ward Graham
Forum Replies Created
-
Forum: Plugins
In reply to: [USPS Simple Shipping for Woocommerce] API Retirement Banner fixBug Report: Missing/Broken JS for Retirement Notice Dismissal
The USPS WebTools API Retirement notice reappears on every page load.
While
src/Plugin.phpcorrectly evaluatesDismissibleNotices::dismissed($noticeId)on line 65, andDismissibleNotices.phpcontains the logic to set the site transient, the frontend JavaScript required to fire the AJAX request (dismiss-notice.js) is either missing from the build, failing to enqueue, or failing to bind to the.notice-dismisselement generated by WordPress core.Proposed Structural Fix:
EnsureDismissibleNotices::init()is being called during bootstrap, and verifydismiss-notice.jsis included in the production build.If the script is present but failing due to a race condition with WP Core’s notice teardown, use event delegation to ensure the AJAX call fires:
javascript $(document).on('click', '.notice[data-dismissible="uspssimple-retirement-notice"] .notice-dismiss', function() { // AJAX POST logic here });Alternatively, you can append this self-contained polyfill to the main plugin file to handle the transient state directly:
php add_action('wp_ajax_usps_simple_force_dismiss', function() { set_site_transient('uspssimple-retirement-notice', true, 0); wp_die(); }); add_action('admin_footer', function() { if (get_site_transient('uspssimple-retirement-notice')) return; ?> <script> jQuery(document).ready(function($) { $(document).on('click', '.notice[data-dismissible="uspssimple-retirement-notice"] .notice-dismiss', function() { $.post(ajaxurl, { action: 'usps_simple_force_dismiss' }); }); }); </script> <?php });Forum: Plugins
In reply to: [USPS Simple Shipping for Woocommerce] USPS WebTools API Retirement BannerGive this a try. I got this to work and seems fine however I am not the author just providing a suggestion… Enjoy!
Append this polyfill directly to the end of
USPS-simple-shipping.php. This bypasses their broken JavaScript enqueue process and manually sets the exact site transient the plugin is looking for (uspssimple-retirement-notice).// --- USPS Simple Notice Hotfix ---
add_action('wp_ajax_usps_simple_force_dismiss', function() {
set_site_transient('uspssimple-retirement-notice', true, 0);
wp_die();
});
add_action('admin_footer', function() {
if (get_site_transient('uspssimple-retirement-notice')) {
return;
}
?>
<script>
jQuery(document).ready(function($) {
// Use event delegation to catch the click before WP core removes the element
$(document).on('click', '.notice[data-dismissible="uspssimple-retirement-notice"] .notice-dismiss', function() {
$.post(ajaxurl, {
action: 'usps_simple_force_dismiss'
});
});
});
</script>
<?php
});Forum: Plugins
In reply to: [Mixed Media Gallery Blocks] thrown inyes and thank you for fast reply. I reinstalled and it seems to be fine. TY!
wppfm_msg_events.min.js?ver=fr-2.10.0:1 Uncaught TypeError: $ is not a function
at wppfm_msg_events.min.js?ver=fr-2.10.0:1:1It’s possible that you are loading beacon script multiple times. Please, check your code.
(anonymous) @ woocommerce-shipping-shipment-tracking.js?ver=5dc61a80e2e449386034bc6193b17241:6Failed to load resource: the server responded with a status of 524 () /wp-json/wcshipping/v1/label/status/109583/10018591?_locale=user:1
GET https://www.brightonhoney.com/wp-json/wcshipping/v1/label/status/109583/10018591?_locale=user 403 (Forbidden)woocommerce-shipping-shipment-tracking.js?ver=5dc61a80e2e449386034bc6193b17241:6
Version 4.7.3 and yes cache buster did show, it was set to yes, I never changed it.
Hi @isaumya
Thank you for the reply! Sorry, I did not see this until today. I did setup cache rules and disabled workers in the plugin. However, I had to go in and delete the worker routes manually within the Cloudflare dashboard. I do not have an option of “Remove Cache Buster Query Param” on the Other tab of the plugin. The error is gone. Performance is mixed on average it does seem to be a few points better. GTmetrix is lower however google page speed is better for desktops but lower for mobile. I will leave it and test again in the AM as perhaps I was hitting some network latency or the cache was not fully loaded etc. CHEERS!
well that is not good… TY!
I rolled back to Version 2.2.0 and the same. so again I suspect possibly something on the server side.
I am experiencing this. There are no PHP errors or logs being generated. Nothing has changed. I rolled back to v 11.7 also 11.6 and same. I suspect this is on the server side not local.
01-26-2023 @ 14:15:33 – Logging enabled
01-26-2023 @ 14:15:33 – Debug enabledmy humblest apologies and thank you! perhaps I may start if this issue continues… 😉
done
Thank you! turning off the prefetch seems to have done it. It was very frustrating. I read the other post and yes I will experiment and see what performance differences I get. Also I have played with many cache plugins over the years and have used CF for 10+ years now and yours by far is superior. “the secret is in the delivery” not just the server side. CHEERS!
Forum: Plugins
In reply to: [WooCommerce] There has been a critical error on this websiteI may have found it; plugin conflict. I suspect some auto-update The site is loading now with WC active. TY!
Forum: Plugins
In reply to: [WooCommerce] There has been a critical error on this websiteI disable WC so the site will load. https://pastebin.com/yBm1ZQh1
I disabled woocommerce-paypal-payments however sameForum: Plugins
In reply to: [WooCommerce] There has been a critical error on this websiteI cannot access the public/main site with WC core is active. I can access the admin management pages. the error occurs when accessing any public page