• Resolved Varun Dubey

    (@vapvarun)


    I am encountering a PHP fatal error with the following message:

    The error occurs when trying to access the WordPress admin area, and the stack trace suggests that the issue arises from the Omnisend Connect plugin, specifically in the class-omnisend-helper.php file.

    PHP Fatal error: Uncaught Error: Call to undefined function switch_to_blog() in /wp-content/plugins/omnisend-connect/manager/class-omnisend-helper.php:280
    #0 /wp-content/plugins/omnisend-connect/manager/class-omnisend-helper.php(201): Omnisend_Helper::check_user_role_for_oauth_access()
    #1 /wp-content/plugins/omnisend-connect/omnisend-woocommerce.php(307): Omnisend_Helper::is_woocommerce_api_access_granted()
    #2 /wp-includes/class-wp-hook.php(324): omnisend_show_api_access_notice()
    #3 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #4 /wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 /wp-admin/admin-header.php(313): do_action()
    #6 /wp-admin/index.php(137): require_once('/wp-admin/admin-header.php')
    #7 {main}

    The error is caused by the switch_to_blog() function being called in the plugin, which is typically used in multisite installations. However, my WordPress setup is not a multisite network, so the function is not available, leading to the fatal error.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support supportomnisend

    (@supportomnisend)

    Hi @vapvarun ,

    Thank you for bringing this issue to our attention and for sharing such a detailed error message — it’s truly valuable in helping us address it.

    Please rest assured that our technical team is already investigating this with high priority. We’re actively working with the relevant teams to pinpoint the cause and identify the best solution.

    We’ll keep you updated here as soon as we have more information or if we need any further details from your side.

    We appreciate your patience and trust as we work to resolve this promptly.

    Global press

    (@xglobalpress)

    Hi Omnisend Support,

    Thank you for your prompt response and for acknowledging the issue.

    To clarify, my WordPress installation is not a multisite network. The fatal error occurs due to the switch_to_blog() function being called within the plugin, which is specific to multisite setups and thus unavailable in my environment. This is causing the site to crash when the plugin is active.

    Please let me know if you need any specific details from my end, such as environment configurations or error logs, to assist with the fix. I appreciate your efforts and look forward to an update on a resolution.

    Best regards,
    [GLOBAL PRESS MEDIA]

    Plugin Support supportomnisend

    (@supportomnisend)

    Hello @vapvarun and @xglobalpress,

    Thank you both for your detailed insights and for helping us confirm the root cause of the issue. Your input has been extremely valuable to our team.

    I’m pleased to let you know that we’ve finalized an update to the Omnisend plugin that resolves the fatal error you encountered. The revised version includes the necessary adjustments and is scheduled to be published later today.

    We appreciate your collaboration and understanding throughout this process, and we’re confident the upcoming update will resolve the issue. Should you have any further questions or encounter anything else, we’re just a message away.

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

The topic ‘PHP Fatal Error – Uncaught Error: Call to Undefined Function switch_to_blog()’ is closed to new replies.