Description
Contact Form 7 can causing Fatal error: Uncaught Error: Call to a member function get_extra_permastruct() on null in /path/to/wp-includes/link-template.php on line 274
if installed as mu-plugins
on very first time the site run after being installed.
Steps to reproduce
- Install brand new bedrock site
- Add
wpackagist-plugin/contact-form-7
line in extra.installer-paths.web/app/mu-plugins/{$name}/
of your composer.json
file. Like this:
{
"extra": {
"installer-paths": {
"public/app/mu-plugins/{$name}/": [
"wpackagist-plugin/contact-form-7",
"type:wordpress-muplugin"
],
"public/app/plugins/{$name}/": ["type:wordpress-plugin"],
"public/app/themes/{$name}/": ["type:wordpress-theme"]
},
"wordpress-install-dir": "public/wp"
}
}
- Install Contact Form 7 using
composer require wpackagist-plugin/contact-form-7
command
- Setup database and update your
.env
file
- Run
wp core install ...
- Visit the website url from browser or try to run another
wp-cli
commands.
Expected behavior: This should not happened
Actual behavior: As described above
Reproduces how often: The issue only happened on the very first time after installing WordPress core, in my case using wp core install
command. It could simply reload the page or re-run the same wpcli command and it's just completely gone.
Versions
Any version of autoloader. Since this autoloader still included on bedrock repository, to be exact. And it's happens anywhere. I meant, my local is running Windows & WSL (ubuntu 18.04), also it happened on CI (github action with ubuntu-latest image) and Heroku. See feryardiant/wpdev#39
Additional information
I'm not sure if the issue was solely because of this autoloader, it might be because of latest update of contact-form-7 plugin as well.
Apology for my poor english, I'm doing my best ๐
Sincerely ๐ฌ