Commit 930dea3
authored
AMP: check if the class exists before to use it (#12139)
Summary:
After adding the AMP compat file that ships with Jetpack (this was done in D22313, D26814, D26819, D26921, and D26928), let's start using this class.
This replaces D22154 and D23501, and allows us to start syncing any future changes that would rely on the Jetpack_AMP_Support class.
Related Jetpack PRs:
- #10945
- #11195, which reverted some of the changes in the PR above.
- #12054
- #12053
- #12026
Discussion:
- https://[private link]
We'll need to test for issues like the ones that popped up on Jetpack at the time:
#11169
We will also need to account for the fact that WordPress.com does not run the latest version of the AMP plugin. It runs an old version (0.6.2 vs. the current version on W.org 1.0.2), with its own version of some of the compatibility fixes that come with the class we've added (see [[ https://[private link].php | here ]]) and needs to be updated as per the discussions here:
- https://[private link] (D14521)
- https://[private link]
Test Plan:
* Create a post with a gallery
* Add a Facebook sharing button to that post.
* Try Liking that post.
* Comment on one of the images in the gallery.
* Load the post in an AMP view, and repeat the steps below.
In all cases:
- You should not see any js errors in the browser console.
- You should not get any PHP notices in your debug log.
Reviewers: zinigor
Tags: #touches_jetpack_files
Differential Revision: D26821-code
This commit syncs r190790-wpcom.1 parent 0d600fe commit 930dea3
3 files changed
+37
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
157 | 160 | | |
158 | 161 | | |
159 | 162 | | |
| |||
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
211 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
212 | 218 | | |
213 | 219 | | |
214 | 220 | | |
| |||
354 | 360 | | |
355 | 361 | | |
356 | 362 | | |
357 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
358 | 367 | | |
359 | 368 | | |
360 | 369 | | |
| |||
372 | 381 | | |
373 | 382 | | |
374 | 383 | | |
375 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
376 | 388 | | |
377 | 389 | | |
378 | 390 | | |
| |||
426 | 438 | | |
427 | 439 | | |
428 | 440 | | |
429 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
430 | 445 | | |
431 | 446 | | |
432 | 447 | | |
| |||
498 | 513 | | |
499 | 514 | | |
500 | 515 | | |
501 | | - | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
502 | 520 | | |
503 | 521 | | |
504 | 522 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1604 | 1604 | | |
1605 | 1605 | | |
1606 | 1606 | | |
1607 | | - | |
1608 | | - | |
1609 | | - | |
1610 | | - | |
1611 | | - | |
1612 | | - | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
1613 | 1616 | | |
1614 | 1617 | | |
1615 | 1618 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | | - | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
579 | 582 | | |
580 | 583 | | |
581 | 584 | | |
| |||
0 commit comments