Native Search Returns Blank Page Error

Example Search URL: /?s=China
Click on Native Search in top right corner
Search for any member, or post
Returns Blank Page Error

Access active until 3:14am on 15.Jan
Please Advise...

    James Morris

    Hello VirtualArtists,

    I hope you are well today.

    I just accessed your site and ran a quick test. When I searched for a user, I was returned with a 500 Internal Server Error. These errors are usually due to a plugin conflict that is interfering with proper site operation.

    There's a couple troubleshooting steps I'd like you to try to see if we can narrow down the cause of this problem.

    First, could you please run a plugin conflict test as outlined in the following article? This will eliminate the possibility of a conflict with another plugin. https://premium.wpmudev.org/manuals/using-wpmu-dev/getting-support/

    If that does not lead to a solution, could you please enable WP_DEBUG and provide us with the output of your debug.log file?

    To enable WP_DEBUG, change the following line in your wp-config.php file:

    define('WP_DEBUG', false);

    To this:

    // Enable WP_DEBUG mode
    define( 'WP_DEBUG', true );
    
    // Enable Debug logging to the /wp-content/debug.log file
    define( 'WP_DEBUG_LOG', true );
    
    // Disable display of errors and warnings
    define( 'WP_DEBUG_DISPLAY', false );
    @ini_set( 'display_errors', 0 );

    After you've visited the pages that are causing you problems, please go to wp-content/ on your server via FTP and download the debug.log file to your local computer. Then, open that file with a text editor like notepad (Windows), GEdit (Linux), or TextEdit (Mac). You can then paste the contents of that file at http://pastebin.com/ and share the URL of the pasted output with us so we can examine it further.

    I look forward to seeing the results of your tests.

    Best regards,

    James Morris

    VirtualArtists

    We have been trying to isolate any Plugin Conflict, but so far no luck

    We do not want to upload our private server logs to some public: http://pastebin.com/
    1.Can you please login to our site, check the private support message - our FTP info is there - and grab the debug.log file?
    2. Is there any CSS code to "hide" the top bar search, until we get this bug fixed?

    Access active until 3:14am in 4 days
    Please Advise...

    James Morris

    Hello VirtualArtists,

    I sincerely apologize for the delay in getting back to you on this issue and any problems it may have caused.

    After doing an extensive amount of debugging on your site, I've been able to restore the native search functionality in the header. The problem was the search had been customized to work with BBPress, but BBPress is not installed on your site. This was causing the following error:

    [08-Jan-2017 23:49:01 UTC] PHP Fatal error: Call to undefined function is_bbpress() in wp-content/themes/musicwiz/functions.php on line 146

    I've modified the code to the following to get the search working again:

    function SearchFilter($query)
    {
       //if ($query->is_search) : bbPress Fails
       // The following line commented out by WPMU DEV to prevent 500 Internal Server Error
       //if ($query->is_search && !is_bbpress() )
       if ($query->is_search)
       {
         $query->set('post_type', 'post');
       }
       return $query;
    }
    add_filter('pre_get_posts','SearchFilter');

    You also had a tremendous amount of additional debug messages related to the custom code that is on your site. I had to clear up a few of these so I was able to track down the core issue with your search.

    Changes I made:
    Debug entry:
    [08-Jan-2017 23:49:00 UTC] PHP Notice: A session had already been started - ignoring session_start() in /wp-includes/mwstudio/mwstudio.php on line 2
    Solution:
    * Commented out session_start() in mwstudio.php on line 2

    Debug entry:
    [08-Jan-2017 23:49:00 UTC] PHP Notice: A session had already been started - ignoring session_start() in /wp-content/plugins/saWPAuthIFrame/saWPAuthIFrame.php on line 14
    Solution:
    * Commented out session_start() in saWPAuthIFrame.php on line 14

    Debug entry:
    [08-Jan-2017 23:49:15 UTC] PHP Warning: include_once(/wp-content/mu-plugins/m2-disable-registration.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: Success in /wp-settings.php on line 261
    Solution:
    * There was a folder named m2-disable-registration.php with a file named m2-disable-registration.php inside of it. I renamed the folder m2-disable-registration.php to m2-disable-registration and copied the m2-disable-registration.php file into the root of your mu-plugins folder.

    The above has cleared up a good bit of the debug messages you were having. However, there are still quite a bit more that need addressed. As a matter of policy, we usually don't address fixes to custom code on the support forums. We are more than happy to address code issues with our own products however. Please see the following for more information: https://premium.wpmudev.org/manuals/using-wpmu-dev/support-vs-custom-development/

    You may want to contact the developer of your custom application and let them know that there are numerous issues with their code that is causing issues with your site.

    However, your native search has been restored and I've not experienced any further 500 Internal Server Errors while browsing on your site.

    I hope this clarifies a bit.

    Best regards,

    James Morris

    VirtualArtists

    Awesome support - thanks for your effort

    The above has cleared up a good bit of the debug messages you were having. However, there are still quite a bit more that need addressed. As a matter of policy, we usually don't address fixes to custom code on the support forums.

    RE: Further Cutom Debugging: You mentioned more work needs to be done to clear remaining errors in our site. We understand that is custom work.

    Does WPMU have a department or team that we can hire to perform this type of "custom work"?

    James Morris

    Hello VirtualArtists,

    Unfortunately, WPMU DEV does not contract out for jobs like this because our Dev Team is focused on improving our product offerings. However, as a service to our community members, we have a Jobs & Pros board where fellow members can provide their dev services or post a job request. This would be a great place to get help with your custom application.

    Best regards,

    James Morris