• Resolved brasofilo

    (@brasofilo)


    Hi, this is the error:

    [01-Feb-2021 19:12:01 UTC] PHP Fatal error: Uncaught Error: Using $this when not in object context in /Users/usernameSites/website/htdocs/wp-content/plugins/upload-media-by-url/inc/umbumedia.php:97

    It’s a static method and should be self::umbu_mediaButtonScript() instead of $this->umbu_mediaButtonScript()

    • This topic was modified 4 years, 1 month ago by brasofilo.
    • This topic was modified 4 years, 1 month ago by brasofilo.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter brasofilo

    (@brasofilo)

    Another thing that needs fixing is your enqueue_scripts, it needs to check for $pagenow == 'upload.php'.
    Right now, it’s being encoded all over the admin and could affect something unrelated. And you put 2 actions to enqueue when only 1 is needed, change ‘wp_enqueue_scripts’ and ‘admin_init’ for ‘admin_enqueue_scripts’

    Also, please review the function umbu_media(), this line doesn’t have brackets (it’s not clear if it should affect only the next command or all of them):

    if ( $pagenow == 'upload.php' )

    Maybe you mean if ( $pagenow != 'upload.php' ) return; ?

    Finally, I just found another error, the action post-plupload-upload-ui is leaking on a WooCommerce page (edit.php?post_type=shop_order, maybe others), not sure how to solve it though… I tried to move it inside load-upload.php but it didn’t work.

    • This reply was modified 4 years, 1 month ago by brasofilo.
    • This reply was modified 4 years, 1 month ago by brasofilo.
    Plugin Author notetoservices

    (@notetoservices)

    You have found an error that was eluding me for some time with WooCommerce… and I will update your findings accordingly and package up with the next update, thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin throwing a fatal error on WP_DEBUG’ is closed to new replies.