BuddyDev

Search

[Resolved] The plugin causes a critical site error

  • Participant
    Level: Initiated
    Posts: 9
    Vladi on #47160

    For the last week I’ve been getting reports of a critical error on the site caused by the mediapress plugin.

    Problem plugin: MediaPress (version 1.5.2) Version PHP 8.1.8 Error details =================================== Error with type E_ERROR occurred on line 65 of /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-content/plugins/mediapress/core/gallery/mpp-gallery-conditionals.php. Error message: Uncaught Error: Undefined constant “MPP_GALLERY_SLUG” in /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-content/plugins/mediapress/core/gallery/mpp-gallery-conditionals.php:65

    Is there any way to solve this problem?

  • Keymaster
    (BuddyDev Team)
    Posts: 22213
    Brajesh Singh on #47162

    Hi Vladi,
    Welcome to BuddyDev foums.
    I am sorry for the inconvenience.
    I am not sure what is causing it. It seems some code is causing this function mpp_is_component_gallery() too early.

    We are defining that constant in mpp_setup_core which should be fine.

    is there any recent changes on your site? Are you using any custom code related to mediapress? Please share and I will assist.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 9
    Vladi on #47164

    Hello, yes I have made some changes, but only in the design area. Fonts, spacing between elements, nothing more. Another critical error on the site is the translation of the plugin, as soon as I sync the created translation, the site immediately crashes. Another problem in uploading audio files, for some reason some mp3 are uploaded normally, but others cause http error. It was not so important as all other formats were uploading normally. But now if you add it all up there is a serious problem.

  • Keymaster
    (BuddyDev Team)
    Posts: 22213
    Brajesh Singh on #47165

    Hi Vladi,
    Thank you for the reply.
    All servers are different and there may be some issues with configuration. The current version of MediaPress has been a very stable one but I am expecting some issues with PHP 8.0+ to surface.

    If there is a critical error notice, It is some fatal error and the only way to know it will be if you share the error log(php error log). If you can provide that for audio, we can check and update the plugin with the same.

    In the meantime, for the current issue, Please share the following details:-

    1. Your current php version
    2. Are you using WordPress multisite? If yes, Is MediaPress network active?
    3. Are you using it with BuddyPress?
    4. If yes, which version of BuddyPress/WordPress are you using?
    5. If yes(3rd), is the error happening on profile or group page?

    6. If no, is the error happening on upload or viewing?

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 9
    Vladi on #47166

    php version 8.1
    I don’t use multisite, but my website is multilingual
    Yes, I use BaddyPress? version is the latest, just updated yesterday.
    “http error” appears on all pages when loading a file, make it clear that not all mp3’s but only those 7-10 years old, i.e. they were encoded at that time.
    As for php errors logs, I’ve already tried to find earlier, then apparently the server such a log is not maintained, but I can describe the error in full –

    E_ERROR occurred on line 65 of /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-content/plugins/mediapress/core/gallery/mpp-gallery-conditionals.php. Error message: Uncaught Error: Undefined constant “MPP_GALLERY_SLUG” in /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-content/plugins/mediapress/core/gallery/mpp-gallery-conditionals.php:65 Stack trace: #0 /var/www/i_aria_fun_usr/data/www/i-aria. fun/wp-content/plugins/mediapress/core/mpp-hooks.php(250): mpp_is_component_gallery() #1 /var/www/i_aria_fun_usr/data/www/i-aria. fun/wp-includes/class-wp-hook.php(307): mpp_filter_body_class(Array, Array) #2 /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-includes/plugin.php(191): WP_Hook->apply_filters(Array, Array) #3 /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-includes/post-template.php(836): apply_filters(‘body_class’, Array, Array) #4 /var/www/i_aria_fun_usr/data/www/i-aria. fun/wp-includes/post-template.php(595): get_body_class(Array) #5 /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-content/themes/buddyx/header. php(27): body_class() #6 /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-includes/template.php(770): require_once(‘/var/www/i_aria…’) #7 /var/www/i_aria_fun_usr/data/www/i-aria. fun/wp-includes/template.php(716): load_template(‘/var/www/i_aria…’, true, Array) #8 /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-includes/general-template.php(48): locate_template(Array, true, true, Array) #9 /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-content/themes/buddyx/404.php(12): get_header() #10 /var/www/i_aria_fun_usr/data/www/i-aria. fun/wp-content/plugins/wp-cerber/cerber-load.php(4658): include(‘/var/www/i_aria…’) #11 /var/www/i_aria_fun_usr/data/www/i-aria. fun/wp-content/plugins/wp-cerber/cerber-load.php(2453): cerber_404_page() #12 /var/www/i_aria_fun_usr/data/www/i-aria. fun/wp-content/plugins/wp-cerber/cerber-load.php(2395): cerber_access_control() #13 /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-includes/class-wp-hook.php(307): {closure}(”) #14 /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #15 /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-includes/plugin.php(476): WP_Hook->do_action(Array) #16 /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-settings.php(598): do_action(‘init’) #17 /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-config.php(95): require_once(‘/var/www/i_aria… ‘) #18 /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-load.php(50): require_once(‘/var/www/i_aria…’) #19 /var/www/i_aria_fun_usr/data/www/i-aria.fun/wp-login.php(12): require(‘/var/www/i_aria…’) #20 {main} thrown

  • Keymaster
    (BuddyDev Team)
    Posts: 22213
    Brajesh Singh on #47169

    Hi,
    Thank you.
    I am testing it with the theme you are using. I will update you in couple of hours.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 22213
    Brajesh Singh on #47170

    Hi,
    I had a look.
    Your current issue is caused by WP Cerber plugin. Here is what is happening:-

    1. On ‘init’ action, wp cerber check for access and if the url is prohibited, It loads 404 page.
    The problem is, It is loading theme’s header.php too early(normally, It should do that at ‘wp’ or below).

    At ‘init’ action, BuddyPress components are also setup and since WP Cerber has slightly high priority, it loads the page before our MediaPress gallery component is setup.

    MediaPress plugin hooks to ‘body_class’ to add some extra css classes to ‘body’ element. On the 404 page created by Cerber, this gets called too early(before even having the component setup). That is causing the issue(the slug is not defined at that time).

    The real solution would be to have W Cerber fix it by loading the template late(I checked their wp.org page and It is under temporary suspension currently, so could not request them for it).

    A temporary fix form our side will be to add an extra check for MPP_GALLERY_SLUG being defined(we should not need to do it as our plugin guarantees it to be defined at init).

    I will push a release tomorrow to fix this one for you.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 9
    Vladi on #47174

    OK, thank you very much.

  • Keymaster
    (BuddyDev Team)
    Posts: 22213
    Brajesh Singh on #47182

    Hi,
    Please upgrade to 1.5.3.
    It fixes the issue with WP Cerber compatibility.

    Let me know if it works for you or not?

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 9
    Vladi on #47184

    Thanks, I was still reading the Cerber forums yesterday. And they have this problem a lot, even with themes, as a solution they suggest changing the 404 page, let’s see what happens. What about MP3 files? Why do some files upload while others cause an Http error?

You must be logged in to reply to this topic.

This topic is: resolved