Support Forum

wp undefined function error

RB rb22
rb22
Member

Fatal error: Call to undefined function is_plugin_active() in /home/XXXXXX/public_html/wp-content/plugins/simple-press/sp-api/sp-api-common-display.php on line 427

 

I am getting something like this error too when I load the “forurms” page via wordpress

I have buddypress installed.

 

The line in question is

 

function sp_build_profile_formlink($userid) {
        global $spThisUser;

        $sfprofile = sp_get_option(‘sfprofile’);
    $mode = $sfprofile[‘formmode’];

    # if profile mode is BP or Mingle but they are not active, switch back to popup profile

// LINE 427 is here—->

    if (($mode == 3 && !is_plugin_active(‘buddypress/bp-loader.php’)) || ($mode == 5 && !is_plugin_active(‘mingle/mingle.php’))) {
        $mode = 1;
    }

        switch ($mode) {

7 Answers

New Answer

MP Mr Papa
Mr Papa
Member

yeah, understood where it was.. but its a standard wp function that should always be available…  still stymied why for your installation (and yours only thus far), its not available..

before that line of code, can you insert this code:

print_r(debug_backtrace());

and see what is reported… see where the call stack is coming from…

RB rb22
rb22
Member

Hi thanks, I am different guy than OP. Just tagging along with his post.

PHP 5.4.23 Centos/Cpanel/Apache2

Heres the backtrace just above the line.

Array
(
    [0] => Array
        (
            [file] => /home/XXXXX/public_html/wp-content/plugins/simple-press/forum/content/sp-common-view-functions.php
            [line] => 1197
            [function] => sp_build_profile_formlink
            [args] => Array
                (
                    [0] => 1
                )

        )

    [1] => Array
        (
            [file] => /home/XXXXX/public_html/wp-content/sp-resources/forum-themes/css-only/templates/spHead.php
            [line] => 100
            [function] => sp_ProfileEditButton
            [args] => Array
                (
                    [0] => tagClass=spButton spRight
                    [1] => Profile
                    [2] => Edit your profile
                )

        )

    [2] => Array
        (
            [file] => /home/XXXXX/public_html/wp-content/plugins/simple-press/forum/content/sp-template-control.php
            [line] => 290
            [args] => Array
                (
                    [0] => /home/XXXXX/public_html/wp-content/sp-resources/forum-themes/css-only/templates/spHead.php
                )

            [function] => include
        )

    [3] => Array
        (
            [file] => /home/XXXXX/public_html/wp-content/sp-resources/forum-themes/css-only/templates/spGroupView.php
            [line] => 16
            [function] => sp_load_template
            [args] => Array
                (
                    [0] => spHead.php
                )

        )

    [4] => Array
        (
            [file] => /home/XXXXX/public_html/wp-content/plugins/simple-press/forum/content/sp-template-control.php
            [line] => 290
            [args] => Array
                (
                    [0] => /home/XXXXX/public_html/wp-content/sp-resources/forum-themes/css-only/templates/spGroupView.php
                )

            [function] => include
        )

    [5] => Array
        (
            [file] => /home/XXXXX/public_html/wp-content/plugins/simple-press/forum/content/sp-template-control.php
            [line] => 90
            [function] => sp_load_template
            [args] => Array
                (
                    [0] => spGroupView.php
                )

        )

    [6] => Array
        (
            [file] => /home/XXXXX/public_html/wp-content/plugins/simple-press/sp-startup/forum/sp-forum-framework.php
            [line] => 533
            [function] => sp_process_template
            [args] => Array
                (
                )

        )

    [7] => Array
        (
            [function] => sp_render_forum
            [args] => Array
                (
                    [0] => 
                )

        )

    [8] => Array
        (
            [file] => /home/XXXXX/public_html/wp-includes/plugin.php
            [line] => 213
            [function] => call_user_func_array
            [args] => Array
                (
                    [0] => sp_render_forum
                    [1] => Array
                        (
                            [0] => 
                        )

                )

        )

    [9] => Array
        (
            [file] => /home/XXXXX/public_html/wp-includes/post-template.php
            [line] => 230
            [function] => apply_filters
            [args] => Array
                (
                    [0] => the_content
                    [1] => 
                )

        )

    [10] => Array
        (
            [file] => /home/XXXXX/public_html/wp-content/themes/XXXXX-theme/page-forum.php
            [line] => 40
            [function] => the_content
            [args] => Array
                (
                )

        )

    [11] => Array
        (
            [file] => /home/XXXXX/public_html/wp-includes/template-loader.php
            [line] => 75
            [args] => Array
                (
                    [0] => /home/XXXXX/public_html/wp-content/themes/XXXXX-theme/page-forum.php
                )

            [function] => include
        )

    [12] => Array
        (
            [file] => /home/XXXXX/public_html/wp-blog-header.php
            [line] => 16
            [args] => Array
                (
                    [0] => /home/XXXXX/public_html/wp-includes/template-loader.php
                )

            [function] => require_once
        )

    [13] => Array
        (
            [file] => /home/XXXXX/public_html/index.php
            [line] => 17
            [args] => Array
                (
                    [0] => /home/XXXXX/public_html/wp-blog-header.php
                )

            [function] => require
        )

)
MP Mr Papa
Mr Papa
Member

wait… rb22, you seem to have hijacked this thread…  you have a different issue from the OP…  gonna break this into its own topic…

and then please start from scratch… explain the problem… where you are seeing it and such…

RB rb22
rb22
Member

Sorry, I thought it was more  or less the same issue.

I upgraded wordpress to 4.3 and then upgraded to the latest version of simple-press. I do all upgrades manually.

Unfortunately, I didn’t try the forum after just the upgrade to 4.3 and upgraded simple-press right away.

Then I went to the wp forum page

I get

Fatal error: Call to undefined function is_plugin_active() in /home/XXXXX/public_html/wp-content/plugins/simple-press/sp-api/sp-api-common-display.php on line 427

MP Mr Papa
Mr Papa
Member

what are your settings on forum – integration – page and permalink? namely in the display options…  perhaps some other plugin is running before wp is even fully loaded causing issues…

make sure you have the display in loop set true and the display multiple to false…  and if no change then, try enabling the strict wp api..

RB rb22
rb22
Member

Changing the settings in integreration didn’t help. I tried different options you suggest and more. 

If I insert this into the (wp) page-forum.php template

include_once(ABSPATH.’wp-admin/includes/plugin.php’);

whether at the top, before the get_header() or below it, I don’t get the error.

simple-press-integration-options.png
MP Mr Papa
Mr Papa
Member

yes, of course… you are forcing wp to load its own file that way… the issue is that wp normally loads it anyway… so something on your site is firing before wp is fully loaded…

so you can either leave that line in there or try tracking it down further…  that would be stuff like trying the default wp theme and seeing if any different… and then if not, disabling other wp plugins and seeing if different…

but understand if you just press on… 🙂