0

For some reason my plugin is causing the /wp-admin/ to not redirect to wp-login.php as it should. I've narrowed it down to these two lines of code:

foreach( glob($this->path['modules_dir'] . '*/_*.php') as $class_path )
    require_once( $class_path );

I'm not sure if its the glob() function or what, but locally this is not an issue but once live on hosting it is an issue. The host is using PHP Version 5.4.20 and its is A2 Hosting in case those details help.

If there is anything else that can help leave a comment and I'll add. This is very frustrating because there is nothing in error logs or anywhere that would suggest an issue, it just simply doesn't work

Thanks in advance for any help you can provide.

Background

The Div Library plugin is library that I'm developing, it is an activated plugin that essentially doesn't do anything except make an extended library of functionality available for developers to use when creating custom solutions for projects, you can review the git repo, but essentially it is instantiated like this:

if(class_exists('div_library')){
    return $library = div_library::instance(); #singleton
}

Then at the end of construction it fires the action:

// Div Library loading complete
do_action( 'divlibrary_loaded', $this );

After this, in the mu-plugins a developer would create their custom business logic for the site using the classes available from Div Library (optional). Div Starter is the companion to the library, it is a child-like boilerplate for developing with Div Library and it auto-loads the add-ons and modules (CPT build-outs) using this glob() method as you can see. I've never had a problem till now, and even now it is only on A2 hosting that it appears. Hope that helps fill in any blanks

2
  • What happens instead of the redirect? (I assume you mean the core redirect when non logged in users try to get to admin pages) How is this code hooked in? Post it in more context please.
    – s_ha_dum
    Oct 23 '14 at 21:34
  • Yes when not logged in it just remains on /wp-admin/ as a blank page. The code base is here if that helps. This is in mu-plugins hooked to an action from the Div Library plugin on the divlibrary_loaded action. (NOTE: Div Library isn't hooked anywhere). Oct 23 '14 at 21:40
0

Well the good news is I found the answer, the bad news is the answer is so lame. Apparently I have some ACF Field export files with multiple field groups each wrapped in their own <?php ?> wrapper. Well there was a line break between the two like so:

?>

<?php

And that was enough to break every thing. Lame right? So if you come across this check for white spaces or look for a way to have your host not be so picky about them :P

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.