• Resolved robertstaddon

    (@robertstaddon)


    Your plugin is causing fatal errors as a result of not scoping the namespace of libraries it includes.

    For example, I’m using the latest version of WP Offload Media (2.4.2). Your plugin causes it to crash with a fatal error:
    [28-Aug-2020 22:46:40 UTC] PHP Fatal error: Uncaught Error: Class ‘DeliciousBrains\WP_Offload_Media\Aws3\Symfony\Polyfill\Intl\Idn\Idn’ not found in /public_html/wp-content/plugins/amazon-s3-and-cloudfront-pro/vendor/Aws3/Symfony/Polyfill/IntlIdn/bootstrap.php:146

    The Delicious Brains tech support team behind the WP Offload Media plugin has investigated this thoroughly and recommended disabling your plugin until it can be fixed to work alongside other plugins that may also include libraries. This can be easily done by scoping your included libraries like they do: https://deliciousbrains.com/php-scoper-namespace-composer-depencies/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Pascal Birchler

    (@swissspidy)

    Hi there,

    Thanks for your report. Could you perhaps send this thread to the WP Offload Media plugin folks or tag them here?

    There seems to be some confusion as the AMP plugin does not use the Symfony Intl Idn polyfill (Symfony/Polyfill/IntlIdn/bootstrap.php belongs to that package).

    The only thing the AMP plugin does is this:

    if ( function_exists( 'idn_to_utf8' ) ) { idn_to_utf8(...) }

    That’s a perfectly fine thing to do: call a PHP-provided function if it’s available.

    The problem:

    The polyfill used by WP Offload Media defines that function if it doesn’t exist yet, so the AMP plugin will simply end up calling it.

    There isn’t really anything we could do differently here, as it’s a simple function call.

    So it seems more like WP Offload Media will have to fix how they use the polyfill in their code base.

    Plugin Author Weston Ruter

    (@westonruter)

    It seems that WP Offload Media is defining that function but not registering the autoloader for the polyfill at the same time? Is that what they need to fix?

    Plugin Author Pascal Birchler

    (@swissspidy)

    Seems like it, yes

    Thread Starter robertstaddon

    (@robertstaddon)

    Hey guys,

    Thank you so much for the quick responses! I passed on your info to the Delicious Brains support team and they are now working on a fix for WP Offload Media: “We’re looking into a fix for this, please either enable Intl in PHP, use WP Offload Media 2.4.1 for the time-being, or deactivate the AMP plugin. Because the code in question isn’t ours, but in the embedded AWS PHP SDK, we have to be careful with how we handle the fix, which comes from how PHP Scoper handles aliased imports.”

    Thread Starter robertstaddon

    (@robertstaddon)

    So it appears that this issue is caused by a bug in the AWS PHP SDK: https://github.com/aws/aws-sdk-php/issues/2092

    Thread Starter robertstaddon

    (@robertstaddon)

    WP Offload Media 2.4.4 has been rolled out with a patched AWS PHP SDK to resolve this issue: https://deliciousbrains.com/wp-offload-media/doc/changelog/

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Fatal Error Conflicts Caused by Unscoped Namespace of Included Libraries’ is closed to new replies.