mesmer7
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [NSFW] [Kadence] FAQ schema stripping URLsRank Math’s FAQ schema is only available to Pro users. I use the free version. I’ll just have to wait for the theme update.
Forum: Themes and Templates
In reply to: [NSFW] [Kadence] FAQ schema stripping URLsUpdate: While the code you gave me worked for the schema, it caused a conflict with Rank Math sitemaps. Here is the discussion on the rank math support group.
That helped. It wasn’t the config file, but a filter function that Kadence’s tech support gave me to patch a bug in the theme’s FAQ schema output.
Unfortunately, I can’t narrow it down any further. The code contains a regex expression and an escape function I don’t really understand.
Forum: Plugins
In reply to: [WooCommerce] Security Concern: Direct Add-to-Cart GET Requests VulnerabilityAlright this is the 10th time I’ve asked an AI for a solution to this problem. And this is the 10th solution they’ve given me. This time, the AI told me enable WooCommerce Order Attribution and check for the session cookie by adding this to the htaccess file:
#
Block Add-to-Cart if the source-tracking cookie is missing (This identifies users who didn't 'land' on the site first)RewriteCond %{QUERY_STRING} (^|&)add-to-cart=[0-9]+ [NC]
RewriteCond %{HTTP_COOKIE} !sbjs_session [NC]
RewriteRule .* - [F,L]I’m also suddenly having a problem with my sitemaps, and I have no idea why. When I tried to view my sitemaps today, it shows the following error:
This page contains the following errors:error on line 2 at column 7: XML declaration allowed only at the start of the document Below is a rendering of the page up to the first error.Forum: Plugins
In reply to: [WooCommerce] Security Concern: Direct Add-to-Cart GET Requests VulnerabilityHi @lovingbro
As difficult as it may be for Automatic to handle these issues at the application level. Think about how difficult it is for us ecommerce merchants. Remember, a lot of us are one-man operations.
I’m a technical writer turned voice actor. I write, voice, and produce my audio recordings. I design my own cover art, I maintain my website and promote my products.In my list of skills, writing non-fiction is #1, coding is probably #10. I’m an amateur.
I spent 3 months trying to find the code to block these bots. (three months NOT developing new products) And so far, I’m only 80% successful. My hosting service tech support was totally useless. I couldn’t find an answer on reddit or stackoverflow. And the AIs I asked for help made a ton of mistakes. People who have even less coding experience than me will go straight to an AI, ask for the code, and add it to their site, not realizing they could be adding additional problems.
We need a better solution.
- This reply was modified 1 week, 4 days ago by mesmer7.
Forum: Themes and Templates
In reply to: [NSFW] [Kadence] FAQ schema stripping URLsThank you. This works.
Also ask your development team to research whether we should include <p> tags inside Answer schema. Might not need it if the Answer is only 1 sentence or 1 paragraph.
Forum: Plugins
In reply to: [WooCommerce] Security Concern: Direct Add-to-Cart GET Requests VulnerabilityGiven the scope of this forum, that’s perfectly understandable. But this is a serious security concern that affects ALL Woocommerce users. These bots are attacking every website they can find. We’d all appreciate it if Automatic would add cart security like this to Woocommerce core functionality.
Forum: Plugins
In reply to: [WooCommerce] Security Concern: Direct Add-to-Cart GET Requests Vulnerability- I’m going to need third-party confirmation before I add this to my site. Last time I tried something like this it disabled all the add-to-cart buttons, and locked me out of the site for an hour.
- WooCommerce’ Hand Picked products block doesn’t use AJAX. I had to add the following code to my site to compensate for this issue.
- I hate nested IF statements. Doesn’t anyone know how to use PHP’s Switch/Case Statement?
add_action( 'wp_enqueue_scripts', 'hand_picked_block_ajax');
function hand_picked_block_ajax() {
// Only load this on the homepage to keep the site fast
if ( is_front_page() ) {
// Force the core WooCommerce AJAX scripts to load
wp_enqueue_script( 'wc-add-to-cart' );
wp_enqueue_script( 'wc-cart-fragments' ); // This fixes the "0 items" issue
// The custom JS logic
$custom_js = "
jQuery(document).on('click', '.wc-block-handpicked-products .add_to_cart_button', function(e) {
e.preventDefault();
var \$button = jQuery(this);
var product_id = \$button.data('product_id');
if (!product_id) return;
\$button.addClass('loading');
jQuery.ajax({
type: 'POST',
url: wc_add_to_cart_params.ajax_url,
data: {
action: 'woocommerce_ajax_add_to_cart',
product_id: product_id
},
success: function(response) {
if (response.error && response.product_url) {
window.location = response.product_url;
return;
}
// Trigger the fragment refresh so the mini-cart updates
jQuery(document.body).trigger('added_to_cart', [response.fragments, response.cart_hash, \$button]);
\$button.removeClass('loading').addClass('added');
}
});
});
";
// Attach this script to the 'wc-add-to-cart' handle
wp_add_inline_script( 'wc-add-to-cart', $custom_js );
}}Forum: Themes and Templates
In reply to: [NSFW] [Kadence] FAQ schema stripping URLs@architabasandrai20 Hi Archita,
I recently read about sanitizing tags, and I figured that’s what you’re doing. But the neither code you gave me nor the code on that documentation page solve the problem. Kadence is stripping the href attribute from the <a> tag in the Answer schema. I want to keep this attribute in the schema.
Forum: Plugins
In reply to: [WooCommerce] Security Concern: Direct Add-to-Cart GET Requests VulnerabilityI’ve been dealing with this attack for three months now. Every day a botnet (rotating IPs) crawls (or hits) 20-30 add-to-cart buttons across my site. Most of them never view a page, but go directly to the add-to-cart. In addition another bot triggers two to three remove_items from the cart. These bots create 20-30 shopping carts every day without ever completing a purchase.
I’ve tried a dozen different configurations for the htaccess file and finally settled on the code below. It reduces the server load, but the attack continues.
RewriteCond %{QUERY_STRING} (^|&)add-to-cart=[0-9]+ [NC]
RewriteCond %{HTTP_USER_AGENT} !googlebot [NC]
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www.hypnoticdreams.com$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (bot|crawl|spider) [NC,OR]
RewriteCond %{HTTP_REFERER} \?.(^|&)add-to-cart=[0-9]+(&|$) [NC,OR] RewriteCond %{HTTP_REFERER} ^$ [NC] RewriteRule . - [E=blockbot:1,F,L]I finally signed up for quic.cloud’s CDN and enabled UNDER ATTACK mode. It seems to be blocking the attack for now, but it really, really slows down the add-to-cart function when I test it.
Forum: Plugins
In reply to: [LiteSpeed Cache] Litespeed looking for deleted images@litetim It can’t be the theme, I sent a report last month without a problem while the same theme was active. It has to be either All In One Security (I switched from Wordfence) or quic.cloud CDN’s (just signed up) security settings. Those are the only two things I’ve changed since I successfully sent a report last month.
Forum: Plugins
In reply to: [LiteSpeed Cache] Litespeed looking for deleted images@litetim The report tool still isn’t working. I disabling AIOS’s firewall. When that didn’t fix the problem, I went into quic.cloud’s CDN security and disabled Block WP API Embed, waited 10 minutes and tried to send it again. But that didn’t fix it either. I continue to see
Failed to request via WordPress: [server] https://api.quic.cloud [service] wp/reportwhen I try to send a report.Forum: Plugins
In reply to: [LiteSpeed Cache] Litespeed looking for deleted images@litetim The report tool isn’t working this morning. I tried three times and keep getting
Failed to request via WordPress: [server] https://api.quic.cloud [service] wp/report. I’ll wait a couple of hours, and try again.@qtwrk The 404 error is another issue I haven’t figured out. In my htaccess file I specify a static ErrorDocument /404.html (which I manually created), but this directive is being ignored. WordPress continues to generate a dynamic 404 page for each missing URL.
The errors have not recurred since restoring the site from backup 3 days ago.
GeoIP.dat or GeoIPv6.dat were in the uploads folder. And I haven’t restored them. So deleting them must not have caused the problem.
I don’t know what actually happened. But the site seems to be fine now. Although I haven’t updated any plugins again since restoring from backup. So maybe one of the plugin (or theme) updates caused a conflict.