Inquiry about modifying protected content before AJAX display for URL authentica
-
Dear Passster Developer Team,
I hope this message finds you well. I am using Passster (The newest version) on my WordPress site to protect download links for paid resources. The download links point to files stored on Tencent Cloud COS, and I use EdgeOne CDN with Token authentication (Type A) to prevent hotlinking. The authentication requires appending a signature parameter (e.g.,
?sign=timestamp-rand-uid-md5hash) to the CDN URL.Currently, I have a PHP filter that successfully replaces all COS URLs with signed CDN URLs in
the_content(priority 20) and in an ACF field. This works perfectly on normal page loads. However, when a visitor enters the correct password and Passster reveals the protected content via AJAX, the links inside the revealed content are not processed by my filter. As a result, the user sees the unsigned COS URL, which leads to a 403 error (since the bucket is private). After manually refreshing the page, the correct signed URLs appear.I have tried using the
passster_compatiblity_actionshook as documented, but it doesn’t seem to work for me. Here’s the code I used:phpadd_filter(‘passster_compatiblity_actions’, function($content, $post_id) { // My URL replacement logic (same as in the_content filter) return $content; }, 10, 2);
It appears that this hook either fires too early or doesn’t modify the content that is injected via AJAX.
Could you please advise on the correct hook or method to modify the protected content before it is displayed after an AJAX unlock? I need to ensure that all URLs inside the revealed content are signed with the proper authentication token.
If there is a specific filter or action that targets the AJAX response, or if I need to adjust my approach, I would greatly appreciate your guidance.
I am using “Use Ajax”, with elementor.
Thank you for your time and for developing such a useful plugin.
You must be logged in to reply to this topic.