Automattic / Automattic/jetpack
Sharing: make unneeded external HTTP call even when email is not enabled
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
#### Steps to reproduce the issue
1. Install Query Monitor plugin
2. Enable share module without email service
3. Go to a post page
4. When the time is very long to load the page like:

5. Hover the area in the image above & there should be something like "HTTP API Calls (1)", click on it
6. You will see the one in the screenshot section below
#### What I expected
No HTTP call should be made on the server side
#### What happened instead
While getting a list of all services, it made a call to akismet by `Jetpack::is_akismet_active`:
https://github.com/Automattic/jetpack/blob/master/modules/sharedaddy/sharing-service.php#L83-L85
if ( apply_filters( 'sharing_services_email', Jetpack::is_akismet_active() ) ) {
$services['email'] = 'Share_Email';
}
**Screenshots**
If applicable, add screenshots to help explain your problem.
The email service is not enabled, but a HTTP call to akismet is still made:

Contributor guide
Research direction
The relevant logic is in modules/sharedaddy/sharing-service.php at lines 83-85, where the sharing services are assembled. Reproduce the issue with Query Monitor while the email service is disabled, then verify that loading a post page makes no HTTP call to Akismet when email sharing is unavailable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100