Automattic / Automattic/jetpack
Jetpack Breaks Frontenberg By Loading wp-admin/includes/post.php
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
#### Steps to reproduce the issue
1. Install Frontenberg and Jetpack
2. Access any URL that has more than one level e.g. `/foo/bar`
3. HTTP 500
#### What I expected
For Jetpack to not influence the page
#### What happened instead
```
Sentry\Exception\FatalErrorException: Error: Cannot redeclare wp_check_post_lock() (previously declared in /srv/www/tomjn.com/htdocs/wp-content/themes/Frontenberg/includes/shims.php:84)
#0 /wp-admin/includes/post.php(1592): null
```
Because Jetpack loaded it here:
https://github.com/Automattic/jetpack/blob/master/projects/plugins/jetpack/sal/class.json-api-post-base.php#L12
---
`SAL_Post` might need this file, but `SAL_Post` isn't always needed, **_but it's loaded anyway_**, as is `wp-admin/includes.post.php`.
At this point I can't load that file myself to avoid the problem as it then triggers a large chain of dependent files. Eitherway this is a frontend UI that has nothing to do with `SAL_Post` and its child classes. Unless this gets fixed I'm going to have to write an option filter to strip Jetpack out of the active plugin list when Frontenberg runs :/ Removing the shim breaks Frontenberg too
Contributor guide
Assessment
This issue has not been assessed yet.