403 Forbidden Error with WP_Background_Process When Rank Math SEO Is Active

#1116569
  • Resolved Ali Hasan
    Rank Math free

    Hello,

    We have a plugin called AI Image Alt Text Generator for WP, which automatically generates image alt text. The plugin includes a Bulk Image Alt Text Generation feature that uses WP_Background_Process.

    Everything works perfectly when Rank Math SEO is inactive. However, when Rank Math SEO is active, we encounter a 403 Forbidden error during the bulk action AJAX requests that trigger or cancel the background process.

    Specifically, the error occurs at the point of dispatching:

    $this->process_generate_bulk_post->push_to_queue($alt_text_attachments[0]);
    $this->process_generate_bulk_post->save()->dispatch();

    The same issue happens when canceling the background task:

    $this->process_generate_bulk_post->cancel();

    It seems that WP_Background_Process fails to execute properly only when Rank Math SEO is active.

    Please forward this issue to your developer team and help us resolve it.

    Best regards,
    Ali Hasan
    AI Image Alt Text Generator for WP Team

    https://imgur.com/a/cLoNMu4

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for your query and we are so sorry about the trouble this must have caused.

    We have reproduced the issue from our end. Allow us to check this with our development team. We will get back to you shortly once we have updates from them.

    We appreciate your time and patience in the meantime.

    Hello,

    The issue is with the classes WP_Background_Process and WP_Async_Request, they’re loaded from other plugins instead of the ones in the ai-image-alt-text-generator-for-wp plugin.

    Even when WooCommerce is active ( which contains these classes as dependencies as well ) and RankMath is deactivated, the classes are loaded from it, leading to the same issue.

    The ai-image-alt-text-generator-for-wp plugin team should update the deliciousbrains/wp-background-processing dependency to the latest ie v1.4.0, to avoid this. ( https://packagist.org/packages/deliciousbrains/wp-background-processing )

    Could you please share these details with them, then share with us their related response.

    Thank you.

    Hello,

    A huge thank you for your support — your prompt and thorough assistance has been invaluable! Thanks to your help, we were able to pinpoint the issue and have successfully resolved it. The bulk action feature is now working perfectly. We truly appreciate the dedication and professionalism your team has shown.

    Best regards,
    Ali Hasan
    WordPress Developer
    WPMessiah

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this ticket.