-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WPINC is not defined. Plugin causes white screen. #14
Comments
WPINC is defined in wp-settings.php and should be called in any standard WP installation. Besides, this is simply to prevent the file from being called directly. |
Becauase the plugin is loaded using Composer Autoload, because we use Bedrock, because of the reasons above... WPINC is not always defined. ABSPATH does the same thing. @see https://wordpress.stackexchange.com/questions/108418/what-are-the-differences-between-wpinc-and-abspath |
You have a number of moving pieces present. Having a file make use of Composer’s autoloader does not call the file directly, it allows the class to be autoloaded if/when someone calls the class eliminating the need for a I confess I no nothing of Bedrock, but I do know that in the usual manner of running WordPress the All this said, I don’t have a strong feeling one way or another and I’ll wait for @collizo4sky to weigh in, but my gut tells me something in Bedrock is loading WP without the wp-settings.php file. |
Bedrock might not be standard, but it is best practices for web development IMHO. The issue is that the bootstrapping starts here: https://github.com/roots/bedrock/blob/master/web/wp-config.php This plugin, being Composer compatible (2018, yay!), will get initialized by `vendor/autoload.php' before wp-settings.php is called. |
@afragen I'm going to open an issue on Bedrock. I looked at your plugins. The GitHub one uses this convention as well. From what you say, seems like this convention is common and maybe this is a Bedrock issue. Thanks for the info. |
Related: roots/bedrock#343 |
Fixed. 067589b
|
I had this issue in my ProfilePress plugin. I had to fix it by adding this line I just need to update the code to Thanks @afragen for the fix for bedrock users |
The first 3 lines of this plugin do:
If you look at the WordPress Code you can see that
WPINC
is maybe defined in the 3rd condition. We are setup using https://roots.io/bedrock/ and this plugin is autoloaded using Composer, thereforeWPINC
is never defined anddie
causes a "white screen of death"Please use
ABSPATH
instead.The text was updated successfully, but these errors were encountered: