Automattic / Automattic/jetpack

Latest Instagram Posts Block: does not work when site is set to private

Open
#22,767 2 comments 0 reactions 0 assignees View on GitHub
[Block] Latest Instagram Posts [Platform] Atomic [Platform] Simple [Plugin] Jetpack [Pri] Low Bug Customer Report [LEGACY] Triaged
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

### Impacted plugin

Jetpack

### Steps to Reproduce

1. Start with a WoA site
2. In Settings > General, mark your site as private
3. Go to Posts > Add New and insert a new Instagram Posts block
4. Upon selecting your Instagram account, you will see that the `wp-json/wpcom/v2/instagram-gallery/gallery` requests fails, and the block reloads.

The request sends back the following response:

```json
{"code":"instagram_connection_unavailable","message":"The requested Instagram connection is not available anymore.","data":403}
```

------

https://github.com/Automattic/jetpack/blob/26db3e436ccca3e16a62d02d95e792a81f38a1e4/projects/plugins/jetpack/_inc/lib/class-jetpack-instagram-gallery-helper.php#L62-L70
https://github.com/Automattic/jetpack/blob/26db3e436ccca3e16a62d02d95e792a81f38a1e4/projects/plugins/jetpack/_inc/lib/class-jetpack-instagram-gallery-helper.php#L37-L43

------

Related: #16370

Contributor guide

Open the contributing guide

Research direction

Start with projects/plugins/jetpack/_inc/lib/class-jetpack-instagram-gallery-helper.php at the linked lines, then reproduce the failing wp-json/wpcom/v2/instagram-gallery/gallery request on a private WoA site. Compare the private-site behavior with a public site; done means selecting an Instagram account loads the Instagram Posts block without the 403 error or reload.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.