• Resolved Robin W

    (@robin-w)


    Hey this looks like it will be a great plugin

    I get an error after activation

    Notice: Undefined variable: this in /www/sites/e12/ee6/gos.rewweb.co.uk/web/wp-content/plugins/bbp-mentions-email-notifications/index.php on line 55

    and when I try and access settings I get :

    Notice: wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /www/sites/e12/ee6/gos.rewweb.co.uk/web/wp-includes/functions.php on line 3792

    Notice: Undefined variable: this in /www/sites/e12/ee6/gos.rewweb.co.uk/web/wp-content/plugins/bbp-mentions-email-notifications/index.php on line 55

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in /www/sites/e12/ee6/gos.rewweb.co.uk/web/wp-includes/plugin.php on line 525

    and a blank screen.

    https://www.ads-software.com/plugins/bbp-mentions-email-notifications/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Ismail

    (@elhardoum)

    Hi Robin,

    Hope you are doing well.

    I am suspecting that your PHP version is something less than the recommended for WordPress so this error is triggered but, not going through this, can you please go to line:55 and add & before $this variable?

    array( &$this, 'bbpen_settings' ) let me know if it worked, else I can put the plugin file in a different syntax so it simply works without OOP..

    Thanks and have a wonderful weekend.

    Samuel

    Thread Starter Robin W

    (@robin-w)

    array( &$this, ‘bbpen_settings’ ) let me know if it worked

    yes that worked.

    and yes I was at an old version of php testing for a client, now reverted back to 5.6 and all is fine

    Thanks

    Plugin Contributor Ismail

    (@elhardoum)

    Thanks for letting me know Robin! I will be updating soon.

    Have a nice day.

    Samuel

    Hi Samuel,

    I have the same (similar) problem, where the settings page goes blank.
    I could figure out that it happens at the same spot (line 55), but the reference with ampersand (&$this) didn’t help.
    When testing on my localhost, it works.

    Localhost: PHP Version 5.5.9-1ubuntu4.16
    Online: Version 5.3.3

    The only errors/warnings I see on the online are :
    PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in /var/www/vhosts/photosynthesis.org.au/httpdocs/wp-includes/plugin.php on line 525
    .. which I have to guess comes from this page.

    Any idea what else I could try?

    thanks for help,
    Jerome

    … sorry, using wordpress 4.5.1 on both platforms ??

    Hi Samuel,

    I made some more tests and realise that the issue appears before this line.
    In the __construct() method, the program breaks at line 42, when it says:
    $this->settings['format'] = get_option('bbpen_format')...

    – I’ve tried to wrap the conditional in brackets, but didn’t help.
    – If I remove the conditional and just add a string, then it works (or at least goes to the next line)
    – I’ve seen now an error that tells me a bit more: Call to undefined function get_option()

    Trying now to get the function to be recognised…

    thanks if any ideas
    Jerome

    Hi Samuel,

    sorry for all the confusion above, this was an unrelated problem.
    The issue remains like I’ve described it first though:
    The program passes the line:
    add_options_page( 'bbPress Mentions Email Notifications', 'bbP mentions', 'manage_options', 'bbpmen', array( $this, 'bbpen_settings' ) );
    … but the method bbpen_settings is not called..

    Thanks for help,
    Jerome

    Plugin Contributor Ismail

    (@elhardoum)

    Hello @jeromias,

    As per the forum welcome, you should be creating your own thread and not bump Mr Robin’s thread ??

    The problem clearly is with your PHP version, you should upgrade to 5.5.* or 5.6 > and you will not see these errors again.

    If you can not upgrade or you don’t want to, I will be happy if you open your own topic and I will edit the plugin file for you to make it work with your outdated EOL version.

    Thank you.
    Samuel

    Hi Samuel,

    Thank you for your prompt reply and sorry, Samuel and Robin, for jumping into this thread. Will not happen again ??

    I will come back to you when I have decided on upgrade or not.

    Thanks again.
    Jerome

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Errors when loading’ is closed to new replies.