AMP for WP – Accelerated Mobile Pages - Version 0.9.72

Version Description

(6th January 2018, Happy New Year) = * View More details on https://ampforwp.com/0-9-72-released-stability-update-77th-update * Related Posts Image stretching in Design 3 AMP theme Framework#1482 * RTL option must be integrated into AMP theme Framework#1562 * DOMDocument::loadHTML(): Attribute itemprop redefined warning fixed#1539 * Created an option to add Author bio article in Facebook Instant Article #1521 * Options to add push notification button above and below the content #1571 * Copy the Content button for Custom Post types #1532 * Alexa Metrics Compatibility added #1536 * Logo styling added with amp_logo. So styling can work with AMP Theme Framework. #1520 * Content parsing login improved, so it will not through any warnings if the content has only 1 paragraph.#1523 * Debug Warnings removed #1564 * Caption in the Gallery creating validation errors Fixed. #1549 * Tables Link color should be as same as the link of the body #1559 * Separate options for In-Content related posts #1546 * WebPage Schema Type added in Structured Data options #1558 * Fatal Error fixed with mb_detect_encoding() after enabling the minify option #1494 * Content blank or fatal errors due to itemscope and itemtype, fixed. #1570 * Performance improved. Due to _transient__redux_activation_redirect transient.#1526

Download this release

Release Info

Developer mohammed_kaludi
Plugin Icon 128x128 AMP for WP – Accelerated Mobile Pages
Version 0.9.72
Comparing to
See all releases

Code changes from version 0.9.71 to 0.9.72

Files changed (37) hide show
  1. LICENSE +357 -357
  2. README.md +1348 -1228
  3. accelerated-moblie-pages.php +634 -637
  4. base_remover/base_remover.php +134 -134
  5. base_remover/dependencyScript.js +20 -20
  6. classes/class-ampforwp-youtube-embed.php +132 -132
  7. classes/class-init.php +10 -10
  8. components/author-box/author-box.php +82 -82
  9. components/call-now/call-now.php +15 -15
  10. components/categories-tags/categories-tags.php +44 -44
  11. components/comments/comments.php +180 -180
  12. components/components-core.php +399 -383
  13. components/featured-image/featured-image.php +28 -28
  14. components/logo/logo.php +47 -41
  15. components/loop/loop.php +298 -298
  16. components/menu/menu.php +16 -16
  17. components/post-navigation/post-navigation.php +26 -26
  18. components/post-pagination/post-pagination.php +175 -175
  19. components/related-posts/related-posts.php +126 -126
  20. components/search/search.php +26 -26
  21. components/sidebar/sidebar.php +78 -78
  22. components/social-icons/fonts/icomoon.svg +21 -21
  23. components/social-icons/social-icons.php +160 -160
  24. components/theme-loader.php +98 -98
  25. feeds/instant-article-feed.php +55 -55
  26. includes/admin-script.js +95 -95
  27. includes/admin-style.css +134 -134
  28. includes/disqus.php +91 -91
  29. includes/includes.php +55 -55
  30. includes/modules/ampforwp-blurb.php +195 -195
  31. includes/modules/ampforwp-button.php +251 -251
  32. includes/modules/js/amp.js +158 -158
  33. includes/newsletter.php +131 -131
  34. includes/onesignal-integration/OneSignalSDKWorker.js +0 -2
  35. includes/onesignal-integration/amp-helper-frame.html +6 -31
  36. includes/onesignal-integration/amp-permission-dialog.html +6 -158
  37. includes/options/admin-config.php +517 -3380
LICENSE CHANGED
@@ -1,357 +1,357 @@
1
- This program is free software; you can redistribute it and/or modify
2
- it under the terms of the GNU General Public License as published by
3
- the Free Software Foundation; either version 2 of the License, or
4
- (at your option) any later version.
5
-
6
- This program is distributed in the hope that it will be useful,
7
- but WITHOUT ANY WARRANTY; without even the implied warranty of
8
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
- GNU General Public License for more details.
10
-
11
- You should have received a copy of the GNU General Public License
12
- along with this program; if not, write to the Free Software
13
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
14
-
15
-
16
- ===================================
17
-
18
- GNU GENERAL PUBLIC LICENSE
19
- Version 2, June 1991
20
-
21
- Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
22
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
- Everyone is permitted to copy and distribute verbatim copies
24
- of this license document, but changing it is not allowed.
25
-
26
- Preamble
27
-
28
- The licenses for most software are designed to take away your
29
- freedom to share and change it. By contrast, the GNU General Public
30
- License is intended to guarantee your freedom to share and change free
31
- software--to make sure the software is free for all its users. This
32
- General Public License applies to most of the Free Software
33
- Foundation's software and to any other program whose authors commit to
34
- using it. (Some other Free Software Foundation software is covered by
35
- the GNU Lesser General Public License instead.) You can apply it to
36
- your programs, too.
37
-
38
- When we speak of free software, we are referring to freedom, not
39
- price. Our General Public Licenses are designed to make sure that you
40
- have the freedom to distribute copies of free software (and charge for
41
- this service if you wish), that you receive source code or can get it
42
- if you want it, that you can change the software or use pieces of it
43
- in new free programs; and that you know you can do these things.
44
-
45
- To protect your rights, we need to make restrictions that forbid
46
- anyone to deny you these rights or to ask you to surrender the rights.
47
- These restrictions translate to certain responsibilities for you if you
48
- distribute copies of the software, or if you modify it.
49
-
50
- For example, if you distribute copies of such a program, whether
51
- gratis or for a fee, you must give the recipients all the rights that
52
- you have. You must make sure that they, too, receive or can get the
53
- source code. And you must show them these terms so they know their
54
- rights.
55
-
56
- We protect your rights with two steps: (1) copyright the software, and
57
- (2) offer you this license which gives you legal permission to copy,
58
- distribute and/or modify the software.
59
-
60
- Also, for each author's protection and ours, we want to make certain
61
- that everyone understands that there is no warranty for this free
62
- software. If the software is modified by someone else and passed on, we
63
- want its recipients to know that what they have is not the original, so
64
- that any problems introduced by others will not reflect on the original
65
- authors' reputations.
66
-
67
- Finally, any free program is threatened constantly by software
68
- patents. We wish to avoid the danger that redistributors of a free
69
- program will individually obtain patent licenses, in effect making the
70
- program proprietary. To prevent this, we have made it clear that any
71
- patent must be licensed for everyone's free use or not licensed at all.
72
-
73
- The precise terms and conditions for copying, distribution and
74
- modification follow.
75
-
76
- GNU GENERAL PUBLIC LICENSE
77
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
78
-
79
- 0. This License applies to any program or other work which contains
80
- a notice placed by the copyright holder saying it may be distributed
81
- under the terms of this General Public License. The "Program", below,
82
- refers to any such program or work, and a "work based on the Program"
83
- means either the Program or any derivative work under copyright law:
84
- that is to say, a work containing the Program or a portion of it,
85
- either verbatim or with modifications and/or translated into another
86
- language. (Hereinafter, translation is included without limitation in
87
- the term "modification".) Each licensee is addressed as "you".
88
-
89
- Activities other than copying, distribution and modification are not
90
- covered by this License; they are outside its scope. The act of
91
- running the Program is not restricted, and the output from the Program
92
- is covered only if its contents constitute a work based on the
93
- Program (independent of having been made by running the Program).
94
- Whether that is true depends on what the Program does.
95
-
96
- 1. You may copy and distribute verbatim copies of the Program's
97
- source code as you receive it, in any medium, provided that you
98
- conspicuously and appropriately publish on each copy an appropriate
99
- copyright notice and disclaimer of warranty; keep intact all the
100
- notices that refer to this License and to the absence of any warranty;
101
- and give any other recipients of the Program a copy of this License
102
- along with the Program.
103
-
104
- You may charge a fee for the physical act of transferring a copy, and
105
- you may at your option offer warranty protection in exchange for a fee.
106
-
107
- 2. You may modify your copy or copies of the Program or any portion
108
- of it, thus forming a work based on the Program, and copy and
109
- distribute such modifications or work under the terms of Section 1
110
- above, provided that you also meet all of these conditions:
111
-
112
- a) You must cause the modified files to carry prominent notices
113
- stating that you changed the files and the date of any change.
114
-
115
- b) You must cause any work that you distribute or publish, that in
116
- whole or in part contains or is derived from the Program or any
117
- part thereof, to be licensed as a whole at no charge to all third
118
- parties under the terms of this License.
119
-
120
- c) If the modified program normally reads commands interactively
121
- when run, you must cause it, when started running for such
122
- interactive use in the most ordinary way, to print or display an
123
- announcement including an appropriate copyright notice and a
124
- notice that there is no warranty (or else, saying that you provide
125
- a warranty) and that users may redistribute the program under
126
- these conditions, and telling the user how to view a copy of this
127
- License. (Exception: if the Program itself is interactive but
128
- does not normally print such an announcement, your work based on
129
- the Program is not required to print an announcement.)
130
-
131
- These requirements apply to the modified work as a whole. If
132
- identifiable sections of that work are not derived from the Program,
133
- and can be reasonably considered independent and separate works in
134
- themselves, then this License, and its terms, do not apply to those
135
- sections when you distribute them as separate works. But when you
136
- distribute the same sections as part of a whole which is a work based
137
- on the Program, the distribution of the whole must be on the terms of
138
- this License, whose permissions for other licensees extend to the
139
- entire whole, and thus to each and every part regardless of who wrote it.
140
-
141
- Thus, it is not the intent of this section to claim rights or contest
142
- your rights to work written entirely by you; rather, the intent is to
143
- exercise the right to control the distribution of derivative or
144
- collective works based on the Program.
145
-
146
- In addition, mere aggregation of another work not based on the Program
147
- with the Program (or with a work based on the Program) on a volume of
148
- a storage or distribution medium does not bring the other work under
149
- the scope of this License.
150
-
151
- 3. You may copy and distribute the Program (or a work based on it,
152
- under Section 2) in object code or executable form under the terms of
153
- Sections 1 and 2 above provided that you also do one of the following:
154
-
155
- a) Accompany it with the complete corresponding machine-readable
156
- source code, which must be distributed under the terms of Sections
157
- 1 and 2 above on a medium customarily used for software interchange; or,
158
-
159
- b) Accompany it with a written offer, valid for at least three
160
- years, to give any third party, for a charge no more than your
161
- cost of physically performing source distribution, a complete
162
- machine-readable copy of the corresponding source code, to be
163
- distributed under the terms of Sections 1 and 2 above on a medium
164
- customarily used for software interchange; or,
165
-
166
- c) Accompany it with the information you received as to the offer
167
- to distribute corresponding source code. (This alternative is
168
- allowed only for noncommercial distribution and only if you
169
- received the program in object code or executable form with such
170
- an offer, in accord with Subsection b above.)
171
-
172
- The source code for a work means the preferred form of the work for
173
- making modifications to it. For an executable work, complete source
174
- code means all the source code for all modules it contains, plus any
175
- associated interface definition files, plus the scripts used to
176
- control compilation and installation of the executable. However, as a
177
- special exception, the source code distributed need not include
178
- anything that is normally distributed (in either source or binary
179
- form) with the major components (compiler, kernel, and so on) of the
180
- operating system on which the executable runs, unless that component
181
- itself accompanies the executable.
182
-
183
- If distribution of executable or object code is made by offering
184
- access to copy from a designated place, then offering equivalent
185
- access to copy the source code from the same place counts as
186
- distribution of the source code, even though third parties are not
187
- compelled to copy the source along with the object code.
188
-
189
- 4. You may not copy, modify, sublicense, or distribute the Program
190
- except as expressly provided under this License. Any attempt
191
- otherwise to copy, modify, sublicense or distribute the Program is
192
- void, and will automatically terminate your rights under this License.
193
- However, parties who have received copies, or rights, from you under
194
- this License will not have their licenses terminated so long as such
195
- parties remain in full compliance.
196
-
197
- 5. You are not required to accept this License, since you have not
198
- signed it. However, nothing else grants you permission to modify or
199
- distribute the Program or its derivative works. These actions are
200
- prohibited by law if you do not accept this License. Therefore, by
201
- modifying or distributing the Program (or any work based on the
202
- Program), you indicate your acceptance of this License to do so, and
203
- all its terms and conditions for copying, distributing or modifying
204
- the Program or works based on it.
205
-
206
- 6. Each time you redistribute the Program (or any work based on the
207
- Program), the recipient automatically receives a license from the
208
- original licensor to copy, distribute or modify the Program subject to
209
- these terms and conditions. You may not impose any further
210
- restrictions on the recipients' exercise of the rights granted herein.
211
- You are not responsible for enforcing compliance by third parties to
212
- this License.
213
-
214
- 7. If, as a consequence of a court judgment or allegation of patent
215
- infringement or for any other reason (not limited to patent issues),
216
- conditions are imposed on you (whether by court order, agreement or
217
- otherwise) that contradict the conditions of this License, they do not
218
- excuse you from the conditions of this License. If you cannot
219
- distribute so as to satisfy simultaneously your obligations under this
220
- License and any other pertinent obligations, then as a consequence you
221
- may not distribute the Program at all. For example, if a patent
222
- license would not permit royalty-free redistribution of the Program by
223
- all those who receive copies directly or indirectly through you, then
224
- the only way you could satisfy both it and this License would be to
225
- refrain entirely from distribution of the Program.
226
-
227
- If any portion of this section is held invalid or unenforceable under
228
- any particular circumstance, the balance of the section is intended to
229
- apply and the section as a whole is intended to apply in other
230
- circumstances.
231
-
232
- It is not the purpose of this section to induce you to infringe any
233
- patents or other property right claims or to contest validity of any
234
- such claims; this section has the sole purpose of protecting the
235
- integrity of the free software distribution system, which is
236
- implemented by public license practices. Many people have made
237
- generous contributions to the wide range of software distributed
238
- through that system in reliance on consistent application of that
239
- system; it is up to the author/donor to decide if he or she is willing
240
- to distribute software through any other system and a licensee cannot
241
- impose that choice.
242
-
243
- This section is intended to make thoroughly clear what is believed to
244
- be a consequence of the rest of this License.
245
-
246
- 8. If the distribution and/or use of the Program is restricted in
247
- certain countries either by patents or by copyrighted interfaces, the
248
- original copyright holder who places the Program under this License
249
- may add an explicit geographical distribution limitation excluding
250
- those countries, so that distribution is permitted only in or among
251
- countries not thus excluded. In such case, this License incorporates
252
- the limitation as if written in the body of this License.
253
-
254
- 9. The Free Software Foundation may publish revised and/or new versions
255
- of the General Public License from time to time. Such new versions will
256
- be similar in spirit to the present version, but may differ in detail to
257
- address new problems or concerns.
258
-
259
- Each version is given a distinguishing version number. If the Program
260
- specifies a version number of this License which applies to it and "any
261
- later version", you have the option of following the terms and conditions
262
- either of that version or of any later version published by the Free
263
- Software Foundation. If the Program does not specify a version number of
264
- this License, you may choose any version ever published by the Free Software
265
- Foundation.
266
-
267
- 10. If you wish to incorporate parts of the Program into other free
268
- programs whose distribution conditions are different, write to the author
269
- to ask for permission. For software which is copyrighted by the Free
270
- Software Foundation, write to the Free Software Foundation; we sometimes
271
- make exceptions for this. Our decision will be guided by the two goals
272
- of preserving the free status of all derivatives of our free software and
273
- of promoting the sharing and reuse of software generally.
274
-
275
- NO WARRANTY
276
-
277
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
278
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
279
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
280
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
281
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
282
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
283
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
284
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
285
- REPAIR OR CORRECTION.
286
-
287
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
288
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
289
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
290
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
291
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
292
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
293
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
294
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
295
- POSSIBILITY OF SUCH DAMAGES.
296
-
297
- END OF TERMS AND CONDITIONS
298
-
299
- How to Apply These Terms to Your New Programs
300
-
301
- If you develop a new program, and you want it to be of the greatest
302
- possible use to the public, the best way to achieve this is to make it
303
- free software which everyone can redistribute and change under these terms.
304
-
305
- To do so, attach the following notices to the program. It is safest
306
- to attach them to the start of each source file to most effectively
307
- convey the exclusion of warranty; and each file should have at least
308
- the "copyright" line and a pointer to where the full notice is found.
309
-
310
- {description}
311
- Copyright (C) {year} {fullname}
312
-
313
- This program is free software; you can redistribute it and/or modify
314
- it under the terms of the GNU General Public License as published by
315
- the Free Software Foundation; either version 2 of the License, or
316
- (at your option) any later version.
317
-
318
- This program is distributed in the hope that it will be useful,
319
- but WITHOUT ANY WARRANTY; without even the implied warranty of
320
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
321
- GNU General Public License for more details.
322
-
323
- You should have received a copy of the GNU General Public License along
324
- with this program; if not, write to the Free Software Foundation, Inc.,
325
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
326
-
327
- Also add information on how to contact you by electronic and paper mail.
328
-
329
- If the program is interactive, make it output a short notice like this
330
- when it starts in an interactive mode:
331
-
332
- Gnomovision version 69, Copyright (C) year name of author
333
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
334
- This is free software, and you are welcome to redistribute it
335
- under certain conditions; type `show c' for details.
336
-
337
- The hypothetical commands `show w' and `show c' should show the appropriate
338
- parts of the General Public License. Of course, the commands you use may
339
- be called something other than `show w' and `show c'; they could even be
340
- mouse-clicks or menu items--whatever suits your program.
341
-
342
- You should also get your employer (if you work as a programmer) or your
343
- school, if any, to sign a "copyright disclaimer" for the program, if
344
- necessary. Here is a sample; alter the names:
345
-
346
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
347
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
348
-
349
- {signature of Ty Coon}, 1 April 1989
350
- Ty Coon, President of Vice
351
-
352
- This General Public License does not permit incorporating your program into
353
- proprietary programs. If your program is a subroutine library, you may
354
- consider it more useful to permit linking proprietary applications with the
355
- library. If this is what you want to do, use the GNU Lesser General
356
- Public License instead of this License.
357
-
1
+ This program is free software; you can redistribute it and/or modify
2
+ it under the terms of the GNU General Public License as published by
3
+ the Free Software Foundation; either version 2 of the License, or
4
+ (at your option) any later version.
5
+
6
+ This program is distributed in the hope that it will be useful,
7
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
8
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
+ GNU General Public License for more details.
10
+
11
+ You should have received a copy of the GNU General Public License
12
+ along with this program; if not, write to the Free Software
13
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
14
+
15
+
16
+ ===================================
17
+
18
+ GNU GENERAL PUBLIC LICENSE
19
+ Version 2, June 1991
20
+
21
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
22
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
+ Everyone is permitted to copy and distribute verbatim copies
24
+ of this license document, but changing it is not allowed.
25
+
26
+ Preamble
27
+
28
+ The licenses for most software are designed to take away your
29
+ freedom to share and change it. By contrast, the GNU General Public
30
+ License is intended to guarantee your freedom to share and change free
31
+ software--to make sure the software is free for all its users. This
32
+ General Public License applies to most of the Free Software
33
+ Foundation's software and to any other program whose authors commit to
34
+ using it. (Some other Free Software Foundation software is covered by
35
+ the GNU Lesser General Public License instead.) You can apply it to
36
+ your programs, too.
37
+
38
+ When we speak of free software, we are referring to freedom, not
39
+ price. Our General Public Licenses are designed to make sure that you
40
+ have the freedom to distribute copies of free software (and charge for
41
+ this service if you wish), that you receive source code or can get it
42
+ if you want it, that you can change the software or use pieces of it
43
+ in new free programs; and that you know you can do these things.
44
+
45
+ To protect your rights, we need to make restrictions that forbid
46
+ anyone to deny you these rights or to ask you to surrender the rights.
47
+ These restrictions translate to certain responsibilities for you if you
48
+ distribute copies of the software, or if you modify it.
49
+
50
+ For example, if you distribute copies of such a program, whether
51
+ gratis or for a fee, you must give the recipients all the rights that
52
+ you have. You must make sure that they, too, receive or can get the
53
+ source code. And you must show them these terms so they know their
54
+ rights.
55
+
56
+ We protect your rights with two steps: (1) copyright the software, and
57
+ (2) offer you this license which gives you legal permission to copy,
58
+ distribute and/or modify the software.
59
+
60
+ Also, for each author's protection and ours, we want to make certain
61
+ that everyone understands that there is no warranty for this free
62
+ software. If the software is modified by someone else and passed on, we
63
+ want its recipients to know that what they have is not the original, so
64
+ that any problems introduced by others will not reflect on the original
65
+ authors' reputations.
66
+
67
+ Finally, any free program is threatened constantly by software
68
+ patents. We wish to avoid the danger that redistributors of a free
69
+ program will individually obtain patent licenses, in effect making the
70
+ program proprietary. To prevent this, we have made it clear that any
71
+ patent must be licensed for everyone's free use or not licensed at all.
72
+
73
+ The precise terms and conditions for copying, distribution and
74
+ modification follow.
75
+
76
+ GNU GENERAL PUBLIC LICENSE
77
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
78
+
79
+ 0. This License applies to any program or other work which contains
80
+ a notice placed by the copyright holder saying it may be distributed
81
+ under the terms of this General Public License. The "Program", below,
82
+ refers to any such program or work, and a "work based on the Program"
83
+ means either the Program or any derivative work under copyright law:
84
+ that is to say, a work containing the Program or a portion of it,
85
+ either verbatim or with modifications and/or translated into another
86
+ language. (Hereinafter, translation is included without limitation in
87
+ the term "modification".) Each licensee is addressed as "you".
88
+
89
+ Activities other than copying, distribution and modification are not
90
+ covered by this License; they are outside its scope. The act of
91
+ running the Program is not restricted, and the output from the Program
92
+ is covered only if its contents constitute a work based on the
93
+ Program (independent of having been made by running the Program).
94
+ Whether that is true depends on what the Program does.
95
+
96
+ 1. You may copy and distribute verbatim copies of the Program's
97
+ source code as you receive it, in any medium, provided that you
98
+ conspicuously and appropriately publish on each copy an appropriate
99
+ copyright notice and disclaimer of warranty; keep intact all the
100
+ notices that refer to this License and to the absence of any warranty;
101
+ and give any other recipients of the Program a copy of this License
102
+ along with the Program.
103
+
104
+ You may charge a fee for the physical act of transferring a copy, and
105
+ you may at your option offer warranty protection in exchange for a fee.
106
+
107
+ 2. You may modify your copy or copies of the Program or any portion
108
+ of it, thus forming a work based on the Program, and copy and
109
+ distribute such modifications or work under the terms of Section 1
110
+ above, provided that you also meet all of these conditions:
111
+
112
+ a) You must cause the modified files to carry prominent notices
113
+ stating that you changed the files and the date of any change.
114
+
115
+ b) You must cause any work that you distribute or publish, that in
116
+ whole or in part contains or is derived from the Program or any
117
+ part thereof, to be licensed as a whole at no charge to all third
118
+ parties under the terms of this License.
119
+
120
+ c) If the modified program normally reads commands interactively
121
+ when run, you must cause it, when started running for such
122
+ interactive use in the most ordinary way, to print or display an
123
+ announcement including an appropriate copyright notice and a
124
+ notice that there is no warranty (or else, saying that you provide
125
+ a warranty) and that users may redistribute the program under
126
+ these conditions, and telling the user how to view a copy of this
127
+ License. (Exception: if the Program itself is interactive but
128
+ does not normally print such an announcement, your work based on
129
+ the Program is not required to print an announcement.)
130
+
131
+ These requirements apply to the modified work as a whole. If
132
+ identifiable sections of that work are not derived from the Program,
133
+ and can be reasonably considered independent and separate works in
134
+ themselves, then this License, and its terms, do not apply to those
135
+ sections when you distribute them as separate works. But when you
136
+ distribute the same sections as part of a whole which is a work based
137
+ on the Program, the distribution of the whole must be on the terms of
138
+ this License, whose permissions for other licensees extend to the
139
+ entire whole, and thus to each and every part regardless of who wrote it.
140
+
141
+ Thus, it is not the intent of this section to claim rights or contest
142
+ your rights to work written entirely by you; rather, the intent is to
143
+ exercise the right to control the distribution of derivative or
144
+ collective works based on the Program.
145
+
146
+ In addition, mere aggregation of another work not based on the Program
147
+ with the Program (or with a work based on the Program) on a volume of
148
+ a storage or distribution medium does not bring the other work under
149
+ the scope of this License.
150
+
151
+ 3. You may copy and distribute the Program (or a work based on it,
152
+ under Section 2) in object code or executable form under the terms of
153
+ Sections 1 and 2 above provided that you also do one of the following:
154
+
155
+ a) Accompany it with the complete corresponding machine-readable
156
+ source code, which must be distributed under the terms of Sections
157
+ 1 and 2 above on a medium customarily used for software interchange; or,
158
+
159
+ b) Accompany it with a written offer, valid for at least three
160
+ years, to give any third party, for a charge no more than your
161
+ cost of physically performing source distribution, a complete
162
+ machine-readable copy of the corresponding source code, to be
163
+ distributed under the terms of Sections 1 and 2 above on a medium
164
+ customarily used for software interchange; or,
165
+
166
+ c) Accompany it with the information you received as to the offer
167
+ to distribute corresponding source code. (This alternative is
168
+ allowed only for noncommercial distribution and only if you
169
+ received the program in object code or executable form with such
170
+ an offer, in accord with Subsection b above.)
171
+
172
+ The source code for a work means the preferred form of the work for
173
+ making modifications to it. For an executable work, complete source
174
+ code means all the source code for all modules it contains, plus any
175
+ associated interface definition files, plus the scripts used to
176
+ control compilation and installation of the executable. However, as a
177
+ special exception, the source code distributed need not include
178
+ anything that is normally distributed (in either source or binary
179
+ form) with the major components (compiler, kernel, and so on) of the
180
+ operating system on which the executable runs, unless that component
181
+ itself accompanies the executable.
182
+
183
+ If distribution of executable or object code is made by offering
184
+ access to copy from a designated place, then offering equivalent
185
+ access to copy the source code from the same place counts as
186
+ distribution of the source code, even though third parties are not
187
+ compelled to copy the source along with the object code.
188
+
189
+ 4. You may not copy, modify, sublicense, or distribute the Program
190
+ except as expressly provided under this License. Any attempt
191
+ otherwise to copy, modify, sublicense or distribute the Program is
192
+ void, and will automatically terminate your rights under this License.
193
+ However, parties who have received copies, or rights, from you under
194
+ this License will not have their licenses terminated so long as such
195
+ parties remain in full compliance.
196
+
197
+ 5. You are not required to accept this License, since you have not
198
+ signed it. However, nothing else grants you permission to modify or
199
+ distribute the Program or its derivative works. These actions are
200
+ prohibited by law if you do not accept this License. Therefore, by
201
+ modifying or distributing the Program (or any work based on the
202
+ Program), you indicate your acceptance of this License to do so, and
203
+ all its terms and conditions for copying, distributing or modifying
204
+ the Program or works based on it.
205
+
206
+ 6. Each time you redistribute the Program (or any work based on the
207
+ Program), the recipient automatically receives a license from the
208
+ original licensor to copy, distribute or modify the Program subject to
209
+ these terms and conditions. You may not impose any further
210
+ restrictions on the recipients' exercise of the rights granted herein.
211
+ You are not responsible for enforcing compliance by third parties to
212
+ this License.
213
+
214
+ 7. If, as a consequence of a court judgment or allegation of patent
215
+ infringement or for any other reason (not limited to patent issues),
216
+ conditions are imposed on you (whether by court order, agreement or
217
+ otherwise) that contradict the conditions of this License, they do not
218
+ excuse you from the conditions of this License. If you cannot
219
+ distribute so as to satisfy simultaneously your obligations under this
220
+ License and any other pertinent obligations, then as a consequence you
221
+ may not distribute the Program at all. For example, if a patent
222
+ license would not permit royalty-free redistribution of the Program by
223
+ all those who receive copies directly or indirectly through you, then
224
+ the only way you could satisfy both it and this License would be to
225
+ refrain entirely from distribution of the Program.
226
+
227
+ If any portion of this section is held invalid or unenforceable under
228
+ any particular circumstance, the balance of the section is intended to
229
+ apply and the section as a whole is intended to apply in other
230
+ circumstances.
231
+
232
+ It is not the purpose of this section to induce you to infringe any
233
+ patents or other property right claims or to contest validity of any
234
+ such claims; this section has the sole purpose of protecting the
235
+ integrity of the free software distribution system, which is
236
+ implemented by public license practices. Many people have made
237
+ generous contributions to the wide range of software distributed
238
+ through that system in reliance on consistent application of that
239
+ system; it is up to the author/donor to decide if he or she is willing
240
+ to distribute software through any other system and a licensee cannot
241
+ impose that choice.
242
+
243
+ This section is intended to make thoroughly clear what is believed to
244
+ be a consequence of the rest of this License.
245
+
246
+ 8. If the distribution and/or use of the Program is restricted in
247
+ certain countries either by patents or by copyrighted interfaces, the
248
+ original copyright holder who places the Program under this License
249
+ may add an explicit geographical distribution limitation excluding
250
+ those countries, so that distribution is permitted only in or among
251
+ countries not thus excluded. In such case, this License incorporates
252
+ the limitation as if written in the body of this License.
253
+
254
+ 9. The Free Software Foundation may publish revised and/or new versions
255
+ of the General Public License from time to time. Such new versions will
256
+ be similar in spirit to the present version, but may differ in detail to
257
+ address new problems or concerns.
258
+
259
+ Each version is given a distinguishing version number. If the Program
260
+ specifies a version number of this License which applies to it and "any
261
+ later version", you have the option of following the terms and conditions
262
+ either of that version or of any later version published by the Free
263
+ Software Foundation. If the Program does not specify a version number of
264
+ this License, you may choose any version ever published by the Free Software
265
+ Foundation.
266
+
267
+ 10. If you wish to incorporate parts of the Program into other free
268
+ programs whose distribution conditions are different, write to the author
269
+ to ask for permission. For software which is copyrighted by the Free
270
+ Software Foundation, write to the Free Software Foundation; we sometimes
271
+ make exceptions for this. Our decision will be guided by the two goals
272
+ of preserving the free status of all derivatives of our free software and
273
+ of promoting the sharing and reuse of software generally.
274
+
275
+ NO WARRANTY
276
+
277
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
278
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
279
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
280
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
281
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
282
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
283
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
284
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
285
+ REPAIR OR CORRECTION.
286
+
287
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
288
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
289
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
290
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
291
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
292
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
293
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
294
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
295
+ POSSIBILITY OF SUCH DAMAGES.
296
+
297
+ END OF TERMS AND CONDITIONS
298
+
299
+ How to Apply These Terms to Your New Programs
300
+
301
+ If you develop a new program, and you want it to be of the greatest
302
+ possible use to the public, the best way to achieve this is to make it
303
+ free software which everyone can redistribute and change under these terms.
304
+
305
+ To do so, attach the following notices to the program. It is safest
306
+ to attach them to the start of each source file to most effectively
307
+ convey the exclusion of warranty; and each file should have at least
308
+ the "copyright" line and a pointer to where the full notice is found.
309
+
310
+ {description}
311
+ Copyright (C) {year} {fullname}
312
+
313
+ This program is free software; you can redistribute it and/or modify
314
+ it under the terms of the GNU General Public License as published by
315
+ the Free Software Foundation; either version 2 of the License, or
316
+ (at your option) any later version.
317
+
318
+ This program is distributed in the hope that it will be useful,
319
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
320
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
321
+ GNU General Public License for more details.
322
+
323
+ You should have received a copy of the GNU General Public License along
324
+ with this program; if not, write to the Free Software Foundation, Inc.,
325
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
326
+
327
+ Also add information on how to contact you by electronic and paper mail.
328
+
329
+ If the program is interactive, make it output a short notice like this
330
+ when it starts in an interactive mode:
331
+
332
+ Gnomovision version 69, Copyright (C) year name of author
333
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
334
+ This is free software, and you are welcome to redistribute it
335
+ under certain conditions; type `show c' for details.
336
+
337
+ The hypothetical commands `show w' and `show c' should show the appropriate
338
+ parts of the General Public License. Of course, the commands you use may
339
+ be called something other than `show w' and `show c'; they could even be
340
+ mouse-clicks or menu items--whatever suits your program.
341
+
342
+ You should also get your employer (if you work as a programmer) or your
343
+ school, if any, to sign a "copyright disclaimer" for the program, if
344
+ necessary. Here is a sample; alter the names:
345
+
346
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
347
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
348
+
349
+ {signature of Ty Coon}, 1 April 1989
350
+ Ty Coon, President of Vice
351
+
352
+ This General Public License does not permit incorporating your program into
353
+ proprietary programs. If your program is a subroutine library, you may
354
+ consider it more useful to permit linking proprietary applications with the
355
+ library. If this is what you want to do, use the GNU Lesser General
356
+ Public License instead of this License.
357
+
README.md CHANGED
@@ -1,1228 +1,1348 @@
1
- === AMP for WP - Accelerated Mobile Pages ===
2
- Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
3
- Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
4
- Donate link: https://www.paypal.me/Kaludi/25
5
- Requires at least: 3.0
6
- Tested up to: 4.8.3
7
- Stable tag: 0.9.67.0
8
- License: GPLv2 or later
9
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
-
11
- AMP for WP is the most recommended AMP plugin by the community. Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on your WordPress site.
12
-
13
- == Description ==
14
- AMP for WP automatically adds Accelerated Mobile Pages (Google AMP Project) functionality to your WordPress site. AMP makes your website faster for Mobile visitors.
15
-
16
- [What's New in this Version?](http://ampforwp.com/new/) | [Priority Support](https://ampforwp.com/priority-support/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin) | [View Demo](https://demo.ampforwp.com/amp/) | [Screenshots](https://wordpress.org/plugins/accelerated-mobile-pages/screenshots/) | [Community](http://ampforwp.com/community/)
17
-
18
- [youtube https://www.youtube.com/watch?v=Em1nsE_KaKw]
19
-
20
- [youtube https://www.youtube.com/watch?v=vAGPFKKm5G4]
21
-
22
- <strong>Extensions</strong><br>
23
- Some useful extensions to extend AMP features, check [AMP Adsense Support](https://ampforwp.com/advanced-amp-ads/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin), [Contact Form 7 Support](https://ampforwp.com/contact-form-7/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin), [Email Opt-in Support](https://ampforwp.com/opt-in-forms/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin) and [Call To Action Support](https://ampforwp.com/call-to-action/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin). To view more, go to our [Extensions page](https://ampforwp.com/extensions/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin).
24
-
25
- <strong>Premium Support</strong><br>
26
- We try our best to provide support on WordPress.org forums. However, One-on-one email support is available to people who bought the [Priority Support](https://ampforwp.com/priority-support/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin) only.
27
-
28
- <strong>Bug Reports</strong><br>
29
- Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkaludi/Accelerated-Mobile-Pages). Please note GitHub is _not_ a support forum, and issues that aren't properly qualified as bugs will be closed.
30
-
31
-
32
- = Features: =
33
-
34
- * NEW - OneSignal Push Notifications integration
35
- * NEW - Structured Data Options
36
- * NEW - Page Builder 2.0 for AMP! [Learn More & Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
37
- * NEW - Advanced WooCommerce Support [More Info](https://ampforwp.com/woocommerce/)
38
- * NEW - Gravity Forms Support [More Info](https://ampforwp.com/gravity-forms/)
39
- * AMP Plugins Manager - Which allows you to disable a specific plugin functionality only in the AMP version
40
- * Page Break / NextPage (Pagination) Support
41
- * Contact Form 7 Support [More Info](https://ampforwp.com/contact-form-7/)
42
- * Facebook Comments Support
43
- * Github Gist Support
44
- * Email Opt-in Subscription form support in AMP added
45
- * Call to Action boxes and notification bars
46
- * 9 Advertisement sizes - 2 More AD slots added recently
47
- * Comments Forms in AMP.
48
- * Native AMP Search functionality.
49
- * Design 3 [Watch the Video Overview](https://www.youtube.com/watch?v=ub1pwskt3Rc)
50
- * Disqus Comments Support
51
- * Google Tag Manager Support
52
- * Page, Category & Tags Support Added
53
- * Custom AMP Editor - Which allows you to override your Content that you had written in Post or page, so you can add the different content just for AMP.
54
- * Mobile Redirection - More than 50% of your traffic is from mobile and you aren’t doing anything to improve their user experience, which means you are falling behind on SEO and it can result in lower SERPS. Lightning fast mobile version means faster User experience means more engagement which directly results in the lower bounce rate.
55
- * Custom Post Type Support
56
- * Star Ratings
57
- * Drag & Drop Page builder Added
58
- * 2 Designs Added
59
- * Yoast SEO support on AMP pages and other SEO plugins
60
- * AMP WooCommerce Support
61
- * Switch on/off Support for Pages & Posts on AMP
62
- * Translation Panel & RTL
63
- * Internal AMP linking - You can browse AMP pages internally
64
- * Related posts below the post
65
- * Recent Comments list
66
- * Automatically integrate AMP to your website.
67
- * Google Adsense (AMP-AD) Support with 4 different Ad slots across the layout! The First Plugin to have this capability.
68
- * Google Analytics Support.
69
- * User Friendly Theme Options Panel.
70
- * Unlimited Color Scheme.
71
- * Image Logo Upload.
72
- * Supports Posts and Pages.
73
- * Proper rel canonical tags which means that Google know the original page.
74
- * Overlay Navigation Menu bar.
75
- * Social Sharing in the Single.
76
- * Sexy Design.
77
- * Separate WordPress Menu for AMP version.
78
- * Page builder & Shortcodes Compatibility.
79
- * Carousel support for Gallery.
80
- * Better Image stretching and resizing.
81
- * Youtube Video Embed Support.
82
- * Vine Embed Support.
83
- * Twitter oembed Support.
84
- * Instagram Embed Support.
85
- * Facebook Video Embed Support.
86
- * RTL Support
87
- * Custom AMP FrontPage
88
- * Notifications
89
- * Chartbeat, Hi-stats, Yandex Metrika, Piwik, Segment.com, StatCounter, Effective Measure and comScore Support
90
- * Incontent & DoubleClick Support
91
- * Great Support & Active Development.
92
- * Widgets & WooCommerce
93
- * Genesis SEO Support
94
- * Breadcrumb Support added
95
- * Facebook Instant Articles Support Added
96
- * NEW - AMP Installation Wizard that makes it easy to setup for new users.
97
- * NEW - Category base remover support
98
- * NEW - Tag base remover support
99
- * NEW - AMP Theme Framework Core Support Added. You can now create Custom AMP templates in just minutes. **[More](https://ampforwp.com/amp-theme-framework/)**
100
-
101
- **[JOIN CHAT GROUP COMMUNITY](http://ampforwp.com/community/)**: Purpose of this group is to get proper suggestions and feedback from plugin users and the community so that we can make the plugin even better.
102
-
103
- = Getting Started: =
104
- **[1. User Documentation:](http://ampforwp.com/help/)** The AMP for WP plugin is easy to setup but we have some tutorials and guides prepared for you which will help you dive deep with the plugin.
105
-
106
- **[2. Developer Docs:](https://ampforwp.com/help/#extend)** We have created special documentations for developers and semi technical users who are willing to modify the plugin according to their own needs.
107
-
108
- **[3. Fixing AMP Validation Errors:](https://ampforwp.com/priority-support/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin)** We will personally take care that your website’s AMP version is perfectly validated. We will make sure that your AMP version gets approved and indexed by Google Webmaster Tools properly and we will even keep an eye on AMP updates from Google and implement them into your website.
109
-
110
- **[4. Community Support Forum:](https://ampforwp.com/help/#support-forum)** We have a special community support forum where you can ask us questions and get help about your AMP related questions. Delivering a good user experience means alot to us and so we try our best to reply each and every question that gets asked.
111
-
112
- **[5. Frequently Asked Questions:](http://ampforwp.com/faq/)** Some of the Frequently Asked questions.
113
-
114
- = Issues & Bug Reports: =
115
- **How do I Report Bugs and Suggest New Features**
116
- <i>You</i> can report the bugs at https://github.com/ahmedkaludi/Accelerated-Mobile-Pages/issues
117
-
118
- **Will you Add New features upon my request?**
119
- Yes, Absolutely! I would suggest you to send your feature request by creating an issue in Github at https://github.com/ahmedkaludi/Accelerated-Mobile-Pages/issues/new/ . It helps us organize the feedback easily.
120
-
121
- **How do I get in touch?**
122
- You can contact me using this url: http://ampforwp.com/contact/
123
-
124
-
125
- == Installation ==
126
- **[Visit Help area for the Documentation:](http://ampforwp.com/help/)**
127
-
128
- [youtube https://www.youtube.com/watch?v=Em1nsE_KaKw]
129
-
130
- **[Visit Help area for the Documentation:](http://ampforwp.com/help/)**
131
-
132
-
133
- == Frequently Asked Questions ==
134
- **[View The Full FAQ at:](http://ampforwp.com/faq/)**
135
-
136
-
137
- == Screenshots ==
138
- 1. AMP Homepage
139
- 2. AMP Single Post
140
- 3. Post Navigation in Single
141
- 4. Sticky Social sharing icons
142
- 5. Overlay Navigation menu sidebar.
143
- 6. Page builder of the Single article. You can drag and drop any element.
144
- 7. Single post of Design One
145
- 8. GTMetrix Performance Report
146
- 9. Google PageSpeed Insight report for AMP
147
- 10. Homepage of Design One
148
- 11. Pingdom Speed Report for AMP
149
-
150
-
151
- == Changelog ==
152
-
153
- = 0.9.68 (12th November 2017) =
154
- * View More details on https://ampforwp.com/0-9-68-released-stability-update-74th-update/
155
- * ADs are Optimize For Viewability, meaning it will try to load faster than the original AMP AD loading strategy.
156
- * Content was disappearing issue was resolved #1392
157
- * Featured Image from The Content option is connected to related post #1339
158
- * Fix amp-web-push helper iframe configuration URL #1387
159
- * Facebook Like button added to AMP #1327
160
- * WPML support for AMP Improvement #1285
161
- * Debug Errors fixed #1366
162
- * Setting ad density for Facebook Instant Articles ads #1287
163
- * Showing the number of comments in Single #1341
164
- * Styling added to the sitewide ads and made sure that they are in the center. #1343
165
- * One Signal buttons Translation added #1383
166
- * Article type added to Structured data #1344 #1354
167
- * The issue with the amp-carousel when RTL was enabled #1358
168
- * amp-carousel with images of different sizes #1358
169
- * a bug where Img is getting converted to amp-img if there's no height or width. which causing validation issue and image is not visible fixed.
170
- * Instant Article should have a default value for number of posts, it was causing the memory issue with alot of posts #1390
171
- * Notice if a post has no author data #1338
172
- * Added a new redux extension select field in redux framework #1349
173
- * Issues with galleries as well as gallery captions #1363
174
- * Added a hook for adding anything in between the loops #1396
175
- * Hide meta boxes as per the user level types #1340
176
- * A Switch between the Date formats #1384
177
- * Fix: Jannah theme lazy load issue #1362
178
- * Issues with galleries as well as gallery captions #1363
179
- * Create Dynamic url of amp according to the permalink structure #1318
180
- * Minor code performance improvement.
181
- * Archive titles in Design 3 frontend issue
182
-
183
- = 0.9.67.0 (6th November 2017) =
184
- * View more details on https://ampforwp.com/one-signal-push-notifications-for-amp/
185
- * OneSignal Push Notifications integrated #807
186
- * Vimeo embed support added
187
- * SoundCloud embed support added
188
- * Pinterest embed support added
189
- * PlayBuzz embed support added
190
- * DailyMotion embed support added
191
- * Fix: Handle issues with data uri images in CSS #1033
192
- * Fix attribute when adding AMP Mustache lib #1033
193
- * Fix: Output CSS for feature image #1033
194
- * An option added for users who don't want to receive update notifications #1342
195
- * Structured data nav improvement
196
- * Sitenavigationelement has been implemented correctly for footer menu. #1345
197
- * Style sanitization for Menu Items #1359
198
- * Polylang flags support for menu  #1360
199
- * Mobile Redirection issues fixed #1173
200
- * Jetpack fatal error fixed #1355
201
- * AMP Page Builder requires a button to be clicked, so the scripts are not running on the runtime making it easy on the edit screen page and avoid the possible script conflict.
202
- * Needs proper CTA Bar's styling. #1361
203
- * Debug errors on archive pages #1353
204
- * Preview shall only be loaded on click rather than in background #1331
205
- * ampforwp_is_home() function code improved
206
- * making sure scripts and styling is properly adding when sanitizing the sidebar #868
207
- * All the backend css and js should be versioned, so it's not cached. #1335
208
-
209
- = 0.9.66.1 (30th October 2017) =
210
- * Fatal error if has version less than WP 4.8 fixed
211
- * More Minor Validation errors fixed
212
- * Odnoklassniki sharing button is not working #1337
213
-
214
- = 0.9.66.0 (29th October 2017) =
215
- * View more details on https://ampforwp.com/0-9-66-released-bug-squashing-oct-2017-72nd-update/
216
- * Design 3 & Design 1 are optimised with 90+ Google PageSpeed Score on Mobile and 95+ in desktop performance #1273
217
- * Featured Image from the content for blog and homepage #1295
218
- * Category Module for AMP Page builder added #888
219
- * Don't load unused CSS selectors. All the CSS is conditionally loading, to decrease the number of CSS loaded per page and increased in performance #1292
220
- * Twitter Video embed code support added in AMP #1307
221
- * Video Posting Structured data #1293
222
- * Navigation menus are now Schema compatible for better Structured data integration #1229
223
- * Yoast checking conditions for Structured Data Improved #1293
224
- * Added "back to Top" in design 3 #959
225
- * Proper blog check and author for custom frontpage #1260 (Made some changes to check the blog properly and also added the author details for Custom Frontpage)
226
- * AMP not working on password-protected pages #1192
227
- * Debug errors reported by the user #1284 and few more we found internally
228
- * Inline Style Sanitizer for Comments to avoid any validation issues #1193
229
- * Next/Previous links removed from pages #1268 props @Frenchomatic
230
- * WPML Multilingual CMS plugin flags compatibility added #1270
231
- * Image sanitizer added for the Sidebar #1270
232
- * Added AMP Components the correct way. Added amp-gist, amp-social-share. #336
233
- * amp-video script added - Which decreases the non-critical validation issues #991
234
- * Arrows in Design 3 pagination #1000
235
- * Author page links in Single #1282
236
- * Added previous open state of option panel and show again when search clean #1238
237
- * Odnoklassniki Social Sharing Support for AMP (with target blank for better bounce rate) #1230
238
- * GIF or animated images resize problem fixed #1281
239
- * In Design1, Header Background & Link Color have same option #1249
240
- * FB Pixel for AMP added #1231
241
- * Structured Data Type option for AMPed Custom Post types only #1259
242
- * Attribute ‘readability in the tag ‘div’ removed - this decreases the validation issues #1306
243
- * AMP Theme Framework Improvements: loop, author, related_post, Add Author support #1311
244
- * Commentator's Avatar in the comments section #1132
245
- * Remove 'Welcome to AMP' from Dashboard sub-menu and moved to the options area to decrease the annoyance and increase the user happiness #902
246
- * Option to Sort the Random Order of Related Posts to increase the audience engagement (Default is 'ID', on enabling the option it will change to 'rand') #1250
247
- *  View AMP on Admin Bar for the respected page/post If enable. #1236
248
- * google maps iframe link to larger map #1099
249
- * Comments now jumping due to the slash at the end #1309
250
- * Page Builder causes Incompatibility with the Divi theme (We restructured the Text Module for Page builder for better compatibility and UX) #1162
251
- * Inline Style Sanitizer for Comments added. Less Critical Validation issues and Better Presentation #1193
252
- * WPML amp-html error fixed #1285
253
- * Radio button not working for Show View more Button" #1018
254
- * Added registered handle for tinymcePointer localize data #1301
255
- * Date in the Design 2 should not be hidden in mobile version #1315
256
- * Page builder not working on homepage(Selected as front page) #1316
257
- * Instant articles number of posts option #1271 (Removed some unused code as well, it will rendered all posts if none is enter in the options)
258
- * Auto flush on save for FBIA to improve the UX.
259
- * Plain Permalinks Support improved. #1318
260
- * Tables support added to FB Instant Articles #1266
261
- * Demo link added in the Theme selector option #1248
262
- * Remove invalid attributes from multiple tags which reduces critical validation errors and validates pages.
263
- * AMP makes a problem in archive page label, when it is active in non-amp version #1304
264
- * placeholder-icon.png is 404 fixed #1310
265
- * Category & Tags switches for Single added. #1055
266
- * Copy Content (Custom AMP Editor) Option Not showing with Page Builder of SiteOrigin issue fixed #1280
267
- * Improving UX with: when AMP support is off for a specific post type then all the AMP related metaboxes should be removed #1289
268
- * Options Panel Options rearranged, labels rewritten, descriptions repositioned for better User interaction [commit]
269
-
270
- = 0.9.65.2 (25th October 2017) =
271
- * TypeWatch is not a function #1299
272
- * Error with BackupBuddy fixed #1303
273
-
274
- = 0.9.65.1 (24th October 2017) =
275
- * AMP Minifcation Issues fixed
276
-
277
- = 0.9.65 (22nd October 2017) =
278
- * View more details on https://ampforwp.com/new/
279
- * Favicon for AMP #1039
280
- * AMP Minification option added with Performance Tab in Options #1286
281
- * Post support is turned off then Meta box should also be removed #1253
282
- * Excerpt Length feature in Design two and Three #1122
283
- * Test Contact form plugins and their settings in the options panel #1121
284
- * Mobile preview in Edit Screen #1082
285
- * Search feature for Options Panel #1238
286
- * WordPress Social Share Buttons Validation Issues #1272
287
- * itemtype attribute is striping in the ul tag #1210
288
- * Debug Error in Breadcrumb 0.9.64 #1267
289
- * Disable AMP linking at Wordpress Search Page #969
290
- * Featured Image is missing #1071
291
- * Removed ampforwp_plugin_activation_notice #1034
292
- * Add VK (Vkontakte) Sharing Button #1187
293
- * Grab the first image instead of post thumbnail for featured image #1189
294
- * AMP theme framework core changes #1274
295
- * Grab the first image instead of post thumbnail for featured image #1189
296
- * Create a Switch on Top of Page Builder #1279
297
- * Inline Related Posts added that helps you with improving bounce rate #1078
298
- * Caption Support in Image Gallery Carousel #1172 #1136
299
- * Instant Articles feed shows sticky posts on top #945
300
- * Added search check, to fix debug notice
301
- * Option to hide date from Design 1 & Design 3 Homepage Loop #1264
302
- * UI labels improvements in the Options panel
303
- * Sorting out design #2 – static front page #1175
304
-
305
- = 0.9.64 (15th October 2017) =
306
- * View more details on https://ampforwp.com/new/
307
- * Structured Data Type option added. You can now change the structured data format for Posts, Pages and Custom post types #323
308
- * When comments plugin activate, Comments section should remove. #1093
309
- * Notification causes a validation error. #1147
310
- * CSS !important need sanitization #1225 - This will help us to validate tens of thousands of pages.
311
- * Strange spaces when using Sassy Social Share #1185
312
- * Remote CDN use? Let's host it? #549
313
- * Typo fix for Linkedin Profile Page URL section #905 [Thanks to Prayag @pra85]
314
- * Replace fastimage with fasterimage for PHP 5.4+ #1191
315
- * Debug Errors Post 0.9.63 #1219
316
- * Ad5 code injected twice #1116
317
- * Homepage Support must be Off when we turn Off Homepage Support. #738
318
- * Add custom class in post pagination for styling #1100
319
- * Removed the Lazy Loading issue of Schema Theme #1170
320
- * H1 tag for archive titles (Commit) #1155
321
- * Alt tag for the Logo #1155
322
- * Design 3 Menu RTL issue fixed #1106
323
- * Ability to add dynamic classes in body tag #1237
324
- * Warnings fixed on 404 page #1243
325
- * Properly structured data for Homepage, Custom Frontpage and Blog #1155 #1242
326
- * Option added to Enable/Disable categories and Tags links from Single #1155
327
- * Fatal error after 0.9.63 fixed #1220
328
- * Debug Error due to vendor AMP #1213
329
- * PHP warning on line 147 after 0.9.63 #1241
330
-
331
- = 0.9.63 (8th October 2017) =
332
- * View more details on https://ampforwp.com/new/
333
- * Category and Tag Base Remover as core features #1079
334
- * Hide AMP on Posts option added #935
335
- * Installation Setup Screen Added for new users
336
- * Validation for the session in PHP #1158. PR by Bryan Contreras @bryan3561
337
- * All the amp pages should work perfect with Plain Permalink settings #488
338
- * WYSIWYG TinyMCE editor added for the Text Module in AMP Page Builder #1205
339
- * WPML Static Front Page Support for title and description with Yoast. #1143
340
- * Row Settings area added for AMP Page Builder #1148
341
- * xlink attribute causes Validation Issues #1149
342
- * Posts with no images on Archive pages are squeezed to 65% #1058
343
- * Body Class to target specific pages #1123
344
- * Option to enable/disable Breadcrumb #1129
345
- * Debug errors due to Breadcrumbs fixed #1109 #1130 #966
346
- * Visit AMP option added below the View Site in Dashboard. #1076
347
- * Many Debug errors fixed #1109
348
- * Textarea for body tag which will help people add AMP Auto Ads #1064
349
- * Structured data improvements #1048 #1044 #1085 #1118
350
- * Twitter share URL based on users choice, you can allow people to share pretty links and short links. #1097
351
- * Author Avatar removed code fixed which has been displayed in the div "amp-wp-meta amp-wp-byline". #1087
352
- * Only one figure element is allowed in the article header FB Instant Articles #1127 & #1157
353
- * Image alt tags are empty and cause issues fixed. #1154
354
- * Button to copy the content into Custom AMP Editor #783
355
- * Rename AMP loop widget areas or add proper descriptions #1045
356
- * Trailing slash issue #1095
357
- * Related Posts by Post type featured added #1141
358
- * Ultimate Social Media Icons plugin causes validation issues fixed #1135
359
- * Adding proper path for functions.php, it was causing strange fatal errors and irregular white screen of death fixed  #1144
360
- * A smooth way to migrate from other AMP plugins to AMPforWP #1051
361
- * Alert added on AMP by Automattic installation. #1180
362
- * Insertion of strange spaces around H1 titles #1069
363
- * AMP Page Builder and HTTPS #1164
364
- * You can display comments from more than one vendor such as displaying WP & FB Comments #1150
365
- * Rename AMP loop widget areas or add proper descriptions #1045
366
- * FrontPage featured image with srcset #1063
367
- * An option for Showing featured image from custom field #1098
368
- * Added the Custom Front Page Title From Yoast SEO #1163
369
- * Commenting breaks SSI directives causes to display error #1179
370
- * rel canonical appears more than once in search pages #1195
371
- * Dev mode in AMP #1083
372
- * Social Sticky Icons Improvements #1061
373
- * Grand-Child support added in Design #1152
374
- * amp-accordion non-critical error in Design 3 & CSS improvements fixed #1152
375
- * Incorrect @id for mainentity #1080
376
- * Hide AMP by specific Categories tweaked for performance. Thanks to Joshua Eichorn @jeichorn CTO at Page.ly #1133 - Huge Thanks!
377
- * amp-auto-ads for sites with RTL support ON #1176
378
- * Redirected the Google forms to our contact page so that we can take each and every query and answer every person. #1201
379
- * ui-state-highlight class was conflicting with ACF date picker fixed #1199
380
- * Responsify WP Lazy loading causes blank image (Compatibility) #1131
381
- * amp-carousel scripts loading on the second page fixed in Design 3
382
- * Show Design screenshot while selection of design #1209
383
- * Switches Redesigned for better UX #1211
384
- * Welcome Page UX Improved #1214
385
-
386
- = 0.9.62 (25th September 2017) =
387
- * View more details on https://ampforwp.com/new/
388
- * INTRODUCING Page Builder 2.0 for AMP! [Learn More & Watch the Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
389
- * Documentation & Help links improved
390
- * Post type specific classes for targetting
391
- * Design name restored in Options panel (It was recently renamed to Appearance)
392
- * Minor Bug fixes as well
393
-
394
- = 0.9.61 (10th September 2017) =
395
- * View more details on https://ampforwp.com/options-restructured/
396
- * Options Panel Restructured – Options were dividing into two parts: Settings and Appearance.
397
- * AMP Theme Framework Core Support Added. You can now create themes of your own in just minutes.
398
- * WPML Static Front Page Support #1111
399
- * Notification message disables when CF7 & gravity form is activated. #1107
400
- * Space after On in Design 3 #1114
401
-
402
- = 0.9.60 (4th September 2017) =
403
- * View more details on https://ampforwp.com/0-9-60-released-improved-redirection-66th-update/
404
- * Class added to View non-amp anchor tag
405
- * Params added properly to get rid of a warning #1077
406
- * rel=attachment noopener generating validation errors #1090
407
- * Breadcrumbs Support Added #701
408
- * Enable / Disable button added for Navigation Menu #735
409
- * Move the ad code for Instant Article down after the article #964
410
- * Add analytics code of FB instant articles properly #1096
411
- * datetime Tag not stripping properly #1043
412
- * Mobile redirection on custom post types #1028 #1052
413
- * Mobile Redirection causing extra redirect #879 #933
414
- * Proper mobile redirection on Homepage #1052
415
- * View non-amp on blog will redirect to blog
416
- * Blog will redirect to blog irrespective of AMP Homepage option #871
417
- * Dont redirect if archive support is disabled #1052
418
- * non-amp category pages should redirect to non-amp pages if turned off from Hide AMP #999
419
- * Disable amp for forum plugin (wpforo) #592
420
-
421
- = 0.9.59 (23th August 2017) =
422
- * Design 3 Images were not aligned properly. Fixed. #1040
423
- * Caption in the design 3 improved
424
- * Jetpack File not loading throwing fatal error #1038
425
- * If the mobile redirection is ON and the category is excluded to display the AMP then it should redirect properly
426
- * Custom Editor Compatibility issue with SiteOrigin PageBuilder fixed #997
427
- * Native Twitter Embed support
428
- * Added a hook after the body tag: ampforwp_body_beginning (commit)
429
- * GTM in AMP Improved #958
430
- * WP User Avatar compatibility Added #975
431
- * Alt tag on frontpage featured image added #1050
432
- * Blurred Images on the frontpage fixed #1050
433
- * Need to escape alt tag #1049
434
- * Debug errors & PHP warnings were fixed #859 #811 #830 #810
435
- * Proper rel canonicals for inner pages #1047
436
- * Added Video sanitizer for comments #1053
437
- * When activating the AMP plugin, display a notification in the popup. #1036
438
- * Video Sanitizer added for Comments
439
-
440
- = 0.9.58.1 (9th August 2017) =
441
- * Jetpack conflict issue solved #1038
442
- * Genesis SEO Support added #1013
443
- * Fixed Wrong SEO title issue #1013 and #836
444
- * Design 3 Carousel script loading method improved #990
445
-
446
- = 0.9.58 (9th August 2017) =
447
- * View more details on https://ampforwp.com/new/
448
- * Genesis SEO for AMP support added
449
- * AMP 0.4.2 Vendor Bundled for making it crash proof
450
- * Archive desc only on 1st page #1029
451
- * Ads are not working after 0.9.6 #1030
452
- * Fixed the Post 0.9.57 Update Bugs #1025
453
- * All Images are aligned on left side in design 3 #1031
454
- * Custom frontpage title issue in Design 3 fixed
455
-
456
- = 0.9.57 (5th August 2017) =
457
- * See the Full changelog https://ampforwp.com/0-9-57-released-compatibility-issue-fixed-62nd-update/
458
-
459
- = 0.9.56 (31st July 2017) =
460
- * View more details on https://ampforwp.com/page-break-in-amp/
461
- * Page Break / NextPage (Pagination) Support Added #834 #857 (Improvement)
462
- * Show/Hide AMP for Categories of Posts or All posts #872 (Improvement)
463
- * Adding analytics capabilities to Instant Articles #978
464
- * JetPack Plugin Conflict Solved #971
465
- * Social sharing code improved. amp-social-share js is getting added for line and WhatsApp social share #981
466
- * Code improvement for rel canonicals(home and archive)
467
- * Perfect SEO URL + Yoast SEO Compatibility #982
468
- * Some styling for tags to show up properly
469
- * Undefined index notices #960
470
- * Non-amp category pages should redirect to non-amp pages if turned off from Hiding AMP #999
471
- * Page builder text and button module issues #972
472
- * Documentation links updated in the Options panel
473
-
474
- = 0.9.55 (13th July 2017) =
475
- * View more details on https://ampforwp.com/0-9-55-released-improvement-update-61st-update/
476
- * Disqus Comments show up even when disabled per post #931
477
- * Unnecessary: Adding the Markup for AMP Woocommerce latest Products #929
478
- * H3 inside OL in Related-Posts.php #930
479
- * Advertisement Options in Instant Articles #943
480
- * Incompatible with bootstrap plugin #525
481
- * Error in tag and category links #934
482
- * Pagebuilder Button module link had issues #951
483
- * Unnecessary: Adding the Markup for AMP Woocommerce latest Products #929
484
- * WPtouch Pro Compatibility Issues #927
485
- * Better scripts compatibility in Single of post types #757
486
- * Instant Articles Error: "The HTML element does not contain any text" #949
487
- * added a filter in all the dates so a user can change the date format and modify #962
488
- * Design3 Menu Arrows are clickable along with the links #952
489
-
490
-
491
- = 0.9.54.2 (4th July 2017) =
492
- * Minor bug post 0.9.54 bug fixed
493
-
494
- = 0.9.54 (4th July 2017) =
495
- * View more details on https://ampforwp.com/new/
496
- * Facebook Instant Articles Support #862
497
- * Exclude Some Pages from Mobile Redirection #914
498
- * After 0.9.53 update amp-social-share js missing (critical issue) #924
499
- * Hooks added in Header (above and below)
500
- * View non AMP[Code improvement] #928
501
- * Pages are not supposed to show meta like this, especially Categories #894
502
- * Monarch plugin having design issues #925
503
- * Show AMP Hide AMP Check Box Fixes #794
504
-
505
- = 0.9.53 (19th June 2017) =
506
- * View more details on https://ampforwp.com/stability-validation-issues-59th-update/
507
- * Compatibility Issue with Rocket Lazy Load plugin #907
508
- * Link color issue with UX of Color Pickers in Design 3 #731
509
- * amp-analytics js appears more than once when Google tag manager is used #885
510
- * SEO by SQUIRRLY is adding analytics twice #678
511
- * Fatal error when WPSEO is activated #900
512
- * Design 3 Sticky header should have an option #625
513
- * Search form was enhanced, it can now be used on the websites without https certificate. That will certainly fix a lot of validation issues. #912
514
- * Yandex Metrika support in AMP #585
515
- * Histats Analytics Support #880
516
- * Chartbeat Analytics Support #882
517
- * Do not strip Rel from anchor tags #790
518
- * Design close Resulting Blank Screen in AMP Site #642
519
- * Logo size is not applying #817
520
- * AMP Publisher logo guidelines #162
521
- * Remove amp-social-share extension .js from Custom Frontpage #899
522
- * Add compatibility with Sassy Social Share #679
523
- * Remove Disallowed ‘like’ tag from Facebook Like button by Ultimate Facebook plugin
524
-
525
- = 0.9.51.1 (12th June 2017) =
526
- * Redirection issue after 0.9.51 Update.
527
- * Improved compatibility with plugins.
528
-
529
- = 0.9.51 (8th June 2017) =
530
- * View more details on https://ampforwp.com/page-builder-released-in-amp/
531
- * Page Builder Support added ( See Tutorial at https://ampforwp.com/tutorials/page-builder/ )
532
- * Comments are not showing properly when words are long #861
533
- * Remove amp-social-share extension .js from Pages #853
534
- * The tag ‘amp-sidebar extension .js script’ appears more than once in the document #828
535
- * Remove Advertisement tab #839
536
- * Compatibility with Slide-in Plugin by WPMU dev #866
537
- * Mobile redirection issue with bbpress #867
538
- * All the data must be properly sanitize in the sidebar #849
539
- * AMP html should not be added on the second page of comments
540
- * Author page’s support #456
541
- * URLs in comments should be clickable(links) #869
542
- * Featured image should be centered in desktop mode #870
543
- * Added More Hooks #721 (Documentation on this coming soon!)
544
- * Page 2 goes to the wrong URL #865
545
- * Proper Title and meta for homepage and posts #850
546
- * Gist Support added #608 Just add a shortcode and enjoy Devs (Ex: amp-gist id="b9bb35bc68df68259af94430f012425f )
547
- * /blog/amp pagination not working #875
548
- * separate the Text and Date format in design 2 #876
549
- * Comments show in AMP w/o breaks between paragraphs #873
550
- * If no featured image below hooks are not working #877
551
- * Change meta name Viewport and its value #878
552
- * Bolt icon in option #474
553
- * Code restructuring and code quality improvements.
554
- * Create a seperate function for comment code in frontpage.php #682
555
- * Remove all the duplicate code from frontpage.php of all the designs and use hooks to add the code instead of static code #889
556
- * Few Debug errors removed.
557
-
558
- = 0.9.50 (24 May 2017) =
559
- * View more details on https://ampforwp.com/facebook-comments-in-amp/
560
- * Design 3 Social Icons issue #832
561
- * View non AMP leads to /?nonamp=1 #814
562
- * Youtube shortcode compatibility improved #557
563
- * welcome.php should be shown only if user is “administrator” #696
564
- * Facebook comments support added in AMP #825
565
- * WP Like Button Compatibility #841
566
- * Custom Taxonomy Support added with Custom Post Type Extension.
567
- * Front page comments not found as expected #837
568
- * Fixed xml:lang tag issue #848
569
- * Sanitize Iframe in the archive description Fixed #845
570
- * Compatibility with Newspaper Theme by TagDiv #842 and #796
571
- * Some debug problems (blog page, style.php) #838
572
- * Featured Image hooks added
573
- * Twitter is misspelled #854
574
- * The core concept of the AMP Content builder has been built.
575
-
576
-
577
- = 0.9.49 (12 May 2017) =
578
- * View more details on https://ampforwp.com/0-9-49-released-small-important-bugs-fixed-56th-update/
579
- * Option added to display the excerpt in Single #806
580
- * Ability to add new invalid tags to filter out from AMP pages #809
581
- * In frontpage, comment button is pointing to wrong URL #812
582
- * Call now button and search is overlapping in Design-1 #784
583
- * Sticky Social Icons should be off if the CTA notification bar is on #788
584
- * Author bio in Design 1 and 2 #732
585
- * Styling in Taxonomy description causing validation issues #798
586
- * Twitter share(handle, url positions fixed) #815
587
- * Tables responsiveness in ALL Designs #726
588
- * Output all the categories and tags with their own ID’s in the div classes #750
589
- * Social Share Icons Overlap with Leave A Comment in Design 3 #716
590
- * Effective Measure Support on AMP #297
591
- * Custom AMP editor on pages should only be shown when page support is ON #756
592
- * AMP on website.com/blog without need of separate installation #775
593
- * GTranslate Compatible #819
594
- * Images and amp-anim styling added #725
595
- * Filter to make the title in a post to a link #727
596
- * Author Bio and Social Share button must not come in Pages #770
597
- * StatCounter is now compatible with AMP #361
598
- * Line Social media support #500
599
- * Footer menus for Design 1 & Design 2 #623
600
- * Strip out src=”about:blank” When Gravity Forms used #804
601
- * Add Compatibility with Crazy Lazy load plugin #751
602
- * Meta Titles and Description issues fixed with Yoast, All in one SEO and The SEO Framework #813
603
- * Double quotes in the Excerpt of the meta description is making AMP Invalidated #818
604
- * Missing featured image on static front page #824
605
- * Fatal error while activation: see the video 0.9.49 Beta #827
606
- * Review this code in archive.php in all 3 designs. #826
607
-
608
-
609
- = 0.9.48 (28 April 2017) =
610
- * View more details on: https://ampforwp.com/0-9-48-released-step-towards-multilingual-support-55th-update/
611
- * The default translation method of WordPress added. (Option in Translation panel to switch between * Translation panel and POT file #540)
612
- * A new Advertisement slot added above the related posts in the Single. It not only gives better options for people to display ads but this ad slot is also very handy if you are using ad companies like Taboola and RevContent.
613
- * Another Advertisement slot added below the post title in the Single post.
614
- * Fatal error: require_once report-bugs.php #747 fixed
615
- * Add / for codes in Meta Description #766 fixed
616
- * Controls re-adjusted & Renamed title of yoast description control in Options panel
617
- * Design-3 Slider URL redirecting to non-AMP page #758
618
- * Added new sanitizer For HTML to AMP-HTML conversion
619
- * Sanitized Archive descriptions so that it would convert to AMP
620
- * Comments sanitized with new sanitizer so that HTML tags automatically become AMP compatible.
621
- * 301 redirects on non-pretty internal links #767
622
- * Create a filter to modify the value of rel="amphtml" #778
623
- * Max-width added for images in comments
624
- * If in WooCommerce ?amp endpoint set then update href.
625
- * Undefined Variable (Debug) #733 and many other debug issues were fixed
626
- * Show last updated Post instead of published date #575
627
- * WooCommerce Widget added to display latest products on homepage. #763
628
- * add amp_post_template_above_footer hook global in all the designs #779
629
- * Excerpt on top of the content in Single #665
630
- * Subscribe box has been improved for the UX needs #712
631
- * Notice warnings since 0.4.2 update #740
632
- * AMP Comments Form Integration with the extension
633
- * Filter added on the loop in Homepage of the Design 3 so that it can be modified with an external plugin.
634
- * 404 on paged home page #781
635
- * Twitter handle should be at the end of the tweet not in the beginning #787
636
- * Wrong Rel Canonical for AMP Custom Frontpage #799
637
- * Merged a pull request #761 that will improve the title and description output that is much more stable and flexible for future enhancement and use. It was contributed by Sybre Waaijer - Thanks mate for the contribution, we (our team and users) really appreciate your hard work done on this code.
638
- * Extension page user experienced improved.
639
- * Removed old Youtube installation video and replaced with new one.
640
-
641
- = 0.9.47.2 (12 April 2017) =
642
- * Design-3 Slider URL redirecting to non-AMP page #758
643
- * Ads showing in comments #768
644
-
645
- = 0.9.47.1 (11 April 2017) =
646
- * Meta description option improved in SEO section #766
647
- * Fatal error: require_once report-bugs.php #747
648
-
649
- = 0.9.47 (10 April 2017) =
650
- * View more details at https://ampforwp.com/0-9-47-released-54th-update/
651
- * Meta saving method updated for customAMP content editor checkbox was causing some conflict.
652
- * Wrong Yoast title and structured data in Custom Frontpage fixed
653
- * CSS minification all 3 designs
654
- * Polylang flags in menu was causing validation issue, is now resolved
655
- * WPML flags in menu was causing validation issue, is now resolved
656
- * Standardized function created for content sanitization.
657
- * Archive description now displays AMP compatible markup
658
- * Comments markup sanitized for AMP
659
- * Design 3 images not aligned properly, fixed
660
- * Images are aligned to center in Design 1.
661
- * carousel ending with //amp instead of /amp – fixed #753
662
- * Title of the Post along with Post link when shared in twitter #683
663
- * Ads were cutting in half in RTL, fixed
664
- * Add / at the end of AMP links with in the AMP pages (Internal links) #668
665
- * Rendering the wrong URLs in front page if paged #742
666
- * Option to turn off AMP on all pages, so people can turn on only for specific pages #746
667
- * Need Meta Description on amp pages #741
668
- * Woocommerce Loop shortcode updated
669
- * Call Now Button added in header #563
670
- * Post images are not centered in Design 3 #695
671
- * UX of GTM settings done, since users were getting confused #700
672
- * Front page amphtml fixed for paginated pages
673
-
674
- = 0.9.45.6 (31 March 2017) =
675
- * Installation Process from welcome page was not working after WP Plugin DIR API change was fixed.
676
- * WP Rocket Minifcation and Concatenation was not working, its fixed now.
677
- * WP Rocket was tested properly to make sure everything is working fine.
678
-
679
- = 0.9.45.5 (25 March 2017) =
680
- * WP rocket conflict solved
681
- * Cannot set property ‘innerHTML’ of null issue fixed
682
-
683
- = 0.9.45.3 (21 March 2017) =
684
- * Post 0.9.45 bugs fixed and released as an urgent update.
685
-
686
- = 0.9.45.1 (19 March 2017) =
687
- * Post 0.9.45 bugs fixed and released as an urgent update.
688
-
689
- = 0.9.45 (18 March 2017) =
690
- * View more details at https://ampforwp.com/0-9-45-released-compatibility-rtl-53rd-update/
691
- * W3Total cache compatibility added
692
- * RTL Support added for Right-to-Left language websites.
693
- * Comments Pagination feature added
694
- * WP-Rocket Compatibility added
695
- * WPML Compatibility added
696
- * Quantcast analytics support added
697
- * ComScore support added
698
- * Custom Yoast title support added #685
699
- * WooCommerce Shortcode: Allows you to display WooCommerce Products. [amp-woocommerce num=6] will display the 6 products from WooCommerce. [amp-woocommerce num=6 link=noamp] will display 6 products but they will go to non-amp website, if you want to link to AMP version of the page then use [amp-woocommerce num=6 link=amp]
700
- * Admin area UX improvements
701
- * Adding notifications script in the correct way
702
- * Comments now display on frontpage as well.
703
- * Re-positioned non-amp Header link control to the right section.
704
- * ?nonamp=1 only displays when the Mobile redirection is on
705
- * Properly adding iFrame js.
706
- * Custom Post type incompatibility fixed
707
- * Widgets added to the Custom Frontpage.
708
- * Stripping shortcodes from excerpts.
709
- * Custom content on static frontpage had over riding issue #687
710
- * Option added for controlling number of comments
711
- * Welcome page should be shown only if user is “administrator” #696
712
- * Digg Digg social share compatibility #694
713
- * Removed unnecessary lines from Design 3
714
- * Sanitized Archive Description to amp Compatible #659
715
- * Author box now displays HTML properly #645
716
- * Date added Design-3 in meta #583
717
- * Options link was removed from wp-admin tool bar after a feedback from a user.
718
- * Footer sub menus layout compatibility.
719
-
720
-
721
- = 0.9.44 (5 March 2017) =
722
- * View more details at https://ampforwp.com/user-experience-52nd-update/
723
- * Added Welcome Screen for better User experience. [Enhancement]
724
- * Undefined Index debug error resolved [Bug fix]
725
- * All in one SEO Support support tested [3rd party compatibility]
726
- * Frontpage title in Design 3 is out of the container #644 [Bug fix]
727
- * Default Table markup in AMP #643 [Enhancement]
728
- * AMP carousel is not working on Frontpage #641 [Bug fix]
729
- * Social share .js was getting added even when it was not required #638 [Bug fix]
730
- * Search Feature added for Design 1 & Design 2 [Major Improvement]
731
- * Accordion script loading issue in Design 3 #634 [Bug fix]
732
- * ?nonamp=1 links should be nofollow #622 [Bug fix]
733
- * Same Header and Color Scheme are making header elements invisible #629 [Enhancement]
734
- * In Search AMP rel canonical was different #631 [Bug fix]
735
- * Non-AMP link in Design 3 was not working when mobile redirection was enabled #632 [Bug fix]
736
- * Search form text strings are now added in the translation panel #607 [Bug fix]
737
- * Load AMP-ads conditionally only if ads are available #609 [Bug fix]
738
- * Added compatibility with Custom post type extension. Option to hide/show AMP on all custom post types #587 [Bug fix]
739
- * Report a Bug & Request feature links added [Enhancement]
740
- * If there was no menu set in Design 3 then all pages were getting displayed. #613 [Bug fix]
741
- * The tag Font is disallowed #616 [Validation Improved]
742
- * index/noindex separately added for Tags and also for Categories #606 [Enhancement]
743
- * Use of undefined constant AMP_QUERY_VAR #596 [Bug fixed]
744
- * Logo is not centered in Design 3 #586 [Bug fixed]
745
- * Remove defer, a very rare type of defer was getting added #589 [Validation Improved]
746
- * Disqus comments iframe had scrolling issues #566 [Bug fixed]
747
- * Left side blank gap in the RTL in design 2 #541 [Bug fixed]
748
- * Inline Styles not working correctly in Custom AMP Editor #533 [Bug fixed]
749
- * Re-save permalinks issues. Flushing rewrites with options saved. #511 [Improvement]
750
- * Code review and cleaning of the customizer #404 [Code Cleaning]
751
- * Google Search iframe had some header alignment issues in Design 3. #624 - Thank you Leo Osa @leoosa for the contribution! [Bug fixed]
752
- * AMP Frontpage + Override AMP Content = Blank page #604 [Bug fixed]
753
- * Widget area added on the homepage with an 'AMP Category Blocks' widget. It means you can display multiple category blocks the homepage. This allows you to display complex layouts, even on AMP. [Major Improvement]
754
- * Auto-append /amp at the end of internal links in Menu with an option in the Menu section of the options panel #531 [Major Improvement]
755
- Reformatting and Minifying of stylesheet [Code Cleaning]
756
- * Created a new section for Homepage and moved some controls from other areas to the home section for the better user experience. [User Experience]
757
- * Override Homepage Thumbnail size option added. It will give you more control over your thumbnails. [Major Improvement]
758
- * New color picker added to change the color of the header elements in the Design 3 to give you better control over the design. [Enhancement]
759
- * Extra amp-carousel script loading is now fixed. [Bug fixed]
760
- * Crafting of layout code in design 2 and design 3, especially with social icons area. [Code Cleaning]
761
- * Design of search form was not clickable in iOS devices #621 [Bug fixed]
762
- * Disqus iframe was loading even when there was no disqus name was added in the option. We found that many users might be enabling it without knowing the output and then they seem to forget, which was causing them validation warnings. [Bug fixed]
763
-
764
- = 0.9.43.6 =
765
- * View more details at https://ampforwp.com/stability-sprint-3-51st-update/
766
- * Typo in the is_home() function fixed
767
- * Option to hide/show AMP on all custom post types #587
768
- * False detection by Windows defender tool fixed
769
- * Conditional tags were not compatible with Advanced AMP ads which were causing some conflicts but is now fixed.
770
-
771
- = 0.9.43.5 =
772
- * View more details at https://ampforwp.com/stability-sprint-2-50th-update/
773
- * Fixed shortcodes issue in related posts #543
774
- * Iframe Scripts Added properly
775
- * Proper conditions added for the social section of Design 3
776
- * Featured Image issue stretched in Design 2 & 3
777
- * Removed extra global $redux_builder_amp;
778
- * Custom Logo Dimensions option added #479
779
- * Index & NoIndex options added for SEO section. #558
780
- * Added URL for rewrite flushing rules in Options
781
- * Option to enable and disable the Author area in Design 3#577
782
- * Rel Nofollow added in credit link
783
- * debug issue solved: fn_offset not defined
784
- * debug issue solved: global $post not declared
785
- * The word 'ago' is now translatable in design 3
786
- * The word 'read next' is translatable now
787
- * Tablepress compatibility added #392
788
- * Secure API server is now serving through Google Cloud Manager.
789
- * Thrive Content builder was displaying twice when the Custom AMP content was on. It was a complex issue which has been solved now.
790
- * amp-ad extension.js script was loading if the Ads are not enabled. #598
791
- * Social Share Extension Included on Homepage even if we didn't have social icons #599
792
- * Installation UX improvement #593
793
- * Removed duplicate global variable
794
- * Proper OG tags added #588
795
- * Proper instructions added for Custom AMP content #471
796
-
797
-
798
- = 0.9.43.1 =
799
- * View more details at https://ampforwp.com/0-9-43-1-released-stability-sprint-1-49th-update/
800
- * Emoji in comments leads to AMP errors
801
- * Design 1 showing time on archives
802
- * Added some space between the archive label.
803
- * Lazy loading plugins compatibility #544
804
- * Custom header and footer areas
805
- * Sticky posts now come on top #564
806
- * Footer non-amplink added in design 3 #562
807
- * HTML Paragraph tag is shown in the title in category! #518
808
-
809
- = 0.9.42 =
810
- * View more details at https://ampforwp.com/design-three-update/
811
- * Design 3 was released – Video Overview along with new options and features. View the video overview at: https://www.youtube.com/watch?v=ub1pwskt3Rc [Major Feature]
812
- * Ticket #517 Added Upload field into Redux core [3rd party Compatiblity]
813
- * Ticket#529 Controls for archive titles added [Improvement]
814
- * Ticket #548 Jetpack photon code removed
815
-
816
- = 0.9.41 =
817
- * View more details at https://ampforwp.com/disqus-comments-in-amp/
818
- * Disqus Comments in AMP Support Added [New Feature] - This feature can be enabled from Dashboard > AMP Options > Disqus Comments
819
- * AMP WooCommerce supported tag was missing after the last update. [Bug fix]
820
- * Homepage & Related Posts was displaying private and protected posts, which is now fixed [Bug fix]
821
- * Next previous links added in Design 1 [Enhancement]
822
- * Invalid Post Time displaying in the homepage of Design 1 [Bug fix]
823
- * Twitter share now includes the twitter handle of the author with setting in options [Enhancement]
824
- * Emoji in comments leads to AMP errors was fixed [Bug fix]
825
- * Date are now displayed on archives in Design 1 [Enhancement]
826
- * When RTL enabled logo merges with nav bar was fixed [Bug fix]
827
- * Jetpack Photon compatibility added [3rd Party Compatibility]
828
-
829
- = 0.9.40 =
830
- * View more details at https://ampforwp.com/0-9-40-released-biggest-stability-update/
831
- * Proper endpoints added [Improvement]
832
- * Flush Rewrites properly [Improvement]
833
- * REL Canonical properly getting added. [Improvement]
834
- * Proper Frontpage Canonical added [Improvement]
835
- * Added Base name support for categories and tags [Improvement]
836
- * Redirection of excluded post solved. [Bug fix]
837
- * Archives properly redirecting to the right URL [Bug fix]
838
- * Homepage redirection solved [Bug fix]
839
- * Plusone tag is stripped properly. [Validation Issue fixed]
840
- * Archives are now clickable. [Improvements]
841
- * WP_Query filter added for better customizability of Homepage loop. [Better Customizations]
842
- * Social share boost plugin compatibility. [3rd party Customizations]
843
- * Removed H1 from the frontpage even if it is not available. [Improvement]
844
- * H3 instead of H1 for Site title. So there is only one H1 per page. [SEO Improvement]
845
-
846
- = 0.9.38 =
847
- * View full details at https://ampforwp.com/google-tag-manager-for-amp/
848
- * Google Tag manager included [New feature]
849
- * Iframe max-width added [Improvement]
850
- * Paginated pages have different titles now. [Bug fix]
851
-
852
- = 0.9.37 =
853
- * View full details at https://ampforwp.com/category-tags-archive-support-added/
854
- * Debug issues solved [Bug fix]
855
- * Remove Extra styling added by other Themes/ Plugins [3rd party themes and plugin Support]
856
- * Category, Tags & Archive Support with titles added [Enchancement]
857
- * Archive Title support added [Enchancement]
858
- * There were some issues with attachments [Bug fix]
859
- * removed ? from amp url's [Improvement]
860
- * Mobile redirection for Archives added and 404 redirections removed for archives [Improvement]
861
- * View non-amp version now properly redirects to the normal version. #415 [Bug fix]
862
- * Added an option to turn off AMP support for Homepage. [Enchancement]
863
- * Too many redirects issue on homepage is fixed #435 [Improvement]
864
- * Spell check and G tags are removed for thrive & Spell check compatibility [Better Validation]
865
- * If image is not available in gravatar fixed, it was throwing an error #365 #327 [Improvement]
866
- * Comment anchor link changed for simplecomment button files in both designs [Improvement]
867
- * Redirection Loop issue fixed [Bug fix]
868
- * Shortcodes were visible in excerpt, it's fixed now. [Improvement]
869
- * Defer onload by other plugins was causing issues #431 [Better Validation & 3rd party support]
870
- * Improved Sessions [Improvement]
871
- * Advnaced Settings panel was created for better user experience. [Improvement]
872
- * Spell check tag was causing validation issues. [Better Validation & 3rd party support]
873
- * RTL issue fixed #454 [Bug fixed]
874
-
875
- = 0.9.36 =
876
- * Full details at https://ampforwp.com/0-9-36-released-stability-update-43rd-update/
877
- * Redux Core Update. Better compatibility with the Salient theme and Themeforest themes & plugins using redux framework in their core, which makes the plugin much stable. [Huge Improvements]
878
- * Hide advertisement section if advance ads plugin is active. [Better User experience]
879
- * Ultimate Social Media PLUS Plugin Compatibility (Link) [3rd Party plugin Compatibility & Better Validation]
880
- * Launch Post Builder button added. One of the important feature called ‘Post Builder’, that is drag and drop post builder was somewhere hidden in the customizer, so positioned it for better visibility from users. [Better UX]
881
-
882
- = 0.9.35 =
883
- * Full details at https://ampforwp.com/page-builder-realtime-preview-3rd-party-plugins-compatibility/
884
- * Customizer page builder (Design Manager) was not showing real-time preview, we have fixed this issue properly [Bug fix]
885
- * Attachment page was having the wrong endpoint. [Bug fix]
886
- * Fb:like div has href, showfaces, send and action tag, which was against validation [Validation Improvement]
887
- * A plugin (Spam Protection by CleanTalk, no Captcha Anti-Spam) was forcefully adding script into the AMP version. [3rd party Compatibility]
888
- * Lang attributes were added [Enhancement]
889
- * The tag like was disallowed in the AMP [Validation Improvement]
890
- * We did some more testing with Visual Composer & AMP [3rd party Compatibility]
891
- * AMP on Pages option was not working in some cases. [Bug fix]
892
- * Disable comment button when comments were disabled. This was fixed by @lofesa and was sent as a pull request. Thank you Lofesa!
893
- * g:plusone tag was not getting removed properly. [Validation Improvement]
894
- * Thrive headline optimizer was having issues in AMP version. [Validation Improvement]
895
- * Structured Data Image width issue solved [Enhancement]
896
- * BJ Lazy Load was having issues, we have added a fix which will make this plugin compatible with the AMP. [3rd party Compatibility & Validation Improvement]
897
- * imageanchor=”1″ was getting added by some 3rd party plugin, this was fixed.[Validation Improvement]
898
-
899
- = 0.9.34 =
900
- * Newspaper theme by Tagdiv was having issues, we have fixed this one.
901
-
902
- = 0.9.33 [15th Jan 2017] =
903
- * Full details at https://ampforwp.com/debug-errors-shortcodes/
904
- * Mobile was not working with Newspaper theme by Tagdiv [Bugfix]
905
- * Debug errors fixed, Code is now much cleaner.
906
- * New rewrite rules for homepage pagination. It had some paginated URLs with wrong amphtml tag.
907
- * Extra analytics file was loading. Better compatibility with Yoast & Monster analytics.
908
- * Properly removes AMP if turned off from Post panel
909
- * z-index position improved on Sticky Social bar
910
- * Better compatibility with shortcodes.
911
- * Divi Standard Layouts Compatibility
912
- * Properly Hide AMP posts if excluded. #367
913
- * Mobile redirection was causing loop issues which are now fixed.
914
- * Some plugins were loading in core AMP js file, which was causing the issues, which is now fixed. [Better Validation]
915
- * onclick was getting added in the links on AMP version. Issue fixed. [Better Validation]
916
- * thrive_headline tag was getting added in the Title tag which was causing validation issues. Fixed. [Better Validation]
917
- * Some interactive plugins were using place, state, city and imap tags which are now fixed. [Better Validation]
918
-
919
- = 0.9.32 [7th Jan 2017] =
920
- * Full details at https://ampforwp.com/first-wave-of-polishing-in-2017/
921
- * Rel=canonical issue fixed: AMP URL redirect to the normal URL #293 & #332.
922
- * Paginated pages on homepage redirect to homepage URL #335
923
- * Title of the page should be displayed on the FrontPage #358
924
- * Thrive Builder AMP Validation Compatibility, so it will be validated properly in AMP.
925
- * Twitter Sharing improved so it gets the data properly #341
926
- * Option to change the number of Related Posts #290
927
- * Validation errors due to rel="canonical" was missing on some pages
928
- * Comment button displays even if the comments are not available
929
- * Threaded comments were duplicating, so that issue is solved and added proper CSS for it.
930
- * Minor issue with Jetpack Comments fixed.
931
- * Missing amp-social-share.js on front page fixed #372
932
- * Minor improvements to Title and description tags.
933
- * Analytics Script was loading twice when Glue was active.
934
- * Page specific class added for better customization compatibility #377
935
- * Inline Style support added Fixed #356
936
- * Bugs fixed in Email notification pointer
937
-
938
- = 0.9.31 [2nd Jan 2017] =
939
- * Proper Details at https://ampforwp.com/amp-0-9-31-released-installation-user-experience/
940
- * Proper Condition added for the scripts to load in Frontpage.php
941
- * Rel canonical properly added for front pages
942
- * 404 and Archive page Mobile redirection code refined
943
- * User Experience Improvement: Installation process was improved
944
-
945
- = 0.9.3 [31th December 2016] =
946
- * Proper Details at https://ampforwp.com/custom-amp-content-editor/
947
- * Custom AMP Editor - Which allows you to override your Content that you had written in Post or page, so you can add the different content just for AMP.
948
- * FrontPage had some validation issues. [Bug fix]
949
- * Related posts in Design 1 we're redirecting to 404 fixed [Bug fix]
950
-
951
- = 0.9.2.2 [27th December 2016] =
952
- * Proper Details at https://ampforwp.com/polishing-user-experience-improvements/
953
- * Made the Options panel user-friendly
954
- * Social Share on frontpage issue fixed.
955
- * Readme.txt made user-friendly.
956
- * Archive option removed and some UI improvements
957
- * Single was not displaying the Title
958
- * 'Type is not allowed' [Validation issue fixed]
959
- * noshade tag Validation issue fixed
960
-
961
- = 0.9.2.1 [24th December 2016] =
962
- * Proper Details at https://ampforwp.com/step-towards-fixing-amp-validation-errors/
963
- * Disabled the Tags and Categories support for AMP for better validation until we find a better solution.
964
- * Mobile redirection bug fixed, It was continuously redirecting to the same page [Bug fix]
965
- * trailingslashit added to make sure we have proper url for Mobile redirection [Bug fix]
966
- * In content AD overlapping the content issue fixed
967
-
968
- = 0.9.2 [23th December 2016] =
969
- * Proper Details at https://ampforwp.com/mobile-redirection/
970
- * AMP Mobile Redirection Feature added. It can be turned on from Dashboard > General and then Mobile Redirection. [New Feature]
971
- * Archive title and description added [Improvement]
972
- * Improved the Speed of the AMP version #321 [Improvement]
973
- * Anchor link was not closing fixed #328 [Bug Fix]
974
- * Typo in Trailingslashit function which resulted in some issues in the Homepage version [Bug Fix]
975
-
976
- = 0.9.1.2 [20th December 2016] =
977
- * Proper Details at http://ampforwp.com/new/
978
- * DoubleClick Support
979
- * Custom Post Type Support
980
- * Ratings Support
981
- * Comments Gaping fix
982
- * Custom Excerpt code
983
- * Better Compatibility with Yoast SEO plugin
984
- * AMP Validation error in Design 1 Fixed
985
- * Proper Homepage title & Description with Yoast SEO plugin issue fixed
986
- * Design -1 Excerpt too big for mobile devices, Fixed
987
- * Advertisement support on Design 1
988
- * Link to Tags & Categories were having some issues.
989
- * AMP looking bad on big devices
990
- * AMP validation Improvement: Lightbox plugins compatibility
991
- * Huge Progress in AMP Validation Errors: Strip unwanted codes and tags from wp_footer for better compatibility with Plugins
992
- * Page Performance: Removed default Google font loading
993
- * Page Performance: DNS Prefetch tag added for faster DNS Handshake
994
-
995
- = 0.9.1 [16th December 2016] =
996
- * Proper Details at http://ampforwp.com/new/
997
- * PHP7 Compatibility
998
- * Pagination URLs (Prev & Next) was going to 404 ( #244 | #251 )
999
- * Custom CSS not working in Design one (#249)
1000
- * Enhanced the translation panel by adding Textarea from Redux, which means that we're able to allow HTML in footer like before (#260)
1001
- * How to remove “Powered by WordPress” from Design-1 of AMP ( #264 )
1002
- * Non-amp Homepage support added (#267)
1003
- * using get_avatar() (#259)
1004
- * Validation issue fixed: The attribute 'rel' may not appear in tag 'div' (#268)
1005
- * Validation Issue fixed: Script Tag removed from the content.
1006
- * Featured image in Design 1 in single #261
1007
- * After Fresh installation - a save is required Fixed
1008
- * Excerpt length controlled
1009
- * Design One has thumbnails on the Homepage
1010
- * Non-AMP link goes to the wrong page, issue fixed.
1011
- * Archive pages were broken, fixed.
1012
- * Option to Enable & Disable the Next/Previous links in Single
1013
- * WhatsApp sharing not working, issue fixed.
1014
- * Category Taxonomy has extra ':' in the word.
1015
- * The word 'Ago' is now translatable.
1016
- * Yoast SEO with AMP compatibility issue fixed.
1017
- * Several Minor Polishing in the code
1018
- * Footer Ad gets covered by Sticky Social Icons (#269)
1019
- * Smaller image size when “image caption” is used in Design-2 (#263)
1020
- * Footer ad with Sticky Social bar issue fix
1021
- * Checked with WordPress 4.7
1022
- * Ad #1 was messing up with the title, issue fixed.
1023
- * Compatibility improved with AMP WooCommerce.
1024
-
1025
- = 0.9 =
1026
- * Proper Details at http://ampforwp.com/amp-pagebuilder/
1027
- * Drag & Drop Page builder Added: You can easily modify the look of the AMP page using this feature
1028
- * 100% Yoast Compatible , Now no need to have additionally Glue Installed
1029
- * 100% completed Translation panel, Now absolutely anything on page is translated
1030
- * Added Option to turn on/off Page Support
1031
- * Styling for Tags was Corrected
1032
- * Made changes to these sections to reflect in the new Design manager : Related Posts, Footer
1033
- * Default Image alignment styling added
1034
- * Added Option to turn on/off Page Support
1035
- * Related Posts Now use Custom Excerpt if it Exists
1036
- * Now AMP pages wont have Validation errors because of 'rel' attribute in 'div' Tag or 'onclick' attribute in 'a' Tag
1037
- * <pre> Tag styling issue fixed for AMP pages
1038
- * Frontpage (Homepage) Compatibility with AMP which means better validation of front page.
1039
- * WooCommerce Support Added https://wordpress.org/plugins/amp-woocommerce/ (for E-Commerce)
1040
- * 2 New Designs added
1041
- * SEO Panel Added
1042
-
1043
- = 0.8.8 =
1044
- * Proper Details at http://ampforwp.com/amp-0-8-8-released-translation-panel/
1045
- * Translation Panel added. You can now easily translate the AMP version from the backend without any complications.
1046
- * Badge Tag was throwing Validation error
1047
- * Plusone tag validation error was fixed
1048
- * Time tag was validation error was fixed
1049
- * User experience for Mobile devices was improved
1050
- * Meta info was messing up in smaller devices, it was fixed as well.
1051
- * Internal AMP linking added for Categories and Tags
1052
- * Future errors for AMP ads was fixed
1053
- * Blockquote styling added
1054
- * “Please Activate parent Plugin settings” added for better User Experience.
1055
- * Related Post Ux improvement
1056
- * Plugin version added in Footer source code for better debugging
1057
- * Added Support for Default WordPress Image alignment
1058
- * New action hooks added in index page
1059
- * Featured Image Size options added
1060
-
1061
- = 0.8.7 =
1062
- * Proper Details at http://ampforwp.com/amp-0-8-7/
1063
- * added option to enable/disable AMP on Archive pages (Ticket #188)
1064
- * Solved 404 on Related Posts (Ticket #178 )
1065
- * Related posts by either categories or Tags(Ticket #179)
1066
- * added a link to menu Section from the AMP Options page(Ticket #190)
1067
- * Added Support for Piwik Analytics(Ticket #163)
1068
- * Added Support for Segment.com Analytics(Ticket #50)
1069
- * Added a switch for hiding Non-Amp page link from Footer.( Ticket #189)
1070
- * Added an Option that strips Users URL from Comments Section(Ticket #180)
1071
- * Fixed stripping <date> tags from the content , Since it was preventing validation – amp-img issues fixed
1072
- * UX Improved for every section of AMP Options page
1073
- * Added Settings button on plugin page
1074
- * Related posts switch added
1075
- * Removed carousel.js
1076
-
1077
-
1078
- = 0.8.6.1 =
1079
- * Date Tag fix
1080
- * Few validation issues after 0.8.6 were fixed (Frontpage amp-img strip issue fixed)
1081
-
1082
- = 0.8.6 =
1083
- * Proper Details at http://ampforwp.com/amp-0-8-6-released-related-posts-comments/
1084
- * Related Posts
1085
- * Post Comments
1086
- * WhatsApp sharing button Your visitors can now easily share the content over the whatsapp.
1087
- * Validation issue fixed by All In One Schema.org Rich Snippets plugin
1088
- * Removed Google Fonts loading for Performance
1089
- * New relic Support
1090
- * Class added to ‘View Non-AMP Version’ text
1091
- * Archives Structured Data issue fixed
1092
- * Some instances img tags converted into amp-img automatically.
1093
-
1094
-
1095
- = 0.8.5.3 =
1096
- * Canonical issue fixed for Post
1097
-
1098
- = 0.8.5.2 =
1099
- * Canonical issue fixed for FrontPage
1100
-
1101
- = 0.8.5.1 =
1102
- * Proper Details at http://ampforwp.com/new/
1103
- * Validation issue fixed: 'Value' tag
1104
- * Validation issue fixed: The attribute 'contenteditable' may not appear in tag 'a'.
1105
- * Validation issue fixed: Table markup
1106
- * Validation issue fixed: nowrap and misc tags
1107
- * New Relic Support
1108
- * Tags on off option
1109
- * Canonical and correct AMP html Redirect issues Solved
1110
- * NextGEN Gallery Validation Support Added
1111
-
1112
- = 0.8.5 =
1113
- * Proper Details at http://ampforwp.com/the-0-4-compatibility/
1114
- * AMP 0.4 Compatibility Check
1115
- * Even better Structured Data Validation, Once in for all!
1116
- * Structured Data Options to eliminate Validation errors
1117
- * AMP Page Exclude option
1118
-
1119
- = 0.8.4 =
1120
- * Proper Details at http://ampforwp.com/blog/structured-data-validation/
1121
- * Structured Data Validation
1122
- * Navigation Text Change
1123
- * Inline Style Validation
1124
- * Form Validation
1125
- * Frontpage shows the amphtml rel twice fixed
1126
- * Facebook Sharing not working
1127
-
1128
- = 0.8.3 =
1129
- * Prefix added in the Content filter
1130
- * Extra space after quote in Ads
1131
-
1132
- = 0.8.2 =
1133
- * Proper Details at http://ampforwp.com/blog/the-custom-frontpage/
1134
- * Custom AMP FrontPage
1135
- * Featured Image
1136
- * New Mobile Friendly Advertisement sizes
1137
- * Single Post Pagination Option
1138
- * RTL Support
1139
- * Notifications
1140
- * Gaping if the Meta was turned off.
1141
- * Analytics was not fetching the user id properly.
1142
- * Page was not using the post template along with the AD support.
1143
- * AMP Endpoint support for Paged when the front page is active.
1144
- * UI improvement of Admin panel
1145
- * Few Validation issues fixed
1146
-
1147
- = 0.8.1 =
1148
- * Warning: Cannot modify header information error fixed
1149
- * Validation issue fixed. KK Star Plugin compatible.
1150
- * Gaping in the smaller screens fixed
1151
-
1152
- = 0.8 =
1153
- * Proper Details at http://ampforwp.com/blog/the-change/
1154
- * Plugin was re-written from scratch and is now built on top of default AMP plugin by Automattic but giving you the same features of the original plugin.
1155
- * 99.5% Validation issues were fixed.
1156
- * Page builder & Shortcodes Compatibility Support Added
1157
- * Conflict with JSON API
1158
- * Carousel support for Gallery
1159
- * Better Image stretching and resizing
1160
- * Youtube Video Embed Support
1161
- * Vine Embed Support
1162
- * Twitter oembed Support
1163
- * Instagram Embed Support
1164
- * Facebook Video Embed Support
1165
- * Better Future Compatibility
1166
-
1167
- = 0.7.7 =
1168
- * Proper Details at http://ampforwp.com/blog/amp-0-7-7/
1169
- * Big Validation Error fix Update
1170
- * Disable AMP support on specific Pages and Posts
1171
- * Option to disable the Post meta from the Single
1172
- * Footer Credits and Copyright Text Option
1173
- * New options for Social Sharing Bar in Single
1174
- * Jetpack Social & Related Sharing Issue fixed
1175
- * Gaping in footer if the Sticky bar is enabled
1176
- * Text domain added on few strings
1177
-
1178
- = 0.7.6 =
1179
- * Google Adsense Support Added with AMP-Ad
1180
- * Wrong Homepage rel amphtml bug fixed
1181
-
1182
- = 0.7.5 =
1183
- * Google Analytics Support Added
1184
- * Logo Support Added. If the logo is disabled, then the Title should be activated.
1185
- * Color Scheme Feature Added
1186
- * User friendly Options Panel Added
1187
- * iFrame support Added
1188
- * Few Minor Bugs Fixed
1189
-
1190
- = 0.7.1 =
1191
- * Bug #24 (Github) fixed
1192
- * Strip Style tags for faster & better validation
1193
- * Bug #21 (Github) fixed
1194
-
1195
- = 0.7 =
1196
- * Canonical Improved
1197
- * Navigation Validation bug fixed
1198
- * Two more validation bugs fixed ('role' and 'tabindex' attribute)
1199
- * Featured image automatically hides if it is not present
1200
- * Validation issues in the images of the post's the_content
1201
-
1202
- = 0.6 =
1203
- * Improved Navigation Menu
1204
- * Search Console errors fixed
1205
- * Social Sharing option
1206
- * Pages support
1207
- * Force redirection for mobile users removed and many other bug fixes
1208
-
1209
- = 0.5 =
1210
- * Added AMP Markup for Google Structured data. This will fix the issues in Webmaster tools.
1211
-
1212
- = 0.4 =
1213
- * Support of Custom menu added for AMP enabled sites
1214
-
1215
- = 0.3 =
1216
- * Support of amp-img added in single posts
1217
- * minor css bug fixed
1218
-
1219
- = 0.2.5 =
1220
- * Minor bugs fixed
1221
- * ?mobile & ?nomobile is now ?amp & ?noamp
1222
-
1223
- = 0.2 =
1224
- * White Screen of death issue fixed
1225
- * Plugin URI updated
1226
-
1227
- = 0.1 =
1228
- * Initial version
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === AMP for WP - Accelerated Mobile Pages ===
2
+ Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
3
+ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
4
+ Donate link: https://www.paypal.me/Kaludi/25
5
+ Requires at least: 3.0
6
+ Tested up to: 4.9.1
7
+ Stable tag: 0.9.72
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ AMP for WP is the most recommended AMP plugin by the community. Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on your WordPress site.
12
+
13
+ == Description ==
14
+ AMP for WP automatically adds Accelerated Mobile Pages (Google AMP Project) functionality to your WordPress site. AMP makes your website faster for Mobile visitors.
15
+
16
+ [What's New in this Version?](http://ampforwp.com/new/) | [Priority Support](https://ampforwp.com/priority-support/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin) | [View Demo](https://demo.ampforwp.com/amp/) | [Screenshots](https://wordpress.org/plugins/accelerated-mobile-pages/screenshots/) | [Community](http://ampforwp.com/community/)
17
+
18
+ [youtube https://www.youtube.com/watch?v=Em1nsE_KaKw]
19
+
20
+ [youtube https://www.youtube.com/watch?v=vAGPFKKm5G4]
21
+
22
+ <strong>Extensions</strong><br>
23
+ Some useful extensions to extend AMP features, check [AMP Adsense Support](https://ampforwp.com/advanced-amp-ads/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin), [Contact Form 7 Support](https://ampforwp.com/contact-form-7/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin), [Email Opt-in Support](https://ampforwp.com/opt-in-forms/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin) and [Call To Action Support](https://ampforwp.com/call-to-action/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin). To view more, go to our [Extensions page](https://ampforwp.com/extensions/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin).
24
+
25
+ <strong>Premium Support</strong><br>
26
+ We try our best to provide support on WordPress.org forums. However, One-on-one email support is available to people who bought the [Priority Support](https://ampforwp.com/priority-support/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin) only.
27
+
28
+ <strong>Bug Reports</strong><br>
29
+ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkaludi/Accelerated-Mobile-Pages). Please note GitHub is _not_ a support forum, and issues that aren't properly qualified as bugs will be closed.
30
+
31
+
32
+ = Features: =
33
+
34
+ * NEW - OneSignal Push Notifications integration
35
+ * NEW - Structured Data Options
36
+ * NEW - Page Builder 2.0 for AMP! [Learn More & Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
37
+ * NEW - Advanced WooCommerce Support [More Info](https://ampforwp.com/woocommerce/)
38
+ * NEW - Gravity Forms Support [More Info](https://ampforwp.com/gravity-forms/)
39
+ * AMP Plugins Manager - Which allows you to disable a specific plugin functionality only in the AMP version
40
+ * Page Break / NextPage (Pagination) Support
41
+ * Contact Form 7 Support [More Info](https://ampforwp.com/contact-form-7/)
42
+ * Facebook Comments Support
43
+ * Github Gist Support
44
+ * Email Opt-in Subscription form support in AMP added
45
+ * Call to Action boxes and notification bars
46
+ * 9 Advertisement sizes - 2 More AD slots added recently
47
+ * Comments Forms in AMP.
48
+ * Native AMP Search functionality.
49
+ * Design 3 [Watch the Video Overview](https://www.youtube.com/watch?v=ub1pwskt3Rc)
50
+ * Disqus Comments Support
51
+ * Google Tag Manager Support
52
+ * Page, Category & Tags Support Added
53
+ * Custom AMP Editor - Which allows you to override your Content that you had written in Post or page, so you can add the different content just for AMP.
54
+ * Mobile Redirection - More than 50% of your traffic is from mobile and you aren’t doing anything to improve their user experience, which means you are falling behind on SEO and it can result in lower SERPS. Lightning fast mobile version means faster User experience means more engagement which directly results in the lower bounce rate.
55
+ * Custom Post Type Support
56
+ * Star Ratings
57
+ * Drag & Drop Page builder Added
58
+ * 2 Designs Added
59
+ * Yoast SEO support on AMP pages and other SEO plugins
60
+ * AMP WooCommerce Support
61
+ * Switch on/off Support for Pages & Posts on AMP
62
+ * Translation Panel & RTL
63
+ * Internal AMP linking - You can browse AMP pages internally
64
+ * Related posts below the post
65
+ * Recent Comments list
66
+ * Automatically integrate AMP to your website.
67
+ * Google Adsense (AMP-AD) Support with 4 different Ad slots across the layout! The First Plugin to have this capability.
68
+ * Google Analytics Support.
69
+ * User Friendly Theme Options Panel.
70
+ * Unlimited Color Scheme.
71
+ * Image Logo Upload.
72
+ * Supports Posts and Pages.
73
+ * Proper rel canonical tags which means that Google know the original page.
74
+ * Overlay Navigation Menu bar.
75
+ * Social Sharing in the Single.
76
+ * Sexy Design.
77
+ * Separate WordPress Menu for AMP version.
78
+ * Page builder & Shortcodes Compatibility.
79
+ * Carousel support for Gallery.
80
+ * Better Image stretching and resizing.
81
+ * Youtube Video Embed Support.
82
+ * Vine Embed Support.
83
+ * Twitter oembed Support.
84
+ * Instagram Embed Support.
85
+ * Facebook Video Embed Support.
86
+ * RTL Support
87
+ * Custom AMP FrontPage
88
+ * Notifications
89
+ * Chartbeat, Hi-stats, Yandex Metrika, Piwik, Segment.com, StatCounter, Effective Measure and comScore Support
90
+ * Incontent & DoubleClick Support
91
+ * Great Support & Active Development.
92
+ * Widgets & WooCommerce
93
+ * Genesis SEO Support
94
+ * Breadcrumb Support added
95
+ * Facebook Instant Articles Support Added
96
+ * NEW - AMP Installation Wizard that makes it easy to setup for new users.
97
+ * NEW - Category base remover support
98
+ * NEW - Tag base remover support
99
+ * NEW - AMP Theme Framework Core Support Added. You can now create AMP templates of your own in just minutes. **[More](https://ampforwp.com/amp-theme-framework/)**
100
+
101
+ **[JOIN CHAT GROUP COMMUNITY](http://ampforwp.com/community/)**: Purpose of this group is to get proper suggestions and feedback from plugin users and the community so that we can make the plugin even better.
102
+
103
+ = Getting Started: =
104
+ **[1. User Documentation:](http://ampforwp.com/help/)** The AMP for WP plugin is easy to setup but we have some tutorials and guides prepared for you which will help you dive deep with the plugin.
105
+
106
+ **[2. Developer Docs:](https://ampforwp.com/help/#extend)** We have created special documentations for developers and semi technical users who are willing to modify the plugin according to their own needs.
107
+
108
+ **[3. Fixing AMP Validation Errors:](https://ampforwp.com/priority-support/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin)** We will personally take care that your website’s AMP version is perfectly validated. We will make sure that your AMP version gets approved and indexed by Google Webmaster Tools properly and we will even keep an eye on AMP updates from Google and implement them into your website.
109
+
110
+ **[4. Community Support Forum:](https://ampforwp.com/help/#support-forum)** We have a special community support forum where you can ask us questions and get help about your AMP related questions. Delivering a good user experience means alot to us and so we try our best to reply each and every question that gets asked.
111
+
112
+ **[5. Frequently Asked Questions:](http://ampforwp.com/faq/)** Some of the Frequently Asked questions.
113
+
114
+ = Issues & Bug Reports: =
115
+ **How do I Report Bugs and Suggest New Features**
116
+ <i>You</i> can report the bugs at https://github.com/ahmedkaludi/Accelerated-Mobile-Pages/issues
117
+
118
+ **Will you Add New features upon my request?**
119
+ Yes, Absolutely! I would suggest you to send your feature request by creating an issue in Github at https://github.com/ahmedkaludi/Accelerated-Mobile-Pages/issues/new/ . It helps us organize the feedback easily.
120
+
121
+ **How do I get in touch?**
122
+ You can contact me using this url: http://ampforwp.com/contact/
123
+
124
+
125
+ == Installation ==
126
+ **[Visit Help area for the Documentation:](http://ampforwp.com/help/)**
127
+
128
+ [youtube https://www.youtube.com/watch?v=Em1nsE_KaKw]
129
+
130
+ **[Visit Help area for the Documentation:](http://ampforwp.com/help/)**
131
+
132
+
133
+ == Frequently Asked Questions ==
134
+
135
+ = Can I add analytics? =
136
+
137
+ Yes, you easily can. In fact, we have support for 12 Analytics companies. Including Google Analytics, Facebook Pixel, StatCounter, QuantCast, Chartbeat, comScore to list a few. Also, we have Google Tag Manager (GTM) support as well.
138
+
139
+ = Can I add Ads in my AMP pages? =
140
+
141
+ Yes, you can. We have 6 ad placement slots that are built in and strategically placed to get maximum views. Also, we have [an extension] (https://ampforwp.com/advanced-amp-ads/) from which you can insert ads between the content, will get more ad slots and also add custom banners to all the available slots.
142
+
143
+
144
+ = Can I extend/Change the AMP design, so it suits my needs? =
145
+
146
+ Yes, you easily can. We have created this plugin in such a way that it can easily be extended. Check out our [AMP Theme Framework](https://ampforwp.com/tutorials/article/getting-started-amp-framework/)
147
+
148
+
149
+ = Do you have any prebuilt designs? =
150
+
151
+ Yes, we have AMP themes section where we have free and paid designs available. We also update it regularly. You can check it out our [AMP Themes](https://ampforwp.com/themes)
152
+
153
+
154
+ = I'm a developer and I want to add custom functionality for a client, can I do that? =
155
+
156
+ Yes, of course. This plugin is very developer friendly, we have lots of hooks and filters that you can use to extend and customize according to the requirements. Also, we have [developer documentation](https://ampforwp.com/tutorials/article-categories/developer-documentation/) which we update regularly.
157
+
158
+
159
+ = How do I report bugs and suggest new features? =
160
+
161
+ You can report the bugs [here](https://github.com/ahmedkaludi/Accelerated-Mobile-Pages/issues)
162
+
163
+ = Will you Add New features to my request? =
164
+
165
+ Yes, Absolutely! We would suggest you send your feature request by creating an issue in [Github](https://github.com/ahmedkaludi/Accelerated-Mobile-Pages/issues/new/) . It helps us organize the feedback easily.
166
+
167
+
168
+ = How do I get in touch? =
169
+
170
+ You can contact me using this URL: http://ampforwp.com/contact/
171
+
172
+
173
+ == Screenshots ==
174
+ 1. AMP Homepage
175
+ 2. AMP Single Post
176
+ 3. Post Navigation in Single
177
+ 4. Sticky Social sharing icons
178
+ 5. Overlay Navigation menu sidebar.
179
+ 6. Page builder of the Single article. You can drag and drop any element.
180
+ 7. Single post of Design One
181
+ 8. GTMetrix Performance Report
182
+ 9. Google PageSpeed Insight report for AMP
183
+ 10. Homepage of Design One
184
+ 11. Pingdom Speed Report for AMP
185
+
186
+
187
+ == Changelog ==
188
+
189
+ = 0.9.72 (6th January 2018, Happy New Year) =
190
+ * View More details on https://ampforwp.com/0-9-72-released-stability-update-77th-update
191
+ * Related Posts Image stretching in Design 3 AMP theme Framework #1482
192
+ * RTL option must be integrated into AMP theme Framework #1562
193
+ * `DOMDocument::loadHTML():` Attribute itemprop redefined warning fixed #1539
194
+ * Created an option to add Author bio article in Facebook Instant Article #1521
195
+ * Options to add push notification button above and below the content #1571
196
+ * Copy the Content button for Custom Post types #1532
197
+ * Alexa Metrics Compatibility added #1536
198
+ * Logo styling added with amp_logo. So styling can work with AMP Theme Framework. #1520
199
+ * Content parsing login improved, so it will not through any warnings if the content has only 1 paragraph. #1523
200
+ * Debug Warnings removed #1564
201
+ * Caption in the Gallery creating validation errors Fixed. #1549
202
+ * Tables Link color should be as same as the link of the body #1559
203
+ * Separate options for In-Content related posts #1546
204
+ * WebPage Schema Type added in Structured Data options #1558
205
+ * Fatal Error fixed with `mb_detect_encoding()` after enabling the minify option #1494
206
+ * Content blank or fatal errors due to itemscope and itemtype, fixed. #1570
207
+ * Performance improved. Due to `_transient__redux_activation_redirect` transient. #1526
208
+
209
+ = 0.9.71 (1st December 2017) =
210
+ * Design 2 Post Titles issue fixed
211
+ * Instant Articles validation issue fixed.
212
+
213
+ = 0.9.70 (30th November 2017) =
214
+ * View More details on https://ampforwp.com/0-9-70-released-stability-update-76th-update/
215
+ * Image alt tags are empty which caused issues. #1154 (thanks to @liagua)
216
+ * ALT and IMG tags are in one line #1442
217
+ * Updated the permalink for post view in admin area #1318
218
+ * aria-current causing validation issues #1427
219
+ * Aligning Captions in the Bottom in Gallery #1428
220
+ * Logo’s height & width should dynamically come from the logo. This was a great UX improvement in my opinion. The logo would good regardless of the kind of image you upload. #1429
221
+ * After 0.9.69.1 update Call to undefined function mb_convert_encoding #1447
222
+ * Featured image options now also reflect the structured data #1430
223
+ * Blur & Stretching issues of Design 3 thumbnails are now fixed. They’re crisp and clear than ever! #1227
224
+ * Related posts are showing on single even when turned off #1434
225
+ * Show Related posts CSS only when it is selected #1356
226
+ * Author image now displays on author pages #1426
227
+ * Category base removal in AMP from url option is only working on the first page #1418
228
+ * Bug fixed: PHP Warning DOMDocument Empty string supplied as input #1449
229
+ * Video support added in Instant Articles #1300
230
+ * Read more tag in Instant articles issue fixed #1415
231
+ * Amp carousel issues fixed #1446 #1456
232
+ * Compatibilty with Envira Gallery Lazy Loading #1432
233
+ * Inline Related Posts in AMP Theme Framework #1457
234
+ * Different number of in-content related post and related posts at the footer #1448
235
+ * FooGallery update broke all the AMP compatibility, but we fixed it from our side so that user’s gallery work perfectly #1424
236
+ * WPBakery Page Builder Conflict solved #1419
237
+ * Goodlife theme Lazy Load compatibility added #1416
238
+ * AMP-Facebook-Like Was found but unused Validation Error fixed. #1463
239
+ * Playbuzz not displaying if added with https: #1466
240
+ * Options Panel labels renamed for better understanding.
241
+
242
+
243
+ = 0.9.69 (20th November 2017) =
244
+ * View More details on https://ampforwp.com/0-9-69-released-stability-update-75th-update/
245
+ * One Signal Push Notifications bug fixed! #1404
246
+ * AMP theme framework Related posts extended so that it can be used as a loop format #1406
247
+ * Facebook like Button improvements #1405
248
+ * Add layout responsive tag to image module in page builder #1373
249
+ * Strip the shortcodes from Structure data area #1389
250
+ * Test HTTP API Call From admin panel by redux #1391
251
+ * Meta description tag in normal site Unicode character is different from AMP site unicode character. #1369
252
+ * Updated the check for ampforwp_is_amp_endpoint this should fix the issue #1372
253
+ * Updated the URL for design 3 so it can work with plain permalink #1318
254
+ * Updated the option Featured Image from The Content #1367
255
+ * If “Featured Image From The Content is enabled and Duplicate Featured Image” is disable it will remove all the duplicate images from the content. #1375
256
+ * Date Format under Homepage improvements #1408
257
+ * Warnings due to inline related posts in Homepage #1413
258
+ * Plain Permalinks Support improved. #1318
259
+ * Allow Homepage title of Bread Crumbs feature to be changed from Translation Panel #1414
260
+ * Debug Errors in AMP Theme Framework #1403
261
+ * Unnecessary loading of Merriweather fixed, it will only load in the Design 1.
262
+ * Enter Phone Number is not Appearing when switch to Call now button #1425
263
+ * Need excerpt below the title, above the meta #1399
264
+ * Remove the Separator piple symbol from the footer when “Back to Top link” is off #1417
265
+ * Display Child or subcategories on Category pages. #1385
266
+ * Add Caption in the Gallery Image feature conflicting with Gallery widget #1407
267
+ * Youtube Shortcode embed with &rel=0 support #1378
268
+ * Filter for Excerpt custom text in the AMP options #1411
269
+ * WPML Multilingual CMS plugin flags compatibility #1270
270
+ * Compatibility with Tasty Recipes plugin and other page builders with amp page builder #1431
271
+
272
+
273
+ = 0.9.68 (12th November 2017) =
274
+ * View More details on https://ampforwp.com/0-9-68-released-stability-update-74th-update/
275
+ * ADs are Optimize For Viewability, meaning it will try to load faster than the original AMP AD loading strategy.
276
+ * Content was disappearing issue was resolved #1392
277
+ * Featured Image from The Content option is connected to related post #1339
278
+ * Fix amp-web-push helper iframe configuration URL #1387
279
+ * Facebook Like button added to AMP #1327
280
+ * WPML support for AMP Improvement #1285
281
+ * Debug Errors fixed #1366
282
+ * Setting ad density for Facebook Instant Articles ads #1287
283
+ * Showing the number of comments in Single #1341
284
+ * Styling added to the sitewide ads and made sure that they are in the center. #1343
285
+ * One Signal buttons Translation added #1383
286
+ * Article type added to Structured data #1344 #1354
287
+ * The issue with the amp-carousel when RTL was enabled #1358
288
+ * amp-carousel with images of different sizes #1358
289
+ * a bug where Img is getting converted to amp-img if there's no height or width. which causing validation issue and image is not visible fixed.
290
+ * Instant Article should have a default value for number of posts, it was causing the memory issue with alot of posts #1390
291
+ * Notice if a post has no author data #1338
292
+ * Added a new redux extension select field in redux framework #1349
293
+ * Issues with galleries as well as gallery captions #1363
294
+ * Added a hook for adding anything in between the loops #1396
295
+ * Hide meta boxes as per the user level types #1340
296
+ * Switch between the Date formats #1384
297
+ * Fix: Jannah theme lazy load issue #1362
298
+ * Issues with galleries as well as gallery captions #1363
299
+ * Create Dynamic url of amp according to the permalink structure #1318
300
+ * Minor code performance improvement.
301
+ * Archive titles in Design 3 frontend issue
302
+
303
+ = 0.9.67.0 (6th November 2017) =
304
+ * View more details on https://ampforwp.com/one-signal-push-notifications-for-amp/
305
+ * OneSignal Push Notifications integrated #807
306
+ * Vimeo embed support added
307
+ * SoundCloud embed support added
308
+ * Pinterest embed support added
309
+ * PlayBuzz embed support added
310
+ * DailyMotion embed support added
311
+ * Fix: Handle issues with data uri images in CSS #1033
312
+ * Fix attribute when adding AMP Mustache lib #1033
313
+ * Fix: Output CSS for feature image #1033
314
+ * An option added for users who don't want to receive update notifications #1342
315
+ * Structured data nav improvement
316
+ * Sitenavigationelement has been implemented correctly for footer menu. #1345
317
+ * Style sanitization for Menu Items #1359
318
+ * Polylang flags support for menu  #1360
319
+ * Mobile Redirection issues fixed #1173
320
+ * Jetpack fatal error fixed #1355
321
+ * AMP Page Builder requires a button to be clicked, so the scripts are not running on the runtime making it easy on the edit screen page and avoid the possible script conflict.
322
+ * Needs proper CTA Bar's styling. #1361
323
+ * Debug errors on archive pages #1353
324
+ * Preview shall only be loaded on click rather than in background #1331
325
+ * ampforwp_is_home() function code improved
326
+ * making sure scripts and styling is properly adding when sanitizing the sidebar #868
327
+ * All the backend css and js should be versioned, so it's not cached. #1335
328
+
329
+ = 0.9.66.1 (30th October 2017) =
330
+ * Fatal error if has version less than WP 4.8 fixed
331
+ * More Minor Validation errors fixed
332
+ * Odnoklassniki sharing button is not working #1337
333
+
334
+ = 0.9.66.0 (29th October 2017) =
335
+ * View more details on https://ampforwp.com/0-9-66-released-bug-squashing-oct-2017-72nd-update/
336
+ * Design 3 & Design 1 are optimised with 90+ Google PageSpeed Score on Mobile and 95+ in desktop performance #1273
337
+ * Featured Image from the content for blog and homepage #1295
338
+ * Category Module for AMP Page builder added #888
339
+ * Don't load unused CSS selectors. All the CSS is conditionally loading, to decrease the number of CSS loaded per page and increased in performance #1292
340
+ * Twitter Video embed code support added in AMP #1307
341
+ * Video Posting Structured data #1293
342
+ * Navigation menus are now Schema compatible for better Structured data integration #1229
343
+ * Yoast checking conditions for Structured Data Improved #1293
344
+ * Added "back to Top" in design 3 #959
345
+ * Proper blog check and author for custom frontpage #1260 (Made some changes to check the blog properly and also added the author details for Custom Frontpage)
346
+ * AMP not working on password-protected pages #1192
347
+ * Debug errors reported by the user #1284 and few more we found internally
348
+ * Inline Style Sanitizer for Comments to avoid any validation issues #1193
349
+ * Next/Previous links removed from pages #1268 props @Frenchomatic
350
+ * WPML Multilingual CMS plugin flags compatibility added #1270
351
+ * Image sanitizer added for the Sidebar #1270
352
+ * Added AMP Components the correct way. Added amp-gist, amp-social-share. #336
353
+ * amp-video script added - Which decreases the non-critical validation issues #991
354
+ * Arrows in Design 3 pagination #1000
355
+ * Author page links in Single #1282
356
+ * Added previous open state of option panel and show again when search clean #1238
357
+ * Odnoklassniki Social Sharing Support for AMP (with target blank for better bounce rate) #1230
358
+ * GIF or animated images resize problem fixed #1281
359
+ * In Design1, Header Background & Link Color have same option #1249
360
+ * FB Pixel for AMP added #1231
361
+ * Structured Data Type option for AMPed Custom Post types only #1259
362
+ * Attribute ‘readability in the tag ‘div’ removed - this decreases the validation issues #1306
363
+ * AMP Theme Framework Improvements: loop, author, related_post, Add Author support #1311
364
+ * Commentator's Avatar in the comments section #1132
365
+ * Remove 'Welcome to AMP' from Dashboard sub-menu and moved to the options area to decrease the annoyance and increase the user happiness #902
366
+ * Option to Sort the Random Order of Related Posts to increase the audience engagement (Default is 'ID', on enabling the option it will change to 'rand') #1250
367
+ *  View AMP on Admin Bar for the respected page/post If enable. #1236
368
+ * google maps iframe link to larger map #1099
369
+ * Comments now jumping due to the slash at the end #1309
370
+ * Page Builder causes Incompatibility with the Divi theme (We restructured the Text Module for Page builder for better compatibility and UX) #1162
371
+ * Inline Style Sanitizer for Comments added. Less Critical Validation issues and Better Presentation #1193
372
+ * WPML amp-html error fixed #1285
373
+ * Radio button not working for Show View more Button" #1018
374
+ * Added registered handle for tinymcePointer localize data #1301
375
+ * Date in the Design 2 should not be hidden in mobile version #1315
376
+ * Page builder not working on homepage(Selected as front page) #1316
377
+ * Instant articles number of posts option #1271 (Removed some unused code as well, it will rendered all posts if none is enter in the options)
378
+ * Auto flush on save for FBIA to improve the UX.
379
+ * Plain Permalinks Support improved. #1318
380
+ * Tables support added to FB Instant Articles #1266
381
+ * Demo link added in the Theme selector option #1248
382
+ * Remove invalid attributes from multiple tags which reduces critical validation errors and validates pages.
383
+ * AMP makes a problem in archive page label, when it is active in non-amp version #1304
384
+ * placeholder-icon.png is 404 fixed #1310
385
+ * Category & Tags switches for Single added. #1055
386
+ * Copy Content (Custom AMP Editor) Option Not showing with Page Builder of SiteOrigin issue fixed #1280
387
+ * Improving UX with: when AMP support is off for a specific post type then all the AMP related metaboxes should be removed #1289
388
+ * Options Panel Options rearranged, labels rewritten, descriptions repositioned for better User interaction [commit]
389
+
390
+ = 0.9.65.2 (25th October 2017) =
391
+ * TypeWatch is not a function #1299
392
+ * Error with BackupBuddy fixed #1303
393
+
394
+ = 0.9.65.1 (24th October 2017) =
395
+ * AMP Minifcation Issues fixed
396
+
397
+ = 0.9.65 (22nd October 2017) =
398
+ * View more details on https://ampforwp.com/new/
399
+ * Favicon for AMP #1039
400
+ * AMP Minification option added with Performance Tab in Options #1286
401
+ * Post support is turned off then Meta box should also be removed #1253
402
+ * Excerpt Length feature in Design two and Three #1122
403
+ * Test Contact form plugins and their settings in the options panel #1121
404
+ * Mobile preview in Edit Screen #1082
405
+ * Search feature for Options Panel #1238
406
+ * WordPress Social Share Buttons Validation Issues #1272
407
+ * itemtype attribute is striping in the ul tag #1210
408
+ * Debug Error in Breadcrumb 0.9.64 #1267
409
+ * Disable AMP linking at Wordpress Search Page #969
410
+ * Featured Image is missing #1071
411
+ * Removed ampforwp_plugin_activation_notice #1034
412
+ * Add VK (Vkontakte) Sharing Button #1187
413
+ * Grab the first image instead of post thumbnail for featured image #1189
414
+ * AMP theme framework core changes #1274
415
+ * Grab the first image instead of post thumbnail for featured image #1189
416
+ * Create a Switch on Top of Page Builder #1279
417
+ * Inline Related Posts added that helps you with improving bounce rate #1078
418
+ * Caption Support in Image Gallery Carousel #1172 #1136
419
+ * Instant Articles feed shows sticky posts on top #945
420
+ * Added search check, to fix debug notice
421
+ * Option to hide date from Design 1 & Design 3 Homepage Loop #1264
422
+ * UI labels improvements in the Options panel
423
+ * Sorting out design #2 – static front page #1175
424
+
425
+ = 0.9.64 (15th October 2017) =
426
+ * View more details on https://ampforwp.com/new/
427
+ * Structured Data Type option added. You can now change the structured data format for Posts, Pages and Custom post types #323
428
+ * When comments plugin activate, Comments section should remove. #1093
429
+ * Notification causes a validation error. #1147
430
+ * CSS !important need sanitization #1225 - This will help us to validate tens of thousands of pages.
431
+ * Strange spaces when using Sassy Social Share #1185
432
+ * Remote CDN use? Let's host it? #549
433
+ * Typo fix for Linkedin Profile Page URL section #905 [Thanks to Prayag @pra85]
434
+ * Replace fastimage with fasterimage for PHP 5.4+ #1191
435
+ * Debug Errors Post 0.9.63 #1219
436
+ * Ad5 code injected twice #1116
437
+ * Homepage Support must be Off when we turn Off Homepage Support. #738
438
+ * Add custom class in post pagination for styling #1100
439
+ * Removed the Lazy Loading issue of Schema Theme #1170
440
+ * H1 tag for archive titles (Commit) #1155
441
+ * Alt tag for the Logo #1155
442
+ * Design 3 Menu RTL issue fixed #1106
443
+ * Ability to add dynamic classes in body tag #1237
444
+ * Warnings fixed on 404 page #1243
445
+ * Properly structured data for Homepage, Custom Frontpage and Blog #1155 #1242
446
+ * Option added to Enable/Disable categories and Tags links from Single #1155
447
+ * Fatal error after 0.9.63 fixed #1220
448
+ * Debug Error due to vendor AMP #1213
449
+ * PHP warning on line 147 after 0.9.63 #1241
450
+
451
+ = 0.9.63 (8th October 2017) =
452
+ * View more details on https://ampforwp.com/new/
453
+ * Category and Tag Base Remover as core features #1079
454
+ * Hide AMP on Posts option added #935
455
+ * Installation Setup Screen Added for new users
456
+ * Validation for the session in PHP #1158. PR by Bryan Contreras @bryan3561
457
+ * All the amp pages should work perfect with Plain Permalink settings #488
458
+ * WYSIWYG TinyMCE editor added for the Text Module in AMP Page Builder #1205
459
+ * WPML Static Front Page Support for title and description with Yoast. #1143
460
+ * Row Settings area added for AMP Page Builder #1148
461
+ * xlink attribute causes Validation Issues #1149
462
+ * Posts with no images on Archive pages are squeezed to 65% #1058
463
+ * Body Class to target specific pages #1123
464
+ * Option to enable/disable Breadcrumb #1129
465
+ * Debug errors due to Breadcrumbs fixed #1109 #1130 #966
466
+ * Visit AMP option added below the View Site in Dashboard. #1076
467
+ * Many Debug errors fixed #1109
468
+ * Textarea for body tag which will help people add AMP Auto Ads #1064
469
+ * Structured data improvements #1048 #1044 #1085 #1118
470
+ * Twitter share URL based on users choice, you can allow people to share pretty links and short links. #1097
471
+ * Author Avatar removed code fixed which has been displayed in the div "amp-wp-meta amp-wp-byline". #1087
472
+ * Only one figure element is allowed in the article header FB Instant Articles #1127 & #1157
473
+ * Image alt tags are empty and cause issues fixed. #1154
474
+ * Button to copy the content into Custom AMP Editor #783
475
+ * Rename AMP loop widget areas or add proper descriptions #1045
476
+ * Trailing slash issue #1095
477
+ * Related Posts by Post type featured added #1141
478
+ * Ultimate Social Media Icons plugin causes validation issues fixed #1135
479
+ * Adding proper path for functions.php, it was causing strange fatal errors and irregular white screen of death fixed  #1144
480
+ * A smooth way to migrate from other AMP plugins to AMPforWP #1051
481
+ * Alert added on AMP by Automattic installation. #1180
482
+ * Insertion of strange spaces around H1 titles #1069
483
+ * AMP Page Builder and HTTPS #1164
484
+ * You can display comments from more than one vendor such as displaying WP & FB Comments #1150
485
+ * Rename AMP loop widget areas or add proper descriptions #1045
486
+ * FrontPage featured image with srcset #1063
487
+ * An option for Showing featured image from custom field #1098
488
+ * Added the Custom Front Page Title From Yoast SEO #1163
489
+ * Commenting breaks SSI directives causes to display error #1179
490
+ * rel canonical appears more than once in search pages #1195
491
+ * Dev mode in AMP #1083
492
+ * Social Sticky Icons Improvements #1061
493
+ * Grand-Child support added in Design 3 #1152
494
+ * amp-accordion non-critical error in Design 3 & CSS improvements fixed #1152
495
+ * Incorrect @id for mainentity #1080
496
+ * Hide AMP by specific Categories tweaked for performance. Thanks to Joshua Eichorn @jeichorn CTO at Page.ly #1133 - Huge Thanks!
497
+ * amp-auto-ads for sites with RTL support ON #1176
498
+ * Redirected the Google forms to our contact page so that we can take each and every query and answer every person. #1201
499
+ * ui-state-highlight class was conflicting with ACF date picker fixed #1199
500
+ * Responsify WP Lazy loading causes blank image (Compatibility) #1131
501
+ * amp-carousel scripts loading on the second page fixed in Design 3
502
+ * Show Design screenshot while selection of design #1209
503
+ * Switches Redesigned for better UX #1211
504
+ * Welcome Page UX Improved #1214
505
+
506
+ = 0.9.62 (25th September 2017) =
507
+ * View more details on https://ampforwp.com/new/
508
+ * INTRODUCING Page Builder 2.0 for AMP! [Learn More & Watch the Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
509
+ * Documentation & Help links improved
510
+ * Post type specific classes for targetting
511
+ * Design name restored in Options panel (It was recently renamed to Appearance)
512
+ * Minor Bug fixes as well
513
+
514
+ = 0.9.61 (10th September 2017) =
515
+ * View more details on https://ampforwp.com/options-restructured/
516
+ * Options Panel Restructured – Options were dividing into two parts: Settings and Appearance.
517
+ * AMP Theme Framework Core Support Added. You can now create themes of your own in just minutes.
518
+ * WPML Static Front Page Support #1111
519
+ * Notification message disables when CF7 & gravity form is activated. #1107
520
+ * Space after On in Design 3 #1114
521
+
522
+ = 0.9.60 (4th September 2017) =
523
+ * View more details on https://ampforwp.com/0-9-60-released-improved-redirection-66th-update/
524
+ * Class added to View non-amp anchor tag
525
+ * Params added properly to get rid of a warning #1077
526
+ * rel=attachment noopener generating validation errors #1090
527
+ * Breadcrumbs Support Added #701
528
+ * Enable / Disable button added for Navigation Menu #735
529
+ * Move the ad code for Instant Article down after the article #964
530
+ * Add analytics code of FB instant articles properly #1096
531
+ * datetime Tag not stripping properly #1043
532
+ * Mobile redirection on custom post types #1028 #1052
533
+ * Mobile Redirection causing extra redirect #879 #933
534
+ * Proper mobile redirection on Homepage #1052
535
+ * View non-amp on blog will redirect to blog
536
+ * Blog will redirect to blog irrespective of AMP Homepage option #871
537
+ * Dont redirect if archive support is disabled #1052
538
+ * non-amp category pages should redirect to non-amp pages if turned off from Hide AMP #999
539
+ * Disable amp for forum plugin (wpforo) #592
540
+
541
+ = 0.9.59 (23th August 2017) =
542
+ * Design 3 Images were not aligned properly. Fixed. #1040
543
+ * Caption in the design 3 improved
544
+ * Jetpack File not loading throwing fatal error #1038
545
+ * If the mobile redirection is ON and the category is excluded to display the AMP then it should redirect properly
546
+ * Custom Editor Compatibility issue with SiteOrigin PageBuilder fixed #997
547
+ * Native Twitter Embed support
548
+ * Added a hook after the body tag: ampforwp_body_beginning (commit)
549
+ * GTM in AMP Improved #958
550
+ * WP User Avatar compatibility Added #975
551
+ * Alt tag on frontpage featured image added #1050
552
+ * Blurred Images on the frontpage fixed #1050
553
+ * Need to escape alt tag #1049
554
+ * Debug errors & PHP warnings were fixed #859 #811 #830 #810
555
+ * Proper rel canonicals for inner pages #1047
556
+ * Added Video sanitizer for comments #1053
557
+ * When activating the AMP plugin, display a notification in the popup. #1036
558
+ * Video Sanitizer added for Comments
559
+
560
+ = 0.9.58.1 (9th August 2017) =
561
+ * Jetpack conflict issue solved #1038
562
+ * Genesis SEO Support added #1013
563
+ * Fixed Wrong SEO title issue #1013 and #836
564
+ * Design 3 Carousel script loading method improved #990
565
+
566
+ = 0.9.58 (9th August 2017) =
567
+ * View more details on https://ampforwp.com/new/
568
+ * Genesis SEO for AMP support added
569
+ * AMP 0.4.2 Vendor Bundled for making it crash proof
570
+ * Archive desc only on 1st page #1029
571
+ * Ads are not working after 0.9.6 #1030
572
+ * Fixed the Post 0.9.57 Update Bugs #1025
573
+ * All Images are aligned on left side in design 3 #1031
574
+ * Custom frontpage title issue in Design 3 fixed
575
+
576
+ = 0.9.57 (5th August 2017) =
577
+ * See the Full changelog https://ampforwp.com/0-9-57-released-compatibility-issue-fixed-62nd-update/
578
+
579
+ = 0.9.56 (31st July 2017) =
580
+ * View more details on https://ampforwp.com/page-break-in-amp/
581
+ * Page Break / NextPage (Pagination) Support Added #834 #857 (Improvement)
582
+ * Show/Hide AMP for Categories of Posts or All posts #872 (Improvement)
583
+ * Adding analytics capabilities to Instant Articles #978
584
+ * JetPack Plugin Conflict Solved #971
585
+ * Social sharing code improved. amp-social-share js is getting added for line and WhatsApp social share #981
586
+ * Code improvement for rel canonicals(home and archive)
587
+ * Perfect SEO URL + Yoast SEO Compatibility #982
588
+ * Some styling for tags to show up properly
589
+ * Undefined index notices #960
590
+ * Non-amp category pages should redirect to non-amp pages if turned off from Hiding AMP #999
591
+ * Page builder text and button module issues #972
592
+ * Documentation links updated in the Options panel
593
+
594
+ = 0.9.55 (13th July 2017) =
595
+ * View more details on https://ampforwp.com/0-9-55-released-improvement-update-61st-update/
596
+ * Disqus Comments show up even when disabled per post #931
597
+ * Unnecessary: Adding the Markup for AMP Woocommerce latest Products #929
598
+ * H3 inside OL in Related-Posts.php #930
599
+ * Advertisement Options in Instant Articles #943
600
+ * Incompatible with bootstrap plugin #525
601
+ * Error in tag and category links #934
602
+ * Pagebuilder Button module link had issues #951
603
+ * Unnecessary: Adding the Markup for AMP Woocommerce latest Products #929
604
+ * WPtouch Pro Compatibility Issues #927
605
+ * Better scripts compatibility in Single of post types #757
606
+ * Instant Articles Error: "The HTML element does not contain any text" #949
607
+ * added a filter in all the dates so a user can change the date format and modify #962
608
+ * Design3 Menu Arrows are clickable along with the links #952
609
+
610
+
611
+ = 0.9.54.2 (4th July 2017) =
612
+ * Minor bug post 0.9.54 bug fixed
613
+
614
+ = 0.9.54 (4th July 2017) =
615
+ * View more details on https://ampforwp.com/new/
616
+ * Facebook Instant Articles Support #862
617
+ * Exclude Some Pages from Mobile Redirection #914
618
+ * After 0.9.53 update amp-social-share js missing (critical issue) #924
619
+ * Hooks added in Header (above and below)
620
+ * View non AMP[Code improvement] #928
621
+ * Pages are not supposed to show meta like this, especially Categories #894
622
+ * Monarch plugin having design issues #925
623
+ * Show AMP Hide AMP Check Box Fixes #794
624
+
625
+ = 0.9.53 (19th June 2017) =
626
+ * View more details on https://ampforwp.com/stability-validation-issues-59th-update/
627
+ * Compatibility Issue with Rocket Lazy Load plugin #907
628
+ * Link color issue with UX of Color Pickers in Design 3 #731
629
+ * amp-analytics js appears more than once when Google tag manager is used #885
630
+ * SEO by SQUIRRLY is adding analytics twice #678
631
+ * Fatal error when WPSEO is activated #900
632
+ * Design 3 Sticky header should have an option #625
633
+ * Search form was enhanced, it can now be used on the websites without https certificate. That will certainly fix a lot of validation issues. #912
634
+ * Yandex Metrika support in AMP #585
635
+ * Histats Analytics Support #880
636
+ * Chartbeat Analytics Support #882
637
+ * Do not strip Rel from anchor tags #790
638
+ * Design close Resulting Blank Screen in AMP Site #642
639
+ * Logo size is not applying #817
640
+ * AMP Publisher logo guidelines #162
641
+ * Remove amp-social-share extension .js from Custom Frontpage #899
642
+ * Add compatibility with Sassy Social Share #679
643
+ * Remove Disallowed ‘like’ tag from Facebook Like button by Ultimate Facebook plugin
644
+
645
+ = 0.9.51.1 (12th June 2017) =
646
+ * Redirection issue after 0.9.51 Update.
647
+ * Improved compatibility with plugins.
648
+
649
+ = 0.9.51 (8th June 2017) =
650
+ * View more details on https://ampforwp.com/page-builder-released-in-amp/
651
+ * Page Builder Support added ( See Tutorial at https://ampforwp.com/tutorials/page-builder/ )
652
+ * Comments are not showing properly when words are long #861
653
+ * Remove amp-social-share extension .js from Pages #853
654
+ * The tag ‘amp-sidebar extension .js script’ appears more than once in the document #828
655
+ * Remove Advertisement tab #839
656
+ * Compatibility with Slide-in Plugin by WPMU dev #866
657
+ * Mobile redirection issue with bbpress #867
658
+ * All the data must be properly sanitize in the sidebar #849
659
+ * AMP html should not be added on the second page of comments
660
+ * Author page’s support #456
661
+ * URLs in comments should be clickable(links) #869
662
+ * Featured image should be centered in desktop mode #870
663
+ * Added More Hooks #721 (Documentation on this coming soon!)
664
+ * Page 2 goes to the wrong URL #865
665
+ * Proper Title and meta for homepage and posts #850
666
+ * Gist Support added #608 Just add a shortcode and enjoy Devs (Ex: amp-gist id="b9bb35bc68df68259af94430f012425f )
667
+ * /blog/amp pagination not working #875
668
+ * separate the Text and Date format in design 2 #876
669
+ * Comments show in AMP w/o breaks between paragraphs #873
670
+ * If no featured image below hooks are not working #877
671
+ * Change meta name Viewport and its value #878
672
+ * Bolt icon in option #474
673
+ * Code restructuring and code quality improvements.
674
+ * Create a seperate function for comment code in frontpage.php #682
675
+ * Remove all the duplicate code from frontpage.php of all the designs and use hooks to add the code instead of static code #889
676
+ * Few Debug errors removed.
677
+
678
+ = 0.9.50 (24 May 2017) =
679
+ * View more details on https://ampforwp.com/facebook-comments-in-amp/
680
+ * Design 3 Social Icons issue #832
681
+ * View non AMP leads to /?nonamp=1 #814
682
+ * Youtube shortcode compatibility improved #557
683
+ * welcome.php should be shown only if user is “administrator” #696
684
+ * Facebook comments support added in AMP #825
685
+ * WP Like Button Compatibility #841
686
+ * Custom Taxonomy Support added with Custom Post Type Extension.
687
+ * Front page comments not found as expected #837
688
+ * Fixed xml:lang tag issue #848
689
+ * Sanitize Iframe in the archive description Fixed #845
690
+ * Compatibility with Newspaper Theme by TagDiv #842 and #796
691
+ * Some debug problems (blog page, style.php) #838
692
+ * Featured Image hooks added
693
+ * Twitter is misspelled #854
694
+ * The core concept of the AMP Content builder has been built.
695
+
696
+
697
+ = 0.9.49 (12 May 2017) =
698
+ * View more details on https://ampforwp.com/0-9-49-released-small-important-bugs-fixed-56th-update/
699
+ * Option added to display the excerpt in Single #806
700
+ * Ability to add new invalid tags to filter out from AMP pages #809
701
+ * In frontpage, comment button is pointing to wrong URL #812
702
+ * Call now button and search is overlapping in Design-1 #784
703
+ * Sticky Social Icons should be off if the CTA notification bar is on #788
704
+ * Author bio in Design 1 and 2 #732
705
+ * Styling in Taxonomy description causing validation issues #798
706
+ * Twitter share(handle, url positions fixed) #815
707
+ * Tables responsiveness in ALL Designs #726
708
+ * Output all the categories and tags with their own ID’s in the div classes #750
709
+ * Social Share Icons Overlap with Leave A Comment in Design 3 #716
710
+ * Effective Measure Support on AMP #297
711
+ * Custom AMP editor on pages should only be shown when page support is ON #756
712
+ * AMP on website.com/blog without need of separate installation #775
713
+ * GTranslate Compatible #819
714
+ * Images and amp-anim styling added #725
715
+ * Filter to make the title in a post to a link #727
716
+ * Author Bio and Social Share button must not come in Pages #770
717
+ * StatCounter is now compatible with AMP #361
718
+ * Line Social media support #500
719
+ * Footer menus for Design 1 & Design 2 #623
720
+ * Strip out src=”about:blank” When Gravity Forms used #804
721
+ * Add Compatibility with Crazy Lazy load plugin #751
722
+ * Meta Titles and Description issues fixed with Yoast, All in one SEO and The SEO Framework #813
723
+ * Double quotes in the Excerpt of the meta description is making AMP Invalidated #818
724
+ * Missing featured image on static front page #824
725
+ * Fatal error while activation: see the video 0.9.49 Beta #827
726
+ * Review this code in archive.php in all 3 designs. #826
727
+
728
+
729
+ = 0.9.48 (28 April 2017) =
730
+ * View more details on: https://ampforwp.com/0-9-48-released-step-towards-multilingual-support-55th-update/
731
+ * The default translation method of WordPress added. (Option in Translation panel to switch between * Translation panel and POT file #540)
732
+ * A new Advertisement slot added above the related posts in the Single. It not only gives better options for people to display ads but this ad slot is also very handy if you are using ad companies like Taboola and RevContent.
733
+ * Another Advertisement slot added below the post title in the Single post.
734
+ * Fatal error: require_once report-bugs.php #747 fixed
735
+ * Add / for codes in Meta Description #766 fixed
736
+ * Controls re-adjusted & Renamed title of yoast description control in Options panel
737
+ * Design-3 Slider URL redirecting to non-AMP page #758
738
+ * Added new sanitizer For HTML to AMP-HTML conversion
739
+ * Sanitized Archive descriptions so that it would convert to AMP
740
+ * Comments sanitized with new sanitizer so that HTML tags automatically become AMP compatible.
741
+ * 301 redirects on non-pretty internal links #767
742
+ * Create a filter to modify the value of rel="amphtml" #778
743
+ * Max-width added for images in comments
744
+ * If in WooCommerce ?amp endpoint set then update href.
745
+ * Undefined Variable (Debug) #733 and many other debug issues were fixed
746
+ * Show last updated Post instead of published date #575
747
+ * WooCommerce Widget added to display latest products on homepage. #763
748
+ * add amp_post_template_above_footer hook global in all the designs #779
749
+ * Excerpt on top of the content in Single #665
750
+ * Subscribe box has been improved for the UX needs #712
751
+ * Notice warnings since 0.4.2 update #740
752
+ * AMP Comments Form Integration with the extension
753
+ * Filter added on the loop in Homepage of the Design 3 so that it can be modified with an external plugin.
754
+ * 404 on paged home page #781
755
+ * Twitter handle should be at the end of the tweet not in the beginning #787
756
+ * Wrong Rel Canonical for AMP Custom Frontpage #799
757
+ * Merged a pull request #761 that will improve the title and description output that is much more stable and flexible for future enhancement and use. It was contributed by Sybre Waaijer - Thanks mate for the contribution, we (our team and users) really appreciate your hard work done on this code.
758
+ * Extension page user experienced improved.
759
+ * Removed old Youtube installation video and replaced with new one.
760
+
761
+ = 0.9.47.2 (12 April 2017) =
762
+ * Design-3 Slider URL redirecting to non-AMP page #758
763
+ * Ads showing in comments #768
764
+
765
+ = 0.9.47.1 (11 April 2017) =
766
+ * Meta description option improved in SEO section #766
767
+ * Fatal error: require_once report-bugs.php #747
768
+
769
+ = 0.9.47 (10 April 2017) =
770
+ * View more details at https://ampforwp.com/0-9-47-released-54th-update/
771
+ * Meta saving method updated for customAMP content editor checkbox was causing some conflict.
772
+ * Wrong Yoast title and structured data in Custom Frontpage fixed
773
+ * CSS minification all 3 designs
774
+ * Polylang flags in menu was causing validation issue, is now resolved
775
+ * WPML flags in menu was causing validation issue, is now resolved
776
+ * Standardized function created for content sanitization.
777
+ * Archive description now displays AMP compatible markup
778
+ * Comments markup sanitized for AMP
779
+ * Design 3 images not aligned properly, fixed
780
+ * Images are aligned to center in Design 1.
781
+ * carousel ending with //amp instead of /amp fixed #753
782
+ * Title of the Post along with Post link when shared in twitter #683
783
+ * Ads were cutting in half in RTL, fixed
784
+ * Add / at the end of AMP links with in the AMP pages (Internal links) #668
785
+ * Rendering the wrong URLs in front page if paged #742
786
+ * Option to turn off AMP on all pages, so people can turn on only for specific pages #746
787
+ * Need Meta Description on amp pages #741
788
+ * Woocommerce Loop shortcode updated
789
+ * Call Now Button added in header #563
790
+ * Post images are not centered in Design 3 #695
791
+ * UX of GTM settings done, since users were getting confused #700
792
+ * Front page amphtml fixed for paginated pages
793
+
794
+ = 0.9.45.6 (31 March 2017) =
795
+ * Installation Process from welcome page was not working after WP Plugin DIR API change was fixed.
796
+ * WP Rocket Minifcation and Concatenation was not working, its fixed now.
797
+ * WP Rocket was tested properly to make sure everything is working fine.
798
+
799
+ = 0.9.45.5 (25 March 2017) =
800
+ * WP rocket conflict solved
801
+ * Cannot set property ‘innerHTML’ of null issue fixed
802
+
803
+ = 0.9.45.3 (21 March 2017) =
804
+ * Post 0.9.45 bugs fixed and released as an urgent update.
805
+
806
+ = 0.9.45.1 (19 March 2017) =
807
+ * Post 0.9.45 bugs fixed and released as an urgent update.
808
+
809
+ = 0.9.45 (18 March 2017) =
810
+ * View more details at https://ampforwp.com/0-9-45-released-compatibility-rtl-53rd-update/
811
+ * W3Total cache compatibility added
812
+ * RTL Support added for Right-to-Left language websites.
813
+ * Comments Pagination feature added
814
+ * WP-Rocket Compatibility added
815
+ * WPML Compatibility added
816
+ * Quantcast analytics support added
817
+ * ComScore support added
818
+ * Custom Yoast title support added #685
819
+ * WooCommerce Shortcode: Allows you to display WooCommerce Products. [amp-woocommerce num=6] will display the 6 products from WooCommerce. [amp-woocommerce num=6 link=noamp] will display 6 products but they will go to non-amp website, if you want to link to AMP version of the page then use [amp-woocommerce num=6 link=amp]
820
+ * Admin area UX improvements
821
+ * Adding notifications script in the correct way
822
+ * Comments now display on frontpage as well.
823
+ * Re-positioned non-amp Header link control to the right section.
824
+ * ?nonamp=1 only displays when the Mobile redirection is on
825
+ * Properly adding iFrame js.
826
+ * Custom Post type incompatibility fixed
827
+ * Widgets added to the Custom Frontpage.
828
+ * Stripping shortcodes from excerpts.
829
+ * Custom content on static frontpage had over riding issue #687
830
+ * Option added for controlling number of comments
831
+ * Welcome page should be shown only if user is “administrator” #696
832
+ * Digg Digg social share compatibility #694
833
+ * Removed unnecessary lines from Design 3
834
+ * Sanitized Archive Description to amp Compatible #659
835
+ * Author box now displays HTML properly #645
836
+ * Date added Design-3 in meta #583
837
+ * Options link was removed from wp-admin tool bar after a feedback from a user.
838
+ * Footer sub menus layout compatibility.
839
+
840
+
841
+ = 0.9.44 (5 March 2017) =
842
+ * View more details at https://ampforwp.com/user-experience-52nd-update/
843
+ * Added Welcome Screen for better User experience. [Enhancement]
844
+ * Undefined Index debug error resolved [Bug fix]
845
+ * All in one SEO Support support tested [3rd party compatibility]
846
+ * Frontpage title in Design 3 is out of the container #644 [Bug fix]
847
+ * Default Table markup in AMP #643 [Enhancement]
848
+ * AMP carousel is not working on Frontpage #641 [Bug fix]
849
+ * Social share .js was getting added even when it was not required #638 [Bug fix]
850
+ * Search Feature added for Design 1 & Design 2 [Major Improvement]
851
+ * Accordion script loading issue in Design 3 #634 [Bug fix]
852
+ * ?nonamp=1 links should be nofollow #622 [Bug fix]
853
+ * Same Header and Color Scheme are making header elements invisible #629 [Enhancement]
854
+ * In Search AMP rel canonical was different #631 [Bug fix]
855
+ * Non-AMP link in Design 3 was not working when mobile redirection was enabled #632 [Bug fix]
856
+ * Search form text strings are now added in the translation panel #607 [Bug fix]
857
+ * Load AMP-ads conditionally only if ads are available #609 [Bug fix]
858
+ * Added compatibility with Custom post type extension. Option to hide/show AMP on all custom post types #587 [Bug fix]
859
+ * Report a Bug & Request feature links added [Enhancement]
860
+ * If there was no menu set in Design 3 then all pages were getting displayed. #613 [Bug fix]
861
+ * The tag Font is disallowed #616 [Validation Improved]
862
+ * index/noindex separately added for Tags and also for Categories #606 [Enhancement]
863
+ * Use of undefined constant AMP_QUERY_VAR #596 [Bug fixed]
864
+ * Logo is not centered in Design 3 #586 [Bug fixed]
865
+ * Remove defer, a very rare type of defer was getting added #589 [Validation Improved]
866
+ * Disqus comments iframe had scrolling issues #566 [Bug fixed]
867
+ * Left side blank gap in the RTL in design 2 #541 [Bug fixed]
868
+ * Inline Styles not working correctly in Custom AMP Editor #533 [Bug fixed]
869
+ * Re-save permalinks issues. Flushing rewrites with options saved. #511 [Improvement]
870
+ * Code review and cleaning of the customizer #404 [Code Cleaning]
871
+ * Google Search iframe had some header alignment issues in Design 3. #624 - Thank you Leo Osa @leoosa for the contribution! [Bug fixed]
872
+ * AMP Frontpage + Override AMP Content = Blank page #604 [Bug fixed]
873
+ * Widget area added on the homepage with an 'AMP Category Blocks' widget. It means you can display multiple category blocks the homepage. This allows you to display complex layouts, even on AMP. [Major Improvement]
874
+ * Auto-append /amp at the end of internal links in Menu with an option in the Menu section of the options panel #531 [Major Improvement]
875
+ Reformatting and Minifying of stylesheet [Code Cleaning]
876
+ * Created a new section for Homepage and moved some controls from other areas to the home section for the better user experience. [User Experience]
877
+ * Override Homepage Thumbnail size option added. It will give you more control over your thumbnails. [Major Improvement]
878
+ * New color picker added to change the color of the header elements in the Design 3 to give you better control over the design. [Enhancement]
879
+ * Extra amp-carousel script loading is now fixed. [Bug fixed]
880
+ * Crafting of layout code in design 2 and design 3, especially with social icons area. [Code Cleaning]
881
+ * Design of search form was not clickable in iOS devices #621 [Bug fixed]
882
+ * Disqus iframe was loading even when there was no disqus name was added in the option. We found that many users might be enabling it without knowing the output and then they seem to forget, which was causing them validation warnings. [Bug fixed]
883
+
884
+ = 0.9.43.6 =
885
+ * View more details at https://ampforwp.com/stability-sprint-3-51st-update/
886
+ * Typo in the is_home() function fixed
887
+ * Option to hide/show AMP on all custom post types #587
888
+ * False detection by Windows defender tool fixed
889
+ * Conditional tags were not compatible with Advanced AMP ads which were causing some conflicts but is now fixed.
890
+
891
+ = 0.9.43.5 =
892
+ * View more details at https://ampforwp.com/stability-sprint-2-50th-update/
893
+ * Fixed shortcodes issue in related posts #543
894
+ * Iframe Scripts Added properly
895
+ * Proper conditions added for the social section of Design 3
896
+ * Featured Image issue stretched in Design 2 & 3
897
+ * Removed extra global $redux_builder_amp;
898
+ * Custom Logo Dimensions option added #479
899
+ * Index & NoIndex options added for SEO section. #558
900
+ * Added URL for rewrite flushing rules in Options
901
+ * Option to enable and disable the Author area in Design 3#577
902
+ * Rel Nofollow added in credit link
903
+ * debug issue solved: fn_offset not defined
904
+ * debug issue solved: global $post not declared
905
+ * The word 'ago' is now translatable in design 3
906
+ * The word 'read next' is translatable now
907
+ * Tablepress compatibility added #392
908
+ * Secure API server is now serving through Google Cloud Manager.
909
+ * Thrive Content builder was displaying twice when the Custom AMP content was on. It was a complex issue which has been solved now.
910
+ * amp-ad extension.js script was loading if the Ads are not enabled. #598
911
+ * Social Share Extension Included on Homepage even if we didn't have social icons #599
912
+ * Installation UX improvement #593
913
+ * Removed duplicate global variable
914
+ * Proper OG tags added #588
915
+ * Proper instructions added for Custom AMP content #471
916
+
917
+
918
+ = 0.9.43.1 =
919
+ * View more details at https://ampforwp.com/0-9-43-1-released-stability-sprint-1-49th-update/
920
+ * Emoji in comments leads to AMP errors
921
+ * Design 1 showing time on archives
922
+ * Added some space between the archive label.
923
+ * Lazy loading plugins compatibility #544
924
+ * Custom header and footer areas
925
+ * Sticky posts now come on top #564
926
+ * Footer non-amplink added in design 3 #562
927
+ * HTML Paragraph tag is shown in the title in category! #518
928
+
929
+ = 0.9.42 =
930
+ * View more details at https://ampforwp.com/design-three-update/
931
+ * Design 3 was released – Video Overview along with new options and features. View the video overview at: https://www.youtube.com/watch?v=ub1pwskt3Rc [Major Feature]
932
+ * Ticket #517 Added Upload field into Redux core [3rd party Compatiblity]
933
+ * Ticket#529 Controls for archive titles added [Improvement]
934
+ * Ticket #548 Jetpack photon code removed
935
+
936
+ = 0.9.41 =
937
+ * View more details at https://ampforwp.com/disqus-comments-in-amp/
938
+ * Disqus Comments in AMP Support Added [New Feature] - This feature can be enabled from Dashboard > AMP Options > Disqus Comments
939
+ * AMP WooCommerce supported tag was missing after the last update. [Bug fix]
940
+ * Homepage & Related Posts was displaying private and protected posts, which is now fixed [Bug fix]
941
+ * Next previous links added in Design 1 [Enhancement]
942
+ * Invalid Post Time displaying in the homepage of Design 1 [Bug fix]
943
+ * Twitter share now includes the twitter handle of the author with setting in options [Enhancement]
944
+ * Emoji in comments leads to AMP errors was fixed [Bug fix]
945
+ * Date are now displayed on archives in Design 1 [Enhancement]
946
+ * When RTL enabled logo merges with nav bar was fixed [Bug fix]
947
+ * Jetpack Photon compatibility added [3rd Party Compatibility]
948
+
949
+ = 0.9.40 =
950
+ * View more details at https://ampforwp.com/0-9-40-released-biggest-stability-update/
951
+ * Proper endpoints added [Improvement]
952
+ * Flush Rewrites properly [Improvement]
953
+ * REL Canonical properly getting added. [Improvement]
954
+ * Proper Frontpage Canonical added [Improvement]
955
+ * Added Base name support for categories and tags [Improvement]
956
+ * Redirection of excluded post solved. [Bug fix]
957
+ * Archives properly redirecting to the right URL [Bug fix]
958
+ * Homepage redirection solved [Bug fix]
959
+ * Plusone tag is stripped properly. [Validation Issue fixed]
960
+ * Archives are now clickable. [Improvements]
961
+ * WP_Query filter added for better customizability of Homepage loop. [Better Customizations]
962
+ * Social share boost plugin compatibility. [3rd party Customizations]
963
+ * Removed H1 from the frontpage even if it is not available. [Improvement]
964
+ * H3 instead of H1 for Site title. So there is only one H1 per page. [SEO Improvement]
965
+
966
+ = 0.9.38 =
967
+ * View full details at https://ampforwp.com/google-tag-manager-for-amp/
968
+ * Google Tag manager included [New feature]
969
+ * Iframe max-width added [Improvement]
970
+ * Paginated pages have different titles now. [Bug fix]
971
+
972
+ = 0.9.37 =
973
+ * View full details at https://ampforwp.com/category-tags-archive-support-added/
974
+ * Debug issues solved [Bug fix]
975
+ * Remove Extra styling added by other Themes/ Plugins [3rd party themes and plugin Support]
976
+ * Category, Tags & Archive Support with titles added [Enchancement]
977
+ * Archive Title support added [Enchancement]
978
+ * There were some issues with attachments [Bug fix]
979
+ * removed ? from amp url's [Improvement]
980
+ * Mobile redirection for Archives added and 404 redirections removed for archives [Improvement]
981
+ * View non-amp version now properly redirects to the normal version. #415 [Bug fix]
982
+ * Added an option to turn off AMP support for Homepage. [Enchancement]
983
+ * Too many redirects issue on homepage is fixed #435 [Improvement]
984
+ * Spell check and G tags are removed for thrive & Spell check compatibility [Better Validation]
985
+ * If image is not available in gravatar fixed, it was throwing an error #365 #327 [Improvement]
986
+ * Comment anchor link changed for simplecomment button files in both designs [Improvement]
987
+ * Redirection Loop issue fixed [Bug fix]
988
+ * Shortcodes were visible in excerpt, it's fixed now. [Improvement]
989
+ * Defer onload by other plugins was causing issues #431 [Better Validation & 3rd party support]
990
+ * Improved Sessions [Improvement]
991
+ * Advnaced Settings panel was created for better user experience. [Improvement]
992
+ * Spell check tag was causing validation issues. [Better Validation & 3rd party support]
993
+ * RTL issue fixed #454 [Bug fixed]
994
+
995
+ = 0.9.36 =
996
+ * Full details at https://ampforwp.com/0-9-36-released-stability-update-43rd-update/
997
+ * Redux Core Update. Better compatibility with the Salient theme and Themeforest themes & plugins using redux framework in their core, which makes the plugin much stable. [Huge Improvements]
998
+ * Hide advertisement section if advance ads plugin is active. [Better User experience]
999
+ * Ultimate Social Media PLUS Plugin Compatibility (Link) [3rd Party plugin Compatibility & Better Validation]
1000
+ * Launch Post Builder button added. One of the important feature called ‘Post Builder’, that is drag and drop post builder was somewhere hidden in the customizer, so positioned it for better visibility from users. [Better UX]
1001
+
1002
+ = 0.9.35 =
1003
+ * Full details at https://ampforwp.com/page-builder-realtime-preview-3rd-party-plugins-compatibility/
1004
+ * Customizer page builder (Design Manager) was not showing real-time preview, we have fixed this issue properly [Bug fix]
1005
+ * Attachment page was having the wrong endpoint. [Bug fix]
1006
+ * Fb:like div has href, showfaces, send and action tag, which was against validation [Validation Improvement]
1007
+ * A plugin (Spam Protection by CleanTalk, no Captcha Anti-Spam) was forcefully adding script into the AMP version. [3rd party Compatibility]
1008
+ * Lang attributes were added [Enhancement]
1009
+ * The tag like was disallowed in the AMP [Validation Improvement]
1010
+ * We did some more testing with Visual Composer & AMP [3rd party Compatibility]
1011
+ * AMP on Pages option was not working in some cases. [Bug fix]
1012
+ * Disable comment button when comments were disabled. This was fixed by @lofesa and was sent as a pull request. Thank you Lofesa!
1013
+ * g:plusone tag was not getting removed properly. [Validation Improvement]
1014
+ * Thrive headline optimizer was having issues in AMP version. [Validation Improvement]
1015
+ * Structured Data Image width issue solved [Enhancement]
1016
+ * BJ Lazy Load was having issues, we have added a fix which will make this plugin compatible with the AMP. [3rd party Compatibility & Validation Improvement]
1017
+ * imageanchor=”1″ was getting added by some 3rd party plugin, this was fixed.[Validation Improvement]
1018
+
1019
+ = 0.9.34 =
1020
+ * Newspaper theme by Tagdiv was having issues, we have fixed this one.
1021
+
1022
+ = 0.9.33 [15th Jan 2017] =
1023
+ * Full details at https://ampforwp.com/debug-errors-shortcodes/
1024
+ * Mobile was not working with Newspaper theme by Tagdiv [Bugfix]
1025
+ * Debug errors fixed, Code is now much cleaner.
1026
+ * New rewrite rules for homepage pagination. It had some paginated URLs with wrong amphtml tag.
1027
+ * Extra analytics file was loading. Better compatibility with Yoast & Monster analytics.
1028
+ * Properly removes AMP if turned off from Post panel
1029
+ * z-index position improved on Sticky Social bar
1030
+ * Better compatibility with shortcodes.
1031
+ * Divi Standard Layouts Compatibility
1032
+ * Properly Hide AMP posts if excluded. #367
1033
+ * Mobile redirection was causing loop issues which are now fixed.
1034
+ * Some plugins were loading in core AMP js file, which was causing the issues, which is now fixed. [Better Validation]
1035
+ * onclick was getting added in the links on AMP version. Issue fixed. [Better Validation]
1036
+ * thrive_headline tag was getting added in the Title tag which was causing validation issues. Fixed. [Better Validation]
1037
+ * Some interactive plugins were using place, state, city and imap tags which are now fixed. [Better Validation]
1038
+
1039
+ = 0.9.32 [7th Jan 2017] =
1040
+ * Full details at https://ampforwp.com/first-wave-of-polishing-in-2017/
1041
+ * Rel=canonical issue fixed: AMP URL redirect to the normal URL #293 & #332.
1042
+ * Paginated pages on homepage redirect to homepage URL #335
1043
+ * Title of the page should be displayed on the FrontPage #358
1044
+ * Thrive Builder AMP Validation Compatibility, so it will be validated properly in AMP.
1045
+ * Twitter Sharing improved so it gets the data properly #341
1046
+ * Option to change the number of Related Posts #290
1047
+ * Validation errors due to rel="canonical" was missing on some pages
1048
+ * Comment button displays even if the comments are not available
1049
+ * Threaded comments were duplicating, so that issue is solved and added proper CSS for it.
1050
+ * Minor issue with Jetpack Comments fixed.
1051
+ * Missing amp-social-share.js on front page fixed #372
1052
+ * Minor improvements to Title and description tags.
1053
+ * Analytics Script was loading twice when Glue was active.
1054
+ * Page specific class added for better customization compatibility #377
1055
+ * Inline Style support added Fixed #356
1056
+ * Bugs fixed in Email notification pointer
1057
+
1058
+ = 0.9.31 [2nd Jan 2017] =
1059
+ * Proper Details at https://ampforwp.com/amp-0-9-31-released-installation-user-experience/
1060
+ * Proper Condition added for the scripts to load in Frontpage.php
1061
+ * Rel canonical properly added for front pages
1062
+ * 404 and Archive page Mobile redirection code refined
1063
+ * User Experience Improvement: Installation process was improved
1064
+
1065
+ = 0.9.3 [31th December 2016] =
1066
+ * Proper Details at https://ampforwp.com/custom-amp-content-editor/
1067
+ * Custom AMP Editor - Which allows you to override your Content that you had written in Post or page, so you can add the different content just for AMP.
1068
+ * FrontPage had some validation issues. [Bug fix]
1069
+ * Related posts in Design 1 we're redirecting to 404 fixed [Bug fix]
1070
+
1071
+ = 0.9.2.2 [27th December 2016] =
1072
+ * Proper Details at https://ampforwp.com/polishing-user-experience-improvements/
1073
+ * Made the Options panel user-friendly
1074
+ * Social Share on frontpage issue fixed.
1075
+ * Readme.txt made user-friendly.
1076
+ * Archive option removed and some UI improvements
1077
+ * Single was not displaying the Title
1078
+ * 'Type is not allowed' [Validation issue fixed]
1079
+ * noshade tag Validation issue fixed
1080
+
1081
+ = 0.9.2.1 [24th December 2016] =
1082
+ * Proper Details at https://ampforwp.com/step-towards-fixing-amp-validation-errors/
1083
+ * Disabled the Tags and Categories support for AMP for better validation until we find a better solution.
1084
+ * Mobile redirection bug fixed, It was continuously redirecting to the same page [Bug fix]
1085
+ * trailingslashit added to make sure we have proper url for Mobile redirection [Bug fix]
1086
+ * In content AD overlapping the content issue fixed
1087
+
1088
+ = 0.9.2 [23th December 2016] =
1089
+ * Proper Details at https://ampforwp.com/mobile-redirection/
1090
+ * AMP Mobile Redirection Feature added. It can be turned on from Dashboard > General and then Mobile Redirection. [New Feature]
1091
+ * Archive title and description added [Improvement]
1092
+ * Improved the Speed of the AMP version #321 [Improvement]
1093
+ * Anchor link was not closing fixed #328 [Bug Fix]
1094
+ * Typo in Trailingslashit function which resulted in some issues in the Homepage version [Bug Fix]
1095
+
1096
+ = 0.9.1.2 [20th December 2016] =
1097
+ * Proper Details at http://ampforwp.com/new/
1098
+ * DoubleClick Support
1099
+ * Custom Post Type Support
1100
+ * Ratings Support
1101
+ * Comments Gaping fix
1102
+ * Custom Excerpt code
1103
+ * Better Compatibility with Yoast SEO plugin
1104
+ * AMP Validation error in Design 1 Fixed
1105
+ * Proper Homepage title & Description with Yoast SEO plugin issue fixed
1106
+ * Design -1 Excerpt too big for mobile devices, Fixed
1107
+ * Advertisement support on Design 1
1108
+ * Link to Tags & Categories were having some issues.
1109
+ * AMP looking bad on big devices
1110
+ * AMP validation Improvement: Lightbox plugins compatibility
1111
+ * Huge Progress in AMP Validation Errors: Strip unwanted codes and tags from wp_footer for better compatibility with Plugins
1112
+ * Page Performance: Removed default Google font loading
1113
+ * Page Performance: DNS Prefetch tag added for faster DNS Handshake
1114
+
1115
+ = 0.9.1 [16th December 2016] =
1116
+ * Proper Details at http://ampforwp.com/new/
1117
+ * PHP7 Compatibility
1118
+ * Pagination URLs (Prev & Next) was going to 404 ( #244 | #251 )
1119
+ * Custom CSS not working in Design one (#249)
1120
+ * Enhanced the translation panel by adding Textarea from Redux, which means that we're able to allow HTML in footer like before (#260)
1121
+ * How to remove “Powered by WordPress” from Design-1 of AMP ( #264 )
1122
+ * Non-amp Homepage support added (#267)
1123
+ * using get_avatar() (#259)
1124
+ * Validation issue fixed: The attribute 'rel' may not appear in tag 'div' (#268)
1125
+ * Validation Issue fixed: Script Tag removed from the content.
1126
+ * Featured image in Design 1 in single #261
1127
+ * After Fresh installation - a save is required Fixed
1128
+ * Excerpt length controlled
1129
+ * Design One has thumbnails on the Homepage
1130
+ * Non-AMP link goes to the wrong page, issue fixed.
1131
+ * Archive pages were broken, fixed.
1132
+ * Option to Enable & Disable the Next/Previous links in Single
1133
+ * WhatsApp sharing not working, issue fixed.
1134
+ * Category Taxonomy has extra ':' in the word.
1135
+ * The word 'Ago' is now translatable.
1136
+ * Yoast SEO with AMP compatibility issue fixed.
1137
+ * Several Minor Polishing in the code
1138
+ * Footer Ad gets covered by Sticky Social Icons (#269)
1139
+ * Smaller image size when “image caption” is used in Design-2 (#263)
1140
+ * Footer ad with Sticky Social bar issue fix
1141
+ * Checked with WordPress 4.7
1142
+ * Ad #1 was messing up with the title, issue fixed.
1143
+ * Compatibility improved with AMP WooCommerce.
1144
+
1145
+ = 0.9 =
1146
+ * Proper Details at http://ampforwp.com/amp-pagebuilder/
1147
+ * Drag & Drop Page builder Added: You can easily modify the look of the AMP page using this feature
1148
+ * 100% Yoast Compatible , Now no need to have additionally Glue Installed
1149
+ * 100% completed Translation panel, Now absolutely anything on page is translated
1150
+ * Added Option to turn on/off Page Support
1151
+ * Styling for Tags was Corrected
1152
+ * Made changes to these sections to reflect in the new Design manager : Related Posts, Footer
1153
+ * Default Image alignment styling added
1154
+ * Added Option to turn on/off Page Support
1155
+ * Related Posts Now use Custom Excerpt if it Exists
1156
+ * Now AMP pages wont have Validation errors because of 'rel' attribute in 'div' Tag or 'onclick' attribute in 'a' Tag
1157
+ * <pre> Tag styling issue fixed for AMP pages
1158
+ * Frontpage (Homepage) Compatibility with AMP which means better validation of front page.
1159
+ * WooCommerce Support Added https://wordpress.org/plugins/amp-woocommerce/ (for E-Commerce)
1160
+ * 2 New Designs added
1161
+ * SEO Panel Added
1162
+
1163
+ = 0.8.8 =
1164
+ * Proper Details at http://ampforwp.com/amp-0-8-8-released-translation-panel/
1165
+ * Translation Panel added. You can now easily translate the AMP version from the backend without any complications.
1166
+ * Badge Tag was throwing Validation error
1167
+ * Plusone tag validation error was fixed
1168
+ * Time tag was validation error was fixed
1169
+ * User experience for Mobile devices was improved
1170
+ * Meta info was messing up in smaller devices, it was fixed as well.
1171
+ * Internal AMP linking added for Categories and Tags
1172
+ * Future errors for AMP ads was fixed
1173
+ * Blockquote styling added
1174
+ * “Please Activate parent Plugin settings” added for better User Experience.
1175
+ * Related Post Ux improvement
1176
+ * Plugin version added in Footer source code for better debugging
1177
+ * Added Support for Default WordPress Image alignment
1178
+ * New action hooks added in index page
1179
+ * Featured Image Size options added
1180
+
1181
+ = 0.8.7 =
1182
+ * Proper Details at http://ampforwp.com/amp-0-8-7/
1183
+ * added option to enable/disable AMP on Archive pages (Ticket #188)
1184
+ * Solved 404 on Related Posts (Ticket #178 )
1185
+ * Related posts by either categories or Tags(Ticket #179)
1186
+ * added a link to menu Section from the AMP Options page(Ticket #190)
1187
+ * Added Support for Piwik Analytics(Ticket #163)
1188
+ * Added Support for Segment.com Analytics(Ticket #50)
1189
+ * Added a switch for hiding Non-Amp page link from Footer.( Ticket #189)
1190
+ * Added an Option that strips Users URL from Comments Section(Ticket #180)
1191
+ * Fixed stripping <date> tags from the content , Since it was preventing validation – amp-img issues fixed
1192
+ * UX Improved for every section of AMP Options page
1193
+ * Added Settings button on plugin page
1194
+ * Related posts switch added
1195
+ * Removed carousel.js
1196
+
1197
+
1198
+ = 0.8.6.1 =
1199
+ * Date Tag fix
1200
+ * Few validation issues after 0.8.6 were fixed (Frontpage amp-img strip issue fixed)
1201
+
1202
+ = 0.8.6 =
1203
+ * Proper Details at http://ampforwp.com/amp-0-8-6-released-related-posts-comments/
1204
+ * Related Posts
1205
+ * Post Comments
1206
+ * WhatsApp sharing button – Your visitors can now easily share the content over the whatsapp.
1207
+ * Validation issue fixed by All In One Schema.org Rich Snippets plugin
1208
+ * Removed Google Fonts loading for Performance
1209
+ * New relic Support
1210
+ * Class added to ‘View Non-AMP Version’ text
1211
+ * Archives Structured Data issue fixed
1212
+ * Some instances img tags converted into amp-img automatically.
1213
+
1214
+
1215
+ = 0.8.5.3 =
1216
+ * Canonical issue fixed for Post
1217
+
1218
+ = 0.8.5.2 =
1219
+ * Canonical issue fixed for FrontPage
1220
+
1221
+ = 0.8.5.1 =
1222
+ * Proper Details at http://ampforwp.com/new/
1223
+ * Validation issue fixed: 'Value' tag
1224
+ * Validation issue fixed: The attribute 'contenteditable' may not appear in tag 'a'.
1225
+ * Validation issue fixed: Table markup
1226
+ * Validation issue fixed: nowrap and misc tags
1227
+ * New Relic Support
1228
+ * Tags on off option
1229
+ * Canonical and correct AMP html Redirect issues Solved
1230
+ * NextGEN Gallery Validation Support Added
1231
+
1232
+ = 0.8.5 =
1233
+ * Proper Details at http://ampforwp.com/the-0-4-compatibility/
1234
+ * AMP 0.4 Compatibility Check
1235
+ * Even better Structured Data Validation, Once in for all!
1236
+ * Structured Data Options to eliminate Validation errors
1237
+ * AMP Page Exclude option
1238
+
1239
+ = 0.8.4 =
1240
+ * Proper Details at http://ampforwp.com/blog/structured-data-validation/
1241
+ * Structured Data Validation
1242
+ * Navigation Text Change
1243
+ * Inline Style Validation
1244
+ * Form Validation
1245
+ * Frontpage shows the amphtml rel twice fixed
1246
+ * Facebook Sharing not working
1247
+
1248
+ = 0.8.3 =
1249
+ * Prefix added in the Content filter
1250
+ * Extra space after quote in Ads
1251
+
1252
+ = 0.8.2 =
1253
+ * Proper Details at http://ampforwp.com/blog/the-custom-frontpage/
1254
+ * Custom AMP FrontPage
1255
+ * Featured Image
1256
+ * New Mobile Friendly Advertisement sizes
1257
+ * Single Post Pagination Option
1258
+ * RTL Support
1259
+ * Notifications
1260
+ * Gaping if the Meta was turned off.
1261
+ * Analytics was not fetching the user id properly.
1262
+ * Page was not using the post template along with the AD support.
1263
+ * AMP Endpoint support for Paged when the front page is active.
1264
+ * UI improvement of Admin panel
1265
+ * Few Validation issues fixed
1266
+
1267
+ = 0.8.1 =
1268
+ * Warning: Cannot modify header information error fixed
1269
+ * Validation issue fixed. KK Star Plugin compatible.
1270
+ * Gaping in the smaller screens fixed
1271
+
1272
+ = 0.8 =
1273
+ * Proper Details at http://ampforwp.com/blog/the-change/
1274
+ * Plugin was re-written from scratch and is now built on top of default AMP plugin by Automattic but giving you the same features of the original plugin.
1275
+ * 99.5% Validation issues were fixed.
1276
+ * Page builder & Shortcodes Compatibility Support Added
1277
+ * Conflict with JSON API
1278
+ * Carousel support for Gallery
1279
+ * Better Image stretching and resizing
1280
+ * Youtube Video Embed Support
1281
+ * Vine Embed Support
1282
+ * Twitter oembed Support
1283
+ * Instagram Embed Support
1284
+ * Facebook Video Embed Support
1285
+ * Better Future Compatibility
1286
+
1287
+ = 0.7.7 =
1288
+ * Proper Details at http://ampforwp.com/blog/amp-0-7-7/
1289
+ * Big Validation Error fix Update
1290
+ * Disable AMP support on specific Pages and Posts
1291
+ * Option to disable the Post meta from the Single
1292
+ * Footer Credits and Copyright Text Option
1293
+ * New options for Social Sharing Bar in Single
1294
+ * Jetpack Social & Related Sharing Issue fixed
1295
+ * Gaping in footer if the Sticky bar is enabled
1296
+ * Text domain added on few strings
1297
+
1298
+ = 0.7.6 =
1299
+ * Google Adsense Support Added with AMP-Ad
1300
+ * Wrong Homepage rel amphtml bug fixed
1301
+
1302
+ = 0.7.5 =
1303
+ * Google Analytics Support Added
1304
+ * Logo Support Added. If the logo is disabled, then the Title should be activated.
1305
+ * Color Scheme Feature Added
1306
+ * User friendly Options Panel Added
1307
+ * iFrame support Added
1308
+ * Few Minor Bugs Fixed
1309
+
1310
+ = 0.7.1 =
1311
+ * Bug #24 (Github) fixed
1312
+ * Strip Style tags for faster & better validation
1313
+ * Bug #21 (Github) fixed
1314
+
1315
+ = 0.7 =
1316
+ * Canonical Improved
1317
+ * Navigation Validation bug fixed
1318
+ * Two more validation bugs fixed ('role' and 'tabindex' attribute)
1319
+ * Featured image automatically hides if it is not present
1320
+ * Validation issues in the images of the post's the_content
1321
+
1322
+ = 0.6 =
1323
+ * Improved Navigation Menu
1324
+ * Search Console errors fixed
1325
+ * Social Sharing option
1326
+ * Pages support
1327
+ * Force redirection for mobile users removed and many other bug fixes
1328
+
1329
+ = 0.5 =
1330
+ * Added AMP Markup for Google Structured data. This will fix the issues in Webmaster tools.
1331
+
1332
+ = 0.4 =
1333
+ * Support of Custom menu added for AMP enabled sites
1334
+
1335
+ = 0.3 =
1336
+ * Support of amp-img added in single posts
1337
+ * minor css bug fixed
1338
+
1339
+ = 0.2.5 =
1340
+ * Minor bugs fixed
1341
+ * ?mobile & ?nomobile is now ?amp & ?noamp
1342
+
1343
+ = 0.2 =
1344
+ * White Screen of death issue fixed
1345
+ * Plugin URI updated
1346
+
1347
+ = 0.1 =
1348
+ * Initial version
accelerated-moblie-pages.php CHANGED
@@ -1,637 +1,634 @@
1
- <?php
2
- /*
3
- Plugin Name: Accelerated Mobile Pages
4
- Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
5
- Description: AMP for WP - Accelerated Mobile Pages for WordPress
6
- Version: 0.9.71
7
- Author: Ahmed Kaludi, Mohammed Kaludi
8
- Author URI: https://ampforwp.com/
9
- Donate link: https://www.paypal.me/Kaludi/25
10
- License: GPL2+
11
- */
12
-
13
- // Exit if accessed directly.
14
- if ( ! defined( 'ABSPATH' ) ) exit;
15
-
16
- define('AMPFORWP_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
17
- define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
18
- define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
19
- define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
20
- define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
21
- define('AMPFORWP_VERSION','0.9.71');
22
-
23
- // any changes to AMP_QUERY_VAR should be refelected here
24
- function ampforwp_generate_endpoint(){
25
- $ampforwp_slug = '';
26
- $get_permalink_structure = '';
27
- //$get_permalink_structure = get_option('permalink_structure');
28
-
29
- // if(empty( $get_permalink_structure )) {
30
- // $ampforwp_slug = '&amp=1';
31
- // }else{
32
- // $ampforwp_slug = "amp";
33
- // }
34
- $ampforwp_slug = "amp";
35
-
36
- return $ampforwp_slug;
37
- }
38
-
39
- define('AMPFORWP_AMP_QUERY_VAR', apply_filters( 'amp_query_var', ampforwp_generate_endpoint() ) );
40
-
41
- load_plugin_textdomain( 'accelerated-mobile-pages', false, trailingslashit(AMPFORWP_PLUGIN_DIR) . 'languages' );
42
-
43
- // Rewrite the Endpoints after the plugin is activate, as priority is set to 11
44
- function ampforwp_add_custom_post_support() {
45
- global $redux_builder_amp;
46
- if( isset($redux_builder_amp['amp-on-off-for-all-pages']) && $redux_builder_amp['amp-on-off-for-all-pages'] ) {
47
- add_rewrite_endpoint( AMPFORWP_AMP_QUERY_VAR, EP_PAGES | EP_PERMALINK | EP_AUTHORS | EP_ALL_ARCHIVES | EP_ROOT );
48
- add_post_type_support( 'page', AMPFORWP_AMP_QUERY_VAR );
49
- }
50
- }
51
- add_action( 'init', 'ampforwp_add_custom_post_support',11);
52
-
53
- // Frontpage and Blog page check from reading settings.
54
- function ampforwp_name_blog_page() {
55
- if(!$page_for_posts = get_option('page_for_posts')) return;
56
- $page_for_posts = get_option( 'page_for_posts' );
57
- $post = get_post($page_for_posts);
58
- if ( $post ) {
59
- $slug = $post->post_name;
60
- return $slug;
61
- }
62
- }
63
- function ampforwp_custom_post_page() {
64
- $front_page_type = get_option( 'show_on_front' );
65
- if ( $front_page_type ) {
66
- return $front_page_type;
67
- }
68
- }
69
-
70
- function ampforwp_get_the_page_id_blog_page(){
71
- $page = "";
72
- $output = "";
73
- if ( ampforwp_name_blog_page() ) {
74
- $page = get_page_by_path( ampforwp_name_blog_page() );
75
- $output = $page->ID;
76
- }
77
-
78
- return $output;
79
- }
80
-
81
- // Add Custom Rewrite Rule to make sure pagination & redirection is working correctly
82
- function ampforwp_add_custom_rewrite_rules() {
83
- global $redux_builder_amp;
84
- // For Homepage
85
- add_rewrite_rule(
86
- 'amp/?$',
87
- 'index.php?amp',
88
- 'top'
89
- );
90
- // For Homepage with Pagination
91
- add_rewrite_rule(
92
- 'amp/page/([0-9]{1,})/?$',
93
- 'index.php?amp&paged=$matches[1]',
94
- 'top'
95
- );
96
- // For /Blog page with Pagination
97
- //if ( ampforwp_custom_post_page() && ampforwp_name_blog_page() ) {
98
- add_rewrite_rule(
99
- ampforwp_name_blog_page(). '/amp/page/([0-9]{1,})/?$',
100
- 'index.php?amp&paged=$matches[1]&page_id=' .ampforwp_get_the_page_id_blog_page(),
101
- 'top'
102
- );
103
- //}
104
-
105
- // For Author pages
106
- add_rewrite_rule(
107
- 'author\/([^/]+)\/amp\/?$',
108
- 'index.php?amp&author_name=$matches[1]',
109
- 'top'
110
- );
111
-
112
- add_rewrite_rule(
113
- 'author\/([^/]+)\/amp\/page\/?([0-9]{1,})\/?$',
114
- 'index.php?amp=1&author_name=$matches[1]&paged=$matches[2]',
115
- 'top'
116
- );
117
-
118
- // For category pages
119
- $rewrite_category = get_option('category_base');
120
- if (! empty($rewrite_category)) {
121
- $rewrite_category = get_option('category_base');
122
- } else {
123
- $rewrite_category = 'category';
124
- }
125
-
126
- add_rewrite_rule(
127
- $rewrite_category.'\/(.+?)\/amp/?$',
128
- 'index.php?amp&category_name=$matches[1]',
129
- 'top'
130
- );
131
- // For category pages with Pagination
132
- add_rewrite_rule(
133
- $rewrite_category.'\/(.+?)\/amp\/page\/?([0-9]{1,})\/?$',
134
- 'index.php?amp&category_name=$matches[1]&paged=$matches[2]',
135
- 'top'
136
- );
137
-
138
- // For tag pages
139
- $rewrite_tag = get_option('tag_base');
140
- if (! empty($rewrite_tag)) {
141
- $rewrite_tag = get_option('tag_base');
142
- } else {
143
- $rewrite_tag = 'tag';
144
- }
145
- add_rewrite_rule(
146
- $rewrite_tag.'\/(.+?)\/amp/?$',
147
- 'index.php?amp&tag=$matches[1]',
148
- 'top'
149
- );
150
- // For tag pages with Pagination
151
- add_rewrite_rule(
152
- $rewrite_tag.'\/(.+?)\/amp\/page\/?([0-9]{1,})\/?$',
153
- 'index.php?amp&tag=$matches[1]&paged=$matches[2]',
154
- 'top'
155
- );
156
-
157
- //Rewrite rule for custom Taxonomies
158
- $args = array(
159
- 'public' => true,
160
- '_builtin' => false
161
- );
162
- $output = 'names'; // or objects
163
- $operator = 'and'; // 'and' or 'or'
164
- $taxonomies = get_taxonomies( $args, $output, $operator );
165
- if ( $taxonomies ) {
166
- foreach ( $taxonomies as $taxonomy ) {
167
- add_rewrite_rule(
168
- $taxonomy.'\/(.+?)\/amp/?$',
169
- 'index.php?amp&'.$taxonomy.'=$matches[1]',
170
- 'top'
171
- );
172
- // For Custom Taxonomies with pages
173
- add_rewrite_rule(
174
- $taxonomy.'\/(.+?)\/amp\/page\/?([0-9]{1,})\/?$',
175
- 'index.php?amp&'.$taxonomy.'=$matches[1]&paged=$matches[2]',
176
- 'top'
177
- );
178
- }
179
- }
180
- // For OneSignal
181
- if(isset($redux_builder_amp['ampforwp-web-push-onesignal']) && $redux_builder_amp['ampforwp-web-push-onesignal'] ){
182
- add_rewrite_rule('OneSignalSDKWorker.js','wp-content/plugins/accelerated-mobile-pages/includes/onesignal-integration/OneSignalSDKWorker.js','top');
183
- }
184
- }
185
- add_action( 'init', 'ampforwp_add_custom_rewrite_rules' );
186
-
187
- register_activation_hook( __FILE__, 'ampforwp_rewrite_activation', 20 );
188
- function ampforwp_rewrite_activation() {
189
-
190
- // Run AMP deactivation code while activation
191
- ampforwp_deactivate_amp_plugin();
192
-
193
- if ( ! did_action( 'ampforwp_init' ) ) {
194
- ampforwp_init();
195
- }
196
-
197
- flush_rewrite_rules();
198
-
199
- ampforwp_add_custom_post_support();
200
- ampforwp_add_custom_rewrite_rules();
201
-
202
- // Flushing rewrite urls ONLY on activation
203
- global $wp_rewrite;
204
- $wp_rewrite->flush_rules();
205
-
206
- delete_option('ampforwp_rewrite_flush_option');
207
-
208
- // Set transient for Welcome page
209
- set_transient( 'ampforwp_welcome_screen_activation_redirect', true, 30 );
210
-
211
- }
212
-
213
- add_action('init', 'ampforwp_flush_rewrite_by_option', 20);
214
-
215
- function ampforwp_flush_rewrite_by_option(){
216
-
217
- global $wp_rewrite;
218
- $get_current_permalink_settings = "";
219
-
220
- $get_current_permalink_settings = get_option('ampforwp_rewrite_flush_option');
221
-
222
- if ( $get_current_permalink_settings ) {
223
- return;
224
- }
225
- // Adding double check to make sure, we are not updating and calling database unnecessarily
226
- if ( empty( $get_current_permalink_settings )){
227
- $wp_rewrite->flush_rules();
228
- update_option('ampforwp_rewrite_flush_option', 'true');
229
- }
230
-
231
- }
232
-
233
- register_deactivation_hook( __FILE__, 'ampforwp_rewrite_deactivate', 20 );
234
- function ampforwp_rewrite_deactivate() {
235
- // Flushing rewrite urls ONLY on deactivation
236
- global $wp_rewrite;
237
-
238
- foreach ( $wp_rewrite->endpoints as $index => $endpoint ) {
239
- if ( AMP_QUERY_VAR === $endpoint[1] ) {
240
- unset( $wp_rewrite->endpoints[ $index ] );
241
- break;
242
- }
243
- }
244
-
245
- flush_rewrite_rules();
246
-
247
- $wp_rewrite->flush_rules();
248
-
249
- // Remove transient for Welcome page
250
- delete_transient( 'ampforwp_welcome_screen_activation_redirect');
251
- }
252
-
253
- add_action( 'admin_init','ampforwp_parent_plugin_check');
254
- function ampforwp_parent_plugin_check() {
255
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
256
- $amp_plugin_activation_check = is_plugin_active( 'amp/amp.php' );
257
- if ( $amp_plugin_activation_check ) {
258
- // set_transient( 'ampforwp_parent_plugin_check', true, 30 );
259
- } else {
260
- delete_option( 'ampforwp_parent_plugin_check');
261
- }
262
- }
263
-
264
- // Redux panel inclusion code
265
- if ( !class_exists( 'ReduxFramework' ) ) {
266
- require_once dirname( __FILE__ ).'/includes/options/extensions/loader.php';
267
- require_once dirname( __FILE__ ).'/includes/options/redux-core/framework.php';
268
- }
269
- // Register all the main options
270
- require_once dirname( __FILE__ ).'/includes/options/admin-config.php';
271
- require_once dirname( __FILE__ ).'/templates/report-bugs.php';
272
-
273
-
274
- // Modules
275
- add_action('after_setup_theme','ampforwp_add_module_files');
276
- function ampforwp_add_module_files() {
277
-
278
- global $redux_builder_amp;
279
- if ( isset($redux_builder_amp['ampforwp-content-builder']) && $redux_builder_amp['ampforwp-content-builder'] ) {
280
- if ( ! function_exists( 'bstw' ) ) {
281
- require_once AMPFORWP_PLUGIN_DIR .'/includes/vendor/tinymce-widget/tinymce-widget.php';
282
- }
283
- require_once AMPFORWP_PLUGIN_DIR .'/includes/modules/ampforwp-blurb.php';
284
- require_once AMPFORWP_PLUGIN_DIR .'/includes/modules/ampforwp-button.php';
285
- }
286
- }
287
-
288
- /*
289
- * Load Files only in the backend
290
- * As we don't need plugin activation code to run everytime the site loads
291
- */
292
- if ( is_admin() ) {
293
-
294
- // Include Welcome page only on Admin pages
295
- require AMPFORWP_PLUGIN_DIR .'/includes/welcome.php';
296
-
297
- // Deactivate Parent Plugin notice
298
- // add_action('init','ampforwp_plugin_notice');
299
- function ampforwp_plugin_notice() {
300
-
301
- if ( ! defined( 'AMP__FILE__' ) ) {
302
- add_action( 'admin_notices', 'ampforwp_plugin_not_found_notice' );
303
- function ampforwp_plugin_not_found_notice() {
304
-
305
- $current_screen = get_current_screen();
306
-
307
- if( $current_screen ->id == "plugin-install" || $current_screen ->id == "dashboard_page_ampforwp-welcome-page" || $current_screen ->id == "ampforwp-welcome-page" ) {
308
- return;
309
- }
310
-
311
- ?>
312
-
313
- <div class="notice notice-warning is-dismissible ampinstallation">
314
-
315
- <?php add_thickbox(); ?>
316
- <p>
317
- <strong><?php _e( 'AMP Installation requires one last step:','accelerated-mobile-pages' ); ?></strong> <?php _e( 'AMP by Automattic plugin is not active', 'accelerated-mobile-pages' ); ?>
318
- <strong> <span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;"><a href="index.php?page=ampforwp-welcome-page"><?php _e( 'Continue Installation', 'accelerated-mobile-pages' ); ?></a>
319
- </span> </strong>
320
- </p>
321
- </div> <?php
322
- }
323
-
324
- add_action('admin_head','ampforwp_required_plugin_styling');
325
- function ampforwp_required_plugin_styling() {
326
- if ( ! defined( 'AMP__FILE__' ) ) { ?>
327
- <style>
328
- #toplevel_page_amp_options a .wp-menu-name:after {
329
- content: "1";
330
- background-color: #d54e21;
331
- color: #fff;
332
- border-radius: 10px;
333
- font-size: 9px;
334
- line-height: 17px;
335
- font-weight: 600;
336
- padding: 3px 7px;
337
- margin-left: 5px;
338
- }
339
- </style>
340
- <?php
341
- }
342
- ?>
343
- <style>
344
- .notice, .notice-error, .is-dismissible, .ampinstallation{}
345
- .plugin-card.plugin-card-amp:before{
346
- content: __("FINISH INSTALLATION: Install & Activate this plugin ↓",'accelerated-mobile-pages');
347
- font-weight: bold;
348
- float: right;
349
- position: relative;
350
- color: #dc3232;
351
- top: -28px;
352
- font-size: 18px;
353
- }
354
- .plugin-action-buttons a{
355
- color: #fff
356
- }
357
- .plugin-card.plugin-card-amp {
358
- background: rgb(0, 165, 92);
359
- color: #fff;
360
- }
361
- .plugin-card.plugin-card-amp .column-name a,
362
- .plugin-card.plugin-card-amp .column-description a,
363
- .plugin-card.plugin-card-amp .column-description p {
364
- color: #fff;
365
- }
366
- .plugin-card-amp .plugin-card-bottom {
367
- background: rgba(229, 255, 80, 0);
368
- }
369
- </style> <?php
370
- }
371
- }
372
- }
373
-
374
- // Add Settings Button in Plugin backend
375
- if ( ! function_exists( 'ampforwp_plugin_settings_link' ) ) {
376
-
377
- // Deactivate Parent Plugin notice
378
- add_filter( 'plugin_action_links', 'ampforwp_plugin_settings_link', 10, 5 );
379
-
380
- function ampforwp_plugin_settings_link( $actions, $plugin_file ) {
381
- static $plugin;
382
- if (!isset($plugin))
383
- $plugin = plugin_basename(__FILE__);
384
- if ($plugin == $plugin_file) {
385
- $settings = array('settings' => '<a href="admin.php?page=amp_options&tab=8">' . __('Settings', 'accelerated-mobile-pages') . '</a> | <a href="https://ampforwp.com/priority-support/#utm_source=options-panel&utm_medium=extension-tab_priority_support&utm_campaign=AMP%20Plugin">' . __('Premium Support', 'accelerated-mobile-pages') . '</a>');
386
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
387
- $actions = array_merge( $actions, $settings );
388
- /*if ( is_plugin_active( 'amp/amp.php' ) ) {
389
- //if parent plugin is activated
390
- $actions = array_merge( $actions, $settings );
391
- } else{
392
- if(is_plugin_active( 'amp/amp.php' )){
393
- $actions = array_merge( $actions, $settings );
394
- }else{
395
- $please_activate_parent_plugin = array(__('Please Activate Parent plugin','accelerated-mobile-pages') => '<a href="'.get_admin_url() .'index.php?page=ampforwp-welcome-page">' . __('<span style="color:#b30000">'.__('Action Required: Continue Installation','accelerated-mobile-pages').'</span>', 'accelerated-mobile-pages') . '</a>');
396
- $actions = array_merge( $please_activate_parent_plugin,$actions );
397
- }
398
- }*/
399
-
400
- }
401
- return $actions;
402
- }
403
- }
404
-
405
- } // is_admin() closing
406
-
407
- // AMP endpoint Verifier
408
- function ampforwp_is_amp_endpoint() {
409
- return false !== get_query_var( 'amp', false );
410
- }
411
-
412
- if ( ! class_exists( 'Ampforwp_Init', false ) ) {
413
- class Ampforwp_Init {
414
-
415
- public function __construct(){
416
-
417
- // Load Files required for the plugin to run
418
- require AMPFORWP_PLUGIN_DIR .'/includes/includes.php';
419
-
420
- // Redirection Code added
421
- require AMPFORWP_PLUGIN_DIR.'/includes/redirect.php';
422
-
423
- require AMPFORWP_PLUGIN_DIR .'/classes/class-init.php';
424
- new Ampforwp_Loader;
425
-
426
- }
427
- }
428
- }
429
- /*
430
- * Start the plugin.
431
- * Gentlemen start your engines
432
- */
433
- function ampforwp_plugin_init() {
434
-
435
- if ( defined( 'AMP__FILE__' ) && defined('AMPFORWP_PLUGIN_DIR') ) {
436
- new Ampforwp_Init;
437
- }
438
- }
439
- add_action('init','ampforwp_plugin_init',9);
440
-
441
- /*
442
- * customized output widget
443
- * to be used be used in before or after Loop
444
- */
445
- require AMPFORWP_PLUGIN_DIR.'/templates/category-widget.php';
446
- require AMPFORWP_PLUGIN_DIR.'/templates/woo-widget.php';
447
-
448
-
449
- /*
450
- * Including core AMP plugin files and removing any other things if necessary
451
- */
452
- function ampforwp_bundle_core_amp_files(){
453
- // Bundling Default plugin
454
- require_once AMPFORWP_PLUGIN_DIR .'/includes/vendor/amp/amp.php';
455
-
456
- define( 'AMP__FILE__', __FILE__ );
457
- if ( ! defined('AMP__DIR__') ) {
458
- define( 'AMP__DIR__', plugin_dir_path(__FILE__) . 'includes/vendor/amp/' );
459
- }
460
- define( 'AMP__VERSION', '0.4.2' );
461
-
462
- require_once( AMP__DIR__ . '/back-compat/back-compat.php' );
463
- require_once( AMP__DIR__ . '/includes/amp-helper-functions.php' );
464
- require_once( AMP__DIR__ . '/includes/admin/functions.php' );
465
- require_once( AMP__DIR__ . '/includes/settings/class-amp-customizer-settings.php' );
466
- require_once( AMP__DIR__ . '/includes/settings/class-amp-customizer-design-settings.php' );
467
- }
468
- add_action('plugins_loaded','ampforwp_bundle_core_amp_files', 8);
469
-
470
- function ampforwp_deactivate_amp_plugin() {
471
-
472
- if ( version_compare( floatval( get_bloginfo( 'version' ) ), '3.5', '>=' ) ) {
473
-
474
- if ( current_user_can( 'activate_plugins' ) ) {
475
-
476
- add_action( 'admin_init', 'ampforwp_deactivate_amp' );
477
-
478
- function ampforwp_deactivate_amp() {
479
- deactivate_plugins( AMPFORWP_MAIN_PLUGIN_DIR . 'amp/amp.php' );
480
- }
481
- }
482
- }
483
- }
484
- add_action( 'plugins_loaded', 'ampforwp_deactivate_amp_plugin' );
485
-
486
- function ampforwp_modify_amp_activatation_link( $actions, $plugin_file ) {
487
- $plugin = '';
488
-
489
- $plugin = 'amp/amp.php';
490
- if ( $plugin == $plugin_file ) {
491
- add_thickbox();
492
- unset($actions['activate']);
493
- $a = '<span style="cursor:pointer;color:#0089c8" class="warning_activate_amp" onclick="alert(\'AMP is already bundled with AMPforWP. Please do not install this plugin with AMPforWP to avoid conflicts. \')">Activate</span>';
494
- array_unshift ($actions,$a);
495
- }
496
- return $actions;
497
- }
498
- add_filter( 'plugin_action_links', 'ampforwp_modify_amp_activatation_link', 10, 2 );
499
-
500
-
501
-
502
-
503
-
504
-
505
- if ( ! function_exists('ampforwp_init') ) {
506
- add_action( 'init', 'ampforwp_init' );
507
- function ampforwp_init() {
508
- if ( false === apply_filters( 'amp_is_enabled', true ) ) {
509
- return;
510
- }
511
-
512
- define( 'AMP_QUERY_VAR', apply_filters( 'amp_query_var', 'amp' ) );
513
-
514
- if ( ! defined('AMP__DIR__') ) {
515
- define( 'AMP__DIR__', plugin_dir_path(__FILE__) . 'includes/vendor/amp/' );
516
- }
517
-
518
- do_action( 'amp_init' );
519
-
520
- load_plugin_textdomain( 'amp', false, plugin_basename( AMP__DIR__ ) . '/languages' );
521
-
522
- add_rewrite_endpoint( AMP_QUERY_VAR, EP_PERMALINK );
523
- add_post_type_support( 'post', AMP_QUERY_VAR );
524
-
525
- add_filter( 'request', 'amp_force_query_var_value' );
526
- add_action( 'wp', 'amp_maybe_add_actions' );
527
-
528
- // Redirect the old url of amp page to the updated url. #1033 (Vendor Update)
529
- add_filter( 'old_slug_redirect_url', 'ampforwp_redirect_old_slug_to_new_url' );
530
-
531
- if ( class_exists( 'Jetpack' ) && ! ( defined( 'IS_WPCOM' ) && IS_WPCOM ) ) {
532
- require_once( AMP__DIR__ . '/jetpack-helper.php' );
533
- }
534
- }
535
- }
536
-
537
-
538
- function AMP_update_db_check() {
539
- global $redux_builder_amp;
540
- $ampforWPCurrentVersion = AMPFORWP_VERSION;
541
- if (get_option( 'AMPforwp_db_version' ) != $ampforWPCurrentVersion) {
542
-
543
- if ( isset( $_GET['ampforwp-dismiss'] ) && trim($_GET['ampforwp-dismiss'])=="ampforwp_dismiss_admin_notices" ) {
544
- update_option( 'AMPforwp_db_version', $ampforWPCurrentVersion );
545
- wp_redirect(remove_query_arg('ampforwp-dismiss'), 301);
546
- }
547
- if( isset($redux_builder_amp['ampforwp-update-notification-bar'] ) && $redux_builder_amp['ampforwp-update-notification-bar'] && current_user_can( 'manage_options' ) ){
548
-
549
- add_action('admin_notices', 'ampforwp_update_notice');
550
- }
551
- }
552
- }
553
- add_action( 'plugins_loaded', 'AMP_update_db_check' );
554
-
555
- function ampforwp_update_notice() {
556
- $ampforWPCurrentVersion = AMPFORWP_VERSION;
557
- ?>
558
- <div class="notice-success notice is-dismissible amp-update-notice" style=" display: table;
559
- position: relative;
560
- height: 70px;
561
- padding: 0;
562
- border: 0;
563
- overflow: hidden;
564
- margin-bottom: 10px;
565
- " id="gf_dashboard_message">
566
- <div style=" padding: 15px 15px 10px 15px;
567
- display: inline-block;">
568
- <img style=" width: 40px;
569
- display: inline;
570
- height: 40px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAn1BMVEUAAADuHCXwHiTuHSTtHST/IjjuHSXuHCTvHSXvHCXwHi3/JyfuHSTuHCTvHSTvHCTxHSb/NDTyHyj0IyruHSTvHSXvHSbuHST1ICftHCXuHCXuHSXwHiXvHyfuHSTuHSTvHSXuHCTuHCTuHCTuHCTvHSXyHibuHCTuHCXuHCXuHCXuHibwICjuHCTuHCTuHSTwHSbuHCXuHCTuHCTtHCSisK2PAAAANHRSTlMA+1T35wiIxm9kEQzu4Yx/NgQlFZV6PrAa16RpUi7MhE3y3LmYXynrz5FYSSC9q55EddGypVN9ggAABlxJREFUeNrVm+mymkAQhQfZBVQEFNz3fbtm3v/ZYqUqyWww0603Vfn+mcr1wMz06QUk/yfZIPRua79KYst2Vgd/fS9aU5f8E6JFx4+pktWPryn5VtKH51u0kXgY9Mk30cv31IhZkH1e/VJU1BzrR+uzJ2I6sigQ5yv63NoPKYa42/6M/JpiWXrvr0I7p+/gnN7U3+7pm1x3BM/Op+9je+iACO2mI+aPcq8ItmHQ7WyGVVOUHHDWFI1qN3Y0HmSiSfYX3atddxhPmNCv1As6HNdvqvuYP6mSDXgbTsq78cdt7YV3HOU2lDD9QBnVZnuZnlXOkYAOwlzjaxjv3PfMs+5dvvsiAh6hofwdD1P9GxUZlQTMeSXlyAkxQrr/6kEwuF1bDKEBav87aCfrH8SDNIWf/3hB8Lgb0cMu2vgXI/9C3uK0FArXTHN4hW27p+RNdomQHZv9vxK2Hyf6ODIfSuE7u6QBIf984fQnNuc5bSGpN4RCSDlCnH7L2ghH8cofxKx2u2z+/rH6SSTu7IyyrEkN/if2f2JROXAz3hW3NfUff/7R+iNVX+Nwm6DMa+09F/8pVn+v3OIeV7PlRAFnWvEFq09PJg7bU1wiZVmg9YekBi4/z4jEmjuAaP24rG1xOEtsNS5A5eL0m73jwdWIjQv0QOtfjX32LCQhrv5B69uNZ7dcsmFWf3HLEqtPA0CtMeB8go3SAuW/8l3JpFWdIResBURYfZvpmfRma7ELXbH5GqNv+JdpIiY7OQaXbaz+08C9x4zS8+8/s1MQD6tvmXQ+LpuUpn8Whk1Dfbg+5Mo93m9li/Kx+isz99yx/arqqsZgfS6s9bDF0UWuhOw2Uj8HNP5i0RkxLjRE6ifG5pHJnr9A70DLklKLHqZfdMgvOvQvO5g+Jn3Jcj5zSTh9B3JyFlJ5HDObgtKnLQKAPXKeeCrGEH3syZ0JZ37A5mi4vroMNCyMKrEhzAD66BayYFJyyvtgjNHfp1DzFDLPjUkEAH18ATMVStO1HAR6fZbVpvPi+CJ/sXlxPzaNdF22PeBtIAfoa0garsDmz08lhCVeX+7+1DDlR/D6mGjqYZy+U1ce8Ipd3giDt/SNu9snv+aWaM14fRNvEE6dcCQ+pT829eLj66Oj2YIP6/PHfv76uOKOBF7f/D4Svjk5mM4lBjh9mSWzVvyR2DS2Vas6Reh4VahI1oYlad9MvwCVpRP+AUnV2FXNPqAvFSBSem7AnXS9X8xfdF/kPhPCZq21VIBI6RlGeeD158CyOBbTs2yg+uUEd9Y/hALEfWc4UcL1SSIOpFfs8xQgZ4i+HE2FuCQ2dEK5BuuTUNryL/yIcgLV52tQ2pYmRHOQftuB6xNHHlnH7OAIwh124dLtdhRz4ilA/4FZuFwxLw5wg/ooAenLAzErUgyOHPM+54hxj4lyIDaTl0VPDzVbvikLp0CaIetxK4x+31IOxDJL7Cj0zIH68pOxG5cfoIOyqYXRL+2azNeiwEhMZ6jHu0da09a7DnAJCpR+adcG/BcFBULfZupfXAjYJW8qjB0bzJ19lP656eltF1LZjVH6LlvXWxcxsS3Z5WmuDS9LjD6ZNz+c9yjDoXET1rr+T99YWfItRg6lZj3SFqWfcd9/1L5BdKr/phiqLz8cd5STtStlWO6aYikE63eF29O/w5KUNfkUpR8avczkUZaqrS4DMfoLi5oEmcs3Wr4qFO4Y/YFtOEDoL/mVilRl4BauH1OWofm7dLNMKgMR+gtbM0PlCwaOlWCYR4R+yOy/8IRXfwyo0+NfBjq9GX96By8TymExf+A+wfrZWtDP9al+T3mGf/asAOsPHMpzMym3l5Qnefy+Nmj+nVOBq2vUcVma14rRLxbPItM3IqnAMkih8uWNSvoZwDlEqm0Kkj8yNyH5mp6pQyWSsWvc/2xkeXoDTV8uKyrjeDuTlmFxs6hMDg3gK+hnZPIP0iQ7QVqYzKGziGpWPhw5VEnCGCrcRWSs2Yj/gWM2CDs/WA9VexneR9XY+9XTn1VJrPlvAUGzdejbXHcf/KkZ/sdmeHozisc6RuR9Wges/L1PPsPZR8jb+YV8jsHagsnvOyX5LOXX0/zmb4uUfAPTTmKy8wY/SMNzEdxW9ulzRL6bXegpfuAY+/diAb51PGn/3AqDrpcf58V4Oxlk5H/lJxdt5e+wtfWRAAAAAElFTkSuQmCC" width="128" height="128" />
571
- <div style=" display: inline;
572
- position: relative;
573
- margin-left: 5px;
574
- font-weight: 300;
575
- top: -14px;
576
- font-size: 20px;"> <?php _e( 'AMP has been updated to '.$ampforWPCurrentVersion, 'accelerated-mobile-pages' ); ?></div>
577
- <a href="https://ampforwp.com/new/" target="_blank" style="
578
- position: relative;
579
- top: -17px;
580
- background: #ECEFF1;
581
- text-decoration: none;
582
- color: #111;
583
- font-size: 10px;
584
- padding: 4px 6px 5px 5px;
585
- border-radius: 4px;
586
- margin-left: 5px;
587
- text-transform: uppercase;
588
- border: 1px solid rgba(207, 216, 220, 0.9);" href="admin.php?page=acmforwp_update">What's New?</a>
589
- </div>
590
- <div style="display:inline-block;float:right;height: 70px;background: #333;width: 50px;text-align: center;">
591
- <a title="Close this Notification" style="color: #fff;
592
- text-decoration: none;
593
- top: 26px;
594
- position: relative;
595
- padding: 24px 18px;
596
- font-size: 17px;
597
- font-weight: 300;
598
- background: #333;
599
- z-index: 100;" href="<?php echo add_query_arg( 'ampforwp-dismiss', 'ampforwp_dismiss_admin_notices' ) ?>">X</a>
600
- </div>
601
-
602
- <div style="float: right;display: inline-block;/* height: 55px; */background: #4CAF50;padding: 12px 20px 11px 60px;background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA1MTIuMDAxIDUxMi4wMDEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUxMi4wMDEgNTEyLjAwMTsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxMjhweCIgaGVpZ2h0PSIxMjhweCI+CjxnPgoJPGc+CgkJPGc+CgkJCTxwYXRoIGQ9Ik0zNjYuOTA1LDM2NS4wNzFsODcuOTAyLTg1LjY4M2M2LjA4Ny01LjkzNSw4LjIzNi0xNC42NDMsNS42MS0yMi43MjljLTIuNjI5LTguMDg1LTkuNDg2LTEzLjg2Ni0xNy44OTgtMTUuMDg3ICAgICBsLTU1Ljg3OS04LjEyYy00LjQxMy0wLjY0Ny04LjUyMSwyLjQxOS05LjE2MSw2LjgzN2MtMC42NDMsNC40MTksMi40MTgsOC41MjEsNi44MzcsOS4xNjNsNTUuODc5LDguMTIgICAgIGMyLjI3OCwwLjMzLDQuMTM1LDEuODk2LDQuODQ3LDQuMDgzYzAuNzExLDIuMTksMC4xMjksNC41NDgtMS41MTksNi4xNTRsLTkwLjk0Nyw4OC42NWMtMS45MDUsMS44NTgtMi43NzMsNC41MzMtMi4zMjMsNy4xNTUgICAgIGwyMS40NjksMTI1LjE3OGMwLjM4OSwyLjI2OC0wLjUyNyw0LjUxOC0yLjM4Nyw1Ljg2OWMtMS44MTYsMS4zMTgtNC4zMzksMS41MDItNi4zMjIsMC40NTlsLTExMi40MTQtNTkuMTAxICAgICBjLTIuMzU1LTEuMjM3LTUuMTY5LTEuMjM3LTcuNTI0LDBsLTExMi40MTQsNTkuMTAxYy0yLjAzOCwxLjA3LTQuNDYsMC44OTMtNi4zMjItMC40NThjLTEuODYxLTEuMzUzLTIuNzc1LTMuNjAyLTIuMzg4LTUuODcgICAgIGwyMS40Ny0xMjUuMTc3YzAuNDUtMi42MjItMC40Mi01LjI5Ny0yLjMyNC03LjE1NWwtOTAuOTQ2LTg4LjY0OWMtMS42NDgtMS42MDctMi4yMjktMy45NjYtMS41Mi02LjE1NSAgICAgYzAuNzEyLTIuMTg4LDIuNTY3LTMuNzUzLDQuODQ2LTQuMDgzbDEyNS42ODQtMTguMjYzYzIuNjMzLTAuMzgyLDQuOTEtMi4wMzYsNi4wODctNC40MjJsNTYuMjA5LTExMy44OTEgICAgIGMxLjAxOS0yLjA2MywzLjA4LTMuMzQ1LDUuMzgyLTMuMzQ1czQuMzY0LDEuMjgxLDUuMzgzLDMuMzQ1bDU2LjIwNywxMTMuODljMS4xNzgsMi4zODUsMy40NTMsNC4wMzksNi4wODgsNC40MjJsNDIuMzk1LDYuMTYgICAgIGM0LjQwNSwwLjY0MSw4LjUyLTIuNDE4LDkuMTYxLTYuODM3YzAuNjQzLTQuNDE4LTIuNDE4LTguNTIxLTYuODM3LTkuMTYybC0zOC4xOS01LjU0OWwtNTQuMzI2LTExMC4wNzcgICAgIGMtMy43NjEtNy42MjQtMTEuMzc5LTEyLjM1OS0xOS44OC0xMi4zNTljLTguNTAxLDAtMTYuMTE5LDQuNzM2LTE5Ljg3OSwxMi4zNThsLTU0LjMyOCwxMTAuMDc4TDUxLjE0OSwyNDEuNTcyICAgICBjLTguNDEyLDEuMjIyLTE1LjI3LDcuMDAzLTE3Ljg5NywxNS4wODljLTIuNjI2LDguMDg0LTAuNDc4LDE2Ljc5Miw1LjYxLDIyLjcyOGw4Ny45MDIsODUuNjgybC0yMC43NSwxMjAuOTg5ICAgICBjLTEuNDM4LDguMzc3LDEuOTQsMTYuNjg1LDguODE4LDIxLjY4M2MzLjg4OCwyLjgyMyw4LjQzNCw0LjI1OCwxMy4wMTEsNC4yNThjMy41MjMsMCw3LjA2NS0wLjg1LDEwLjMzNy0yLjU2OWwxMDguNjU0LTU3LjEyMiAgICAgbDEwOC42NTcsNTcuMTI0YzMuMTcsMS42NjMsNi43MzUsMi41NDMsMTAuMzEyLDIuNTQzYzQuNzE0LDAsOS4yMTktMS40NjQsMTMuMDM0LTQuMjM0YzYuODc2LTQuOTk4LDEwLjI1Ni0xMy4zMDcsOC44MTctMjEuNjgzICAgICBMMzY2LjkwNSwzNjUuMDcxeiIgZmlsbD0iI0ZGRkZGRiIvPgoJCQk8cGF0aCBkPSJNMzg5LjQyOCwyMDIuMzEzYzAuNzA2LTUuMTc5LDcuNzgtMTMuNTY1LDI5LjgxNi0xMi4xNjVjMS4zNTUsMC4wODYsMi42NTEsMC4xMjgsMy45MDEsMC4xMjggICAgIGMyNy42OTktMC4wMDIsMzAuMDU0LTIwLjYzOSwzMS42My0zNC40OThjMC44NzQtNy42NzcsMS42OTktMTQuOTI4LDUuMjc1LTIwLjA1M2MyLjU1My0zLjY2MiwxLjY1My04LjcwMS0yLjAwNy0xMS4yNTQgICAgIGMtMy42NjItMi41NTItOC43MDEtMS42NTUtMTEuMjU1LDIuMDA2Yy01LjkxNCw4LjQ4MS03LjA2MywxOC41Ny04LjA3NiwyNy40NzNjLTEuNzQ2LDE1LjM0My0yLjQxLDIxLjA4Ny0xOC40MzgsMjAuMDYzICAgICBjLTE3LjY2NC0xLjEyNy0zMC44NiwyLjY1Ni0zOS4yMzIsMTEuMjQyYy02Ljg1NCw3LjAyOS03LjY0NCwxNC43MjItNy43MTEsMTUuNTc2bDE2LjExNywxLjI3NSAgICAgQzM4OS40NDksMjAyLjEwNiwzODkuNDQ3LDIwMi4xNzksMzg5LjQyOCwyMDIuMzEzeiIgZmlsbD0iI0ZGRkZGRiIvPgoJCQk8cGF0aCBkPSJNMjg2Ljc3NSw5MS4xN2MwLjE2LTAuMDg2LDAuMjU0LTAuMTE5LDAuMjU0LTAuMTE5bDYuNTIxLDE0Ljc5NWM3LjkzNC0zLjQ5NiwxOS45NDUtMTcuMTkyLDguNjE3LTQzLjk5OSAgICAgYy00LjEzNS05Ljc4OS0yLjEyNS0xMS4xMzEsOS4yNS0xNi42MThjMTEuMTEtNS4zNjEsMjcuOTAyLTEzLjQ2MiwyMy40NzEtMzguNTUxYy0wLjc3NS00LjM5Ny00Ljk2Mi03LjMyNy05LjM2Ny02LjU1NSAgICAgYy00LjM5NywwLjc3Ny03LjMzLDQuOTcxLTYuNTU0LDkuMzY3YzIuMjA1LDEyLjQ4LTMuMTc3LDE1LjY3OC0xNC41NzYsMjEuMTc3Yy0xMC4yMzcsNC45MzktMjcuMzcsMTMuMjA1LTE3LjExNiwzNy40NzQgICAgIEMyOTMuNDU5LDgyLjc3OSwyODkuODcxLDg5LjUwNSwyODYuNzc1LDkxLjE3eiIgZmlsbD0iI0ZGRkZGRiIvPgoJCQk8cGF0aCBkPSJNODAuMjY4LDg0Ljc0OWMxMi4zMTQsMi43OTYsMTQuNTc2LDMuNjUzLDEyLjc0LDE0LjEyYy01LjAyOCwyOC42NjUsOS43NSwzOS4zMTksMTguMjY2LDQwLjk0NiAgICAgYzAuNTEzLDAuMDk5LDEuMDIzLDAuMTQ2LDEuNTI3LDAuMTQ2YzMuODAyLDAsNy4xOS0yLjY5NSw3LjkzMS02LjU2N2MwLjgzOC00LjM4Ni0yLjAzNy04LjYyLTYuNDIzLTkuNDU4ICAgICBjLTAuMDg5LTAuMDE3LTguODI3LTIuNi01LjM3Ni0yMi4yNzNjNC41NDktMjUuOTUtMTQuMDAxLTMwLjE2My0yNS4wODUtMzIuNjhjLTEyLjM0MS0yLjgwMy0xOC4zMDMtNC43MTItMTguOTUzLTE3LjM2OSAgICAgYy0wLjIyOS00LjQ1OC00LjAwNi03Ljg5NC04LjQ4OC03LjY1OWMtNC40NTgsMC4yMjktNy44ODgsNC4wMjktNy42NTgsOC40ODhDNTAuMDU2LDc3Ljg4OCw2OC4yMzcsODIuMDE2LDgwLjI2OCw4NC43NDl6IiBmaWxsPSIjRkZGRkZGIi8+CgkJCTxwYXRoIGQ9Ik0xMDUuMjM5LDE4MS4xMTNjMCw2LjEyMSwyLjM4MiwxMS44NzQsNi43MSwxNi4yMDFjNC4zMjgsNC4zMjgsMTAuMDgxLDYuNzExLDE2LjIwMSw2LjcxMSAgICAgYzYuMTIsMCwxMS44NzQtMi4zODMsMTYuMjAyLTYuNzFjNC4zMjgtNC4zMjgsNi43MTItMTAuMDgxLDYuNzEyLTE2LjIwMnMtMi4zODQtMTEuODc0LTYuNzExLTE2LjIwMiAgICAgYy00LjMyOS00LjMyOC0xMC4wODItNi43MTEtMTYuMjAzLTYuNzExcy0xMS44NzMsMi4zODMtMTYuMjAxLDYuNzExQzEwNy42MjEsMTY5LjIzOSwxMDUuMjM5LDE3NC45OTIsMTA1LjIzOSwxODEuMTEzeiAgICAgIE0xMjMuMzgyLDE3Ni4zNDJjMS4yNzMtMS4yNzMsMi45NjgtMS45NzUsNC43NjktMS45NzVjMS44MDIsMCwzLjQ5NSwwLjcwMiw0Ljc3LDEuOTc2YzEuMjc1LDEuMjc0LDEuOTc4LDIuOTY4LDEuOTc4LDQuNzcgICAgIHMtMC43MDIsMy40OTQtMS45NzYsNC43NjljLTEuMjc1LDEuMjc0LTIuOTY5LDEuOTc2LTQuNzcyLDEuOTc2Yy0xLjgsMC0zLjQ5NC0wLjcwMi00Ljc3LTEuOTc2ICAgICBjLTEuMjczLTEuMjczLTEuOTc1LTIuOTY3LTEuOTc1LTQuNzY5QzEyMS40MDUsMTc5LjMxMiwxMjIuMTA2LDE3Ny42MTgsMTIzLjM4MiwxNzYuMzQyeiIgZmlsbD0iI0ZGRkZGRiIvPgoJCQk8cGF0aCBkPSJNMzE1LjI4NSwxMjkuMTg5Yy04LjkzMyw4LjkzNC04LjkzMywyMy40NywwLjAwMSwzMi40MDRjNC4zMjgsNC4zMjgsMTAuMDgyLDYuNzEsMTYuMjAxLDYuNzEgICAgIGM2LjExOSwwLDExLjg3NC0yLjM4MiwxNi4yMDItNi43MWM4LjkzMy04LjkzNCw4LjkzMy0yMy40NywwLTMyLjQwM2MtNC4zMjctNC4zMjgtMTAuMDgzLTYuNzExLTE2LjIwMi02LjcxMSAgICAgQzMyNS4zNjgsMTIyLjQ3OSwzMTkuNjEzLDEyNC44NiwzMTUuMjg1LDEyOS4xODl6IE0zMzYuMjU0LDE1MC4xNmMtMS4yNzMsMS4yNzMtMi45NjcsMS45NzQtNC43NjksMS45NzQgICAgIGMtMS44MDIsMC0zLjQ5NS0wLjcwMS00Ljc3LTEuOTc0Yy0yLjYzLTIuNjMtMi42My02LjkxLTAuMDAxLTkuNTM5YzEuMjc0LTEuMjc0LDIuOTY4LTEuOTc1LDQuNzcxLTEuOTc1ICAgICBjMS44MDEsMCwzLjQ5NCwwLjcwMSw0Ljc2OSwxLjk3NEMzMzguODg0LDE0My4yNSwzMzguODg0LDE0Ny41MywzMzYuMjU0LDE1MC4xNnoiIGZpbGw9IiNGRkZGRkYiLz4KCQkJPHBhdGggZD0iTTc1LjY5NSwzMzYuOTI2Yy00LjMyOS00LjMyNi0xMC4wODItNi43MDktMTYuMjAyLTYuNzA5Yy02LjEyLDAtMTEuODczLDIuMzgzLTE2LjIwMSw2LjcxICAgICBjLTguOTM0LDguOTM1LTguOTM0LDIzLjQ3LDAsMzIuNDA0YzQuMzI3LDQuMzI4LDEwLjA4LDYuNzEyLDE2LjIwMSw2LjcxMnMxMS44NzQtMi4zODQsMTYuMjAzLTYuNzExICAgICBDODQuNjI5LDM2MC4zOTYsODQuNjI5LDM0NS44NjIsNzUuNjk1LDMzNi45MjZ6IE02NC4yNjIsMzU3Ljg5OGMtMS4yNzMsMS4yNzQtMi45NjcsMS45NzctNC43NywxLjk3NyAgICAgYy0xLjgsMC0zLjQ5NC0wLjcwMi00Ljc2OS0xLjk3N2MtMi42MzEtMi42MjktMi42MzEtNi45MDktMC4wMDEtOS41MzhjMS4yNzMtMS4yNzMsMi45NjctMS45NzUsNC43Ny0xLjk3NSAgICAgczMuNDk2LDAuNzAxLDQuNzcsMS45NzVDNjYuODkzLDM1MC45ODksNjYuODkzLDM1NS4yNjksNjQuMjYyLDM1Ny44OTh6IiBmaWxsPSIjRkZGRkZGIi8+CgkJCTxwYXRoIGQ9Ik00NzMuMTUsMzM2LjkyNmMtNC4zMjktNC4zMjYtMTAuMDgyLTYuNzA5LTE2LjIwMS02LjcwOWMtNi4xMjEsMC0xMS44NzMsMi4zODMtMTYuMjAyLDYuNzEgICAgIGMtOC45MzMsOC45MzUtOC45MzMsMjMuNDcsMCwzMi40MDRjNC4zMjgsNC4zMjgsMTAuMDgxLDYuNzEyLDE2LjIwMiw2LjcxMmM2LjEyLDAsMTEuODczLTIuMzg0LDE2LjIwMi02LjcxMSAgICAgQzQ4Mi4wODQsMzYwLjM5Niw0ODIuMDg0LDM0NS44NjIsNDczLjE1LDMzNi45MjZ6IE00NjEuNzE5LDM1Ny44OThjLTEuMjc0LDEuMjc0LTIuOTY4LDEuOTc3LTQuNzcsMS45NzcgICAgIGMtMS44MDEsMC0zLjQ5NS0wLjcwMi00Ljc2OS0xLjk3N2MtMi42MzEtMi42MjktMi42MzEtNi45MDktMC4wMDItOS41MzhjMS4yNzQtMS4yNzMsMi45NjgtMS45NzUsNC43NzEtMS45NzUgICAgIGMxLjgwMSwwLDMuNDk2LDAuNzAxLDQuNzcsMS45NzVDNDY0LjM0OSwzNTAuOTg5LDQ2NC4zNDksMzU1LjI2OSw0NjEuNzE5LDM1Ny44OTh6IiBmaWxsPSIjRkZGRkZGIi8+CgkJCTxwYXRoIGQ9Ik0xODYuODkyLDkzLjI0NWM2LjEyLDAsMTEuODczLTIuMzgzLDE2LjIwMS02LjcxMWM0LjMyNy00LjMyOCw2LjcxMS0xMC4wODIsNi43MTEtMTYuMjAyICAgICBjMC02LjEyMS0yLjM4NC0xMS44NzQtNi43MTEtMTYuMmMtNC4zMjgtNC4zMjktMTAuMDgxLTYuNzEyLTE2LjIwMS02LjcxMmMtNi4xMjIsMC0xMS44NzQsMi4zODMtMTYuMjAyLDYuNzExICAgICBjLTQuMzI4LDQuMzI3LTYuNzEyLDEwLjA4LTYuNzEyLDE2LjIwMXMyLjM4NCwxMS44NzQsNi43MTEsMTYuMjAyQzE3NS4wMTgsOTAuODYxLDE4MC43Nyw5My4yNDUsMTg2Ljg5Miw5My4yNDV6ICAgICAgTTE4Mi4xMjIsNjUuNTYyYzEuMjczLTEuMjc0LDIuOTY4LTEuOTc1LDQuNzcxLTEuOTc1YzEuOCwwLDMuNDkzLDAuNzAxLDQuNzY5LDEuOTc2YzEuMjczLDEuMjczLDEuOTc3LDIuOTY3LDEuOTc3LDQuNzY5ICAgICBjMCwxLjgwMi0wLjcwMywzLjQ5NS0xLjk3Nyw0Ljc3MWMtMS4yNzQsMS4yNzMtMi45NjgsMS45NzUtNC43NjksMS45NzVjLTEuODAyLDAtMy40OTYtMC43MDItNC43NzEtMS45NzYgICAgIGMtMS4yNzQtMS4yNzQtMS45NzYtMi45NjctMS45NzYtNC43N0MxODAuMTQ2LDY4LjUzMSwxODAuODQ4LDY2LjgzNiwxODIuMTIyLDY1LjU2MnoiIGZpbGw9IiNGRkZGRkYiLz4KCQkJPGNpcmNsZSBjeD0iNjQuNDA5IiBjeT0iMTYwLjIyIiByPSIxMC40OTYiIGZpbGw9IiNGRkZGRkYiLz4KCQkJPGNpcmNsZSBjeD0iNDExLjM5IiBjeT0iMzc0LjExNSIgcj0iMTAuNDk2IiBmaWxsPSIjRkZGRkZGIi8+CgkJCTxjaXJjbGUgY3g9IjczLjc1IiBjeT0iNDM5LjM0MyIgcj0iMTAuNDk3IiBmaWxsPSIjRkZGRkZGIi8+CgkJCTxwYXRoIGQ9Ik0zODcuOTI5LDE0OC45NTFjMi4xMDcsMCw0LjIxMy0wLjgxOSw1Ljc5OS0yLjQ0OGwxMS4yMy0xMS41NTNjMy4xMTEtMy4yMDEsMy4wMzktOC4zMTktMC4xNjItMTEuNDMxICAgICBjLTMuMTk5LTMuMTEyLTguMzE4LTMuMDM5LTExLjQzMSwwLjE2MmwtMTEuMjMsMTEuNTUyYy0zLjExMSwzLjIwMS0zLjA0LDguMzE5LDAuMTYyLDExLjQzMSAgICAgQzM4My44NjgsMTQ4LjE5MiwzODUuODk5LDE0OC45NTEsMzg3LjkyOSwxNDguOTUxeiIgZmlsbD0iI0ZGRkZGRiIvPgoJCQk8cGF0aCBkPSJNMTQ4LjgyMiwxMzYuMTgybDE0LjkzNyw2LjA0YzAuOTkzLDAuNDAxLDIuMDIsMC41OTEsMy4wMjcsMC41OTFjMy4xOTcsMCw2LjIyNy0xLjkwOSw3LjQ5Ny01LjA1NiAgICAgYzEuNjc0LTQuMTM5LTAuMzI1LTguODUxLTQuNDY0LTEwLjUyNGwtMTQuOTM4LTYuMDRjLTQuMTQ2LTEuNjc2LTguODUxLDAuMzI2LTEwLjUyNCw0LjQ2NCAgICAgQzE0Mi42ODQsMTI5Ljc5NywxNDQuNjgzLDEzNC41MDgsMTQ4LjgyMiwxMzYuMTgyeiIgZmlsbD0iI0ZGRkZGRiIvPgoJCQk8cGF0aCBkPSJNOTYuMDMzLDM5Mi42NzNsLTE0LjkzOC02LjA0Yy00LjE0Ni0xLjY3NC04Ljg1MSwwLjMyNS0xMC41MjQsNC40NjRjLTEuNjczLDQuMTQsMC4zMjYsOC44NTIsNC40NjUsMTAuNTI0bDE0LjkzOCw2LjA0MSAgICAgYzAuOTkzLDAuNCwyLjAxOSwwLjU5MSwzLjAyNiwwLjU5MWMzLjE5NywwLDYuMjI3LTEuOTA4LDcuNDk3LTUuMDU2QzEwMi4xNzEsMzk5LjA1OSwxMDAuMTcyLDM5NC4zNDcsOTYuMDMzLDM5Mi42NzN6IiBmaWxsPSIjRkZGRkZGIi8+CgkJCTxwYXRoIGQ9Ik00MzYuOTQ1LDQyMC4yODRsLTE0LjkzNy02LjA0Yy00LjE0Ni0xLjY3My04Ljg1MiwwLjMyNi0xMC41MjQsNC40NjVjLTEuNjc0LDQuMTQsMC4zMjUsOC44NTIsNC40NjQsMTAuNTI0bDE0LjkzOCw2LjA0ICAgICBjMC45OTMsMC40LDIuMDE5LDAuNTkyLDMuMDI3LDAuNTkyYzMuMTk2LDAsNi4yMjYtMS45MSw3LjQ5Ny01LjA1N0M0NDMuMDgzLDQyNi42NjksNDQxLjA4NSw0MjEuOTU3LDQzNi45NDUsNDIwLjI4NHoiIGZpbGw9IiNGRkZGRkYiLz4KCQk8L2c+Cgk8L2c+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==);url(data: image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA1MTIuMDAxIDUxMi4wMDEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUxMi4wMDEgNTEyLjAwMTsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiPgo8Zz4KCTxnPgoJCTxnPgoJCQk8cGF0aCBkPSJNMzY2LjkwNSwzNjUuMDcxbDg3LjkwMi04NS42ODNjNi4wODctNS45MzUsOC4yMzYtMTQuNjQzLDUuNjEtMjIuNzI5Yy0yLjYyOS04LjA4NS05LjQ4Ni0xMy44NjYtMTcuODk4LTE1LjA4NyAgICAgbC01NS44NzktOC4xMmMtNC40MTMtMC42NDctOC41MjEsMi40MTktOS4xNjEsNi44MzdjLTAuNjQzLDQuNDE5LDIuNDE4LDguNTIxLDYuODM3LDkuMTYzbDU1Ljg3OSw4LjEyICAgICBjMi4yNzgsMC4zMyw0LjEzNSwxLjg5Niw0Ljg0Nyw0LjA4M2MwLjcxMSwyLjE5LDAuMTI5LDQuNTQ4LTEuNTE5LDYuMTU0bC05MC45NDcsODguNjVjLTEuOTA1LDEuODU4LTIuNzczLDQuNTMzLTIuMzIzLDcuMTU1ICAgICBsMjEuNDY5LDEyNS4xNzhjMC4zODksMi4yNjgtMC41MjcsNC41MTgtMi4zODcsNS44NjljLTEuODE2LDEuMzE4LTQuMzM5LDEuNTAyLTYuMzIyLDAuNDU5bC0xMTIuNDE0LTU5LjEwMSAgICAgYy0yLjM1NS0xLjIzNy01LjE2OS0xLjIzNy03LjUyNCwwbC0xMTIuNDE0LDU5LjEwMWMtMi4wMzgsMS4wNy00LjQ2LDAuODkzLTYuMzIyLTAuNDU4Yy0xLjg2MS0xLjM1My0yLjc3NS0zLjYwMi0yLjM4OC01Ljg3ICAgICBsMjEuNDctMTI1LjE3N2MwLjQ1LTIuNjIyLTAuNDItNS4yOTctMi4zMjQtNy4xNTVsLTkwLjk0Ni04OC42NDljLTEuNjQ4LTEuNjA3LTIuMjI5LTMuOTY2LTEuNTItNi4xNTUgICAgIGMwLjcxMi0yLjE4OCwyLjU2Ny0zLjc1Myw0Ljg0Ni00LjA4M2wxMjUuNjg0LTE4LjI2M2MyLjYzMy0wLjM4Miw0LjkxLTIuMDM2LDYuMDg3LTQuNDIybDU2LjIwOS0xMTMuODkxICAgICBjMS4wMTktMi4wNjMsMy4wOC0zLjM0NSw1LjM4Mi0zLjM0NXM0LjM2NCwxLjI4MSw1LjM4MywzLjM0NWw1Ni4yMDcsMTEzLjg5YzEuMTc4LDIuMzg1LDMuNDUzLDQuMDM5LDYuMDg4LDQuNDIybDQyLjM5NSw2LjE2ICAgICBjNC40MDUsMC42NDEsOC41Mi0yLjQxOCw5LjE2MS02LjgzN2MwLjY0My00LjQxOC0yLjQxOC04LjUyMS02LjgzNy05LjE2MmwtMzguMTktNS41NDlsLTU0LjMyNi0xMTAuMDc3ICAgICBjLTMuNzYxLTcuNjI0LTExLjM3OS0xMi4zNTktMTkuODgtMTIuMzU5Yy04LjUwMSwwLTE2LjExOSw0LjczNi0xOS44NzksMTIuMzU4bC01NC4zMjgsMTEwLjA3OEw1MS4xNDksMjQxLjU3MiAgICAgYy04LjQxMiwxLjIyMi0xNS4yNyw3LjAwMy0xNy44OTcsMTUuMDg5Yy0yLjYyNiw4LjA4NC0wLjQ3OCwxNi43OTIsNS42MSwyMi43MjhsODcuOTAyLDg1LjY4MmwtMjAuNzUsMTIwLjk4OSAgICAgYy0xLjQzOCw4LjM3NywxLjk0LDE2LjY4NSw4LjgxOCwyMS42ODNjMy44ODgsMi44MjMsOC40MzQsNC4yNTgsMTMuMDExLDQuMjU4YzMuNTIzLDAsNy4wNjUtMC44NSwxMC4zMzctMi41NjlsMTA4LjY1NC01Ny4xMjIgICAgIGwxMDguNjU3LDU3LjEyNGMzLjE3LDEuNjYzLDYuNzM1LDIuNTQzLDEwLjMxMiwyLjU0M2M0LjcxNCwwLDkuMjE5LTEuNDY0LDEzLjAzNC00LjIzNGM2Ljg3Ni00Ljk5OCwxMC4yNTYtMTMuMzA3LDguODE3LTIxLjY4MyAgICAgTDM2Ni45MDUsMzY1LjA3MXoiIGZpbGw9IiNjY2NjY2MiLz4KCQkJPHBhdGggZD0iTTM4OS40MjgsMjAyLjMxM2MwLjcwNi01LjE3OSw3Ljc4LTEzLjU2NSwyOS44MTYtMTIuMTY1YzEuMzU1LDAuMDg2LDIuNjUxLDAuMTI4LDMuOTAxLDAuMTI4ICAgICBjMjcuNjk5LTAuMDAyLDMwLjA1NC0yMC42MzksMzEuNjMtMzQuNDk4YzAuODc0LTcuNjc3LDEuNjk5LTE0LjkyOCw1LjI3NS0yMC4wNTNjMi41NTMtMy42NjIsMS42NTMtOC43MDEtMi4wMDctMTEuMjU0ICAgICBjLTMuNjYyLTIuNTUyLTguNzAxLTEuNjU1LTExLjI1NSwyLjAwNmMtNS45MTQsOC40ODEtNy4wNjMsMTguNTctOC4wNzYsMjcuNDczYy0xLjc0NiwxNS4zNDMtMi40MSwyMS4wODctMTguNDM4LDIwLjA2MyAgICAgYy0xNy42NjQtMS4xMjctMzAuODYsMi42NTYtMzkuMjMyLDExLjI0MmMtNi44NTQsNy4wMjktNy42NDQsMTQuNzIyLTcuNzExLDE1LjU3NmwxNi4xMTcsMS4yNzUgICAgIEMzODkuNDQ5LDIwMi4xMDYsMzg5LjQ0NywyMDIuMTc5LDM4OS40MjgsMjAyLjMxM3oiIGZpbGw9IiNjY2NjY2MiLz4KCQkJPHBhdGggZD0iTTI4Ni43NzUsOTEuMTdjMC4xNi0wLjA4NiwwLjI1NC0wLjExOSwwLjI1NC0wLjExOWw2LjUyMSwxNC43OTVjNy45MzQtMy40OTYsMTkuOTQ1LTE3LjE5Miw4LjYxNy00My45OTkgICAgIGMtNC4xMzUtOS43ODktMi4xMjUtMTEuMTMxLDkuMjUtMTYuNjE4YzExLjExLTUuMzYxLDI3LjkwMi0xMy40NjIsMjMuNDcxLTM4LjU1MWMtMC43NzUtNC4zOTctNC45NjItNy4zMjctOS4zNjctNi41NTUgICAgIGMtNC4zOTcsMC43NzctNy4zMyw0Ljk3MS02LjU1NCw5LjM2N2MyLjIwNSwxMi40OC0zLjE3NywxNS42NzgtMTQuNTc2LDIxLjE3N2MtMTAuMjM3LDQuOTM5LTI3LjM3LDEzLjIwNS0xNy4xMTYsMzcuNDc0ICAgICBDMjkzLjQ1OSw4Mi43NzksMjg5Ljg3MSw4OS41MDUsMjg2Ljc3NSw5MS4xN3oiIGZpbGw9IiNjY2NjY2MiLz4KCQkJPHBhdGggZD0iTTgwLjI2OCw4NC43NDljMTIuMzE0LDIuNzk2LDE0LjU3NiwzLjY1MywxMi43NCwxNC4xMmMtNS4wMjgsMjguNjY1LDkuNzUsMzkuMzE5LDE4LjI2Niw0MC45NDYgICAgIGMwLjUxMywwLjA5OSwxLjAyMywwLjE0NiwxLjUyNywwLjE0NmMzLjgwMiwwLDcuMTktMi42OTUsNy45MzEtNi41NjdjMC44MzgtNC4zODYtMi4wMzctOC42Mi02LjQyMy05LjQ1OCAgICAgYy0wLjA4OS0wLjAxNy04LjgyNy0yLjYtNS4zNzYtMjIuMjczYzQuNTQ5LTI1Ljk1LTE0LjAwMS0zMC4xNjMtMjUuMDg1LTMyLjY4Yy0xMi4zNDEtMi44MDMtMTguMzAzLTQuNzEyLTE4Ljk1My0xNy4zNjkgICAgIGMtMC4yMjktNC40NTgtNC4wMDYtNy44OTQtOC40ODgtNy42NTljLTQuNDU4LDAuMjI5LTcuODg4LDQuMDI5LTcuNjU4LDguNDg4QzUwLjA1Niw3Ny44ODgsNjguMjM3LDgyLjAxNiw4MC4yNjgsODQuNzQ5eiIgZmlsbD0iI2NjY2NjYyIvPgoJCQk8cGF0aCBkPSJNMTA1LjIzOSwxODEuMTEzYzAsNi4xMjEsMi4zODIsMTEuODc0LDYuNzEsMTYuMjAxYzQuMzI4LDQuMzI4LDEwLjA4MSw2LjcxMSwxNi4yMDEsNi43MTEgICAgIGM2LjEyLDAsMTEuODc0LTIuMzgzLDE2LjIwMi02LjcxYzQuMzI4LTQuMzI4LDYuNzEyLTEwLjA4MSw2LjcxMi0xNi4yMDJzLTIuMzg0LTExLjg3NC02LjcxMS0xNi4yMDIgICAgIGMtNC4zMjktNC4zMjgtMTAuMDgyLTYuNzExLTE2LjIwMy02LjcxMXMtMTEuODczLDIuMzgzLTE2LjIwMSw2LjcxMUMxMDcuNjIxLDE2OS4yMzksMTA1LjIzOSwxNzQuOTkyLDEwNS4yMzksMTgxLjExM3ogICAgICBNMTIzLjM4MiwxNzYuMzQyYzEuMjczLTEuMjczLDIuOTY4LTEuOTc1LDQuNzY5LTEuOTc1YzEuODAyLDAsMy40OTUsMC43MDIsNC43NywxLjk3NmMxLjI3NSwxLjI3NCwxLjk3OCwyLjk2OCwxLjk3OCw0Ljc3ICAgICBzLTAuNzAyLDMuNDk0LTEuOTc2LDQuNzY5Yy0xLjI3NSwxLjI3NC0yLjk2OSwxLjk3Ni00Ljc3MiwxLjk3NmMtMS44LDAtMy40OTQtMC43MDItNC43Ny0xLjk3NiAgICAgYy0xLjI3My0xLjI3My0xLjk3NS0yLjk2Ny0xLjk3NS00Ljc2OUMxMjEuNDA1LDE3OS4zMTIsMTIyLjEwNiwxNzcuNjE4LDEyMy4zODIsMTc2LjM0MnoiIGZpbGw9IiNjY2NjY2MiLz4KCQkJPHBhdGggZD0iTTMxNS4yODUsMTI5LjE4OWMtOC45MzMsOC45MzQtOC45MzMsMjMuNDcsMC4wMDEsMzIuNDA0YzQuMzI4LDQuMzI4LDEwLjA4Miw2LjcxLDE2LjIwMSw2LjcxICAgICBjNi4xMTksMCwxMS44NzQtMi4zODIsMTYuMjAyLTYuNzFjOC45MzMtOC45MzQsOC45MzMtMjMuNDcsMC0zMi40MDNjLTQuMzI3LTQuMzI4LTEwLjA4My02LjcxMS0xNi4yMDItNi43MTEgICAgIEMzMjUuMzY4LDEyMi40NzksMzE5LjYxMywxMjQuODYsMzE1LjI4NSwxMjkuMTg5eiBNMzM2LjI1NCwxNTAuMTZjLTEuMjczLDEuMjczLTIuOTY3LDEuOTc0LTQuNzY5LDEuOTc0ICAgICBjLTEuODAyLDAtMy40OTUtMC43MDEtNC43Ny0xLjk3NGMtMi42My0yLjYzLTIuNjMtNi45MS0wLjAwMS05LjUzOWMxLjI3NC0xLjI3NCwyLjk2OC0xLjk3NSw0Ljc3MS0xLjk3NSAgICAgYzEuODAxLDAsMy40OTQsMC43MDEsNC43NjksMS45NzRDMzM4Ljg4NCwxNDMuMjUsMzM4Ljg4NCwxNDcuNTMsMzM2LjI1NCwxNTAuMTZ6IiBmaWxsPSIjY2NjY2NjIi8+CgkJCTxwYXRoIGQ9Ik03NS42OTUsMzM2LjkyNmMtNC4zMjktNC4zMjYtMTAuMDgyLTYuNzA5LTE2LjIwMi02LjcwOWMtNi4xMiwwLTExLjg3MywyLjM4My0xNi4yMDEsNi43MSAgICAgYy04LjkzNCw4LjkzNS04LjkzNCwyMy40NywwLDMyLjQwNGM0LjMyNyw0LjMyOCwxMC4wOCw2LjcxMiwxNi4yMDEsNi43MTJzMTEuODc0LTIuMzg0LDE2LjIwMy02LjcxMSAgICAgQzg0LjYyOSwzNjAuMzk2LDg0LjYyOSwzNDUuODYyLDc1LjY5NSwzMzYuOTI2eiBNNjQuMjYyLDM1Ny44OThjLTEuMjczLDEuMjc0LTIuOTY3LDEuOTc3LTQuNzcsMS45NzcgICAgIGMtMS44LDAtMy40OTQtMC43MDItNC43NjktMS45NzdjLTIuNjMxLTIuNjI5LTIuNjMxLTYuOTA5LTAuMDAxLTkuNTM4YzEuMjczLTEuMjczLDIuOTY3LTEuOTc1LDQuNzctMS45NzUgICAgIHMzLjQ5NiwwLjcwMSw0Ljc3LDEuOTc1QzY2Ljg5MywzNTAuOTg5LDY2Ljg5MywzNTUuMjY5LDY0LjI2MiwzNTcuODk4eiIgZmlsbD0iI2NjY2NjYyIvPgoJCQk8cGF0aCBkPSJNNDczLjE1LDMzNi45MjZjLTQuMzI5LTQuMzI2LTEwLjA4Mi02LjcwOS0xNi4yMDEtNi43MDljLTYuMTIxLDAtMTEuODczLDIuMzgzLTE2LjIwMiw2LjcxICAgICBjLTguOTMzLDguOTM1LTguOTMzLDIzLjQ3LDAsMzIuNDA0YzQuMzI4LDQuMzI4LDEwLjA4MSw2LjcxMiwxNi4yMDIsNi43MTJjNi4xMiwwLDExLjg3My0yLjM4NCwxNi4yMDItNi43MTEgICAgIEM0ODIuMDg0LDM2MC4zOTYsNDgyLjA4NCwzNDUuODYyLDQ3My4xNSwzMzYuOTI2eiBNNDYxLjcxOSwzNTcuODk4Yy0xLjI3NCwxLjI3NC0yLjk2OCwxLjk3Ny00Ljc3LDEuOTc3ICAgICBjLTEuODAxLDAtMy40OTUtMC43MDItNC43NjktMS45NzdjLTIuNjMxLTIuNjI5LTIuNjMxLTYuOTA5LTAuMDAyLTkuNTM4YzEuMjc0LTEuMjczLDIuOTY4LTEuOTc1LDQuNzcxLTEuOTc1ICAgICBjMS44MDEsMCwzLjQ5NiwwLjcwMSw0Ljc3LDEuOTc1QzQ2NC4zNDksMzUwLjk4OSw0NjQuMzQ5LDM1NS4yNjksNDYxLjcxOSwzNTcuODk4eiIgZmlsbD0iI2NjY2NjYyIvPgoJCQk8cGF0aCBkPSJNMTg2Ljg5Miw5My4yNDVjNi4xMiwwLDExLjg3My0yLjM4MywxNi4yMDEtNi43MTFjNC4zMjctNC4zMjgsNi43MTEtMTAuMDgyLDYuNzExLTE2LjIwMiAgICAgYzAtNi4xMjEtMi4zODQtMTEuODc0LTYuNzExLTE2LjJjLTQuMzI4LTQuMzI5LTEwLjA4MS02LjcxMi0xNi4yMDEtNi43MTJjLTYuMTIyLDAtMTEuODc0LDIuMzgzLTE2LjIwMiw2LjcxMSAgICAgYy00LjMyOCw0LjMyNy02LjcxMiwxMC4wOC02LjcxMiwxNi4yMDFzMi4zODQsMTEuODc0LDYuNzExLDE2LjIwMkMxNzUuMDE4LDkwLjg2MSwxODAuNzcsOTMuMjQ1LDE4Ni44OTIsOTMuMjQ1eiAgICAgIE0xODIuMTIyLDY1LjU2MmMxLjI3My0xLjI3NCwyLjk2OC0xLjk3NSw0Ljc3MS0xLjk3NWMxLjgsMCwzLjQ5MywwLjcwMSw0Ljc2OSwxLjk3NmMxLjI3MywxLjI3MywxLjk3NywyLjk2NywxLjk3Nyw0Ljc2OSAgICAgYzAsMS44MDItMC43MDMsMy40OTUtMS45NzcsNC43NzFjLTEuMjc0LDEuMjczLTIuOTY4LDEuOTc1LTQuNzY5LDEuOTc1Yy0xLjgwMiwwLTMuNDk2LTAuNzAyLTQuNzcxLTEuOTc2ICAgICBjLTEuMjc0LTEuMjc0LTEuOTc2LTIuOTY3LTEuOTc2LTQuNzdDMTgwLjE0Niw2OC41MzEsMTgwLjg0OCw2Ni44MzYsMTgyLjEyMiw2NS41NjJ6IiBmaWxsPSIjY2NjY2NjIi8+CgkJCTxjaXJjbGUgY3g9IjY0LjQwOSIgY3k9IjE2MC4yMiIgcj0iMTAuNDk2IiBmaWxsPSIjY2NjY2NjIi8+CgkJCTxjaXJjbGUgY3g9IjQxMS4zOSIgY3k9IjM3NC4xMTUiIHI9IjEwLjQ5NiIgZmlsbD0iI2NjY2NjYyIvPgoJCQk8Y2lyY2xlIGN4PSI3My43NSIgY3k9IjQzOS4zNDMiIHI9IjEwLjQ5NyIgZmlsbD0iI2NjY2NjYyIvPgoJCQk8cGF0aCBkPSJNMzg3LjkyOSwxNDguOTUxYzIuMTA3LDAsNC4yMTMtMC44MTksNS43OTktMi40NDhsMTEuMjMtMTEuNTUzYzMuMTExLTMuMjAxLDMuMDM5LTguMzE5LTAuMTYyLTExLjQzMSAgICAgYy0zLjE5OS0zLjExMi04LjMxOC0zLjAzOS0xMS40MzEsMC4xNjJsLTExLjIzLDExLjU1MmMtMy4xMTEsMy4yMDEtMy4wNCw4LjMxOSwwLjE2MiwxMS40MzEgICAgIEMzODMuODY4LDE0OC4xOTIsMzg1Ljg5OSwxNDguOTUxLDM4Ny45MjksMTQ4Ljk1MXoiIGZpbGw9IiNjY2NjY2MiLz4KCQkJPHBhdGggZD0iTTE0OC44MjIsMTM2LjE4MmwxNC45MzcsNi4wNGMwLjk5MywwLjQwMSwyLjAyLDAuNTkxLDMuMDI3LDAuNTkxYzMuMTk3LDAsNi4yMjctMS45MDksNy40OTctNS4wNTYgICAgIGMxLjY3NC00LjEzOS0wLjMyNS04Ljg1MS00LjQ2NC0xMC41MjRsLTE0LjkzOC02LjA0Yy00LjE0Ni0xLjY3Ni04Ljg1MSwwLjMyNi0xMC41MjQsNC40NjQgICAgIEMxNDIuNjg0LDEyOS43OTcsMTQ0LjY4MywxMzQuNTA4LDE0OC44MjIsMTM2LjE4MnoiIGZpbGw9IiNjY2NjY2MiLz4KCQkJPHBhdGggZD0iTTk2LjAzMywzOTIuNjczbC0xNC45MzgtNi4wNGMtNC4xNDYtMS42NzQtOC44NTEsMC4zMjUtMTAuNTI0LDQuNDY0Yy0xLjY3Myw0LjE0LDAuMzI2LDguODUyLDQuNDY1LDEwLjUyNGwxNC45MzgsNi4wNDEgICAgIGMwLjk5MywwLjQsMi4wMTksMC41OTEsMy4wMjYsMC41OTFjMy4xOTcsMCw2LjIyNy0xLjkwOCw3LjQ5Ny01LjA1NkMxMDIuMTcxLDM5OS4wNTksMTAwLjE3MiwzOTQuMzQ3LDk2LjAzMywzOTIuNjczeiIgZmlsbD0iI2NjY2NjYyIvPgoJCQk8cGF0aCBkPSJNNDM2Ljk0NSw0MjAuMjg0bC0xNC45MzctNi4wNGMtNC4xNDYtMS42NzMtOC44NTIsMC4zMjYtMTAuNTI0LDQuNDY1Yy0xLjY3NCw0LjE0LDAuMzI1LDguODUyLDQuNDY0LDEwLjUyNGwxNC45MzgsNi4wNCAgICAgYzAuOTkzLDAuNCwyLjAxOSwwLjU5MiwzLjAyNywwLjU5MmMzLjE5NiwwLDYuMjI2LTEuOTEsNy40OTctNS4wNTdDNDQzLjA4Myw0MjYuNjY5LDQ0MS4wODUsNDIxLjk1Nyw0MzYuOTQ1LDQyMC4yODR6IiBmaWxsPSIjY2NjY2NjIi8+CgkJPC9nPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=);background-size: 34px;background-repeat: no-repeat;text-align: right;background-position: 16px 17px;">
603
- <a class="star_icon" href="https://wordpress.org/support/view/plugin-reviews/accelerated-mobile-pages?rate=5#new-post" target="_blank" style=" color: #fff;
604
- text-decoration: none;
605
- font-size: 16px;
606
- line-height: 23px; font-weight: 300;"> Appreciate it? <br> <span style="font-size: 11px;text-transform: uppercase;" title="Give Us 5 Star">Leave a Review →</span></a>
607
- </div></div>
608
- <?php
609
- //update_option( 'AMPforwp_db_version', $ampforWPCurrentVersion );
610
- }
611
- if(!defined('AMP_FRAMEWORK_COMOPNENT_DIR_PATH')){
612
- define('AMP_FRAMEWORK_COMOPNENT_DIR_PATH', plugin_dir_path( __FILE__ )."/components");
613
- }
614
- require_once( AMP_FRAMEWORK_COMOPNENT_DIR_PATH . '/components-core.php' );
615
- require_once( AMPFORWP_PLUGIN_DIR. 'pagebuilder/amp-page-builder.php' );
616
- require_once( AMPFORWP_PLUGIN_DIR. 'base_remover/base_remover.php' );
617
- require_once( AMPFORWP_PLUGIN_DIR. 'includes/thirdparty-compatibility.php' );
618
- require ( AMPFORWP_PLUGIN_DIR.'/install/index.php' );
619
-
620
- /**
621
- * Redirects the old AMP URL to the new AMP URL.
622
- * If post slug is updated the amp page with old post slug will be redirected to the updated url.
623
- *
624
- * @param string $link New URL of the post.
625
- *
626
- * @return string $link URL to be redirected.
627
- */
628
- if( ! function_exists( 'ampforwp_redirect_old_slug_to_new_url' ) ){
629
- function ampforwp_redirect_old_slug_to_new_url( $link ) {
630
-
631
- if ( function_exists( 'ampforwp_is_amp_endpoint' ) && ampforwp_is_amp_endpoint() ) {
632
- $link = trailingslashit( trailingslashit( $link ) . AMPFORWP_AMP_QUERY_VAR );
633
- }
634
-
635
- return $link;
636
- }
637
- }
1
+ <?php
2
+ /*
3
+ Plugin Name: Accelerated Mobile Pages
4
+ Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
5
+ Description: AMP for WP - Accelerated Mobile Pages for WordPress
6
+ Version: 0.9.72
7
+ Author: Ahmed Kaludi, Mohammed Kaludi
8
+ Author URI: https://ampforwp.com/
9
+ Donate link: https://www.paypal.me/Kaludi/25
10
+ License: GPL2+
11
+ Text Domain: accelerated-mobile-pages
12
+ */
13
+
14
+ // Exit if accessed directly.
15
+ if ( ! defined( 'ABSPATH' ) ) exit;
16
+
17
+ define('AMPFORWP_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
18
+ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
19
+ define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
20
+ define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
21
+ define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
22
+ define('AMPFORWP_VERSION','0.9.72');
23
+
24
+ // any changes to AMP_QUERY_VAR should be refelected here
25
+ function ampforwp_generate_endpoint(){
26
+ $ampforwp_slug = '';
27
+ $get_permalink_structure = '';
28
+ //$get_permalink_structure = get_option('permalink_structure');
29
+
30
+ // if(empty( $get_permalink_structure )) {
31
+ // $ampforwp_slug = '&amp=1';
32
+ // }else{
33
+ // $ampforwp_slug = "amp";
34
+ // }
35
+ $ampforwp_slug = "amp";
36
+
37
+ return $ampforwp_slug;
38
+ }
39
+
40
+ define('AMPFORWP_AMP_QUERY_VAR', apply_filters( 'amp_query_var', ampforwp_generate_endpoint() ) );
41
+
42
+ load_plugin_textdomain( 'accelerated-mobile-pages', false, trailingslashit(AMPFORWP_PLUGIN_DIR) . 'languages' );
43
+
44
+ // Rewrite the Endpoints after the plugin is activate, as priority is set to 11
45
+ function ampforwp_add_custom_post_support() {
46
+ global $redux_builder_amp;
47
+ if( isset($redux_builder_amp['amp-on-off-for-all-pages']) && $redux_builder_amp['amp-on-off-for-all-pages'] ) {
48
+ add_rewrite_endpoint( AMPFORWP_AMP_QUERY_VAR, EP_PAGES | EP_PERMALINK | EP_AUTHORS | EP_ALL_ARCHIVES | EP_ROOT );
49
+ add_post_type_support( 'page', AMPFORWP_AMP_QUERY_VAR );
50
+ }
51
+ }
52
+ add_action( 'init', 'ampforwp_add_custom_post_support',11);
53
+
54
+ // Frontpage and Blog page check from reading settings.
55
+ function ampforwp_name_blog_page() {
56
+ if(!$page_for_posts = get_option('page_for_posts')) return;
57
+ $page_for_posts = get_option( 'page_for_posts' );
58
+ $post = get_post($page_for_posts);
59
+ if ( $post ) {
60
+ $slug = $post->post_name;
61
+ return $slug;
62
+ }
63
+ }
64
+ function ampforwp_custom_post_page() {
65
+ $front_page_type = get_option( 'show_on_front' );
66
+ if ( $front_page_type ) {
67
+ return $front_page_type;
68
+ }
69
+ }
70
+
71
+ function ampforwp_get_the_page_id_blog_page(){
72
+ $page = "";
73
+ $output = "";
74
+ if ( ampforwp_name_blog_page() ) {
75
+ $page = get_page_by_path( ampforwp_name_blog_page() );
76
+ $output = $page->ID;
77
+ }
78
+
79
+ return $output;
80
+ }
81
+
82
+ // Add Custom Rewrite Rule to make sure pagination & redirection is working correctly
83
+ function ampforwp_add_custom_rewrite_rules() {
84
+ global $redux_builder_amp;
85
+ // For Homepage
86
+ add_rewrite_rule(
87
+ 'amp/?$',
88
+ 'index.php?amp',
89
+ 'top'
90
+ );
91
+ // For Homepage with Pagination
92
+ add_rewrite_rule(
93
+ 'amp/page/([0-9]{1,})/?$',
94
+ 'index.php?amp&paged=$matches[1]',
95
+ 'top'
96
+ );
97
+ // For /Blog page with Pagination
98
+ //if ( ampforwp_custom_post_page() && ampforwp_name_blog_page() ) {
99
+ add_rewrite_rule(
100
+ ampforwp_name_blog_page(). '/amp/page/([0-9]{1,})/?$',
101
+ 'index.php?amp&paged=$matches[1]&page_id=' .ampforwp_get_the_page_id_blog_page(),
102
+ 'top'
103
+ );
104
+ //}
105
+
106
+ // For Author pages
107
+ add_rewrite_rule(
108
+ 'author\/([^/]+)\/amp\/?$',
109
+ 'index.php?amp&author_name=$matches[1]',
110
+ 'top'
111
+ );
112
+
113
+ add_rewrite_rule(
114
+ 'author\/([^/]+)\/amp\/page\/?([0-9]{1,})\/?$',
115
+ 'index.php?amp=1&author_name=$matches[1]&paged=$matches[2]',
116
+ 'top'
117
+ );
118
+
119
+ // For category pages
120
+ $rewrite_category = get_option('category_base');
121
+ if (! empty($rewrite_category)) {
122
+ $rewrite_category = get_option('category_base');
123
+ } else {
124
+ $rewrite_category = 'category';
125
+ }
126
+
127
+ add_rewrite_rule(
128
+ $rewrite_category.'\/(.+?)\/amp/?$',
129
+ 'index.php?amp&category_name=$matches[1]',
130
+ 'top'
131
+ );
132
+ // For category pages with Pagination
133
+ add_rewrite_rule(
134
+ $rewrite_category.'\/(.+?)\/amp\/page\/?([0-9]{1,})\/?$',
135
+ 'index.php?amp&category_name=$matches[1]&paged=$matches[2]',
136
+ 'top'
137
+ );
138
+
139
+ // For tag pages
140
+ $rewrite_tag = get_option('tag_base');
141
+ if (! empty($rewrite_tag)) {
142
+ $rewrite_tag = get_option('tag_base');
143
+ } else {
144
+ $rewrite_tag = 'tag';
145
+ }
146
+ add_rewrite_rule(
147
+ $rewrite_tag.'\/(.+?)\/amp/?$',
148
+ 'index.php?amp&tag=$matches[1]',
149
+ 'top'
150
+ );
151
+ // For tag pages with Pagination
152
+ add_rewrite_rule(
153
+ $rewrite_tag.'\/(.+?)\/amp\/page\/?([0-9]{1,})\/?$',
154
+ 'index.php?amp&tag=$matches[1]&paged=$matches[2]',
155
+ 'top'
156
+ );
157
+
158
+ //Rewrite rule for custom Taxonomies
159
+ $args = array(
160
+ 'public' => true,
161
+ '_builtin' => false
162
+ );
163
+ $output = 'names'; // or objects
164
+ $operator = 'and'; // 'and' or 'or'
165
+ $taxonomies = get_taxonomies( $args, $output, $operator );
166
+ if ( $taxonomies ) {
167
+ foreach ( $taxonomies as $taxonomy ) {
168
+ add_rewrite_rule(
169
+ $taxonomy.'\/(.+?)\/amp/?$',
170
+ 'index.php?amp&'.$taxonomy.'=$matches[1]',
171
+ 'top'
172
+ );
173
+ // For Custom Taxonomies with pages
174
+ add_rewrite_rule(
175
+ $taxonomy.'\/(.+?)\/amp\/page\/?([0-9]{1,})\/?$',
176
+ 'index.php?amp&'.$taxonomy.'=$matches[1]&paged=$matches[2]',
177
+ 'top'
178
+ );
179
+ }
180
+ }
181
+ }
182
+ add_action( 'init', 'ampforwp_add_custom_rewrite_rules' );
183
+
184
+ register_activation_hook( __FILE__, 'ampforwp_rewrite_activation', 20 );
185
+ function ampforwp_rewrite_activation() {
186
+
187
+ // Run AMP deactivation code while activation
188
+ ampforwp_deactivate_amp_plugin();
189
+
190
+ if ( ! did_action( 'ampforwp_init' ) ) {
191
+ ampforwp_init();
192
+ }
193
+
194
+ flush_rewrite_rules();
195
+
196
+ ampforwp_add_custom_post_support();
197
+ ampforwp_add_custom_rewrite_rules();
198
+
199
+ // Flushing rewrite urls ONLY on activation
200
+ global $wp_rewrite;
201
+ $wp_rewrite->flush_rules();
202
+
203
+ delete_option('ampforwp_rewrite_flush_option');
204
+
205
+ // Set transient for Welcome page
206
+ set_transient( 'ampforwp_welcome_screen_activation_redirect', true, 30 );
207
+
208
+ }
209
+
210
+ add_action('init', 'ampforwp_flush_rewrite_by_option', 20);
211
+
212
+ function ampforwp_flush_rewrite_by_option(){
213
+
214
+ global $wp_rewrite;
215
+ $get_current_permalink_settings = "";
216
+
217
+ $get_current_permalink_settings = get_option('ampforwp_rewrite_flush_option');
218
+
219
+ if ( $get_current_permalink_settings ) {
220
+ return;
221
+ }
222
+ // Adding double check to make sure, we are not updating and calling database unnecessarily
223
+ if ( empty( $get_current_permalink_settings )){
224
+ $wp_rewrite->flush_rules();
225
+ update_option('ampforwp_rewrite_flush_option', 'true');
226
+ }
227
+
228
+ }
229
+
230
+ register_deactivation_hook( __FILE__, 'ampforwp_rewrite_deactivate', 20 );
231
+ function ampforwp_rewrite_deactivate() {
232
+ // Flushing rewrite urls ONLY on deactivation
233
+ global $wp_rewrite;
234
+
235
+ foreach ( $wp_rewrite->endpoints as $index => $endpoint ) {
236
+ if ( AMP_QUERY_VAR === $endpoint[1] ) {
237
+ unset( $wp_rewrite->endpoints[ $index ] );
238
+ break;
239
+ }
240
+ }
241
+
242
+ flush_rewrite_rules();
243
+
244
+ $wp_rewrite->flush_rules();
245
+
246
+ // Remove transient for Welcome page
247
+ delete_transient( 'ampforwp_welcome_screen_activation_redirect');
248
+ }
249
+
250
+ add_action( 'admin_init','ampforwp_parent_plugin_check');
251
+ function ampforwp_parent_plugin_check() {
252
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
253
+ $amp_plugin_activation_check = is_plugin_active( 'amp/amp.php' );
254
+ if ( $amp_plugin_activation_check ) {
255
+ // set_transient( 'ampforwp_parent_plugin_check', true, 30 );
256
+ } else {
257
+ delete_option( 'ampforwp_parent_plugin_check');
258
+ }
259
+ }
260
+
261
+ // Redux panel inclusion code
262
+ if ( !class_exists( 'ReduxFramework' ) ) {
263
+ require_once dirname( __FILE__ ).'/includes/options/extensions/loader.php';
264
+ require_once dirname( __FILE__ ).'/includes/options/redux-core/framework.php';
265
+ }
266
+ // Register all the main options
267
+ require_once dirname( __FILE__ ).'/includes/options/admin-config.php';
268
+ require_once dirname( __FILE__ ).'/templates/report-bugs.php';
269
+
270
+
271
+ // Modules
272
+ add_action('after_setup_theme','ampforwp_add_module_files');
273
+ function ampforwp_add_module_files() {
274
+
275
+ global $redux_builder_amp;
276
+ if ( isset($redux_builder_amp['ampforwp-content-builder']) && $redux_builder_amp['ampforwp-content-builder'] ) {
277
+ if ( ! function_exists( 'bstw' ) ) {
278
+ require_once AMPFORWP_PLUGIN_DIR .'/includes/vendor/tinymce-widget/tinymce-widget.php';
279
+ }
280
+ require_once AMPFORWP_PLUGIN_DIR .'/includes/modules/ampforwp-blurb.php';
281
+ require_once AMPFORWP_PLUGIN_DIR .'/includes/modules/ampforwp-button.php';
282
+ }
283
+ }
284
+
285
+ /*
286
+ * Load Files only in the backend
287
+ * As we don't need plugin activation code to run everytime the site loads
288
+ */
289
+ if ( is_admin() ) {
290
+
291
+ // Include Welcome page only on Admin pages
292
+ require AMPFORWP_PLUGIN_DIR .'/includes/welcome.php';
293
+
294
+ // Deactivate Parent Plugin notice
295
+ // add_action('init','ampforwp_plugin_notice');
296
+ function ampforwp_plugin_notice() {
297
+
298
+ if ( ! defined( 'AMP__FILE__' ) ) {
299
+ add_action( 'admin_notices', 'ampforwp_plugin_not_found_notice' );
300
+ function ampforwp_plugin_not_found_notice() {
301
+
302
+ $current_screen = get_current_screen();
303
+
304
+ if( $current_screen ->id == "plugin-install" || $current_screen ->id == "dashboard_page_ampforwp-welcome-page" || $current_screen ->id == "ampforwp-welcome-page" ) {
305
+ return;
306
+ }
307
+
308
+ ?>
309
+
310
+ <div class="notice notice-warning is-dismissible ampinstallation">
311
+
312
+ <?php add_thickbox(); ?>
313
+ <p>
314
+ <strong><?php _e( 'AMP Installation requires one last step:','accelerated-mobile-pages' ); ?></strong> <?php _e( 'AMP by Automattic plugin is not active', 'accelerated-mobile-pages' ); ?>
315
+ <strong> <span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;"><a href="index.php?page=ampforwp-welcome-page"><?php _e( 'Continue Installation', 'accelerated-mobile-pages' ); ?></a>
316
+ </span> </strong>
317
+ </p>
318
+ </div> <?php
319
+ }
320
+
321
+ add_action('admin_head','ampforwp_required_plugin_styling');
322
+ function ampforwp_required_plugin_styling() {
323
+ if ( ! defined( 'AMP__FILE__' ) ) { ?>
324
+ <style>
325
+ #toplevel_page_amp_options a .wp-menu-name:after {
326
+ content: "1";
327
+ background-color: #d54e21;
328
+ color: #fff;
329
+ border-radius: 10px;
330
+ font-size: 9px;
331
+ line-height: 17px;
332
+ font-weight: 600;
333
+ padding: 3px 7px;
334
+ margin-left: 5px;
335
+ }
336
+ </style>
337
+ <?php
338
+ }
339
+ ?>
340
+ <style>
341
+ .notice, .notice-error, .is-dismissible, .ampinstallation{}
342
+ .plugin-card.plugin-card-amp:before{
343
+ content: __("FINISH INSTALLATION: Install & Activate this plugin ↓",'accelerated-mobile-pages');
344
+ font-weight: bold;
345
+ float: right;
346
+ position: relative;
347
+ color: #dc3232;
348
+ top: -28px;
349
+ font-size: 18px;
350
+ }
351
+ .plugin-action-buttons a{
352
+ color: #fff
353
+ }
354
+ .plugin-card.plugin-card-amp {
355
+ background: rgb(0, 165, 92);
356
+ color: #fff;
357
+ }
358
+ .plugin-card.plugin-card-amp .column-name a,
359
+ .plugin-card.plugin-card-amp .column-description a,
360
+ .plugin-card.plugin-card-amp .column-description p {
361
+ color: #fff;
362
+ }
363
+ .plugin-card-amp .plugin-card-bottom {
364
+ background: rgba(229, 255, 80, 0);
365
+ }
366
+ </style> <?php
367
+ }
368
+ }
369
+ }
370
+
371
+ // Add Settings Button in Plugin backend
372
+ if ( ! function_exists( 'ampforwp_plugin_settings_link' ) ) {
373
+
374
+ // Deactivate Parent Plugin notice
375
+ add_filter( 'plugin_action_links', 'ampforwp_plugin_settings_link', 10, 5 );
376
+
377
+ function ampforwp_plugin_settings_link( $actions, $plugin_file ) {
378
+ static $plugin;
379
+ if (!isset($plugin))
380
+ $plugin = plugin_basename(__FILE__);
381
+ if ($plugin == $plugin_file) {
382
+ $settings = array('settings' => '<a href="admin.php?page=amp_options&tab=8">' . __('Settings', 'accelerated-mobile-pages') . '</a> | <a href="https://ampforwp.com/priority-support/#utm_source=options-panel&utm_medium=extension-tab_priority_support&utm_campaign=AMP%20Plugin">' . __('Premium Support', 'accelerated-mobile-pages') . '</a>');
383
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
384
+ $actions = array_merge( $actions, $settings );
385
+ /*if ( is_plugin_active( 'amp/amp.php' ) ) {
386
+ //if parent plugin is activated
387
+ $actions = array_merge( $actions, $settings );
388
+ } else{
389
+ if(is_plugin_active( 'amp/amp.php' )){
390
+ $actions = array_merge( $actions, $settings );
391
+ }else{
392
+ $please_activate_parent_plugin = array(__('Please Activate Parent plugin','accelerated-mobile-pages') => '<a href="'.get_admin_url() .'index.php?page=ampforwp-welcome-page">' . __('<span style="color:#b30000">'.__('Action Required: Continue Installation','accelerated-mobile-pages').'</span>', 'accelerated-mobile-pages') . '</a>');
393
+ $actions = array_merge( $please_activate_parent_plugin,$actions );
394
+ }
395
+ }*/
396
+
397
+ }
398
+ return $actions;
399
+ }
400
+ }
401
+
402
+ } // is_admin() closing
403
+
404
+ // AMP endpoint Verifier
405
+ function ampforwp_is_amp_endpoint() {
406
+ return false !== get_query_var( 'amp', false );
407
+ }
408
+
409
+ if ( ! class_exists( 'Ampforwp_Init', false ) ) {
410
+ class Ampforwp_Init {
411
+
412
+ public function __construct(){
413
+
414
+ // Load Files required for the plugin to run
415
+ require AMPFORWP_PLUGIN_DIR .'/includes/includes.php';
416
+
417
+ // Redirection Code added
418
+ require AMPFORWP_PLUGIN_DIR.'/includes/redirect.php';
419
+
420
+ require AMPFORWP_PLUGIN_DIR .'/classes/class-init.php';
421
+ new Ampforwp_Loader;
422
+
423
+ }
424
+ }
425
+ }
426
+ /*
427
+ * Start the plugin.
428
+ * Gentlemen start your engines
429
+ */
430
+ function ampforwp_plugin_init() {
431
+
432
+ if ( defined( 'AMP__FILE__' ) && defined('AMPFORWP_PLUGIN_DIR') ) {
433
+ new Ampforwp_Init;
434
+ }
435
+ }
436
+ add_action('init','ampforwp_plugin_init',9);
437
+
438
+ /*
439
+ * customized output widget
440
+ * to be used be used in before or after Loop
441
+ */
442
+ require AMPFORWP_PLUGIN_DIR.'/templates/category-widget.php';
443
+ require AMPFORWP_PLUGIN_DIR.'/templates/woo-widget.php';
444
+
445
+
446
+ /*
447
+ * Including core AMP plugin files and removing any other things if necessary
448
+ */
449
+ function ampforwp_bundle_core_amp_files(){
450
+ // Bundling Default plugin
451
+ require_once AMPFORWP_PLUGIN_DIR .'/includes/vendor/amp/amp.php';
452
+
453
+ define( 'AMP__FILE__', __FILE__ );
454
+ if ( ! defined('AMP__DIR__') ) {
455
+ define( 'AMP__DIR__', plugin_dir_path(__FILE__) . 'includes/vendor/amp/' );
456
+ }
457
+ define( 'AMP__VERSION', '0.4.2' );
458
+
459
+ require_once( AMP__DIR__ . '/back-compat/back-compat.php' );
460
+ require_once( AMP__DIR__ . '/includes/amp-helper-functions.php' );
461
+ require_once( AMP__DIR__ . '/includes/admin/functions.php' );
462
+ require_once( AMP__DIR__ . '/includes/settings/class-amp-customizer-settings.php' );
463
+ require_once( AMP__DIR__ . '/includes/settings/class-amp-customizer-design-settings.php' );
464
+ }
465
+ add_action('plugins_loaded','ampforwp_bundle_core_amp_files', 8);
466
+
467
+ function ampforwp_deactivate_amp_plugin() {
468
+
469
+ if ( version_compare( floatval( get_bloginfo( 'version' ) ), '3.5', '>=' ) ) {
470
+
471
+ if ( current_user_can( 'activate_plugins' ) ) {
472
+
473
+ add_action( 'admin_init', 'ampforwp_deactivate_amp' );
474
+
475
+ function ampforwp_deactivate_amp() {
476
+ deactivate_plugins( AMPFORWP_MAIN_PLUGIN_DIR . 'amp/amp.php' );
477
+ }
478
+ }
479
+ }
480
+ }
481
+ add_action( 'plugins_loaded', 'ampforwp_deactivate_amp_plugin' );
482
+
483
+ function ampforwp_modify_amp_activatation_link( $actions, $plugin_file ) {
484
+ $plugin = '';
485
+
486
+ $plugin = 'amp/amp.php';
487
+ if ( $plugin == $plugin_file ) {
488
+ add_thickbox();
489
+ unset($actions['activate']);
490
+ $a = '<span style="cursor:pointer;color:#0089c8" class="warning_activate_amp" onclick="alert(\'AMP is already bundled with AMPforWP. Please do not install this plugin with AMPforWP to avoid conflicts. \')">Activate</span>';
491
+ array_unshift ($actions,$a);
492
+ }
493
+ return $actions;
494
+ }
495
+ add_filter( 'plugin_action_links', 'ampforwp_modify_amp_activatation_link', 10, 2 );
496
+
497
+
498
+
499
+
500
+
501
+
502
+ if ( ! function_exists('ampforwp_init') ) {
503
+ add_action( 'init', 'ampforwp_init' );
504
+ function ampforwp_init() {
505
+ if ( false === apply_filters( 'amp_is_enabled', true ) ) {
506
+ return;
507
+ }
508
+
509
+ define( 'AMP_QUERY_VAR', apply_filters( 'amp_query_var', 'amp' ) );
510
+
511
+ if ( ! defined('AMP__DIR__') ) {
512
+ define( 'AMP__DIR__', plugin_dir_path(__FILE__) . 'includes/vendor/amp/' );
513
+ }
514
+
515
+ do_action( 'amp_init' );
516
+
517
+ load_plugin_textdomain( 'amp', false, plugin_basename( AMP__DIR__ ) . '/languages' );
518
+
519
+ add_rewrite_endpoint( AMP_QUERY_VAR, EP_PERMALINK );
520
+ add_post_type_support( 'post', AMP_QUERY_VAR );
521
+
522
+ add_filter( 'request', 'amp_force_query_var_value' );
523
+ add_action( 'wp', 'amp_maybe_add_actions' );
524
+
525
+ // Redirect the old url of amp page to the updated url. #1033 (Vendor Update)
526
+ add_filter( 'old_slug_redirect_url', 'ampforwp_redirect_old_slug_to_new_url' );
527
+
528
+ if ( class_exists( 'Jetpack' ) && ! ( defined( 'IS_WPCOM' ) && IS_WPCOM ) ) {
529
+ require_once( AMP__DIR__ . '/jetpack-helper.php' );
530
+ }
531
+ }
532
+ }
533
+
534
+
535
+ function AMP_update_db_check() {
536
+ global $redux_builder_amp;
537
+ $ampforWPCurrentVersion = AMPFORWP_VERSION;
538
+ if (get_option( 'AMPforwp_db_version' ) != $ampforWPCurrentVersion) {
539
+
540
+ if ( isset( $_GET['ampforwp-dismiss'] ) && trim($_GET['ampforwp-dismiss'])=="ampforwp_dismiss_admin_notices" ) {
541
+ update_option( 'AMPforwp_db_version', $ampforWPCurrentVersion );
542
+ wp_redirect(remove_query_arg('ampforwp-dismiss'), 301);
543
+ }
544
+ if( isset($redux_builder_amp['ampforwp-update-notification-bar'] ) && $redux_builder_amp['ampforwp-update-notification-bar'] && current_user_can( 'manage_options' ) ){
545
+
546
+ add_action('admin_notices', 'ampforwp_update_notice');
547
+ }
548
+ }
549
+ }
550
+ add_action( 'plugins_loaded', 'AMP_update_db_check' );
551
+
552
+ function ampforwp_update_notice() {
553
+ $ampforWPCurrentVersion = AMPFORWP_VERSION;
554
+ ?>
555
+ <div class="notice-success notice is-dismissible amp-update-notice" style=" display: table;
556
+ position: relative;
557
+ height: 70px;
558
+ padding: 0;
559
+ border: 0;
560
+ overflow: hidden;
561
+ margin-bottom: 10px;
562
+ " id="gf_dashboard_message">
563
+ <div style=" padding: 15px 15px 10px 15px;
564
+ display: inline-block;">
565
+ <img style=" width: 40px;
566
+ display: inline;
567
+ height: 40px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAn1BMVEUAAADuHCXwHiTuHSTtHST/IjjuHSXuHCTvHSXvHCXwHi3/JyfuHSTuHCTvHSTvHCTxHSb/NDTyHyj0IyruHSTvHSXvHSbuHST1ICftHCXuHCXuHSXwHiXvHyfuHSTuHSTvHSXuHCTuHCTuHCTuHCTvHSXyHibuHCTuHCXuHCXuHCXuHibwICjuHCTuHCTuHSTwHSbuHCXuHCTuHCTtHCSisK2PAAAANHRSTlMA+1T35wiIxm9kEQzu4Yx/NgQlFZV6PrAa16RpUi7MhE3y3LmYXynrz5FYSSC9q55EddGypVN9ggAABlxJREFUeNrVm+mymkAQhQfZBVQEFNz3fbtm3v/ZYqUqyWww0603Vfn+mcr1wMz06QUk/yfZIPRua79KYst2Vgd/fS9aU5f8E6JFx4+pktWPryn5VtKH51u0kXgY9Mk30cv31IhZkH1e/VJU1BzrR+uzJ2I6sigQ5yv63NoPKYa42/6M/JpiWXrvr0I7p+/gnN7U3+7pm1x3BM/Op+9je+iACO2mI+aPcq8ItmHQ7WyGVVOUHHDWFI1qN3Y0HmSiSfYX3atddxhPmNCv1As6HNdvqvuYP6mSDXgbTsq78cdt7YV3HOU2lDD9QBnVZnuZnlXOkYAOwlzjaxjv3PfMs+5dvvsiAh6hofwdD1P9GxUZlQTMeSXlyAkxQrr/6kEwuF1bDKEBav87aCfrH8SDNIWf/3hB8Lgb0cMu2vgXI/9C3uK0FArXTHN4hW27p+RNdomQHZv9vxK2Hyf6ODIfSuE7u6QBIf984fQnNuc5bSGpN4RCSDlCnH7L2ghH8cofxKx2u2z+/rH6SSTu7IyyrEkN/if2f2JROXAz3hW3NfUff/7R+iNVX+Nwm6DMa+09F/8pVn+v3OIeV7PlRAFnWvEFq09PJg7bU1wiZVmg9YekBi4/z4jEmjuAaP24rG1xOEtsNS5A5eL0m73jwdWIjQv0QOtfjX32LCQhrv5B69uNZ7dcsmFWf3HLEqtPA0CtMeB8go3SAuW/8l3JpFWdIResBURYfZvpmfRma7ELXbH5GqNv+JdpIiY7OQaXbaz+08C9x4zS8+8/s1MQD6tvmXQ+LpuUpn8Whk1Dfbg+5Mo93m9li/Kx+isz99yx/arqqsZgfS6s9bDF0UWuhOw2Uj8HNP5i0RkxLjRE6ifG5pHJnr9A70DLklKLHqZfdMgvOvQvO5g+Jn3Jcj5zSTh9B3JyFlJ5HDObgtKnLQKAPXKeeCrGEH3syZ0JZ37A5mi4vroMNCyMKrEhzAD66BayYFJyyvtgjNHfp1DzFDLPjUkEAH18ATMVStO1HAR6fZbVpvPi+CJ/sXlxPzaNdF22PeBtIAfoa0garsDmz08lhCVeX+7+1DDlR/D6mGjqYZy+U1ce8Ipd3giDt/SNu9snv+aWaM14fRNvEE6dcCQ+pT829eLj66Oj2YIP6/PHfv76uOKOBF7f/D4Svjk5mM4lBjh9mSWzVvyR2DS2Vas6Reh4VahI1oYlad9MvwCVpRP+AUnV2FXNPqAvFSBSem7AnXS9X8xfdF/kPhPCZq21VIBI6RlGeeD158CyOBbTs2yg+uUEd9Y/hALEfWc4UcL1SSIOpFfs8xQgZ4i+HE2FuCQ2dEK5BuuTUNryL/yIcgLV52tQ2pYmRHOQftuB6xNHHlnH7OAIwh124dLtdhRz4ilA/4FZuFwxLw5wg/ooAenLAzErUgyOHPM+54hxj4lyIDaTl0VPDzVbvikLp0CaIetxK4x+31IOxDJL7Cj0zIH68pOxG5cfoIOyqYXRL+2azNeiwEhMZ6jHu0da09a7DnAJCpR+adcG/BcFBULfZupfXAjYJW8qjB0bzJ19lP656eltF1LZjVH6LlvXWxcxsS3Z5WmuDS9LjD6ZNz+c9yjDoXET1rr+T99YWfItRg6lZj3SFqWfcd9/1L5BdKr/phiqLz8cd5STtStlWO6aYikE63eF29O/w5KUNfkUpR8avczkUZaqrS4DMfoLi5oEmcs3Wr4qFO4Y/YFtOEDoL/mVilRl4BauH1OWofm7dLNMKgMR+gtbM0PlCwaOlWCYR4R+yOy/8IRXfwyo0+NfBjq9GX96By8TymExf+A+wfrZWtDP9al+T3mGf/asAOsPHMpzMym3l5Qnefy+Nmj+nVOBq2vUcVma14rRLxbPItM3IqnAMkih8uWNSvoZwDlEqm0Kkj8yNyH5mp6pQyWSsWvc/2xkeXoDTV8uKyrjeDuTlmFxs6hMDg3gK+hnZPIP0iQ7QVqYzKGziGpWPhw5VEnCGCrcRWSs2Yj/gWM2CDs/WA9VexneR9XY+9XTn1VJrPlvAUGzdejbXHcf/KkZ/sdmeHozisc6RuR9Wges/L1PPsPZR8jb+YV8jsHagsnvOyX5LOXX0/zmb4uUfAPTTmKy8wY/SMNzEdxW9ulzRL6bXegpfuAY+/diAb51PGn/3AqDrpcf58V4Oxlk5H/lJxdt5e+wtfWRAAAAAElFTkSuQmCC" width="128" height="128" />
568
+ <div style=" display: inline;
569
+ position: relative;
570
+ margin-left: 5px;
571
+ font-weight: 300;
572
+ top: -14px;
573
+ font-size: 20px;"> <?php _e( 'AMP has been updated to '.$ampforWPCurrentVersion, 'accelerated-mobile-pages' ); ?></div>
574
+ <a href="https://ampforwp.com/new/" target="_blank" style="
575
+ position: relative;
576
+ top: -17px;
577
+ background: #ECEFF1;
578
+ text-decoration: none;
579
+ color: #111;
580
+ font-size: 10px;
581
+ padding: 4px 6px 5px 5px;
582
+ border-radius: 4px;
583
+ margin-left: 5px;
584
+ text-transform: uppercase;
585
+ border: 1px solid rgba(207, 216, 220, 0.9);" href="admin.php?page=acmforwp_update">What's New?</a>
586
+ </div>
587
+ <div style="display:inline-block;float:right;height: 70px;background: #333;width: 50px;text-align: center;">
588
+ <a title="Close this Notification" style="color: #fff;
589
+ text-decoration: none;
590
+ top: 26px;
591
+ position: relative;
592
+ padding: 24px 18px;
593
+ font-size: 17px;
594
+ font-weight: 300;
595
+ background: #333;
596
+ z-index: 100;" href="<?php echo add_query_arg( 'ampforwp-dismiss', 'ampforwp_dismiss_admin_notices' ) ?>">X</a>
597
+ </div>
598
+
599
+ <div style="float: right;display: inline-block;/* height: 55px; */background: #4CAF50;padding: 12px 20px 11px 60px;background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA1MTIuMDAxIDUxMi4wMDEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUxMi4wMDEgNTEyLjAwMTsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxMjhweCIgaGVpZ2h0PSIxMjhweCI+CjxnPgoJPGc+CgkJPGc+CgkJCTxwYXRoIGQ9Ik0zNjYuOTA1LDM2NS4wNzFsODcuOTAyLTg1LjY4M2M2LjA4Ny01LjkzNSw4LjIzNi0xNC42NDMsNS42MS0yMi43MjljLTIuNjI5LTguMDg1LTkuNDg2LTEzLjg2Ni0xNy44OTgtMTUuMDg3ICAgICBsLTU1Ljg3OS04LjEyYy00LjQxMy0wLjY0Ny04LjUyMSwyLjQxOS05LjE2MSw2LjgzN2MtMC42NDMsNC40MTksMi40MTgsOC41MjEsNi44MzcsOS4xNjNsNTUuODc5LDguMTIgICAgIGMyLjI3OCwwLjMzLDQuMTM1LDEuODk2LDQuODQ3LDQuMDgzYzAuNzExLDIuMTksMC4xMjksNC41NDgtMS41MTksNi4xNTRsLTkwLjk0Nyw4OC42NWMtMS45MDUsMS44NTgtMi43NzMsNC41MzMtMi4zMjMsNy4xNTUgICAgIGwyMS40NjksMTI1LjE3OGMwLjM4OSwyLjI2OC0wLjUyNyw0LjUxOC0yLjM4Nyw1Ljg2OWMtMS44MTYsMS4zMTgtNC4zMzksMS41MDItNi4zMjIsMC40NTlsLTExMi40MTQtNTkuMTAxICAgICBjLTIuMzU1LTEuMjM3LTUuMTY5LTEuMjM3LTcuNTI0LDBsLTExMi40MTQsNTkuMTAxYy0yLjAzOCwxLjA3LTQuNDYsMC44OTMtNi4zMjItMC40NThjLTEuODYxLTEuMzUzLTIuNzc1LTMuNjAyLTIuMzg4LTUuODcgICAgIGwyMS40Ny0xMjUuMTc3YzAuNDUtMi42MjItMC40Mi01LjI5Ny0yLjMyNC03LjE1NWwtOTAuOTQ2LTg4LjY0OWMtMS42NDgtMS42MDctMi4yMjktMy45NjYtMS41Mi02LjE1NSAgICAgYzAuNzEyLTIuMTg4LDIuNTY3LTMuNzUzLDQuODQ2LTQuMDgzbDEyNS42ODQtMTguMjYzYzIuNjMzLTAuMzgyLDQuOTEtMi4wMzYsNi4wODctNC40MjJsNTYuMjA5LTExMy44OTEgICAgIGMxLjAxOS0yLjA2MywzLjA4LTMuMzQ1LDUuMzgyLTMuMzQ1czQuMzY0LDEuMjgxLDUuMzgzLDMuMzQ1bDU2LjIwNywxMTMuODljMS4xNzgsMi4zODUsMy40NTMsNC4wMzksNi4wODgsNC40MjJsNDIuMzk1LDYuMTYgICAgIGM0LjQwNSwwLjY0MSw4LjUyLTIuNDE4LDkuMTYxLTYuODM3YzAuNjQzLTQuNDE4LTIuNDE4LTguNTIxLTYuODM3LTkuMTYybC0zOC4xOS01LjU0OWwtNTQuMzI2LTExMC4wNzcgICAgIGMtMy43NjEtNy42MjQtMTEuMzc5LTEyLjM1OS0xOS44OC0xMi4zNTljLTguNTAxLDAtMTYuMTE5LDQuNzM2LTE5Ljg3OSwxMi4zNThsLTU0LjMyOCwxMTAuMDc4TDUxLjE0OSwyNDEuNTcyICAgICBjLTguNDEyLDEuMjIyLTE1LjI3LDcuMDAzLTE3Ljg5NywxNS4wODljLTIuNjI2LDguMDg0LTAuNDc4LDE2Ljc5Miw1LjYxLDIyLjcyOGw4Ny45MDIsODUuNjgybC0yMC43NSwxMjAuOTg5ICAgICBjLTEuNDM4LDguMzc3LDEuOTQsMTYuNjg1LDguODE4LDIxLjY4M2MzLjg4OCwyLjgyMyw4LjQzNCw0LjI1OCwxMy4wMTEsNC4yNThjMy41MjMsMCw3LjA2NS0wLjg1LDEwLjMzNy0yLjU2OWwxMDguNjU0LTU3LjEyMiAgICAgbDEwOC42NTcsNTcuMTI0YzMuMTcsMS42NjMsNi43MzUsMi41NDMsMTAuMzEyLDIuNTQzYzQuNzE0LDAsOS4yMTktMS40NjQsMTMuMDM0LTQuMjM0YzYuODc2LTQuOTk4LDEwLjI1Ni0xMy4zMDcsOC44MTctMjEuNjgzICAgICBMMzY2LjkwNSwzNjUuMDcxeiIgZmlsbD0iI0ZGRkZGRiIvPgoJCQk8cGF0aCBkPSJNMzg5LjQyOCwyMDIuMzEzYzAuNzA2LTUuMTc5LDcuNzgtMTMuNTY1LDI5LjgxNi0xMi4xNjVjMS4zNTUsMC4wODYsMi42NTEsMC4xMjgsMy45MDEsMC4xMjggICAgIGMyNy42OTktMC4wMDIsMzAuMDU0LTIwLjYzOSwzMS42My0zNC40OThjMC44NzQtNy42NzcsMS42OTktMTQuOTI4LDUuMjc1LTIwLjA1M2MyLjU1My0zLjY2MiwxLjY1My04LjcwMS0yLjAwNy0xMS4yNTQgICAgIGMtMy42NjItMi41NTItOC43MDEtMS42NTUtMTEuMjU1LDIuMDA2Yy01LjkxNCw4LjQ4MS03LjA2MywxOC41Ny04LjA3NiwyNy40NzNjLTEuNzQ2LDE1LjM0My0yLjQxLDIxLjA4Ny0xOC40MzgsMjAuMDYzICAgICBjLTE3LjY2NC0xLjEyNy0zMC44NiwyLjY1Ni0zOS4yMzIsMTEuMjQyYy02Ljg1NCw3LjAyOS03LjY0NCwxNC43MjItNy43MTEsMTUuNTc2bDE2LjExNywxLjI3NSAgICAgQzM4OS40NDksMjAyLjEwNiwzODkuNDQ3LDIwMi4xNzksMzg5LjQyOCwyMDIuMzEzeiIgZmlsbD0iI0ZGRkZGRiIvPgoJCQk8cGF0aCBkPSJNMjg2Ljc3NSw5MS4xN2MwLjE2LTAuMDg2LDAuMjU0LTAuMTE5LDAuMjU0LTAuMTE5bDYuNTIxLDE0Ljc5NWM3LjkzNC0zLjQ5NiwxOS45NDUtMTcuMTkyLDguNjE3LTQzLjk5OSAgICAgYy00LjEzNS05Ljc4OS0yLjEyNS0xMS4xMzEsOS4yNS0xNi42MThjMTEuMTEtNS4zNjEsMjcuOTAyLTEzLjQ2MiwyMy40NzEtMzguNTUxYy0wLjc3NS00LjM5Ny00Ljk2Mi03LjMyNy05LjM2Ny02LjU1NSAgICAgYy00LjM5NywwLjc3Ny03LjMzLDQuOTcxLTYuNTU0LDkuMzY3YzIuMjA1LDEyLjQ4LTMuMTc3LDE1LjY3OC0xNC41NzYsMjEuMTc3Yy0xMC4yMzcsNC45MzktMjcuMzcsMTMuMjA1LTE3LjExNiwzNy40NzQgICAgIEMyOTMuNDU5LDgyLjc3OSwyODkuODcxLDg5LjUwNSwyODYuNzc1LDkxLjE3eiIgZmlsbD0iI0ZGRkZGRiIvPgoJCQk8cGF0aCBkPSJNODAuMjY4LDg0Ljc0OWMxMi4zMTQsMi43OTYsMTQuNTc2LDMuNjUzLDEyLjc0LDE0LjEyYy01LjAyOCwyOC42NjUsOS43NSwzOS4zMTksMTguMjY2LDQwLjk0NiAgICAgYzAuNTEzLDAuMDk5LDEuMDIzLDAuMTQ2LDEuNTI3LDAuMTQ2YzMuODAyLDAsNy4xOS0yLjY5NSw3LjkzMS02LjU2N2MwLjgzOC00LjM4Ni0yLjAzNy04LjYyLTYuNDIzLTkuNDU4ICAgICBjLTAuMDg5LTAuMDE3LTguODI3LTIuNi01LjM3Ni0yMi4yNzNjNC41NDktMjUuOTUtMTQuMDAxLTMwLjE2My0yNS4wODUtMzIuNjhjLTEyLjM0MS0yLjgwMy0xOC4zMDMtNC43MTItMTguOTUzLTE3LjM2OSAgICAgYy0wLjIyOS00LjQ1OC00LjAwNi03Ljg5NC04LjQ4OC03LjY1OWMtNC40NTgsMC4yMjktNy44ODgsNC4wMjktNy42NTgsOC40ODhDNTAuMDU2LDc3Ljg4OCw2OC4yMzcsODIuMDE2LDgwLjI2OCw4NC43NDl6IiBmaWxsPSIjRkZGRkZGIi8+CgkJCTxwYXRoIGQ9Ik0xMDUuMjM5LDE4MS4xMTNjMCw2LjEyMSwyLjM4MiwxMS44NzQsNi43MSwxNi4yMDFjNC4zMjgsNC4zMjgsMTAuMDgxLDYuNzExLDE2LjIwMSw2LjcxMSAgICAgYzYuMTIsMCwxMS44NzQtMi4zODMsMTYuMjAyLTYuNzFjNC4zMjgtNC4zMjgsNi43MTItMTAuMDgxLDYuNzEyLTE2LjIwMnMtMi4zODQtMTEuODc0LTYuNzExLTE2LjIwMiAgICAgYy00LjMyOS00LjMyOC0xMC4wODItNi43MTEtMTYuMjAzLTYuNzExcy0xMS44NzMsMi4zODMtMTYuMjAxLDYuNzExQzEwNy42MjEsMTY5LjIzOSwxMDUuMjM5LDE3NC45OTIsMTA1LjIzOSwxODEuMTEzeiAgICAgIE0xMjMuMzgyLDE3Ni4zNDJjMS4yNzMtMS4yNzMsMi45NjgtMS45NzUsNC43NjktMS45NzVjMS44MDIsMCwzLjQ5NSwwLjcwMiw0Ljc3LDEuOTc2YzEuMjc1LDEuMjc0LDEuOTc4LDIuOTY4LDEuOTc4LDQuNzcgICAgIHMtMC43MDIsMy40OTQtMS45NzYsNC43NjljLTEuMjc1LDEuMjc0LTIuOTY5LDEuOTc2LTQuNzcyLDEuOTc2Yy0xLjgsMC0zLjQ5NC0wLjcwMi00Ljc3LTEuOTc2ICAgICBjLTEuMjczLTEuMjczLTEuOTc1LTIuOTY3LTEuOTc1LTQuNzY5QzEyMS40MDUsMTc5LjMxMiwxMjIuMTA2LDE3Ny42MTgsMTIzLjM4MiwxNzYuMzQyeiIgZmlsbD0iI0ZGRkZGRiIvPgoJCQk8cGF0aCBkPSJNMzE1LjI4NSwxMjkuMTg5Yy04LjkzMyw4LjkzNC04LjkzMywyMy40NywwLjAwMSwzMi40MDRjNC4zMjgsNC4zMjgsMTAuMDgyLDYuNzEsMTYuMjAxLDYuNzEgICAgIGM2LjExOSwwLDExLjg3NC0yLjM4MiwxNi4yMDItNi43MWM4LjkzMy04LjkzNCw4LjkzMy0yMy40NywwLTMyLjQwM2MtNC4zMjctNC4zMjgtMTAuMDgzLTYuNzExLTE2LjIwMi02LjcxMSAgICAgQzMyNS4zNjgsMTIyLjQ3OSwzMTkuNjEzLDEyNC44NiwzMTUuMjg1LDEyOS4xODl6IE0zMzYuMjU0LDE1MC4xNmMtMS4yNzMsMS4yNzMtMi45NjcsMS45NzQtNC43NjksMS45NzQgICAgIGMtMS44MDIsMC0zLjQ5NS0wLjcwMS00Ljc3LTEuOTc0Yy0yLjYzLTIuNjMtMi42My02LjkxLTAuMDAxLTkuNTM5YzEuMjc0LTEuMjc0LDIuOTY4LTEuOTc1LDQuNzcxLTEuOTc1ICAgICBjMS44MDEsMCwzLjQ5NCwwLjcwMSw0Ljc2OSwxLjk3NEMzMzguODg0LDE0My4yNSwzMzguODg0LDE0Ny41MywzMzYuMjU0LDE1MC4xNnoiIGZpbGw9IiNGRkZGRkYiLz4KCQkJPHBhdGggZD0iTTc1LjY5NSwzMzYuOTI2Yy00LjMyOS00LjMyNi0xMC4wODItNi43MDktMTYuMjAyLTYuNzA5Yy02LjEyLDAtMTEuODczLDIuMzgzLTE2LjIwMSw2LjcxICAgICBjLTguOTM0LDguOTM1LTguOTM0LDIzLjQ3LDAsMzIuNDA0YzQuMzI3LDQuMzI4LDEwLjA4LDYuNzEyLDE2LjIwMSw2LjcxMnMxMS44NzQtMi4zODQsMTYuMjAzLTYuNzExICAgICBDODQuNjI5LDM2MC4zOTYsODQuNjI5LDM0NS44NjIsNzUuNjk1LDMzNi45MjZ6IE02NC4yNjIsMzU3Ljg5OGMtMS4yNzMsMS4yNzQtMi45NjcsMS45NzctNC43NywxLjk3NyAgICAgYy0xLjgsMC0zLjQ5NC0wLjcwMi00Ljc2OS0xLjk3N2MtMi42MzEtMi42MjktMi42MzEtNi45MDktMC4wMDEtOS41MzhjMS4yNzMtMS4yNzMsMi45NjctMS45NzUsNC43Ny0xLjk3NSAgICAgczMuNDk2LDAuNzAxLDQuNzcsMS45NzVDNjYuODkzLDM1MC45ODksNjYuODkzLDM1NS4yNjksNjQuMjYyLDM1Ny44OTh6IiBmaWxsPSIjRkZGRkZGIi8+CgkJCTxwYXRoIGQ9Ik00NzMuMTUsMzM2LjkyNmMtNC4zMjktNC4zMjYtMTAuMDgyLTYuNzA5LTE2LjIwMS02LjcwOWMtNi4xMjEsMC0xMS44NzMsMi4zODMtMTYuMjAyLDYuNzEgICAgIGMtOC45MzMsOC45MzUtOC45MzMsMjMuNDcsMCwzMi40MDRjNC4zMjgsNC4zMjgsMTAuMDgxLDYuNzEyLDE2LjIwMiw2LjcxMmM2LjEyLDAsMTEuODczLTIuMzg0LDE2LjIwMi02LjcxMSAgICAgQzQ4Mi4wODQsMzYwLjM5Niw0ODIuMDg0LDM0NS44NjIsNDczLjE1LDMzNi45MjZ6IE00NjEuNzE5LDM1Ny44OThjLTEuMjc0LDEuMjc0LTIuOTY4LDEuOTc3LTQuNzcsMS45NzcgICAgIGMtMS44MDEsMC0zLjQ5NS0wLjcwMi00Ljc2OS0xLjk3N2MtMi42MzEtMi42MjktMi42MzEtNi45MDktMC4wMDItOS41MzhjMS4yNzQtMS4yNzMsMi45NjgtMS45NzUsNC43NzEtMS45NzUgICAgIGMxLjgwMSwwLDMuNDk2LDAuNzAxLDQuNzcsMS45NzVDNDY0LjM0OSwzNTAuOTg5LDQ2NC4zNDksMzU1LjI2OSw0NjEuNzE5LDM1Ny44OTh6IiBmaWxsPSIjRkZGRkZGIi8+CgkJCTxwYXRoIGQ9Ik0xODYuODkyLDkzLjI0NWM2LjEyLDAsMTEuODczLTIuMzgzLDE2LjIwMS02LjcxMWM0LjMyNy00LjMyOCw2LjcxMS0xMC4wODIsNi43MTEtMTYuMjAyICAgICBjMC02LjEyMS0yLjM4NC0xMS44NzQtNi43MTEtMTYuMmMtNC4zMjgtNC4zMjktMTAuMDgxLTYuNzEyLTE2LjIwMS02LjcxMmMtNi4xMjIsMC0xMS44NzQsMi4zODMtMTYuMjAyLDYuNzExICAgICBjLTQuMzI4LDQuMzI3LTYuNzEyLDEwLjA4LTYuNzEyLDE2LjIwMXMyLjM4NCwxMS44NzQsNi43MTEsMTYuMjAyQzE3NS4wMTgsOTAuODYxLDE4MC43Nyw5My4yNDUsMTg2Ljg5Miw5My4yNDV6ICAgICAgTTE4Mi4xMjIsNjUuNTYyYzEuMjczLTEuMjc0LDIuOTY4LTEuOTc1LDQuNzcxLTEuOTc1YzEuOCwwLDMuNDkzLDAuNzAxLDQuNzY5LDEuOTc2YzEuMjczLDEuMjczLDEuOTc3LDIuOTY3LDEuOTc3LDQuNzY5ICAgICBjMCwxLjgwMi0wLjcwMywzLjQ5NS0xLjk3Nyw0Ljc3MWMtMS4yNzQsMS4yNzMtMi45NjgsMS45NzUtNC43NjksMS45NzVjLTEuODAyLDAtMy40OTYtMC43MDItNC43NzEtMS45NzYgICAgIGMtMS4yNzQtMS4yNzQtMS45NzYtMi45NjctMS45NzYtNC43N0MxODAuMTQ2LDY4LjUzMSwxODAuODQ4LDY2LjgzNiwxODIuMTIyLDY1LjU2MnoiIGZpbGw9IiNGRkZGRkYiLz4KCQkJPGNpcmNsZSBjeD0iNjQuNDA5IiBjeT0iMTYwLjIyIiByPSIxMC40OTYiIGZpbGw9IiNGRkZGRkYiLz4KCQkJPGNpcmNsZSBjeD0iNDExLjM5IiBjeT0iMzc0LjExNSIgcj0iMTAuNDk2IiBmaWxsPSIjRkZGRkZGIi8+CgkJCTxjaXJjbGUgY3g9IjczLjc1IiBjeT0iNDM5LjM0MyIgcj0iMTAuNDk3IiBmaWxsPSIjRkZGRkZGIi8+CgkJCTxwYXRoIGQ9Ik0zODcuOTI5LDE0OC45NTFjMi4xMDcsMCw0LjIxMy0wLjgxOSw1Ljc5OS0yLjQ0OGwxMS4yMy0xMS41NTNjMy4xMTEtMy4yMDEsMy4wMzktOC4zMTktMC4xNjItMTEuNDMxICAgICBjLTMuMTk5LTMuMTEyLTguMzE4LTMuMDM5LTExLjQzMSwwLjE2MmwtMTEuMjMsMTEuNTUyYy0zLjExMSwzLjIwMS0zLjA0LDguMzE5LDAuMTYyLDExLjQzMSAgICAgQzM4My44NjgsMTQ4LjE5MiwzODUuODk5LDE0OC45NTEsMzg3LjkyOSwxNDguOTUxeiIgZmlsbD0iI0ZGRkZGRiIvPgoJCQk8cGF0aCBkPSJNMTQ4LjgyMiwxMzYuMTgybDE0LjkzNyw2LjA0YzAuOTkzLDAuNDAxLDIuMDIsMC41OTEsMy4wMjcsMC41OTFjMy4xOTcsMCw2LjIyNy0xLjkwOSw3LjQ5Ny01LjA1NiAgICAgYzEuNjc0LTQuMTM5LTAuMzI1LTguODUxLTQuNDY0LTEwLjUyNGwtMTQuOTM4LTYuMDRjLTQuMTQ2LTEuNjc2LTguODUxLDAuMzI2LTEwLjUyNCw0LjQ2NCAgICAgQzE0Mi42ODQsMTI5Ljc5NywxNDQuNjgzLDEzNC41MDgsMTQ4LjgyMiwxMzYuMTgyeiIgZmlsbD0iI0ZGRkZGRiIvPgoJCQk8cGF0aCBkPSJNOTYuMDMzLDM5Mi42NzNsLTE0LjkzOC02LjA0Yy00LjE0Ni0xLjY3NC04Ljg1MSwwLjMyNS0xMC41MjQsNC40NjRjLTEuNjczLDQuMTQsMC4zMjYsOC44NTIsNC40NjUsMTAuNTI0bDE0LjkzOCw2LjA0MSAgICAgYzAuOTkzLDAuNCwyLjAxOSwwLjU5MSwzLjAyNiwwLjU5MWMzLjE5NywwLDYuMjI3LTEuOTA4LDcuNDk3LTUuMDU2QzEwMi4xNzEsMzk5LjA1OSwxMDAuMTcyLDM5NC4zNDcsOTYuMDMzLDM5Mi42NzN6IiBmaWxsPSIjRkZGRkZGIi8+CgkJCTxwYXRoIGQ9Ik00MzYuOTQ1LDQyMC4yODRsLTE0LjkzNy02LjA0Yy00LjE0Ni0xLjY3My04Ljg1MiwwLjMyNi0xMC41MjQsNC40NjVjLTEuNjc0LDQuMTQsMC4zMjUsOC44NTIsNC40NjQsMTAuNTI0bDE0LjkzOCw2LjA0ICAgICBjMC45OTMsMC40LDIuMDE5LDAuNTkyLDMuMDI3LDAuNTkyYzMuMTk2LDAsNi4yMjYtMS45MSw3LjQ5Ny01LjA1N0M0NDMuMDgzLDQyNi42NjksNDQxLjA4NSw0MjEuOTU3LDQzNi45NDUsNDIwLjI4NHoiIGZpbGw9IiNGRkZGRkYiLz4KCQk8L2c+Cgk8L2c+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==);url(data: image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA1MTIuMDAxIDUxMi4wMDEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUxMi4wMDEgNTEyLjAwMTsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiPgo8Zz4KCTxnPgoJCTxnPgoJCQk8cGF0aCBkPSJNMzY2LjkwNSwzNjUuMDcxbDg3LjkwMi04NS42ODNjNi4wODctNS45MzUsOC4yMzYtMTQuNjQzLDUuNjEtMjIuNzI5Yy0yLjYyOS04LjA4NS05LjQ4Ni0xMy44NjYtMTcuODk4LTE1LjA4NyAgICAgbC01NS44NzktOC4xMmMtNC40MTMtMC42NDctOC41MjEsMi40MTktOS4xNjEsNi44MzdjLTAuNjQzLDQuNDE5LDIuNDE4LDguNTIxLDYuODM3LDkuMTYzbDU1Ljg3OSw4LjEyICAgICBjMi4yNzgsMC4zMyw0LjEzNSwxLjg5Niw0Ljg0Nyw0LjA4M2MwLjcxMSwyLjE5LDAuMTI5LDQuNTQ4LTEuNTE5LDYuMTU0bC05MC45NDcsODguNjVjLTEuOTA1LDEuODU4LTIuNzczLDQuNTMzLTIuMzIzLDcuMTU1ICAgICBsMjEuNDY5LDEyNS4xNzhjMC4zODksMi4yNjgtMC41MjcsNC41MTgtMi4zODcsNS44NjljLTEuODE2LDEuMzE4LTQuMzM5LDEuNTAyLTYuMzIyLDAuNDU5bC0xMTIuNDE0LTU5LjEwMSAgICAgYy0yLjM1NS0xLjIzNy01LjE2OS0xLjIzNy03LjUyNCwwbC0xMTIuNDE0LDU5LjEwMWMtMi4wMzgsMS4wNy00LjQ2LDAuODkzLTYuMzIyLTAuNDU4Yy0xLjg2MS0xLjM1My0yLjc3NS0zLjYwMi0yLjM4OC01Ljg3ICAgICBsMjEuNDctMTI1LjE3N2MwLjQ1LTIuNjIyLTAuNDItNS4yOTctMi4zMjQtNy4xNTVsLTkwLjk0Ni04OC42NDljLTEuNjQ4LTEuNjA3LTIuMjI5LTMuOTY2LTEuNTItNi4xNTUgICAgIGMwLjcxMi0yLjE4OCwyLjU2Ny0zLjc1Myw0Ljg0Ni00LjA4M2wxMjUuNjg0LTE4LjI2M2MyLjYzMy0wLjM4Miw0LjkxLTIuMDM2LDYuMDg3LTQuNDIybDU2LjIwOS0xMTMuODkxICAgICBjMS4wMTktMi4wNjMsMy4wOC0zLjM0NSw1LjM4Mi0zLjM0NXM0LjM2NCwxLjI4MSw1LjM4MywzLjM0NWw1Ni4yMDcsMTEzLjg5YzEuMTc4LDIuMzg1LDMuNDUzLDQuMDM5LDYuMDg4LDQuNDIybDQyLjM5NSw2LjE2ICAgICBjNC40MDUsMC42NDEsOC41Mi0yLjQxOCw5LjE2MS02LjgzN2MwLjY0My00LjQxOC0yLjQxOC04LjUyMS02LjgzNy05LjE2MmwtMzguMTktNS41NDlsLTU0LjMyNi0xMTAuMDc3ICAgICBjLTMuNzYxLTcuNjI0LTExLjM3OS0xMi4zNTktMTkuODgtMTIuMzU5Yy04LjUwMSwwLTE2LjExOSw0LjczNi0xOS44NzksMTIuMzU4bC01NC4zMjgsMTEwLjA3OEw1MS4xNDksMjQxLjU3MiAgICAgYy04LjQxMiwxLjIyMi0xNS4yNyw3LjAwMy0xNy44OTcsMTUuMDg5Yy0yLjYyNiw4LjA4NC0wLjQ3OCwxNi43OTIsNS42MSwyMi43MjhsODcuOTAyLDg1LjY4MmwtMjAuNzUsMTIwLjk4OSAgICAgYy0xLjQzOCw4LjM3NywxLjk0LDE2LjY4NSw4LjgxOCwyMS42ODNjMy44ODgsMi44MjMsOC40MzQsNC4yNTgsMTMuMDExLDQuMjU4YzMuNTIzLDAsNy4wNjUtMC44NSwxMC4zMzctMi41NjlsMTA4LjY1NC01Ny4xMjIgICAgIGwxMDguNjU3LDU3LjEyNGMzLjE3LDEuNjYzLDYuNzM1LDIuNTQzLDEwLjMxMiwyLjU0M2M0LjcxNCwwLDkuMjE5LTEuNDY0LDEzLjAzNC00LjIzNGM2Ljg3Ni00Ljk5OCwxMC4yNTYtMTMuMzA3LDguODE3LTIxLjY4MyAgICAgTDM2Ni45MDUsMzY1LjA3MXoiIGZpbGw9IiNjY2NjY2MiLz4KCQkJPHBhdGggZD0iTTM4OS40MjgsMjAyLjMxM2MwLjcwNi01LjE3OSw3Ljc4LTEzLjU2NSwyOS44MTYtMTIuMTY1YzEuMzU1LDAuMDg2LDIuNjUxLDAuMTI4LDMuOTAxLDAuMTI4ICAgICBjMjcuNjk5LTAuMDAyLDMwLjA1NC0yMC42MzksMzEuNjMtMzQuNDk4YzAuODc0LTcuNjc3LDEuNjk5LTE0LjkyOCw1LjI3NS0yMC4wNTNjMi41NTMtMy42NjIsMS42NTMtOC43MDEtMi4wMDctMTEuMjU0ICAgICBjLTMuNjYyLTIuNTUyLTguNzAxLTEuNjU1LTExLjI1NSwyLjAwNmMtNS45MTQsOC40ODEtNy4wNjMsMTguNTctOC4wNzYsMjcuNDczYy0xLjc0NiwxNS4zNDMtMi40MSwyMS4wODctMTguNDM4LDIwLjA2MyAgICAgYy0xNy42NjQtMS4xMjctMzAuODYsMi42NTYtMzkuMjMyLDExLjI0MmMtNi44NTQsNy4wMjktNy42NDQsMTQuNzIyLTcuNzExLDE1LjU3NmwxNi4xMTcsMS4yNzUgICAgIEMzODkuNDQ5LDIwMi4xMDYsMzg5LjQ0NywyMDIuMTc5LDM4OS40MjgsMjAyLjMxM3oiIGZpbGw9IiNjY2NjY2MiLz4KCQkJPHBhdGggZD0iTTI4Ni43NzUsOTEuMTdjMC4xNi0wLjA4NiwwLjI1NC0wLjExOSwwLjI1NC0wLjExOWw2LjUyMSwxNC43OTVjNy45MzQtMy40OTYsMTkuOTQ1LTE3LjE5Miw4LjYxNy00My45OTkgICAgIGMtNC4xMzUtOS43ODktMi4xMjUtMTEuMTMxLDkuMjUtMTYuNjE4YzExLjExLTUuMzYxLDI3LjkwMi0xMy40NjIsMjMuNDcxLTM4LjU1MWMtMC43NzUtNC4zOTctNC45NjItNy4zMjctOS4zNjctNi41NTUgICAgIGMtNC4zOTcsMC43NzctNy4zMyw0Ljk3MS02LjU1NCw5LjM2N2MyLjIwNSwxMi40OC0zLjE3NywxNS42NzgtMTQuNTc2LDIxLjE3N2MtMTAuMjM3LDQuOTM5LTI3LjM3LDEzLjIwNS0xNy4xMTYsMzcuNDc0ICAgICBDMjkzLjQ1OSw4Mi43NzksMjg5Ljg3MSw4OS41MDUsMjg2Ljc3NSw5MS4xN3oiIGZpbGw9IiNjY2NjY2MiLz4KCQkJPHBhdGggZD0iTTgwLjI2OCw4NC43NDljMTIuMzE0LDIuNzk2LDE0LjU3NiwzLjY1MywxMi43NCwxNC4xMmMtNS4wMjgsMjguNjY1LDkuNzUsMzkuMzE5LDE4LjI2Niw0MC45NDYgICAgIGMwLjUxMywwLjA5OSwxLjAyMywwLjE0NiwxLjUyNywwLjE0NmMzLjgwMiwwLDcuMTktMi42OTUsNy45MzEtNi41NjdjMC44MzgtNC4zODYtMi4wMzctOC42Mi02LjQyMy05LjQ1OCAgICAgYy0wLjA4OS0wLjAxNy04LjgyNy0yLjYtNS4zNzYtMjIuMjczYzQuNTQ5LTI1Ljk1LTE0LjAwMS0zMC4xNjMtMjUuMDg1LTMyLjY4Yy0xMi4zNDEtMi44MDMtMTguMzAzLTQuNzEyLTE4Ljk1My0xNy4zNjkgICAgIGMtMC4yMjktNC40NTgtNC4wMDYtNy44OTQtOC40ODgtNy42NTljLTQuNDU4LDAuMjI5LTcuODg4LDQuMDI5LTcuNjU4LDguNDg4QzUwLjA1Niw3Ny44ODgsNjguMjM3LDgyLjAxNiw4MC4yNjgsODQuNzQ5eiIgZmlsbD0iI2NjY2NjYyIvPgoJCQk8cGF0aCBkPSJNMTA1LjIzOSwxODEuMTEzYzAsNi4xMjEsMi4zODIsMTEuODc0LDYuNzEsMTYuMjAxYzQuMzI4LDQuMzI4LDEwLjA4MSw2LjcxMSwxNi4yMDEsNi43MTEgICAgIGM2LjEyLDAsMTEuODc0LTIuMzgzLDE2LjIwMi02LjcxYzQuMzI4LTQuMzI4LDYuNzEyLTEwLjA4MSw2LjcxMi0xNi4yMDJzLTIuMzg0LTExLjg3NC02LjcxMS0xNi4yMDIgICAgIGMtNC4zMjktNC4zMjgtMTAuMDgyLTYuNzExLTE2LjIwMy02LjcxMXMtMTEuODczLDIuMzgzLTE2LjIwMSw2LjcxMUMxMDcuNjIxLDE2OS4yMzksMTA1LjIzOSwxNzQuOTkyLDEwNS4yMzksMTgxLjExM3ogICAgICBNMTIzLjM4MiwxNzYuMzQyYzEuMjczLTEuMjczLDIuOTY4LTEuOTc1LDQuNzY5LTEuOTc1YzEuODAyLDAsMy40OTUsMC43MDIsNC43NywxLjk3NmMxLjI3NSwxLjI3NCwxLjk3OCwyLjk2OCwxLjk3OCw0Ljc3ICAgICBzLTAuNzAyLDMuNDk0LTEuOTc2LDQuNzY5Yy0xLjI3NSwxLjI3NC0yLjk2OSwxLjk3Ni00Ljc3MiwxLjk3NmMtMS44LDAtMy40OTQtMC43MDItNC43Ny0xLjk3NiAgICAgYy0xLjI3My0xLjI3My0xLjk3NS0yLjk2Ny0xLjk3NS00Ljc2OUMxMjEuNDA1LDE3OS4zMTIsMTIyLjEwNiwxNzcuNjE4LDEyMy4zODIsMTc2LjM0MnoiIGZpbGw9IiNjY2NjY2MiLz4KCQkJPHBhdGggZD0iTTMxNS4yODUsMTI5LjE4OWMtOC45MzMsOC45MzQtOC45MzMsMjMuNDcsMC4wMDEsMzIuNDA0YzQuMzI4LDQuMzI4LDEwLjA4Miw2LjcxLDE2LjIwMSw2LjcxICAgICBjNi4xMTksMCwxMS44NzQtMi4zODIsMTYuMjAyLTYuNzFjOC45MzMtOC45MzQsOC45MzMtMjMuNDcsMC0zMi40MDNjLTQuMzI3LTQuMzI4LTEwLjA4My02LjcxMS0xNi4yMDItNi43MTEgICAgIEMzMjUuMzY4LDEyMi40NzksMzE5LjYxMywxMjQuODYsMzE1LjI4NSwxMjkuMTg5eiBNMzM2LjI1NCwxNTAuMTZjLTEuMjczLDEuMjczLTIuOTY3LDEuOTc0LTQuNzY5LDEuOTc0ICAgICBjLTEuODAyLDAtMy40OTUtMC43MDEtNC43Ny0xLjk3NGMtMi42My0yLjYzLTIuNjMtNi45MS0wLjAwMS05LjUzOWMxLjI3NC0xLjI3NCwyLjk2OC0xLjk3NSw0Ljc3MS0xLjk3NSAgICAgYzEuODAxLDAsMy40OTQsMC43MDEsNC43NjksMS45NzRDMzM4Ljg4NCwxNDMuMjUsMzM4Ljg4NCwxNDcuNTMsMzM2LjI1NCwxNTAuMTZ6IiBmaWxsPSIjY2NjY2NjIi8+CgkJCTxwYXRoIGQ9Ik03NS42OTUsMzM2LjkyNmMtNC4zMjktNC4zMjYtMTAuMDgyLTYuNzA5LTE2LjIwMi02LjcwOWMtNi4xMiwwLTExLjg3MywyLjM4My0xNi4yMDEsNi43MSAgICAgYy04LjkzNCw4LjkzNS04LjkzNCwyMy40NywwLDMyLjQwNGM0LjMyNyw0LjMyOCwxMC4wOCw2LjcxMiwxNi4yMDEsNi43MTJzMTEuODc0LTIuMzg0LDE2LjIwMy02LjcxMSAgICAgQzg0LjYyOSwzNjAuMzk2LDg0LjYyOSwzNDUuODYyLDc1LjY5NSwzMzYuOTI2eiBNNjQuMjYyLDM1Ny44OThjLTEuMjczLDEuMjc0LTIuOTY3LDEuOTc3LTQuNzcsMS45NzcgICAgIGMtMS44LDAtMy40OTQtMC43MDItNC43NjktMS45NzdjLTIuNjMxLTIuNjI5LTIuNjMxLTYuOTA5LTAuMDAxLTkuNTM4YzEuMjczLTEuMjczLDIuOTY3LTEuOTc1LDQuNzctMS45NzUgICAgIHMzLjQ5NiwwLjcwMSw0Ljc3LDEuOTc1QzY2Ljg5MywzNTAuOTg5LDY2Ljg5MywzNTUuMjY5LDY0LjI2MiwzNTcuODk4eiIgZmlsbD0iI2NjY2NjYyIvPgoJCQk8cGF0aCBkPSJNNDczLjE1LDMzNi45MjZjLTQuMzI5LTQuMzI2LTEwLjA4Mi02LjcwOS0xNi4yMDEtNi43MDljLTYuMTIxLDAtMTEuODczLDIuMzgzLTE2LjIwMiw2LjcxICAgICBjLTguOTMzLDguOTM1LTguOTMzLDIzLjQ3LDAsMzIuNDA0YzQuMzI4LDQuMzI4LDEwLjA4MSw2LjcxMiwxNi4yMDIsNi43MTJjNi4xMiwwLDExLjg3My0yLjM4NCwxNi4yMDItNi43MTEgICAgIEM0ODIuMDg0LDM2MC4zOTYsNDgyLjA4NCwzNDUuODYyLDQ3My4xNSwzMzYuOTI2eiBNNDYxLjcxOSwzNTcuODk4Yy0xLjI3NCwxLjI3NC0yLjk2OCwxLjk3Ny00Ljc3LDEuOTc3ICAgICBjLTEuODAxLDAtMy40OTUtMC43MDItNC43NjktMS45NzdjLTIuNjMxLTIuNjI5LTIuNjMxLTYuOTA5LTAuMDAyLTkuNTM4YzEuMjc0LTEuMjczLDIuOTY4LTEuOTc1LDQuNzcxLTEuOTc1ICAgICBjMS44MDEsMCwzLjQ5NiwwLjcwMSw0Ljc3LDEuOTc1QzQ2NC4zNDksMzUwLjk4OSw0NjQuMzQ5LDM1NS4yNjksNDYxLjcxOSwzNTcuODk4eiIgZmlsbD0iI2NjY2NjYyIvPgoJCQk8cGF0aCBkPSJNMTg2Ljg5Miw5My4yNDVjNi4xMiwwLDExLjg3My0yLjM4MywxNi4yMDEtNi43MTFjNC4zMjctNC4zMjgsNi43MTEtMTAuMDgyLDYuNzExLTE2LjIwMiAgICAgYzAtNi4xMjEtMi4zODQtMTEuODc0LTYuNzExLTE2LjJjLTQuMzI4LTQuMzI5LTEwLjA4MS02LjcxMi0xNi4yMDEtNi43MTJjLTYuMTIyLDAtMTEuODc0LDIuMzgzLTE2LjIwMiw2LjcxMSAgICAgYy00LjMyOCw0LjMyNy02LjcxMiwxMC4wOC02LjcxMiwxNi4yMDFzMi4zODQsMTEuODc0LDYuNzExLDE2LjIwMkMxNzUuMDE4LDkwLjg2MSwxODAuNzcsOTMuMjQ1LDE4Ni44OTIsOTMuMjQ1eiAgICAgIE0xODIuMTIyLDY1LjU2MmMxLjI3My0xLjI3NCwyLjk2OC0xLjk3NSw0Ljc3MS0xLjk3NWMxLjgsMCwzLjQ5MywwLjcwMSw0Ljc2OSwxLjk3NmMxLjI3MywxLjI3MywxLjk3NywyLjk2NywxLjk3Nyw0Ljc2OSAgICAgYzAsMS44MDItMC43MDMsMy40OTUtMS45NzcsNC43NzFjLTEuMjc0LDEuMjczLTIuOTY4LDEuOTc1LTQuNzY5LDEuOTc1Yy0xLjgwMiwwLTMuNDk2LTAuNzAyLTQuNzcxLTEuOTc2ICAgICBjLTEuMjc0LTEuMjc0LTEuOTc2LTIuOTY3LTEuOTc2LTQuNzdDMTgwLjE0Niw2OC41MzEsMTgwLjg0OCw2Ni44MzYsMTgyLjEyMiw2NS41NjJ6IiBmaWxsPSIjY2NjY2NjIi8+CgkJCTxjaXJjbGUgY3g9IjY0LjQwOSIgY3k9IjE2MC4yMiIgcj0iMTAuNDk2IiBmaWxsPSIjY2NjY2NjIi8+CgkJCTxjaXJjbGUgY3g9IjQxMS4zOSIgY3k9IjM3NC4xMTUiIHI9IjEwLjQ5NiIgZmlsbD0iI2NjY2NjYyIvPgoJCQk8Y2lyY2xlIGN4PSI3My43NSIgY3k9IjQzOS4zNDMiIHI9IjEwLjQ5NyIgZmlsbD0iI2NjY2NjYyIvPgoJCQk8cGF0aCBkPSJNMzg3LjkyOSwxNDguOTUxYzIuMTA3LDAsNC4yMTMtMC44MTksNS43OTktMi40NDhsMTEuMjMtMTEuNTUzYzMuMTExLTMuMjAxLDMuMDM5LTguMzE5LTAuMTYyLTExLjQzMSAgICAgYy0zLjE5OS0zLjExMi04LjMxOC0zLjAzOS0xMS40MzEsMC4xNjJsLTExLjIzLDExLjU1MmMtMy4xMTEsMy4yMDEtMy4wNCw4LjMxOSwwLjE2MiwxMS40MzEgICAgIEMzODMuODY4LDE0OC4xOTIsMzg1Ljg5OSwxNDguOTUxLDM4Ny45MjksMTQ4Ljk1MXoiIGZpbGw9IiNjY2NjY2MiLz4KCQkJPHBhdGggZD0iTTE0OC44MjIsMTM2LjE4MmwxNC45MzcsNi4wNGMwLjk5MywwLjQwMSwyLjAyLDAuNTkxLDMuMDI3LDAuNTkxYzMuMTk3LDAsNi4yMjctMS45MDksNy40OTctNS4wNTYgICAgIGMxLjY3NC00LjEzOS0wLjMyNS04Ljg1MS00LjQ2NC0xMC41MjRsLTE0LjkzOC02LjA0Yy00LjE0Ni0xLjY3Ni04Ljg1MSwwLjMyNi0xMC41MjQsNC40NjQgICAgIEMxNDIuNjg0LDEyOS43OTcsMTQ0LjY4MywxMzQuNTA4LDE0OC44MjIsMTM2LjE4MnoiIGZpbGw9IiNjY2NjY2MiLz4KCQkJPHBhdGggZD0iTTk2LjAzMywzOTIuNjczbC0xNC45MzgtNi4wNGMtNC4xNDYtMS42NzQtOC44NTEsMC4zMjUtMTAuNTI0LDQuNDY0Yy0xLjY3Myw0LjE0LDAuMzI2LDguODUyLDQuNDY1LDEwLjUyNGwxNC45MzgsNi4wNDEgICAgIGMwLjk5MywwLjQsMi4wMTksMC41OTEsMy4wMjYsMC41OTFjMy4xOTcsMCw2LjIyNy0xLjkwOCw3LjQ5Ny01LjA1NkMxMDIuMTcxLDM5OS4wNTksMTAwLjE3MiwzOTQuMzQ3LDk2LjAzMywzOTIuNjczeiIgZmlsbD0iI2NjY2NjYyIvPgoJCQk8cGF0aCBkPSJNNDM2Ljk0NSw0MjAuMjg0bC0xNC45MzctNi4wNGMtNC4xNDYtMS42NzMtOC44NTIsMC4zMjYtMTAuNTI0LDQuNDY1Yy0xLjY3NCw0LjE0LDAuMzI1LDguODUyLDQuNDY0LDEwLjUyNGwxNC45MzgsNi4wNCAgICAgYzAuOTkzLDAuNCwyLjAxOSwwLjU5MiwzLjAyNywwLjU5MmMzLjE5NiwwLDYuMjI2LTEuOTEsNy40OTctNS4wNTdDNDQzLjA4Myw0MjYuNjY5LDQ0MS4wODUsNDIxLjk1Nyw0MzYuOTQ1LDQyMC4yODR6IiBmaWxsPSIjY2NjY2NjIi8+CgkJPC9nPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=);background-size: 34px;background-repeat: no-repeat;text-align: right;background-position: 16px 17px;">
600
+ <a class="star_icon" href="https://wordpress.org/support/view/plugin-reviews/accelerated-mobile-pages?rate=5#new-post" target="_blank" style=" color: #fff;
601
+ text-decoration: none;
602
+ font-size: 16px;
603
+ line-height: 23px; font-weight: 300;"> Appreciate it? <br> <span style="font-size: 11px;text-transform: uppercase;" title="Give Us 5 Star">Leave a Review →</span></a>
604
+ </div></div>
605
+ <?php
606
+ //update_option( 'AMPforwp_db_version', $ampforWPCurrentVersion );
607
+ }
608
+ if(!defined('AMP_FRAMEWORK_COMOPNENT_DIR_PATH')){
609
+ define('AMP_FRAMEWORK_COMOPNENT_DIR_PATH', plugin_dir_path( __FILE__ )."/components");
610
+ }
611
+ require_once( AMP_FRAMEWORK_COMOPNENT_DIR_PATH . '/components-core.php' );
612
+ require_once( AMPFORWP_PLUGIN_DIR. 'pagebuilder/amp-page-builder.php' );
613
+ require_once( AMPFORWP_PLUGIN_DIR. 'base_remover/base_remover.php' );
614
+ require_once( AMPFORWP_PLUGIN_DIR. 'includes/thirdparty-compatibility.php' );
615
+ require ( AMPFORWP_PLUGIN_DIR.'/install/index.php' );
616
+
617
+ /**
618
+ * Redirects the old AMP URL to the new AMP URL.
619
+ * If post slug is updated the amp page with old post slug will be redirected to the updated url.
620
+ *
621
+ * @param string $link New URL of the post.
622
+ *
623
+ * @return string $link URL to be redirected.
624
+ */
625
+ if( ! function_exists( 'ampforwp_redirect_old_slug_to_new_url' ) ){
626
+ function ampforwp_redirect_old_slug_to_new_url( $link ) {
627
+
628
+ if ( function_exists( 'ampforwp_is_amp_endpoint' ) && ampforwp_is_amp_endpoint() ) {
629
+ $link = trailingslashit( trailingslashit( $link ) . AMPFORWP_AMP_QUERY_VAR );
630
+ }
631
+
632
+ return $link;
633
+ }
634
+ }
 
 
 
base_remover/base_remover.php CHANGED
@@ -1,135 +1,135 @@
1
- <?php
2
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
3
-
4
- // check for plugin using plugin name
5
- $oldPlugin = AMPFORWP_MAIN_PLUGIN_DIR.'amp-category-base-remover/amp-category-base-remover.php';
6
- if ( is_plugin_active( $oldPlugin ) ) {
7
- //plugin is activated
8
- deactivate_plugins($oldPlugin);
9
- add_action( 'admin_notices', 'plugin_catagory_base_removed_admin_notice__success' );
10
- }
11
-
12
- function plugin_catagory_base_removed_admin_notice__success(){
13
- ?>
14
- <div class="notice notice-success is-dismissible">
15
- <p><?php _e( 'AMP Category Base URL Remover plugin has De-activated, <br> Category removal option is added in our core plugin <a href="#">Click here to view details</a>', 'amp-for-plugin' ); ?></p>
16
- </div>
17
- <?php
18
- }
19
-
20
-
21
- add_action( 'current_screen', 'this_screen_own' );
22
- function this_screen_own(){
23
- $current_screen = get_current_screen();
24
- if( $current_screen ->id == "plugin-install" ) {
25
-
26
- function amp_enqueue_function_dependancies($hook) {
27
- wp_enqueue_script( 'AMPScriptDependanciesremove', plugins_url('dependencyScript.js', __FILE__), array('jquery') );
28
- }
29
- add_action( 'admin_enqueue_scripts', 'amp_enqueue_function_dependancies' );
30
-
31
-
32
-
33
-
34
-
35
- }
36
- }
37
-
38
-
39
-
40
- add_filter( 'init', 'ampforwp_url_base_rewrite_rules', 100 );
41
- function ampforwp_url_base_rewrite_rules(){
42
- global $redux_builder_amp;
43
- global $wp_rewrite;
44
- $categoryBaseRewrite = 0;
45
- $tagBaseRewrite = 0;
46
-
47
- if(isset($redux_builder_amp['ampforwp-category-base-removel-link'])){
48
- $categoryBaseRewrite = $redux_builder_amp['ampforwp-category-base-removel-link'];
49
- }
50
- if(isset($redux_builder_amp['ampforwp-tag-base-removal-link'])){
51
- $tagBaseRewrite = $redux_builder_amp['ampforwp-tag-base-removal-link'];
52
- }
53
- /* $catagoryStatusChanges = get_option('AMP-category-base-removal-status');
54
- if($catagoryStatusChanges==$categoryBaseRewrite){
55
- update_option('AMP-category-base-removal-status',$categoryBaseRewrite);
56
- $wp_rerite->flush_rules( $hard );
57
- } */
58
- if($categoryBaseRewrite=='1'){
59
- add_action( 'created_category', 'amp_flush_rewrite_rules', 999 );
60
- add_action( 'edited_category', 'amp_flush_rewrite_rules', 999 );
61
- add_action( 'delete_category', 'amp_flush_rewrite_rules', 999 );
62
- add_filter( 'category_rewrite_rules', 'ampforwp_category_url_rewrite_rules');
63
- }elseif($categoryBaseRewrite=='0'){
64
- remove_action( 'created_category', 'amp_flush_rewrite_rules' , 999 );
65
- remove_action( 'edited_category', 'amp_flush_rewrite_rules' , 999 );
66
- remove_action( 'delete_category', 'amp_flush_rewrite_rules' , 999 );
67
- remove_filter( 'category_rewrite_rules', 'ampforwp_category_url_rewrite_rules');
68
-
69
- }
70
- if($tagBaseRewrite=='1'){
71
- add_action( 'created_post_tag', 'amp_flush_rewrite_rules' , 999 );
72
- add_action( 'edited_post_tag', 'amp_flush_rewrite_rules', 999 );
73
- add_action( 'delete_post_tag', 'amp_flush_rewrite_rules', 999 );
74
- add_filter( 'tag_rewrite_rules', 'ampforwp_tag_url_rewrite_rules' );
75
- }elseif($tagBaseRewrite=='0'){
76
-
77
- remove_action( 'created_post_tag', 'amp_flush_rewrite_rules' , 999 );
78
- remove_action( 'edited_post_tag', 'amp_flush_rewrite_rules', 999 );
79
- remove_action( 'delete_post_tag', 'amp_flush_rewrite_rules', 999 );
80
- remove_filter( 'tag_rewrite_rules', 'ampforwp_tag_url_rewrite_rules' );
81
- }
82
- }
83
-
84
-
85
-
86
-
87
- function amp_flush_rewrite_rules($hard=true){
88
- //flush_rewrite_rules();
89
- global $wp_rewrite;
90
- $wp_rewrite->flush_rules( $hard );
91
- }
92
-
93
- function ampforwp_category_url_rewrite_rules($rewrite){
94
- global $redux_builder_amp, $wp_rewrite;
95
- $categoryBaseRewrite = $redux_builder_amp['ampforwp-category-base-removel-link'];
96
- $categories = get_categories( array( 'hide_empty' => false ) );
97
- if(is_array( $categories ) && ! empty( $categories ) ) {
98
-
99
-
100
- foreach ( $categories as $category ) {
101
- $category_nicename = $category->slug;
102
- if ( $category->parent == $category->cat_ID ) {
103
- $category->parent = 0;
104
- } elseif ( 0 != $category->parent ) {
105
- $category_nicename = get_category_parents( $category->parent, false, '/', true ) . $category_nicename;
106
- }
107
- $category_nicename = trim($category_nicename);
108
-
109
- $rewrite['('.$category_nicename.')'.'/amp/?$'] = 'index.php?amp&category_name=$matches[1]';
110
- $rewrite['('.$category_nicename.')'.'/amp/' . $wp_rewrite->pagination_base . '/?([0-9]{1,})/?$'] = 'index.php?amp&category_name=$matches[1]&paged=$matches[2]';
111
-
112
- // Redirect support from Old Category Base
113
- $old_category_base = get_option( 'category_base' ) ? get_option( 'category_base' ) : 'category';
114
- $old_category_base = trim( $old_category_base, '/' );
115
- $rewrite[ $old_category_base . '/(.*)$' ] = 'index.php?category_redirect=$matches[1]';
116
-
117
- }
118
- }
119
- return $rewrite;
120
- }
121
-
122
-
123
- function ampforwp_tag_url_rewrite_rules($rewrite){
124
- $terms = get_terms( 'post_tag', array( 'hide_empty' => false ) );
125
- foreach ( $terms as $term ) {
126
- $term_nicename = trim($term->slug);
127
-
128
- $rewrite['('.$term_nicename.')'.'/amp/?$'] = 'index.php?amp&tag=$matches[1]';
129
- $rewrite['('.$term_nicename.')'.'/amp/page/?([0-9]{1,})/?$'] =
130
- 'index.php?amp&tag=$matches[1]&paged=$matches[2]';
131
-
132
- }
133
-
134
- return $rewrite;
135
  }
1
+ <?php
2
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
3
+
4
+ // check for plugin using plugin name
5
+ $oldPlugin = AMPFORWP_MAIN_PLUGIN_DIR.'amp-category-base-remover/amp-category-base-remover.php';
6
+ if ( is_plugin_active( $oldPlugin ) ) {
7
+ //plugin is activated
8
+ deactivate_plugins($oldPlugin);
9
+ add_action( 'admin_notices', 'plugin_catagory_base_removed_admin_notice__success' );
10
+ }
11
+
12
+ function plugin_catagory_base_removed_admin_notice__success(){
13
+ ?>
14
+ <div class="notice notice-success is-dismissible">
15
+ <p><?php _e( 'AMP Category Base URL Remover plugin has De-activated, <br> Category removal option is added in our core plugin <a href="#">Click here to view details</a>', 'amp-for-plugin' ); ?></p>
16
+ </div>
17
+ <?php
18
+ }
19
+
20
+
21
+ add_action( 'current_screen', 'this_screen_own' );
22
+ function this_screen_own(){
23
+ $current_screen = get_current_screen();
24
+ if( $current_screen ->id == "plugin-install" ) {
25
+
26
+ function amp_enqueue_function_dependancies($hook) {
27
+ wp_enqueue_script( 'AMPScriptDependanciesremove', plugins_url('dependencyScript.js', __FILE__), array('jquery') );
28
+ }
29
+ add_action( 'admin_enqueue_scripts', 'amp_enqueue_function_dependancies' );
30
+
31
+
32
+
33
+
34
+
35
+ }
36
+ }
37
+
38
+
39
+
40
+ add_filter( 'init', 'ampforwp_url_base_rewrite_rules', 100 );
41
+ function ampforwp_url_base_rewrite_rules(){
42
+ global $redux_builder_amp;
43
+ global $wp_rewrite;
44
+ $categoryBaseRewrite = 0;
45
+ $tagBaseRewrite = 0;
46
+
47
+ if(isset($redux_builder_amp['ampforwp-category-base-removel-link'])){
48
+ $categoryBaseRewrite = $redux_builder_amp['ampforwp-category-base-removel-link'];
49
+ }
50
+ if(isset($redux_builder_amp['ampforwp-tag-base-removal-link'])){
51
+ $tagBaseRewrite = $redux_builder_amp['ampforwp-tag-base-removal-link'];
52
+ }
53
+ /* $catagoryStatusChanges = get_option('AMP-category-base-removal-status');
54
+ if($catagoryStatusChanges==$categoryBaseRewrite){
55
+ update_option('AMP-category-base-removal-status',$categoryBaseRewrite);
56
+ $wp_rerite->flush_rules( $hard );
57
+ } */
58
+ if($categoryBaseRewrite=='1'){
59
+ add_action( 'created_category', 'amp_flush_rewrite_rules', 999 );
60
+ add_action( 'edited_category', 'amp_flush_rewrite_rules', 999 );
61
+ add_action( 'delete_category', 'amp_flush_rewrite_rules', 999 );
62
+ add_filter( 'category_rewrite_rules', 'ampforwp_category_url_rewrite_rules');
63
+ }elseif($categoryBaseRewrite=='0'){
64
+ remove_action( 'created_category', 'amp_flush_rewrite_rules' , 999 );
65
+ remove_action( 'edited_category', 'amp_flush_rewrite_rules' , 999 );
66
+ remove_action( 'delete_category', 'amp_flush_rewrite_rules' , 999 );
67
+ remove_filter( 'category_rewrite_rules', 'ampforwp_category_url_rewrite_rules');
68
+
69
+ }
70
+ if($tagBaseRewrite=='1'){
71
+ add_action( 'created_post_tag', 'amp_flush_rewrite_rules' , 999 );
72
+ add_action( 'edited_post_tag', 'amp_flush_rewrite_rules', 999 );
73
+ add_action( 'delete_post_tag', 'amp_flush_rewrite_rules', 999 );
74
+ add_filter( 'tag_rewrite_rules', 'ampforwp_tag_url_rewrite_rules' );
75
+ }elseif($tagBaseRewrite=='0'){
76
+
77
+ remove_action( 'created_post_tag', 'amp_flush_rewrite_rules' , 999 );
78
+ remove_action( 'edited_post_tag', 'amp_flush_rewrite_rules', 999 );
79
+ remove_action( 'delete_post_tag', 'amp_flush_rewrite_rules', 999 );
80
+ remove_filter( 'tag_rewrite_rules', 'ampforwp_tag_url_rewrite_rules' );
81
+ }
82
+ }
83
+
84
+
85
+
86
+
87
+ function amp_flush_rewrite_rules($hard=true){
88
+ //flush_rewrite_rules();
89
+ global $wp_rewrite;
90
+ $wp_rewrite->flush_rules( $hard );
91
+ }
92
+
93
+ function ampforwp_category_url_rewrite_rules($rewrite){
94
+ global $redux_builder_amp, $wp_rewrite;
95
+ $categoryBaseRewrite = $redux_builder_amp['ampforwp-category-base-removel-link'];
96
+ $categories = get_categories( array( 'hide_empty' => false ) );
97
+ if(is_array( $categories ) && ! empty( $categories ) ) {
98
+
99
+
100
+ foreach ( $categories as $category ) {
101
+ $category_nicename = $category->slug;
102
+ if ( $category->parent == $category->cat_ID ) {
103
+ $category->parent = 0;
104
+ } elseif ( 0 != $category->parent ) {
105
+ $category_nicename = get_category_parents( $category->parent, false, '/', true ) . $category_nicename;
106
+ }
107
+ $category_nicename = trim($category_nicename);
108
+
109
+ $rewrite['('.$category_nicename.')'.'/amp/?$'] = 'index.php?amp&category_name=$matches[1]';
110
+ $rewrite['('.$category_nicename.')'.'/amp/' . $wp_rewrite->pagination_base . '/?([0-9]{1,})/?$'] = 'index.php?amp&category_name=$matches[1]&paged=$matches[2]';
111
+
112
+ // Redirect support from Old Category Base
113
+ $old_category_base = get_option( 'category_base' ) ? get_option( 'category_base' ) : 'category';
114
+ $old_category_base = trim( $old_category_base, '/' );
115
+ $rewrite[ $old_category_base . '/(.*)$' ] = 'index.php?category_redirect=$matches[1]';
116
+
117
+ }
118
+ }
119
+ return $rewrite;
120
+ }
121
+
122
+
123
+ function ampforwp_tag_url_rewrite_rules($rewrite){
124
+ $terms = get_terms( 'post_tag', array( 'hide_empty' => false ) );
125
+ foreach ( $terms as $term ) {
126
+ $term_nicename = trim($term->slug);
127
+
128
+ $rewrite['('.$term_nicename.')'.'/amp/?$'] = 'index.php?amp&tag=$matches[1]';
129
+ $rewrite['('.$term_nicename.')'.'/amp/page/?([0-9]{1,})/?$'] =
130
+ 'index.php?amp&tag=$matches[1]&paged=$matches[2]';
131
+
132
+ }
133
+
134
+ return $rewrite;
135
  }
base_remover/dependencyScript.js CHANGED
@@ -1,21 +1,21 @@
1
- jQuery(document).ready(function($){
2
-
3
- var myElement = document.getElementById('plugin-filter');
4
- //if( myElement.innerHtml!=''){
5
- if(window.addEventListener) {
6
- // Normal browsers
7
- myElement.addEventListener('DOMSubtreeModified', contentChanged, false);
8
- } else
9
- if(window.attachEvent) {
10
- myElement.attachEvent('DOMSubtreeModified', contentChanged,false);
11
- }
12
- //}
13
-
14
-
15
- function contentChanged() {
16
- if($('.plugin-card-amp').length>0){
17
- $('.plugin-card-amp').find('.plugin-action-buttons').find('li:first a').attr("href","#").attr('onclick','alert(\'AMP is already bundled with AMPforWP. Please do not install this plugin with AMPforWP to avoid conflicts.\')');
18
- }
19
- }
20
- contentChanged();
21
  });
1
+ jQuery(document).ready(function($){
2
+
3
+ var myElement = document.getElementById('plugin-filter');
4
+ //if( myElement.innerHtml!=''){
5
+ if(window.addEventListener) {
6
+ // Normal browsers
7
+ myElement.addEventListener('DOMSubtreeModified', contentChanged, false);
8
+ } else
9
+ if(window.attachEvent) {
10
+ myElement.attachEvent('DOMSubtreeModified', contentChanged,false);
11
+ }
12
+ //}
13
+
14
+
15
+ function contentChanged() {
16
+ if($('.plugin-card-amp').length>0){
17
+ $('.plugin-card-amp').find('.plugin-action-buttons').find('li:first a').attr("href","#").attr('onclick','alert(\'AMP is already bundled with AMPforWP. Please do not install this plugin with AMPforWP to avoid conflicts.\')');
18
+ }
19
+ }
20
+ contentChanged();
21
  });
classes/class-ampforwp-youtube-embed.php CHANGED
@@ -1,133 +1,133 @@
1
- <?php require_once AMP__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php';
2
-
3
- // Much of this class is borrowed from Jetpack embeds
4
- class AMPforWP_YouTube_Embed_Handler extends AMP_Base_Embed_Handler {
5
- const SHORT_URL_HOST = 'youtu.be';
6
- // Only handling single videos. Playlists are handled elsewhere.
7
- const URL_PATTERN = '#https?://(?:www\.)?(?:youtube.com/(?:v/|e/|embed/|watch[/\#?])|youtu\.be/).*#i';
8
- const RATIO = 0.5625;
9
-
10
- protected $DEFAULT_WIDTH = 600;
11
- protected $DEFAULT_HEIGHT = 338;
12
-
13
- private static $script_slug = 'amp-youtube';
14
- private static $script_src = 'https://cdn.ampproject.org/v0/amp-youtube-0.1.js';
15
-
16
- function __construct( $args = array() ) {
17
- parent::__construct( $args );
18
-
19
- if ( isset( $this->args['content_max_width'] ) ) {
20
- $max_width = $this->args['content_max_width'];
21
- $this->args['width'] = $max_width;
22
- $this->args['height'] = round( $max_width * self::RATIO );
23
- }
24
- }
25
-
26
- function register_embed() {
27
- wp_embed_register_handler( 'amp-youtube', self::URL_PATTERN, array( $this, 'oembed' ), -1 );
28
- add_shortcode( 'youtube', array( $this, 'shortcode' ) );
29
- }
30
-
31
- public function unregister_embed() {
32
- wp_embed_unregister_handler( 'amp-youtube', -1 );
33
- remove_shortcode( 'youtube' );
34
- }
35
-
36
- public function get_scripts() {
37
- if ( ! $this->did_convert_elements ) {
38
- return array();
39
- }
40
-
41
- return array( self::$script_slug => self::$script_src );
42
- }
43
-
44
- public function shortcode( $attr ) {
45
- $url = false;
46
- $video_id = false;
47
- if ( isset( $attr[0] ) ) {
48
- $url = ltrim( $attr[0] , '=' );
49
- } elseif ( function_exists ( 'ampforwp_youtube_shortcode' ) ) {
50
- $url = ampforwp_youtube_shortcode( $attr );
51
- }
52
-
53
- if ( empty( $url ) ) {
54
- return '';
55
- }
56
-
57
- $video_id = $this->get_video_id_from_url( $url );
58
-
59
- return $this->render( array(
60
- 'url' => $url,
61
- 'video_id' => $video_id,
62
- ) );
63
- }
64
-
65
-
66
- public function oembed( $matches, $attr, $url, $rawattr ) {
67
- return $this->shortcode( array( $url ) );
68
- }
69
-
70
- public function render( $args ) {
71
- $args = wp_parse_args( $args, array(
72
- 'video_id' => false,
73
- ) );
74
-
75
- if ( empty( $args['video_id'] ) ) {
76
- return AMP_HTML_Utils::build_tag( 'a', array( 'href' => esc_url( $args['url'] ), 'class' => 'amp-wp-embed-fallback' ), esc_html( $args['url'] ) );
77
- }
78
-
79
- $this->did_convert_elements = true;
80
- // Return it with a filter for the modification purpose #1378
81
- return AMP_HTML_Utils::build_tag(
82
- 'amp-youtube',apply_filters('amp_youtube_params',
83
- array(
84
- 'data-videoid' => $args['video_id'],
85
- 'layout' => 'responsive',
86
- 'width' => $this->args['width'],
87
- 'height' => $this->args['height'],
88
- ) )
89
- );
90
- }
91
-
92
- private function get_video_id_from_url( $url ) {
93
- $video_id = false;
94
- $parsed_url = parse_url( $url );
95
- if(!isset($parsed_url['host'])){
96
- $parsed_url['host'] = '';
97
- }
98
- if ( self::SHORT_URL_HOST === substr( $parsed_url['host'], -strlen( self::SHORT_URL_HOST ) ) ) {
99
- // youtu.be/{id}
100
- $parts = explode( '/', $parsed_url['path'] );
101
- if ( ! empty( $parts ) ) {
102
- $video_id = $parts[1];
103
- }
104
- } else {
105
- // ?v={id} or ?list={id}
106
- parse_str( $parsed_url['query'], $query_args );
107
-
108
- if ( isset( $query_args['v'] ) ) {
109
- $video_id = $this->sanitize_v_arg( $query_args['v'] );
110
- }
111
- }
112
-
113
- if ( empty( $video_id ) ) {
114
- // /(v|e|embed)/{id}
115
- $parts = explode( '/', $parsed_url['path'] );
116
-
117
- if ( in_array( $parts[1], array( 'v', 'e', 'embed' ) ) ) {
118
- $video_id = $parts[2];
119
- }
120
- }
121
-
122
- return $video_id;
123
- }
124
-
125
- private function sanitize_v_arg( $value ) {
126
- // Deal with broken params like `?v=123?rel=0`
127
- if ( false !== strpos( $value, '?' ) ) {
128
- $value = strtok( $value, '?' );
129
- }
130
-
131
- return $value;
132
- }
133
  }
1
+ <?php require_once AMP__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php';
2
+
3
+ // Much of this class is borrowed from Jetpack embeds
4
+ class AMPforWP_YouTube_Embed_Handler extends AMP_Base_Embed_Handler {
5
+ const SHORT_URL_HOST = 'youtu.be';
6
+ // Only handling single videos. Playlists are handled elsewhere.
7
+ const URL_PATTERN = '#https?://(?:www\.)?(?:youtube.com/(?:v/|e/|embed/|watch[/\#?])|youtu\.be/).*#i';
8
+ const RATIO = 0.5625;
9
+
10
+ protected $DEFAULT_WIDTH = 600;
11
+ protected $DEFAULT_HEIGHT = 338;
12
+
13
+ private static $script_slug = 'amp-youtube';
14
+ private static $script_src = 'https://cdn.ampproject.org/v0/amp-youtube-0.1.js';
15
+
16
+ function __construct( $args = array() ) {
17
+ parent::__construct( $args );
18
+
19
+ if ( isset( $this->args['content_max_width'] ) ) {
20
+ $max_width = $this->args['content_max_width'];
21
+ $this->args['width'] = $max_width;
22
+ $this->args['height'] = round( $max_width * self::RATIO );
23
+ }
24
+ }
25
+
26
+ function register_embed() {
27
+ wp_embed_register_handler( 'amp-youtube', self::URL_PATTERN, array( $this, 'oembed' ), -1 );
28
+ add_shortcode( 'youtube', array( $this, 'shortcode' ) );
29
+ }
30
+
31
+ public function unregister_embed() {
32
+ wp_embed_unregister_handler( 'amp-youtube', -1 );
33
+ remove_shortcode( 'youtube' );
34
+ }
35
+
36
+ public function get_scripts() {
37
+ if ( ! $this->did_convert_elements ) {
38
+ return array();
39
+ }
40
+
41
+ return array( self::$script_slug => self::$script_src );
42
+ }
43
+
44
+ public function shortcode( $attr ) {
45
+ $url = false;
46
+ $video_id = false;
47
+ if ( isset( $attr[0] ) ) {
48
+ $url = ltrim( $attr[0] , '=' );
49
+ } elseif ( function_exists ( 'ampforwp_youtube_shortcode' ) ) {
50
+ $url = ampforwp_youtube_shortcode( $attr );
51
+ }
52
+
53
+ if ( empty( $url ) ) {
54
+ return '';
55
+ }
56
+
57
+ $video_id = $this->get_video_id_from_url( $url );
58
+
59
+ return $this->render( array(
60
+ 'url' => $url,
61
+ 'video_id' => $video_id,
62
+ ) );
63
+ }
64
+
65
+
66
+ public function oembed( $matches, $attr, $url, $rawattr ) {
67
+ return $this->shortcode( array( $url ) );
68
+ }
69
+
70
+ public function render( $args ) {
71
+ $args = wp_parse_args( $args, array(
72
+ 'video_id' => false,
73
+ ) );
74
+
75
+ if ( empty( $args['video_id'] ) ) {
76
+ return AMP_HTML_Utils::build_tag( 'a', array( 'href' => esc_url( $args['url'] ), 'class' => 'amp-wp-embed-fallback' ), esc_html( $args['url'] ) );
77
+ }
78
+
79
+ $this->did_convert_elements = true;
80
+ // Return it with a filter for the modification purpose #1378
81
+ return AMP_HTML_Utils::build_tag(
82
+ 'amp-youtube',apply_filters('amp_youtube_params',
83
+ array(
84
+ 'data-videoid' => $args['video_id'],
85
+ 'layout' => 'responsive',
86
+ 'width' => $this->args['width'],
87
+ 'height' => $this->args['height'],
88
+ ) )
89
+ );
90
+ }
91
+
92
+ private function get_video_id_from_url( $url ) {
93
+ $video_id = false;
94
+ $parsed_url = parse_url( $url );
95
+ if(!isset($parsed_url['host'])){
96
+ $parsed_url['host'] = '';
97
+ }
98
+ if ( self::SHORT_URL_HOST === substr( $parsed_url['host'], -strlen( self::SHORT_URL_HOST ) ) ) {
99
+ // youtu.be/{id}
100
+ $parts = explode( '/', $parsed_url['path'] );
101
+ if ( ! empty( $parts ) ) {
102
+ $video_id = $parts[1];
103
+ }
104
+ } else {
105
+ // ?v={id} or ?list={id}
106
+ parse_str( $parsed_url['query'], $query_args );
107
+
108
+ if ( isset( $query_args['v'] ) ) {
109
+ $video_id = $this->sanitize_v_arg( $query_args['v'] );
110
+ }
111
+ }
112
+
113
+ if ( empty( $video_id ) ) {
114
+ // /(v|e|embed)/{id}
115
+ $parts = explode( '/', $parsed_url['path'] );
116
+
117
+ if ( in_array( $parts[1], array( 'v', 'e', 'embed' ) ) ) {
118
+ $video_id = $parts[2];
119
+ }
120
+ }
121
+
122
+ return $video_id;
123
+ }
124
+
125
+ private function sanitize_v_arg( $value ) {
126
+ // Deal with broken params like `?v=123?rel=0`
127
+ if ( false !== strpos( $value, '?' ) ) {
128
+ $value = strtok( $value, '?' );
129
+ }
130
+
131
+ return $value;
132
+ }
133
  }
classes/class-init.php CHANGED
@@ -1,11 +1,11 @@
1
- <?php if ( ! class_exists( 'Ampforwp_Loader', false ) ) {
2
- class Ampforwp_Loader {
3
- public function __construct() {
4
- $this->load_required_files();
5
- }
6
- public function load_required_files() {
7
- require AMPFORWP_PLUGIN_DIR . '/templates/features.php';
8
- require AMPFORWP_PLUGIN_DIR . '/templates/instant-articles/instant-article-sanitizer.php';
9
- }
10
- }
11
  } ?>
1
+ <?php if ( ! class_exists( 'Ampforwp_Loader', false ) ) {
2
+ class Ampforwp_Loader {
3
+ public function __construct() {
4
+ $this->load_required_files();
5
+ }
6
+ public function load_required_files() {
7
+ require AMPFORWP_PLUGIN_DIR . '/templates/features.php';
8
+ require AMPFORWP_PLUGIN_DIR . '/templates/instant-articles/instant-article-sanitizer.php';
9
+ }
10
+ }
11
  } ?>
components/author-box/author-box.php CHANGED
@@ -1,83 +1,83 @@
1
- <?php
2
- function ampforwp_framework_get_author_box($args=array()){
3
- global $post, $redux_builder_amp;
4
- $post_author = get_userdata($post->post_author);
5
- if(! is_array($args) ){
6
- $args = array();
7
- }
8
-
9
- $avatar = false; //To show author Avater
10
- $avatar_size = 40;
11
- $author_description = false;
12
- $class = $author_prefix = $author_wrapper_class = '';
13
- $show_date = false;
14
- $show_time = false;
15
- $author_link = get_author_posts_url($post_author->ID);
16
-
17
- if(isset($args['avatar'])){
18
- $avatar = $args['avatar'];
19
- }
20
- if(isset($args['avatar_size'])){
21
- $avatar_size = $args['avatar_size'];
22
- }
23
- if(isset($args['class'])){
24
- $class = $args['class'];
25
- }
26
- if(isset($args['author_description'])){
27
- $author_description = $args['author_description'];
28
- }
29
-
30
-
31
- if(isset( $args['author_prefix'])){
32
- $author_prefix = $args['author_prefix'];
33
- }
34
- //$author_prefix = ampforwp_translation($redux_builder_amp['amp-translator-by-text'] , $author_prefix );
35
-
36
- if(isset( $args['author_link'])){
37
- $author_link = $args['author_link'];
38
- }
39
- if(isset( $args['author_wrapper_class'])){
40
- $author_wrapper_class = $args['author_wrapper_class'];
41
- }
42
-
43
- if(isset($args['author_image_wrapper'])){
44
- $author_image_wrapper = $args['author_image_wrapper'];
45
- }
46
- if(isset($args['show_date'])){
47
- $show_date = $args['show_date'];
48
- }
49
- if(isset($args['show_time'])){
50
- $show_time = $args['show_time'];
51
- }
52
-
53
- ?>
54
- <div class="amp-author <?php echo $class; ?>">
55
- <?php if($avatar){
56
- $author_avatar_url = get_avatar_url( $post_author->ID, array( 'size' => $avatar_size ) );
57
- ?>
58
- <div class="amp-author-image <?php echo $author_image_wrapper; ?>">
59
- <amp-img src="<?php echo $author_avatar_url; ?>" width="<?php echo $avatar_size; ?>" height="<?php echo $avatar_size; ?>" layout="fixed"></amp-img>
60
- </div>
61
- <?php } ?>
62
- <?php echo '<div class="author-details '. $author_wrapper_class .'">
63
- <span class="author-name">'
64
- .$author_prefix . ' <a href="'. ampforwp_url_controller($author_link).'"> ' .esc_html( $post_author->display_name ).'</a>
65
- </span>';
66
-
67
- //to show date and time
68
- if($show_date || $show_time){
69
- echo '<span class="posted-time"> ';
70
- if($show_date){
71
- echo esc_html( get_the_date() ) . ' ';
72
- }
73
- if($show_time){
74
- echo esc_html( get_the_time());
75
- }
76
- echo '</span>';
77
- }
78
- if($author_description){
79
- echo "<p>".$post_author->description."</p>";
80
- } ?>
81
- </div>
82
- </div>
83
  <?php }
1
+ <?php
2
+ function ampforwp_framework_get_author_box($args=array()){
3
+ global $post, $redux_builder_amp;
4
+ $post_author = get_userdata($post->post_author);
5
+ if(! is_array($args) ){
6
+ $args = array();
7
+ }
8
+
9
+ $avatar = false; //To show author Avater
10
+ $avatar_size = 40;
11
+ $author_description = false;
12
+ $class = $author_prefix = $author_wrapper_class = '';
13
+ $show_date = false;
14
+ $show_time = false;
15
+ $author_link = get_author_posts_url($post_author->ID);
16
+
17
+ if(isset($args['avatar'])){
18
+ $avatar = $args['avatar'];
19
+ }
20
+ if(isset($args['avatar_size'])){
21
+ $avatar_size = $args['avatar_size'];
22
+ }
23
+ if(isset($args['class'])){
24
+ $class = $args['class'];
25
+ }
26
+ if(isset($args['author_description'])){
27
+ $author_description = $args['author_description'];
28
+ }
29
+
30
+
31
+ if(isset( $args['author_prefix'])){
32
+ $author_prefix = $args['author_prefix'];
33
+ }
34
+ //$author_prefix = ampforwp_translation($redux_builder_amp['amp-translator-by-text'] , $author_prefix );
35
+
36
+ if(isset( $args['author_link'])){
37
+ $author_link = $args['author_link'];
38
+ }
39
+ if(isset( $args['author_wrapper_class'])){
40
+ $author_wrapper_class = $args['author_wrapper_class'];
41
+ }
42
+
43
+ if(isset($args['author_image_wrapper'])){
44
+ $author_image_wrapper = $args['author_image_wrapper'];
45
+ }
46
+ if(isset($args['show_date'])){
47
+ $show_date = $args['show_date'];
48
+ }
49
+ if(isset($args['show_time'])){
50
+ $show_time = $args['show_time'];
51
+ }
52
+
53
+ ?>
54
+ <div class="amp-author <?php echo $class; ?>">
55
+ <?php if($avatar){
56
+ $author_avatar_url = get_avatar_url( $post_author->ID, array( 'size' => $avatar_size ) );
57
+ ?>
58
+ <div class="amp-author-image <?php echo $author_image_wrapper; ?>">
59
+ <amp-img src="<?php echo $author_avatar_url; ?>" width="<?php echo $avatar_size; ?>" height="<?php echo $avatar_size; ?>" layout="fixed"></amp-img>
60
+ </div>
61
+ <?php } ?>
62
+ <?php echo '<div class="author-details '. $author_wrapper_class .'">
63
+ <span class="author-name">'
64
+ .$author_prefix . ' <a href="'. ampforwp_url_controller($author_link).'"> ' .esc_html( $post_author->display_name ).'</a>
65
+ </span>';
66
+
67
+ //to show date and time
68
+ if($show_date || $show_time){
69
+ echo '<span class="posted-time"> ';
70
+ if($show_date){
71
+ echo esc_html( get_the_date() ) . ' ';
72
+ }
73
+ if($show_time){
74
+ echo esc_html( get_the_time());
75
+ }
76
+ echo '</span>';
77
+ }
78
+ if($author_description){
79
+ echo "<p>".$post_author->description."</p>";
80
+ } ?>
81
+ </div>
82
+ </div>
83
  <?php }
components/call-now/call-now.php CHANGED
@@ -1,16 +1,16 @@
1
- <?php
2
- add_action('amp_call_button','amp_call_button_html_output');
3
- function amp_call_button_html_output(){
4
- global $redux_builder_amp;
5
- if ( $redux_builder_amp['ampforwp-callnow-button'] ) { ?>
6
- <div class="amp-phone">
7
- <a href="tel:<?php echo $redux_builder_amp['enable-amp-call-numberfield']; ?>"></a>
8
- </div> <?php
9
- }
10
- }
11
- add_action('amp_post_template_css','amp_callnow_styles',11);
12
- function amp_callnow_styles(){
13
- global $redux_builder_amp; if ($redux_builder_amp['ampforwp-callnow-button']) { ?>
14
- .amp-phone{ position:relative }
15
- .amp-phone a:before { content: ""; display:inline-block; width: 4px; height: 8px; border-width: 6px 0 6px 3px; border-style: solid; border-color:<?php echo $redux_builder_amp['amp-opt-color-rgba-colorscheme-call']['color']; ?>; background: transparent; transform: rotate(-30deg); box-sizing: initial; border-top-left-radius: 3px 5px; border-bottom-left-radius: 3px 5px; }
16
  <?php }} ?>
1
+ <?php
2
+ add_action('amp_call_button','amp_call_button_html_output');
3
+ function amp_call_button_html_output(){
4
+ global $redux_builder_amp;
5
+ if ( $redux_builder_amp['ampforwp-callnow-button'] ) { ?>
6
+ <div class="amp-phone">
7
+ <a href="tel:<?php echo $redux_builder_amp['enable-amp-call-numberfield']; ?>"></a>
8
+ </div> <?php
9
+ }
10
+ }
11
+ add_action('amp_post_template_css','amp_callnow_styles',11);
12
+ function amp_callnow_styles(){
13
+ global $redux_builder_amp; if ($redux_builder_amp['ampforwp-callnow-button']) { ?>
14
+ .amp-phone{ position:relative }
15
+ .amp-phone a:before { content: ""; display:inline-block; width: 4px; height: 8px; border-width: 6px 0 6px 3px; border-style: solid; border-color:<?php echo $redux_builder_amp['amp-opt-color-rgba-colorscheme-call']['color']; ?>; background: transparent; transform: rotate(-30deg); box-sizing: initial; border-top-left-radius: 3px 5px; border-bottom-left-radius: 3px 5px; }
16
  <?php }} ?>
components/categories-tags/categories-tags.php CHANGED
@@ -1,45 +1,45 @@
1
- <?php
2
- /*
3
- TODO: 1: Connect with options panel(archive support and translational panel)
4
- 2: Do we have to change the classes names as well?
5
- */
6
- global $post;
7
- function ampforwp_framework_get_categories_list(){
8
- global $post;
9
- $ampforwp_categories = get_the_terms( $post->ID, 'category' );
10
- if ( $ampforwp_categories ) : ?>
11
- <div class="amp-category">
12
- <span>Categories:</span>
13
- <?php foreach ($ampforwp_categories as $cat ) {
14
- //if($redux_builder_amp['ampforwp-archive-support']){
15
- echo ('<span class="amp-cat-'.$cat->term_id.'"><a href="'. ampforwp_url_controller( get_category_link( $cat->term_id ) ) .'" > '. $cat->name .'</a></span>');//#934
16
- //} else {
17
- // echo '<span>'. $cat->name .'</span>';
18
- //}
19
- } ?>
20
- </div>
21
- <?php endif;
22
- }
23
- function ampforwp_framework_get_tags_list(){
24
- global $post;
25
- $ampforwp_tags= get_the_terms( $post->ID, 'post_tag' );
26
- if ( $ampforwp_tags && ! is_wp_error( $ampforwp_tags ) ) :?>
27
- <div class="amp-tags">
28
- <?php /* if($redux_builder_amp['amp-rtl-select-option']==0) {
29
- global $redux_builder_amp; printf( ampforwp_translation($redux_builder_amp['amp-translator-tags-text'] .' ', 'accelerated-mobile-pages' ));
30
- }*/
31
- ?>
32
- <span>Tags:</span>
33
- <?php foreach ($ampforwp_tags as $tag) {
34
- //if($redux_builder_amp['ampforwp-archive-support']){
35
- echo ('<span class="amp-tag-'.$tag->term_id.'"><a href="'. ampforwp_url_controller( get_tag_link( $tag->term_id ) ).'" >'.$tag->name .'</a></span>');//#934
36
- //} else {
37
- // echo ('<span>'.$tag->name.'</span>');
38
- //}
39
- }
40
- /* if($redux_builder_amp['amp-rtl-select-option']) {
41
- global $redux_builder_amp; printf( ampforwp_translation($redux_builder_amp['amp-translator-tags-text'] .' ', 'accelerated-mobile-pages' ));
42
- }*/ ?>
43
- </div>
44
- <?php endif;
45
  }
1
+ <?php
2
+ /*
3
+ TODO: 1: Connect with options panel(archive support and translational panel)
4
+ 2: Do we have to change the classes names as well?
5
+ */
6
+ global $post;
7
+ function ampforwp_framework_get_categories_list(){
8
+ global $post;
9
+ $ampforwp_categories = get_the_terms( $post->ID, 'category' );
10
+ if ( $ampforwp_categories ) : ?>
11
+ <div class="amp-category">
12
+ <span>Categories:</span>
13
+ <?php foreach ($ampforwp_categories as $cat ) {
14
+ //if($redux_builder_amp['ampforwp-archive-support']){
15
+ echo ('<span class="amp-cat-'.$cat->term_id.'"><a href="'. ampforwp_url_controller( get_category_link( $cat->term_id ) ) .'" > '. $cat->name .'</a></span>');//#934
16
+ //} else {
17
+ // echo '<span>'. $cat->name .'</span>';
18
+ //}
19
+ } ?>
20
+ </div>
21
+ <?php endif;
22
+ }
23
+ function ampforwp_framework_get_tags_list(){
24
+ global $post;
25
+ $ampforwp_tags= get_the_terms( $post->ID, 'post_tag' );
26
+ if ( $ampforwp_tags && ! is_wp_error( $ampforwp_tags ) ) :?>
27
+ <div class="amp-tags">
28
+ <?php /* if($redux_builder_amp['amp-rtl-select-option']==0) {
29
+ global $redux_builder_amp; printf( ampforwp_translation($redux_builder_amp['amp-translator-tags-text'] .' ', 'accelerated-mobile-pages' ));
30
+ }*/
31
+ ?>
32
+ <span>Tags:</span>
33
+ <?php foreach ($ampforwp_tags as $tag) {
34
+ //if($redux_builder_amp['ampforwp-archive-support']){
35
+ echo ('<span class="amp-tag-'.$tag->term_id.'"><a href="'. ampforwp_url_controller( get_tag_link( $tag->term_id ) ).'" >'.$tag->name .'</a></span>');//#934
36
+ //} else {
37
+ // echo ('<span>'.$tag->name.'</span>');
38
+ //}
39
+ }
40
+ /* if($redux_builder_amp['amp-rtl-select-option']) {
41
+ global $redux_builder_amp; printf( ampforwp_translation($redux_builder_amp['amp-translator-tags-text'] .' ', 'accelerated-mobile-pages' ));
42
+ }*/ ?>
43
+ </div>
44
+ <?php endif;
45
  }
components/comments/comments.php CHANGED
@@ -1,181 +1,181 @@
1
- <?php
2
- function ampforwp_framework_get_comments(){
3
- global $redux_builder_amp;
4
- if ( !comments_open() ){
5
- return;
6
- }
7
- if ( $redux_builder_amp['ampforwp-facebook-comments-support'] ) {
8
- echo ampforwp_framework_get_facebook_comments();
9
- }
10
- elseif ( $redux_builder_amp['ampforwp-disqus-comments-support'] ) {
11
- ampforwp_framework_get_disqus_comments();
12
- }
13
- else {
14
- if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'] || $redux_builder_amp['ampforwp-facebook-comments-support']) {
15
- return;
16
- }
17
- ?>
18
- <div class="amp-comments">
19
- <?php
20
- global $redux_builder_amp;
21
- // Gather comments for a specific page/post
22
- $postID = get_the_ID();
23
- $comments = get_comments(array(
24
- 'post_id' => $postID,
25
- 'status' => 'approve' //Change this to the type of comments to be displayed
26
- ));
27
- if ( $comments ) { ?>
28
- <div class="amp-comments-wrapper">
29
- <h3><?php global $redux_builder_amp; echo ampforwp_translation($redux_builder_amp['amp-translator-view-comments-text'], 'View Comments' )?></h3>
30
- <ul>
31
- <?php
32
- // Display the list of comments
33
- function ampforwp_custom_translated_comment($comment, $args, $depth){
34
- $GLOBALS['comment'] = $comment;
35
- global $redux_builder_amp;
36
- $comment_author_img_url = "";
37
- $comment_author_img_url = ampforwp_get_comments_gravatar( $comment );
38
-
39
- ?>
40
- <li id="li-comment-<?php comment_ID() ?>"
41
- <?php comment_class(); ?> >
42
- <article id="comment-<?php comment_ID(); ?>" class="comment-body">
43
- <footer class="comment-meta">
44
- <?php if($comment_author_img_url){ ?>
45
- <amp-img src="<?php echo esc_url($comment_author_img_url); ?>" width="40" height="40" layout="fixed" class="comment-author-img"></amp-img>
46
- <?php } ?>
47
- <div class="comment-author vcard">
48
- <?php
49
- printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
50
- </div>
51
- <div class="comment-metadata">
52
- <a href="<?php echo htmlspecialchars( trailingslashit( get_comment_link( $comment->comment_ID ) ) ) ?>">
53
- <?php printf( ampforwp_translation( ('%1$s '. ampforwp_translation($redux_builder_amp['amp-translator-at-text'],'at').' %2$s'), '%1$s at %2$s') , get_comment_date(), get_comment_time())?>
54
- </a>
55
- <?php edit_comment_link( ampforwp_translation( $redux_builder_amp['amp-translator-Edit-text'], 'Edit' ) ) ?>
56
- </div>
57
- </footer>
58
- <div class="comment-content">
59
- <?php
60
- $comment_content = get_comment_text();
61
- $comment_content = wpautop( $comment_content );
62
- $sanitizer = new AMPFORWP_Content( $comment_content, array(), apply_filters( 'ampforwp_content_sanitizers', array(
63
- 'AMP_Img_Sanitizer' => array(),
64
- 'AMP_Video_Sanitizer' => array(),
65
- 'AMP_Style_Sanitizer' => array() ) ) );
66
- $sanitized_comment_content = $sanitizer->get_amp_content();
67
- echo make_clickable( $sanitized_comment_content ); ?>
68
- </div>
69
- </article>
70
- </li>
71
- <?php }
72
- wp_list_comments( array(
73
- //Allow comment pagination
74
- 'per_page' => AMPFORWP_COMMENTS_PER_PAGE ,
75
- 'style' => 'li',
76
- 'type' => 'comment',
77
- 'max_depth' => 5,
78
- 'avatar_size' => 0,
79
- 'callback' => 'ampforwp_custom_translated_comment',
80
- 'reverse_top_level' => true //Show the latest comments at the top of the list
81
- ), $comments); ?>
82
- </ul>
83
- </div>
84
- <?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
85
- if( ! is_plugin_active( 'amp-comments/amp-comments.php' ) ) { ?>
86
- <div class="amp-comment-button">
87
- <a href="<?php echo ampforwp_comment_button_url(); ?>" rel="nofollow"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ); ?></a>
88
- </div>
89
- <?php } ?>
90
- <?php
91
- } else {
92
- global $redux_builder_amp ;
93
- if (!comments_open()) {
94
- return;
95
- } ?>
96
- <?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
97
- if( ! is_plugin_active( 'amp-comments/amp-comments.php' ) ) { ?>
98
- <div class="amp-comment-button">
99
- <a href="<?php echo ampforwp_comment_button_url(); ?>" rel="nofollow"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ); ?></a>
100
- </div>
101
- <?php } ?>
102
- <?php } ?>
103
- </div>
104
- <?php do_action('ampforwp_after_comment_hook');
105
-
106
- }
107
-
108
- }
109
-
110
- //Facebook Comments
111
- function ampforwp_framework_get_facebook_comments(){
112
- global $redux_builder_amp;
113
- $facebook_comments_markup = '';
114
- if ( !comments_open() ){
115
- return;
116
- }
117
- if ( $redux_builder_amp['ampforwp-facebook-comments-support'] ) {
118
- $facebook_comments_markup = '<section class="amp-facebook-comments">';
119
- $facebook_comments_markup .= '<amp-facebook-comments width=486 height=357
120
- layout="responsive" data-numposts=';
121
- $facebook_comments_markup .= '"'. $redux_builder_amp['ampforwp-number-of-fb-no-of-comments']. '" ';
122
-
123
- $facebook_comments_markup .= 'data-href=" ' . get_permalink() . ' "';
124
- $facebook_comments_markup .= '></amp-facebook-comments>';
125
-
126
- return $facebook_comments_markup;
127
- }
128
- }
129
-
130
- //Disqus Comments
131
- function ampforwp_framework_get_disqus_comments(){
132
- global $redux_builder_amp;
133
- if ( !comments_open() ){
134
- return;
135
- }//931
136
- if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
137
- global $post; $post_slug=$post->post_name;
138
-
139
- $disqus_script_host_url = "https://ampforwp.appspot.com/?api=". AMPFORWP_DISQUS_URL;
140
-
141
- if( $redux_builder_amp['ampforwp-disqus-host-position'] == 0 ) {
142
- $disqus_script_host_url = esc_url( $redux_builder_amp['ampforwp-disqus-host-file'] );
143
- }
144
-
145
- $disqus_url = $disqus_script_host_url.'?disqus_title='.$post_slug.'&url='.get_permalink().'&disqus_name='. esc_url( $redux_builder_amp['ampforwp-disqus-comments-name'] ) ."/embed.js" ;
146
- ?>
147
- <section class="amp-disqus-comments">
148
- <amp-iframe
149
- height=200
150
- width=300
151
- layout="responsive"
152
- sandbox="allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"
153
- frameborder="0"
154
- src="<?php echo $disqus_url ?>" >
155
- <div overflow tabindex="0" role="button" aria-label="Read more"><?php echo __('Disqus Comments Loading...','accelerated-mobile-pages') ?></div>
156
- </amp-iframe>
157
- </section>
158
- <?php
159
- }
160
- }
161
-
162
- // Comments Scripts
163
- add_filter( 'amp_post_template_data', 'ampforwp_framework_comments_scripts' );
164
- function ampforwp_framework_comments_scripts( $data ) {
165
-
166
- $facebook_comments_check = ampforwp_framework_get_facebook_comments();
167
- global $redux_builder_amp;
168
- if ( $facebook_comments_check && $redux_builder_amp['ampforwp-facebook-comments-support'] && is_singular() ) {
169
- if ( empty( $data['amp_component_scripts']['amp-facebook-comments'] ) ) {
170
- $data['amp_component_scripts']['amp-facebook-comments'] = 'https://cdn.ampproject.org/v0/amp-facebook-comments-0.1.js';
171
- }
172
- }
173
- if ( $redux_builder_amp['ampforwp-disqus-comments-support'] && is_singular() && comments_open() ) {
174
- if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
175
- if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
176
- $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
177
- }
178
- }
179
- }
180
- return $data;
181
  }
1
+ <?php
2
+ function ampforwp_framework_get_comments(){
3
+ global $redux_builder_amp;
4
+ if ( !comments_open() ){
5
+ return;
6
+ }
7
+ if ( $redux_builder_amp['ampforwp-facebook-comments-support'] ) {
8
+ echo ampforwp_framework_get_facebook_comments();
9
+ }
10
+ elseif ( $redux_builder_amp['ampforwp-disqus-comments-support'] ) {
11
+ ampforwp_framework_get_disqus_comments();
12
+ }
13
+ else {
14
+ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'] || $redux_builder_amp['ampforwp-facebook-comments-support']) {
15
+ return;
16
+ }
17
+ ?>
18
+ <div class="amp-comments">
19
+ <?php
20
+ global $redux_builder_amp;
21
+ // Gather comments for a specific page/post
22
+ $postID = get_the_ID();
23
+ $comments = get_comments(array(
24
+ 'post_id' => $postID,
25
+ 'status' => 'approve' //Change this to the type of comments to be displayed
26
+ ));
27
+ if ( $comments ) { ?>
28
+ <div class="amp-comments-wrapper">
29
+ <h3><?php global $redux_builder_amp; echo ampforwp_translation($redux_builder_amp['amp-translator-view-comments-text'], 'View Comments' )?></h3>
30
+ <ul>
31
+ <?php
32
+ // Display the list of comments
33
+ function ampforwp_custom_translated_comment($comment, $args, $depth){
34
+ $GLOBALS['comment'] = $comment;
35
+ global $redux_builder_amp;
36
+ $comment_author_img_url = "";
37
+ $comment_author_img_url = ampforwp_get_comments_gravatar( $comment );
38
+
39
+ ?>
40
+ <li id="li-comment-<?php comment_ID() ?>"
41
+ <?php comment_class(); ?> >
42
+ <article id="comment-<?php comment_ID(); ?>" class="comment-body">
43
+ <footer class="comment-meta">
44
+ <?php if($comment_author_img_url){ ?>
45
+ <amp-img src="<?php echo esc_url($comment_author_img_url); ?>" width="40" height="40" layout="fixed" class="comment-author-img"></amp-img>
46
+ <?php } ?>
47
+ <div class="comment-author vcard">
48
+ <?php
49
+ printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
50
+ </div>
51
+ <div class="comment-metadata">
52
+ <a href="<?php echo htmlspecialchars( trailingslashit( get_comment_link( $comment->comment_ID ) ) ) ?>">
53
+ <?php printf( ampforwp_translation( ('%1$s '. ampforwp_translation($redux_builder_amp['amp-translator-at-text'],'at').' %2$s'), '%1$s at %2$s') , get_comment_date(), get_comment_time())?>
54
+ </a>
55
+ <?php edit_comment_link( ampforwp_translation( $redux_builder_amp['amp-translator-Edit-text'], 'Edit' ) ) ?>
56
+ </div>
57
+ </footer>
58
+ <div class="comment-content">
59
+ <?php
60
+ $comment_content = get_comment_text();
61
+ $comment_content = wpautop( $comment_content );
62
+ $sanitizer = new AMPFORWP_Content( $comment_content, array(), apply_filters( 'ampforwp_content_sanitizers', array(
63
+ 'AMP_Img_Sanitizer' => array(),
64
+ 'AMP_Video_Sanitizer' => array(),
65
+ 'AMP_Style_Sanitizer' => array() ) ) );
66
+ $sanitized_comment_content = $sanitizer->get_amp_content();
67
+ echo make_clickable( $sanitized_comment_content ); ?>
68
+ </div>
69
+ </article>
70
+ </li>
71
+ <?php }
72
+ wp_list_comments( array(
73
+ //Allow comment pagination
74
+ 'per_page' => AMPFORWP_COMMENTS_PER_PAGE ,
75
+ 'style' => 'li',
76
+ 'type' => 'comment',
77
+ 'max_depth' => 5,
78
+ 'avatar_size' => 0,
79
+ 'callback' => 'ampforwp_custom_translated_comment',
80
+ 'reverse_top_level' => true //Show the latest comments at the top of the list
81
+ ), $comments); ?>
82
+ </ul>
83
+ </div>
84
+ <?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
85
+ if( ! is_plugin_active( 'amp-comments/amp-comments.php' ) ) { ?>
86
+ <div class="amp-comment-button">
87
+ <a href="<?php echo ampforwp_comment_button_url(); ?>" rel="nofollow"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ); ?></a>
88
+ </div>
89
+ <?php } ?>
90
+ <?php
91
+ } else {
92
+ global $redux_builder_amp ;
93
+ if (!comments_open()) {
94
+ return;
95
+ } ?>
96
+ <?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
97
+ if( ! is_plugin_active( 'amp-comments/amp-comments.php' ) ) { ?>
98
+ <div class="amp-comment-button">
99
+ <a href="<?php echo ampforwp_comment_button_url(); ?>" rel="nofollow"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ); ?></a>
100
+ </div>
101
+ <?php } ?>
102
+ <?php } ?>
103
+ </div>
104
+ <?php do_action('ampforwp_after_comment_hook');
105
+
106
+ }
107
+
108
+ }
109
+
110
+ //Facebook Comments
111
+ function ampforwp_framework_get_facebook_comments(){
112
+ global $redux_builder_amp;
113
+ $facebook_comments_markup = '';
114
+ if ( !comments_open() ){
115
+ return;
116
+ }
117
+ if ( $redux_builder_amp['ampforwp-facebook-comments-support'] ) {
118
+ $facebook_comments_markup = '<section class="amp-facebook-comments">';
119
+ $facebook_comments_markup .= '<amp-facebook-comments width=486 height=357
120
+ layout="responsive" data-numposts=';
121
+ $facebook_comments_markup .= '"'. $redux_builder_amp['ampforwp-number-of-fb-no-of-comments']. '" ';
122
+
123
+ $facebook_comments_markup .= 'data-href=" ' . get_permalink() . ' "';
124
+ $facebook_comments_markup .= '></amp-facebook-comments>';
125
+
126
+ return $facebook_comments_markup;
127
+ }
128
+ }
129
+
130
+ //Disqus Comments
131
+ function ampforwp_framework_get_disqus_comments(){
132
+ global $redux_builder_amp;
133
+ if ( !comments_open() ){
134
+ return;
135
+ }//931
136
+ if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
137
+ global $post; $post_slug=$post->post_name;
138
+
139
+ $disqus_script_host_url = "https://ampforwp.appspot.com/?api=". AMPFORWP_DISQUS_URL;
140
+
141
+ if( $redux_builder_amp['ampforwp-disqus-host-position'] == 0 ) {
142
+ $disqus_script_host_url = esc_url( $redux_builder_amp['ampforwp-disqus-host-file'] );
143
+ }
144
+
145
+ $disqus_url = $disqus_script_host_url.'?disqus_title='.$post_slug.'&url='.get_permalink().'&disqus_name='. esc_url( $redux_builder_amp['ampforwp-disqus-comments-name'] ) ."/embed.js" ;
146
+ ?>
147
+ <section class="amp-disqus-comments">
148
+ <amp-iframe
149
+ height=200
150
+ width=300
151
+ layout="responsive"
152
+ sandbox="allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"
153
+ frameborder="0"
154
+ src="<?php echo $disqus_url ?>" >
155
+ <div overflow tabindex="0" role="button" aria-label="Read more"><?php echo __('Disqus Comments Loading...','accelerated-mobile-pages') ?></div>
156
+ </amp-iframe>
157
+ </section>
158
+ <?php
159
+ }
160
+ }
161
+
162
+ // Comments Scripts
163
+ add_filter( 'amp_post_template_data', 'ampforwp_framework_comments_scripts' );
164
+ function ampforwp_framework_comments_scripts( $data ) {
165
+
166
+ $facebook_comments_check = ampforwp_framework_get_facebook_comments();
167
+ global $redux_builder_amp;
168
+ if ( $facebook_comments_check && $redux_builder_amp['ampforwp-facebook-comments-support'] && is_singular() ) {
169
+ if ( empty( $data['amp_component_scripts']['amp-facebook-comments'] ) ) {
170
+ $data['amp_component_scripts']['amp-facebook-comments'] = 'https://cdn.ampproject.org/v0/amp-facebook-comments-0.1.js';
171
+ }
172
+ }
173
+ if ( $redux_builder_amp['ampforwp-disqus-comments-support'] && is_singular() && comments_open() ) {
174
+ if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
175
+ if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
176
+ $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
177
+ }
178
+ }
179
+ }
180
+ return $data;
181
  }
components/components-core.php CHANGED
@@ -1,383 +1,399 @@
1
- <?php
2
- $loadComponent = array();
3
- $scriptComponent = array();
4
- $supportComponent = array('AMP-search','AMP-menu','AMP-logo','AMP-social-icons','AMP-sidebar','AMP-featured-image','AMP-author-box','AMP-loop','AMP-categories-tags','AMP-comments','AMP-post-navigation','AMP-related-posts','AMP-post-pagination','AMP-call-now');
5
- //$removeScriptComponent = array('amp-carousel');
6
- add_filter( 'amp_post_template_data', 'ampforwp_framework_add_and_form_scripts',20);
7
- function ampforwp_framework_add_and_form_scripts($data) {
8
- global $scriptComponent, $loadComponent; //$removeScriptComponent;
9
-
10
- if(count($scriptComponent)>0){
11
- foreach ($scriptComponent as $key => $value) {
12
- if ( empty( $data['amp_component_scripts'][$key] ) ) {
13
- $data['amp_component_scripts'][$key] = $value;
14
- }
15
- }
16
- }
17
- /*if(count($removeScriptComponent)>0){
18
- foreach ($removeScriptComponent as $key => $value) {
19
- if ( empty( $data['amp_component_scripts'][$key] ) ) {
20
- unset($data['amp_component_scripts']['$key']);
21
- }
22
- }
23
- }*/
24
- return $data;
25
- }
26
-
27
- //Component Loader
28
- function add_amp_theme_support($componentName){
29
- global $wpdb;
30
- global $loadComponent,$supportComponent;
31
- if($supportComponent){
32
- if(in_array($componentName, $supportComponent)){
33
- $loadComponent[$componentName] = true;
34
- loadComponents($componentName);
35
- return true;
36
- }
37
- }
38
- return false;
39
- }
40
- //Include the Component file
41
- function loadComponents($componentName){
42
- global $wpdb;
43
- if(empty($componentName)) return '';
44
- $componentName = str_replace("AMP-", "", $componentName);
45
-
46
- $file = AMP_FRAMEWORK_COMOPNENT_DIR_PATH.'/'.$componentName.'/'.$componentName.".php";
47
- if(!file_exists($file)){
48
- return '';
49
- }
50
- include_once($file);
51
- }
52
-
53
- /**
54
- * Component Functions
55
- **/
56
-
57
- //Search Component Utilities
58
- function amp_search(){
59
- global $loadComponent;
60
- if(isset($loadComponent['AMP-search']) && $loadComponent['AMP-search']==true){
61
- ampforwp_framework_get_search_form();
62
- }
63
- }
64
-
65
- // Logo Component Utilitis
66
- function amp_logo(){
67
- global $loadComponent;
68
- if(isset($loadComponent['AMP-logo']) && $loadComponent['AMP-logo']==true){
69
- ampforwp_framework_get_logo();
70
- }
71
- }
72
-
73
- // Title
74
- function amp_title(){
75
- global $redux_builder_amp, $post;
76
- $ID = '';
77
- if(is_home() && $redux_builder_amp['amp-frontpage-select-option'] == 1){
78
- if( $redux_builder_amp['ampforwp-title-on-front-page'] ) {
79
- $ID = $redux_builder_amp['amp-frontpage-select-option-pages'];
80
- }
81
- }
82
- else
83
- $ID = $post->ID;
84
- if( $ID!=null ){
85
- do_action('ampforwp_above_the_title'); ?>
86
- <h1 class="amp-post-title"> <?php
87
- $ampforwp_title = get_the_title($ID);
88
- $ampforwp_title = apply_filters('ampforwp_filter_single_title', $ampforwp_title);
89
- echo wp_kses_data( $ampforwp_title ); ?>
90
- </h1>
91
- <?php do_action('ampforwp_below_the_title'); ?>
92
- <?php
93
- }
94
- }
95
-
96
- // Excerpt
97
- function amp_excerpt(){
98
- global $redux_builder_amp, $post;
99
- $ID = '';
100
- if(is_home() && $redux_builder_amp['amp-frontpage-select-option'] == 1){
101
- if( $redux_builder_amp['ampforwp-title-on-front-page'] ) {
102
- $ID = $redux_builder_amp['amp-frontpage-select-option-pages'];
103
- }
104
- }
105
- else
106
- $ID = $post->ID;
107
- if( $ID!=null ){ ?>
108
- <p><?php
109
- if(has_excerpt()){
110
- $content = get_the_excerpt();
111
- }else{
112
- $content = get_the_content();
113
- }
114
- echo wp_trim_words( strip_shortcodes( $content ) , '15' );
115
- ?></p>
116
- <?php
117
- }
118
- }
119
-
120
-
121
- //Menus
122
- function amp_menu(){
123
- global $loadComponent;
124
- if(isset($loadComponent['AMP-menu']) && $loadComponent['AMP-menu']==true){
125
- amp_menu_html();
126
- }
127
- }
128
-
129
- // Social Icons component
130
- function amp_social($social_icons=""){
131
- global $loadComponent;
132
- $amp_social = array();
133
- //Supported social icons
134
- $amp_social = array('twitter','facebook','pinterest','google-plus','linkedin','youtube','instagram','reddit','VKontakte','snapchat','tumblr');
135
- if(isset($loadComponent['AMP-social-icons']) && $loadComponent['AMP-social-icons']==true){
136
- if($social_icons!=null){
137
- ampforwp_framework_get_social_icons($social_icons);
138
- }
139
- else
140
- ampforwp_framework_get_social_icons($amp_social);
141
- }
142
- }
143
-
144
- //Sidebar
145
- function amp_sidebar($tag='start',$data=array()){
146
- global $loadComponent;
147
- if(isset($loadComponent['AMP-sidebar']) && $loadComponent['AMP-sidebar']==true){
148
- ampforwp_framework_get_sideabr($tag,$data);
149
- }
150
- }
151
-
152
- //Featured Image
153
- function amp_featured_image( ){
154
- global $loadComponent;
155
- if(isset($loadComponent['AMP-featured-image']) && $loadComponent['AMP-featured-image']==true){
156
- ampforwp_framework_get_featured_image( );
157
- }
158
- }
159
-
160
- // Author Box
161
- function amp_author_box($args=array() ){
162
- global $loadComponent;
163
- if(isset($loadComponent['AMP-author-box']) && $loadComponent['AMP-author-box']==true){
164
- ampforwp_framework_get_author_box($args);
165
- }
166
- }
167
-
168
- // Categories List
169
- function amp_categories_list( ){
170
- global $loadComponent;
171
- if(isset($loadComponent['AMP-categories-tags']) && $loadComponent['AMP-categories-tags']==true){
172
- ampforwp_framework_get_categories_list( );
173
- }
174
- }
175
- // Tags List
176
- function amp_tags_list( ){
177
- global $loadComponent;
178
- if(isset($loadComponent['AMP-categories-tags']) && $loadComponent['AMP-categories-tags']==true){
179
- ampforwp_framework_get_tags_list( );
180
- }
181
- }
182
-
183
- // Comments
184
- function amp_comments( ){
185
- global $loadComponent;
186
- if(isset($loadComponent['AMP-comments']) && $loadComponent['AMP-comments']==true){
187
- ampforwp_framework_get_comments( );
188
- }
189
- }
190
-
191
- // Post Navigation
192
- function amp_post_navigation( ){
193
- global $loadComponent;
194
- if(isset($loadComponent['AMP-post-navigation']) && $loadComponent['AMP-post-navigation']==true){
195
- echo ampforwp_framework_get_post_navigation( );
196
- }
197
- }
198
-
199
- // Related Posts
200
- function amp_related_posts($argsdata = array()){
201
- global $loadComponent;
202
- if(isset($loadComponent['AMP-related-posts']) && $loadComponent['AMP-related-posts']==true){
203
- echo ampforwp_framework_get_related_posts( $argsdata);
204
- }
205
- }
206
-
207
- // Post Pagination
208
- function amp_post_pagination($args='' ){
209
- global $loadComponent;
210
- if(isset($loadComponent['AMP-post-pagination']) && $loadComponent['AMP-post-pagination']==true){
211
- ampforwp_framework_get_post_pagination();
212
- }
213
- }
214
-
215
- // Call Now
216
- function amp_call_now(){
217
- global $loadComponent;
218
- if(isset($loadComponent['AMP-call-now']) && $loadComponent['AMP-call-now']==true){
219
- amp_call_button_html_output();
220
- }
221
- }
222
-
223
- //Get Core of AMP HTML
224
- function amp_header_core(){
225
- $post_id = get_queried_object_id();
226
- $thisTemplate = new AMP_Post_Template($post_id);
227
- global $redux_builder_amp;
228
- $html_tag_attributes = AMP_HTML_Utils::build_attributes_string( $thisTemplate->get( 'html_tag_attributes' ) );
229
-
230
- $bodyClass = '';
231
- if ( is_single() || is_page() ) {
232
- $bodyClass = 'single-post';
233
- $bodyClass .= ( is_page()? 'amp-single-page' : 'amp-single');
234
-
235
- }
236
- // Archive
237
- if ( is_archive() ) {
238
- $bodyClass = 'amp-archive';
239
- }
240
- $ampforwp_custom_post_page = ampforwp_custom_post_page();
241
- // Homepage
242
- if ( is_home() ) {
243
-
244
- $bodyClass = 'amp-index amp-home'.esc_attr( $thisTemplate->get( 'body_class' ) );
245
- if ($redux_builder_amp['amp-frontpage-select-option'] == 1) {
246
- $bodyClass = 'single-post design_3_wrapper';
247
- }
248
- if ( $ampforwp_custom_post_page == "page" && ampforwp_name_blog_page() ) {
249
- $current_url = home_url( $GLOBALS['wp']->request );
250
- $current_url_in_pieces = explode( '/', $current_url );
251
-
252
- if( in_array( ampforwp_name_blog_page() , $current_url_in_pieces ) ) {
253
- $bodyClass = 'amp-index '.esc_attr( $thisTemplate->get( 'body_class' ) );
254
- }
255
- }
256
-
257
- }
258
- // is_search
259
- if ( is_search() ) {
260
- if ( 'single' === $type ) {
261
- $bodyClass = 'amp_home_body archives_body design_3_wrapper';
262
- }
263
- }
264
- ?><!doctype html>
265
- <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $thisTemplate->get( 'html_tag_attributes' ) ); ?>>
266
- <head>
267
- <meta charset="utf-8">
268
- <link rel="dns-prefetch" href="https://cdn.ampproject.org">
269
- <?php do_action( 'amp_meta', $thisTemplate ); ?>
270
- <?php do_action( 'amp_post_template_head', $thisTemplate ); ?>
271
- <style amp-custom>
272
- <?php $thisTemplate->load_parts( array( 'style' ) ); ?>
273
- <?php do_action( 'amp_post_template_css', $thisTemplate ); ?>
274
- <?php do_action( 'amp_css', $thisTemplate ); ?>
275
- </style>
276
-
277
- </head>
278
- <body <?php ampforwp_body_class($bodyClass); ?>>
279
- <?php do_action('amp_start', $thisTemplate); ?>
280
- <?php do_action('ampforwp_body_beginning', $thisTemplate);
281
- }
282
-
283
- function amp_header(){
284
- $post_id = get_queried_object_id();
285
- $thisTemplate = new AMP_Post_Template($post_id);
286
- $thisTemplate->load_parts( array( 'header' ) );
287
- do_action( 'amp_after_header', $thisTemplate );
288
- do_action( 'ampforwp_after_header', $thisTemplate );
289
- do_action('ampforwp_post_before_design_elements') ?>
290
- <?php }
291
-
292
- function amp_footer(){
293
- $post_id = get_queried_object_id();
294
- $thisTemplate = new AMP_Post_Template($post_id);
295
- do_action( 'amp_before_footer', $thisTemplate );
296
- do_action( 'amp_post_template_above_footer', $thisTemplate );
297
- $thisTemplate->load_parts( array( 'footer' ) );
298
-
299
- }
300
-
301
- function amp_footer_core(){
302
- $post_id = get_queried_object_id();
303
- $thisTemplate = new AMP_Post_Template($post_id);
304
- do_action( 'amp_post_template_footer', $thisTemplate );
305
- do_action('ampforwp_global_after_footer');
306
- do_action('amp_end',$thisTemplate);
307
- // Close the body and Html tags ?>
308
- </body>
309
- </html><?php
310
- }
311
-
312
- function amp_non_amp_link(){
313
- global $allowed_html;
314
- global $redux_builder_amp;
315
- echo wp_kses($redux_builder_amp['amp-translator-footer-text'],$allowed_html) ;
316
- if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') { ampforwp_view_nonamp(); }
317
- }
318
-
319
- function amp_loop_template(){
320
- $post_id = get_queried_object_id();
321
- $thisTemplate = new AMP_Post_Template($post_id);
322
- do_action('amp_before_loop',$thisTemplate);
323
- $thisTemplate->load_parts( array( 'loop' ) );
324
- do_action('amp_after_loop',$thisTemplate);
325
- }
326
-
327
- // The Content
328
- function amp_content(){
329
- global $redux_builder_amp, $post;
330
- $post_id = get_queried_object_id();
331
- if(is_home() && $redux_builder_amp['amp-frontpage-select-option'] == 1){
332
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
333
- }
334
- $thisTemplate = new AMP_Post_Template($post_id);
335
- ?>
336
- <div>
337
- <?php do_action('ampforwp_before_post_content',$thisTemplate);
338
- $amp_custom_content_enable = get_post_meta( $thisTemplate->get( 'post_id' ) , 'ampforwp_custom_content_editor_checkbox', true);
339
- // Normal Content
340
- if ( ! $amp_custom_content_enable ) {
341
- $ampforwp_the_content = $thisTemplate->get( 'post_amp_content' ); // amphtml content; no kses
342
- } else {
343
- // Custom/Alternative AMP content added through post meta
344
- $ampforwp_the_content = $thisTemplate->get( 'ampforwp_amp_content' );
345
- }
346
- $ampforwp_the_content = apply_filters('ampforwp_modify_the_content',$ampforwp_the_content);
347
- echo $ampforwp_the_content;
348
- do_action('ampforwp_after_post_content',$thisTemplate); ?>
349
- </div>
350
- <?php }
351
-
352
- function amp_date($args=array()){
353
- global $redux_builder_amp;
354
- if(isset($args['format']) && $args['format']=='traditional'){
355
- $post_date = esc_html( get_the_date() ) . ' '.esc_html( get_the_time());
356
- }else{
357
- $post_date = human_time_diff(
358
- get_the_time('U', get_the_ID() ),
359
- current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],
360
- 'ago');
361
- }
362
- echo '<div class="loop-date">'.$post_date.'</div>';
363
- }
364
-
365
- //Load font Compoment
366
- $fontComponent = array();
367
- function amp_post_load_custom_fonts(){
368
- global $fontComponent;
369
- if(count($fontComponent)){
370
- $fontComponent = array_unique($fontComponent);
371
- foreach ($fontComponent as $key => $value) {
372
- ?>
373
- <link rel="stylesheet" href="<?php echo esc_url( $value ); ?>">
374
- <?php
375
- }
376
- }
377
-
378
- }
379
- add_action( 'amp_meta', 'amp_post_load_custom_fonts');
380
- function amp_font($fontName){
381
- global $fontComponent;
382
- $fontComponent[] = $fontName;
383
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $redux_builder_amp;
3
+ $loadComponent = array();
4
+ $scriptComponent = array();
5
+ $supportComponent = array('AMP-search','AMP-menu','AMP-logo','AMP-social-icons','AMP-sidebar','AMP-featured-image','AMP-author-box','AMP-loop','AMP-categories-tags','AMP-comments','AMP-post-navigation','AMP-related-posts','AMP-post-pagination','AMP-call-now');
6
+ //$removeScriptComponent = array('amp-carousel');
7
+ add_filter( 'amp_post_template_data', 'ampforwp_framework_add_and_form_scripts',20);
8
+ function ampforwp_framework_add_and_form_scripts($data) {
9
+ global $scriptComponent, $loadComponent; //$removeScriptComponent;
10
+
11
+ if(count($scriptComponent)>0){
12
+ foreach ($scriptComponent as $key => $value) {
13
+ if ( empty( $data['amp_component_scripts'][$key] ) ) {
14
+ $data['amp_component_scripts'][$key] = $value;
15
+ }
16
+ }
17
+ }
18
+ /*if(count($removeScriptComponent)>0){
19
+ foreach ($removeScriptComponent as $key => $value) {
20
+ if ( empty( $data['amp_component_scripts'][$key] ) ) {
21
+ unset($data['amp_component_scripts']['$key']);
22
+ }
23
+ }
24
+ }*/
25
+ return $data;
26
+ }
27
+
28
+ //Component Loader
29
+ function add_amp_theme_support($componentName){
30
+ global $wpdb;
31
+ global $loadComponent,$supportComponent;
32
+ if($supportComponent){
33
+ if(in_array($componentName, $supportComponent)){
34
+ $loadComponent[$componentName] = true;
35
+ loadComponents($componentName);
36
+ return true;
37
+ }
38
+ }
39
+ return false;
40
+ }
41
+ //Include the Component file
42
+ function loadComponents($componentName){
43
+ global $wpdb;
44
+ if(empty($componentName)) return '';
45
+ $componentName = str_replace("AMP-", "", $componentName);
46
+
47
+ $file = AMP_FRAMEWORK_COMOPNENT_DIR_PATH.'/'.$componentName.'/'.$componentName.".php";
48
+ if(!file_exists($file)){
49
+ return '';
50
+ }
51
+ include_once($file);
52
+ }
53
+
54
+ /**
55
+ * Component Functions
56
+ **/
57
+
58
+ //Search Component Utilities
59
+ function amp_search(){
60
+ global $loadComponent;
61
+ if(isset($loadComponent['AMP-search']) && $loadComponent['AMP-search']==true){
62
+ ampforwp_framework_get_search_form();
63
+ }
64
+ }
65
+
66
+ // Logo Component Utilitis
67
+ function amp_logo(){
68
+ global $loadComponent;
69
+ if(isset($loadComponent['AMP-logo']) && $loadComponent['AMP-logo']==true){
70
+ ampforwp_framework_get_logo();
71
+ }
72
+ }
73
+
74
+ // Title
75
+ function amp_title(){
76
+ global $redux_builder_amp, $post;
77
+ $ID = '';
78
+ if(is_home() && $redux_builder_amp['amp-frontpage-select-option'] == 1){
79
+ if( $redux_builder_amp['ampforwp-title-on-front-page'] ) {
80
+ $ID = $redux_builder_amp['amp-frontpage-select-option-pages'];
81
+ }
82
+ }
83
+ else
84
+ $ID = $post->ID;
85
+ if( $ID!=null ){
86
+ do_action('ampforwp_above_the_title'); ?>
87
+ <h1 class="amp-post-title"> <?php
88
+ $ampforwp_title = get_the_title($ID);
89
+ $ampforwp_title = apply_filters('ampforwp_filter_single_title', $ampforwp_title);
90
+ echo wp_kses_data( $ampforwp_title ); ?>
91
+ </h1>
92
+ <?php do_action('ampforwp_below_the_title'); ?>
93
+ <?php
94
+ }
95
+ }
96
+
97
+ // Excerpt
98
+ function amp_excerpt(){
99
+ global $redux_builder_amp, $post;
100
+ $ID = '';
101
+ if(is_home() && $redux_builder_amp['amp-frontpage-select-option'] == 1){
102
+ if( $redux_builder_amp['ampforwp-title-on-front-page'] ) {
103
+ $ID = $redux_builder_amp['amp-frontpage-select-option-pages'];
104
+ }
105
+ }
106
+ else
107
+ $ID = $post->ID;
108
+ if( $ID!=null ){ ?>
109
+ <p><?php
110
+ if(has_excerpt()){
111
+ $content = get_the_excerpt();
112
+ }else{
113
+ $content = get_the_content();
114
+ }
115
+ echo wp_trim_words( strip_shortcodes( $content ) , '15' );
116
+ ?></p>
117
+ <?php
118
+ }
119
+ }
120
+
121
+
122
+ //Menus
123
+ function amp_menu(){
124
+ global $loadComponent;
125
+ if(isset($loadComponent['AMP-menu']) && $loadComponent['AMP-menu']==true){
126
+ amp_menu_html();
127
+ }
128
+ }
129
+
130
+ // Social Icons component
131
+ function amp_social($social_icons=""){
132
+ global $loadComponent;
133
+ $amp_social = array();
134
+ //Supported social icons
135
+ $amp_social = array('twitter','facebook','pinterest','google-plus','linkedin','youtube','instagram','reddit','VKontakte','snapchat','tumblr');
136
+ if(isset($loadComponent['AMP-social-icons']) && $loadComponent['AMP-social-icons']==true){
137
+ if($social_icons!=null){
138
+ ampforwp_framework_get_social_icons($social_icons);
139
+ }
140
+ else
141
+ ampforwp_framework_get_social_icons($amp_social);
142
+ }
143
+ }
144
+
145
+ //Sidebar
146
+ function amp_sidebar($tag='start',$data=array()){
147
+ global $loadComponent;
148
+ if(isset($loadComponent['AMP-sidebar']) && $loadComponent['AMP-sidebar']==true){
149
+ ampforwp_framework_get_sideabr($tag,$data);
150
+ }
151
+ }
152
+
153
+ //Featured Image
154
+ function amp_featured_image( ){
155
+ global $loadComponent;
156
+ if(isset($loadComponent['AMP-featured-image']) && $loadComponent['AMP-featured-image']==true){
157
+ ampforwp_framework_get_featured_image( );
158
+ }
159
+ }
160
+
161
+ // Author Box
162
+ function amp_author_box($args=array() ){
163
+ global $loadComponent;
164
+ if(isset($loadComponent['AMP-author-box']) && $loadComponent['AMP-author-box']==true){
165
+ ampforwp_framework_get_author_box($args);
166
+ }
167
+ }
168
+
169
+ // Categories List
170
+ function amp_categories_list( ){
171
+ global $loadComponent;
172
+ if(isset($loadComponent['AMP-categories-tags']) && $loadComponent['AMP-categories-tags']==true){
173
+ ampforwp_framework_get_categories_list( );
174
+ }
175
+ }
176
+ // Tags List
177
+ function amp_tags_list( ){
178
+ global $loadComponent;
179
+ if(isset($loadComponent['AMP-categories-tags']) && $loadComponent['AMP-categories-tags']==true){
180
+ ampforwp_framework_get_tags_list( );
181
+ }
182
+ }
183
+
184
+ // Comments
185
+ function amp_comments( ){
186
+ global $loadComponent;
187
+ if(isset($loadComponent['AMP-comments']) && $loadComponent['AMP-comments']==true){
188
+ ampforwp_framework_get_comments( );
189
+ }
190
+ }
191
+
192
+ // Post Navigation
193
+ function amp_post_navigation( ){
194
+ global $loadComponent;
195
+ if(isset($loadComponent['AMP-post-navigation']) && $loadComponent['AMP-post-navigation']==true){
196
+ echo ampforwp_framework_get_post_navigation( );
197
+ }
198
+ }
199
+
200
+ // Related Posts
201
+ function amp_related_posts($argsdata = array()){
202
+ global $loadComponent;
203
+ if(isset($loadComponent['AMP-related-posts']) && $loadComponent['AMP-related-posts']==true){
204
+ echo ampforwp_framework_get_related_posts( $argsdata);
205
+ }
206
+ }
207
+
208
+ // Post Pagination
209
+ function amp_post_pagination($args='' ){
210
+ global $loadComponent;
211
+ if(isset($loadComponent['AMP-post-pagination']) && $loadComponent['AMP-post-pagination']==true){
212
+ ampforwp_framework_get_post_pagination();
213
+ }
214
+ }
215
+
216
+ // Call Now
217
+ function amp_call_now(){
218
+ global $loadComponent;
219
+ if(isset($loadComponent['AMP-call-now']) && $loadComponent['AMP-call-now']==true){
220
+ amp_call_button_html_output();
221
+ }
222
+ }
223
+
224
+ //Get Core of AMP HTML
225
+ function amp_header_core(){
226
+ $post_id = get_queried_object_id();
227
+ $thisTemplate = new AMP_Post_Template($post_id);
228
+ global $redux_builder_amp;
229
+ $html_tag_attributes = AMP_HTML_Utils::build_attributes_string( $thisTemplate->get( 'html_tag_attributes' ) );
230
+
231
+ $bodyClass = '';
232
+ if ( is_single() || is_page() ) {
233
+ $bodyClass = 'single-post';
234
+ $bodyClass .= ( is_page()? ' amp-single-page ' : ' amp-single ');
235
+
236
+ }
237
+ // Archive
238
+ if ( is_archive() ) {
239
+ $bodyClass = 'amp-archive';
240
+ }
241
+ $ampforwp_custom_post_page = ampforwp_custom_post_page();
242
+ // Homepage
243
+ if ( is_home() ) {
244
+
245
+ $bodyClass = 'amp-index amp-home'.esc_attr( $thisTemplate->get( 'body_class' ) );
246
+ if ($redux_builder_amp['amp-frontpage-select-option'] == 1) {
247
+ $bodyClass = 'single-post design_3_wrapper';
248
+ }
249
+ if ( $ampforwp_custom_post_page == "page" && ampforwp_name_blog_page() ) {
250
+ $current_url = home_url( $GLOBALS['wp']->request );
251
+ $current_url_in_pieces = explode( '/', $current_url );
252
+
253
+ if( in_array( ampforwp_name_blog_page() , $current_url_in_pieces ) ) {
254
+ $bodyClass = 'amp-index' .esc_attr( $thisTemplate->get( 'body_class' ) );
255
+ }
256
+ }
257
+
258
+ }
259
+ // is_search
260
+ if ( is_search() ) {
261
+ if ( 'single' === $type ) {
262
+ $bodyClass = 'amp_home_body archives_body design_3_wrapper';
263
+ }
264
+ }
265
+ if( true == $redux_builder_amp['amp-rtl-select-option'] ){
266
+ $bodyClass .= ' rtl ';
267
+ }
268
+ ?><!doctype html>
269
+ <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $thisTemplate->get( 'html_tag_attributes' ) ); ?>>
270
+ <head>
271
+ <meta charset="utf-8">
272
+ <link rel="dns-prefetch" href="https://cdn.ampproject.org">
273
+ <?php do_action( 'amp_meta', $thisTemplate ); ?>
274
+ <?php do_action( 'amp_post_template_head', $thisTemplate ); ?>
275
+ <style amp-custom>
276
+ <?php $thisTemplate->load_parts( array( 'style' ) ); ?>
277
+ <?php do_action( 'amp_css', $thisTemplate ); ?>
278
+ <?php do_action( 'amp_post_template_css', $thisTemplate ); ?>
279
+ </style>
280
+
281
+ </head>
282
+ <body <?php ampforwp_body_class($bodyClass); ?>>
283
+ <?php do_action('amp_start', $thisTemplate); ?>
284
+ <?php do_action('ampforwp_body_beginning', $thisTemplate);
285
+ }
286
+
287
+ function amp_header(){
288
+ $post_id = get_queried_object_id();
289
+ $thisTemplate = new AMP_Post_Template($post_id);
290
+ $thisTemplate->load_parts( array( 'header' ) );
291
+ do_action( 'amp_after_header', $thisTemplate );
292
+ do_action( 'ampforwp_after_header', $thisTemplate );
293
+ do_action('ampforwp_post_before_design_elements') ?>
294
+ <?php }
295
+
296
+ function amp_footer(){
297
+ $post_id = get_queried_object_id();
298
+ $thisTemplate = new AMP_Post_Template($post_id);
299
+ do_action( 'amp_before_footer', $thisTemplate );
300
+ do_action( 'amp_post_template_above_footer', $thisTemplate );
301
+ $thisTemplate->load_parts( array( 'footer' ) );
302
+
303
+ }
304
+
305
+ function amp_footer_core(){
306
+ $post_id = get_queried_object_id();
307
+ $thisTemplate = new AMP_Post_Template($post_id);
308
+ do_action( 'amp_post_template_footer', $thisTemplate );
309
+ do_action('ampforwp_global_after_footer');
310
+ do_action('amp_end',$thisTemplate);
311
+ // Close the body and Html tags ?>
312
+ </body>
313
+ </html><?php
314
+ }
315
+
316
+ function amp_non_amp_link(){
317
+ global $allowed_html;
318
+ global $redux_builder_amp;
319
+ echo wp_kses($redux_builder_amp['amp-translator-footer-text'],$allowed_html) ;
320
+ if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') { ampforwp_view_nonamp(); }
321
+ }
322
+
323
+ function amp_loop_template(){
324
+ $post_id = get_queried_object_id();
325
+ $thisTemplate = new AMP_Post_Template($post_id);
326
+ do_action('amp_before_loop',$thisTemplate);
327
+ $thisTemplate->load_parts( array( 'loop' ) );
328
+ do_action('amp_after_loop',$thisTemplate);
329
+ }
330
+
331
+ // The Content
332
+ function amp_content(){
333
+ global $redux_builder_amp, $post;
334
+ $post_id = get_queried_object_id();
335
+ if(is_home() && $redux_builder_amp['amp-frontpage-select-option'] == 1){
336
+ $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
337
+ }
338
+ $thisTemplate = new AMP_Post_Template($post_id);
339
+ ?>
340
+ <div>
341
+ <?php do_action('ampforwp_before_post_content',$thisTemplate);
342
+ $amp_custom_content_enable = get_post_meta( $thisTemplate->get( 'post_id' ) , 'ampforwp_custom_content_editor_checkbox', true);
343
+ // Normal Content
344
+ if ( ! $amp_custom_content_enable ) {
345
+ $ampforwp_the_content = $thisTemplate->get( 'post_amp_content' ); // amphtml content; no kses
346
+ } else {
347
+ // Custom/Alternative AMP content added through post meta
348
+ $ampforwp_the_content = $thisTemplate->get( 'ampforwp_amp_content' );
349
+ }
350
+ $ampforwp_the_content = apply_filters('ampforwp_modify_the_content',$ampforwp_the_content);
351
+ echo $ampforwp_the_content;
352
+ do_action('ampforwp_after_post_content',$thisTemplate); ?>
353
+ </div>
354
+ <?php }
355
+
356
+ function amp_date($args=array()){
357
+ global $redux_builder_amp;
358
+ if(isset($args['format']) && $args['format']=='traditional'){
359
+ $post_date = esc_html( get_the_date() ) . ' '.esc_html( get_the_time());
360
+ }else{
361
+ $post_date = human_time_diff(
362
+ get_the_time('U', get_the_ID() ),
363
+ current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],
364
+ 'ago');
365
+ }
366
+ echo '<div class="loop-date">'.$post_date.'</div>';
367
+ }
368
+
369
+ //Load font Compoment
370
+ $fontComponent = array();
371
+ function amp_post_load_custom_fonts(){
372
+ global $fontComponent;
373
+ if(count($fontComponent)){
374
+ $fontComponent = array_unique($fontComponent);
375
+ foreach ($fontComponent as $key => $value) {
376
+ ?>
377
+ <link rel="stylesheet" href="<?php echo esc_url( $value ); ?>">
378
+ <?php
379
+ }
380
+ }
381
+
382
+ }
383
+ add_action( 'amp_meta', 'amp_post_load_custom_fonts');
384
+ function amp_font($fontName){
385
+ global $fontComponent;
386
+ $fontComponent[] = $fontName;
387
+ }
388
+
389
+ // RTL Styling
390
+ add_action('amp_css', 'amp_theme_framework_rtl_styles');
391
+ if( ! function_exists('amp_theme_framework_rtl_styles') ){
392
+ function amp_theme_framework_rtl_styles(){
393
+ global $redux_builder_amp;
394
+ if( true == $redux_builder_amp['amp-rtl-select-option'] ){ ?>
395
+ body.rtl {direction: rtl;}
396
+ body amp-carousel{ direction: ltr;}
397
+ <?php }
398
+ }
399
+ }
components/featured-image/featured-image.php CHANGED
@@ -1,29 +1,29 @@
1
- <?php
2
- function ampforwp_framework_get_featured_image(){
3
- global $post, $redux_builder_amp;
4
- $post_id = $post->ID;
5
- if(is_home() && $redux_builder_amp['amp-frontpage-select-option'] == 1){
6
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
7
- }
8
- if (has_post_thumbnail( $post_id ) ): ?>
9
- <figure class="amp-featured-image"> <?php
10
- $thumb_id = get_post_thumbnail_id($post_id);
11
- $image = wp_get_attachment_image_src( $thumb_id, 'full' );
12
- $caption = get_the_post_thumbnail_caption( $post_id );
13
- $thumb_alt = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true);
14
- if($thumb_alt){
15
- $alt = $thumb_alt;
16
- }
17
- else{
18
- $alt = get_the_title( $post_id );
19
- }
20
- ?>
21
- <amp-img src="<?php echo $image[0]; ?>" width="<?php echo $image[1]; ?>" height="<?php echo $image[2]; ?>" layout=responsive alt="<?php echo esc_attr($alt); ?>" > </amp-img>
22
- <?php if ( $caption ) : ?>
23
- <p class="wp-caption-text">
24
- <?php echo wp_kses_data( $caption ); ?>
25
- </p>
26
- <?php endif; ?>
27
- </figure>
28
- <?php endif;
29
  }
1
+ <?php
2
+ function ampforwp_framework_get_featured_image(){
3
+ global $post, $redux_builder_amp;
4
+ $post_id = $post->ID;
5
+ if(is_home() && $redux_builder_amp['amp-frontpage-select-option'] == 1){
6
+ $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
7
+ }
8
+ if (has_post_thumbnail( $post_id ) ): ?>
9
+ <figure class="amp-featured-image"> <?php
10
+ $thumb_id = get_post_thumbnail_id($post_id);
11
+ $image = wp_get_attachment_image_src( $thumb_id, 'full' );
12
+ $caption = get_the_post_thumbnail_caption( $post_id );
13
+ $thumb_alt = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true);
14
+ if($thumb_alt){
15
+ $alt = $thumb_alt;
16
+ }
17
+ else{
18
+ $alt = get_the_title( $post_id );
19
+ }
20
+ ?>
21
+ <amp-img src="<?php echo $image[0]; ?>" width="<?php echo $image[1]; ?>" height="<?php echo $image[2]; ?>" layout=responsive alt="<?php echo esc_attr($alt); ?>" > </amp-img>
22
+ <?php if ( $caption ) : ?>
23
+ <p class="wp-caption-text">
24
+ <?php echo wp_kses_data( $caption ); ?>
25
+ </p>
26
+ <?php endif; ?>
27
+ </figure>
28
+ <?php endif;
29
  }
components/logo/logo.php CHANGED
@@ -1,41 +1,47 @@
1
- <?php
2
- function ampforwp_framework_get_logo(){
3
- global $redux_builder_amp; ?>
4
- <div class="amp-logo">
5
- <?php
6
- do_action('amp_header_top');
7
- $set_rel_to_noamp=false;
8
-
9
- if( $redux_builder_amp['amp-on-off-support-for-non-amp-home-page'] ) {
10
- if( $redux_builder_amp['amp-mobile-redirection'] ) {
11
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') ).'?nonamp=1';
12
- $set_rel_to_noamp = true;
13
- } else {
14
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') );
15
- }
16
- } else {
17
- if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
18
- $ampforwp_home_url = user_trailingslashit( trailingslashit( get_bloginfo('url') ) . AMPFORWP_AMP_QUERY_VAR );
19
- } else {
20
- if( $redux_builder_amp['amp-mobile-redirection'] ) {
21
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') ).'?nonamp=1';
22
- $set_rel_to_noamp = true;
23
- } else {
24
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') );
25
- }
26
- }
27
- }?>
28
-
29
- <?php if ( true == ($redux_builder_amp['opt-media']['url']) ) {
30
- $logo_id = attachment_url_to_postid($redux_builder_amp['opt-media'] ['url']);
31
- $alt = ampforwp_default_logo('alt') ?>
32
- <a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> >
33
-
34
- <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="<?php echo ampforwp_default_logo('width'); ?>" height="<?php echo ampforwp_default_logo('height'); ?>" alt="<?php echo $alt; ?>" class="amp-logo" layout="responsive"></amp-img>
35
-
36
- </a>
37
- <?php } else { ?>
38
- <h1><a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> ><?php bloginfo('name'); ?></a></h1>
39
- <?php } ?>
40
- </div>
41
- <?php }
 
 
 
 
 
 
1
+ <?php
2
+ function ampforwp_framework_get_logo(){
3
+ global $redux_builder_amp; ?>
4
+ <div class="amp-logo">
5
+ <?php
6
+ do_action('amp_header_top');
7
+ $set_rel_to_noamp=false;
8
+
9
+ if( $redux_builder_amp['amp-on-off-support-for-non-amp-home-page'] ) {
10
+ if( $redux_builder_amp['amp-mobile-redirection'] ) {
11
+ $ampforwp_home_url = trailingslashit( get_bloginfo('url') ).'?nonamp=1';
12
+ $set_rel_to_noamp = true;
13
+ } else {
14
+ $ampforwp_home_url = trailingslashit( get_bloginfo('url') );
15
+ }
16
+ } else {
17
+ if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
18
+ $ampforwp_home_url = user_trailingslashit( trailingslashit( get_bloginfo('url') ) . AMPFORWP_AMP_QUERY_VAR );
19
+ } else {
20
+ if( $redux_builder_amp['amp-mobile-redirection'] ) {
21
+ $ampforwp_home_url = trailingslashit( get_bloginfo('url') ).'?nonamp=1';
22
+ $set_rel_to_noamp = true;
23
+ } else {
24
+ $ampforwp_home_url = trailingslashit( get_bloginfo('url') );
25
+ }
26
+ }
27
+ }?>
28
+
29
+ <?php if ( true == ($redux_builder_amp['opt-media']['url']) ) {
30
+ $alt = ampforwp_default_logo('alt') ?>
31
+ <a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> >
32
+
33
+ <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="<?php echo ampforwp_default_logo('width'); ?>" height="<?php echo ampforwp_default_logo('height'); ?>" alt="<?php echo $alt; ?>" class="amp-logo" layout="responsive"></amp-img>
34
+
35
+ </a>
36
+ <?php } else { ?>
37
+ <h1><a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> ><?php bloginfo('name'); ?></a></h1>
38
+ <?php } ?>
39
+ </div>
40
+ <?php }
41
+
42
+ add_action('amp_post_template_css','amp_framework_logo_styles',11);
43
+ if( !function_exists( 'amp_framework_logo_styles' ) ){
44
+ function amp_framework_logo_styles(){ ?>
45
+ .amp-logo amp-img{max-width: 190px;width:<?php echo ampforwp_default_logo('width');?>px ;}
46
+ <?php }
47
+ }
components/loop/loop.php CHANGED
@@ -1,298 +1,298 @@
1
- <?php
2
- function amp_archive_title(){
3
- global $redux_builder_amp;
4
- if ( is_archive() ) {
5
- the_archive_title( '<h3 class="amp-archive-title">', '</h3>' );
6
- the_archive_description( '<div class="amp-archive-desc">', '</div>' );
7
- }
8
- if(is_search()){
9
- $label = 'You searched for:';
10
- if(function_exists('ampforwp_translation')){
11
- $label = ampforwp_translation( $redux_builder_amp['amp-translator-search-text'], 'You searched for:');
12
- }
13
- echo '<h3 class="amp-loop-label">'.$label . ' ' . get_search_query().'</h3>';
14
- }
15
- }
16
-
17
- $amp_q ='';
18
- function call_loops_standard($data=array()){
19
- global $amp_q;
20
- if (get_query_var( 'paged' ) ) {
21
- $paged = get_query_var('paged');
22
- } elseif ( get_query_var( 'page' ) ) {
23
- $paged = get_query_var('page');
24
- } else {
25
- $paged = 1;
26
- }
27
-
28
- if ( is_archive() ) {
29
- $exclude_ids = get_option('ampforwp_exclude_post');
30
- $qobj = get_queried_object();
31
- $args = array(
32
- 'post_type' => 'post',
33
- 'orderby' => 'date',
34
- 'ignore_sticky_posts' => 1,
35
- 'tax_query' => array(
36
- array(
37
- 'taxonomy' => $qobj->taxonomy,
38
- 'field' => 'id',
39
- 'terms' => $qobj->term_id,
40
- // using a slug is also possible
41
- // 'field' => 'slug',
42
- // 'terms' => $qobj->name
43
- )
44
- ),
45
- 'paged' => esc_attr($paged),
46
- 'post__not_in' => $exclude_ids,
47
- 'has_password' => false ,
48
- 'post_status'=> 'publish'
49
- );
50
- }
51
- if ( is_home() ) {
52
- $exclude_ids = get_option('ampforwp_exclude_post');
53
-
54
- $args = array(
55
- 'post_type' => 'post',
56
- 'orderby' => 'date',
57
- 'paged' => esc_attr($paged),
58
- 'post__not_in' => $exclude_ids,
59
- 'has_password' => false ,
60
- 'post_status' => 'publish'
61
- );
62
- }
63
-
64
- if ( is_search() ) {
65
- $exclude_ids = get_option('ampforwp_exclude_post');
66
- $args = array(
67
- 's' => get_search_query() ,
68
- 'ignore_sticky_posts' => 1,
69
- 'paged' => esc_attr($paged),
70
- 'post__not_in' => $exclude_ids,
71
- 'has_password' => false ,
72
- 'post_status' => 'publish'
73
- );
74
- }
75
- if(is_author()){
76
- $exclude_ids = get_option('ampforwp_exclude_post');
77
- $author = get_user_by( 'slug', get_query_var( 'author_name' ) );
78
- $args = array(
79
- 'author' => $author->ID,
80
- 'post_type' => 'post',
81
- 'orderby' => 'date',
82
- 'ignore_sticky_posts' => 1,
83
- 'paged' => esc_attr($paged),
84
- 'post__not_in' => $exclude_ids,
85
- 'has_password' => false ,
86
- 'post_status'=> 'publish'
87
- );
88
- }
89
- if(isset($data['post_to_show']) && $data['post_to_show']>0){
90
- $args['posts_per_page'] = $data['post_to_show'];
91
- }
92
- if(isset($data['offset']) && $data['offset']>0){
93
- $args['offset'] = $data['offset'];
94
- }
95
-
96
- $filtered_args = apply_filters('ampforwp_query_args', $args);
97
- $amp_q = new WP_Query( $filtered_args );
98
- }
99
- //call_loops_standered();
100
- /****
101
- * AMP Loop Functions
102
- *
103
- *
104
- *
105
- *
106
- *
107
- */
108
- //add_action("init", 'call_loops_standered');
109
-
110
- function amp_loop($selection,$data=array()){
111
- global $amp_q;
112
- if(empty($amp_q) || is_null($amp_q)){
113
- call_loops_standard($data);
114
- echo "<div class='loop-wrapper'>";
115
- }
116
- if ( !isset($ampLoopData['no_data']) ) :
117
- switch($selection){
118
- case 'start':
119
- return amp_start_loop();
120
- break;
121
- case 'end':
122
- return amp_end_loop();
123
- break;
124
- }
125
- else : // If no posts exist.
126
- return false;
127
- endif; // End loop.
128
- }
129
-
130
- function amp_start_loop(){
131
- global $amp_q;
132
- $post_status = $amp_q->have_posts();
133
- $amp_q->the_post();
134
- return $post_status;
135
- }
136
- function amp_end_loop(){
137
- global $amp_q;
138
- wp_reset_postdata();
139
- echo "</div>";
140
- }
141
-
142
- function amp_reset_loop(){
143
- global $amp_q;
144
- $amp_q = '';
145
- return "";
146
- }
147
-
148
- function amp_pagination($args =array()) {
149
- global $amp_q, $redux_builder_amp;
150
- if (get_query_var( 'paged' ) ) {
151
- $paged = get_query_var('paged');
152
- } elseif ( get_query_var( 'page' ) ) {
153
- $paged = get_query_var('page');
154
- } else {
155
- $paged = 1;
156
- }
157
- $pre_link = '';
158
- if(!isset($args['previous_text']) || $args['previous_text']==''){
159
- $args['previous_text'] = 'Show previous Posts';
160
- }
161
- if(!isset($args['next_text']) || $args['next_text']==''){
162
- $args['next_text'] = 'Show more Posts';
163
- }
164
- if ( $paged > 1 ) {
165
- $pre_link = '<div class="left">'.get_previous_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-show-previous-posts-text'], $args['previous_text'] ) ) .'</div>';
166
- }
167
-
168
- echo '<div class="loop-pagination">
169
- <div class="right">'. get_next_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-show-more-posts-text'] , $args['next_text']), $amp_q->max_num_pages ) .'</div>
170
- '.$pre_link.'
171
- <div class="clearfix"></div>
172
- </div>';
173
- }
174
-
175
- /***
176
- * Get Title of post
177
- */
178
- function amp_loop_title($data=array()){
179
- $data = array_filter($data);
180
- $tag = 'h2';
181
- if(isset($data['tag']) && $data['tag']!=""){
182
- $tag = $data['tag'];
183
- }
184
- $attributes = 'class="loop-title"';
185
- if(isset($data['attributes']) && $data['attributes']!=""){
186
- $attributes = $data['attributes'];
187
- }
188
- echo '<'.$tag.' '.$attributes.'>';
189
- if(!isset($data['link']) ){
190
- echo '<a href="'. amp_loop_permalink(true) .'">';
191
- }
192
- echo the_title('','',false);
193
-
194
- if(!isset($data['link']) ){
195
- echo '</a>';
196
- }
197
- echo '</'.$tag.'>';
198
- }
199
-
200
- function amp_loop_date($args=array()){
201
- global $redux_builder_amp;
202
- if(isset($args['format']) && $args['format']=='traditional'){
203
- $post_date = esc_html( get_the_date() ) . ' '.esc_html( get_the_time());
204
- }else{
205
- $post_date = human_time_diff(
206
- get_the_time('U', get_the_ID() ),
207
- current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],
208
- 'ago');
209
- }
210
- echo '<div class="loop-date">'.$post_date.'</div>';
211
- }
212
-
213
- function amp_loop_excerpt($no_of_words=15,$tag = 'p'){
214
- //excerpt
215
- if(has_excerpt()){
216
- $content = get_the_excerpt();
217
- }else{
218
- $content = get_the_content();
219
- }
220
- $content = strip_shortcodes( $content );
221
- echo '<'.$tag.'>'. wp_trim_words( $content, $no_of_words ) .'</'.$tag.'>';
222
- }
223
- function amp_loop_all_content($tag = 'p'){
224
- $fullContent = strip_shortcodes( get_the_content() );
225
- echo '<'.$tag.'>'. $fullContent .'</'.$tag.'>';
226
- }
227
-
228
- function amp_loop_permalink($return,$amp_query_var ='amp'){
229
- if( $return ){
230
- return ampforwp_url_controller( get_permalink() ) ;
231
- }
232
- echo ampforwp_url_controller( get_permalink() );
233
- }
234
- function amp_loop_image( $data=array() ){
235
- global $ampLoopData,$counterOffset;
236
- if (has_post_thumbnail() ) {
237
-
238
- $tag = 'div';
239
- $tag_class = '';
240
- $layout_responsive = '';
241
- $imageClass = '';
242
- $imageSize = 'thumbnail';
243
-
244
- if(isset($data['tag']) && $data['tag']!=""){
245
- $tag = $data['tag'];
246
- }
247
-
248
- if(isset($data['responsive']) && $data['responsive']!=""){
249
- $layout_responsive = 'layout=responsive';
250
- }
251
-
252
- if(isset($data['tag_class']) && $data['tag_class']!=""){
253
- $tag_class = $data['tag_class'];
254
- }
255
- if(isset($data['image_class']) && $data['image_class']!=""){
256
- $imageClass = $data['image_class'];
257
- }
258
- if(isset($data['image_size']) && $data['image_size']!=""){
259
- $imageSize = $data['image_size'];
260
- }
261
-
262
- $thumb_id = get_post_thumbnail_id();
263
- $thumb_url_array = wp_get_attachment_image_src($thumb_id, $imageSize, true);
264
- $thumb_url = $thumb_url_array[0];
265
-
266
-
267
- echo '<'.$tag.' class="loop-img '.$tag_class.'">';
268
- echo '<a href="'.amp_loop_permalink(true).'">';
269
- echo '<amp-img src="'. $thumb_url .'" width="'.$thumb_url_array[1].'" height="'.$thumb_url_array[2].'" '. $layout_responsive .' class="'.$imageClass.'"></amp-img>';
270
- echo '</a>';
271
- echo '</'.$tag.'>';
272
- }
273
- }
274
-
275
- // Category
276
- function amp_loop_category(){
277
- echo ' <ul class="loop-category">';
278
- if(count(get_the_category()) > 0){
279
- foreach((get_the_category()) as $category) {
280
- echo '<li class="amp-cat-'. $category->term_id.'"><a href="'.ampforwp_url_controller( get_category_link( $category->term_id ) ).'">'. $category->cat_name.'</a></li>';
281
- }
282
- }
283
- echo '</ul>';
284
- }
285
- // author
286
- function amp_loop_author($args = array()){
287
- global $redux_builder_amp;
288
- if(function_exists('ampforwp_framework_get_author_box')){
289
- ampforwp_framework_get_author_box($args);
290
- }else{
291
- echo "";
292
- }
293
-
294
- }
295
-
296
-
297
-
298
-
1
+ <?php
2
+ function amp_archive_title(){
3
+ global $redux_builder_amp;
4
+ if ( is_archive() ) {
5
+ the_archive_title( '<h3 class="amp-archive-title">', '</h3>' );
6
+ the_archive_description( '<div class="amp-archive-desc">', '</div>' );
7
+ }
8
+ if(is_search()){
9
+ $label = 'You searched for:';
10
+ if(function_exists('ampforwp_translation')){
11
+ $label = ampforwp_translation( $redux_builder_amp['amp-translator-search-text'], 'You searched for:');
12
+ }
13
+ echo '<h3 class="amp-loop-label">'.$label . ' ' . get_search_query().'</h3>';
14
+ }
15
+ }
16
+
17
+ $amp_q ='';
18
+ function call_loops_standard($data=array()){
19
+ global $amp_q;
20
+ if (get_query_var( 'paged' ) ) {
21
+ $paged = get_query_var('paged');
22
+ } elseif ( get_query_var( 'page' ) ) {
23
+ $paged = get_query_var('page');
24
+ } else {
25
+ $paged = 1;
26
+ }
27
+
28
+ if ( is_archive() ) {
29
+ $exclude_ids = get_option('ampforwp_exclude_post');
30
+ $qobj = get_queried_object();
31
+ $args = array(
32
+ 'post_type' => 'post',
33
+ 'orderby' => 'date',
34
+ 'ignore_sticky_posts' => 1,
35
+ 'tax_query' => array(
36
+ array(
37
+ 'taxonomy' => $qobj->taxonomy,
38
+ 'field' => 'id',
39
+ 'terms' => $qobj->term_id,
40
+ // using a slug is also possible
41
+ // 'field' => 'slug',
42
+ // 'terms' => $qobj->name
43
+ )
44
+ ),
45
+ 'paged' => esc_attr($paged),
46
+ 'post__not_in' => $exclude_ids,
47
+ 'has_password' => false ,
48
+ 'post_status'=> 'publish'
49
+ );
50
+ }
51
+ if ( is_home() ) {
52
+ $exclude_ids = get_option('ampforwp_exclude_post');
53
+
54
+ $args = array(
55
+ 'post_type' => 'post',
56
+ 'orderby' => 'date',
57
+ 'paged' => esc_attr($paged),
58
+ 'post__not_in' => $exclude_ids,
59
+ 'has_password' => false ,
60
+ 'post_status' => 'publish'
61
+ );
62
+ }
63
+
64
+ if ( is_search() ) {
65
+ $exclude_ids = get_option('ampforwp_exclude_post');
66
+ $args = array(
67
+ 's' => get_search_query() ,
68
+ 'ignore_sticky_posts' => 1,
69
+ 'paged' => esc_attr($paged),
70
+ 'post__not_in' => $exclude_ids,
71
+ 'has_password' => false ,
72
+ 'post_status' => 'publish'
73
+ );
74
+ }
75
+ if(is_author()){
76
+ $exclude_ids = get_option('ampforwp_exclude_post');
77
+ $author = get_user_by( 'slug', get_query_var( 'author_name' ) );
78
+ $args = array(
79
+ 'author' => $author->ID,
80
+ 'post_type' => 'post',
81
+ 'orderby' => 'date',
82
+ 'ignore_sticky_posts' => 1,
83
+ 'paged' => esc_attr($paged),
84
+ 'post__not_in' => $exclude_ids,
85
+ 'has_password' => false ,
86
+ 'post_status'=> 'publish'
87
+ );
88
+ }
89
+ if(isset($data['post_to_show']) && $data['post_to_show']>0){
90
+ $args['posts_per_page'] = $data['post_to_show'];
91
+ }
92
+ if(isset($data['offset']) && $data['offset']>0){
93
+ $args['offset'] = $data['offset'];
94
+ }
95
+
96
+ $filtered_args = apply_filters('ampforwp_query_args', $args);
97
+ $amp_q = new WP_Query( $filtered_args );
98
+ }
99
+ //call_loops_standered();
100
+ /****
101
+ * AMP Loop Functions
102
+ *
103
+ *
104
+ *
105
+ *
106
+ *
107
+ */
108
+ //add_action("init", 'call_loops_standered');
109
+
110
+ function amp_loop($selection,$data=array()){
111
+ global $amp_q;
112
+ if(empty($amp_q) || is_null($amp_q)){
113
+ call_loops_standard($data);
114
+ echo "<div class='loop-wrapper'>";
115
+ }
116
+ if ( !isset($ampLoopData['no_data']) ) :
117
+ switch($selection){
118
+ case 'start':
119
+ return amp_start_loop();
120
+ break;
121
+ case 'end':
122
+ return amp_end_loop();
123
+ break;
124
+ }
125
+ else : // If no posts exist.
126
+ return false;
127
+ endif; // End loop.
128
+ }
129
+
130
+ function amp_start_loop(){
131
+ global $amp_q;
132
+ $post_status = $amp_q->have_posts();
133
+ $amp_q->the_post();
134
+ return $post_status;
135
+ }
136
+ function amp_end_loop(){
137
+ global $amp_q;
138
+ wp_reset_postdata();
139
+ echo "</div>";
140
+ }
141
+
142
+ function amp_reset_loop(){
143
+ global $amp_q;
144
+ $amp_q = '';
145
+ return "";
146
+ }
147
+
148
+ function amp_pagination($args =array()) {
149
+ global $amp_q, $redux_builder_amp;
150
+ if (get_query_var( 'paged' ) ) {
151
+ $paged = get_query_var('paged');
152
+ } elseif ( get_query_var( 'page' ) ) {
153
+ $paged = get_query_var('page');
154
+ } else {
155
+ $paged = 1;
156
+ }
157
+ $pre_link = '';
158
+ if(!isset($args['previous_text']) || $args['previous_text']==''){
159
+ $args['previous_text'] = 'Show previous Posts';
160
+ }
161
+ if(!isset($args['next_text']) || $args['next_text']==''){
162
+ $args['next_text'] = 'Show more Posts';
163
+ }
164
+ if ( $paged > 1 ) {
165
+ $pre_link = '<div class="left">'.get_previous_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-show-previous-posts-text'], $args['previous_text'] ) ) .'</div>';
166
+ }
167
+
168
+ echo '<div class="loop-pagination">
169
+ <div class="right">'. get_next_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-show-more-posts-text'] , $args['next_text']), $amp_q->max_num_pages ) .'</div>
170
+ '.$pre_link.'
171
+ <div class="clearfix"></div>
172
+ </div>';
173
+ }
174
+
175
+ /***
176
+ * Get Title of post
177
+ */
178
+ function amp_loop_title($data=array()){
179
+ $data = array_filter($data);
180
+ $tag = 'h2';
181
+ if(isset($data['tag']) && $data['tag']!=""){
182
+ $tag = $data['tag'];
183
+ }
184
+ $attributes = 'class="loop-title"';
185
+ if(isset($data['attributes']) && $data['attributes']!=""){
186
+ $attributes = $data['attributes'];
187
+ }
188
+ echo '<'.$tag.' '.$attributes.'>';
189
+ if(!isset($data['link']) ){
190
+ echo '<a href="'. amp_loop_permalink(true) .'">';
191
+ }
192
+ echo the_title('','',false);
193
+
194
+ if(!isset($data['link']) ){
195
+ echo '</a>';
196
+ }
197
+ echo '</'.$tag.'>';
198
+ }
199
+
200
+ function amp_loop_date($args=array()){
201
+ global $redux_builder_amp;
202
+ if(isset($args['format']) && $args['format']=='traditional'){
203
+ $post_date = esc_html( get_the_date() ) . ' '.esc_html( get_the_time());
204
+ }else{
205
+ $post_date = human_time_diff(
206
+ get_the_time('U', get_the_ID() ),
207
+ current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],
208
+ 'ago');
209
+ }
210
+ echo '<div class="loop-date">'.$post_date.'</div>';
211
+ }
212
+
213
+ function amp_loop_excerpt($no_of_words=15,$tag = 'p'){
214
+ //excerpt
215
+ if(has_excerpt()){
216
+ $content = get_the_excerpt();
217
+ }else{
218
+ $content = get_the_content();
219
+ }
220
+ $content = strip_shortcodes( $content );
221
+ echo '<'.$tag.'>'. wp_trim_words( $content, $no_of_words ) .'</'.$tag.'>';
222
+ }
223
+ function amp_loop_all_content($tag = 'p'){
224
+ $fullContent = strip_shortcodes( get_the_content() );
225
+ echo '<'.$tag.'>'. $fullContent .'</'.$tag.'>';
226
+ }
227
+
228
+ function amp_loop_permalink($return,$amp_query_var ='amp'){
229
+ if( $return ){
230
+ return ampforwp_url_controller( get_permalink() ) ;
231
+ }
232
+ echo ampforwp_url_controller( get_permalink() );
233
+ }
234
+ function amp_loop_image( $data=array() ){
235
+ global $ampLoopData,$counterOffset;
236
+ if (has_post_thumbnail() ) {
237
+
238
+ $tag = 'div';
239
+ $tag_class = '';
240
+ $layout_responsive = '';
241
+ $imageClass = '';
242
+ $imageSize = 'thumbnail';
243
+
244
+ if(isset($data['tag']) && $data['tag']!=""){
245
+ $tag = $data['tag'];
246
+ }
247
+
248
+ if(isset($data['responsive']) && $data['responsive']!=""){
249
+ $layout_responsive = 'layout=responsive';
250
+ }
251
+
252
+ if(isset($data['tag_class']) && $data['tag_class']!=""){
253
+ $tag_class = $data['tag_class'];
254
+ }
255
+ if(isset($data['image_class']) && $data['image_class']!=""){
256
+ $imageClass = $data['image_class'];
257
+ }
258
+ if(isset($data['image_size']) && $data['image_size']!=""){
259
+ $imageSize = $data['image_size'];
260
+ }
261
+
262
+ $thumb_id = get_post_thumbnail_id();
263
+ $thumb_url_array = wp_get_attachment_image_src($thumb_id, $imageSize, true);
264
+ $thumb_url = $thumb_url_array[0];
265
+
266
+
267
+ echo '<'.$tag.' class="loop-img '.$tag_class.'">';
268
+ echo '<a href="'.amp_loop_permalink(true).'">';
269
+ echo '<amp-img src="'. $thumb_url .'" width="'.$thumb_url_array[1].'" height="'.$thumb_url_array[2].'" '. $layout_responsive .' class="'.$imageClass.'"></amp-img>';
270
+ echo '</a>';
271
+ echo '</'.$tag.'>';
272
+ }
273
+ }
274
+
275
+ // Category
276
+ function amp_loop_category(){
277
+ echo ' <ul class="loop-category">';
278
+ if(count(get_the_category()) > 0){
279
+ foreach((get_the_category()) as $category) {
280
+ echo '<li class="amp-cat-'. $category->term_id.'"><a href="'.ampforwp_url_controller( get_category_link( $category->term_id ) ).'">'. $category->cat_name.'</a></li>';
281
+ }
282
+ }
283
+ echo '</ul>';
284
+ }
285
+ // author
286
+ function amp_loop_author($args = array()){
287
+ global $redux_builder_amp;
288
+ if(function_exists('ampforwp_framework_get_author_box')){
289
+ ampforwp_framework_get_author_box($args);
290
+ }else{
291
+ echo "";
292
+ }
293
+
294
+ }
295
+
296
+
297
+
298
+
components/menu/menu.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
- function amp_menu_html(){
3
- if( has_nav_menu( 'amp-menu' ) ) {
4
- wp_nav_menu( array(
5
- 'theme_location' => 'amp-menu',
6
- 'container'=>'aside',
7
- 'menu'=>'ul',
8
- 'menu_class'=>'amp-menu',
9
- ) );
10
- }
11
- }
12
-
13
- //Load styling for Menu
14
- add_action('amp_post_template_css','amp_menu_styles',11);
15
- function amp_menu_styles(){ ?>
16
- aside{width:150px}.amp-menu{list-style-type:none;margin:0;padding:0}.amp-menu li{position:relative;display:block}.amp-menu li.menu-item-has-children ul{display:none}.amp-menu li.menu-item-has-children:hover>ul{display:block}.amp-menu li.menu-item-has-children>ul>li{padding-left:10px}.amp-menu li.menu-item-has-children:after{content:" > ";position:absolute;padding:10px;right:0;top:0;z-index:10000;line-height:1;background:#ddd}.amp-menu>li a{padding:7px;display:block;margin-bottom:1px}.amp-menu>li ul{list-style-type:none;margin:0;padding:0;position:relative}.amp-menu>li>li a{background:#e5e5e5}.amp-menu>li>li a{background:#e5e5e5}.amp-menu li:hover a{background:#fff}.amp-menu li:hover li:hover>a{background:#fff}
17
  <?php }
1
+ <?php
2
+ function amp_menu_html(){
3
+ if( has_nav_menu( 'amp-menu' ) ) {
4
+ wp_nav_menu( array(
5
+ 'theme_location' => 'amp-menu',
6
+ 'container'=>'aside',
7
+ 'menu'=>'ul',
8
+ 'menu_class'=>'amp-menu',
9
+ ) );
10
+ }
11
+ }
12
+
13
+ //Load styling for Menu
14
+ add_action('amp_post_template_css','amp_menu_styles',11);
15
+ function amp_menu_styles(){ ?>
16
+ aside{width:150px}.amp-menu{list-style-type:none;margin:0;padding:0}.amp-menu li{position:relative;display:block}.amp-menu li.menu-item-has-children ul{display:none}.amp-menu li.menu-item-has-children:hover>ul{display:block}.amp-menu li.menu-item-has-children>ul>li{padding-left:10px}.amp-menu li.menu-item-has-children:after{content:" > ";position:absolute;padding:10px;right:0;top:0;z-index:10000;line-height:1;background:#ddd}.amp-menu>li a{padding:7px;display:block;margin-bottom:1px}.amp-menu>li ul{list-style-type:none;margin:0;padding:0;position:relative}.amp-menu>li>li a{background:#e5e5e5}.amp-menu>li>li a{background:#e5e5e5}.amp-menu li:hover a{background:#fff}.amp-menu li:hover li:hover>a{background:#fff}
17
  <?php }
components/post-navigation/post-navigation.php CHANGED
@@ -1,27 +1,27 @@
1
- <?php
2
- function ampforwp_framework_get_post_navigation(){
3
- global $redux_builder_amp;
4
- if($redux_builder_amp['enable-single-next-prev']) { ?>
5
- <div id="pagination">
6
- <div class="next">
7
- <?php $next_post = get_next_post();
8
- if (!empty( $next_post )) {
9
- $next_text = $next_post->post_title;
10
- ?>
11
- <a href="<?php echo ampforwp_url_controller( get_permalink( $next_post->ID ) ); ?>"><?php echo apply_filters('ampforwp_next_link',$next_text ); ?> &raquo;</a> <?php
12
- } ?>
13
- </div>
14
-
15
- <div class="prev">
16
- <?php $prev_post = get_previous_post();
17
- if (!empty( $prev_post )) {
18
- $prev_text = $prev_post->post_title;
19
- ?>
20
- <a href="<?php echo ampforwp_url_controller( get_permalink( $prev_post->ID ) ); ?>"> &laquo; <?php echo apply_filters('ampforwp_prev_link',$prev_text ); ?></a> <?php
21
- } ?>
22
- </div>
23
-
24
- <div class="clearfix"></div>
25
- </div>
26
- <?php }
27
  }
1
+ <?php
2
+ function ampforwp_framework_get_post_navigation(){
3
+ global $redux_builder_amp;
4
+ if($redux_builder_amp['enable-single-next-prev']) { ?>
5
+ <div id="pagination">
6
+ <div class="next">
7
+ <?php $next_post = get_next_post();
8
+ if (!empty( $next_post )) {
9
+ $next_text = $next_post->post_title;
10
+ ?>
11
+ <a href="<?php echo ampforwp_url_controller( get_permalink( $next_post->ID ) ); ?>"><?php echo apply_filters('ampforwp_next_link',$next_text ); ?> &raquo;</a> <?php
12
+ } ?>
13
+ </div>
14
+
15
+ <div class="prev">
16
+ <?php $prev_post = get_previous_post();
17
+ if (!empty( $prev_post )) {
18
+ $prev_text = $prev_post->post_title;
19
+ ?>
20
+ <a href="<?php echo ampforwp_url_controller( get_permalink( $prev_post->ID ) ); ?>"> &laquo; <?php echo apply_filters('ampforwp_prev_link',$prev_text ); ?></a> <?php
21
+ } ?>
22
+ </div>
23
+
24
+ <div class="clearfix"></div>
25
+ </div>
26
+ <?php }
27
  }
components/post-pagination/post-pagination.php CHANGED
@@ -1,176 +1,176 @@
1
- <?php
2
- function ampforwp_framework_get_post_pagination( $args = '' ) {
3
-
4
- wp_reset_postdata();
5
- global $page, $numpages, $multipage, $more, $redux_builder_amp;
6
-
7
- $defaults = array(
8
- 'before' => '<p>' . __( 'Page:' ),
9
- 'after' => '</p>',
10
- 'link_before' => '',
11
- 'link_after' => '',
12
- 'next_or_number' => 'number',
13
- 'separator' => ' ',
14
- 'nextpagelink' => __( 'Next page' ),
15
- 'previouspagelink' => __( 'Previous page' ),
16
- 'pagelink' => '%',
17
- 'echo' => 1
18
- );
19
-
20
- $params = wp_parse_args( $args, $defaults );
21
-
22
- /**
23
- * Filters the arguments used in retrieving page links for paginated posts.
24
- * @param array $params An array of arguments for page links for paginated posts.
25
- */
26
- $r = apply_filters( 'ampforwp_framework_get_post_pagination_args', $params );
27
-
28
- $output = '';
29
- if ( $multipage ) {
30
- if ( 'number' == $r['next_or_number'] ) {
31
- $output .= $r['before'];
32
- for ( $i = 1; $i <= $numpages; $i++ ) {
33
- $link = $r['link_before'] . str_replace( '%', $i, $r['pagelink'] ) . $r['link_after'];
34
- if ( $i != $page || ! $more && 1 == $page ) {
35
- $link = ampforwp_framework_get_post_paginated_link( $i ) . $link . '</a>';
36
- }
37
- /**
38
- * Filters the HTML output of individual page number links.
39
- * @param string $link The page number HTML output.
40
- * @param int $i Page number for paginated posts' page links.
41
- */
42
- $link = apply_filters( 'ampforwp_framework_get_post_pagination_link', $link, $i );
43
-
44
- // Use the custom links separator beginning with the second link.
45
- $output .= ( 1 === $i ) ? ' ' : $r['separator'];
46
- $output .= $link;
47
- }
48
- $output .= $r['after'];
49
- } elseif ( $more ) {
50
- $output .= $r['before'];
51
- $prev = $page - 1;
52
- if ( $prev > 0 ) {
53
- $link = ampforwp_framework_get_post_paginated_link( $prev ) . $r['link_before'] . $r['previouspagelink'] . $r['link_after'] . '</a>';
54
- $output .= apply_filters( 'ampforwp_framework_get_post_pagination_link', $link, $prev );
55
- }
56
- $next = $page + 1;
57
- if ( $next <= $numpages ) {
58
- if ( $prev ) {
59
- $output .= $r['separator'];
60
- }
61
- $link = ampforwp_framework_get_post_paginated_link( $next ) . $r['link_before'] . $r['nextpagelink'] . $r['link_after'] . '</a>';
62
- $output .= apply_filters( 'ampforwp_framework_get_post_pagination_link', $link, $next );
63
- }
64
- $output .= $r['after'];
65
- }
66
- }
67
-
68
- /**
69
- * Filters the HTML output of page links for paginated posts.
70
- * @param string $output HTML output of paginated posts' page links.
71
- * @param array $args An array of arguments.
72
- */
73
- $html = apply_filters( 'ampforwp_framework_get_post_pagination', $output, $args );
74
- if($redux_builder_amp['amp-pagination']) {
75
- if ( $r['echo'] ) {
76
- echo $html;
77
- }
78
- return $html;
79
- }
80
-
81
- }
82
-
83
- /**
84
- * Helper function for ampforwp_framework_get_post_pagination().
85
- * @access private
86
- *
87
- * @global WP_Rewrite $wp_rewrite
88
- *
89
- * @param int $i Page number.
90
- * @return string Link.
91
- */
92
- function ampforwp_framework_get_post_paginated_link( $i ) {
93
- global $wp_rewrite;
94
- $post = get_post();
95
- $query_args = array();
96
- if ( 1 == $i ) {
97
- $url = get_permalink();
98
- } else {
99
- if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
100
- $url = add_query_arg( 'page', $i, get_permalink() );
101
- elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') == $post->ID )
102
- $url = trailingslashit(get_permalink()) . user_trailingslashit("$wp_rewrite->pagination_base/" . $i, 'single_paged');
103
- else
104
- $url = trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged');
105
- }
106
-
107
- if ( is_preview() ) {
108
-
109
- if ( ( 'draft' !== $post->post_status ) && isset( $_GET['preview_id'], $_GET['preview_nonce'] ) ) {
110
- $query_args['preview_id'] = wp_unslash( $_GET['preview_id'] );
111
- $query_args['preview_nonce'] = wp_unslash( $_GET['preview_nonce'] );
112
- }
113
-
114
- $url = get_preview_post_link( $post, $query_args, $url );
115
- }
116
-
117
- return '<a href="' . esc_url(trailingslashit( $url) ) . '?amp">';
118
- }
119
-
120
- add_filter('ampforwp_modify_rel_canonical','amp_paginated_post_modify_amphtml');
121
- function amp_paginated_post_modify_amphtml($url) {
122
- if(is_single()){
123
- $post_paginated_page='';
124
- $post_paginated_page = get_query_var('page');
125
- if($post_paginated_page){
126
- $url = get_permalink();
127
- $new_url = $url."$post_paginated_page/?amp";
128
- return $new_url;
129
- }
130
- }
131
- return $url;
132
- }
133
-
134
- add_action('amp_post_template_head','amp_paginated_post_modify_canonical',9);
135
- function amp_paginated_post_modify_canonical(){
136
- if(is_single()){
137
- $post_paginated_page='';
138
- $post_paginated_page = get_query_var('page');
139
- if($post_paginated_page){
140
- remove_action( 'amp_post_template_head', 'amp_post_template_add_canonical' );
141
- add_action('amp_post_template_head','amp_paginated_post_rel_canonical');
142
- }
143
- }
144
- }
145
- function amp_paginated_post_rel_canonical(){
146
- $post_paginated_page='';
147
- $new_canonical_url = '';
148
- global $post;
149
- $current_post_id = $post->ID;
150
- $new_canonical_url = get_permalink($current_post_id);
151
- $new_canonical_url = trailingslashit($new_canonical_url);
152
- $post_paginated_page = get_query_var('page');
153
- if($post_paginated_page){?>
154
- <link rel="canonical" href="<?php echo $new_canonical_url.$post_paginated_page ?>/" /><?php }
155
- }
156
-
157
- add_filter('ampforwp_modify_the_content','ampforwp_post_paginated_content');
158
- function ampforwp_post_paginated_content($content){
159
- global $redux_builder_amp;
160
- $ampforwp_new_content = '';
161
- $ampforwp_the_content = '';
162
- $ampforwp_the_content = $content;
163
- if($redux_builder_amp['amp-pagination']) {
164
- $ampforwp_new_content = explode('<!--nextpage-->', $ampforwp_the_content);
165
- $queried_var = get_query_var('page');
166
- if ( $queried_var > 1 ) {
167
- $queried_var = $queried_var -1 ;
168
- }
169
- else{
170
- $queried_var = 0;
171
- }
172
- return $ampforwp_new_content[$queried_var];
173
- } else{
174
- return $ampforwp_the_content;
175
- }
176
  }
1
+ <?php
2
+ function ampforwp_framework_get_post_pagination( $args = '' ) {
3
+
4
+ wp_reset_postdata();
5
+ global $page, $numpages, $multipage, $more, $redux_builder_amp;
6
+
7
+ $defaults = array(
8
+ 'before' => '<p>' . __( 'Page:' ),
9
+ 'after' => '</p>',
10
+ 'link_before' => '',
11
+ 'link_after' => '',
12
+ 'next_or_number' => 'number',
13
+ 'separator' => ' ',
14
+ 'nextpagelink' => __( 'Next page' ),
15
+ 'previouspagelink' => __( 'Previous page' ),
16
+ 'pagelink' => '%',
17
+ 'echo' => 1
18
+ );
19
+
20
+ $params = wp_parse_args( $args, $defaults );
21
+
22
+ /**
23
+ * Filters the arguments used in retrieving page links for paginated posts.
24
+ * @param array $params An array of arguments for page links for paginated posts.
25
+ */
26
+ $r = apply_filters( 'ampforwp_framework_get_post_pagination_args', $params );
27
+
28
+ $output = '';
29
+ if ( $multipage ) {
30
+ if ( 'number' == $r['next_or_number'] ) {
31
+ $output .= $r['before'];
32
+ for ( $i = 1; $i <= $numpages; $i++ ) {
33
+ $link = $r['link_before'] . str_replace( '%', $i, $r['pagelink'] ) . $r['link_after'];
34
+ if ( $i != $page || ! $more && 1 == $page ) {
35
+ $link = ampforwp_framework_get_post_paginated_link( $i ) . $link . '</a>';
36
+ }
37
+ /**
38
+ * Filters the HTML output of individual page number links.
39
+ * @param string $link The page number HTML output.
40
+ * @param int $i Page number for paginated posts' page links.
41
+ */
42
+ $link = apply_filters( 'ampforwp_framework_get_post_pagination_link', $link, $i );
43
+
44
+ // Use the custom links separator beginning with the second link.
45
+ $output .= ( 1 === $i ) ? ' ' : $r['separator'];
46
+ $output .= $link;
47
+ }
48
+ $output .= $r['after'];
49
+ } elseif ( $more ) {
50
+ $output .= $r['before'];
51
+ $prev = $page - 1;
52
+ if ( $prev > 0 ) {
53
+ $link = ampforwp_framework_get_post_paginated_link( $prev ) . $r['link_before'] . $r['previouspagelink'] . $r['link_after'] . '</a>';
54
+ $output .= apply_filters( 'ampforwp_framework_get_post_pagination_link', $link, $prev );
55
+ }
56
+ $next = $page + 1;
57
+ if ( $next <= $numpages ) {
58
+ if ( $prev ) {
59
+ $output .= $r['separator'];
60
+ }
61
+ $link = ampforwp_framework_get_post_paginated_link( $next ) . $r['link_before'] . $r['nextpagelink'] . $r['link_after'] . '</a>';
62
+ $output .= apply_filters( 'ampforwp_framework_get_post_pagination_link', $link, $next );
63
+ }
64
+ $output .= $r['after'];
65
+ }
66
+ }
67
+
68
+ /**
69
+ * Filters the HTML output of page links for paginated posts.
70
+ * @param string $output HTML output of paginated posts' page links.
71
+ * @param array $args An array of arguments.
72
+ */
73
+ $html = apply_filters( 'ampforwp_framework_get_post_pagination', $output, $args );
74
+ if($redux_builder_amp['amp-pagination']) {
75
+ if ( $r['echo'] ) {
76
+ echo $html;
77
+ }
78
+ return $html;
79
+ }
80
+
81
+ }
82
+
83
+ /**
84
+ * Helper function for ampforwp_framework_get_post_pagination().
85
+ * @access private
86
+ *
87
+ * @global WP_Rewrite $wp_rewrite
88
+ *
89
+ * @param int $i Page number.
90
+ * @return string Link.
91
+ */
92
+ function ampforwp_framework_get_post_paginated_link( $i ) {
93
+ global $wp_rewrite;
94
+ $post = get_post();
95
+ $query_args = array();
96
+ if ( 1 == $i ) {
97
+ $url = get_permalink();
98
+ } else {
99
+ if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
100
+ $url = add_query_arg( 'page', $i, get_permalink() );
101
+ elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') == $post->ID )
102
+ $url = trailingslashit(get_permalink()) . user_trailingslashit("$wp_rewrite->pagination_base/" . $i, 'single_paged');
103
+ else
104
+ $url = trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged');
105
+ }
106
+
107
+ if ( is_preview() ) {
108
+
109
+ if ( ( 'draft' !== $post->post_status ) && isset( $_GET['preview_id'], $_GET['preview_nonce'] ) ) {
110
+ $query_args['preview_id'] = wp_unslash( $_GET['preview_id'] );
111
+ $query_args['preview_nonce'] = wp_unslash( $_GET['preview_nonce'] );
112
+ }
113
+
114
+ $url = get_preview_post_link( $post, $query_args, $url );
115
+ }
116
+
117
+ return '<a href="' . esc_url(trailingslashit( $url) ) . '?amp">';
118
+ }
119
+
120
+ add_filter('ampforwp_modify_rel_canonical','amp_paginated_post_modify_amphtml');
121
+ function amp_paginated_post_modify_amphtml($url) {
122
+ if(is_single()){
123
+ $post_paginated_page='';
124
+ $post_paginated_page = get_query_var('page');
125
+ if($post_paginated_page){
126
+ $url = get_permalink();
127
+ $new_url = $url."$post_paginated_page/?amp";
128
+ return $new_url;
129
+ }
130
+ }
131
+ return $url;
132
+ }
133
+
134
+ add_action('amp_post_template_head','amp_paginated_post_modify_canonical',9);
135
+ function amp_paginated_post_modify_canonical(){
136
+ if(is_single()){
137
+ $post_paginated_page='';
138
+ $post_paginated_page = get_query_var('page');
139
+ if($post_paginated_page){
140
+ remove_action( 'amp_post_template_head', 'amp_post_template_add_canonical' );
141
+ add_action('amp_post_template_head','amp_paginated_post_rel_canonical');
142
+ }
143
+ }
144
+ }
145
+ function amp_paginated_post_rel_canonical(){
146
+ $post_paginated_page='';
147
+ $new_canonical_url = '';
148
+ global $post;
149
+ $current_post_id = $post->ID;
150
+ $new_canonical_url = get_permalink($current_post_id);
151
+ $new_canonical_url = trailingslashit($new_canonical_url);
152
+ $post_paginated_page = get_query_var('page');
153
+ if($post_paginated_page){?>
154
+ <link rel="canonical" href="<?php echo $new_canonical_url.$post_paginated_page ?>/" /><?php }
155
+ }
156
+
157
+ add_filter('ampforwp_modify_the_content','ampforwp_post_paginated_content');
158
+ function ampforwp_post_paginated_content($content){
159
+ global $redux_builder_amp;
160
+ $ampforwp_new_content = '';
161
+ $ampforwp_the_content = '';
162
+ $ampforwp_the_content = $content;
163
+ if($redux_builder_amp['amp-pagination']) {
164
+ $ampforwp_new_content = explode('<!--nextpage-->', $ampforwp_the_content);
165
+ $queried_var = get_query_var('page');
166
+ if ( $queried_var > 1 ) {
167
+ $queried_var = $queried_var -1 ;
168
+ }
169
+ else{
170
+ $queried_var = 0;
171
+ }
172
+ return $ampforwp_new_content[$queried_var];
173
+ } else{
174
+ return $ampforwp_the_content;
175
+ }
176
  }
components/related-posts/related-posts.php CHANGED
@@ -1,127 +1,127 @@
1
- <?php
2
- /*
3
- @data parameter have options for
4
- show_excerpt
5
- */
6
- function ampforwp_framework_get_related_posts($argsdata=array()){
7
- global $post, $redux_builder_amp;
8
- do_action('ampforwp_above_related_post'); //Above Related Posts
9
- $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
10
- $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
11
- $my_query = related_post_loop_query();
12
- if( $my_query->have_posts() ) { ?>
13
- <div class="amp-related-posts">
14
- <ul class="clearfix">
15
- <?php ampforwp_related_post(); ?>
16
- <?php
17
- while( $my_query->have_posts() ) {
18
- $my_query->the_post();
19
-
20
- ?>
21
- <li class="<?php if ( has_post_thumbnail() ) { echo'has_thumbnail'; } else { echo 'no_thumbnail'; } ?>">
22
- <?php
23
- $related_post_permalink = ampforwp_url_controller( get_permalink() );
24
- ampforwp_get_relatedpost_image('thumbnail');
25
- ampforwp_get_relatedpost_content($argsdata);
26
- ?>
27
- </li><?php
28
- }
29
-
30
- } ?>
31
- </ul>
32
- </div>
33
- <?php wp_reset_postdata(); ?>
34
- <?php do_action('ampforwp_below_related_post_hook');
35
- }
36
-
37
-
38
- function related_post_loop_query(){
39
- global $post, $redux_builder_amp;
40
- $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
41
- $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
42
- $args = null;
43
-
44
- if($redux_builder_amp['ampforwp-single-select-type-of-related']==2){
45
- $categories = get_the_category($post->ID);
46
- if ($categories) {
47
- $category_ids = array();
48
- foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
49
- $args=array(
50
- 'category__in' => $category_ids,
51
- 'post__not_in' => array($post->ID),
52
- 'posts_per_page'=> $int_number_of_related_posts,
53
- 'ignore_sticky_posts'=>1,
54
- 'has_password' => false ,
55
- 'post_status'=> 'publish'
56
- );
57
- }
58
- }
59
- // tags
60
- if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
61
- $ampforwp_tags = get_the_tags($post->ID);
62
- if ($ampforwp_tags) {
63
- $tag_ids = array();
64
- foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
65
- $args=array(
66
- 'tag__in' => $tag_ids,
67
- 'post__not_in' => array($post->ID),
68
- 'posts_per_page'=> $int_number_of_related_posts,
69
- 'ignore_sticky_posts'=>1,
70
- 'has_password' => false ,
71
- 'post_status'=> 'publish'
72
- );
73
- }
74
- }
75
- $my_query = new wp_query( $args );
76
- return $my_query;
77
- }
78
-
79
- function ampforwp_related_post(){
80
- global $redux_builder_amp;
81
- ?>
82
- <h3 class="amp-related-posts-title"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ); ?></h3>
83
- <?php }
84
-
85
-
86
- function ampforwp_get_relatedpost_image( $imagetype ='thumbnail'){
87
- $related_post_permalink = ampforwp_url_controller( get_permalink() );
88
- ?>
89
- <a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
90
- <?php
91
- $thumb_id_2 = get_post_thumbnail_id();
92
- $thumb_url_array_2 = wp_get_attachment_image_src($thumb_id_2, $imagetype, true);
93
- $thumb_url_2 = $thumb_url_array_2[0];
94
-
95
- if ( has_post_thumbnail() ) { ?>
96
- <amp-img src="<?php echo esc_url( $thumb_url_2 ); ?>" width="<?php echo $thumb_url_array_2[1]; ?>" height="<?php echo $thumb_url_array_2[2]; ?>" layout="responsive"></amp-img>
97
- <?php } ?>
98
- </a>
99
- <?php
100
- }
101
- function ampforwp_get_relatedpost_content($argsdata=array()){
102
- $related_post_permalink = ampforwp_url_controller( get_permalink() );
103
- ?>
104
- <div class="related_link">
105
- <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
106
-
107
- <?php
108
- $show_excerpt = (isset($argsdata['show_excerpt'])? $argsdata['show_excerpt'] : true);
109
- if($show_excerpt){
110
- if(has_excerpt()){
111
- $content = get_the_excerpt();
112
- }else{
113
- $content = get_the_content();
114
- }
115
- ?><p><?php
116
- echo wp_trim_words( strip_shortcodes( $content ) , '15' );
117
- ?></p><?php
118
- }
119
- $show_author = (isset($argsdata['show_author'])? $argsdata['show_author'] : true);
120
- if($show_author){
121
- $author_args = isset($argsdata['author_args'])? $argsdata['author_args'] : array();
122
- ampforwp_framework_get_author_box($author_args);
123
- }
124
- ?>
125
- </div>
126
- <?php
127
  }
1
+ <?php
2
+ /*
3
+ @data parameter have options for
4
+ show_excerpt
5
+ */
6
+ function ampforwp_framework_get_related_posts($argsdata=array()){
7
+ global $post, $redux_builder_amp;
8
+ do_action('ampforwp_above_related_post'); //Above Related Posts
9
+ $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
10
+ $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
11
+ $my_query = related_post_loop_query();
12
+ if( $my_query->have_posts() ) { ?>
13
+ <div class="amp-related-posts">
14
+ <ul class="clearfix">
15
+ <?php ampforwp_related_post(); ?>
16
+ <?php
17
+ while( $my_query->have_posts() ) {
18
+ $my_query->the_post();
19
+
20
+ ?>
21
+ <li class="<?php if ( has_post_thumbnail() ) { echo'has_thumbnail'; } else { echo 'no_thumbnail'; } ?>">
22
+ <?php
23
+ $related_post_permalink = ampforwp_url_controller( get_permalink() );
24
+ ampforwp_get_relatedpost_image('thumbnail');
25
+ ampforwp_get_relatedpost_content($argsdata);
26
+ ?>
27
+ </li><?php
28
+ }
29
+
30
+ } ?>
31
+ </ul>
32
+ </div>
33
+ <?php wp_reset_postdata(); ?>
34
+ <?php do_action('ampforwp_below_related_post_hook');
35
+ }
36
+
37
+
38
+ function related_post_loop_query(){
39
+ global $post, $redux_builder_amp;
40
+ $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
41
+ $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
42
+ $args = null;
43
+
44
+ if($redux_builder_amp['ampforwp-single-select-type-of-related']==2){
45
+ $categories = get_the_category($post->ID);
46
+ if ($categories) {
47
+ $category_ids = array();
48
+ foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
49
+ $args=array(
50
+ 'category__in' => $category_ids,
51
+ 'post__not_in' => array($post->ID),
52
+ 'posts_per_page'=> $int_number_of_related_posts,
53
+ 'ignore_sticky_posts'=>1,
54
+ 'has_password' => false ,
55
+ 'post_status'=> 'publish'
56
+ );
57
+ }
58
+ }
59
+ // tags
60
+ if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
61
+ $ampforwp_tags = get_the_tags($post->ID);
62
+ if ($ampforwp_tags) {
63
+ $tag_ids = array();
64
+ foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
65
+ $args=array(
66
+ 'tag__in' => $tag_ids,
67
+ 'post__not_in' => array($post->ID),
68
+ 'posts_per_page'=> $int_number_of_related_posts,
69
+ 'ignore_sticky_posts'=>1,
70
+ 'has_password' => false ,
71
+ 'post_status'=> 'publish'
72
+ );
73
+ }
74
+ }
75
+ $my_query = new wp_query( $args );
76
+ return $my_query;
77
+ }
78
+
79
+ function ampforwp_related_post(){
80
+ global $redux_builder_amp;
81
+ ?>
82
+ <h3 class="amp-related-posts-title"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ); ?></h3>
83
+ <?php }
84
+
85
+
86
+ function ampforwp_get_relatedpost_image( $imagetype ='thumbnail'){
87
+ $related_post_permalink = ampforwp_url_controller( get_permalink() );
88
+ ?>
89
+ <a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
90
+ <?php
91
+ $thumb_id_2 = get_post_thumbnail_id();
92
+ $thumb_url_array_2 = wp_get_attachment_image_src($thumb_id_2, $imagetype, true);
93
+ $thumb_url_2 = $thumb_url_array_2[0];
94
+
95
+ if ( has_post_thumbnail() ) { ?>
96
+ <amp-img src="<?php echo esc_url( $thumb_url_2 ); ?>" width="<?php echo $thumb_url_array_2[1]; ?>" height="<?php echo $thumb_url_array_2[2]; ?>" layout="responsive"></amp-img>
97
+ <?php } ?>
98
+ </a>
99
+ <?php
100
+ }
101
+ function ampforwp_get_relatedpost_content($argsdata=array()){
102
+ $related_post_permalink = ampforwp_url_controller( get_permalink() );
103
+ ?>
104
+ <div class="related_link">
105
+ <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
106
+
107
+ <?php
108
+ $show_excerpt = (isset($argsdata['show_excerpt'])? $argsdata['show_excerpt'] : true);
109
+ if($show_excerpt){
110
+ if(has_excerpt()){
111
+ $content = get_the_excerpt();
112
+ }else{
113
+ $content = get_the_content();
114
+ }
115
+ ?><p><?php
116
+ echo wp_trim_words( strip_shortcodes( $content ) , '15' );
117
+ ?></p><?php
118
+ }
119
+ $show_author = (isset($argsdata['show_author'])? $argsdata['show_author'] : true);
120
+ if($show_author){
121
+ $author_args = isset($argsdata['author_args'])? $argsdata['author_args'] : array();
122
+ ampforwp_framework_get_author_box($author_args);
123
+ }
124
+ ?>
125
+ </div>
126
+ <?php
127
  }
components/search/search.php CHANGED
@@ -1,27 +1,27 @@
1
- <?php
2
- //main output function
3
- function ampforwp_framework_get_search_form() {
4
- global $redux_builder_amp;
5
- $action_url = '';
6
- $label = ampforwp_translation(isset($redux_builder_amp['ampforwp-search-label']) && $redux_builder_amp['ampforwp-search-label'], 'Type your search query and hit enter');
7
- $action_url = esc_url( get_bloginfo('url') );
8
- $action_url = preg_replace('#^http?:#', '', $action_url);
9
- $placeholder = ampforwp_translation($redux_builder_amp['ampforwp-search-placeholder'], 'Type Here' );
10
- $form = '<form role="search" method="get" id="amp-search" class="amp-search" target="_top" action="' . $action_url .'">
11
- <div class="amp-search-wrapper">
12
- <label class="screen-reader-text" for="s">' . $label . '</label>
13
- <input type="text" placeholder="AMP" value="1" name="amp" class="hidden"/>
14
- <input type="text" placeholder="'.$placeholder.'" value="' . get_search_query() . '" name="s" id="s" />
15
- <input type="submit" id="amp-search-submit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
16
- </div>
17
- </form>';
18
- echo $form;
19
-
20
- }
21
- ampforwp_add_scripts();
22
- function ampforwp_add_scripts(){
23
- global $scriptComponent;
24
- if ( empty( $scriptComponent['amp-form'] ) ) {
25
- $scriptComponent['amp-form'] = 'https://cdn.ampproject.org/v0/amp-form-0.1.js';
26
- }
27
  }
1
+ <?php
2
+ //main output function
3
+ function ampforwp_framework_get_search_form() {
4
+ global $redux_builder_amp;
5
+ $action_url = '';
6
+ $label = ampforwp_translation(isset($redux_builder_amp['ampforwp-search-label']) && $redux_builder_amp['ampforwp-search-label'], 'Type your search query and hit enter');
7
+ $action_url = esc_url( get_bloginfo('url') );
8
+ $action_url = preg_replace('#^http?:#', '', $action_url);
9
+ $placeholder = ampforwp_translation($redux_builder_amp['ampforwp-search-placeholder'], 'Type Here' );
10
+ $form = '<form role="search" method="get" id="amp-search" class="amp-search" target="_top" action="' . $action_url .'">
11
+ <div class="amp-search-wrapper">
12
+ <label class="screen-reader-text" for="s">' . $label . '</label>
13
+ <input type="text" placeholder="AMP" value="1" name="amp" class="hidden"/>
14
+ <input type="text" placeholder="'.$placeholder.'" value="' . get_search_query() . '" name="s" id="s" />
15
+ <input type="submit" id="amp-search-submit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
16
+ </div>
17
+ </form>';
18
+ echo $form;
19
+
20
+ }
21
+ ampforwp_add_scripts();
22
+ function ampforwp_add_scripts(){
23
+ global $scriptComponent;
24
+ if ( empty( $scriptComponent['amp-form'] ) ) {
25
+ $scriptComponent['amp-form'] = 'https://cdn.ampproject.org/v0/amp-form-0.1.js';
26
+ }
27
  }
components/sidebar/sidebar.php CHANGED
@@ -1,79 +1,79 @@
1
- <?php
2
- if(!function_exists('ampforwp_framework_get_sideabr')){
3
- function ampforwp_framework_get_sideabr($data=array()){
4
- if(!isset($data['action'])){
5
- echo 'action not found';
6
- }
7
- $action = $data['action'];
8
- unset($data['action']);
9
- switch(strtolower($action)) {
10
- case 'start':
11
- echo sideber_begin($data);
12
- do_action('amp_sidebar_start');
13
- break;
14
- case 'end':
15
- do_action('amp_sidebar_end');
16
- echo sideber_end();
17
- break;
18
- case 'open-button':
19
- echo sidebar_opening_button($data);
20
- break;
21
- case 'close-button':
22
- echo sidebar_close_button($data);
23
- break;
24
- default:
25
- echo 'action not found';
26
- break;
27
- }
28
- }
29
- }
30
- function sidebar_close_button($data=array() ){
31
- $id = 'sidebar';
32
- $class = 'amp-sidebar-close';
33
- if(isset($data['id'])){
34
- $id = $data['id'];
35
- }
36
- if(isset($data['class'])){
37
- $class .= $data['class'];
38
- }
39
- return '<div role="button" tabindex="0" on="tap:'.$id.'.close" class="'.$class.'">X</div>';
40
- }
41
- function sidebar_opening_button($data=array()){
42
- $id = 'sidebar';
43
- $class = 'amp-sidebar-button';
44
- if(isset($data['id'])){
45
- $id = $data['id'];
46
- }
47
- if(isset($data['class'])){
48
- $class = $data['class'];
49
- }
50
- return '<div on="tap:'.$id.'.toggle" role="button" tabindex="0" class="'.$class.'">
51
- <a href="#" class="amp-sidebar-toggle">
52
- <span></span>
53
- <span></span>
54
- <span></span>
55
- </a>
56
- </div>';
57
- }
58
- function sideber_begin($data=array()){
59
- $attribute = '';
60
- if(count($data)>0){
61
- foreach ($data as $key => $value) {
62
- $attribute .= $key.'="'.$value.'" ' ;
63
- }
64
- }else{
65
- $attribute = "id='sidebar' layout='nodisplay' side='right'";
66
- }
67
- return '<amp-sidebar '.$attribute.'>';
68
- }
69
-
70
- function sideber_end(){
71
- return '</amp-sidebar>';
72
- }
73
- ampforwp_add_sidebar_scripts();
74
- function ampforwp_add_sidebar_scripts(){
75
- global $scriptComponent;
76
- if ( empty( $scriptComponent['amp-sidebar'] ) ) {
77
- $scriptComponent['amp-sidebar'] = 'https://cdn.ampproject.org/v0/amp-sidebar-0.1.js';
78
- }
79
  }
1
+ <?php
2
+ if(!function_exists('ampforwp_framework_get_sideabr')){
3
+ function ampforwp_framework_get_sideabr($data=array()){
4
+ if(!isset($data['action'])){
5
+ echo 'action not found';
6
+ }
7
+ $action = $data['action'];
8
+ unset($data['action']);
9
+ switch(strtolower($action)) {
10
+ case 'start':
11
+ echo sideber_begin($data);
12
+ do_action('amp_sidebar_start');
13
+ break;
14
+ case 'end':
15
+ do_action('amp_sidebar_end');
16
+ echo sideber_end();
17
+ break;
18
+ case 'open-button':
19
+ echo sidebar_opening_button($data);
20
+ break;
21
+ case 'close-button':
22
+ echo sidebar_close_button($data);
23
+ break;
24
+ default:
25
+ echo 'action not found';
26
+ break;
27
+ }
28
+ }
29
+ }
30
+ function sidebar_close_button($data=array() ){
31
+ $id = 'sidebar';
32
+ $class = 'amp-sidebar-close';
33
+ if(isset($data['id'])){
34
+ $id = $data['id'];
35
+ }
36
+ if(isset($data['class'])){
37
+ $class .= $data['class'];
38
+ }
39
+ return '<div role="button" tabindex="0" on="tap:'.$id.'.close" class="'.$class.'">X</div>';
40
+ }
41
+ function sidebar_opening_button($data=array()){
42
+ $id = 'sidebar';
43
+ $class = 'amp-sidebar-button';
44
+ if(isset($data['id'])){
45
+ $id = $data['id'];
46
+ }
47
+ if(isset($data['class'])){
48
+ $class = $data['class'];
49
+ }
50
+ return '<div on="tap:'.$id.'.toggle" role="button" tabindex="0" class="'.$class.'">
51
+ <a href="#" class="amp-sidebar-toggle">
52
+ <span></span>
53
+ <span></span>
54
+ <span></span>
55
+ </a>
56
+ </div>';
57
+ }
58
+ function sideber_begin($data=array()){
59
+ $attribute = '';
60
+ if(count($data)>0){
61
+ foreach ($data as $key => $value) {
62
+ $attribute .= $key.'="'.$value.'" ' ;
63
+ }
64
+ }else{
65
+ $attribute = "id='sidebar' layout='nodisplay' side='right'";
66
+ }
67
+ return '<amp-sidebar '.$attribute.'>';
68
+ }
69
+
70
+ function sideber_end(){
71
+ return '</amp-sidebar>';
72
+ }
73
+ ampforwp_add_sidebar_scripts();
74
+ function ampforwp_add_sidebar_scripts(){
75
+ global $scriptComponent;
76
+ if ( empty( $scriptComponent['amp-sidebar'] ) ) {
77
+ $scriptComponent['amp-sidebar'] = 'https://cdn.ampproject.org/v0/amp-sidebar-0.1.js';
78
+ }
79
  }
components/social-icons/fonts/icomoon.svg CHANGED
@@ -1,22 +1,22 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Generated by IcoMoon</metadata>
5
- <defs>
6
- <font id="icomoon" horiz-adv-x="1024">
7
- <font-face units-per-em="1024" ascent="960" descent="-64" />
8
- <missing-glyph horiz-adv-x="1024" />
9
- <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
- <glyph unicode="&#xf099;" glyph-name="twitter" horiz-adv-x="951" d="M925.714 717.714c-25.143-36.571-56.571-69.143-92.571-95.429 0.571-8 0.571-16 0.571-24 0-244-185.714-525.143-525.143-525.143-104.571 0-201.714 30.286-283.429 82.857 14.857-1.714 29.143-2.286 44.571-2.286 86.286 0 165.714 29.143 229.143 78.857-81.143 1.714-149.143 54.857-172.571 128 11.429-1.714 22.857-2.857 34.857-2.857 16.571 0 33.143 2.286 48.571 6.286-84.571 17.143-148 91.429-148 181.143v2.286c24.571-13.714 53.143-22.286 83.429-23.429-49.714 33.143-82.286 89.714-82.286 153.714 0 34.286 9.143 65.714 25.143 93.143 90.857-112 227.429-185.143 380.571-193.143-2.857 13.714-4.571 28-4.571 42.286 0 101.714 82.286 184.571 184.571 184.571 53.143 0 101.143-22.286 134.857-58.286 41.714 8 81.714 23.429 117.143 44.571-13.714-42.857-42.857-78.857-81.143-101.714 37.143 4 73.143 14.286 106.286 28.571z" />
11
- <glyph unicode="&#xf09a;" glyph-name="facebook, facebook-f" horiz-adv-x="602" d="M548 944v-150.857h-89.714c-70.286 0-83.429-33.714-83.429-82.286v-108h167.429l-22.286-169.143h-145.143v-433.714h-174.857v433.714h-145.714v169.143h145.714v124.571c0 144.571 88.571 223.429 217.714 223.429 61.714 0 114.857-4.571 130.286-6.857z" />
12
- <glyph unicode="&#xf0d2;" glyph-name="pinterest" horiz-adv-x="878" d="M877.714 438.857c0-242.286-196.571-438.857-438.857-438.857-43.429 0-84.571 6.286-124.571 18.286 16.571 26.286 35.429 60 44.571 93.714 0 0 5.143 19.429 30.857 120.571 14.857-29.143 59.429-54.857 106.857-54.857 141.143 0 237.143 128.571 237.143 301.143 0 129.714-110.286 251.429-278.286 251.429-208 0-313.143-149.714-313.143-274.286 0-75.429 28.571-142.857 89.714-168 9.714-4 18.857 0 21.714 11.429 2.286 7.429 6.857 26.857 9.143 34.857 2.857 11.429 1.714 14.857-6.286 24.571-17.714 21.143-29.143 48-29.143 86.286 0 110.857 82.857 210.286 216 210.286 117.714 0 182.857-72 182.857-168.571 0-126.286-56-233.143-139.429-233.143-45.714 0-80 37.714-69.143 84.571 13.143 55.429 38.857 115.429 38.857 155.429 0 36-19.429 66.286-59.429 66.286-46.857 0-84.571-48.571-84.571-113.714 0 0 0-41.714 14.286-69.714-48-203.429-56.571-238.857-56.571-238.857-8-33.143-8.571-70.286-7.429-101.143-154.857 68-262.857 222.286-262.857 402.286 0 242.286 196.571 438.857 438.857 438.857s438.857-196.571 438.857-438.857z" />
13
- <glyph unicode="&#xf0d5;" glyph-name="google-plus" horiz-adv-x="1317" d="M821.143 429.143c0-239.429-160.571-409.143-402.286-409.143-231.429 0-418.857 187.429-418.857 418.857s187.429 418.857 418.857 418.857c113.143 0 207.429-41.143 280.571-109.714l-113.714-109.143c-30.857 29.714-85.143 64.571-166.857 64.571-142.857 0-259.429-118.286-259.429-264.571s116.571-264.571 259.429-264.571c165.714 0 228 119.429 237.714 180.571h-237.714v144h395.429c4-21.143 6.857-42.286 6.857-69.714zM1316.571 498.857v-120h-119.429v-119.429h-120v119.429h-119.429v120h119.429v119.429h120v-119.429h119.429z" />
14
- <glyph unicode="&#xf0e1;" glyph-name="linkedin" horiz-adv-x="878" d="M199.429 593.714v-566.286h-188.571v566.286h188.571zM211.429 768.571c0.571-54.286-40.571-97.714-106.286-97.714v0h-1.143c-63.429 0-104 43.429-104 97.714 0 55.429 42.286 97.714 106.286 97.714 64.571 0 104.571-42.286 105.143-97.714zM877.714 352v-324.571h-188v302.857c0 76-27.429 128-95.429 128-52 0-82.857-34.857-96.571-68.571-4.571-12.571-6.286-29.143-6.286-46.286v-316h-188c2.286 513.143 0 566.286 0 566.286h188v-82.286h-1.143c24.571 38.857 69.143 95.429 170.857 95.429 124 0 216.571-81.143 216.571-254.857z" />
15
- <glyph unicode="&#xf16a;" glyph-name="youtube-play" d="M406.286 306.286l276.571 142.857-276.571 144.571v-287.429zM512 798.857c215.429 0 358.286-10.286 358.286-10.286 20-2.286 64-2.286 102.857-43.429 0 0 31.429-30.857 40.571-101.714 10.857-82.857 10.286-165.714 10.286-165.714v-77.714s0.571-82.857-10.286-165.714c-9.143-70.286-40.571-101.714-40.571-101.714-38.857-40.571-82.857-40.571-102.857-42.857 0 0-142.857-10.857-358.286-10.857v0c-266.286 2.286-348 10.286-348 10.286-22.857 4-74.286 2.857-113.143 43.429 0 0-31.429 31.429-40.571 101.714-10.857 82.857-10.286 165.714-10.286 165.714v77.714s-0.571 82.857 10.286 165.714c9.143 70.857 40.571 101.714 40.571 101.714 38.857 41.143 82.857 41.143 102.857 43.429 0 0 142.857 10.286 358.286 10.286v0z" />
16
- <glyph unicode="&#xf16d;" glyph-name="instagram" horiz-adv-x="878" d="M585.143 438.857c0 80.571-65.714 146.286-146.286 146.286s-146.286-65.714-146.286-146.286 65.714-146.286 146.286-146.286 146.286 65.714 146.286 146.286zM664 438.857c0-124.571-100.571-225.143-225.143-225.143s-225.143 100.571-225.143 225.143 100.571 225.143 225.143 225.143 225.143-100.571 225.143-225.143zM725.714 673.143c0-29.143-23.429-52.571-52.571-52.571s-52.571 23.429-52.571 52.571 23.429 52.571 52.571 52.571 52.571-23.429 52.571-52.571zM438.857 798.857c-64 0-201.143 5.143-258.857-17.714-20-8-34.857-17.714-50.286-33.143s-25.143-30.286-33.143-50.286c-22.857-57.714-17.714-194.857-17.714-258.857s-5.143-201.143 17.714-258.857c8-20 17.714-34.857 33.143-50.286s30.286-25.143 50.286-33.143c57.714-22.857 194.857-17.714 258.857-17.714s201.143-5.143 258.857 17.714c20 8 34.857 17.714 50.286 33.143s25.143 30.286 33.143 50.286c22.857 57.714 17.714 194.857 17.714 258.857s5.143 201.143-17.714 258.857c-8 20-17.714 34.857-33.143 50.286s-30.286 25.143-50.286 33.143c-57.714 22.857-194.857 17.714-258.857 17.714zM877.714 438.857c0-60.571 0.571-120.571-2.857-181.143-3.429-70.286-19.429-132.571-70.857-184s-113.714-67.429-184-70.857c-60.571-3.429-120.571-2.857-181.143-2.857s-120.571-0.571-181.143 2.857c-70.286 3.429-132.571 19.429-184 70.857s-67.429 113.714-70.857 184c-3.429 60.571-2.857 120.571-2.857 181.143s-0.571 120.571 2.857 181.143c3.429 70.286 19.429 132.571 70.857 184s113.714 67.429 184 70.857c60.571 3.429 120.571 2.857 181.143 2.857s120.571 0.571 181.143-2.857c70.286-3.429 132.571-19.429 184-70.857s67.429-113.714 70.857-184c3.429-60.571 2.857-120.571 2.857-181.143z" />
17
- <glyph unicode="&#xf173;" glyph-name="tumblr" horiz-adv-x="624" d="M539.429 191.428l45.714-135.429c-17.143-25.714-94.857-54.857-164.571-56-207.429-3.429-285.714 147.429-285.714 253.714v310.857h-96v122.857c144 52 178.857 182.286 186.857 256.571 0.571 4.571 4.571 6.857 6.857 6.857h139.429v-242.286h190.286v-144h-190.857v-296c0-40 14.857-95.429 91.429-93.714 25.143 0.571 58.857 8 76.571 16.571z" />
18
- <glyph unicode="&#xf189;" glyph-name="vk" horiz-adv-x="1119" d="M1095.429 653.714c8.571-23.429-18.286-78.286-85.714-168-110.857-147.429-122.857-133.714-31.429-218.857 88-81.714 106.286-121.143 109.143-126.286 0 0 36.571-64-40.571-64.571l-146.286-2.286c-31.429-6.286-73.143 22.286-73.143 22.286-54.857 37.714-106.286 135.429-146.286 122.857 0 0-41.143-13.143-40-101.143 0.571-18.857-8.571-29.143-8.571-29.143s-10.286-10.857-30.286-12.571h-65.714c-144.571-9.143-272 124-272 124s-139.429 144-261.714 431.429c-8 18.857 0.571 28 0.571 28s8.571 10.857 32.571 10.857l156.571 1.143c14.857-2.286 25.143-10.286 25.143-10.286s9.143-6.286 13.714-18.286c25.714-64 58.857-122.286 58.857-122.286 57.143-117.714 96-137.714 118.286-125.714 0 0 29.143 17.714 22.857 160-2.286 51.429-16.571 74.857-16.571 74.857-13.143 17.714-37.714 22.857-48.571 24.571-8.571 1.143 5.714 21.714 24.571 30.857 28 13.714 77.714 14.286 136.571 13.714 46.286-0.571 59.429-3.429 77.143-7.429 54.286-13.143 36-63.429 36-184.571 0-38.857-7.429-93.143 20.571-110.857 12-8 41.714-1.143 114.857 123.429 0 0 34.286 59.429 61.143 128.571 4.571 12.571 14.286 17.714 14.286 17.714s9.143 5.143 21.714 3.429l164.571 1.143c49.714 6.286 57.714-16.571 57.714-16.571z" />
19
- <glyph unicode="&#xf232;" glyph-name="whatsapp" horiz-adv-x="878" d="M562.857 394.286c9.714 0 102.857-48.571 106.857-55.429 1.143-2.857 1.143-6.286 1.143-8.571 0-14.286-4.571-30.286-9.714-43.429-13.143-32-66.286-52.571-98.857-52.571-27.429 0-84 24-108.571 35.429-81.714 37.143-132.571 100.571-181.714 173.143-21.714 32-41.143 71.429-40.571 110.857v4.571c1.143 37.714 14.857 64.571 42.286 90.286 8.571 8 17.714 12.571 29.714 12.571 6.857 0 13.714-1.714 21.143-1.714 15.429 0 18.286-4.571 24-19.429 4-9.714 33.143-87.429 33.143-93.143 0-21.714-39.429-46.286-39.429-59.429 0-2.857 1.143-5.714 2.857-8.571 12.571-26.857 36.571-57.714 58.286-78.286 26.286-25.143 54.286-41.714 86.286-57.714 4-2.286 8-4 12.571-4 17.143 0 45.714 55.429 60.571 55.429zM446.857 91.428c197.714 0 358.857 161.143 358.857 358.857s-161.143 358.857-358.857 358.857-358.857-161.143-358.857-358.857c0-75.429 24-149.143 68.571-210.286l-45.143-133.143 138.286 44c58.286-38.286 127.429-59.429 197.143-59.429zM446.857 881.143c237.714 0 430.857-193.143 430.857-430.857s-193.143-430.857-430.857-430.857c-72.571 0-144.571 18.286-208.571 53.714l-238.286-76.571 77.714 231.429c-40.571 66.857-61.714 144-61.714 222.286 0 237.714 193.143 430.857 430.857 430.857z" />
20
- <glyph unicode="&#xf281;" glyph-name="reddit-alien" d="M1024 467.428c0-44.571-25.143-82.857-62.286-101.714 4.571-17.714 6.857-36 6.857-54.857 0-180.571-204-326.857-455.429-326.857-250.857 0-454.857 146.286-454.857 326.857 0 18.286 2.286 36.571 6.286 53.714-38.286 18.857-64.571 57.714-64.571 102.857 0 62.857 50.857 113.714 113.714 113.714 32.571 0 61.714-13.714 82.857-36 77.143 53.714 180 88.571 294.286 92.571l66.286 297.714c2.286 10.286 13.143 17.143 23.429 14.857l210.857-46.286c13.714 27.429 42.857 46.857 76 46.857 47.429 0 85.714-38.286 85.714-85.143 0-47.429-38.286-85.714-85.714-85.714-46.857 0-85.143 38.286-85.143 85.143l-190.857 42.286-59.429-269.714c114.857-3.429 218.857-37.714 296.571-91.429 20.571 21.714 49.714 34.857 81.714 34.857 62.857 0 113.714-50.857 113.714-113.714zM238.857 353.714c0-47.429 38.286-85.714 85.143-85.714 47.429 0 85.714 38.286 85.714 85.714 0 46.857-38.286 85.143-85.714 85.143-46.857 0-85.143-38.286-85.143-85.143zM701.714 150.857c8.571 8.571 8.571 21.143 0 29.714-8 8-21.143 8-29.143 0-34.286-34.857-108-46.857-160.571-46.857s-126.286 12-160.571 46.857c-8 8-21.143 8-29.143 0-8.571-8-8.571-21.143 0-29.714 54.286-54.286 158.857-58.286 189.714-58.286s135.429 4 189.714 58.286zM700 268c46.857 0 85.143 38.286 85.143 85.714 0 46.857-38.286 85.143-85.143 85.143-47.429 0-85.714-38.286-85.714-85.143 0-47.429 38.286-85.714 85.714-85.714z" />
21
- <glyph unicode="&#xf2ac;" glyph-name="snapchat-ghost" horiz-adv-x="951" d="M484.571 877.714c102.857 1.143 188-56.571 230.857-149.143 13.143-28 15.429-71.429 15.429-102.286 0-36.571-2.857-72.571-5.143-109.143 4.571-2.286 10.857-4 16-4 20.571 0 37.714 15.429 58.286 15.429 19.429 0 47.429-13.714 47.429-36.571 0-54.857-114.857-44.571-114.857-92.571 0-8.571 3.429-16.571 6.857-24.571 27.429-60 79.429-117.714 141.143-143.429 14.857-6.286 29.714-9.714 45.714-13.143 10.286-2.286 16-9.714 16-20 0-38.857-98.857-54.857-125.143-58.857-11.429-17.714-2.857-59.429-33.143-59.429-23.429 0-46.857 7.429-72 7.429-12 0-24-0.571-35.429-2.857-68-11.429-90.857-84.571-202.286-84.571-107.429 0-133.143 73.143-199.429 84.571-12 2.286-24 2.857-36 2.857-25.714 0-50.286-8.571-70.857-8.571-32 0-22.286 42.286-34.286 60.571-26.286 4-125.143 20-125.143 58.857 0 10.286 5.714 17.714 16 20 16 3.429 30.857 6.857 45.714 13.143 61.143 25.143 114.286 83.429 141.143 143.429 3.429 8 6.857 16 6.857 24.571 0 48-115.429 38.857-115.429 92 0 22.286 26.286 36.571 46.286 36.571 17.714 0 35.429-14.857 57.714-14.857 6.286 0 12.571 1.143 18.286 4-2.286 36-5.143 72-5.143 108.571 0 30.857 2.286 74.857 15.429 102.857 50.286 108.571 135.429 148 249.143 149.143z" />
22
  </font></defs></svg>
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Generated by IcoMoon</metadata>
5
+ <defs>
6
+ <font id="icomoon" horiz-adv-x="1024">
7
+ <font-face units-per-em="1024" ascent="960" descent="-64" />
8
+ <missing-glyph horiz-adv-x="1024" />
9
+ <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
+ <glyph unicode="&#xf099;" glyph-name="twitter" horiz-adv-x="951" d="M925.714 717.714c-25.143-36.571-56.571-69.143-92.571-95.429 0.571-8 0.571-16 0.571-24 0-244-185.714-525.143-525.143-525.143-104.571 0-201.714 30.286-283.429 82.857 14.857-1.714 29.143-2.286 44.571-2.286 86.286 0 165.714 29.143 229.143 78.857-81.143 1.714-149.143 54.857-172.571 128 11.429-1.714 22.857-2.857 34.857-2.857 16.571 0 33.143 2.286 48.571 6.286-84.571 17.143-148 91.429-148 181.143v2.286c24.571-13.714 53.143-22.286 83.429-23.429-49.714 33.143-82.286 89.714-82.286 153.714 0 34.286 9.143 65.714 25.143 93.143 90.857-112 227.429-185.143 380.571-193.143-2.857 13.714-4.571 28-4.571 42.286 0 101.714 82.286 184.571 184.571 184.571 53.143 0 101.143-22.286 134.857-58.286 41.714 8 81.714 23.429 117.143 44.571-13.714-42.857-42.857-78.857-81.143-101.714 37.143 4 73.143 14.286 106.286 28.571z" />
11
+ <glyph unicode="&#xf09a;" glyph-name="facebook, facebook-f" horiz-adv-x="602" d="M548 944v-150.857h-89.714c-70.286 0-83.429-33.714-83.429-82.286v-108h167.429l-22.286-169.143h-145.143v-433.714h-174.857v433.714h-145.714v169.143h145.714v124.571c0 144.571 88.571 223.429 217.714 223.429 61.714 0 114.857-4.571 130.286-6.857z" />
12
+ <glyph unicode="&#xf0d2;" glyph-name="pinterest" horiz-adv-x="878" d="M877.714 438.857c0-242.286-196.571-438.857-438.857-438.857-43.429 0-84.571 6.286-124.571 18.286 16.571 26.286 35.429 60 44.571 93.714 0 0 5.143 19.429 30.857 120.571 14.857-29.143 59.429-54.857 106.857-54.857 141.143 0 237.143 128.571 237.143 301.143 0 129.714-110.286 251.429-278.286 251.429-208 0-313.143-149.714-313.143-274.286 0-75.429 28.571-142.857 89.714-168 9.714-4 18.857 0 21.714 11.429 2.286 7.429 6.857 26.857 9.143 34.857 2.857 11.429 1.714 14.857-6.286 24.571-17.714 21.143-29.143 48-29.143 86.286 0 110.857 82.857 210.286 216 210.286 117.714 0 182.857-72 182.857-168.571 0-126.286-56-233.143-139.429-233.143-45.714 0-80 37.714-69.143 84.571 13.143 55.429 38.857 115.429 38.857 155.429 0 36-19.429 66.286-59.429 66.286-46.857 0-84.571-48.571-84.571-113.714 0 0 0-41.714 14.286-69.714-48-203.429-56.571-238.857-56.571-238.857-8-33.143-8.571-70.286-7.429-101.143-154.857 68-262.857 222.286-262.857 402.286 0 242.286 196.571 438.857 438.857 438.857s438.857-196.571 438.857-438.857z" />
13
+ <glyph unicode="&#xf0d5;" glyph-name="google-plus" horiz-adv-x="1317" d="M821.143 429.143c0-239.429-160.571-409.143-402.286-409.143-231.429 0-418.857 187.429-418.857 418.857s187.429 418.857 418.857 418.857c113.143 0 207.429-41.143 280.571-109.714l-113.714-109.143c-30.857 29.714-85.143 64.571-166.857 64.571-142.857 0-259.429-118.286-259.429-264.571s116.571-264.571 259.429-264.571c165.714 0 228 119.429 237.714 180.571h-237.714v144h395.429c4-21.143 6.857-42.286 6.857-69.714zM1316.571 498.857v-120h-119.429v-119.429h-120v119.429h-119.429v120h119.429v119.429h120v-119.429h119.429z" />
14
+ <glyph unicode="&#xf0e1;" glyph-name="linkedin" horiz-adv-x="878" d="M199.429 593.714v-566.286h-188.571v566.286h188.571zM211.429 768.571c0.571-54.286-40.571-97.714-106.286-97.714v0h-1.143c-63.429 0-104 43.429-104 97.714 0 55.429 42.286 97.714 106.286 97.714 64.571 0 104.571-42.286 105.143-97.714zM877.714 352v-324.571h-188v302.857c0 76-27.429 128-95.429 128-52 0-82.857-34.857-96.571-68.571-4.571-12.571-6.286-29.143-6.286-46.286v-316h-188c2.286 513.143 0 566.286 0 566.286h188v-82.286h-1.143c24.571 38.857 69.143 95.429 170.857 95.429 124 0 216.571-81.143 216.571-254.857z" />
15
+ <glyph unicode="&#xf16a;" glyph-name="youtube-play" d="M406.286 306.286l276.571 142.857-276.571 144.571v-287.429zM512 798.857c215.429 0 358.286-10.286 358.286-10.286 20-2.286 64-2.286 102.857-43.429 0 0 31.429-30.857 40.571-101.714 10.857-82.857 10.286-165.714 10.286-165.714v-77.714s0.571-82.857-10.286-165.714c-9.143-70.286-40.571-101.714-40.571-101.714-38.857-40.571-82.857-40.571-102.857-42.857 0 0-142.857-10.857-358.286-10.857v0c-266.286 2.286-348 10.286-348 10.286-22.857 4-74.286 2.857-113.143 43.429 0 0-31.429 31.429-40.571 101.714-10.857 82.857-10.286 165.714-10.286 165.714v77.714s-0.571 82.857 10.286 165.714c9.143 70.857 40.571 101.714 40.571 101.714 38.857 41.143 82.857 41.143 102.857 43.429 0 0 142.857 10.286 358.286 10.286v0z" />
16
+ <glyph unicode="&#xf16d;" glyph-name="instagram" horiz-adv-x="878" d="M585.143 438.857c0 80.571-65.714 146.286-146.286 146.286s-146.286-65.714-146.286-146.286 65.714-146.286 146.286-146.286 146.286 65.714 146.286 146.286zM664 438.857c0-124.571-100.571-225.143-225.143-225.143s-225.143 100.571-225.143 225.143 100.571 225.143 225.143 225.143 225.143-100.571 225.143-225.143zM725.714 673.143c0-29.143-23.429-52.571-52.571-52.571s-52.571 23.429-52.571 52.571 23.429 52.571 52.571 52.571 52.571-23.429 52.571-52.571zM438.857 798.857c-64 0-201.143 5.143-258.857-17.714-20-8-34.857-17.714-50.286-33.143s-25.143-30.286-33.143-50.286c-22.857-57.714-17.714-194.857-17.714-258.857s-5.143-201.143 17.714-258.857c8-20 17.714-34.857 33.143-50.286s30.286-25.143 50.286-33.143c57.714-22.857 194.857-17.714 258.857-17.714s201.143-5.143 258.857 17.714c20 8 34.857 17.714 50.286 33.143s25.143 30.286 33.143 50.286c22.857 57.714 17.714 194.857 17.714 258.857s5.143 201.143-17.714 258.857c-8 20-17.714 34.857-33.143 50.286s-30.286 25.143-50.286 33.143c-57.714 22.857-194.857 17.714-258.857 17.714zM877.714 438.857c0-60.571 0.571-120.571-2.857-181.143-3.429-70.286-19.429-132.571-70.857-184s-113.714-67.429-184-70.857c-60.571-3.429-120.571-2.857-181.143-2.857s-120.571-0.571-181.143 2.857c-70.286 3.429-132.571 19.429-184 70.857s-67.429 113.714-70.857 184c-3.429 60.571-2.857 120.571-2.857 181.143s-0.571 120.571 2.857 181.143c3.429 70.286 19.429 132.571 70.857 184s113.714 67.429 184 70.857c60.571 3.429 120.571 2.857 181.143 2.857s120.571 0.571 181.143-2.857c70.286-3.429 132.571-19.429 184-70.857s67.429-113.714 70.857-184c3.429-60.571 2.857-120.571 2.857-181.143z" />
17
+ <glyph unicode="&#xf173;" glyph-name="tumblr" horiz-adv-x="624" d="M539.429 191.428l45.714-135.429c-17.143-25.714-94.857-54.857-164.571-56-207.429-3.429-285.714 147.429-285.714 253.714v310.857h-96v122.857c144 52 178.857 182.286 186.857 256.571 0.571 4.571 4.571 6.857 6.857 6.857h139.429v-242.286h190.286v-144h-190.857v-296c0-40 14.857-95.429 91.429-93.714 25.143 0.571 58.857 8 76.571 16.571z" />
18
+ <glyph unicode="&#xf189;" glyph-name="vk" horiz-adv-x="1119" d="M1095.429 653.714c8.571-23.429-18.286-78.286-85.714-168-110.857-147.429-122.857-133.714-31.429-218.857 88-81.714 106.286-121.143 109.143-126.286 0 0 36.571-64-40.571-64.571l-146.286-2.286c-31.429-6.286-73.143 22.286-73.143 22.286-54.857 37.714-106.286 135.429-146.286 122.857 0 0-41.143-13.143-40-101.143 0.571-18.857-8.571-29.143-8.571-29.143s-10.286-10.857-30.286-12.571h-65.714c-144.571-9.143-272 124-272 124s-139.429 144-261.714 431.429c-8 18.857 0.571 28 0.571 28s8.571 10.857 32.571 10.857l156.571 1.143c14.857-2.286 25.143-10.286 25.143-10.286s9.143-6.286 13.714-18.286c25.714-64 58.857-122.286 58.857-122.286 57.143-117.714 96-137.714 118.286-125.714 0 0 29.143 17.714 22.857 160-2.286 51.429-16.571 74.857-16.571 74.857-13.143 17.714-37.714 22.857-48.571 24.571-8.571 1.143 5.714 21.714 24.571 30.857 28 13.714 77.714 14.286 136.571 13.714 46.286-0.571 59.429-3.429 77.143-7.429 54.286-13.143 36-63.429 36-184.571 0-38.857-7.429-93.143 20.571-110.857 12-8 41.714-1.143 114.857 123.429 0 0 34.286 59.429 61.143 128.571 4.571 12.571 14.286 17.714 14.286 17.714s9.143 5.143 21.714 3.429l164.571 1.143c49.714 6.286 57.714-16.571 57.714-16.571z" />
19
+ <glyph unicode="&#xf232;" glyph-name="whatsapp" horiz-adv-x="878" d="M562.857 394.286c9.714 0 102.857-48.571 106.857-55.429 1.143-2.857 1.143-6.286 1.143-8.571 0-14.286-4.571-30.286-9.714-43.429-13.143-32-66.286-52.571-98.857-52.571-27.429 0-84 24-108.571 35.429-81.714 37.143-132.571 100.571-181.714 173.143-21.714 32-41.143 71.429-40.571 110.857v4.571c1.143 37.714 14.857 64.571 42.286 90.286 8.571 8 17.714 12.571 29.714 12.571 6.857 0 13.714-1.714 21.143-1.714 15.429 0 18.286-4.571 24-19.429 4-9.714 33.143-87.429 33.143-93.143 0-21.714-39.429-46.286-39.429-59.429 0-2.857 1.143-5.714 2.857-8.571 12.571-26.857 36.571-57.714 58.286-78.286 26.286-25.143 54.286-41.714 86.286-57.714 4-2.286 8-4 12.571-4 17.143 0 45.714 55.429 60.571 55.429zM446.857 91.428c197.714 0 358.857 161.143 358.857 358.857s-161.143 358.857-358.857 358.857-358.857-161.143-358.857-358.857c0-75.429 24-149.143 68.571-210.286l-45.143-133.143 138.286 44c58.286-38.286 127.429-59.429 197.143-59.429zM446.857 881.143c237.714 0 430.857-193.143 430.857-430.857s-193.143-430.857-430.857-430.857c-72.571 0-144.571 18.286-208.571 53.714l-238.286-76.571 77.714 231.429c-40.571 66.857-61.714 144-61.714 222.286 0 237.714 193.143 430.857 430.857 430.857z" />
20
+ <glyph unicode="&#xf281;" glyph-name="reddit-alien" d="M1024 467.428c0-44.571-25.143-82.857-62.286-101.714 4.571-17.714 6.857-36 6.857-54.857 0-180.571-204-326.857-455.429-326.857-250.857 0-454.857 146.286-454.857 326.857 0 18.286 2.286 36.571 6.286 53.714-38.286 18.857-64.571 57.714-64.571 102.857 0 62.857 50.857 113.714 113.714 113.714 32.571 0 61.714-13.714 82.857-36 77.143 53.714 180 88.571 294.286 92.571l66.286 297.714c2.286 10.286 13.143 17.143 23.429 14.857l210.857-46.286c13.714 27.429 42.857 46.857 76 46.857 47.429 0 85.714-38.286 85.714-85.143 0-47.429-38.286-85.714-85.714-85.714-46.857 0-85.143 38.286-85.143 85.143l-190.857 42.286-59.429-269.714c114.857-3.429 218.857-37.714 296.571-91.429 20.571 21.714 49.714 34.857 81.714 34.857 62.857 0 113.714-50.857 113.714-113.714zM238.857 353.714c0-47.429 38.286-85.714 85.143-85.714 47.429 0 85.714 38.286 85.714 85.714 0 46.857-38.286 85.143-85.714 85.143-46.857 0-85.143-38.286-85.143-85.143zM701.714 150.857c8.571 8.571 8.571 21.143 0 29.714-8 8-21.143 8-29.143 0-34.286-34.857-108-46.857-160.571-46.857s-126.286 12-160.571 46.857c-8 8-21.143 8-29.143 0-8.571-8-8.571-21.143 0-29.714 54.286-54.286 158.857-58.286 189.714-58.286s135.429 4 189.714 58.286zM700 268c46.857 0 85.143 38.286 85.143 85.714 0 46.857-38.286 85.143-85.143 85.143-47.429 0-85.714-38.286-85.714-85.143 0-47.429 38.286-85.714 85.714-85.714z" />
21
+ <glyph unicode="&#xf2ac;" glyph-name="snapchat-ghost" horiz-adv-x="951" d="M484.571 877.714c102.857 1.143 188-56.571 230.857-149.143 13.143-28 15.429-71.429 15.429-102.286 0-36.571-2.857-72.571-5.143-109.143 4.571-2.286 10.857-4 16-4 20.571 0 37.714 15.429 58.286 15.429 19.429 0 47.429-13.714 47.429-36.571 0-54.857-114.857-44.571-114.857-92.571 0-8.571 3.429-16.571 6.857-24.571 27.429-60 79.429-117.714 141.143-143.429 14.857-6.286 29.714-9.714 45.714-13.143 10.286-2.286 16-9.714 16-20 0-38.857-98.857-54.857-125.143-58.857-11.429-17.714-2.857-59.429-33.143-59.429-23.429 0-46.857 7.429-72 7.429-12 0-24-0.571-35.429-2.857-68-11.429-90.857-84.571-202.286-84.571-107.429 0-133.143 73.143-199.429 84.571-12 2.286-24 2.857-36 2.857-25.714 0-50.286-8.571-70.857-8.571-32 0-22.286 42.286-34.286 60.571-26.286 4-125.143 20-125.143 58.857 0 10.286 5.714 17.714 16 20 16 3.429 30.857 6.857 45.714 13.143 61.143 25.143 114.286 83.429 141.143 143.429 3.429 8 6.857 16 6.857 24.571 0 48-115.429 38.857-115.429 92 0 22.286 26.286 36.571 46.286 36.571 17.714 0 35.429-14.857 57.714-14.857 6.286 0 12.571 1.143 18.286 4-2.286 36-5.143 72-5.143 108.571 0 30.857 2.286 74.857 15.429 102.857 50.286 108.571 135.429 148 249.143 149.143z" />
22
  </font></defs></svg>
components/social-icons/social-icons.php CHANGED
@@ -1,161 +1,161 @@
1
- <?php
2
-
3
- function ampforwp_framework_get_social_icons($selected_social_icons){
4
-
5
- /* TODO:
6
- 1: Connect with options panel
7
- 2: Add icons for email, line and whatsapp
8
- */
9
- global $post, $redux_builder_amp;
10
- $twitter_url = '';
11
- $thumb_id = '';
12
- $image = '';
13
- $post_id = $post->ID;
14
- $desc = $post->post_excerpt;
15
- if (has_post_thumbnail( $post_id ) ){
16
- $thumb_id = get_post_thumbnail_id($post_id);
17
- $image = wp_get_attachment_image_src( $thumb_id, 'full' );
18
- }
19
- $social_icons_names = array();
20
- $url = get_the_permalink();
21
- $title = get_the_title();
22
- if(isset($redux_builder_amp['enable-single-twitter-share-link']) && $redux_builder_amp['enable-single-twitter-share-link']){
23
- $twitter_url = get_the_permalink();
24
- }
25
- else
26
- $twitter_url = wp_get_shortlink();
27
- foreach ($selected_social_icons as $key => $value) {
28
- $social_icons_names[] = $key;
29
- }
30
-
31
- if( empty($selected_social_icons['twitter'] ) && null == $selected_social_icons['twitter'] ){
32
- $selected_social_icons['twitter'] = 'https://twitter.com/intent/tweet?url='. $twitter_url.'&text='. $title .' ';
33
- //https://twitter.com/intent/tweet?url={url}&text={title}&via={via}&hashtags={hashtags}
34
- }
35
-
36
- if( empty($selected_social_icons['facebook'] ) && null == $selected_social_icons['facebook'] ){
37
- $selected_social_icons['facebook'] = 'https://www.facebook.com/sharer.php?u='. $url. '';
38
- //or https://www.facebook.com/dialog/share?app_id={app_id}&display=page&href={url}&redirect_uri={redirect_url}
39
- }
40
- if( empty($selected_social_icons['pinterest'] ) && null == $selected_social_icons['pinterest'] ){
41
- $selected_social_icons['pinterest'] = 'https://pinterest.com/pin/create/bookmarklet/?media='.$image.' &url='. $url.'&description='. $title .'';
42
- //https://pinterest.com/pin/create/bookmarklet/?media={img}&url={url}&is_video={is_video}&description={title}
43
- }
44
- if( empty($selected_social_icons['google-plus']) && $selected_social_icons['google-plus'] == null){
45
- $selected_social_icons['google-plus'] = 'https://plus.google.com/share?url='. $url. '';
46
- //https://plus.google.com/share?url={url}
47
- }
48
- if( empty($selected_social_icons['linkedin']) && $selected_social_icons['linkedin'] == null){
49
- $selected_social_icons['linkedin'] = 'https://www.linkedin.com/shareArticle?url='. $url. '&title='. $title .'';
50
- //https://www.linkedin.com/shareArticle?url={url}&title={title}
51
- }
52
-
53
- if( empty($selected_social_icons['reddit']) && $selected_social_icons['reddit'] == null){
54
- $selected_social_icons['reddit'] = 'https://reddit.com/submit?url='. $url. '&title='. $title .'';
55
- //https://reddit.com/submit?url={url}&title={title}
56
- }
57
- if( empty($selected_social_icons['VKontakte']) && $selected_social_icons['VKontakte'] == null){
58
- $selected_social_icons['VKontakte'] = 'http://vk.com/share.php?url='. $url. '';
59
- //http://vk.com/share.php?url={url}
60
- }
61
-
62
- if( empty($selected_social_icons['tumblr']) && $selected_social_icons['tumblr'] == null){
63
- $selected_social_icons['tumblr'] = 'https://www.tumblr.com/widgets/share/tool?canonicalUrl='. $url. '&title='. $title .'&caption='.$desc.'';
64
- //https://www.tumblr.com/widgets/share/tool?canonicalUrl={url}&title={title}&caption={desc}
65
- }
66
-
67
- ?>
68
- <div class="amp-social">
69
- <ul>
70
- <?php if( ( in_array( 'twitter' , $selected_social_icons,true) || in_array('twitter', $social_icons_names,true) ) && !empty($selected_social_icons['twitter']) ) { ?>
71
- <a href="<?php echo $selected_social_icons['twitter'] ?>" target ="_blank"><li class="icon-twitter"></li></a>
72
- <?php } ?>
73
-
74
- <?php if( (in_array('facebook', $selected_social_icons,true) || in_array('facebook', $social_icons_names,true)) && !empty($selected_social_icons['facebook']) ) { ?>
75
- <a href="<?php echo $selected_social_icons['facebook'] ?>" target ="_blank"><li class="icon-facebook"></li></a>
76
- <?php } ?>
77
-
78
- <?php if( ( in_array( 'pinterest' , $selected_social_icons,true ) || in_array( 'pinterest', $social_icons_names,true )) && !empty($selected_social_icons['pinterest']) ) { ?>
79
- <a href="<?php echo $selected_social_icons['pinterest'] ?>" target ="_blank"><li class="icon-pinterest"></li></a>
80
- <?php } ?>
81
-
82
- <?php if( (in_array( 'google-plus' , $selected_social_icons,true ) || in_array( 'google-plus' , $social_icons_names,true )) && !empty($selected_social_icons['google-plus']) ) { ?>
83
- <a href="<?php echo $selected_social_icons['google-plus'] ?>" target ="_blank"><li class="icon-google-plus"></li></a>
84
- <?php } ?>
85
-
86
- <?php if( (in_array( 'linkedin' , $selected_social_icons,true ) || in_array( 'linkedin' , $social_icons_names,true )) && !empty($selected_social_icons['linkedin']) ) { ?>
87
- <a href="<?php echo $selected_social_icons['linkedin'] ?>" target ="_blank"><li class="icon-linkedin"></li></a>
88
- <?php } ?>
89
-
90
- <?php if( (in_array( 'youtube' , $selected_social_icons,true ) || in_array( 'youtube' , $social_icons_names,true )) && !empty($selected_social_icons['youtube']) ) { ?>
91
- <a href="<?php echo $selected_social_icons['youtube'] ?>" target ="_blank"><li class="icon-youtube-play"></li></a>
92
- <?php } ?>
93
-
94
- <?php if( (in_array( 'instagram' , $selected_social_icons,true ) || in_array( 'instagram' , $social_icons_names,true )) && !empty($selected_social_icons['instagram']) ) { ?>
95
- <a href="<?php echo $selected_social_icons['instagram'] ?>" target ="_blank"> <li class="icon-instagram"></li></a>
96
- <?php } ?>
97
-
98
- <?php if( ( in_array( 'reddit' , $selected_social_icons,true ) || in_array( 'reddit' , $social_icons_names,true )) && !empty($selected_social_icons['reddit']) ) { ?>
99
- <a href="<?php echo $selected_social_icons['reddit'] ?>" target ="_blank"><li class="icon-reddit-alien"></li></a>
100
- <?php } ?>
101
-
102
- <?php if( ( in_array( 'VKontakte' , $selected_social_icons,true ) || in_array( 'VKontakte' , $social_icons_names,true ) ) && !empty($selected_social_icons['VKontakte']) ) { ?>
103
- <a href="<?php echo $selected_social_icons['VKontakte'] ?>" target ="_blank"><li class="icon-vk"></li></a>
104
- <?php } ?>
105
-
106
- <?php if( (in_array( 'snapchat' , $selected_social_icons,true ) || in_array( 'snapchat' , $social_icons_names,true ) ) && !empty($selected_social_icons['snapchat']) ) { ?>
107
- <a href="<?php echo $selected_social_icons['snapchat'] ?>" target ="_blank"><li class="icon-snapchat-ghost"></li></a>
108
- <?php } ?>
109
-
110
- <?php if( (in_array( 'tumblr' , $selected_social_icons,true ) || in_array( 'tumblr' , $social_icons_names,true )) && !empty($selected_social_icons['tumblr']) ) { ?>
111
- <a href="<?php echo $selected_social_icons['tumblr'] ?>" target ="_blank"><li class="icon-tumblr"></li></a>
112
- <?php } ?>
113
- </ul>
114
- </div>
115
- <?php
116
- }
117
- //Load styling for social icons
118
-
119
- add_action('amp_post_template_css','amp_social_styles',11);
120
-
121
-
122
- function amp_social_styles(){?>
123
-
124
- /* Social icons */
125
- @font-face {
126
- font-family: 'icomoon';
127
- src: url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.eot?b9qrme');
128
- src: url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.eot?b9qrme#iefix') format('embedded-opentype'),
129
- url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.ttf?b9qrme') format('truetype'),
130
- url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.woff?b9qrme') format('woff'),
131
- url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.svg?b9qrme#icomoon') format('svg');
132
- font-weight: normal;
133
- font-style: normal;
134
- }
135
-
136
- [class^="icon-"], [class*=" icon-"]{ font-family: 'icomoon'; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1;
137
-
138
- /* Better Font Rendering =========== */
139
- -webkit-font-smoothing: antialiased;
140
- -moz-osx-font-smoothing: grayscale;
141
- }
142
-
143
- .icon-twitter:before{ content: "\f099";background:#1da1f2 }
144
- .icon-facebook:before{ content: "\f09a";background:#3b5998 }
145
- .icon-facebook-f:before{ content: "\f09a";background:#3b5998 }
146
- .icon-pinterest:before{ content: "\f0d2";background:#bd081c }
147
- .icon-google-plus:before{ content: "\f0d5";background:#dd4b39 }
148
- .icon-linkedin:before{ content: "\f0e1";background:#0077b5 }
149
- .icon-youtube-play:before{ content: "\f16a";background:#cd201f }
150
- .icon-instagram:before{ content: "\f16d";background:#c13584 }
151
- .icon-tumblr:before{ content: "\f173";background:#35465c }
152
- .icon-vk:before{ content: "\f189";background:#45668e }
153
- .icon-whatsapp:before{ content: "\f232";background:#075e54 }
154
- .icon-reddit-alien:before{ content: "\f281";background:#ff4500 }
155
- .icon-snapchat-ghost:before{ content: "\f2ac"; background:#fffc00 }
156
- .amp-social{ font-size: 15px; display: inline-block; }
157
- .amp-social ul{ list-style-type:none; padding:0;margin:0; text-align:center }
158
- .amp-social li{ box-sizing: initial; display:inline-block; }
159
- .amp-social li:before{ box-sizing: initial; color:#fff; padding: 6px; display: inline-block; border-radius: 70px; width: 18px; height: 18px; line-height: 20px; text-align: center; }
160
-
161
  <?php }
1
+ <?php
2
+
3
+ function ampforwp_framework_get_social_icons($selected_social_icons){
4
+
5
+ /* TODO:
6
+ 1: Connect with options panel
7
+ 2: Add icons for email, line and whatsapp
8
+ */
9
+ global $post, $redux_builder_amp;
10
+ $twitter_url = '';
11
+ $thumb_id = '';
12
+ $image = '';
13
+ $post_id = $post->ID;
14
+ $desc = $post->post_excerpt;
15
+ if (has_post_thumbnail( $post_id ) ){
16
+ $thumb_id = get_post_thumbnail_id($post_id);
17
+ $image = wp_get_attachment_image_src( $thumb_id, 'full' );
18
+ }
19
+ $social_icons_names = array();
20
+ $url = get_the_permalink();
21
+ $title = get_the_title();
22
+ if(isset($redux_builder_amp['enable-single-twitter-share-link']) && $redux_builder_amp['enable-single-twitter-share-link']){
23
+ $twitter_url = get_the_permalink();
24
+ }
25
+ else
26
+ $twitter_url = wp_get_shortlink();
27
+ foreach ($selected_social_icons as $key => $value) {
28
+ $social_icons_names[] = $key;
29
+ }
30
+
31
+ if( empty($selected_social_icons['twitter'] ) && null == $selected_social_icons['twitter'] ){
32
+ $selected_social_icons['twitter'] = 'https://twitter.com/intent/tweet?url='. $twitter_url.'&text='. $title .' ';
33
+ //https://twitter.com/intent/tweet?url={url}&text={title}&via={via}&hashtags={hashtags}
34
+ }
35
+
36
+ if( empty($selected_social_icons['facebook'] ) && null == $selected_social_icons['facebook'] ){
37
+ $selected_social_icons['facebook'] = 'https://www.facebook.com/sharer.php?u='. $url. '';
38
+ //or https://www.facebook.com/dialog/share?app_id={app_id}&display=page&href={url}&redirect_uri={redirect_url}
39
+ }
40
+ if( empty($selected_social_icons['pinterest'] ) && null == $selected_social_icons['pinterest'] ){
41
+ $selected_social_icons['pinterest'] = 'https://pinterest.com/pin/create/bookmarklet/?media='.$image.' &url='. $url.'&description='. $title .'';
42
+ //https://pinterest.com/pin/create/bookmarklet/?media={img}&url={url}&is_video={is_video}&description={title}
43
+ }
44
+ if( empty($selected_social_icons['google-plus']) && $selected_social_icons['google-plus'] == null){
45
+ $selected_social_icons['google-plus'] = 'https://plus.google.com/share?url='. $url. '';
46
+ //https://plus.google.com/share?url={url}
47
+ }
48
+ if( empty($selected_social_icons['linkedin']) && $selected_social_icons['linkedin'] == null){
49
+ $selected_social_icons['linkedin'] = 'https://www.linkedin.com/shareArticle?url='. $url. '&title='. $title .'';
50
+ //https://www.linkedin.com/shareArticle?url={url}&title={title}
51
+ }
52
+
53
+ if( empty($selected_social_icons['reddit']) && $selected_social_icons['reddit'] == null){
54
+ $selected_social_icons['reddit'] = 'https://reddit.com/submit?url='. $url. '&title='. $title .'';
55
+ //https://reddit.com/submit?url={url}&title={title}
56
+ }
57
+ if( empty($selected_social_icons['VKontakte']) && $selected_social_icons['VKontakte'] == null){
58
+ $selected_social_icons['VKontakte'] = 'http://vk.com/share.php?url='. $url. '';
59
+ //http://vk.com/share.php?url={url}
60
+ }
61
+
62
+ if( empty($selected_social_icons['tumblr']) && $selected_social_icons['tumblr'] == null){
63
+ $selected_social_icons['tumblr'] = 'https://www.tumblr.com/widgets/share/tool?canonicalUrl='. $url. '&title='. $title .'&caption='.$desc.'';
64
+ //https://www.tumblr.com/widgets/share/tool?canonicalUrl={url}&title={title}&caption={desc}
65
+ }
66
+
67
+ ?>
68
+ <div class="amp-social">
69
+ <ul>
70
+ <?php if( ( in_array( 'twitter' , $selected_social_icons,true) || in_array('twitter', $social_icons_names,true) ) && !empty($selected_social_icons['twitter']) ) { ?>
71
+ <a href="<?php echo $selected_social_icons['twitter'] ?>" target ="_blank"><li class="icon-twitter"></li></a>
72
+ <?php } ?>
73
+
74
+ <?php if( (in_array('facebook', $selected_social_icons,true) || in_array('facebook', $social_icons_names,true)) && !empty($selected_social_icons['facebook']) ) { ?>
75
+ <a href="<?php echo $selected_social_icons['facebook'] ?>" target ="_blank"><li class="icon-facebook"></li></a>
76
+ <?php } ?>
77
+
78
+ <?php if( ( in_array( 'pinterest' , $selected_social_icons,true ) || in_array( 'pinterest', $social_icons_names,true )) && !empty($selected_social_icons['pinterest']) ) { ?>
79
+ <a href="<?php echo $selected_social_icons['pinterest'] ?>" target ="_blank"><li class="icon-pinterest"></li></a>
80
+ <?php } ?>
81
+
82
+ <?php if( (in_array( 'google-plus' , $selected_social_icons,true ) || in_array( 'google-plus' , $social_icons_names,true )) && !empty($selected_social_icons['google-plus']) ) { ?>
83
+ <a href="<?php echo $selected_social_icons['google-plus'] ?>" target ="_blank"><li class="icon-google-plus"></li></a>
84
+ <?php } ?>
85
+
86
+ <?php if( (in_array( 'linkedin' , $selected_social_icons,true ) || in_array( 'linkedin' , $social_icons_names,true )) && !empty($selected_social_icons['linkedin']) ) { ?>
87
+ <a href="<?php echo $selected_social_icons['linkedin'] ?>" target ="_blank"><li class="icon-linkedin"></li></a>
88
+ <?php } ?>
89
+
90
+ <?php if( (in_array( 'youtube' , $selected_social_icons,true ) || in_array( 'youtube' , $social_icons_names,true )) && !empty($selected_social_icons['youtube']) ) { ?>
91
+ <a href="<?php echo $selected_social_icons['youtube'] ?>" target ="_blank"><li class="icon-youtube-play"></li></a>
92
+ <?php } ?>
93
+
94
+ <?php if( (in_array( 'instagram' , $selected_social_icons,true ) || in_array( 'instagram' , $social_icons_names,true )) && !empty($selected_social_icons['instagram']) ) { ?>
95
+ <a href="<?php echo $selected_social_icons['instagram'] ?>" target ="_blank"> <li class="icon-instagram"></li></a>
96
+ <?php } ?>
97
+
98
+ <?php if( ( in_array( 'reddit' , $selected_social_icons,true ) || in_array( 'reddit' , $social_icons_names,true )) && !empty($selected_social_icons['reddit']) ) { ?>
99
+ <a href="<?php echo $selected_social_icons['reddit'] ?>" target ="_blank"><li class="icon-reddit-alien"></li></a>
100
+ <?php } ?>
101
+
102
+ <?php if( ( in_array( 'VKontakte' , $selected_social_icons,true ) || in_array( 'VKontakte' , $social_icons_names,true ) ) && !empty($selected_social_icons['VKontakte']) ) { ?>
103
+ <a href="<?php echo $selected_social_icons['VKontakte'] ?>" target ="_blank"><li class="icon-vk"></li></a>
104
+ <?php } ?>
105
+
106
+ <?php if( (in_array( 'snapchat' , $selected_social_icons,true ) || in_array( 'snapchat' , $social_icons_names,true ) ) && !empty($selected_social_icons['snapchat']) ) { ?>
107
+ <a href="<?php echo $selected_social_icons['snapchat'] ?>" target ="_blank"><li class="icon-snapchat-ghost"></li></a>
108
+ <?php } ?>
109
+
110
+ <?php if( (in_array( 'tumblr' , $selected_social_icons,true ) || in_array( 'tumblr' , $social_icons_names,true )) && !empty($selected_social_icons['tumblr']) ) { ?>
111
+ <a href="<?php echo $selected_social_icons['tumblr'] ?>" target ="_blank"><li class="icon-tumblr"></li></a>
112
+ <?php } ?>
113
+ </ul>
114
+ </div>
115
+ <?php
116
+ }
117
+ //Load styling for social icons
118
+
119
+ add_action('amp_post_template_css','amp_social_styles',11);
120
+
121
+
122
+ function amp_social_styles(){?>
123
+
124
+ /* Social icons */
125
+ @font-face {
126
+ font-family: 'icomoon';
127
+ src: url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.eot?b9qrme');
128
+ src: url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.eot?b9qrme#iefix') format('embedded-opentype'),
129
+ url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.ttf?b9qrme') format('truetype'),
130
+ url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.woff?b9qrme') format('woff'),
131
+ url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.svg?b9qrme#icomoon') format('svg');
132
+ font-weight: normal;
133
+ font-style: normal;
134
+ }
135
+
136
+ [class^="icon-"], [class*=" icon-"]{ font-family: 'icomoon'; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1;
137
+
138
+ /* Better Font Rendering =========== */
139
+ -webkit-font-smoothing: antialiased;
140
+ -moz-osx-font-smoothing: grayscale;
141
+ }
142
+
143
+ .icon-twitter:before{ content: "\f099";background:#1da1f2 }
144
+ .icon-facebook:before{ content: "\f09a";background:#3b5998 }
145
+ .icon-facebook-f:before{ content: "\f09a";background:#3b5998 }
146
+ .icon-pinterest:before{ content: "\f0d2";background:#bd081c }
147
+ .icon-google-plus:before{ content: "\f0d5";background:#dd4b39 }
148
+ .icon-linkedin:before{ content: "\f0e1";background:#0077b5 }
149
+ .icon-youtube-play:before{ content: "\f16a";background:#cd201f }
150
+ .icon-instagram:before{ content: "\f16d";background:#c13584 }
151
+ .icon-tumblr:before{ content: "\f173";background:#35465c }
152
+ .icon-vk:before{ content: "\f189";background:#45668e }
153
+ .icon-whatsapp:before{ content: "\f232";background:#075e54 }
154
+ .icon-reddit-alien:before{ content: "\f281";background:#ff4500 }
155
+ .icon-snapchat-ghost:before{ content: "\f2ac"; background:#fffc00 }
156
+ .amp-social{ font-size: 15px; display: inline-block; }
157
+ .amp-social ul{ list-style-type:none; padding:0;margin:0; text-align:center }
158
+ .amp-social li{ box-sizing: initial; display:inline-block; }
159
+ .amp-social li:before{ box-sizing: initial; color:#fff; padding: 6px; display: inline-block; border-radius: 70px; width: 18px; height: 18px; line-height: 20px; text-align: center; }
160
+
161
  <?php }
components/theme-loader.php CHANGED
@@ -1,98 +1,98 @@
1
- <?php
2
- if(!defined('AMPFORWP_CUSTOM_THEME')){
3
- define('AMPFORWP_CUSTOM_THEME',AMPFORWP_MAIN_PLUGIN_DIR."/".$ampforwp_design_selector);
4
- }
5
-
6
-
7
- require_once( AMPFORWP_CUSTOM_THEME . '/functions.php' );
8
- //Filter the Template files to override previous ones
9
- add_filter( 'amp_post_template_file', 'ampforwp_custom_header_file', 10, 2 );
10
- add_filter( 'amp_post_template_file', 'ampforwp_designing_custom_template', 10, 3 );
11
- add_filter( 'amp_post_template_file', 'ampforwp_custom_footer_file', 10, 2 );
12
-
13
- // Custom Header
14
- function ampforwp_custom_header_file( $file, $type ) {
15
- if ( 'header' === $type ) {
16
- $file = AMPFORWP_CUSTOM_THEME . '/header.php';
17
- }
18
- return $file;
19
- }
20
-
21
- // Custom Template Files
22
- function ampforwp_designing_custom_template( $file, $type, $post ) {
23
- global $redux_builder_amp;
24
- // Single file
25
- if ( is_single() ) {
26
- if('single' === $type && !('product' === $post->post_type )) {
27
- $file = AMPFORWP_CUSTOM_THEME . '/single.php';
28
- }
29
- }
30
- if ( is_page() ) {
31
- if('single' === $type && !('product' === $post->post_type )) {
32
- $file = AMPFORWP_CUSTOM_THEME . '/page.php';
33
- }
34
- }
35
- // Loop Template
36
- if ( 'loop' === $type ) {
37
- $file = AMPFORWP_CUSTOM_THEME . '/loop.php';
38
- }
39
- // Archive
40
- if ( is_archive() ) {
41
- if ( 'single' === $type ) {
42
- $file = AMPFORWP_CUSTOM_THEME . '/archive.php';
43
- }
44
- }
45
- $ampforwp_custom_post_page = ampforwp_custom_post_page();
46
- // Homepage
47
- if ( is_home() ) {
48
- if ( 'single' === $type ) {
49
- $file = AMPFORWP_CUSTOM_THEME . '/index.php';
50
-
51
- if ($redux_builder_amp['amp-frontpage-select-option'] == 1) {
52
- $file = AMPFORWP_CUSTOM_THEME . '/page.php';
53
- }
54
- if ( $ampforwp_custom_post_page == "page" && ampforwp_name_blog_page() ) {
55
- $current_url = home_url( $GLOBALS['wp']->request );
56
- $current_url_in_pieces = explode( '/', $current_url );
57
-
58
- if( in_array( ampforwp_name_blog_page() , $current_url_in_pieces ) ) {
59
- $file = AMPFORWP_CUSTOM_THEME . '/index.php';
60
- }
61
- }
62
- }
63
- }
64
- // is_search
65
- if ( is_search() ) {
66
- if ( 'single' === $type ) {
67
- $file = AMPFORWP_CUSTOM_THEME . '/search.php';
68
- }
69
- }
70
-
71
- return $file;
72
- }
73
-
74
- // Custom Footer
75
- function ampforwp_custom_footer_file($file, $type ){
76
- if ( 'footer' === $type ) {
77
- $file = AMPFORWP_CUSTOM_THEME . '/footer.php';
78
- }
79
- return $file;
80
- }
81
- // Load the Core Styles of Custom Theme
82
- add_action('amp_css', 'ampforwp_custom_style');
83
- function ampforwp_custom_style() {
84
- global $redux_builder_amp;
85
- require_once( AMPFORWP_CUSTOM_THEME . '/style.php' );
86
- // Custom CSS
87
- echo $redux_builder_amp['css_editor'];
88
- }
89
-
90
- // Loading Custom Google Fonts in the theme
91
- /*add_action( 'amp_post_template_head', 'amp_post_template_add_custom_google_font');
92
- function amp_post_template_add_custom_google_font( $amp_template ) {
93
- $font_urls = $amp_template->get( 'font_urls', array() );
94
- $font_urls['source_serif_pro'] = 'https://fonts.googleapis.com/css?family=Source+Serif+Pro:400,600|Source+Sans+Pro:400,700'; ?>
95
- <link rel="stylesheet" href="<?php echo esc_url( $font_urls['source_serif_pro'] ); ?>">
96
- <?php }*/
97
-
98
-
1
+ <?php
2
+ if(!defined('AMPFORWP_CUSTOM_THEME')){
3
+ define('AMPFORWP_CUSTOM_THEME',AMPFORWP_MAIN_PLUGIN_DIR."/".$ampforwp_design_selector);
4
+ }
5
+
6
+
7
+ require_once( AMPFORWP_CUSTOM_THEME . '/functions.php' );
8
+ //Filter the Template files to override previous ones
9
+ add_filter( 'amp_post_template_file', 'ampforwp_custom_header_file', 10, 2 );
10
+ add_filter( 'amp_post_template_file', 'ampforwp_designing_custom_template', 10, 3 );
11
+ add_filter( 'amp_post_template_file', 'ampforwp_custom_footer_file', 10, 2 );
12
+
13
+ // Custom Header
14
+ function ampforwp_custom_header_file( $file, $type ) {
15
+ if ( 'header' === $type ) {
16
+ $file = AMPFORWP_CUSTOM_THEME . '/header.php';
17
+ }
18
+ return $file;
19
+ }
20
+
21
+ // Custom Template Files
22
+ function ampforwp_designing_custom_template( $file, $type, $post ) {
23
+ global $redux_builder_amp;
24
+ // Single file
25
+ if ( is_single() ) {
26
+ if('single' === $type && !('product' === $post->post_type )) {
27
+ $file = AMPFORWP_CUSTOM_THEME . '/single.php';
28
+ }
29
+ }
30
+ if ( is_page() ) {
31
+ if('single' === $type && !('product' === $post->post_type )) {
32
+ $file = AMPFORWP_CUSTOM_THEME . '/page.php';
33
+ }
34
+ }
35
+ // Loop Template
36
+ if ( 'loop' === $type ) {
37
+ $file = AMPFORWP_CUSTOM_THEME . '/loop.php';
38
+ }
39
+ // Archive
40
+ if ( is_archive() ) {
41
+ if ( 'single' === $type ) {
42
+ $file = AMPFORWP_CUSTOM_THEME . '/archive.php';
43
+ }
44
+ }
45
+ $ampforwp_custom_post_page = ampforwp_custom_post_page();
46
+ // Homepage
47
+ if ( is_home() ) {
48
+ if ( 'single' === $type ) {
49
+ $file = AMPFORWP_CUSTOM_THEME . '/index.php';
50
+
51
+ if ($redux_builder_amp['amp-frontpage-select-option'] == 1) {
52
+ $file = AMPFORWP_CUSTOM_THEME . '/page.php';
53
+ }
54
+ if ( $ampforwp_custom_post_page == "page" && ampforwp_name_blog_page() ) {
55
+ $current_url = home_url( $GLOBALS['wp']->request );
56
+ $current_url_in_pieces = explode( '/', $current_url );
57
+
58
+ if( in_array( ampforwp_name_blog_page() , $current_url_in_pieces ) ) {
59
+ $file = AMPFORWP_CUSTOM_THEME . '/index.php';
60
+ }
61
+ }
62
+ }
63
+ }
64
+ // is_search
65
+ if ( is_search() ) {
66
+ if ( 'single' === $type ) {
67
+ $file = AMPFORWP_CUSTOM_THEME . '/search.php';
68
+ }
69
+ }
70
+
71
+ return $file;
72
+ }
73
+
74
+ // Custom Footer
75
+ function ampforwp_custom_footer_file($file, $type ){
76
+ if ( 'footer' === $type ) {
77
+ $file = AMPFORWP_CUSTOM_THEME . '/footer.php';
78
+ }
79
+ return $file;
80
+ }
81
+ // Load the Core Styles of Custom Theme
82
+ add_action('amp_css', 'ampforwp_custom_style');
83
+ function ampforwp_custom_style() {
84
+ global $redux_builder_amp;
85
+ require_once( AMPFORWP_CUSTOM_THEME . '/style.php' );
86
+ // Custom CSS
87
+ echo $redux_builder_amp['css_editor'];
88
+ }
89
+
90
+ // Loading Custom Google Fonts in the theme
91
+ /*add_action( 'amp_post_template_head', 'amp_post_template_add_custom_google_font');
92
+ function amp_post_template_add_custom_google_font( $amp_template ) {
93
+ $font_urls = $amp_template->get( 'font_urls', array() );
94
+ $font_urls['source_serif_pro'] = 'https://fonts.googleapis.com/css?family=Source+Serif+Pro:400,600|Source+Sans+Pro:400,700'; ?>
95
+ <link rel="stylesheet" href="<?php echo esc_url( $font_urls['source_serif_pro'] ); ?>">
96
+ <?php }*/
97
+
98
+
feeds/instant-article-feed.php CHANGED
@@ -1,56 +1,56 @@
1
- <?php header('Content-Type: ' . feed_content_type('rss2') . '; charset=' . get_option('blog_charset'), true);
2
- $more = 1;
3
-
4
- echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
5
- ?>
6
-
7
- <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
8
-
9
- <channel>
10
- <title><?php bloginfo_rss('name'); ?></title>
11
- <link><?php bloginfo_rss('url') ?></link>
12
- <description><?php bloginfo_rss("description") ?></description>
13
- <lastBuildDate><?php echo mysql2date('c', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
14
- <language><?php bloginfo_rss( 'language' ); ?></language>
15
-
16
- <?php
17
- global $redux_builder_amp;
18
- $number_of_articles = '';
19
- if( isset( $redux_builder_amp['ampforwp-fb-instant-article-posts'] ) && $redux_builder_amp['ampforwp-fb-instant-article-posts'] ){
20
- $number_of_articles = $redux_builder_amp['ampforwp-fb-instant-article-posts'];
21
- $number_of_articles = round( abs( floatval( $number_of_articles ) ) );
22
- }
23
- else{
24
- $number_of_articles = -1;
25
- }
26
- $args = array(
27
- 'post_status' => 'publish',
28
- 'ignore_sticky_posts' => 1,
29
- 'posts_per_page' => $number_of_articles
30
- );
31
- $query = new WP_Query( $args );
32
- while( $query->have_posts() ) :
33
-
34
- $query->the_post();
35
- ?>
36
-
37
- <item>
38
- <title><?php the_title_rss() ?></title>
39
- <link><?php the_permalink_rss() ?></link>
40
- <guid><?php the_guid(); ?></guid>
41
- <pubDate><?php echo mysql2date('c', get_post_time('c', true), false); ?></pubDate>
42
- <author><?php the_author() ?></author>
43
- <description><?php the_excerpt_rss(); ?></description>
44
- <content:encoded>
45
- <![CDATA[
46
- <?php
47
- $template_file = AMPFORWP_PLUGIN_DIR . 'templates/instant-articles/instant-article.php';
48
- load_template($template_file, false);
49
- ?>
50
- ]]>
51
- </content:encoded>
52
- </item>
53
-
54
- <?php endwhile; ?>
55
- </channel>
56
  </rss>
1
+ <?php header('Content-Type: ' . feed_content_type('rss2') . '; charset=' . get_option('blog_charset'), true);
2
+ $more = 1;
3
+
4
+ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
5
+ ?>
6
+
7
+ <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
8
+
9
+ <channel>
10
+ <title><?php bloginfo_rss('name'); ?></title>
11
+ <link><?php bloginfo_rss('url') ?></link>
12
+ <description><?php bloginfo_rss("description") ?></description>
13
+ <lastBuildDate><?php echo mysql2date('c', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
14
+ <language><?php bloginfo_rss( 'language' ); ?></language>
15
+
16
+ <?php
17
+ global $redux_builder_amp;
18
+ $number_of_articles = '';
19
+ if( isset( $redux_builder_amp['ampforwp-fb-instant-article-posts'] ) && $redux_builder_amp['ampforwp-fb-instant-article-posts'] ){
20
+ $number_of_articles = $redux_builder_amp['ampforwp-fb-instant-article-posts'];
21
+ $number_of_articles = round( abs( floatval( $number_of_articles ) ) );
22
+ }
23
+ else{
24
+ $number_of_articles = -1;
25
+ }
26
+ $args = array(
27
+ 'post_status' => 'publish',
28
+ 'ignore_sticky_posts' => 1,
29
+ 'posts_per_page' => $number_of_articles
30
+ );
31
+ $query = new WP_Query( $args );
32
+ while( $query->have_posts() ) :
33
+
34
+ $query->the_post();
35
+ ?>
36
+
37
+ <item>
38
+ <title><?php the_title_rss() ?></title>
39
+ <link><?php the_permalink_rss() ?></link>
40
+ <guid><?php the_guid(); ?></guid>
41
+ <pubDate><?php echo mysql2date('c', get_post_time('c', true), false); ?></pubDate>
42
+ <author><?php the_author() ?></author>
43
+ <description><?php the_excerpt_rss(); ?></description>
44
+ <content:encoded>
45
+ <![CDATA[
46
+ <?php
47
+ $template_file = AMPFORWP_PLUGIN_DIR . 'templates/instant-articles/instant-article.php';
48
+ load_template($template_file, false);
49
+ ?>
50
+ ]]>
51
+ </content:encoded>
52
+ </item>
53
+
54
+ <?php endwhile; ?>
55
+ </channel>
56
  </rss>
includes/admin-script.js CHANGED
@@ -1,96 +1,96 @@
1
- jQuery(function($) {
2
- var reduxOptionSearch = function(){
3
- jQuery('.redux_field_search').typeWatch({
4
- callback:function( searchString ){
5
- searchString = searchString.toLowerCase();
6
- var searchArray = searchString.split(' ');
7
- var parent = $(this).parents('.redux-container:first');
8
- var expanded_options = parent.find('.expand_options');
9
- if (searchString != "") {
10
- if (!expanded_options.hasClass('expanded')) {
11
- expanded_options.click();
12
- parent.find('.redux-main').addClass('redux-search');
13
- }
14
- } else {
15
- if (expanded_options.hasClass('expanded')) {
16
- expanded_options.click();
17
- parent.find('.redux-main').removeClass('redux-search');
18
- }
19
- parent.find('.redux-section-field, .redux-info-field, .redux-notice-field, .redux-container-group, .redux-section-desc, .redux-group-tab h3').show();
20
-
21
- if($('.redux-group-tab-link-li.active').length>0){
22
- var rel = $('.redux-group-tab-link-li.active a').attr('data-rel');
23
- var selector = 'div#'+rel+'_section_group';
24
- jQuery(selector).show();
25
- jQuery(selector).css('display','block');
26
-
27
- }else{
28
- $('.redux-group-tab-link-li.activeChild').click();
29
- $('div#'+rel+'_section_group').show();
30
- $('#'+rel+'_section_group').css('display','block');
31
- }
32
-
33
- }
34
- parent.find('.redux-field-container').each(function() {
35
- if (searchString != "") {
36
- parent.find('div.redux-group-tab').css('display','none');
37
- $(this).parents('tr:first').hide();
38
- } else {
39
- $(this).parents('tr:first').show();
40
- }
41
- });
42
- parent.find('.form-table tr').filter(function () {
43
- if(searchString==''){
44
- return false;
45
- }
46
- var item = $(this);
47
- var isMatch = true,
48
- text = $(this).find('.redux_field_th').text().toLowerCase();
49
- if ( !text || text == "" ) {
50
- return false;
51
- }
52
- $.each(searchArray, function (i, searchStr) {
53
- if (text.indexOf(searchStr) == -1) {
54
- isMatch = false;
55
- }
56
- });
57
- if (isMatch) {
58
- $(this).show();
59
- $(this).parents('div.redux-group-tab').css('display','block');
60
- }
61
- return isMatch;
62
- }).show( function() {
63
-
64
-
65
- });
66
- },
67
- wait:400,
68
- highlight:false,
69
- captureLength:0
70
- });
71
- }
72
- $(document).ready(function() {
73
- $('.redux-container').each(function() {
74
- if (!$(this).hasClass('redux-no-sections')) {
75
- $(this).find('.redux-main').prepend('<input style="float:right" class="redux_field_search" name="" type="text" placeholder="Search the controls"/>');
76
- reduxOptionSearch();
77
- }
78
- });
79
-
80
- $(".redux_field_search").keypress(function (evt) {
81
- //Deterime where our character code is coming from within the event
82
- var charCode = evt.charCode || evt.keyCode;
83
- if (charCode == 13) { //Enter key's keycode
84
- return false;
85
- }
86
- });
87
-
88
- if($(".amp-preview-button").length>0){
89
- $(".amp-preview-button").click(function(){
90
- var srcLink = $("#amp-preview-iframe").attr('data-src');
91
- $("#amp-preview-iframe").html("<iframe src='"+srcLink+"'></iframe>");
92
- });
93
- }
94
-
95
- });
96
  });
1
+ jQuery(function($) {
2
+ var reduxOptionSearch = function(){
3
+ jQuery('.redux_field_search').typeWatch({
4
+ callback:function( searchString ){
5
+ searchString = searchString.toLowerCase();
6
+ var searchArray = searchString.split(' ');
7
+ var parent = $(this).parents('.redux-container:first');
8
+ var expanded_options = parent.find('.expand_options');
9
+ if (searchString != "") {
10
+ if (!expanded_options.hasClass('expanded')) {
11
+ expanded_options.click();
12
+ parent.find('.redux-main').addClass('redux-search');
13
+ }
14
+ } else {
15
+ if (expanded_options.hasClass('expanded')) {
16
+ expanded_options.click();
17
+ parent.find('.redux-main').removeClass('redux-search');
18
+ }
19
+ parent.find('.redux-section-field, .redux-info-field, .redux-notice-field, .redux-container-group, .redux-section-desc, .redux-group-tab h3').show();
20
+
21
+ if($('.redux-group-tab-link-li.active').length>0){
22
+ var rel = $('.redux-group-tab-link-li.active a').attr('data-rel');
23
+ var selector = 'div#'+rel+'_section_group';
24
+ jQuery(selector).show();
25
+ jQuery(selector).css('display','block');
26
+
27
+ }else{
28
+ $('.redux-group-tab-link-li.activeChild').click();
29
+ $('div#'+rel+'_section_group').show();
30
+ $('#'+rel+'_section_group').css('display','block');
31
+ }
32
+
33
+ }
34
+ parent.find('.redux-field-container').each(function() {
35
+ if (searchString != "") {
36
+ parent.find('div.redux-group-tab').css('display','none');
37
+ $(this).parents('tr:first').hide();
38
+ } else {
39
+ $(this).parents('tr:first').show();
40
+ }
41
+ });
42
+ parent.find('.form-table tr').filter(function () {
43
+ if(searchString==''){
44
+ return false;
45
+ }
46
+ var item = $(this);
47
+ var isMatch = true,
48
+ text = $(this).find('.redux_field_th').text().toLowerCase();
49
+ if ( !text || text == "" ) {
50
+ return false;
51
+ }
52
+ $.each(searchArray, function (i, searchStr) {
53
+ if (text.indexOf(searchStr) == -1) {
54
+ isMatch = false;
55
+ }
56
+ });
57
+ if (isMatch) {
58
+ $(this).show();
59
+ $(this).parents('div.redux-group-tab').css('display','block');
60
+ }
61
+ return isMatch;
62
+ }).show( function() {
63
+
64
+
65
+ });
66
+ },
67
+ wait:400,
68
+ highlight:false,
69
+ captureLength:0
70
+ });
71
+ }
72
+ $(document).ready(function() {
73
+ $('.redux-container').each(function() {
74
+ if (!$(this).hasClass('redux-no-sections')) {
75
+ $(this).find('.redux-main').prepend('<input style="float:right" class="redux_field_search" name="" type="text" placeholder="Search the controls"/>');
76
+ reduxOptionSearch();
77
+ }
78
+ });
79
+
80
+ $(".redux_field_search").keypress(function (evt) {
81
+ //Deterime where our character code is coming from within the event
82
+ var charCode = evt.charCode || evt.keyCode;
83
+ if (charCode == 13) { //Enter key's keycode
84
+ return false;
85
+ }
86
+ });
87
+
88
+ if($(".amp-preview-button").length>0){
89
+ $(".amp-preview-button").click(function(){
90
+ var srcLink = $("#amp-preview-iframe").attr('data-src');
91
+ $("#amp-preview-iframe").html("<iframe src='"+srcLink+"'></iframe>");
92
+ });
93
+ }
94
+
95
+ });
96
  });
includes/admin-style.css CHANGED
@@ -1,135 +1,135 @@
1
- /*Bolt Icon*/
2
- .ampforwp-blurb-add:hover{
3
- cursor: pointer;
4
- }
5
- .ampforwp-blurb-add.button {
6
- margin-bottom: 10px;
7
- }
8
- .ampforwp-blurb-additional .preview-image {
9
- max-width:100%;
10
- width : 70px;
11
- height : 70px;
12
- }
13
- #toplevel_page_amp_options a .wp-menu-image:before{display: none}
14
-
15
- body #toplevel_page_amp_options .wp-menu-image{
16
- background-image:
17
- url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjMxNHB4IiBoZWlnaHQ9IjMxNXB4IiB2aWV3Qm94PSIwIDAgMzE0IDMxNSIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNDEgKDM1MzI2KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5TaGFwZTwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSIyNjA3MSIgZmlsbD0iI0ZGNEM0QyI+CiAgICAgICAgICAgIDxnIGlkPSJDYXBhXzEiPgogICAgICAgICAgICAgICAgPGcgaWQ9Il94MzJfNDAuX1Bvd2VyIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTU3LjAwNywwIEM3MC4yOTIsMCAwLDcwLjI5MiAwLDE1Ny4wMDcgQzAsMjQzLjcxNSA3MC4yOTIsMzE0LjAxNCAxNTcuMDA3LDMxNC4wMTQgQzI0My43MTYsMzE0LjAxNCAzMTQuMDE0LDI0My43MTUgMzE0LjAxNCwxNTcuMDA3IEMzMTQuMDE0LDcwLjI5MiAyNDMuNzE2LDAgMTU3LjAwNywwIFogTTE1Ny4wMDcsMjgyLjYxMiBDODcuNjM0LDI4Mi42MTIgMzEuNDAyLDIyNi4zNzIgMzEuNDAyLDE1Ny4wMDcgQzMxLjQwMiw4Ny42MzQgODcuNjM0LDMxLjQwMiAxNTcuMDA3LDMxLjQwMiBDMjI2LjM3MSwzMS40MDIgMjgyLjYxMSw4Ny42MzQgMjgyLjYxMSwxNTcuMDA3IEMyODIuNjEyLDIyNi4zNzIgMjI2LjM3MiwyODIuNjEyIDE1Ny4wMDcsMjgyLjYxMiBaIE0yMDQuMTExLDE0MS4zNjggTDE2My40NzksMTQxLjUzMyBDMTU5LjEzOSwxNDEuNTUzIDE1Ny41NDQsMTM4LjYyMyAxNTkuOTA1LDEzNC45NzkgTDIwMy4zOTcsNjguMTA5IEMyMDguMTI2LDYwLjg0MSAyMDYuOTg0LDU5LjkyMiAyMDAuODYxLDY2LjA1MyBMMTA1LjMwNSwxNjEuNiBDOTkuMTcyLDE2Ny43MzIgMTAxLjIzMiwxNzIuNjc2IDEwOS45MDYsMTcyLjY0MSBMMTQyLjY3OSwxNzIuNTA4IEMxNTEuMzQ3LDE3Mi40NzIgMTU0LjU1MiwxNzguMzM1IDE0OS44MjQsMTg1LjYwNSBMMTA2LjMzNCwyNTIuNDc3IEMxMDMuOTcyLDI1Ni4xMTIgMTA0LjU0MiwyNTYuNTgxIDEwNy42MiwyNTMuNTI3IEwxNzUuOTE1LDE4NS43MTcgQzE3OC45ODgsMTgyLjY1OSAxODMuOTUsMTc3LjY4NiAxODYuOTgzLDE3NC41OTYgTDIwOC43ODgsMTUyLjQ4NSBDMjE0Ljg3NSwxNDYuMzE3IDIxMi43NzUsMTQxLjMzIDIwNC4xMTEsMTQxLjM2OCBaIiBpZD0iU2hhcGUiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+) !important;
18
- background-repeat: no-repeat;
19
- background-position: center;
20
- -webkit-background-size: 20px auto;
21
- background-size: 20px auto;
22
- }
23
- .amp_content_builder .redux-group-tab-link-a span:after {
24
- /* content: "NEW";*/
25
- color: #fff;
26
- font-size: 10px;
27
- background: #4452a7;
28
- padding: 4px 7px;
29
- border-radius: 30px;
30
- font-weight: normal;
31
- position: relative;
32
- top: -1px;
33
- left: 5px;
34
- }
35
- .redux-container #redux-header .display_header h2{
36
- background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjMxNHB4IiBoZWlnaHQ9IjMxNXB4IiB2aWV3Qm94PSIwIDAgMzE0IDMxNSIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNDEgKDM1MzI2KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5TaGFwZTwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSIjZmZmIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSIyNjA3MSIgZmlsbD0iI2ZmZiI+CiAgICAgICAgICAgIDxnIGlkPSJDYXBhXzEiPgogICAgICAgICAgICAgICAgPGcgaWQ9Il94MzJfNDAuX1Bvd2VyIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTU3LjAwNywwIEM3MC4yOTIsMCAwLDcwLjI5MiAwLDE1Ny4wMDcgQzAsMjQzLjcxNSA3MC4yOTIsMzE0LjAxNCAxNTcuMDA3LDMxNC4wMTQgQzI0My43MTYsMzE0LjAxNCAzMTQuMDE0LDI0My43MTUgMzE0LjAxNCwxNTcuMDA3IEMzMTQuMDE0LDcwLjI5MiAyNDMuNzE2LDAgMTU3LjAwNywwIFogTTE1Ny4wMDcsMjgyLjYxMiBDODcuNjM0LDI4Mi42MTIgMzEuNDAyLDIyNi4zNzIgMzEuNDAyLDE1Ny4wMDcgQzMxLjQwMiw4Ny42MzQgODcuNjM0LDMxLjQwMiAxNTcuMDA3LDMxLjQwMiBDMjI2LjM3MSwzMS40MDIgMjgyLjYxMSw4Ny42MzQgMjgyLjYxMSwxNTcuMDA3IEMyODIuNjEyLDIyNi4zNzIgMjI2LjM3MiwyODIuNjEyIDE1Ny4wMDcsMjgyLjYxMiBaIE0yMDQuMTExLDE0MS4zNjggTDE2My40NzksMTQxLjUzMyBDMTU5LjEzOSwxNDEuNTUzIDE1Ny41NDQsMTM4LjYyMyAxNTkuOTA1LDEzNC45NzkgTDIwMy4zOTcsNjguMTA5IEMyMDguMTI2LDYwLjg0MSAyMDYuOTg0LDU5LjkyMiAyMDAuODYxLDY2LjA1MyBMMTA1LjMwNSwxNjEuNiBDOTkuMTcyLDE2Ny43MzIgMTAxLjIzMiwxNzIuNjc2IDEwOS45MDYsMTcyLjY0MSBMMTQyLjY3OSwxNzIuNTA4IEMxNTEuMzQ3LDE3Mi40NzIgMTU0LjU1MiwxNzguMzM1IDE0OS44MjQsMTg1LjYwNSBMMTA2LjMzNCwyNTIuNDc3IEMxMDMuOTcyLDI1Ni4xMTIgMTA0LjU0MiwyNTYuNTgxIDEwNy42MiwyNTMuNTI3IEwxNzUuOTE1LDE4NS43MTcgQzE3OC45ODgsMTgyLjY1OSAxODMuOTUsMTc3LjY4NiAxODYuOTgzLDE3NC41OTYgTDIwOC43ODgsMTUyLjQ4NSBDMjE0Ljg3NSwxNDYuMzE3IDIxMi43NzUsMTQxLjMzIDIwNC4xMTEsMTQxLjM2OCBaIiBpZD0iU2hhcGUiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+") !important;
37
- background-size: 18px;
38
- background-repeat: no-repeat;
39
- padding-left: 26px;
40
- background-position: 0px 0;
41
- }
42
- .amp-update-notice .notice-dismiss{
43
- display: none
44
- }
45
-
46
- /* Mobile preview button and preview Iframe Styling #1082 */
47
- .col-sm-12 {
48
- width: 100%;
49
- }
50
- .margin-top-bottom {
51
- margin-top: 9px;
52
- margin-bottom: 10px;
53
- }
54
- .text-center {
55
- text-align: center;
56
- }
57
- #ampforwp-preview-format {
58
- margin-bottom: 0px;
59
- line-height: 0.5em;
60
- }
61
- .ampforwp-preview-phone-frame-wrapper {
62
- width:110%;
63
- display:inline-block;
64
- position: relative;
65
- max-width: 300px;
66
- text-align: center;
67
- margin-left: -12px;
68
- }
69
- .ampforwp-preview-phone-frame-wrapper:after {
70
- padding-top: 180%;
71
- display:block;
72
- content: '';
73
- }
74
- .ampforwp-preview-phone-frame {
75
- position: absolute;
76
- top: 0;
77
- bottom: 0;
78
- right: 0;
79
- left: 0;
80
- border: 1px solid #e5e5e5;
81
- border-radius: 40px;
82
- padding-top:50px;
83
- padding-bottom: 35px;
84
- background: #f1f1f1;
85
-
86
- }
87
- .ampforwp-preview-container {
88
- height: 100%;
89
- position: relative;
90
- width: 100%;
91
- border: 1px solid #e5e5e5;
92
- overflow: hidden;
93
- }
94
- .ampforwp-preview-container > iframe {
95
- height: 100%;
96
- width: 100%;
97
- background-color: black;
98
- transform: scale(1, 1);
99
- transform-origin: top left;
100
- }
101
- #TB_window #TB_ajaxContent{
102
- width: 100%;
103
- height: 100%;
104
- }
105
- .ampforwp-preview-button-container{
106
- float: right;
107
- margin-top: 0px;
108
- }
109
- .meta-radio-two{margin-right: 8px; top: 3px; position: relative;}
110
- #wp-admin-bar-ampforwp-view-amp a, #wp-admin-bar-ampforwp-view-amp:hover a{
111
- background-size: 18px !important;background-repeat: no-repeat !important;background-position: 4px 7px !important;text-indent: -99999px;width: 12px; background:
112
- url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjMxNHB4IiBoZWlnaHQ9IjMxNXB4IiB2aWV3Qm94PSIwIDAgMzE0IDMxNSIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNDEgKDM1MzI2KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5TaGFwZTwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSIjODI4NzhjIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSIyNjA3MSIgZmlsbD0iIzgyODc4YyI+CiAgICAgICAgICAgIDxnIGlkPSJDYXBhXzEiPgogICAgICAgICAgICAgICAgPGcgaWQ9Il94MzJfNDAuX1Bvd2VyIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTU3LjAwNywwIEM3MC4yOTIsMCAwLDcwLjI5MiAwLDE1Ny4wMDcgQzAsMjQzLjcxNSA3MC4yOTIsMzE0LjAxNCAxNTcuMDA3LDMxNC4wMTQgQzI0My43MTYsMzE0LjAxNCAzMTQuMDE0LDI0My43MTUgMzE0LjAxNCwxNTcuMDA3IEMzMTQuMDE0LDcwLjI5MiAyNDMuNzE2LDAgMTU3LjAwNywwIFogTTE1Ny4wMDcsMjgyLjYxMiBDODcuNjM0LDI4Mi42MTIgMzEuNDAyLDIyNi4zNzIgMzEuNDAyLDE1Ny4wMDcgQzMxLjQwMiw4Ny42MzQgODcuNjM0LDMxLjQwMiAxNTcuMDA3LDMxLjQwMiBDMjI2LjM3MSwzMS40MDIgMjgyLjYxMSw4Ny42MzQgMjgyLjYxMSwxNTcuMDA3IEMyODIuNjEyLDIyNi4zNzIgMjI2LjM3MiwyODIuNjEyIDE1Ny4wMDcsMjgyLjYxMiBaIE0yMDQuMTExLDE0MS4zNjggTDE2My40NzksMTQxLjUzMyBDMTU5LjEzOSwxNDEuNTUzIDE1Ny41NDQsMTM4LjYyMyAxNTkuOTA1LDEzNC45NzkgTDIwMy4zOTcsNjguMTA5IEMyMDguMTI2LDYwLjg0MSAyMDYuOTg0LDU5LjkyMiAyMDAuODYxLDY2LjA1MyBMMTA1LjMwNSwxNjEuNiBDOTkuMTcyLDE2Ny43MzIgMTAxLjIzMiwxNzIuNjc2IDEwOS45MDYsMTcyLjY0MSBMMTQyLjY3OSwxNzIuNTA4IEMxNTEuMzQ3LDE3Mi40NzIgMTU0LjU1MiwxNzguMzM1IDE0OS44MjQsMTg1LjYwNSBMMTA2LjMzNCwyNTIuNDc3IEMxMDMuOTcyLDI1Ni4xMTIgMTA0LjU0MiwyNTYuNTgxIDEwNy42MiwyNTMuNTI3IEwxNzUuOTE1LDE4NS43MTcgQzE3OC45ODgsMTgyLjY1OSAxODMuOTUsMTc3LjY4NiAxODYuOTgzLDE3NC41OTYgTDIwOC43ODgsMTUyLjQ4NSBDMjE0Ljg3NSwxNDYuMzE3IDIxMi43NzUsMTQxLjMzIDIwNC4xMTEsMTQxLjM2OCBaIiBpZD0iU2hhcGUiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+)
113
- no-repeat
114
- 4px 7px;
115
-
116
- }
117
- .amp-theme-selector-img a{
118
- background: rgba(0, 0, 0, 0.7);
119
- text-decoration: none;
120
- padding: 3px 8px 4px 7px;
121
- bottom: 16px;
122
- font-size: 12px;
123
- border-radius: 100px;
124
- color: #fff;
125
- position: relative;
126
- right: 62px;
127
- }
128
- .amp-theme-selector-img:hover a {
129
- background: #4452a7;
130
- }
131
- .amp-theme-selector-img img{
132
- position: relative;
133
- visibility: visible;
134
- cursor:pointer;
135
  }
1
+ /*Bolt Icon*/
2
+ .ampforwp-blurb-add:hover{
3
+ cursor: pointer;
4
+ }
5
+ .ampforwp-blurb-add.button {
6
+ margin-bottom: 10px;
7
+ }
8
+ .ampforwp-blurb-additional .preview-image {
9
+ max-width:100%;
10
+ width : 70px;
11
+ height : 70px;
12
+ }
13
+ #toplevel_page_amp_options a .wp-menu-image:before{display: none}
14
+
15
+ body #toplevel_page_amp_options .wp-menu-image{
16
+ background-image:
17
+ url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjMxNHB4IiBoZWlnaHQ9IjMxNXB4IiB2aWV3Qm94PSIwIDAgMzE0IDMxNSIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNDEgKDM1MzI2KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5TaGFwZTwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSIyNjA3MSIgZmlsbD0iI0ZGNEM0QyI+CiAgICAgICAgICAgIDxnIGlkPSJDYXBhXzEiPgogICAgICAgICAgICAgICAgPGcgaWQ9Il94MzJfNDAuX1Bvd2VyIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTU3LjAwNywwIEM3MC4yOTIsMCAwLDcwLjI5MiAwLDE1Ny4wMDcgQzAsMjQzLjcxNSA3MC4yOTIsMzE0LjAxNCAxNTcuMDA3LDMxNC4wMTQgQzI0My43MTYsMzE0LjAxNCAzMTQuMDE0LDI0My43MTUgMzE0LjAxNCwxNTcuMDA3IEMzMTQuMDE0LDcwLjI5MiAyNDMuNzE2LDAgMTU3LjAwNywwIFogTTE1Ny4wMDcsMjgyLjYxMiBDODcuNjM0LDI4Mi42MTIgMzEuNDAyLDIyNi4zNzIgMzEuNDAyLDE1Ny4wMDcgQzMxLjQwMiw4Ny42MzQgODcuNjM0LDMxLjQwMiAxNTcuMDA3LDMxLjQwMiBDMjI2LjM3MSwzMS40MDIgMjgyLjYxMSw4Ny42MzQgMjgyLjYxMSwxNTcuMDA3IEMyODIuNjEyLDIyNi4zNzIgMjI2LjM3MiwyODIuNjEyIDE1Ny4wMDcsMjgyLjYxMiBaIE0yMDQuMTExLDE0MS4zNjggTDE2My40NzksMTQxLjUzMyBDMTU5LjEzOSwxNDEuNTUzIDE1Ny41NDQsMTM4LjYyMyAxNTkuOTA1LDEzNC45NzkgTDIwMy4zOTcsNjguMTA5IEMyMDguMTI2LDYwLjg0MSAyMDYuOTg0LDU5LjkyMiAyMDAuODYxLDY2LjA1MyBMMTA1LjMwNSwxNjEuNiBDOTkuMTcyLDE2Ny43MzIgMTAxLjIzMiwxNzIuNjc2IDEwOS45MDYsMTcyLjY0MSBMMTQyLjY3OSwxNzIuNTA4IEMxNTEuMzQ3LDE3Mi40NzIgMTU0LjU1MiwxNzguMzM1IDE0OS44MjQsMTg1LjYwNSBMMTA2LjMzNCwyNTIuNDc3IEMxMDMuOTcyLDI1Ni4xMTIgMTA0LjU0MiwyNTYuNTgxIDEwNy42MiwyNTMuNTI3IEwxNzUuOTE1LDE4NS43MTcgQzE3OC45ODgsMTgyLjY1OSAxODMuOTUsMTc3LjY4NiAxODYuOTgzLDE3NC41OTYgTDIwOC43ODgsMTUyLjQ4NSBDMjE0Ljg3NSwxNDYuMzE3IDIxMi43NzUsMTQxLjMzIDIwNC4xMTEsMTQxLjM2OCBaIiBpZD0iU2hhcGUiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+) !important;
18
+ background-repeat: no-repeat;
19
+ background-position: center;
20
+ -webkit-background-size: 20px auto;
21
+ background-size: 20px auto;
22
+ }
23
+ .amp_content_builder .redux-group-tab-link-a span:after {
24
+ /* content: "NEW";*/
25
+ color: #fff;
26
+ font-size: 10px;
27
+ background: #4452a7;
28
+ padding: 4px 7px;
29
+ border-radius: 30px;
30
+ font-weight: normal;
31
+ position: relative;
32
+ top: -1px;
33
+ left: 5px;
34
+ }
35
+ .redux-container #redux-header .display_header h2{
36
+ background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjMxNHB4IiBoZWlnaHQ9IjMxNXB4IiB2aWV3Qm94PSIwIDAgMzE0IDMxNSIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNDEgKDM1MzI2KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5TaGFwZTwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSIjZmZmIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSIyNjA3MSIgZmlsbD0iI2ZmZiI+CiAgICAgICAgICAgIDxnIGlkPSJDYXBhXzEiPgogICAgICAgICAgICAgICAgPGcgaWQ9Il94MzJfNDAuX1Bvd2VyIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTU3LjAwNywwIEM3MC4yOTIsMCAwLDcwLjI5MiAwLDE1Ny4wMDcgQzAsMjQzLjcxNSA3MC4yOTIsMzE0LjAxNCAxNTcuMDA3LDMxNC4wMTQgQzI0My43MTYsMzE0LjAxNCAzMTQuMDE0LDI0My43MTUgMzE0LjAxNCwxNTcuMDA3IEMzMTQuMDE0LDcwLjI5MiAyNDMuNzE2LDAgMTU3LjAwNywwIFogTTE1Ny4wMDcsMjgyLjYxMiBDODcuNjM0LDI4Mi42MTIgMzEuNDAyLDIyNi4zNzIgMzEuNDAyLDE1Ny4wMDcgQzMxLjQwMiw4Ny42MzQgODcuNjM0LDMxLjQwMiAxNTcuMDA3LDMxLjQwMiBDMjI2LjM3MSwzMS40MDIgMjgyLjYxMSw4Ny42MzQgMjgyLjYxMSwxNTcuMDA3IEMyODIuNjEyLDIyNi4zNzIgMjI2LjM3MiwyODIuNjEyIDE1Ny4wMDcsMjgyLjYxMiBaIE0yMDQuMTExLDE0MS4zNjggTDE2My40NzksMTQxLjUzMyBDMTU5LjEzOSwxNDEuNTUzIDE1Ny41NDQsMTM4LjYyMyAxNTkuOTA1LDEzNC45NzkgTDIwMy4zOTcsNjguMTA5IEMyMDguMTI2LDYwLjg0MSAyMDYuOTg0LDU5LjkyMiAyMDAuODYxLDY2LjA1MyBMMTA1LjMwNSwxNjEuNiBDOTkuMTcyLDE2Ny43MzIgMTAxLjIzMiwxNzIuNjc2IDEwOS45MDYsMTcyLjY0MSBMMTQyLjY3OSwxNzIuNTA4IEMxNTEuMzQ3LDE3Mi40NzIgMTU0LjU1MiwxNzguMzM1IDE0OS44MjQsMTg1LjYwNSBMMTA2LjMzNCwyNTIuNDc3IEMxMDMuOTcyLDI1Ni4xMTIgMTA0LjU0MiwyNTYuNTgxIDEwNy42MiwyNTMuNTI3IEwxNzUuOTE1LDE4NS43MTcgQzE3OC45ODgsMTgyLjY1OSAxODMuOTUsMTc3LjY4NiAxODYuOTgzLDE3NC41OTYgTDIwOC43ODgsMTUyLjQ4NSBDMjE0Ljg3NSwxNDYuMzE3IDIxMi43NzUsMTQxLjMzIDIwNC4xMTEsMTQxLjM2OCBaIiBpZD0iU2hhcGUiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+") !important;
37
+ background-size: 18px;
38
+ background-repeat: no-repeat;
39
+ padding-left: 26px;
40
+ background-position: 0px 0;
41
+ }
42
+ .amp-update-notice .notice-dismiss{
43
+ display: none
44
+ }
45
+
46
+ /* Mobile preview button and preview Iframe Styling #1082 */
47
+ .col-sm-12 {
48
+ width: 100%;
49
+ }
50
+ .margin-top-bottom {
51
+ margin-top: 9px;
52
+ margin-bottom: 10px;
53
+ }
54
+ .text-center {
55
+ text-align: center;
56
+ }
57
+ #ampforwp-preview-format {
58
+ margin-bottom: 0px;
59
+ line-height: 0.5em;
60
+ }
61
+ .ampforwp-preview-phone-frame-wrapper {
62
+ width:110%;
63
+ display:inline-block;
64
+ position: relative;
65
+ max-width: 300px;
66
+ text-align: center;
67
+ margin-left: -12px;
68
+ }
69
+ .ampforwp-preview-phone-frame-wrapper:after {
70
+ padding-top: 180%;
71
+ display:block;
72
+ content: '';
73
+ }
74
+ .ampforwp-preview-phone-frame {
75
+ position: absolute;
76
+ top: 0;
77
+ bottom: 0;
78
+ right: 0;
79
+ left: 0;
80
+ border: 1px solid #e5e5e5;
81
+ border-radius: 40px;
82
+ padding-top:50px;
83
+ padding-bottom: 35px;
84
+ background: #f1f1f1;
85
+
86
+ }
87
+ .ampforwp-preview-container {
88
+ height: 100%;
89
+ position: relative;
90
+ width: 100%;
91
+ border: 1px solid #e5e5e5;
92
+ overflow: hidden;
93
+ }
94
+ .ampforwp-preview-container > iframe {
95
+ height: 100%;
96
+ width: 100%;
97
+ background-color: black;
98
+ transform: scale(1, 1);
99
+ transform-origin: top left;
100
+ }
101
+ #TB_window #TB_ajaxContent{
102
+ width: 100%;
103
+ height: 100%;
104
+ }
105
+ .ampforwp-preview-button-container{
106
+ float: right;
107
+ margin-top: 0px;
108
+ }
109
+ .meta-radio-two{margin-right: 8px; top: 3px; position: relative;}
110
+ #wp-admin-bar-ampforwp-view-amp a, #wp-admin-bar-ampforwp-view-amp:hover a{
111
+ background-size: 18px !important;background-repeat: no-repeat !important;background-position: 4px 7px !important;text-indent: -99999px;width: 12px; background:
112
+ url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjMxNHB4IiBoZWlnaHQ9IjMxNXB4IiB2aWV3Qm94PSIwIDAgMzE0IDMxNSIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNDEgKDM1MzI2KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5TaGFwZTwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSIjODI4NzhjIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSIyNjA3MSIgZmlsbD0iIzgyODc4YyI+CiAgICAgICAgICAgIDxnIGlkPSJDYXBhXzEiPgogICAgICAgICAgICAgICAgPGcgaWQ9Il94MzJfNDAuX1Bvd2VyIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTU3LjAwNywwIEM3MC4yOTIsMCAwLDcwLjI5MiAwLDE1Ny4wMDcgQzAsMjQzLjcxNSA3MC4yOTIsMzE0LjAxNCAxNTcuMDA3LDMxNC4wMTQgQzI0My43MTYsMzE0LjAxNCAzMTQuMDE0LDI0My43MTUgMzE0LjAxNCwxNTcuMDA3IEMzMTQuMDE0LDcwLjI5MiAyNDMuNzE2LDAgMTU3LjAwNywwIFogTTE1Ny4wMDcsMjgyLjYxMiBDODcuNjM0LDI4Mi42MTIgMzEuNDAyLDIyNi4zNzIgMzEuNDAyLDE1Ny4wMDcgQzMxLjQwMiw4Ny42MzQgODcuNjM0LDMxLjQwMiAxNTcuMDA3LDMxLjQwMiBDMjI2LjM3MSwzMS40MDIgMjgyLjYxMSw4Ny42MzQgMjgyLjYxMSwxNTcuMDA3IEMyODIuNjEyLDIyNi4zNzIgMjI2LjM3MiwyODIuNjEyIDE1Ny4wMDcsMjgyLjYxMiBaIE0yMDQuMTExLDE0MS4zNjggTDE2My40NzksMTQxLjUzMyBDMTU5LjEzOSwxNDEuNTUzIDE1Ny41NDQsMTM4LjYyMyAxNTkuOTA1LDEzNC45NzkgTDIwMy4zOTcsNjguMTA5IEMyMDguMTI2LDYwLjg0MSAyMDYuOTg0LDU5LjkyMiAyMDAuODYxLDY2LjA1MyBMMTA1LjMwNSwxNjEuNiBDOTkuMTcyLDE2Ny43MzIgMTAxLjIzMiwxNzIuNjc2IDEwOS45MDYsMTcyLjY0MSBMMTQyLjY3OSwxNzIuNTA4IEMxNTEuMzQ3LDE3Mi40NzIgMTU0LjU1MiwxNzguMzM1IDE0OS44MjQsMTg1LjYwNSBMMTA2LjMzNCwyNTIuNDc3IEMxMDMuOTcyLDI1Ni4xMTIgMTA0LjU0MiwyNTYuNTgxIDEwNy42MiwyNTMuNTI3IEwxNzUuOTE1LDE4NS43MTcgQzE3OC45ODgsMTgyLjY1OSAxODMuOTUsMTc3LjY4NiAxODYuOTgzLDE3NC41OTYgTDIwOC43ODgsMTUyLjQ4NSBDMjE0Ljg3NSwxNDYuMzE3IDIxMi43NzUsMTQxLjMzIDIwNC4xMTEsMTQxLjM2OCBaIiBpZD0iU2hhcGUiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+)
113
+ no-repeat
114
+ 4px 7px;
115
+
116
+ }
117
+ .amp-theme-selector-img a{
118
+ background: rgba(0, 0, 0, 0.7);
119
+ text-decoration: none;
120
+ padding: 3px 8px 4px 7px;
121
+ bottom: 16px;
122
+ font-size: 12px;
123
+ border-radius: 100px;
124
+ color: #fff;
125
+ position: relative;
126
+ right: 62px;
127
+ }
128
+ .amp-theme-selector-img:hover a {
129
+ background: #4452a7;
130
+ }
131
+ .amp-theme-selector-img img{
132
+ position: relative;
133
+ visibility: visible;
134
+ cursor:pointer;
135
  }
includes/disqus.php CHANGED
@@ -1,92 +1,92 @@
1
- <div id="disqus_thread"></div>
2
- <script>
3
-
4
- var QueryString = function () {
5
- var query_string = {};
6
- var query = window.location.search.substring(1);
7
- var vars = query.split("&");
8
- for (var i=0;i<vars.length;i++) {
9
- var pair = vars[i].split("=");
10
- if (typeof query_string[pair[0]] === "undefined") {
11
- query_string[pair[0]] = decodeURIComponent(pair[1]);
12
- } else if (typeof query_string[pair[0]] === "string") {
13
- var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];
14
- query_string[pair[0]] = arr;
15
- } else {
16
- query_string[pair[0]].push(decodeURIComponent(pair[1]));
17
- }
18
- }
19
- return query_string;
20
- }();
21
-
22
- var url = QueryString.url;
23
- var identifier = QueryString.identifier;
24
- var disqus_name = QueryString.disqus_name;
25
- var disqus_title = QueryString.disqus_title;
26
-
27
- var disqus_config = function () {
28
- this.page.url = url;
29
- this.page.title = disqus_title;
30
- this.page.identifier = identifier || url;
31
- };
32
-
33
- (function () {
34
- var d = document, s = d.createElement('script');
35
- s.src = disqus_name;
36
- s.setAttribute('data-timestamp', +new Date());
37
- (d.head || d.body).appendChild(s);
38
- })();
39
-
40
- (function () {
41
- function checkSizeChange() {
42
- var viewportHeight = window.innerHeight;
43
- var contentHeight = document.getElementById('disqus_thread').clientHeight;
44
- if (viewportHeight !== contentHeight && contentHeight > 100) {
45
- window.parent.postMessage({
46
- sentinel: 'amp',
47
- type: 'embed-size',
48
- height: contentHeight
49
- }, '*')
50
- }
51
- }
52
-
53
- var mutationObserverAvailable = typeof window.MutationObserver === 'function';
54
-
55
- function bindObserver() {
56
- var foundframe = false,
57
- frame, framename,
58
- frames = document.getElementsByTagName('iframe');
59
-
60
- for (var i=0; i < frames.length; ++i) {
61
- frame = frames[i];
62
- framename = frame.getAttribute("name");
63
- if ( framename && /dsq/.test(framename) ) {
64
- // check the size now since the frame is now available
65
- checkSizeChange();
66
-
67
- var resizeObserver = new MutationObserver(checkSizeChange);
68
- resizeObserver.observe(frame, {
69
- attributes: true,
70
- attributeFilter: ['style']
71
- });
72
- foundframe = true;
73
- break;
74
- }
75
- }
76
-
77
- // if the frame is not available yet try again later
78
- if (foundframe === false) {
79
- setTimeout(bindObserver, 200);
80
- return;
81
- }
82
- }
83
-
84
- // use mutation observers to quickly change the size of the iframe
85
- if (mutationObserverAvailable) {
86
- bindObserver();
87
- }
88
-
89
- // also check periodically for the size of the frame
90
- setInterval(checkSizeChange, mutationObserverAvailable ? 5000 : 500);
91
- })();
92
  </script>
1
+ <div id="disqus_thread"></div>
2
+ <script>
3
+
4
+ var QueryString = function () {
5
+ var query_string = {};
6
+ var query = window.location.search.substring(1);
7
+ var vars = query.split("&");
8
+ for (var i=0;i<vars.length;i++) {
9
+ var pair = vars[i].split("=");
10
+ if (typeof query_string[pair[0]] === "undefined") {
11
+ query_string[pair[0]] = decodeURIComponent(pair[1]);
12
+ } else if (typeof query_string[pair[0]] === "string") {
13
+ var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];
14
+ query_string[pair[0]] = arr;
15
+ } else {
16
+ query_string[pair[0]].push(decodeURIComponent(pair[1]));
17
+ }
18
+ }
19
+ return query_string;
20
+ }();
21
+
22
+ var url = QueryString.url;
23
+ var identifier = QueryString.identifier;
24
+ var disqus_name = QueryString.disqus_name;
25
+ var disqus_title = QueryString.disqus_title;
26
+
27
+ var disqus_config = function () {
28
+ this.page.url = url;
29
+ this.page.title = disqus_title;
30
+ this.page.identifier = identifier || url;
31
+ };
32
+
33
+ (function () {
34
+ var d = document, s = d.createElement('script');
35
+ s.src = disqus_name;
36
+ s.setAttribute('data-timestamp', +new Date());
37
+ (d.head || d.body).appendChild(s);
38
+ })();
39
+
40
+ (function () {
41
+ function checkSizeChange() {
42
+ var viewportHeight = window.innerHeight;
43
+ var contentHeight = document.getElementById('disqus_thread').clientHeight;
44
+ if (viewportHeight !== contentHeight && contentHeight > 100) {
45
+ window.parent.postMessage({
46
+ sentinel: 'amp',
47
+ type: 'embed-size',
48
+ height: contentHeight
49
+ }, '*')
50
+ }
51
+ }
52
+
53
+ var mutationObserverAvailable = typeof window.MutationObserver === 'function';
54
+
55
+ function bindObserver() {
56
+ var foundframe = false,
57
+ frame, framename,
58
+ frames = document.getElementsByTagName('iframe');
59
+
60
+ for (var i=0; i < frames.length; ++i) {
61
+ frame = frames[i];
62
+ framename = frame.getAttribute("name");
63
+ if ( framename && /dsq/.test(framename) ) {
64
+ // check the size now since the frame is now available
65
+ checkSizeChange();
66
+
67
+ var resizeObserver = new MutationObserver(checkSizeChange);
68
+ resizeObserver.observe(frame, {
69
+ attributes: true,
70
+ attributeFilter: ['style']
71
+ });
72
+ foundframe = true;
73
+ break;
74
+ }
75
+ }
76
+
77
+ // if the frame is not available yet try again later
78
+ if (foundframe === false) {
79
+ setTimeout(bindObserver, 200);
80
+ return;
81
+ }
82
+ }
83
+
84
+ // use mutation observers to quickly change the size of the iframe
85
+ if (mutationObserverAvailable) {
86
+ bindObserver();
87
+ }
88
+
89
+ // also check periodically for the size of the frame
90
+ setInterval(checkSizeChange, mutationObserverAvailable ? 5000 : 500);
91
+ })();
92
  </script>
includes/includes.php CHANGED
@@ -1,56 +1,56 @@
1
- <?php
2
- /* This file will contain all the extra code that works like a supporting.
3
- 1. Register AMP menu
4
- 1.1 AMP Header menu
5
- 1.2 Footer Menu
6
-
7
- 2. Newsletter code
8
- */
9
- // 1. AMP menu code
10
- // Registering Custom AMP menu for this plugin
11
- // 1.1 AMP Header menu
12
- if (! function_exists( 'ampforwp_menu') ) {
13
- function ampforwp_menu() {
14
- register_nav_menus(
15
- array(
16
- 'amp-menu' => __( 'AMP Menu','accelerated-mobile-pages' ),
17
- )
18
- );
19
- }
20
- add_action( 'init', 'ampforwp_menu' );
21
- }
22
-
23
- // 1.2 Footer Menu
24
- add_action( 'init', 'ampforwp_footermenu' );
25
- if (! function_exists( 'ampforwp_footermenu') ) {
26
- function ampforwp_footermenu() {
27
- global $redux_builder_amp;
28
- if ( isset($redux_builder_amp['amp-design-selector']) && ($redux_builder_amp['amp-design-selector'] == 1 ||
29
- $redux_builder_amp['amp-design-selector'] == 2 ||
30
- $redux_builder_amp['amp-design-selector'] == 3 )) {
31
- register_nav_menus(
32
- array(
33
- 'amp-footer-menu' => __( 'AMP Footer Menu','accelerated-mobile-pages' ),
34
- )
35
- );
36
- }
37
- }
38
- }
39
-
40
-
41
- // 2. Newsletter code
42
- require_once( AMPFORWP_PLUGIN_DIR . '/includes/newsletter.php' );
43
-
44
- // 3. Some Extra Styling for Admin area
45
- add_action( 'admin_enqueue_scripts', 'ampforwp_add_admin_styling' );
46
- function ampforwp_add_admin_styling(){
47
- // Style file to add or modify css inside admin area
48
- wp_register_style( 'ampforwp_admin_css', untrailingslashit(AMPFORWP_PLUGIN_DIR_URI) . '/includes/admin-style.css', false, AMPFORWP_VERSION );
49
- wp_enqueue_style( 'ampforwp_admin_css' );
50
-
51
- // Admin area scripts file
52
- wp_register_script( 'ampforwp_admin_js', untrailingslashit(AMPFORWP_PLUGIN_DIR_URI) . '/includes/admin-script.js', false, AMPFORWP_VERSION );
53
- wp_enqueue_script( 'ampforwp_admin_js' );
54
-
55
- }
56
  ?>
1
+ <?php
2
+ /* This file will contain all the extra code that works like a supporting.
3
+ 1. Register AMP menu
4
+ 1.1 AMP Header menu
5
+ 1.2 Footer Menu
6
+
7
+ 2. Newsletter code
8
+ */
9
+ // 1. AMP menu code
10
+ // Registering Custom AMP menu for this plugin
11
+ // 1.1 AMP Header menu
12
+ if (! function_exists( 'ampforwp_menu') ) {
13
+ function ampforwp_menu() {
14
+ register_nav_menus(
15
+ array(
16
+ 'amp-menu' => __( 'AMP Menu','accelerated-mobile-pages' ),
17
+ )
18
+ );
19
+ }
20
+ add_action( 'init', 'ampforwp_menu' );
21
+ }
22
+
23
+ // 1.2 Footer Menu
24
+ add_action( 'init', 'ampforwp_footermenu' );
25
+ if (! function_exists( 'ampforwp_footermenu') ) {
26
+ function ampforwp_footermenu() {
27
+ global $redux_builder_amp;
28
+ if ( isset($redux_builder_amp['amp-design-selector']) && ($redux_builder_amp['amp-design-selector'] == 1 ||
29
+ $redux_builder_amp['amp-design-selector'] == 2 ||
30
+ $redux_builder_amp['amp-design-selector'] == 3 )) {
31
+ register_nav_menus(
32
+ array(
33
+ 'amp-footer-menu' => __( 'AMP Footer Menu','accelerated-mobile-pages' ),
34
+ )
35
+ );
36
+ }
37
+ }
38
+ }
39
+
40
+
41
+ // 2. Newsletter code
42
+ require_once( AMPFORWP_PLUGIN_DIR . '/includes/newsletter.php' );
43
+
44
+ // 3. Some Extra Styling for Admin area
45
+ add_action( 'admin_enqueue_scripts', 'ampforwp_add_admin_styling' );
46
+ function ampforwp_add_admin_styling(){
47
+ // Style file to add or modify css inside admin area
48
+ wp_register_style( 'ampforwp_admin_css', untrailingslashit(AMPFORWP_PLUGIN_DIR_URI) . '/includes/admin-style.css', false, AMPFORWP_VERSION );
49
+ wp_enqueue_style( 'ampforwp_admin_css' );
50
+
51
+ // Admin area scripts file
52
+ wp_register_script( 'ampforwp_admin_js', untrailingslashit(AMPFORWP_PLUGIN_DIR_URI) . '/includes/admin-script.js', false, AMPFORWP_VERSION );
53
+ wp_enqueue_script( 'ampforwp_admin_js' );
54
+
55
+ }
56
  ?>
includes/modules/ampforwp-blurb.php CHANGED
@@ -1,196 +1,196 @@
1
- <?php class AMPFORWP_Blurb_Widget extends WP_Widget {
2
- /*--------------------------------------------------*/
3
- /* Constructor
4
- /*--------------------------------------------------*/
5
-
6
- /**
7
- * Specifies the classname and description, instantiates the widget,
8
- * loads localization files, and includes necessary stylesheets and JavaScript.
9
- */
10
- public function __construct() {
11
-
12
- // Hooks fired when the Widget is activated and deactivated
13
- register_activation_hook( __FILE__, array( $this, 'activate' ) );
14
- register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) );
15
-
16
- parent::__construct(
17
- 'ampforwp-blurb',
18
- __( 'AMP Blurb Module', 'accelerated-mobile-pages' ),
19
- array( //
20
- 'classname' => 'ampforwp-blurb',
21
- 'description' => __( 'Displays Icon, headline and description. Best for showing features.', 'accelerated-mobile-pages' )
22
- )
23
- );
24
-
25
- add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts' ) );
26
-
27
- // Add static written Jquery
28
- // add_action( 'admin_footer', array( $this, 'footer_scritps') );
29
-
30
-
31
- } // end constructor
32
-
33
- /*--------------------------------------------------*/
34
- /* Widget API Functions
35
- /*--------------------------------------------------*/
36
-
37
- /**
38
- * Outputs the content of the widget.
39
- *
40
- * @param array args The array of form elements
41
- * @param array instance The current instance of the widget
42
- */
43
- public function widget( $args, $instance ) {
44
- $output = "";
45
-
46
- extract( $args, EXTR_SKIP );
47
-
48
- $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : '';
49
- $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
50
-
51
- $features = ( ! empty( $instance['features'] ) ) ? $instance['features'] : array();
52
-
53
-
54
- echo $before_widget;
55
-
56
- $output .= '<div class="amp-wp-content amp_cb_module amp_cb_blurb">';
57
-
58
- if ( $title ) {
59
- $output .= '<div class="amp_module_title">';
60
- $output .= $title;
61
- $output .= '</div>';
62
- }
63
-
64
- $output .= '<div class="flex-grid">';
65
-
66
- foreach( $features as $feature ) {
67
- $output .= '<div class="clmn">';
68
- if ( $feature['image'] ) {
69
- $output .= '<img src="'. $feature['image'] .'" height="80" width="80" alt="" />';
70
- }
71
- $output .= '<div class="amp_cb_content">';
72
- $output .= '<h4>'.$feature['title'].'</h4>';
73
- $output .= '<p>'.$feature['description'].'</p>';
74
- $output .= '</div>';
75
- $output .= '</div>';
76
- }
77
- $output .= '</div></div>'; // flex-grid & amp_cb_module
78
- $sanitizer = new AMPFORWP_Content( $output, array(),
79
- apply_filters( 'ampforwp_content_sanitizers',array( 'AMP_Img_Sanitizer' => array(),'AMP_Style_Sanitizer' => array() ) ) );
80
- $sanitized_output = $sanitizer->get_amp_content();
81
-
82
- if( $sanitized_output ) {
83
- echo $sanitized_output;
84
- }
85
-
86
- echo $after_widget;
87
-
88
- } // end widget
89
-
90
- /**
91
- * Processes the widget's options to be saved.
92
- *
93
- * @param array new_instance The new instance of values to be generated via the update.
94
- * @param array old_instance The previous instance of values before the update.
95
- */
96
- public function update( $new_instance, $old_instance ) {
97
-
98
- $instance = $old_instance;
99
-
100
- $instance['title'] = strip_tags($new_instance['title']);
101
-
102
- foreach($new_instance['features'] as $feature){
103
- $feature['title'] = strip_tags($feature['title']);
104
- $feature['description'] = strip_tags($feature['description']);
105
- $feature['image'] = strip_tags($feature['image']);
106
- }
107
- $instance['features'] = $new_instance['features'];
108
-
109
- return $instance;
110
-
111
- } // end widget
112
-
113
- /**
114
- * Generates the administration form for the widget.
115
- *
116
- * @param array instance The array of keys and values for the widget.
117
- */
118
- public function form( $instance ) {
119
-
120
- $instance = wp_parse_args(
121
- (array) $instance
122
- );
123
-
124
- $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; ?>
125
- <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
126
- <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
127
-
128
-
129
- <?php
130
-
131
- $features = ( ! empty( $instance['features'] ) ) ? $instance['features'] : array(); ?>
132
- <span class="ampforwp-blurb-additional">
133
- <?php
134
- $c = 0;
135
- if ( count( $features ) > 0 ) {
136
- foreach( $features as $feature ) {
137
- if ( isset( $feature['title'] ) || isset( $feature['description'] ) ) { ?>
138
- <div class="widget">
139
- <div class="widget-top"><div class="widget-title"><h3><?php echo $feature['title'];?><span class="in-widget-title"></span></h3></div>
140
- </div>
141
-
142
- <div class="widget-inside">
143
- <p>
144
- <label for="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][title]'; ?>"><?php _e( 'Title:' ); ?></label>
145
- <input class="widefat" id="<?php echo $this->get_field_id( 'features' ) .'-'. $c.'-title'; ?>" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][title]'; ?>" type="text" value="<?php echo $feature['title']; ?>" />
146
- <label for="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][description]'; ?>"><?php _e( 'Description:' ); ?></label>
147
-
148
- <textarea class="widefat" id="<?php echo $this->get_field_id( 'features' ) .'-'. $c.'-description'; ?>" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][description]'; ?>" rows="6" cols="50"><?php echo $feature['description']; ?></textarea> <span class="clear"></span>
149
- </p>
150
- <p>
151
- <label for="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][image]'; ?>"><?php _e( 'Image:' ); ?></label>
152
- <input type="button" class="select-img-<?php echo $c;?> button left" style="width:auto;" value="Select Image" onclick="ampSelectImage('<?php echo $c;?>');"/>
153
- <input type="button" style="display:none" name="removeimg" id="remove-img-<?php echo $c;?>" class="button button-secondary remove-img-button" data-count-type="<?php echo $c;?>" value="Remove Image" onclick="removeImage('<?php echo $c;?>')">
154
- <img src="<?php echo $instance['features']["$c"]['image'] ?>" class="preview-image block-image-<?php echo $c;?>" >
155
- <input type="hidden" id="amp-img-field-<?php echo $c;?>" class="img<?php echo $c;?>" style="width:auto;" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][image]'; ?>" id="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][image]';?>'" value="<?php echo $instance['features']["$c"]['image'] ?>" />
156
- </p>
157
- <p> <a class="ampforwp-blurb-remove delete button left"><?php _e('Remove Feature','accelerated-mobile-pages')?></a> </p>
158
- </div>
159
- </div>
160
- <?php
161
- $c = $c +1;
162
- }
163
- }
164
- } ?>
165
- </span>
166
-
167
- <a class="ampforwp-blurb-add button left"> <?php _e('Add Feature','accelerated-mobile-pages'); ?> </a>
168
-
169
- <?php
170
-
171
- } // end form
172
-
173
- /*--------------------------------------------------*/
174
- /* Public Functions
175
- /*--------------------------------------------------*/
176
-
177
- /**
178
- * Registers and enqueues admin-specific JavaScript.
179
- */
180
- public function register_admin_scripts() {
181
-
182
- wp_enqueue_script('media-upload');
183
- wp_enqueue_script('thickbox');
184
- wp_enqueue_style('thickbox');
185
-
186
- wp_enqueue_script( 'ampforwp-builder-script', plugins_url('/modules/js/amp.js' , dirname(__FILE__) ) , array( 'jquery' ), false, true );
187
-
188
- } // end register_admin_scripts
189
-
190
-
191
- } // end class
192
-
193
-
194
- add_action( 'widgets_init', function(){
195
- register_widget( 'AMPFORWP_Blurb_Widget' );
196
  });
1
+ <?php class AMPFORWP_Blurb_Widget extends WP_Widget {
2
+ /*--------------------------------------------------*/
3
+ /* Constructor
4
+ /*--------------------------------------------------*/
5
+
6
+ /**
7
+ * Specifies the classname and description, instantiates the widget,
8
+ * loads localization files, and includes necessary stylesheets and JavaScript.
9
+ */
10
+ public function __construct() {
11
+
12
+ // Hooks fired when the Widget is activated and deactivated
13
+ register_activation_hook( __FILE__, array( $this, 'activate' ) );
14
+ register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) );
15
+
16
+ parent::__construct(
17
+ 'ampforwp-blurb',
18
+ __( 'AMP Blurb Module', 'accelerated-mobile-pages' ),
19
+ array( //
20
+ 'classname' => 'ampforwp-blurb',
21
+ 'description' => __( 'Displays Icon, headline and description. Best for showing features.', 'accelerated-mobile-pages' )
22
+ )
23
+ );
24
+
25
+ add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts' ) );
26
+
27
+ // Add static written Jquery
28
+ // add_action( 'admin_footer', array( $this, 'footer_scritps') );
29
+
30
+
31
+ } // end constructor
32
+
33
+ /*--------------------------------------------------*/
34
+ /* Widget API Functions
35
+ /*--------------------------------------------------*/
36
+
37
+ /**
38
+ * Outputs the content of the widget.
39
+ *
40
+ * @param array args The array of form elements
41
+ * @param array instance The current instance of the widget
42
+ */
43
+ public function widget( $args, $instance ) {
44
+ $output = "";
45
+
46
+ extract( $args, EXTR_SKIP );
47
+
48
+ $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : '';
49
+ $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
50
+
51
+ $features = ( ! empty( $instance['features'] ) ) ? $instance['features'] : array();
52
+
53
+
54
+ echo $before_widget;
55
+
56
+ $output .= '<div class="amp-wp-content amp_cb_module amp_cb_blurb">';
57
+
58
+ if ( $title ) {
59
+ $output .= '<div class="amp_module_title">';
60
+ $output .= $title;
61
+ $output .= '</div>';
62
+ }
63
+
64
+ $output .= '<div class="flex-grid">';
65
+
66
+ foreach( $features as $feature ) {
67
+ $output .= '<div class="clmn">';
68
+ if ( $feature['image'] ) {
69
+ $output .= '<img src="'. $feature['image'] .'" height="80" width="80" alt="" />';
70
+ }
71
+ $output .= '<div class="amp_cb_content">';
72
+ $output .= '<h4>'.$feature['title'].'</h4>';
73
+ $output .= '<p>'.$feature['description'].'</p>';
74
+ $output .= '</div>';
75
+ $output .= '</div>';
76
+ }
77
+ $output .= '</div></div>'; // flex-grid & amp_cb_module
78
+ $sanitizer = new AMPFORWP_Content( $output, array(),
79
+ apply_filters( 'ampforwp_content_sanitizers',array( 'AMP_Img_Sanitizer' => array(),'AMP_Style_Sanitizer' => array() ) ) );
80
+ $sanitized_output = $sanitizer->get_amp_content();
81
+
82
+ if( $sanitized_output ) {
83
+ echo $sanitized_output;
84
+ }
85
+
86
+ echo $after_widget;
87
+
88
+ } // end widget
89
+
90
+ /**
91
+ * Processes the widget's options to be saved.
92
+ *
93
+ * @param array new_instance The new instance of values to be generated via the update.
94
+ * @param array old_instance The previous instance of values before the update.
95
+ */
96
+ public function update( $new_instance, $old_instance ) {
97
+
98
+ $instance = $old_instance;
99
+
100
+ $instance['title'] = strip_tags($new_instance['title']);
101
+
102
+ foreach($new_instance['features'] as $feature){
103
+ $feature['title'] = strip_tags($feature['title']);
104
+ $feature['description'] = strip_tags($feature['description']);
105
+ $feature['image'] = strip_tags($feature['image']);
106
+ }
107
+ $instance['features'] = $new_instance['features'];
108
+
109
+ return $instance;
110
+
111
+ } // end widget
112
+
113
+ /**
114
+ * Generates the administration form for the widget.
115
+ *
116
+ * @param array instance The array of keys and values for the widget.
117
+ */
118
+ public function form( $instance ) {
119
+
120
+ $instance = wp_parse_args(
121
+ (array) $instance
122
+ );
123
+
124
+ $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; ?>
125
+ <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
126
+ <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
127
+
128
+
129
+ <?php
130
+
131
+ $features = ( ! empty( $instance['features'] ) ) ? $instance['features'] : array(); ?>
132
+ <span class="ampforwp-blurb-additional">
133
+ <?php
134
+ $c = 0;
135
+ if ( count( $features ) > 0 ) {
136
+ foreach( $features as $feature ) {
137
+ if ( isset( $feature['title'] ) || isset( $feature['description'] ) ) { ?>
138
+ <div class="widget">
139
+ <div class="widget-top"><div class="widget-title"><h3><?php echo $feature['title'];?><span class="in-widget-title"></span></h3></div>
140
+ </div>
141
+
142
+ <div class="widget-inside">
143
+ <p>
144
+ <label for="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][title]'; ?>"><?php _e( 'Title:' ); ?></label>
145
+ <input class="widefat" id="<?php echo $this->get_field_id( 'features' ) .'-'. $c.'-title'; ?>" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][title]'; ?>" type="text" value="<?php echo $feature['title']; ?>" />
146
+ <label for="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][description]'; ?>"><?php _e( 'Description:' ); ?></label>
147
+
148
+ <textarea class="widefat" id="<?php echo $this->get_field_id( 'features' ) .'-'. $c.'-description'; ?>" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][description]'; ?>" rows="6" cols="50"><?php echo $feature['description']; ?></textarea> <span class="clear"></span>
149
+ </p>
150
+ <p>
151
+ <label for="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][image]'; ?>"><?php _e( 'Image:' ); ?></label>
152
+ <input type="button" class="select-img-<?php echo $c;?> button left" style="width:auto;" value="Select Image" onclick="ampSelectImage('<?php echo $c;?>');"/>
153
+ <input type="button" style="display:none" name="removeimg" id="remove-img-<?php echo $c;?>" class="button button-secondary remove-img-button" data-count-type="<?php echo $c;?>" value="Remove Image" onclick="removeImage('<?php echo $c;?>')">
154
+ <img src="<?php echo $instance['features']["$c"]['image'] ?>" class="preview-image block-image-<?php echo $c;?>" >
155
+ <input type="hidden" id="amp-img-field-<?php echo $c;?>" class="img<?php echo $c;?>" style="width:auto;" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][image]'; ?>" id="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][image]';?>'" value="<?php echo $instance['features']["$c"]['image'] ?>" />
156
+ </p>
157
+ <p> <a class="ampforwp-blurb-remove delete button left"><?php _e('Remove Feature','accelerated-mobile-pages')?></a> </p>
158
+ </div>
159
+ </div>
160
+ <?php
161
+ $c = $c +1;
162
+ }
163
+ }
164
+ } ?>
165
+ </span>
166
+
167
+ <a class="ampforwp-blurb-add button left"> <?php _e('Add Feature','accelerated-mobile-pages'); ?> </a>
168
+
169
+ <?php
170
+
171
+ } // end form
172
+
173
+ /*--------------------------------------------------*/
174
+ /* Public Functions
175
+ /*--------------------------------------------------*/
176
+
177
+ /**
178
+ * Registers and enqueues admin-specific JavaScript.
179
+ */
180
+ public function register_admin_scripts() {
181
+
182
+ wp_enqueue_script('media-upload');
183
+ wp_enqueue_script('thickbox');
184
+ wp_enqueue_style('thickbox');
185
+
186
+ wp_enqueue_script( 'ampforwp-builder-script', plugins_url('/modules/js/amp.js' , dirname(__FILE__) ) , array( 'jquery' ), false, true );
187
+
188
+ } // end register_admin_scripts
189
+
190
+
191
+ } // end class
192
+
193
+
194
+ add_action( 'widgets_init', function(){
195
+ register_widget( 'AMPFORWP_Blurb_Widget' );
196
  });
includes/modules/ampforwp-button.php CHANGED
@@ -1,252 +1,252 @@
1
- <?php class AMPFORWP_Button_Widget extends WP_Widget {
2
-
3
- /*--------------------------------------------------*/
4
- /* Constructor
5
- /*--------------------------------------------------*/
6
-
7
- /**
8
- * Specifies the classname and description, instantiates the widget,
9
- * loads localization files, and includes necessary stylesheets and JavaScript.
10
- */
11
- public function __construct() {
12
-
13
- // Hooks fired when the Widget is activated and deactivated
14
- register_activation_hook( __FILE__, array( $this, 'activate' ) );
15
- register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) );
16
-
17
- parent::__construct(
18
- 'ampforwp-button',
19
- __( 'AMP Button Module', 'accelerated-mobile-pages' ),
20
- array(
21
- 'classname' => 'ampforwp-button',
22
- 'description' => __( 'Displays Button with text and link options.', 'accelerated-mobile-pages' )
23
- )
24
- );
25
-
26
- add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts' ) );
27
-
28
- // Add static written Jquery
29
- add_action( 'admin_footer', array( $this, 'footer_scritps') );
30
-
31
-
32
- } // end constructor
33
-
34
- /*--------------------------------------------------*/
35
- /* Widget API Functions
36
- /*--------------------------------------------------*/
37
-
38
- /**
39
- * Outputs the content of the widget.
40
- *
41
- * @param array args The array of form elements
42
- * @param array instance The current instance of the widget
43
- */
44
- public function widget( $args, $instance ) {
45
- $target = "";
46
- $output = "";
47
-
48
- extract( $args, EXTR_SKIP );
49
-
50
- $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Classes' );
51
- $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
52
-
53
- $features = ( ! empty( $instance['features'] ) ) ? $instance['features'] : array();
54
-
55
-
56
-
57
- echo $before_widget;
58
- $output .= '<div class="amp-wp-content amp_cb_module amp_cb_btn">';
59
-
60
- foreach( $features as $feature ) {
61
-
62
- if ( $feature['radio'] == 'radio-off'){
63
- $target = "_self";
64
- } elseif( $feature['radio'] == 'radio-on' ){
65
- $target = "_blank";
66
- }
67
-
68
- if ( $feature['size'] == '1'){
69
- $size = "s_btn";
70
- } elseif( $feature['size'] == '2' ){
71
- $size = "m_btn";
72
- } elseif( $feature['size'] == '3' ){
73
- $size = "l_btn";
74
- }
75
- //Corrected the URL in button module and breaking of desing and link issue #951 & #972
76
- $output .= '<a href="'.esc_url($feature['url']).'" class="' . $size . '" target="' . $target . '" >'. $feature['title'] .'</a>';
77
- }
78
- $output .= '</div>';
79
-
80
- $sanitizer = new AMPFORWP_Content( $output, array(),
81
- apply_filters( 'ampforwp_content_sanitizers',array( 'AMP_Img_Sanitizer' => array(),'AMP_Style_Sanitizer' => array() ) ) );
82
- $sanitized_output = $sanitizer->get_amp_content();
83
-
84
- if( $sanitized_output ) {
85
- echo $sanitized_output;
86
- }
87
-
88
- echo $after_widget;
89
-
90
- } // end widget
91
-
92
- /**
93
- * Processes the widget's options to be saved.
94
- *
95
- * @param array new_instance The new instance of values to be generated via the update.
96
- * @param array old_instance The previous instance of values before the update.
97
- */
98
- public function update( $new_instance, $old_instance ) {
99
-
100
- $instance = $old_instance;
101
-
102
- $instance['title'] = strip_tags($new_instance['title']);
103
-
104
- foreach($new_instance['features'] as $feature){
105
- $feature['title'] = strip_tags($feature['title']);
106
- $feature['description'] = strip_tags($feature['description']);
107
- $feature['image'] = strip_tags($feature['image']);
108
- }
109
- $instance['features'] = $new_instance['features'];
110
-
111
- return $instance;
112
-
113
- } // end widget
114
-
115
- /**
116
- * Generates the administration form for the widget.
117
- *
118
- * @param array instance The array of keys and values for the widget.
119
- */
120
- public function form( $instance ) {
121
-
122
- $instance = wp_parse_args(
123
- (array) $instance
124
- );
125
-
126
- $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; ?>
127
- <p> </p>
128
-
129
-
130
- <?php
131
-
132
- $features = ( ! empty( $instance['features'] ) ) ? $instance['features'] : array(); ?>
133
- <span class="ampforwp-button-additional"> <?php
134
- $c = 0; ?>
135
-
136
- <?php
137
-
138
- if ( count( $features ) > 0 ) {
139
- foreach( $features as $feature ) {
140
- if ( isset( $feature['title'] ) || isset( $feature['description'] ) ) { ?>
141
- <div class="widget">
142
- <div class="widget-top"><div class="widget-title"><h3><?php echo $feature['title'];?><span class="in-widget-title"></span></h3></div>
143
- </div>
144
-
145
- <div class="widget-inside">
146
- <div class="widget-content">
147
- <p>
148
- <label for="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][title]'; ?>"><?php _e( 'Button Text:' ); ?></label>
149
- <input class="widefat" id="<?php echo $this->get_field_id( 'features' ) .'-'. $c.'-title'; ?>" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][title]'; ?>" type="text" value="<?php echo $feature['title']; ?>" /> </p>
150
-
151
- <p><label for="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][url]'; ?>"><?php _e( 'Url:' ); ?></label>
152
- <input class="widefat" id="<?php echo $this->get_field_id( 'features' ) .'-'. $c.'-url'; ?>" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][url]'; ?>" type="text" value="<?php echo $feature['url']; ?>" />
153
- </p>
154
-
155
-
156
- <p><label><?php _e('URL Target:'); ?> </label><br />
157
- <label class="radio_label" for="<?php echo $this->get_field_id('id') . "-on"; ?>"><?php _e('New Tab'); ?> </label>
158
- <input class="widefat" id="<?php echo $this->get_field_id('id') . "-on"; ?>" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][radio]'; ?>" type="radio" value="radio-on" <?php if ( $feature['radio'] == 'radio-on'): ?> checked <?php endif ?> />
159
-
160
- <label class="radio_label" for="<?php echo $this->get_field_id('id') . "-off"; ?>"> <?php _e('Current'); ?> </label>
161
-
162
- <input class="widefat" id="<?php echo $this->get_field_id('id') . "-off"; ?>" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][radio]'; ?>" type="radio" value="radio-off" <?php if ( $feature['radio'] == 'radio-off' || $feature['radio'] == ''): ?> checked <?php endif ?> />
163
- </p>
164
- <!-- done -->
165
- <p>
166
- <label for="<?php echo $this->get_field_id('id') . "-size"; ?>"> <?php _e('Select Size:'); ?> </label>
167
- <select id="<?php echo $this->get_field_id('id') . "-size"; ?>" class="widefat" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][size]'; ?>">
168
- <option value="1" <?php selected( $feature['size'], 1 ); ?>>Small</option>
169
- <option value="2" <?php selected( $feature['size'], 2 ); ?>>Medium</option>
170
- <option value="3" <?php selected( $feature['size'], 3 ); ?>>Large</option>
171
- </select>
172
- </p>
173
-
174
- <p> <a class="ampforwp-button-remove delete button left"><?php _e('Remove Feature','accelerated-mobile-pages')?></a> </p>
175
- </div>
176
- </div>
177
- </div>
178
- <?php
179
- $c = $c +1;
180
- }
181
- }
182
- } ?>
183
- </span>
184
-
185
- <a class="ampforwp-button-add button left"> <?php _e('Add Feature','accelerated-mobile-pages'); ?> </a>
186
- <p> </p>
187
- <?php
188
-
189
- } // end form
190
-
191
- /*--------------------------------------------------*/
192
- /* Public Functions
193
- /*--------------------------------------------------*/
194
-
195
- /**
196
- * Fired when the plugin is activated.
197
- *
198
- * @param boolean $network_wide True if WPMU superadmin uses "Network Activate" action, false if WPMU is disabled or plugin is activated on an individual blog.
199
- */
200
- public function activate( $network_wide ) {
201
-
202
- } // end activate
203
-
204
- /**
205
- * Fired when the plugin is deactivated.
206
- *
207
- * @param boolean $network_wide True if WPMU superadmin uses "Network Activate" action, false if WPMU is disabled or plugin is activated on an individual blog
208
- */
209
- public function deactivate( $network_wide ) {
210
-
211
- } // end deactivate
212
-
213
- /**
214
- * Registers and enqueues admin-specific styles.
215
- */
216
- public function register_admin_styles() {
217
-
218
- } // end register_admin_styles
219
-
220
- /**
221
- * Registers and enqueues admin-specific JavaScript.
222
- */
223
- public function register_admin_scripts() {
224
-
225
- wp_enqueue_script( 'ampforwp-builder-script', plugins_url('/modules/js/amp.js' , dirname(__FILE__) ) , array( 'jquery' ), false, true );
226
-
227
- } // end register_admin_scripts
228
-
229
- public function footer_scritps() { ?>
230
- <style>.radio_label{}</style>
231
- <?php }
232
-
233
- /**
234
- * Registers and enqueues widget-specific styles.
235
- */
236
- public function register_widget_styles() {
237
-
238
- } // end register_widget_styles
239
-
240
- /**
241
- * Registers and enqueues widget-specific scripts.
242
- */
243
- public function register_widget_scripts() {
244
-
245
- } // end register_widget_scripts
246
-
247
- } // end class
248
-
249
-
250
- add_action( 'widgets_init', function(){
251
- register_widget( 'AMPFORWP_Button_Widget' );
252
  });
1
+ <?php class AMPFORWP_Button_Widget extends WP_Widget {
2
+
3
+ /*--------------------------------------------------*/
4
+ /* Constructor
5
+ /*--------------------------------------------------*/
6
+
7
+ /**
8
+ * Specifies the classname and description, instantiates the widget,
9
+ * loads localization files, and includes necessary stylesheets and JavaScript.
10
+ */
11
+ public function __construct() {
12
+
13
+ // Hooks fired when the Widget is activated and deactivated
14
+ register_activation_hook( __FILE__, array( $this, 'activate' ) );
15
+ register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) );
16
+
17
+ parent::__construct(
18
+ 'ampforwp-button',
19
+ __( 'AMP Button Module', 'accelerated-mobile-pages' ),
20
+ array(
21
+ 'classname' => 'ampforwp-button',
22
+ 'description' => __( 'Displays Button with text and link options.', 'accelerated-mobile-pages' )
23
+ )
24
+ );
25
+
26
+ add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts' ) );
27
+
28
+ // Add static written Jquery
29
+ add_action( 'admin_footer', array( $this, 'footer_scritps') );
30
+
31
+
32
+ } // end constructor
33
+
34
+ /*--------------------------------------------------*/
35
+ /* Widget API Functions
36
+ /*--------------------------------------------------*/
37
+
38
+ /**
39
+ * Outputs the content of the widget.
40
+ *
41
+ * @param array args The array of form elements
42
+ * @param array instance The current instance of the widget
43
+ */
44
+ public function widget( $args, $instance ) {
45
+ $target = "";
46
+ $output = "";
47
+
48
+ extract( $args, EXTR_SKIP );
49
+
50
+ $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Classes' );
51
+ $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
52
+
53
+ $features = ( ! empty( $instance['features'] ) ) ? $instance['features'] : array();
54
+
55
+
56
+
57
+ echo $before_widget;
58
+ $output .= '<div class="amp-wp-content amp_cb_module amp_cb_btn">';
59
+
60
+ foreach( $features as $feature ) {
61
+
62
+ if ( $feature['radio'] == 'radio-off'){
63
+ $target = "_self";
64
+ } elseif( $feature['radio'] == 'radio-on' ){
65
+ $target = "_blank";
66
+ }
67
+
68
+ if ( $feature['size'] == '1'){
69
+ $size = "s_btn";
70
+ } elseif( $feature['size'] == '2' ){
71
+ $size = "m_btn";
72
+ } elseif( $feature['size'] == '3' ){
73
+ $size = "l_btn";
74
+ }
75
+ //Corrected the URL in button module and breaking of desing and link issue #951 & #972
76
+ $output .= '<a href="'.esc_url($feature['url']).'" class="' . $size . '" target="' . $target . '" >'. $feature['title'] .'</a>';
77
+ }
78
+ $output .= '</div>';
79
+
80
+ $sanitizer = new AMPFORWP_Content( $output, array(),
81
+ apply_filters( 'ampforwp_content_sanitizers',array( 'AMP_Img_Sanitizer' => array(),'AMP_Style_Sanitizer' => array() ) ) );
82
+ $sanitized_output = $sanitizer->get_amp_content();
83
+
84
+ if( $sanitized_output ) {
85
+ echo $sanitized_output;
86
+ }
87
+
88
+ echo $after_widget;
89
+
90
+ } // end widget
91
+
92
+ /**
93
+ * Processes the widget's options to be saved.
94
+ *
95
+ * @param array new_instance The new instance of values to be generated via the update.
96
+ * @param array old_instance The previous instance of values before the update.
97
+ */
98
+ public function update( $new_instance, $old_instance ) {
99
+
100
+ $instance = $old_instance;
101
+
102
+ $instance['title'] = strip_tags($new_instance['title']);
103
+
104
+ foreach($new_instance['features'] as $feature){
105
+ $feature['title'] = strip_tags($feature['title']);
106
+ $feature['description'] = strip_tags($feature['description']);
107
+ $feature['image'] = strip_tags($feature['image']);
108
+ }
109
+ $instance['features'] = $new_instance['features'];
110
+
111
+ return $instance;
112
+
113
+ } // end widget
114
+
115
+ /**
116
+ * Generates the administration form for the widget.
117
+ *
118
+ * @param array instance The array of keys and values for the widget.
119
+ */
120
+ public function form( $instance ) {
121
+
122
+ $instance = wp_parse_args(
123
+ (array) $instance
124
+ );
125
+
126
+ $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; ?>
127
+ <p> </p>
128
+
129
+
130
+ <?php
131
+
132
+ $features = ( ! empty( $instance['features'] ) ) ? $instance['features'] : array(); ?>
133
+ <span class="ampforwp-button-additional"> <?php
134
+ $c = 0; ?>
135
+
136
+ <?php
137
+
138
+ if ( count( $features ) > 0 ) {
139
+ foreach( $features as $feature ) {
140
+ if ( isset( $feature['title'] ) || isset( $feature['description'] ) ) { ?>
141
+ <div class="widget">
142
+ <div class="widget-top"><div class="widget-title"><h3><?php echo $feature['title'];?><span class="in-widget-title"></span></h3></div>
143
+ </div>
144
+
145
+ <div class="widget-inside">
146
+ <div class="widget-content">
147
+ <p>
148
+ <label for="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][title]'; ?>"><?php _e( 'Button Text:' ); ?></label>
149
+ <input class="widefat" id="<?php echo $this->get_field_id( 'features' ) .'-'. $c.'-title'; ?>" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][title]'; ?>" type="text" value="<?php echo $feature['title']; ?>" /> </p>
150
+
151
+ <p><label for="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][url]'; ?>"><?php _e( 'Url:' ); ?></label>
152
+ <input class="widefat" id="<?php echo $this->get_field_id( 'features' ) .'-'. $c.'-url'; ?>" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][url]'; ?>" type="text" value="<?php echo $feature['url']; ?>" />
153
+ </p>
154
+
155
+
156
+ <p><label><?php _e('URL Target:'); ?> </label><br />
157
+ <label class="radio_label" for="<?php echo $this->get_field_id('id') . "-on"; ?>"><?php _e('New Tab'); ?> </label>
158
+ <input class="widefat" id="<?php echo $this->get_field_id('id') . "-on"; ?>" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][radio]'; ?>" type="radio" value="radio-on" <?php if ( $feature['radio'] == 'radio-on'): ?> checked <?php endif ?> />
159
+
160
+ <label class="radio_label" for="<?php echo $this->get_field_id('id') . "-off"; ?>"> <?php _e('Current'); ?> </label>
161
+
162
+ <input class="widefat" id="<?php echo $this->get_field_id('id') . "-off"; ?>" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][radio]'; ?>" type="radio" value="radio-off" <?php if ( $feature['radio'] == 'radio-off' || $feature['radio'] == ''): ?> checked <?php endif ?> />
163
+ </p>
164
+ <!-- done -->
165
+ <p>
166
+ <label for="<?php echo $this->get_field_id('id') . "-size"; ?>"> <?php _e('Select Size:'); ?> </label>
167
+ <select id="<?php echo $this->get_field_id('id') . "-size"; ?>" class="widefat" name="<?php echo $this->get_field_name( 'features' ) . '['.$c.'][size]'; ?>">
168
+ <option value="1" <?php selected( $feature['size'], 1 ); ?>>Small</option>
169
+ <option value="2" <?php selected( $feature['size'], 2 ); ?>>Medium</option>
170
+ <option value="3" <?php selected( $feature['size'], 3 ); ?>>Large</option>
171
+ </select>
172
+ </p>
173
+
174
+ <p> <a class="ampforwp-button-remove delete button left"><?php _e('Remove Feature','accelerated-mobile-pages')?></a> </p>
175
+ </div>
176
+ </div>
177
+ </div>
178
+ <?php
179
+ $c = $c +1;
180
+ }
181
+ }
182
+ } ?>
183
+ </span>
184
+
185
+ <a class="ampforwp-button-add button left"> <?php _e('Add Feature','accelerated-mobile-pages'); ?> </a>
186
+ <p> </p>
187
+ <?php
188
+
189
+ } // end form
190
+
191
+ /*--------------------------------------------------*/
192
+ /* Public Functions
193
+ /*--------------------------------------------------*/
194
+
195
+ /**
196
+ * Fired when the plugin is activated.
197
+ *
198
+ * @param boolean $network_wide True if WPMU superadmin uses "Network Activate" action, false if WPMU is disabled or plugin is activated on an individual blog.
199
+ */
200
+ public function activate( $network_wide ) {
201
+
202
+ } // end activate
203
+
204
+ /**
205
+ * Fired when the plugin is deactivated.
206
+ *
207
+ * @param boolean $network_wide True if WPMU superadmin uses "Network Activate" action, false if WPMU is disabled or plugin is activated on an individual blog
208
+ */
209
+ public function deactivate( $network_wide ) {
210
+
211
+ } // end deactivate
212
+
213
+ /**
214
+ * Registers and enqueues admin-specific styles.
215
+ */
216
+ public function register_admin_styles() {
217
+
218
+ } // end register_admin_styles
219
+
220
+ /**
221
+ * Registers and enqueues admin-specific JavaScript.
222
+ */
223
+ public function register_admin_scripts() {
224
+
225
+ wp_enqueue_script( 'ampforwp-builder-script', plugins_url('/modules/js/amp.js' , dirname(__FILE__) ) , array( 'jquery' ), false, true );
226
+
227
+ } // end register_admin_scripts
228
+
229
+ public function footer_scritps() { ?>
230
+ <style>.radio_label{}</style>
231
+ <?php }
232
+
233
+ /**
234
+ * Registers and enqueues widget-specific styles.
235
+ */
236
+ public function register_widget_styles() {
237
+
238
+ } // end register_widget_styles
239
+
240
+ /**
241
+ * Registers and enqueues widget-specific scripts.
242
+ */
243
+ public function register_widget_scripts() {
244
+
245
+ } // end register_widget_scripts
246
+
247
+ } // end class
248
+
249
+
250
+ add_action( 'widgets_init', function(){
251
+ register_widget( 'AMPFORWP_Button_Widget' );
252
  });
includes/modules/js/amp.js CHANGED
@@ -1,158 +1,158 @@
1
- jQuery(document).ready(function($) {
2
- var count = 0;
3
-
4
- //For Blurb Module
5
- jQuery(".ampforwp-blurb-add").live('click', function(e) {
6
- console.log('click');
7
-
8
- event.preventDefault();
9
- var additional = $(this).parent().parent().find('.ampforwp-blurb-additional');
10
- var container = $(this).parent().parent().parent().parent();
11
- var container_class = container.attr('id');
12
- var container_class_array = container_class.split("ampforwp-blurb-").reverse();
13
- var instance = container_class_array[0];
14
- var add = $(this).parent().parent().find('.ampforwp-blurb-add');
15
- count = additional.find('.widget-top').length;
16
-
17
- additional.append('<div class="widget"><div class="widget-top"><div class="widget-title-action"> </div> <div class="widget-title"><h3> New Module<span class="in-widget-title"></span></h3></div></div><div class="widget-inside"><p><label for="widget-ampforwp-blurb['+instance+'][features]['+count+'][title]">Title</label>'+
18
- '<input class="widefat" id="widget-ampforwp-blurb-'+instance+'-features-'+count+'-title" name="widget-ampforwp-blurb['+instance+'][features]['+count+'][title]" type="text" value="Heart Of The Landing Page" />'+
19
- '<label for="widget-ampforwp-blurb['+instance+'][features]['+count+'][description]">Description</label>'+
20
- '<textarea class="widefat" id="widget-ampforwp-blurb-'+instance+'-features-'+count+'-description" name="widget-ampforwp-blurb['+instance+'][features]['+count+'][description]" rows=\'6\' cols=\'50\'>This is a sample text which is being used for the dummy purpose to avoid confusion.</textarea> <span class="clear"></span></p>' + '<p> <label for=""> Image: </label><input type="button" class="select-img-'+count+' button left" style="width:auto;" value="Select Image" onclick="ampSelectImage('+count+');"/><input type="button" style="display:none" name="removeimg" id="remove-img-'+count+'" class="button button-secondary remove-img-button" data-count-type="'+count+'" value="Remove Image" onclick="removeImage('+count+')"><img src="http://i.imgur.com/5nPXqZG.png" class="preview-image block-image-'+count+'" >' + '<input type="hidden" id="amp-img-field-'+count+'" class="img'+count+'" style="width:auto;" name="widget-ampforwp-blurb['+instance+'][features]['+count+'][image]" id="'+instance+'-features-'+count+'" value="http://i.imgur.com/5nPXqZG.png" /></p>' + ' <p> <a class="ampforwp-blurb-remove delete button left">Remove Feature</a></p></div></div>');
21
- });
22
- jQuery(".ampforwp-blurb-remove").live('click', function() {
23
- jQuery(this).parent().parent().parent().remove();
24
- });
25
-
26
- //For Text Module
27
- jQuery(".ampforwp-text-add").live('click', function(e) {
28
- console.log('click');
29
-
30
- event.preventDefault();
31
- var additional = $(this).parent().parent().find('.ampforwp-text-additional');
32
- var container = $(this).parent().parent().parent().parent();
33
- var container_class = container.attr('id');
34
- var container_class_array = container_class.split("ampforwp-text-").reverse();
35
- var instance = container_class_array[0];
36
- var add = $(this).parent().parent().find('.ampforwp-text-add');
37
- count = additional.find('.widget-top').length;
38
-
39
- additional.append('<div class="widget"><div class="widget-top"><div class="widget-title-action"> </div> <div class="widget-title"><h3> New Module<span class="in-widget-title"></span></h3></div></div><div class="widget-inside"><p><label for="widget-ampforwp-text['+instance+'][features]['+count+'][title]">Title</label>'+
40
- '<input class="widefat" id="widget-ampforwp-text-'+instance+'-features-'+count+'-title" name="widget-ampforwp-text['+instance+'][features]['+count+'][title]" type="text" value="This is the default title" />'+
41
- '<label for="widget-ampforwp-text['+instance+'][features]['+count+'][description]">Description</label>'+
42
- '<textarea class="widefat" id="widget-ampforwp-text-'+instance+'-features-'+count+'-description" name="widget-ampforwp-text['+instance+'][features]['+count+'][description]" rows=\'6\' cols=\'50\'>This is the description added by default </textarea> <span class="clear"></span></p>' + ' <p> <a class="ampforwp-text-remove delete button left">Remove Feature</a></p></div></div>' );
43
- });
44
- jQuery(".ampforwp-text-remove").live('click', function() {
45
- jQuery(this).parent().parent().parent().remove();
46
- });
47
-
48
- //For Button Module
49
- jQuery(".ampforwp-button-add").live('click', function(e) {
50
- console.log('click');
51
-
52
- event.preventDefault();
53
- var additional = $(this).parent().parent().find('.ampforwp-button-additional');
54
- var container = $(this).parent().parent().parent().parent();
55
- var container_class = container.attr('id');
56
- var container_class_array = container_class.split("ampforwp-button-").reverse();
57
- var instance = container_class_array[0];
58
- var add = $(this).parent().parent().find('.ampforwp-button-add');
59
- count = additional.find('.widget-top').length;
60
-
61
- additional.append('<div class="widget"><div class="widget-top"><div class="widget-title-action"> </div> <div class="widget-title"><h3> New Module<span class="in-widget-title"></span></h3></div></div><div class="widget-inside"><p><label for="widget-ampforwp-button['+instance+'][features]['+count+'][title]">Button Text</label>'+
62
-
63
- //Text Fields
64
- '<input class="widefat" id="widget-ampforwp-button-'+instance+'-features-'+count+'-title" name="widget-ampforwp-button['+instance+'][features]['+count+'][title]" type="text" value="Click Here" /></p>'+
65
-
66
- '<p><label for="widget-ampforwp-button['+instance+'][features]['+count+'][url]">Url:</label>'+
67
- '<input class="widefat" id="widget-ampforwp-button-'+instance+'-features-'+count+'-url" name="widget-ampforwp-button['+instance+'][features]['+count+'][url]" type="text" value="#" /></p>' +
68
- // Radio
69
- '<p> <label>URL Target:</label> <br />'+
70
-
71
- '<label for="widget-ampforwp-button['+instance+'][features]['+count+']'+"-on"+'">New Tab </label>'+
72
- '<input class="widefat" id="widget-ampforwp-button['+instance+'][features]['+count+']'+"-on"+'" name="widget-ampforwp-button['+instance+'][features]['+count+']'+'[radio]" type="radio" value="radio-on" />'+
73
- '<label for="widget-ampforwp-button['+instance+'][features]['+count+']'+"-off"+'">Current </label>'+
74
- '<input class="widefat" id="widget-ampforwp-button['+instance+'][features]['+count+']'+"-off"+'" name="widget-ampforwp-button['+instance+'][features]['+count+']'+'[radio]" type="radio" checked value="radio-off" /></p>'+
75
- // Select
76
- '<p> <label for="widget-ampforwp-button['+instance+']'+"-id-size"+'">Select Size:</label>'+
77
- '<select id="widget-ampforwp-button-'+instance+'-id-size" class="widefat" name="widget-ampforwp-button['+instance+'][features]['+count+'][size]"> <option value="1">Small</option> <option value="2">Medium</option> <option value="3">Large</option> </select> </p>'+
78
-
79
- '<p> <a class="ampforwp-button-remove delete button left">Remove Feature</a></p></div></div>' );
80
- });
81
-
82
-
83
- jQuery(".ampforwp-button-remove").live('click', function() {
84
- jQuery(this).parent().parent().parent().remove();
85
- });
86
-
87
- // Tiny Mce code
88
- // $(document).on('widget-updated', function(event, widget){
89
- // var widget_id = $(widget).attr('id');
90
- // $('#'+widget_id + ' .switch-tmce').hide();
91
- // });
92
-
93
- remove_button = jQuery('.remove-img-button');
94
-
95
- remove_button.on('click', function(e) {
96
-
97
- id = jQuery(this).attr('data-count-type')
98
-
99
- imageToRemove = jQuery('.block-image-'+ id);
100
-
101
- imageToRemove.attr('src','');
102
-
103
- // remove_image_button_activation( id );
104
-
105
- });
106
-
107
-
108
- function remove_image_button_activation( id ) {
109
-
110
- var currentImage = jQuery('.block-image-'+id).attr('src');
111
-
112
-
113
- console.log(id );
114
-
115
- if ( currentImage == undefined ) {
116
- jQuery('#remove-img-'+id).hide();
117
- } else {
118
- jQuery('#remove-img-'+id).show();
119
- }
120
- }
121
-
122
-
123
-
124
-
125
- });
126
-
127
- var image_field1, image_field2, image_field3;
128
-
129
- function ampSelectImage(count){
130
-
131
- image_field1 = jQuery('#amp-img-field-'+count);
132
- image_field2 = jQuery('.block-image-'+count);
133
- image_field3 = jQuery('#remove-img-'+count);
134
-
135
-
136
- imageSource = image_field2.attr('src');
137
-
138
- if ( imageSource ) {
139
- image_field3.show();
140
- }
141
-
142
- tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
143
- window.send_to_editor = function(html) {
144
-
145
-
146
- if(image_field1 != undefined){
147
- imgurl = jQuery("<div>" + html + "</div>").find('img').attr('src');
148
-
149
-
150
- image_field1.val(imgurl);
151
- image_field2.attr('src',imgurl);
152
- image_field2.show();
153
- image_field3.show();
154
- tb_remove();
155
- }
156
- }
157
- return false;
158
- }
1
+ jQuery(document).ready(function($) {
2
+ var count = 0;
3
+
4
+ //For Blurb Module
5
+ jQuery(".ampforwp-blurb-add").live('click', function(e) {
6
+ console.log('click');
7
+
8
+ event.preventDefault();
9
+ var additional = $(this).parent().parent().find('.ampforwp-blurb-additional');
10
+ var container = $(this).parent().parent().parent().parent();
11
+ var container_class = container.attr('id');
12
+ var container_class_array = container_class.split("ampforwp-blurb-").reverse();
13
+ var instance = container_class_array[0];
14
+ var add = $(this).parent().parent().find('.ampforwp-blurb-add');
15
+ count = additional.find('.widget-top').length;
16
+
17
+ additional.append('<div class="widget"><div class="widget-top"><div class="widget-title-action"> </div> <div class="widget-title"><h3> New Module<span class="in-widget-title"></span></h3></div></div><div class="widget-inside"><p><label for="widget-ampforwp-blurb['+instance+'][features]['+count+'][title]">Title</label>'+
18
+ '<input class="widefat" id="widget-ampforwp-blurb-'+instance+'-features-'+count+'-title" name="widget-ampforwp-blurb['+instance+'][features]['+count+'][title]" type="text" value="Heart Of The Landing Page" />'+
19
+ '<label for="widget-ampforwp-blurb['+instance+'][features]['+count+'][description]">Description</label>'+
20
+ '<textarea class="widefat" id="widget-ampforwp-blurb-'+instance+'-features-'+count+'-description" name="widget-ampforwp-blurb['+instance+'][features]['+count+'][description]" rows=\'6\' cols=\'50\'>This is a sample text which is being used for the dummy purpose to avoid confusion.</textarea> <span class="clear"></span></p>' + '<p> <label for=""> Image: </label><input type="button" class="select-img-'+count+' button left" style="width:auto;" value="Select Image" onclick="ampSelectImage('+count+');"/><input type="button" style="display:none" name="removeimg" id="remove-img-'+count+'" class="button button-secondary remove-img-button" data-count-type="'+count+'" value="Remove Image" onclick="removeImage('+count+')"><img src="http://i.imgur.com/5nPXqZG.png" class="preview-image block-image-'+count+'" >' + '<input type="hidden" id="amp-img-field-'+count+'" class="img'+count+'" style="width:auto;" name="widget-ampforwp-blurb['+instance+'][features]['+count+'][image]" id="'+instance+'-features-'+count+'" value="http://i.imgur.com/5nPXqZG.png" /></p>' + ' <p> <a class="ampforwp-blurb-remove delete button left">Remove Feature</a></p></div></div>');
21
+ });
22
+ jQuery(".ampforwp-blurb-remove").live('click', function() {
23
+ jQuery(this).parent().parent().parent().remove();
24
+ });
25
+
26
+ //For Text Module
27
+ jQuery(".ampforwp-text-add").live('click', function(e) {
28
+ console.log('click');
29
+
30
+ event.preventDefault();
31
+ var additional = $(this).parent().parent().find('.ampforwp-text-additional');
32
+ var container = $(this).parent().parent().parent().parent();
33
+ var container_class = container.attr('id');
34
+ var container_class_array = container_class.split("ampforwp-text-").reverse();
35
+ var instance = container_class_array[0];
36
+ var add = $(this).parent().parent().find('.ampforwp-text-add');
37
+ count = additional.find('.widget-top').length;
38
+
39
+ additional.append('<div class="widget"><div class="widget-top"><div class="widget-title-action"> </div> <div class="widget-title"><h3> New Module<span class="in-widget-title"></span></h3></div></div><div class="widget-inside"><p><label for="widget-ampforwp-text['+instance+'][features]['+count+'][title]">Title</label>'+
40
+ '<input class="widefat" id="widget-ampforwp-text-'+instance+'-features-'+count+'-title" name="widget-ampforwp-text['+instance+'][features]['+count+'][title]" type="text" value="This is the default title" />'+
41
+ '<label for="widget-ampforwp-text['+instance+'][features]['+count+'][description]">Description</label>'+
42
+ '<textarea class="widefat" id="widget-ampforwp-text-'+instance+'-features-'+count+'-description" name="widget-ampforwp-text['+instance+'][features]['+count+'][description]" rows=\'6\' cols=\'50\'>This is the description added by default </textarea> <span class="clear"></span></p>' + ' <p> <a class="ampforwp-text-remove delete button left">Remove Feature</a></p></div></div>' );
43
+ });
44
+ jQuery(".ampforwp-text-remove").live('click', function() {
45
+ jQuery(this).parent().parent().parent().remove();
46
+ });
47
+
48
+ //For Button Module
49
+ jQuery(".ampforwp-button-add").live('click', function(e) {
50
+ console.log('click');
51
+
52
+ event.preventDefault();
53
+ var additional = $(this).parent().parent().find('.ampforwp-button-additional');
54
+ var container = $(this).parent().parent().parent().parent();
55
+ var container_class = container.attr('id');
56
+ var container_class_array = container_class.split("ampforwp-button-").reverse();
57
+ var instance = container_class_array[0];
58
+ var add = $(this).parent().parent().find('.ampforwp-button-add');
59
+ count = additional.find('.widget-top').length;
60
+
61
+ additional.append('<div class="widget"><div class="widget-top"><div class="widget-title-action"> </div> <div class="widget-title"><h3> New Module<span class="in-widget-title"></span></h3></div></div><div class="widget-inside"><p><label for="widget-ampforwp-button['+instance+'][features]['+count+'][title]">Button Text</label>'+
62
+
63
+ //Text Fields
64
+ '<input class="widefat" id="widget-ampforwp-button-'+instance+'-features-'+count+'-title" name="widget-ampforwp-button['+instance+'][features]['+count+'][title]" type="text" value="Click Here" /></p>'+
65
+
66
+ '<p><label for="widget-ampforwp-button['+instance+'][features]['+count+'][url]">Url:</label>'+
67
+ '<input class="widefat" id="widget-ampforwp-button-'+instance+'-features-'+count+'-url" name="widget-ampforwp-button['+instance+'][features]['+count+'][url]" type="text" value="#" /></p>' +
68
+ // Radio
69
+ '<p> <label>URL Target:</label> <br />'+
70
+
71
+ '<label for="widget-ampforwp-button['+instance+'][features]['+count+']'+"-on"+'">New Tab </label>'+
72
+ '<input class="widefat" id="widget-ampforwp-button['+instance+'][features]['+count+']'+"-on"+'" name="widget-ampforwp-button['+instance+'][features]['+count+']'+'[radio]" type="radio" value="radio-on" />'+
73
+ '<label for="widget-ampforwp-button['+instance+'][features]['+count+']'+"-off"+'">Current </label>'+
74
+ '<input class="widefat" id="widget-ampforwp-button['+instance+'][features]['+count+']'+"-off"+'" name="widget-ampforwp-button['+instance+'][features]['+count+']'+'[radio]" type="radio" checked value="radio-off" /></p>'+
75
+ // Select
76
+ '<p> <label for="widget-ampforwp-button['+instance+']'+"-id-size"+'">Select Size:</label>'+
77
+ '<select id="widget-ampforwp-button-'+instance+'-id-size" class="widefat" name="widget-ampforwp-button['+instance+'][features]['+count+'][size]"> <option value="1">Small</option> <option value="2">Medium</option> <option value="3">Large</option> </select> </p>'+
78
+
79
+ '<p> <a class="ampforwp-button-remove delete button left">Remove Feature</a></p></div></div>' );
80
+ });
81
+
82
+
83
+ jQuery(".ampforwp-button-remove").live('click', function() {
84
+ jQuery(this).parent().parent().parent().remove();
85
+ });
86
+
87
+ // Tiny Mce code
88
+ // $(document).on('widget-updated', function(event, widget){
89
+ // var widget_id = $(widget).attr('id');
90
+ // $('#'+widget_id + ' .switch-tmce').hide();
91
+ // });
92
+
93
+ remove_button = jQuery('.remove-img-button');
94
+
95
+ remove_button.on('click', function(e) {
96
+
97
+ id = jQuery(this).attr('data-count-type')
98
+
99
+ imageToRemove = jQuery('.block-image-'+ id);
100
+
101
+ imageToRemove.attr('src','');
102
+
103
+ // remove_image_button_activation( id );
104
+
105
+ });
106
+
107
+
108
+ function remove_image_button_activation( id ) {
109
+
110
+ var currentImage = jQuery('.block-image-'+id).attr('src');
111
+
112
+
113
+ console.log(id );
114
+
115
+ if ( currentImage == undefined ) {
116
+ jQuery('#remove-img-'+id).hide();
117
+ } else {
118
+ jQuery('#remove-img-'+id).show();
119
+ }
120
+ }
121
+
122
+
123
+
124
+
125
+ });
126
+
127
+ var image_field1, image_field2, image_field3;
128
+
129
+ function ampSelectImage(count){
130
+
131
+ image_field1 = jQuery('#amp-img-field-'+count);
132
+ image_field2 = jQuery('.block-image-'+count);
133
+ image_field3 = jQuery('#remove-img-'+count);
134
+
135
+
136
+ imageSource = image_field2.attr('src');
137
+
138
+ if ( imageSource ) {
139
+ image_field3.show();
140
+ }
141
+
142
+ tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
143
+ window.send_to_editor = function(html) {
144
+
145
+
146
+ if(image_field1 != undefined){
147
+ imgurl = jQuery("<div>" + html + "</div>").find('img').attr('src');
148
+
149
+
150
+ image_field1.val(imgurl);
151
+ image_field2.attr('src',imgurl);
152
+ image_field2.show();
153
+ image_field3.show();
154
+ tb_remove();
155
+ }
156
+ }
157
+ return false;
158
+ }
includes/newsletter.php CHANGED
@@ -1,132 +1,132 @@
1
- <?php class ampforwp_pointers {
2
- const DISPLAY_VERSION = 'v1.0';
3
- function __construct () {
4
- add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
5
- }
6
- function admin_enqueue_scripts () {
7
- $dismissed = explode (',', get_user_meta (wp_get_current_user ()->ID, 'dismissed_wp_pointers', true));
8
- $do_tour = !in_array ('ampforwp_subscribe_pointer', $dismissed);
9
- if ($do_tour) {
10
- wp_enqueue_style ('wp-pointer');
11
- wp_enqueue_script ('wp-pointer');
12
-
13
- add_action('admin_print_footer_scripts', array($this, 'admin_print_footer_scripts'));
14
- add_action('admin_head', array($this, 'admin_head')); // Hook to admin head
15
- }
16
- }
17
- function admin_head () {
18
- ?>
19
- <style type="text/css" media="screen"> #pointer-primary { margin: 0 5px 0 0; } </style>
20
- <?php }
21
- function admin_print_footer_scripts () {
22
- global $pagenow;
23
- global $current_user;
24
- $tour = array ();
25
- $tab = isset($_GET['tab']) ? $_GET['tab'] : '';
26
- $function = '';
27
- $button2 = '';
28
- $options = array ();
29
- $show_pointer = false;
30
-
31
- if (!array_key_exists($tab, $tour)) {
32
-
33
- $show_pointer = true;
34
- $file_error = true;
35
-
36
- $id = '#toplevel_page_amp_options'; // Define ID used on page html element where we want to display pointer
37
- $content = '<h3>' . sprintf (__('You are awesome for using AMP!', 'accelerated-mobile-pages'), self::DISPLAY_VERSION) . '</h3>';
38
- $content .= __('<p>Do you want the latest on <b>AMP update</b> before others and some best resources on AMP in a single email? - Free just for users of AMP!</p>', 'accelerated-mobile-pages');
39
- $content .= __('
40
- <!-- Begin MailChimp Signup Form -->
41
- <style type="text/css">
42
- .wp-pointer-buttons{ padding:0; overflow: hidden; }
43
- .wp-pointer-content .button-secondary{ left: -25px;background: transparent;top: 5px; border: 0;position: relative; padding: 0; box-shadow: none;margin: 0;color: #0085ba;} .wp-pointer-content .button-primary{ display:none} #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
44
- </style>
45
- <div id="mc_embed_signup">
46
- <form action="//app.mailerlite.com/webforms/submit/d3w0e1" data-id="258182" data-code="d3w0e1" method="POST" target="_blank">
47
- <div id="mc_embed_signup_scroll">
48
- <div class="mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">
49
- <input type="text" name="fields[name]" class="form-control" placeholder="Name" hidden value="' . esc_attr( $current_user->display_name ) . '" style="display:none">
50
-
51
- <input type="text" value="' . esc_attr( $current_user->user_email ) . '" name="fields[email]" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">
52
-
53
- <input type="text" name="fields[company]" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="' . esc_attr( get_home_url() ) . '">
54
-
55
- <input type="hidden" name="ml-submit" value="1" />
56
- </div>
57
- <div id="mce-responses">
58
- <div class="response" id="mce-error-response" style="display:none"></div>
59
- <div class="response" id="mce-success-response" style="display:none"></div>
60
- </div>
61
- <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
62
- <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>
63
- <input type="submit" value="Subscribe" name="subscribe" id="pointer-close" class="button mc-newsletter-sent" style=" background: #0085ba; border-color: #006799; padding: 0px 16px; text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799; height: 30px; margin-top: 1px; color: #fff; box-shadow: 0 1px 0 #006799;">
64
- </div>
65
- </form>
66
- </div>','accelerated-mobile-pages');
67
- $options = array (
68
- 'content' => $content,
69
- 'position' => array ('edge' => 'left', 'align' => 'left')
70
- );
71
- }
72
- if ($show_pointer) {
73
- $this->ampforwp_pointer_script ($id, $options, __('No Thanks', 'accelerated-mobile-pages'), $button2, $function);
74
- }
75
- }
76
- function get_admin_url($page, $tab) {
77
- $url = admin_url();
78
- $url .= $page.'?tab='.$tab;
79
- return $url;
80
- }
81
- function ampforwp_pointer_script ($id, $options, $button1, $button2=false, $function='') {
82
- ?>
83
- <script type="text/javascript">
84
- (function ($) {
85
- var wp_pointers_tour_opts = <?php echo json_encode ($options); ?>, setup;
86
- wp_pointers_tour_opts = $.extend (wp_pointers_tour_opts, {
87
- buttons: function (event, t) {
88
- button= jQuery ('<a id="pointer-close" class="button-secondary">' + '<?php echo $button1; ?>' + '</a>');
89
- button_2= jQuery ('#pointer-close.button');
90
- button.bind ('click.pointer', function () {
91
- t.element.pointer ('close');
92
- });
93
- button_2.on('click', function() {
94
- t.element.pointer ('close');
95
- } );
96
- return button;
97
- },
98
- close: function () {
99
- $.post (ajaxurl, {
100
- pointer: 'ampforwp_subscribe_pointer',
101
- action: 'dismiss-wp-pointer'
102
- });
103
- }
104
- });
105
- setup = function () {
106
- $('<?php echo $id; ?>').pointer(wp_pointers_tour_opts).pointer('open');
107
- <?php if ($button2) { ?>
108
- jQuery ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + '<?php echo $button2; ?>' + '</a>');
109
- jQuery ('#pointer-primary').click (function () {
110
- <?php echo $function; ?>
111
- });
112
- jQuery ('#pointer-close').click (function () {
113
- $.post (ajaxurl, {
114
- pointer: 'ampforwp_subscribe_pointer',
115
- action: 'dismiss-wp-pointer'
116
- });
117
- })
118
- <?php } ?>
119
- };
120
- if (wp_pointers_tour_opts.position && wp_pointers_tour_opts.position.defer_loading) {
121
- $(window).bind('load.wp-pointers', setup);
122
- }
123
- else {
124
- setup ();
125
- }
126
- }) (jQuery);
127
- </script>
128
- <?php
129
- }
130
- }
131
- $ampforwp_pointers = new ampforwp_pointers();
132
  ?>
1
+ <?php class ampforwp_pointers {
2
+ const DISPLAY_VERSION = 'v1.0';
3
+ function __construct () {
4
+ add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
5
+ }
6
+ function admin_enqueue_scripts () {
7
+ $dismissed = explode (',', get_user_meta (wp_get_current_user ()->ID, 'dismissed_wp_pointers', true));
8
+ $do_tour = !in_array ('ampforwp_subscribe_pointer', $dismissed);
9
+ if ($do_tour) {
10
+ wp_enqueue_style ('wp-pointer');
11
+ wp_enqueue_script ('wp-pointer');
12
+
13
+ add_action('admin_print_footer_scripts', array($this, 'admin_print_footer_scripts'));
14
+ add_action('admin_head', array($this, 'admin_head')); // Hook to admin head
15
+ }
16
+ }
17
+ function admin_head () {
18
+ ?>
19
+ <style type="text/css" media="screen"> #pointer-primary { margin: 0 5px 0 0; } </style>
20
+ <?php }
21
+ function admin_print_footer_scripts () {
22
+ global $pagenow;
23
+ global $current_user;
24
+ $tour = array ();
25
+ $tab = isset($_GET['tab']) ? $_GET['tab'] : '';
26
+ $function = '';
27
+ $button2 = '';
28
+ $options = array ();
29
+ $show_pointer = false;
30
+
31
+ if (!array_key_exists($tab, $tour)) {
32
+
33
+ $show_pointer = true;
34
+ $file_error = true;
35
+
36
+ $id = '#toplevel_page_amp_options'; // Define ID used on page html element where we want to display pointer
37
+ $content = '<h3>' . sprintf (__('You are awesome for using AMP!', 'accelerated-mobile-pages'), self::DISPLAY_VERSION) . '</h3>';
38
+ $content .= __('<p>Do you want the latest on <b>AMP update</b> before others and some best resources on AMP in a single email? - Free just for users of AMP!</p>', 'accelerated-mobile-pages');
39
+ $content .= __('
40
+ <!-- Begin MailChimp Signup Form -->
41
+ <style type="text/css">
42
+ .wp-pointer-buttons{ padding:0; overflow: hidden; }
43
+ .wp-pointer-content .button-secondary{ left: -25px;background: transparent;top: 5px; border: 0;position: relative; padding: 0; box-shadow: none;margin: 0;color: #0085ba;} .wp-pointer-content .button-primary{ display:none} #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
44
+ </style>
45
+ <div id="mc_embed_signup">
46
+ <form action="//app.mailerlite.com/webforms/submit/d3w0e1" data-id="258182" data-code="d3w0e1" method="POST" target="_blank">
47
+ <div id="mc_embed_signup_scroll">
48
+ <div class="mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">
49
+ <input type="text" name="fields[name]" class="form-control" placeholder="Name" hidden value="' . esc_attr( $current_user->display_name ) . '" style="display:none">
50
+
51
+ <input type="text" value="' . esc_attr( $current_user->user_email ) . '" name="fields[email]" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">
52
+
53
+ <input type="text" name="fields[company]" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="' . esc_attr( get_home_url() ) . '">
54
+
55
+ <input type="hidden" name="ml-submit" value="1" />
56
+ </div>
57
+ <div id="mce-responses">
58
+ <div class="response" id="mce-error-response" style="display:none"></div>
59
+ <div class="response" id="mce-success-response" style="display:none"></div>
60
+ </div>
61
+ <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
62
+ <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>
63
+ <input type="submit" value="Subscribe" name="subscribe" id="pointer-close" class="button mc-newsletter-sent" style=" background: #0085ba; border-color: #006799; padding: 0px 16px; text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799; height: 30px; margin-top: 1px; color: #fff; box-shadow: 0 1px 0 #006799;">
64
+ </div>
65
+ </form>
66
+ </div>','accelerated-mobile-pages');
67
+ $options = array (
68
+ 'content' => $content,
69
+ 'position' => array ('edge' => 'left', 'align' => 'left')
70
+ );
71
+ }
72
+ if ($show_pointer) {
73
+ $this->ampforwp_pointer_script ($id, $options, __('No Thanks', 'accelerated-mobile-pages'), $button2, $function);
74
+ }
75
+ }
76
+ function get_admin_url($page, $tab) {
77
+ $url = admin_url();
78
+ $url .= $page.'?tab='.$tab;
79
+ return $url;
80
+ }
81
+ function ampforwp_pointer_script ($id, $options, $button1, $button2=false, $function='') {
82
+ ?>
83
+ <script type="text/javascript">
84
+ (function ($) {
85
+ var wp_pointers_tour_opts = <?php echo json_encode ($options); ?>, setup;
86
+ wp_pointers_tour_opts = $.extend (wp_pointers_tour_opts, {
87
+ buttons: function (event, t) {
88
+ button= jQuery ('<a id="pointer-close" class="button-secondary">' + '<?php echo $button1; ?>' + '</a>');
89
+ button_2= jQuery ('#pointer-close.button');
90
+ button.bind ('click.pointer', function () {
91
+ t.element.pointer ('close');
92
+ });
93
+ button_2.on('click', function() {
94
+ t.element.pointer ('close');
95
+ } );
96
+ return button;
97
+ },
98
+ close: function () {
99
+ $.post (ajaxurl, {
100
+ pointer: 'ampforwp_subscribe_pointer',
101
+ action: 'dismiss-wp-pointer'
102
+ });
103
+ }
104
+ });
105
+ setup = function () {
106
+ $('<?php echo $id; ?>').pointer(wp_pointers_tour_opts).pointer('open');
107
+ <?php if ($button2) { ?>
108
+ jQuery ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + '<?php echo $button2; ?>' + '</a>');
109
+ jQuery ('#pointer-primary').click (function () {
110
+ <?php echo $function; ?>
111
+ });
112
+ jQuery ('#pointer-close').click (function () {
113
+ $.post (ajaxurl, {
114
+ pointer: 'ampforwp_subscribe_pointer',
115
+ action: 'dismiss-wp-pointer'
116
+ });
117
+ })
118
+ <?php } ?>
119
+ };
120
+ if (wp_pointers_tour_opts.position && wp_pointers_tour_opts.position.defer_loading) {
121
+ $(window).bind('load.wp-pointers', setup);
122
+ }
123
+ else {
124
+ setup ();
125
+ }
126
+ }) (jQuery);
127
+ </script>
128
+ <?php
129
+ }
130
+ }
131
+ $ampforwp_pointers = new ampforwp_pointers();
132
  ?>
includes/onesignal-integration/OneSignalSDKWorker.js DELETED
@@ -1,2 +0,0 @@
1
- !function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=55)}([function(e,t,n){"use strict";function i(e,t){function n(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function r(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&(n[i[r]]=e[i[r]]);return n}function o(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function s(e,t){return function(n,i){t(n,i,e)}}function a(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})}function c(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,o&&(s=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(s=s.call(o,n[1])).done)return s;switch(o=0,s&&(n=[0,s.value]),n[0]){case 0:case 1:s=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,o=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(s=u.trys,!(s=s.length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){u.label=n[1];break}if(6===n[0]&&u.label<s[1]){u.label=s[1],s=n;break}if(s&&u.label<s[2]){u.label=s[2],u.ops.push(n);break}s[2]&&u.ops.pop(),u.trys.pop();continue}n=t.call(e,u)}catch(e){n=[6,e],o=0}finally{r=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,s,a,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a}function l(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function d(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),s=[];try{for(;(void 0===t||t-->0)&&!(i=o.next()).done;)s.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}function p(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(f(arguments[t]));return e}function g(e){return this instanceof g?(this.v=e,this):new g(e)}function h(e,t,n){function i(e){l[e]&&(c[e]=function(t){return new Promise(function(n,i){d.push([e,t,n,i])>1||r(e,t)})})}function r(e,t){try{o(l[e](t))}catch(e){u(d[0][3],e)}}function o(e){e.value instanceof g?Promise.resolve(e.value.v).then(s,a):u(d[0][2],e)}function s(e){r("next",e)}function a(e){r("throw",e)}function u(e,t){e(t),d.shift(),d.length&&r(d[0][0],d[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c,l=n.apply(e,t||[]),d=[];return c={},i("next"),i("throw"),i("return"),c[Symbol.asyncIterator]=function(){return this},c}function v(e){function t(t,r){e[t]&&(n[t]=function(n){return(i=!i)?{value:g(e[t](n)),done:"return"===t}:r?r(n):n})}var n,i;return n={},t("next"),t("throw",function(e){throw e}),t("return"),n[Symbol.iterator]=function(){return this},n}function m(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator];return t?t.call(e):"function"==typeof d?d(e):e[Symbol.iterator]()}Object.defineProperty(t,"__esModule",{value:!0}),t.__extends=i,n.d(t,"__assign",function(){return S}),t.__rest=r,t.__decorate=o,t.__param=s,t.__metadata=a,t.__awaiter=u,t.__generator=c,t.__exportStar=l,t.__values=d,t.__read=f,t.__spread=p,t.__await=g,t.__asyncGenerator=h,t.__asyncDelegator=v,t.__asyncValues=m;var b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},S=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}},function(e,t,n){var i,r;!function(o,s){"use strict";i=s,void 0!==(r="function"==typeof i?i.call(t,n,t,e):i)&&(e.exports=r)}(0,function(){"use strict";function e(e){return typeof console!==a&&(void 0!==console[e]?t(console,e):void 0!==console.log?t(console,"log"):s)}function t(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function n(e,t,n){return function(){typeof console!==a&&(i.call(this,t,n),this[e].apply(this,arguments))}}function i(e,t){for(var n=0;n<u.length;n++){var i=u[n];this[i]=n<e?s:this.methodFactory(i,e,t)}}function r(t,i,r){return e(t)||n.apply(this,arguments)}function o(e,t,n){function o(e){var t=(u[e]||"silent").toUpperCase();try{return void(window.localStorage[d]=t)}catch(e){}try{window.document.cookie=encodeURIComponent(d)+"="+t+";"}catch(e){}}function s(){var e;try{e=window.localStorage[d]}catch(e){}if(typeof e===a)try{var t=window.document.cookie,n=t.indexOf(encodeURIComponent(d)+"=");n&&(e=/^([^;]+)/.exec(t.slice(n))[1])}catch(e){}return void 0===l.levels[e]&&(e=void 0),e}var c,l=this,d="loglevel";e&&(d+=":"+e),l.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},l.methodFactory=n||r,l.getLevel=function(){return c},l.setLevel=function(t,n){if("string"==typeof t&&void 0!==l.levels[t.toUpperCase()]&&(t=l.levels[t.toUpperCase()]),!("number"==typeof t&&t>=0&&t<=l.levels.SILENT))throw"log.setLevel() called with invalid level: "+t;if(c=t,!1!==n&&o(t),i.call(l,t,e),typeof console===a&&t<l.levels.SILENT)return"No console available for logging"},l.setDefaultLevel=function(e){s()||l.setLevel(e,!1)},l.enableAll=function(e){l.setLevel(l.levels.TRACE,e)},l.disableAll=function(e){l.setLevel(l.levels.SILENT,e)};var f=s();null==f&&(f=null==t?"WARN":t),l.setLevel(f,!1)}var s=function(){},a="undefined",u=["trace","debug","info","warn","error"],c=new o,l={};c.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=l[e];return t||(t=l[e]=new o(e,c.getLevel(),c.methodFactory)),t};var d=typeof window!==a?window.log:void 0;return c.noConflict=function(){return typeof window!==a&&window.log===c&&(window.log=d),c},c})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),r=n(36),o=n(4),s=n(18),a=function(){function e(){}return e.getBuildEnv=function(){return i.BuildEnvironmentKind.Production},e.getWindowEnv=function(){return"undefined"==typeof window?"undefined"!=typeof self&&void 0!==self.registration?o.WindowEnvironmentKind.ServiceWorker:o.WindowEnvironmentKind.Unknown:window===window.top?-1!==location.href.indexOf("initOneSignal")||"/subscribe"===location.pathname&&""===location.search&&(location.hostname.endsWith(".onesignal.com")||location.hostname.endsWith(".os.tc")||-1!==location.hostname.indexOf(".localhost")&&e.getBuildEnv()===i.BuildEnvironmentKind.Development)?o.WindowEnvironmentKind.OneSignalSubscriptionPopup:o.WindowEnvironmentKind.Host:"/webPushIframe"===location.pathname?o.WindowEnvironmentKind.OneSignalProxyFrame:"/webPushModal"===location.pathname?o.WindowEnvironmentKind.OneSignalSubscriptionModal:o.WindowEnvironmentKind.CustomIframe},e.getTestEnv=function(){return r.TestEnvironmentKind.None},e.getBuildEnvPrefix=function(t){switch(void 0===t&&(t=e.getBuildEnv()),t){case i.BuildEnvironmentKind.Development:return"Dev-";case i.BuildEnvironmentKind.Staging:return"Staging-";case i.BuildEnvironmentKind.Production:return"";default:throw new s.InvalidArgumentError("buildEnv",s.InvalidArgumentReason.EnumOutOfRange)}},e.getOneSignalApiUrl=function(t){switch(void 0===t&&(t=e.getBuildEnv()),t){case i.BuildEnvironmentKind.Development:return new URL("https://localhost:3001/api/v1");case i.BuildEnvironmentKind.Staging:return new URL("https://onesignal-staging.pw/api/v1");case i.BuildEnvironmentKind.Production:return new URL("https://onesignal.com/api/v1");default:throw new s.InvalidArgumentError("buildEnv",s.InvalidArgumentReason.EnumOutOfRange)}},e}();t.default=a},function(e,t,n){"use strict";function i(e){return"[object Array]"===Object.prototype.toString.call(e)}function r(e){return G.default.isBrowser()&&(Z||(Z=document.createElement("textarea"))),Z?(Z.innerHTML=e,Z.value):e}function o(){if(""===V.name&&""===V.version)var e=V._detect(navigator.userAgent);else var e=V;return e}function s(){if(void 0===window.Promise)return!1;var e=o(),t=navigator.userAgent||"";return!(!e.safari&&void 0===navigator.serviceWorker)&&(!(e.ios||e.ipod||e.iphone||e.ipad)&&(!e.msedge&&!e.msie&&(!(t.indexOf("FBAN")>-1||t.indexOf("FBAV")>-1)&&(!navigator.appVersion.match(/ wv/)&&(!(e.firefox&&Number(e.version)<48&&(e.mobile||e.tablet))&&(!!(e.firefox&&Number(e.version)>=44)||(!!(e.safari&&Number(e.version)>=7.1)||(!!(e.samsungBrowser&&Number(e.version)>=4)||(!!((e.chrome||e.chromium)&&Number(e.version)>=42)||(!!(e.yandexbrowser&&Number(e.version)>=15.12)||(!!(e.opera&&(e.mobile||e.tablet)&&Number(e.version)>=37||e.opera&&Number(e.version)>=42)||!!e.vivaldi)))))))))))}function a(){return V.chrome||V.chromium||V.opera||V.yandex}function u(e){var t=document.querySelectorAll(e);if(t.length>0)for(var n=0;n<t.length;n++)t[n].parentNode.removeChild(t[n])}function c(){return new Promise(function(e){OneSignal.initialized?e():OneSignal.once(OneSignal.EVENTS.SDK_INITIALIZED,e)})}function l(e){return JSON.stringify(e,function(e,t){return"function"==typeof t?"[Function]":t},4)}function d(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(e)return e.apply(null,t)}function f(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return K.debug("Called %c"+e+"("+t.map(l).join(", ")+")",w("code"),".")}function p(e){return!!e&&!!e.match(/(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/)}function g(e,t,n){if("string"==typeof e)document.querySelector(e).insertAdjacentHTML(t,n);else{if("object"!=typeof e)throw new Error(e+" must be a CSS selector string or DOM Element object.");e.insertAdjacentHTML(t,n)}}function h(e){if("string"==typeof e)for(var t=document.querySelector(e);t.firstChild;)t.removeChild(t.firstChild);else{if("object"!=typeof e)throw new Error(e+" must be a CSS selector string or DOM Element object.");for(;e.firstChild;)e.removeChild(e.firstChild)}}function v(e,t){if("string"==typeof e)document.querySelector(e).classList.add(t);else{if("object"!=typeof e)throw new Error(e+" must be a CSS selector string or DOM Element object.");e.classList.add(t)}}function m(e,t){if("string"==typeof e)document.querySelector(e).classList.remove(t);else{if("object"!=typeof e)throw new Error(e+" must be a CSS selector string or DOM Element object.");e.classList.remove(t)}}function b(e,t){if("string"==typeof e)return document.querySelector(e).classList.contains(t);if("object"==typeof e)return e.classList.contains(t);throw new Error(e+" must be a CSS selector string or DOM Element object.")}function S(){return V.chrome||V.yandexbrowser||V.opera||V.vivaldi||V.samsungBrowser||V.chromium?Q.CHROME:V.firefox?Q.FIREFOX:V.safari?Q.SAFARI:(K.error("OneSignal: Unable to associate device type for browser "+V.name+" "+V.version),Q.UNKNOWN)}function w(e){return"code"==e?'padding: 0 1px 1px 5px;border: 1px solid #ddd;border-radius: 3px;font-family: Monaco,"DejaVu Sans Mono","Courier New",monospace;color: #444;':"bold"==e?"font-weight: 600;color: rgb(51, 51, 51);":"alert"==e?"font-weight: 600;color: red;":"event"==e?"color: green;":"postmessage"==e?"color: orange;":"serviceworkermessage"==e?"color: purple;":""}function _(e){return new Promise(function(t){setTimeout(t,e)})}function y(){return Promise.resolve()}function O(e,t){var n=new Promise(function(e,n){setTimeout(function(){n(new z.default)},t)});return Promise.race([e,n])}function E(e,t,n){return void 0===t&&(t=y()),void 0===n&&(n=y()),e?t:n}function P(e,t){return!!e&&-1!==e.indexOf(t)}function I(e){for(var t in e)e.hasOwnProperty(t)&&void 0===e[t]&&delete e[t];return e}function C(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(e)}function N(e){var t=window.location.href;t=t.toLowerCase(),e=e.replace(/[\[\]]/g,"\\$&").toLowerCase();var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)"),i=n.exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}function T(){return K.warn("OneSignal: Wiping IndexedDB data."),Promise.all([X.default.remove("Ids"),X.default.remove("NotificationOpened"),X.default.remove("Options")])}function A(e){return e.charAt(0).toUpperCase()+e.slice(1)}function M(){return K.warn("OneSignal: Unsubscribing from push."),Y.default.getWindowEnv()!==J.WindowEnvironmentKind.ServiceWorker?self.registration.pushManager.getSubscription().then(function(e){if(e)return e.unsubscribe();throw new Error("Cannot unsubscribe because not subscribed.")}):q.default.isUsingSubscriptionWorkaround()?new Promise(function(e,t){K.debug("Unsubscribe from push got called, and we're going to remotely execute it in HTTPS iFrame."),OneSignal.proxyFrameHost.message(OneSignal.POSTMAM_COMMANDS.UNSUBSCRIBE_FROM_PUSH,null,function(n){K.debug("Unsubscribe from push succesfully remotely executed."),n.data===OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE?e():t("Failed to remotely unsubscribe from push.")})}):navigator.serviceWorker&&navigator.serviceWorker.controller?navigator.serviceWorker.ready.then(function(e){return e.pushManager}).then(function(e){return e.getSubscription()}).then(function(e){return e?e.unsubscribe():Promise.resolve()}):Promise.resolve()}function k(){return K.warn("OneSignal: Unregistering service worker."),Y.default.getWindowEnv()===J.WindowEnvironmentKind.OneSignalProxyFrame?Promise.resolve():navigator.serviceWorker&&navigator.serviceWorker.controller?navigator.serviceWorker.ready.then(function(e){return e.unregister()}):Promise.resolve()}function R(){return Promise.all([M(),k()])}function x(e){return new Promise(function(t){return setTimeout(t,e)})}function D(e,t){return e.substr(e.indexOf(t)+t.length)}function W(e,t,n,r){if(void 0===r&&(r=!1),t||K.error("Cannot call on() with no event: ",t),n||K.error("Cannot call on() with no task: ",n),"string"==typeof e){var o=document.querySelectorAll(e);if(o.length>0)for(var s=0;s<o.length;s++)W(o[s],t,n)}else if(i(e))for(var s=0;s<e.length;s++)W(e[s],t,n);else{if("object"!=typeof e)throw new Error(e+" must be a CSS selector string or DOM Element object.");var a=function(){return function(t){var i=function(){e.removeEventListener(t.type,a)};r||i(),n(t,i)}}();e.addEventListener(t,a)}}function U(){return window.__oneSignalSdkLoadCount||0}function L(e,t){return H.__awaiter(this,void 0,void 0,function(){return H.__generator(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n){OneSignal.once(e,function(e){if(t){t(e)&&n(e)}else n(e)})})];case 1:return[2,n.sent()]}})})}function B(){window.__oneSignalSdkLoadCount=U()+1}function F(e){return e.replace(/\s/g,"").toLowerCase()}function j(e){for(var t="",n=Object.keys(e),i=0,r=n;i<r.length;i++){var o=r[i],s=e[o];t+=encodeURIComponent(o)+"="+encodeURIComponent(s)}return t}Object.defineProperty(t,"__esModule",{value:!0});var H=n(0),V=n(9),K=n(1),G=n(6),z=n(58),q=n(10),Y=n(2),J=n(4),X=n(11);t.isArray=i;var Z=null;t.decodeHtmlEntities=r,t.redetectBrowserUserAgent=o,t.isPushNotificationsSupported=s,t.isChromeLikeBrowser=a,t.removeDomElement=u,t.awaitOneSignalInitAndSupported=c,t.stringify=l,t.executeCallback=d,t.logMethodCall=f,t.isValidEmail=p,t.addDomElement=g,t.clearDomElementChildren=h,t.addCssClass=v,t.removeCssClass=m,t.hasCssClass=b;var Q={CHROME:5,SAFARI:7,FIREFOX:8,UNKNOWN:-99};t.getDeviceTypeForBrowser=S,t.getConsoleStyle=w,t.delay=_,t.nothing=y,t.timeoutPromise=O,t.when=E,t.contains=P,t.trimUndefined=I,t.isValidUuid=C,t.getUrlQueryParam=N,t.wipeIndexedDb=T,t.capitalize=A,t.unsubscribeFromPush=M,t.wipeServiceWorker=k,t.wipeServiceWorkerAndUnsubscribe=R,t.wait=x,t.substringAfter=D,t.once=W,t.getSdkLoadCount=U,t.awaitSdkEvent=L,t.incrementSdkLoadCount=B,t.prepareEmailForHashing=F,t.encodeHashAsUriComponent=j},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.ServiceWorker="ServiceWorker",e.Host="Host",e.OneSignalSubscriptionPopup="Popup",e.OneSignalSubscriptionModal="Modal",e.OneSignalProxyFrame="ProxyFrame",e.CustomIframe="CustomFrame",e.Unknown="Unknown"}(t.WindowEnvironmentKind||(t.WindowEnvironmentKind={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),r=n(6),o=n(2),s=n(4),a=n(3),u=["notifyButtonHovering","notifyButtonHover","notifyButtonButtonClick","notifyButtonLauncherClick","animatedElementHiding","animatedElementHidden","animatedElementShowing","animatedElementShown","activeAnimatedElementActivating","activeAnimatedElementActive","activeAnimatedElementInactivating","activeAnimatedElementInactive","dbRetrieved","dbSet","testEvent"],c=["onesignal.prompt.custom.clicked","onesignal.prompt.native.permissionchanged","onesignal.subscription.changed","onesignal.internal.subscriptionset","dbRebuilt","initialize","subscriptionSet","sendWelcomeNotification","subscriptionChange","notificationPermissionChange","dbSet","register","notificationDisplay","notificationDismiss","notificationClick","permissionPromptDisplay","testWouldDisplay","testInitOptionDisabled","popupWindowTimeout"],l={notificationPermissionChange:"onesignal.prompt.native.permissionchanged",subscriptionChange:"onesignal.subscription.changed",customPromptClick:"onesignal.prompt.custom.clicked"},d=function(){function e(){}return e.trigger=function(t,n,d){if(void 0===d&&(d=null),!a.contains(u,t)){var f=n;if(d)var p=a.capitalize(o.default.getWindowEnv().toString())+" ⬸ "+a.capitalize(d);else var p=a.capitalize(o.default.getWindowEnv().toString());f||!1===f?i.debug("("+p+") » %c"+t+":",a.getConsoleStyle("event"),f):i.debug("("+p+") » %c"+t,a.getConsoleStyle("event"))}if(r.default.isBrowser()){if(t===OneSignal.EVENTS.SDK_INITIALIZED){if(OneSignal.initialized)return;OneSignal.initialized=!0}OneSignal.emit(t,n)}if(l.hasOwnProperty(t)){var g=l[t];e._triggerLegacy(g,n)}if(r.default.isBrowser()&&(o.default.getWindowEnv()===s.WindowEnvironmentKind.OneSignalSubscriptionPopup||o.default.getWindowEnv()===s.WindowEnvironmentKind.OneSignalProxyFrame)){opener||parent?a.contains(c,t)&&(o.default.getWindowEnv()===s.WindowEnvironmentKind.OneSignalSubscriptionPopup?OneSignal.subscriptionPopup.message(OneSignal.POSTMAM_COMMANDS.REMOTE_RETRIGGER_EVENT,{eventName:t,eventData:n}):OneSignal.proxyFrame.retriggerRemoteEvent(t,n)):i.error("Could not send event '"+t+"' back to host page because no creator (opener or parent) found!")}},e._triggerLegacy=function(e,t){var n=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:t});window.dispatchEvent(n)},e}();t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),r=n(4),o=function(){function e(){}return e.isBrowser=function(){return"undefined"!=typeof window},e.version=function(){return Number("140075")},Object.defineProperty(e,"TRADITIONAL_CHINESE_LANGUAGE_TAG",{get:function(){return["tw","hant"]},enumerable:!0,configurable:!0}),Object.defineProperty(e,"SIMPLIFIED_CHINESE_LANGUAGE_TAG",{get:function(){return["cn","hans"]},enumerable:!0,configurable:!0}),e.getLanguage=function(){var t=navigator.language;if(t){t=t.toLowerCase();var n=t.split("-");if("zh"==n[0]){for(var i=0,r=e.TRADITIONAL_CHINESE_LANGUAGE_TAG;i<r.length;i++){var o=r[i];if(-1!==n.indexOf(o))return"zh-Hant"}for(var s=0,a=e.SIMPLIFIED_CHINESE_LANGUAGE_TAG;s<a.length;s++){var u=a[s];if(-1!==n.indexOf(u))return"zh-Hans"}return"zh-Hant"}return n[0].substring(0,2)}return"en"},e.supportsServiceWorkers=function(){switch(i.default.getWindowEnv()){case r.WindowEnvironmentKind.ServiceWorker:return!0;default:return"undefined"!=typeof navigator&&"serviceWorker"in navigator}},e.getSdkStylesVersionHash=function(){return"f6167d99955e6358ecf2599d34a8514f"},e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(56),o=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t}(r);t.default=o},function(e,t,n){"use strict";function i(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,a=i(e),u=1;u<arguments.length;u++){n=Object(arguments[u]);for(var c in n)r.call(n,c)&&(a[c]=n[c]);if(Object.getOwnPropertySymbols){s=Object.getOwnPropertySymbols(n);for(var l=0;l<s.length;l++)o.call(n,s[l])&&(a[s[l]]=n[s[l]])}}return a}},function(e,t,n){!function(t,i,r){void 0!==e&&e.exports?e.exports=r():n(57)("bowser",r)}(0,0,function(){function e(e){function t(t){var n=e.match(t);return n&&n.length>1&&n[1]||""}var n,i=t(/(ipod|iphone|ipad)/i).toLowerCase(),r=/like android/i.test(e),o=!r&&/android/i.test(e),a=/nexus\s*[0-6]\s*/i.test(e),u=!a&&/nexus\s*[0-9]+/i.test(e),c=/CrOS/.test(e),l=/silk/i.test(e),d=/sailfish/i.test(e),f=/tizen/i.test(e),p=/(web|hpw)os/i.test(e),g=/windows phone/i.test(e),h=(/SamsungBrowser/i.test(e),!g&&/windows/i.test(e)),v=!i&&!l&&/macintosh/i.test(e),m=!o&&!d&&!f&&!p&&/linux/i.test(e),b=t(/edge\/(\d+(\.\d+)?)/i),S=t(/version\/(\d+(\.\d+)?)/i),w=/tablet/i.test(e)&&!/tablet pc/i.test(e),_=!w&&/[^-]mobi/i.test(e),y=/xbox/i.test(e);/opera/i.test(e)?n={name:"Opera",opera:s,version:S||t(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(e)?n={name:"Opera",opera:s,version:t(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||S}:/SamsungBrowser/i.test(e)?n={name:"Samsung Internet for Android",samsungBrowser:s,version:S||t(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(e)?n={name:"Opera Coast",coast:s,version:S||t(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(e)?n={name:"Yandex Browser",yandexbrowser:s,version:S||t(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(e)?n={name:"UC Browser",ucbrowser:s,version:t(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(e)?n={name:"Maxthon",maxthon:s,version:t(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(e)?n={name:"Epiphany",epiphany:s,version:t(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(e)?n={name:"Puffin",puffin:s,version:t(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(e)?n={name:"Sleipnir",sleipnir:s,version:t(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(e)?n={name:"K-Meleon",kMeleon:s,version:t(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:g?(n={name:"Windows Phone",windowsphone:s},b?(n.msedge=s,n.version=b):(n.msie=s,n.version=t(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?n={name:"Internet Explorer",msie:s,version:t(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:c?n={name:"Chrome",chromeos:s,chromeBook:s,chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/chrome.+? edge/i.test(e)?n={name:"Microsoft Edge",msedge:s,version:b}:/vivaldi/i.test(e)?n={name:"Vivaldi",vivaldi:s,version:t(/vivaldi\/(\d+(\.\d+)?)/i)||S}:d?n={name:"Sailfish",sailfish:s,version:t(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?n={name:"SeaMonkey",seamonkey:s,version:t(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(e)?(n={name:"Firefox",firefox:s,version:t(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(n.firefoxos=s)):l?n={name:"Amazon Silk",silk:s,version:t(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(e)?n={name:"PhantomJS",phantom:s,version:t(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(e)?n={name:"SlimerJS",slimer:s,version:t(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?n={name:"BlackBerry",blackberry:s,version:S||t(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:p?(n={name:"WebOS",webos:s,version:S||t(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(n.touchpad=s)):/bada/i.test(e)?n={name:"Bada",bada:s,version:t(/dolfin\/(\d+(\.\d+)?)/i)}:f?n={name:"Tizen",tizen:s,version:t(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||S}:/qupzilla/i.test(e)?n={name:"QupZilla",qupzilla:s,version:t(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||S}:/chromium/i.test(e)?n={name:"Chromium",chromium:s,version:t(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||S}:/chrome|crios|crmo/i.test(e)?n={name:"Chrome",chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:o?n={name:"Android",version:S}:/safari|applewebkit/i.test(e)?(n={name:"Safari",safari:s},S&&(n.version=S)):i?(n={name:"iphone"==i?"iPhone":"ipad"==i?"iPad":"iPod"},S&&(n.version=S)):n=/googlebot/i.test(e)?{name:"Googlebot",googlebot:s,version:t(/googlebot\/(\d+(\.\d+))/i)||S}:{name:t(/^(.*)\/(.*) /),version:function(t){var n=e.match(t);return n&&n.length>1&&n[2]||""}(/^(.*)\/(.*) /)},!n.msedge&&/(apple)?webkit/i.test(e)?(/(apple)?webkit\/537\.36/i.test(e)?(n.name=n.name||"Blink",n.blink=s):(n.name=n.name||"Webkit",n.webkit=s),!n.version&&S&&(n.version=S)):!n.opera&&/gecko\//i.test(e)&&(n.name=n.name||"Gecko",n.gecko=s,n.version=n.version||t(/gecko\/(\d+(\.\d+)?)/i)),n.windowsphone||n.msedge||!o&&!n.silk?n.windowsphone||n.msedge||!i?v?n.mac=s:y?n.xbox=s:h?n.windows=s:m&&(n.linux=s):(n[i]=s,n.ios=s):n.android=s;var O="";n.windows?O=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(t(/Windows ((NT|XP)( \d\d?.\d)?)/i)):n.windowsphone?O=t(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):n.mac?(O=t(/Mac OS X (\d+([_\.\s]\d+)*)/i),O=O.replace(/[_\s]/g,".")):i?(O=t(/os (\d+([_\s]\d+)*) like mac os x/i),O=O.replace(/[_\s]/g,".")):o?O=t(/android[ \/-](\d+(\.\d+)*)/i):n.webos?O=t(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):n.blackberry?O=t(/rim\stablet\sos\s(\d+(\.\d+)*)/i):n.bada?O=t(/bada\/(\d+(\.\d+)*)/i):n.tizen&&(O=t(/tizen[\/\s](\d+(\.\d+)*)/i)),O&&(n.osversion=O);var E=!n.windows&&O.split(".")[0];return w||u||"ipad"==i||o&&(3==E||E>=4&&!_)||n.silk?n.tablet=s:(_||"iphone"==i||"ipod"==i||o||a||n.blackberry||n.webos||n.bada)&&(n.mobile=s),n.msedge||n.msie&&n.version>=10||n.yandexbrowser&&n.version>=15||n.vivaldi&&n.version>=1||n.chrome&&n.version>=20||n.samsungBrowser&&n.version>=4||n.firefox&&n.version>=20||n.safari&&n.version>=6||n.opera&&n.version>=10||n.ios&&n.osversion&&n.osversion.split(".")[0]>=6||n.blackberry&&n.version>=10.1||n.chromium&&n.version>=20?n.a=s:n.msie&&n.version<10||n.chrome&&n.version<20||n.firefox&&n.version<20||n.safari&&n.version<6||n.opera&&n.version<10||n.ios&&n.osversion&&n.osversion.split(".")[0]<6||n.chromium&&n.version<20?n.c=s:n.x=s,n}function t(e){return e.split(".").length}function n(e,t){var n,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n++)i.push(t(e[n]));return i}function i(e){for(var i=Math.max(t(e[0]),t(e[1])),r=n(e,function(e){var r=i-t(e);return e+=new Array(r+1).join(".0"),n(e.split("."),function(e){return new Array(20-e.length).join("0")+e}).reverse()});--i>=0;){if(r[0][i]>r[1][i])return 1;if(r[0][i]!==r[1][i])return-1;if(0===i)return 0}}function r(t,n,r){var o=a;"string"==typeof n&&(r=n,n=void 0),void 0===n&&(n=!1),r&&(o=e(r));var s=""+o.version;for(var u in t)if(t.hasOwnProperty(u)&&o[u]){if("string"!=typeof t[u])throw new Error("Browser version in the minVersion map should be a string: "+u+": "+String(t));return i([s,t[u]])<0}return n}function o(e,t,n){return!r(e,t,n)}var s=!0,a=e("undefined"!=typeof navigator?navigator.userAgent||"":"");return a.test=function(e){for(var t=0;t<e.length;++t){var n=e[t];if("string"==typeof n&&n in a)return!0}return!1},a.isUnsupportedBrowser=r,a.compareVersions=i,a.check=o,a._detect=e,a})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(9),o=n(1),s=n(14),a=n(14),u=n(2),c=n(4),l=n(15),d=n(16),f=n(20),p=function(){function e(){}return e.registerForPush=function(){return i.__awaiter(this,void 0,void 0,function(){var e,t,n,r,p,g,h,v,m;return i.__generator(this,function(i){switch(i.label){case 0:return t=OneSignal.context,[4,OneSignal.isPushNotificationsEnabled()];case 1:if((n=i.sent())&&!t.sessionManager.isFirstPageView())return o.debug("Not registering for push because the user is subscribed and this is not the first page view."),[2,null];if("undefined"!=typeof OneSignal){if(OneSignal._isRegisteringForPush)return[2,null];OneSignal._isRegisteringForPush=!0}switch(r=u.default.getWindowEnv()){case c.WindowEnvironmentKind.Host:case c.WindowEnvironmentKind.OneSignalSubscriptionModal:return[3,2];case c.WindowEnvironmentKind.OneSignalSubscriptionPopup:return[3,6]}return[3,18];case 2:return i.trys.push([2,4,,5]),[4,t.subscriptionManager.subscribe()];case 3:return e=i.sent(),t.sessionManager.incrementPageViewCount(),l.default.triggerNotificationPermissionChanged(),l.default.checkAndTriggerSubscriptionChanged(),[3,5];case 4:return p=i.sent(),o.info(p),[3,5];case 5:return[3,19];case 6:return g=opener||parent,h=void 0,[4,t.permissionManager.updateStoredPermission()];case 7:i.sent(),i.label=8;case 8:return i.trys.push([8,11,,17]),[4,t.subscriptionManager.subscribePartially()];case 9:return h=i.sent(),[4,t.permissionManager.updateStoredPermission()];case 10:return i.sent(),[3,17];case 11:return v=i.sent(),[4,t.permissionManager.updateStoredPermission()];case 12:if(i.sent(),!(v instanceof s.default))return[3,16];switch(m=v.reason){case a.PushPermissionNotGrantedErrorReason.Blocked:return[3,13];case a.PushPermissionNotGrantedErrorReason.Dismissed:return[3,15]}return[3,16];case 13:return[4,t.permissionManager.updateStoredPermission()];case 14:return i.sent(),OneSignal.subscriptionPopup.message(OneSignal.POSTMAM_COMMANDS.REMOTE_NOTIFICATION_PERMISSION_CHANGED,{permission:f.NotificationPermission.Denied,forceUpdatePermission:!1}),[3,16];case 15:return OneSignal.subscriptionPopup.message(OneSignal.POSTMAM_COMMANDS.REMOTE_NOTIFICATION_PERMISSION_CHANGED,{permission:f.NotificationPermission.Default,forceUpdatePermission:!0}),[3,16];case 16:return g?(window.close(),[2,null]):[3,17];case 17:return OneSignal.subscriptionPopup.message(OneSignal.POSTMAM_COMMANDS.FINISH_REMOTE_REGISTRATION,{rawPushSubscription:h.serialize()},function(e){!0===e.data.progress?(o.debug("Got message from host page that remote reg. is in progress, closing popup."),g&&window.close()):o.debug("Got message from host page that remote reg. could not be finished.")}),[3,19];case 18:throw"undefined"!=typeof OneSignal&&(OneSignal._isRegisteringForPush=!1),new d.InvalidStateError(d.InvalidStateReason.UnsupportedEnvironment);case 19:return"undefined"!=typeof OneSignal&&(OneSignal._isRegisteringForPush=!1),[2,e]}})})},e.isUsingSubscriptionWorkaround=function(){if(!OneSignal.config)throw new Error("("+u.default.getWindowEnv().toString()+") isUsingSubscriptionWorkaround() cannot be called until OneSignal.config exists.");return!r.safari&&(!(e.isLocalhostAllowedAsSecureOrigin()&&"localhost"===location.hostname||"127.0.0.1"===location.hostname)&&(u.default.getWindowEnv()===c.WindowEnvironmentKind.Host&&(!!OneSignal.config.subdomain||"http:"===location.protocol)))},e.hasInsecureParentOrigin=function(){return i.__awaiter(this,void 0,void 0,function(){var e;return i.__generator(this,function(t){switch(t.label){case 0:if(window===window.top||!("serviceWorker"in navigator)||void 0===navigator.serviceWorker.getRegistration)return[2,!1];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,navigator.serviceWorker.getRegistration()];case 2:return t.sent(),[2,!1];case 3:return e=t.sent(),[2,!0];case 4:return[2]}})})},e.isInsecureOrigin=function(){return"http:"===window.location.protocol},e.isLocalhostAllowedAsSecureOrigin=function(){return OneSignal.config&&OneSignal.config.userConfig&&!0===OneSignal.config.userConfig.allowLocalhostAsSecureOrigin},e}();t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n(0),o=n(10),s=n(38),a=n(2),u=n(25),c=n(64),l=n(65),d=n(26),f=n(36),p=n(12),g=n(4),h=n(39);!function(e){e[e.SET=0]="SET"}(i||(i={}));var v=function(){function e(e){this.databaseName=e,this.emitter=new s.default,this.database=new h.default(this.databaseName)}return e.applyDbResultFilter=function(e,t,n){switch(e){case"Options":return n&&t?n.value:n&&!t?n:null;case"Ids":return n&&t?n.id:n&&!t?n:null;case"NotificationOpened":return n&&t?{data:n.data,timestamp:n.timestamp}:n&&!t?n:null;default:return n||null}},e.prototype.get=function(t,n){return r.__awaiter(this,void 0,void 0,function(){var i=this;return r.__generator(this,function(s){switch(s.label){case 0:return[4,new Promise(function(s){return r.__awaiter(i,void 0,void 0,function(){var i,u;return r.__generator(this,function(r){switch(r.label){case 0:return a.default.getWindowEnv()!==g.WindowEnvironmentKind.ServiceWorker&&o.default.isUsingSubscriptionWorkaround()&&a.default.getTestEnv()===f.TestEnvironmentKind.None?(OneSignal.proxyFrameHost.message(OneSignal.POSTMAM_COMMANDS.REMOTE_DATABASE_GET,[{table:t,key:n}],function(e){var t=e.data[0];s(t)}),[3,3]):[3,1];case 1:return[4,this.database.get(t,n)];case 2:i=r.sent(),u=e.applyDbResultFilter(t,n,i),s(u),r.label=3;case 3:return[2]}})})})];case 1:return[2,s.sent()]}})})},e.prototype.put=function(t,n){return r.__awaiter(this,void 0,void 0,function(){var i=this;return r.__generator(this,function(s){switch(s.label){case 0:return[4,new Promise(function(e,s){return r.__awaiter(i,void 0,void 0,function(){return r.__generator(this,function(i){switch(i.label){case 0:return a.default.getWindowEnv()!==g.WindowEnvironmentKind.ServiceWorker&&o.default.isUsingSubscriptionWorkaround()&&a.default.getTestEnv()===f.TestEnvironmentKind.None?(OneSignal.proxyFrameHost.message(OneSignal.POSTMAM_COMMANDS.REMOTE_DATABASE_PUT,[{table:t,keypath:n}],function(i){i.data===OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE?e():s("(Database) Attempted remote IndexedDB put("+t+", "+n+"), but did not get success response.")}),[3,3]):[3,1];case 1:return[4,this.database.put(t,n)];case 2:i.sent(),e(),i.label=3;case 3:return[2]}})})})];case 1:return s.sent(),this.emitter.emit(e.EVENTS.SET,n),[2]}})})},e.prototype.remove=function(e,t){return a.default.getWindowEnv()!==g.WindowEnvironmentKind.ServiceWorker&&o.default.isUsingSubscriptionWorkaround()&&a.default.getTestEnv()===f.TestEnvironmentKind.None?new Promise(function(n,i){OneSignal.proxyFrameHost.message(OneSignal.POSTMAM_COMMANDS.REMOTE_DATABASE_REMOVE,[{table:e,keypath:t}],function(r){r.data===OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE?n():i("(Database) Attempted remote IndexedDB remove("+e+", "+t+"), but did not get success response.")})}):this.database.remove(e,t)},e.prototype.getAppConfig=function(){return r.__awaiter(this,void 0,void 0,function(){var t,n,i,o;return r.__generator(this,function(r){switch(r.label){case 0:return t=new u.AppConfig,[4,this.get("Ids","appId")];case 1:return n=r.sent(),t.appId=new p.Uuid(n),i=t,[4,this.get("Options","subdomain")];case 2:return i.subdomain=r.sent(),o=t,[4,e.get("Options","vapidPublicKey")];case 3:return o.vapidPublicKey=r.sent(),[2,t]}})})},e.prototype.setAppConfig=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){switch(t.label){case 0:return e.appId&&e.appId.value?[4,this.put("Ids",{type:"appId",id:e.appId.value})]:[3,2];case 1:t.sent(),t.label=2;case 2:return e.subdomain?[4,this.put("Options",{key:"subdomain",value:e.subdomain})]:[3,4];case 3:t.sent(),t.label=4;case 4:return e.httpUseOneSignalCom?[4,this.put("Options",{key:"httpUseOneSignalCom",value:!0})]:[3,6];case 5:return t.sent(),[3,8];case 6:return[4,this.put("Options",{key:"httpUseOneSignalCom",value:!1})];case 7:t.sent(),t.label=8;case 8:return e.vapidPublicKey?[4,this.put("Options",{key:"vapidPublicKey",value:e.vapidPublicKey})]:[3,10];case 9:t.sent(),t.label=10;case 10:return[2]}})})},e.prototype.getAppState=function(){return r.__awaiter(this,void 0,void 0,function(){var e,t,n,i,o;return r.__generator(this,function(r){switch(r.label){case 0:return e=new c.AppState,t=e,[4,this.get("Options","defaultUrl")];case 1:return t.defaultNotificationUrl=r.sent(),n=e,[4,this.get("Options","defaultTitle")];case 2:return n.defaultNotificationTitle=r.sent(),i=e,[4,this.get("Options","isPushEnabled")];case 3:return i.lastKnownPushEnabled=r.sent(),o=e,[4,this.get("NotificationOpened")];case 4:return o.clickedNotifications=r.sent(),[2,e]}})})},e.prototype.setAppState=function(e){return r.__awaiter(this,void 0,void 0,function(){var t,n,i,o,s;return r.__generator(this,function(r){switch(r.label){case 0:return e.defaultNotificationUrl?[4,this.put("Options",{key:"defaultUrl",value:e.defaultNotificationUrl})]:[3,2];case 1:r.sent(),r.label=2;case 2:return e.defaultNotificationTitle||""===e.defaultNotificationTitle?[4,this.put("Options",{key:"defaultTitle",value:e.defaultNotificationTitle})]:[3,4];case 3:r.sent(),r.label=4;case 4:return null==e.lastKnownPushEnabled?[3,6]:[4,this.put("Options",{key:"isPushEnabled",value:e.lastKnownPushEnabled})];case 5:r.sent(),r.label=6;case 6:if(!e.clickedNotifications)return[3,12];t=Object.keys(e.clickedNotifications),n=0,i=t,r.label=7;case 7:return n<i.length?(o=i[n],s=e.clickedNotifications[o],s?[4,this.put("NotificationOpened",{url:o,data:s.data,timestamp:s.timestamp})]:[3,9]):[3,12];case 8:return r.sent(),[3,11];case 9:return null!==s?[3,11]:[4,this.remove("NotificationOpened",o)];case 10:r.sent(),r.label=11;case 11:return n++,[3,7];case 12:return[2]}})})},e.prototype.getServiceWorkerState=function(){return r.__awaiter(this,void 0,void 0,function(){var e,t,n,i;return r.__generator(this,function(r){switch(r.label){case 0:return e=new l.ServiceWorkerState,t=e,[4,this.get("Ids","WORKER1_ONE_SIGNAL_SW_VERSION")];case 1:return t.workerVersion=r.sent(),n=e,[4,this.get("Ids","WORKER2_ONE_SIGNAL_SW_VERSION")];case 2:return n.updaterWorkerVersion=r.sent(),i=e,[4,this.get("Ids","backupNotification")];case 3:return i.backupNotification=r.sent(),[2,e]}})})},e.prototype.setServiceWorkerState=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){switch(t.label){case 0:return e.workerVersion?[4,this.put("Ids",{type:"WORKER1_ONE_SIGNAL_SW_VERSION",id:e.workerVersion})]:[3,2];case 1:t.sent(),t.label=2;case 2:return e.updaterWorkerVersion?[4,this.put("Ids",{type:"WORKER2_ONE_SIGNAL_SW_VERSION",id:e.updaterWorkerVersion})]:[3,4];case 3:t.sent(),t.label=4;case 4:return e.backupNotification?[4,this.put("Ids",{type:"backupNotification",id:e.backupNotification})]:[3,6];case 5:t.sent(),t.label=6;case 6:return[2]}})})},e.prototype.getSubscription=function(){return r.__awaiter(this,void 0,void 0,function(){var e,t,n,i,o;return r.__generator(this,function(r){switch(r.label){case 0:return e=new d.Subscription,[4,this.get("Ids","userId")];case 1:return t=r.sent(),e.deviceId=new p.Uuid(t),n=e,[4,this.get("Ids","registrationId")];case 2:return n.subscriptionToken=r.sent(),[4,this.get("Options","optedOut")];case 3:return i=r.sent(),[4,this.get("Options","subscription")];case 4:return o=r.sent(),e.optedOut=null!=i?i:null!=o&&!o,[2,e]}})})},e.prototype.setSubscription=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){switch(t.label){case 0:return e.deviceId&&e.deviceId.value?[4,this.put("Ids",{type:"userId",id:e.deviceId.value})]:[3,2];case 1:t.sent(),t.label=2;case 2:return e.subscriptionToken?[4,this.put("Ids",{type:"registrationId",id:e.subscriptionToken})]:[3,4];case 3:t.sent(),t.label=4;case 4:return null==e.optedOut?[3,6]:[4,this.put("Options",{key:"optedOut",value:e.optedOut})];case 5:t.sent(),t.label=6;case 6:return[2]}})})},e.rebuild=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return e.ensureSingletonInstance(),[2,Promise.all([e.databaseInstance.remove("Ids"),e.databaseInstance.remove("NotificationOpened"),e.databaseInstance.remove("Options")])]})})},e.ensureSingletonInstance=function(){e.databaseInstanceName||(e.databaseInstanceName="ONE_SIGNAL_SDK_DB"),e.databaseInstance||(e.databaseInstance=new e(e.databaseInstanceName))},e.on=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return e.ensureSingletonInstance(),[2,e.databaseInstance.emitter.on.apply(e.databaseInstance.emitter,t)]})})},e.setSubscription=function(t){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return e.ensureSingletonInstance(),[2,e.databaseInstance.setSubscription.call(e.databaseInstance,t)]})})},e.getSubscription=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return e.ensureSingletonInstance(),[2,e.databaseInstance.getSubscription.call(e.databaseInstance)]})})},e.setServiceWorkerState=function(t){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return e.ensureSingletonInstance(),[2,e.databaseInstance.setServiceWorkerState.call(e.databaseInstance,t)]})})},e.getServiceWorkerState=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return e.ensureSingletonInstance(),[2,e.databaseInstance.getServiceWorkerState.call(e.databaseInstance)]})})},e.setAppState=function(t){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return e.ensureSingletonInstance(),[2,e.databaseInstance.setAppState.call(e.databaseInstance,t)]})})},e.getAppState=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return e.ensureSingletonInstance(),[2,e.databaseInstance.getAppState.call(e.databaseInstance)]})})},e.setAppConfig=function(t){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return e.ensureSingletonInstance(),[2,e.databaseInstance.setAppConfig.call(e.databaseInstance,t)]})})},e.getAppConfig=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return e.ensureSingletonInstance(),[2,e.databaseInstance.getAppConfig.call(e.databaseInstance)]})})},e.remove=function(t,n){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(i){return e.ensureSingletonInstance(),[2,e.databaseInstance.remove.call(e.databaseInstance,t,n)]})})},e.put=function(t,n){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(i){return e.ensureSingletonInstance(),[2,e.databaseInstance.put.call(e.databaseInstance,t,n)]})})},e.get=function(t,n){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(i){return e.ensureSingletonInstance(),[2,e.databaseInstance.get.call(e.databaseInstance,t,n)]})})},e.EVENTS=i,e}();t.default=v},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=n(60),r=n(62),o=function(){function t(e){if(e){if(!i(e))throw new r.default(e);this.uuid=e}else this.uuid=null}return Object.defineProperty(t.prototype,"value",{get:function(){return this.uuid},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.uuid},t.generate=function(){var n="",i="undefined"==typeof window?e.crypto:window.crypto||window.msCrypto;return n=i?"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=i.getRandomValues(new Uint8Array(1))[0]%16|0;return("x"==e?t:3&t|8).toString(16)}):"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),new t(n)},t.prototype.serialize=function(){return this.value},t.deserialize=function(e){return new t(e)},t}();t.Uuid=o}).call(t,n(37))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(27),o=n(1),s=n(8),a=n(22),u=n(6),c=n(16),l=n(5),d=n(2),f=n(12),p=n(4),g=n(11),h=n(3),v=n(15),m=n(23),b=function(){function e(){}return e.fixWordpressManifestIfMisplaced=function(){var e=document.querySelectorAll("link[rel=manifest]");if(e&&!(e.length<=1))for(var t=0;t<e.length;t++){var n=e[t],i=n.href;h.contains(i,"gcm_sender_id")&&(document.querySelector("head").insertBefore(n,document.querySelector("head").children[0]),o.info("OneSignal: Moved the WordPress push <manifest> to the first element in <head>."))}},e.getNotificationTypeFromOptIn=function(e){return 1==e||null==e?1:-2},e.wasHttpsNativePromptDismissed=function(){return"dismissed"===r.get("onesignal-notification-prompt")},e.markHttpPopoverShown=function(){sessionStorage.setItem("ONESIGNAL_HTTP_PROMPT_SHOWN","true")},e.isHttpPromptAlreadyShown=function(){return"true"==sessionStorage.getItem("ONESIGNAL_HTTP_PROMPT_SHOWN")},e.checkAndTriggerNotificationPermissionChanged=function(){Promise.all([g.default.get("Options","notificationPermission"),OneSignal.getNotificationPermission()]).then(function(e){var t=e[0],n=e[1];t!==n&&v.default.triggerNotificationPermissionChanged().then(function(){return g.default.put("Options",{key:"notificationPermission",value:n})})})},e.showNotifyButton=function(){if(u.default.isBrowser()&&!OneSignal.notifyButton){OneSignal.config.userConfig.notifyButton=OneSignal.config.userConfig.notifyButton||{},OneSignal.config.userConfig.bell&&(s(OneSignal.config.userConfig.bell,OneSignal.config.userConfig.notifyButton),s(OneSignal.config.userConfig.notifyButton,OneSignal.config.userConfig.bell));var e=OneSignal.config.userConfig.notifyButton.displayPredicate;e&&"function"==typeof e?Promise.resolve(OneSignal.config.userConfig.notifyButton.displayPredicate()).then(function(e){!1!==e?(OneSignal.notifyButton=new a.default(OneSignal.config.userConfig.notifyButton),OneSignal.notifyButton.create()):o.debug("Notify button display predicate returned false so not showing the notify button.")}):(OneSignal.notifyButton=new a.default(OneSignal.config.userConfig.notifyButton),OneSignal.notifyButton.create())}},e.getNotificationIcons=function(){return i.__awaiter(this,void 0,void 0,function(){var t,n,r,s;return i.__generator(this,function(i){switch(i.label){case 0:return[4,e.getAppId()];case 1:if(!(t=i.sent())||!t.value)throw new c.InvalidStateError(c.InvalidStateReason.MissingAppId);return n=d.default.getOneSignalApiUrl().toString()+"/apps/"+t.value+"/icon",[4,fetch(n)];case 2:return r=i.sent(),[4,r.json()];case 3:if(s=i.sent(),s.errors)throw o.error("API call %c"+n,h.getConsoleStyle("code"),"failed with:",s.errors),new Error("Failed to get notification icons.");return[2,s]}})})},e.establishServiceWorkerChannel=function(){var e=this,t=OneSignal.context.workerMessenger;t.off(),t.on(m.WorkerMessengerCommand.NotificationDisplayed,function(e){o.debug(location.origin,"Received notification display event from service worker."),l.default.trigger(OneSignal.EVENTS.NOTIFICATION_DISPLAYED,e)}),t.on(m.WorkerMessengerCommand.NotificationClicked,function(t){return i.__awaiter(e,void 0,void 0,function(){var e,n;return i.__generator(this,function(i){switch(i.label){case 0:return d.default.getWindowEnv()!==p.WindowEnvironmentKind.OneSignalProxyFrame?[3,2]:[4,new Promise(function(e){var t=OneSignal.proxyFrame;t&&t.messenger.message(OneSignal.POSTMAM_COMMANDS.GET_EVENT_LISTENER_COUNT,OneSignal.EVENTS.NOTIFICATION_CLICKED,function(t){var n=t.data;e(n)})})];case 1:return e=i.sent(),[3,3];case 2:e=OneSignal.getListeners(OneSignal.EVENTS.NOTIFICATION_CLICKED).length,i.label=3;case 3:return 0!==e?[3,5]:(o.debug("notification.clicked event received, but no event listeners; storing event in IndexedDb for later retrieval."),n=t.url,t.url||(n=location.href),[4,g.default.put("NotificationOpened",{url:n,data:t,timestamp:Date.now()})]);case 4:return i.sent(),[3,6];case 5:l.default.trigger(OneSignal.EVENTS.NOTIFICATION_CLICKED,t),i.label=6;case 6:return[2]}})})}),t.on(m.WorkerMessengerCommand.RedirectPage,function(e){o.debug(d.default.getWindowEnv().toString()+" Picked up command.redirect to "+e+", forwarding to host page.");var t=OneSignal.proxyFrame;t&&t.messenger.message(OneSignal.POSTMAM_COMMANDS.SERVICEWORKER_COMMAND_REDIRECT,e)}),t.on(m.WorkerMessengerCommand.NotificationDismissed,function(e){l.default.trigger(OneSignal.EVENTS.NOTIFICATION_DISMISSED,e)})},e.getPromptOptionsQueryString=function(){var t=OneSignal.config.userConfig.promptOptions,n="";if(t)for(var i=e.getPromptOptionsPostHash(),r=0,o=Object.keys(i);r<o.length;r++){var s=o[r],a=i[s];n+="&"+s+"="+a}return n},e.getPromptOptionsPostHash=function(){var e=OneSignal.config.userConfig.promptOptions;if(e){for(var t={exampleNotificationTitleDesktop:"exampleNotificationTitle",exampleNotificationMessageDesktop:"exampleNotificationMessage",exampleNotificationTitleMobile:"exampleNotificationTitle",exampleNotificationMessageMobile:"exampleNotificationMessage"},n=0,i=Object.keys(t);n<i.length;n++){var r=i[n],o=t[r];e[r]&&(e[o]=e[r])}for(var s=["autoAcceptTitle","siteName","autoAcceptTitle","subscribeText","showGraphic","actionMessage","exampleNotificationTitle","exampleNotificationMessage","exampleNotificationCaption","acceptButtonText","cancelButtonText","timeout"],a={},u=0;u<s.length;u++){var c=s[u],l=e[c],d=encodeURIComponent(l);(l||!1===l||""===l)&&(a[c]=d)}}return a},e.triggerCustomPromptClicked=function(e){l.default.trigger(OneSignal.EVENTS.CUSTOM_PROMPT_CLICKED,{result:e})},e.getAppId=function(){return i.__awaiter(this,void 0,void 0,function(){var e;return i.__generator(this,function(t){switch(t.label){case 0:return OneSignal.config.appId?[2,Promise.resolve(OneSignal.config.appId)]:[3,1];case 1:return[4,g.default.get("Ids","appId")];case 2:return e=t.sent(),[2,new f.Uuid(e)]}})})},e}();t.default=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n(0),o=n(7);!function(e){e[e.Blocked=0]="Blocked",e[e.Dismissed=1]="Dismissed",e[e.Default=2]="Default"}(i=t.PushPermissionNotGrantedErrorReason||(t.PushPermissionNotGrantedErrorReason={}));var PushPermissionNotGrantedError=function(e){function PushPermissionNotGrantedError(t){var n=this;switch(t){case i.Dismissed:n=e.call(this,"The user dismissed the permission prompt.")||this;break;case i.Blocked:n=e.call(this,"Notification permissions are blocked.")||this;break;case i.Default:n=e.call(this,"Notification permissions have not been granted yet.")||this}return n.reason=t,n}return r.__extends(PushPermissionNotGrantedError,e),PushPermissionNotGrantedError}(o.default);t.default=PushPermissionNotGrantedError},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(1),o=n(5),s=n(21),a=n(19),u=n(11),c=n(3),l=n(13),d=function(){function e(){}return e.onNotificationPermissionChange=function(){e.checkAndTriggerSubscriptionChanged()},e.onInternalSubscriptionSet=function(e){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(t){return s.default.put("subscription.optedOut",e),[2]})})},e.checkAndTriggerSubscriptionChanged=function(){return i.__awaiter(this,void 0,void 0,function(){var t,n,o,s;return i.__generator(this,function(i){switch(i.label){case 0:return c.logMethodCall("checkAndTriggerSubscriptionChanged"),[4,OneSignal.isPushNotificationsEnabled()];case 1:return t=i.sent(),[4,u.default.getAppState()];case 2:return n=i.sent(),(o=n.lastKnownPushEnabled,s=null===o||t!==o)?(r.info("The user's subscription state changed from "+(null===o?"(not stored)":o)+" ⟶ "+t),n.lastKnownPushEnabled=t,[4,u.default.setAppState(n)]):[2];case 3:return i.sent(),e.triggerSubscriptionChanged(t),[2]}})})},e._onSubscriptionChanged=function(t){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(n){return e.onSubscriptionChanged_showWelcomeNotification(t),e.onSubscriptionChanged_evaluateNotifyButtonDisplayPredicate(t),[2]})})},e.onSubscriptionChanged_showWelcomeNotification=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,s,d,f,p,g,h;return i.__generator(this,function(i){switch(i.label){case 0:return OneSignal.__doNotShowWelcomeNotification?(r.debug("Not showing welcome notification because user has previously subscribed."),[2]):!0!==e?[3,3]:[4,u.default.getSubscription()];case 1:return t=i.sent().deviceId,[4,l.default.getAppId()];case 2:n=i.sent(),s=OneSignal.config.userConfig.welcomeNotification,d=void 0!==s&&!0===s.disable,f=void 0!==s&&void 0!==s.title&&null!==s.title?s.title:"",p=void 0!==s&&void 0!==s.message&&null!==s.message&&s.message.length>0?s.message:"Thanks for subscribing!",g=new URL(location.href).origin+"?_osp=do_not_open",h=s&&s.url&&s.url.length>0?s.url:g,f=c.decodeHtmlEntities(f),p=c.decodeHtmlEntities(p),d||(r.debug("Sending welcome notification."),a.default.sendNotification(n,[t],{en:f},{en:p},h,null,{__isOneSignalWelcomeNotification:!0},void 0),o.default.trigger(OneSignal.EVENTS.WELCOME_NOTIFICATION_SENT,{title:f,message:p,url:h})),i.label=3;case 3:return[2]}})})},e.onSubscriptionChanged_evaluateNotifyButtonDisplayPredicate=function(e){return i.__awaiter(this,void 0,void 0,function(){var e,t;return i.__generator(this,function(n){switch(n.label){case 0:return e=OneSignal.config.userConfig.notifyButton.displayPredicate,e&&"function"==typeof e&&OneSignal.notifyButton?[4,e()]:[3,2];case 1:t=n.sent(),!1!==t?(r.debug("Showing notify button because display predicate returned true."),OneSignal.notifyButton.launcher.show()):(r.debug("Hiding notify button because display predicate returned false."),OneSignal.notifyButton.launcher.hide()),n.label=2;case 2:return[2]}})})},e.triggerNotificationPermissionChanged=function(e){void 0===e&&(e=!1);var t,n;return Promise.all([OneSignal.getNotificationPermission(),u.default.get("Options","notificationPermission")]).then(function(i){var r=i[0],o=i[1];return t=r,n=r!==o||e,n?u.default.put("Options",{key:"notificationPermission",value:r}):null}).then(function(){n&&o.default.trigger(OneSignal.EVENTS.NATIVE_PROMPT_PERMISSIONCHANGED,{to:t})})},e.triggerSubscriptionChanged=function(e){o.default.trigger(OneSignal.EVENTS.SUBSCRIPTION_CHANGED,e)},e.fireStoredNotificationClicks=function(e){return void 0===e&&(e=document.URL),i.__awaiter(this,void 0,void 0,function(){function t(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,r,s;return i.__generator(this,function(i){switch(i.label){case 0:return[4,u.default.getAppState()];case 1:return t=i.sent(),t.clickedNotifications[e.url]=null,[4,u.default.setAppState(t)];case 2:return i.sent(),(n=e.data,r=e.timestamp,r&&(s=(Date.now()-r)/1e3/60)>5)?[2]:(o.default.trigger(OneSignal.EVENTS.NOTIFICATION_CLICKED,n),[2])}})})}var n,r,s,a,c,l,d,f;return i.__generator(this,function(i){switch(i.label){case 0:return[4,u.default.getAppState()];case 1:return n=i.sent(),[4,u.default.get("Options","notificationClickHandlerMatch")];case 2:if("origin"!==(r=i.sent()))return[3,7];s=0,a=Object.keys(n.clickedNotifications),i.label=3;case 3:return s<a.length?(c=a[s],new URL(c).origin!==location.origin?[3,5]:(l=n.clickedNotifications[c],[4,t(l)])):[3,6];case 4:i.sent(),i.label=5;case 5:return s++,[3,3];case 6:return[3,11];case 7:return d=n.clickedNotifications[e],d?[4,t(d)]:[3,9];case 8:return i.sent(),[3,11];case 9:return d||!e.endsWith("/")?[3,11]:(f=e.substring(0,e.length-1),d=n.clickedNotifications[f],d?[4,t(d)]:[3,11]);case 10:i.sent(),i.label=11;case 11:return[2]}})})},e}();t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n(0),o=n(7),s=n(41);!function(e){e[e.MissingAppId=0]="MissingAppId",e[e.RedundantPermissionMessage=1]="RedundantPermissionMessage",e[e.PushPermissionAlreadyGranted=2]="PushPermissionAlreadyGranted",e[e.UnsupportedEnvironment=3]="UnsupportedEnvironment",e[e.MissingDomElement=4]="MissingDomElement",e[e.ServiceWorkerNotActivated=5]="ServiceWorkerNotActivated"}(i=t.InvalidStateReason||(t.InvalidStateReason={}));var InvalidStateError=function(e){function InvalidStateError(t,n){var r=this;switch(t){case i.MissingAppId:r=e.call(this,"Missing required app ID.")||this;break;case i.RedundantPermissionMessage:var o="";n.permissionPromptType&&(o="("+s.PermissionPromptType[n.permissionPromptType]+")"),r=e.call(this,"Another permission message "+o+" is being displayed.")||this;break;case i.PushPermissionAlreadyGranted:r=e.call(this,"Push permission has already been granted.")||this;break;case i.UnsupportedEnvironment:r=e.call(this,"The current environment does not support this operation.")||this;break;case i.ServiceWorkerNotActivated:r=e.call(this,"The service worker must be activated first.")||this}return r.description=i[t],r.reason=t,r}return r.__extends(InvalidStateError,e),InvalidStateError}(o.default);t.InvalidStateError=InvalidStateError},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(44),r=n(1),o=n(8),s=n(45),a=n(6),u=n(2),c=n(12),l=n(3),d=function(){function e(e,t,n){if(this.windowReference=e,this.sendToOrigin=t,this.receiveFromOrigin=n,!window||!window.postMessage)throw new Error("Must pass in a valid window reference supporting postMessage():"+e);if(!t||!n)throw new Error("Invalid origin. Must be set.");i.merge(this,new s),this.channel=new MessageChannel,this.messagePort=null,this.isListening=!1,this.isConnected=!1,this.replies={}}return Object.defineProperty(e,"HANDSHAKE_MESSAGE",{get:function(){return"onesignal.postmam.handshake"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CONNECTED_MESSAGE",{get:function(){return"onesignal.postmam.connected"},enumerable:!0,configurable:!0}),e.prototype.listen=function(){if(r.debug("(Postmam) Called listen()."),this.isListening)return void r.debug("(Postmam) Already listening for Postmam connections.");a.default.isBrowser()&&(this.isListening=!0,r.debug("(Postmam) Listening for Postmam connections.",this),window.addEventListener("message",this.onWindowMessagePostmanConnectReceived.bind(this)))},e.prototype.startPostMessageReceive=function(){window.addEventListener("message",this.onWindowPostMessageReceived.bind(this))},e.prototype.stopPostMessageReceive=function(){window.removeEventListener("message",this.onWindowPostMessageReceived)},e.prototype.destroy=function(){this.stopPostMessageReceive(),this.removeEvent()},e.prototype.onWindowPostMessageReceived=function(t){if(this.isSafeOrigin(t.origin)){var n=t.data,i=n.id,s=n.command,a=n.data,u=n.source;if(s===e.CONNECTED_MESSAGE)return this.emit("connect"),void(this.isConnected=!0);var c={id:i,command:s,data:a,source:u},l=o({reply:this.reply.bind(this,c)},c);if(this.replies.hasOwnProperty(i)){r.info("(Postmam) This message is a reply.");!1===this.replies[i].bind(window)(l)&&delete this.replies[i]}else this.emit(s,l)}},e.prototype.onWindowMessagePostmanConnectReceived=function(t){if(r.debug("(Postmam) ("+u.default.getWindowEnv().toString()+") Window postmessage for Postman connect received:",t),this.isSafeOrigin(t.origin)){if(t.data.handshake!==e.HANDSHAKE_MESSAGE)return void r.info("(Postmam) Got a postmam message, but not our expected handshake:",t.data);r.info("(Postmam) Got our expected Postmam handshake message (and connecting...):",t.data),window.removeEventListener("message",this.onWindowMessagePostmanConnectReceived),this.messagePort=t.ports[0],this.messagePort.addEventListener("message",this.onMessageReceived.bind(this),!1),r.info("(Postmam) Removed previous message event listener for handshakes, replaced with main message listener."),this.messagePort.start(),this.isConnected=!0,r.info("(Postmam) ("+u.default.getWindowEnv().toString()+") Connected."),this.message(e.CONNECTED_MESSAGE),this.emit("connect")}},e.prototype.connect=function(){r.info("(Postmam) ("+u.default.getWindowEnv().toString()+") Establishing a connection to "+this.sendToOrigin+"."),this.messagePort=this.channel.port1,this.messagePort.addEventListener("message",this.onMessageReceived.bind(this),!1),this.messagePort.start(),this.windowReference.postMessage({handshake:e.HANDSHAKE_MESSAGE},this.sendToOrigin,[this.channel.port2])},e.prototype.onMessageReceived=function(t){if(!t.data)return void r.debug("("+u.default.getWindowEnv().toString()+") Received an empty Postmam message:",t);var n=t.data,i=n.id,s=n.command,a=n.data,c=n.source;if(s===e.CONNECTED_MESSAGE)return this.emit("connect"),void(this.isConnected=!0);var l={id:i,command:s,data:a,source:c},d=o({reply:this.reply.bind(this,l)},l);if(this.replies.hasOwnProperty(i)){!1===this.replies[i].bind(window)(d)&&delete this.replies[i]}else this.emit(s,d)},e.prototype.reply=function(e,t,n){var i={id:e.id,command:e.command,data:t,source:u.default.getWindowEnv().toString(),isReply:!0};"function"==typeof n&&(this.replies[i.id]=n),this.messagePort.postMessage(i)},e.prototype.postMessage=function(e,t,n){if(!e||""==e)throw new Error("(Postmam) Postmam command must not be empty.");if("function"==typeof t)return void r.debug("You passed a function to data, did you mean to pass null?");var i={id:c.Uuid.generate().toString(),command:e,data:t,source:u.default.getWindowEnv().toString()};"function"==typeof n&&(this.replies[i.id]=n),this.windowReference.postMessage(i,"*")},e.prototype.message=function(e,t,n){if(!e||""==e)throw new Error("(Postmam) Postmam command must not be empty.");if("function"==typeof t)return void r.debug("You passed a function to data, did you mean to pass null?");var i={id:c.Uuid.generate().toString(),command:e,data:t,source:u.default.getWindowEnv().toString()};"function"==typeof n&&(this.replies[i.id]=n),this.messagePort.postMessage(i)},e.prototype.generateSafeOrigins=function(e){var t=[];try{var n=new URL(e),i=n.host;0===n.host.indexOf("www.")&&(i=n.host.replace("www.","")),"https:"===n.protocol?(t.push("https://"+i),t.push("https://www."+i)):"http:"===n.protocol&&(t.push("http://"+i),t.push("http://www."+i),t.push("https://"+i),t.push("https://www."+i))}catch(e){}return t},e.prototype.isSafeOrigin=function(e){if(OneSignal.config)var t=OneSignal.config.subdomain;else var t="x";var n=this.generateSafeOrigins(this.receiveFromOrigin);return"https://onesignal.com"===e||e==="https://"+(t||"")+".onesignal.com"||e==="https://"+(t||"")+".os.tc"||e==="https://"+(t||"")+".os.tc:3001"||e===u.default.getOneSignalApiUrl().origin||"*"===this.receiveFromOrigin||l.contains(n,e)},e.prototype.on=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.once=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e}();t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n(0),o=n(7);!function(e){e[e.Empty=0]="Empty",e[e.Malformed=1]="Malformed",e[e.EnumOutOfRange=2]="EnumOutOfRange"}(i=t.InvalidArgumentReason||(t.InvalidArgumentReason={}));var InvalidArgumentError=function(e){function InvalidArgumentError(t,n){var r=this;switch(n){case i.Empty:r=e.call(this,"Supply a non-empty value to '"+t+"'.")||this;break;case i.Malformed:r=e.call(this,"The value for '"+t+"' was malformed.")||this;break;case i.EnumOutOfRange:r=e.call(this,"The value for '"+t+"' was out of range of the expected input enum.")||this}return r.argument=t,r.reason=i[n],r}return r.__extends(InvalidArgumentError,e),InvalidArgumentError}(o.default);t.InvalidArgumentError=InvalidArgumentError},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(59),o=n(1),s=n(8),a=n(6),u=n(2),c=n(25),l=n(12),d=n(3),f=n(63),p=n(4),g=function(){function e(){}return e.get=function(t,n,i){return e.call("GET",t,n,i)},e.post=function(t,n,i){return e.call("POST",t,n,i)},e.put=function(t,n,i){return e.call("PUT",t,n,i)},e.delete=function(t,n,i){return e.call("DELETE",t,n,i)},e.call=function(t,n,i,r){var o=new Headers;if(o.append("SDK-Version","onesignal/web/"+a.default.version()),o.append("Content-Type","application/json;charset=UTF-8"),r)for(var s=0,c=Object.keys(r);s<c.length;s++){var l=c[s];o.append(l,r[l])}var d={method:t||"NO_METHOD_SPECIFIED",headers:o,cache:"no-cache"};i&&(d.body=JSON.stringify(i));var f;return fetch(u.default.getOneSignalApiUrl().toString()+"/"+n,d).then(function(e){return f=e.status,e.json()}).then(function(t){return f>=200&&f<300?t:"no-user-id-error"!==e.identifyError(t)?Promise.reject(t):void 0})},e.identifyError=function(e){if(!e||!e.errors)return"no-error";var t=e.errors;return d.contains(t,"No user with this id found")||d.contains(t,"Could not find app_id for given player id.")?"no-user-id-error":"unknown-error"},e.getUserIdFromSubscriptionIdentifier=function(t,n,i){return e.post("players",{app_id:t,device_type:n,identifier:i}).then(function(e){return e&&e.id?e.id:null}).catch(function(e){return o.debug("Error getting user ID from subscription identifier:",e),null})},e.getPlayer=function(t,n){return e.get("players/"+n+"?app_id="+t)},e.updatePlayer=function(t,n,i){return e.put("players/"+n.value,s({app_id:t.value},i))},e.sendNotification=function(t,n,i,r,o,s,a,u){var c={app_id:t.value,contents:r,include_player_ids:n.map(function(e){return e.value}),isAnyWeb:!0,data:a,web_buttons:u};return i&&(c.headings=i),o&&(c.url=o),s&&(c.chrome_web_icon=s,c.firefox_icon=s),d.trimUndefined(c),e.post("notifications",c)},e.getAppConfig=function(t){return i.__awaiter(this,void 0,void 0,function(){var n,o,s;return i.__generator(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,new Promise(function(n,i){u.default.getWindowEnv()!==p.WindowEnvironmentKind.ServiceWorker?r(u.default.getOneSignalApiUrl().toString()+"/sync/"+t.value+"/web",null,function(e,t){e?i(e):t.success?n(t):i(t)}):n(e.get("sync/"+t.value+"/web",null))})];case 1:return n=i.sent(),o=new c.AppConfig,o.appId=t,n.features&&(n.features.cookie_sync&&n.features.cookie_sync.enable&&(o.cookieSyncEnabled=!0),n.features.metrics&&n.features.metrics.enable&&(o.metrics.enable=!0,o.metrics.mixpanelReportingToken=n.features.metrics.mixpanel_reporting_token)),n.config&&(n.config.http_use_onesignal_com&&(o.httpUseOneSignalCom=!0),n.config.safari_web_id&&(o.safariWebId=n.config.safari_web_id),n.config.subdomain&&(o.subdomain=n.config.subdomain),n.config.vapid_public_key&&(o.vapidPublicKey=n.config.vapid_public_key),n.config.onesignal_vapid_public_key&&(o.onesignalVapidPublicKey=n.config.onesignal_vapid_public_key)),[2,o];case 2:throw s=i.sent();case 3:return[2]}})})},e.createUser=function(t){return i.__awaiter(this,void 0,void 0,function(){var n;return i.__generator(this,function(i){switch(i.label){case 0:return[4,e.post("players",t.serialize())];case 1:return n=i.sent(),n&&n.success?[2,new l.Uuid(n.id)]:[2,null]}})})},e.updateUserSession=function(t,n){return i.__awaiter(this,void 0,void 0,function(){var r,o;return i.__generator(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e.post("players/"+t.value+"/on_session",n.serialize())];case 1:return r=i.sent(),r.id?[2,new l.Uuid(r.id)]:[2,t];case 2:throw o=i.sent(),o&&Array.isArray(o.errors)&&o.errors.length>0&&d.contains(o.errors[0],"app_id not found")?new f.OneSignalApiError(f.OneSignalApiErrorKind.MissingAppId):o;case 3:return[2]}})})},e}();t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i;!function(e){e.Default="default",e.Granted="granted",e.Denied="denied"}(i||(i={})),t.NotificationPermission=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.put=function(t,n){return void 0===e.store[t]&&(e.store[t]=[null,null]),e.store[t].push(n),e.store[t].length==e.LIMIT+1&&e.store[t].shift(),e.store[t]},e.get=function(t){return void 0===e.store[t]&&(e.store[t]=[null,null]),e.store[t]},e.getFirst=function(t){return e.get(t)[0]},e.getLast=function(t){return e.get(t)[1]},e.remove=function(t){delete e.store[t]},e.isEmpty=function(t){var n=e.get(t);return null===n[0]&&null===n[1]},e.store={},e.LIMIT=2,e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(9),o=n(1),s=n(5),a=n(13),u=n(10),c=n(3),l=n(66),d=n(67),f=n(68),p=n(69),g=n(40),h=function(){function e(t){var n=void 0===t?{}:t,r=n.enable,o=void 0!==r&&r,s=n.size,u=void 0===s?"medium":s,l=n.position,d=void 0===l?"bottom-right":l,f=n.theme,p=void 0===f?"default":f,h=n.showLauncherAfter,v=void 0===h?10:h,m=n.showBadgeAfter,b=void 0===m?300:m,S=n.text,w=void 0===S?{"tip.state.unsubscribed":"Subscribe to notifications","tip.state.subscribed":"You're subscribed to notifications","tip.state.blocked":"You've blocked notifications","message.prenotify":"Click to subscribe to notifications","message.action.subscribing":"Click <strong>{{prompt.native.grant}}</strong> to receive notifications","message.action.subscribed":"Thanks for subscribing!","message.action.resubscribed":"You're subscribed to notifications","message.action.unsubscribed":"You won't receive notifications again","dialog.main.title":"Manage Site Notifications","dialog.main.button.subscribe":"SUBSCRIBE","dialog.main.button.unsubscribe":"UNSUBSCRIBE","dialog.blocked.title":"Unblock Notifications","dialog.blocked.message":"Follow these instructions to allow notifications:"}:S,_=n.prenotify,y=void 0===_||_,O=n.showCredit,E=void 0===O||O,P=n.colors,I=void 0===P?null:P,C=n.offset,N=void 0===C?null:C,T=n.launcher,A=void 0===T?null:T,M=this;if(this.options={enable:o,size:u,position:d,theme:p,showLauncherAfter:v,showBadgeAfter:b,text:w,prenotify:y,showCredit:E,colors:I,offset:N},this.options.enable){if(!c.contains(["small","medium","large"],this.options.size))throw new Error("Invalid size "+this.options.size+" for notify button. Choose among 'small', 'medium', or 'large'.");if(!c.contains(["bottom-left","bottom-right"],this.options.position))throw new Error("Invalid position "+this.options.position+" for notify button. Choose either 'bottom-left', or 'bottom-right'.");if(!c.contains(["default","inverse"],this.options.theme))throw new Error("Invalid theme "+this.options.theme+" for notify button. Choose either 'default', or 'inverse'.");if(this.options.showLauncherAfter<0)throw new Error("Invalid delay duration of "+this.options.showLauncherAfter+" for showing the notify button. Choose a value above 0.");if(this.options.showBadgeAfter<0)throw new Error("Invalid delay duration of "+this.options.showBadgeAfter+" for showing the notify button's badge. Choose a value above 0.");this.size=this.options.size,this.position=this.options.position,this.text=this.options.text,this.text["tip.state.unsubscribed"]||(this.text["tip.state.unsubscribed"]="Subscribe to notifications"),this.text["tip.state.subscribed"]||(this.text["tip.state.subscribed"]="You're subscribed to notifications"),this.text["tip.state.blocked"]||(this.text["tip.state.blocked"]="You've blocked notifications"),this.text["message.prenotify"]||(this.text["message.prenotify"]="Click to subscribe to notifications"),this.text["message.action.subscribed"]||(this.text["message.action.subscribed"]="Thanks for subscribing!"),this.text["message.action.resubscribed"]||(this.text["message.action.resubscribed"]="You're subscribed to notifications"),this.text["message.action.subscribing"]||(this.text["message.action.subscribing"]="Click <strong>{{prompt.native.grant}}</strong> to receive notifications"),this.text["message.action.unsubscribed"]||(this.text["message.action.unsubscribed"]="You won't receive notifications again"),this.text["dialog.main.title"]||(this.text["dialog.main.title"]="Manage Site Notifications"),this.text["dialog.main.button.subscribe"]||(this.text["dialog.main.button.subscribe"]="SUBSCRIBE"),this.text["dialog.main.button.unsubscribe"]||(this.text["dialog.main.button.unsubscribe"]="UNSUBSCRIBE"),this.text["dialog.blocked.title"]||(this.text["dialog.blocked.title"]="Unblock Notifications"),this.text["dialog.blocked.message"]||(this.text["dialog.blocked.message"]="Follow these instructions to allow notifications:"),this._launcher=A,this.substituteText(),this.state=e.STATES.UNINITIALIZED,this._ignoreSubscriptionState=!1,OneSignal.on(e.EVENTS.SUBSCRIBE_CLICK,function(){M.dialog.subscribeButton.disabled=!0,M._ignoreSubscriptionState=!0,OneSignal.setSubscription(!0).then(function(){return M.dialog.subscribeButton.disabled=!1,M.dialog.hide()}).then(function(){return M.message.display(g.default.TYPES.MESSAGE,M.text["message.action.resubscribed"],g.default.TIMEOUT)}).then(function(){return M._ignoreSubscriptionState=!1,M.launcher.clearIfWasInactive(),M.launcher.inactivate()}).then(function(){return M.updateState()})}),OneSignal.on(e.EVENTS.UNSUBSCRIBE_CLICK,function(){M.dialog.unsubscribeButton.disabled=!0,OneSignal.setSubscription(!1).then(function(){return M.dialog.unsubscribeButton.disabled=!1,M.dialog.hide()}).then(function(){return M.launcher.clearIfWasInactive(),M.launcher.activate()}).then(function(){return M.message.display(g.default.TYPES.MESSAGE,M.text["message.action.unsubscribed"],g.default.TIMEOUT)}).then(function(){return M.updateState()})}),OneSignal.on(e.EVENTS.HOVERING,function(){return M.hovering=!0,M.launcher.activateIfInactive(),M.message.shown||M.dialog.shown?void(M.hovering=!1):M.message.contentType===g.default.TYPES.MESSAGE?void(M.hovering=!1):void new Promise(function(e){if(M.message.queued.length>0)return M.message.dequeue().then(function(t){M.message.content=t,M.message.contentType=g.default.TYPES.QUEUED,e()});M.message.content=c.decodeHtmlEntities(M.message.getTipForState()),M.message.contentType=g.default.TYPES.TIP,e()}).then(function(){return M.message.show()}).then(function(){M.hovering=!1})}),OneSignal.on(e.EVENTS.HOVERED,function(){M.message.contentType!==g.default.TYPES.MESSAGE&&M.dialog.hidden&&(M.hovering&&(M.hovering=!1,M.message.waitUntilShown().then(function(){return c.delay(g.default.TIMEOUT)}).then(function(){return M.message.hide()}).then(function(){M.launcher.wasInactive&&M.dialog.hidden&&(M.launcher.inactivate(),M.launcher.wasInactive=null)})),M.message.shown&&M.message.hide().then(function(){M.launcher.wasInactive&&M.dialog.hidden&&(M.launcher.inactivate(),M.launcher.wasInactive=null)}))}),OneSignal.on(OneSignal.EVENTS.SUBSCRIPTION_CHANGED,function(t){return i.__awaiter(M,void 0,void 0,function(){var n,r=this;return i.__generator(this,function(i){switch(i.label){case 0:return 1!=t?[3,2]:(this.badge.shown&&this.options.prenotify&&this.badge.hide(),null!==this.dialog.notificationIcons?[3,2]:[4,a.default.getNotificationIcons()]);case 1:n=i.sent(),this.dialog.notificationIcons=n,i.label=2;case 2:return OneSignal.getNotificationPermission(function(n){r.setState(t?e.STATES.SUBSCRIBED:"denied"===n?e.STATES.BLOCKED:e.STATES.UNSUBSCRIBED,r._ignoreSubscriptionState)}),[2]}})})}),OneSignal.on(e.EVENTS.STATE_CHANGED,function(t){M.launcher.element&&(t.to===e.STATES.SUBSCRIBED?M.launcher.inactivate():(t.to===e.STATES.UNSUBSCRIBED||e.STATES.BLOCKED)&&M.launcher.activate())}),OneSignal.on(OneSignal.EVENTS.NATIVE_PROMPT_PERMISSIONCHANGED,function(){M.updateState()}),this.updateState()}}return Object.defineProperty(e,"EVENTS",{get:function(){return{STATE_CHANGED:"notifyButtonStateChange",LAUNCHER_CLICK:"notifyButtonLauncherClick",BELL_CLICK:"notifyButtonButtonClick",SUBSCRIBE_CLICK:"notifyButtonSubscribeClick",UNSUBSCRIBE_CLICK:"notifyButtonUnsubscribeClick",HOVERING:"notifyButtonHovering",HOVERED:"notifyButtonHover"}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"STATES",{get:function(){return{UNINITIALIZED:"uninitialized",SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed",BLOCKED:"blocked"}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"TEXT_SUBS",{get:function(){return{"prompt.native.grant":{default:"Allow",chrome:"Allow",firefox:"Always Receive Notifications",safari:"Allow"}}},enumerable:!0,configurable:!0}),e.prototype.substituteText=function(){for(var t in this.text)if(this.text.hasOwnProperty(t)){var n=this.text[t],i=r.name.toLowerCase();for(var o in e.TEXT_SUBS)if(e.TEXT_SUBS.hasOwnProperty(o)){var s=e.TEXT_SUBS[o],a=s[i];n&&c.contains(n,"{{")&&(this.text[t]=n.replace("{{"+o+"}}",void 0!==a?a:s.default))}}},e.prototype.showDialogProcedure=function(){var e=this;this.dialog.shown||this.dialog.show().then(function(){c.once(document,"click",function(t,n){e.dialog.element.contains(t.target)||(n(),e.dialog.shown&&e.dialog.hide().then(function(){e.launcher.inactivateIfWasInactive()}))},!0)})},e.prototype.create=function(){return i.__awaiter(this,void 0,void 0,function(){var e,t,n,r,s,l=this;return i.__generator(this,function(i){switch(i.label){case 0:return this.options.enable?[4,OneSignal.context.dynamicResourceLoader.loadSdkStylesheet()]:[2];case 1:return 0!==(e=i.sent())?(o.debug("Not showing notify button because styles failed to load."),[2]):(this.container&&c.removeDomElement("#onesignal-bell-container"),c.addDomElement("body","beforeend",'<div id="onesignal-bell-container" class="onesignal-bell-container onesignal-reset"></div>'),c.addDomElement(this.container,"beforeend",'<div id="onesignal-bell-launcher" class="onesignal-bell-launcher"></div>'),c.addDomElement(this.launcher.selector,"beforeend",'<div class="onesignal-bell-launcher-button"></div>'),c.addDomElement(this.launcher.selector,"beforeend",'<div class="onesignal-bell-launcher-badge"></div>'),c.addDomElement(this.launcher.selector,"beforeend",'<div class="onesignal-bell-launcher-message"></div>'),c.addDomElement(this.message.selector,"beforeend",'<div class="onesignal-bell-launcher-message-body"></div>'),c.addDomElement(this.launcher.selector,"beforeend",'<div class="onesignal-bell-launcher-dialog"></div>'),c.addDomElement(this.dialog.selector,"beforeend",'<div class="onesignal-bell-launcher-dialog-body"></div>'),c.addDomElement(this.button.selector,"beforeEnd",'<svg class="onesignal-bell-svg" xmlns="http://www.w3.org/2000/svg" width="99.7" height="99.7" viewBox="0 0 99.7 99.7"><circle class="background" cx="49.9" cy="49.9" r="49.9"/><path class="foreground" d="M50.1 66.2H27.7s-2-.2-2-2.1c0-1.9 1.7-2 1.7-2s6.7-3.2 6.7-5.5S33 52.7 33 43.3s6-16.6 13.2-16.6c0 0 1-2.4 3.9-2.4 2.8 0 3.8 2.4 3.8 2.4 7.2 0 13.2 7.2 13.2 16.6s-1 11-1 13.3c0 2.3 6.7 5.5 6.7 5.5s1.7.1 1.7 2c0 1.8-2.1 2.1-2.1 2.1H50.1zm-7.2 2.3h14.5s-1 6.3-7.2 6.3-7.3-6.3-7.3-6.3z"/><ellipse class="stroke" cx="49.9" cy="49.9" rx="37.4" ry="36.9"/></svg>'),[4,OneSignal.isPushNotificationsEnabled()]);case 2:return t=i.sent(),[4,OneSignal.getSubscription()];case 3:return n=i.sent(),[4,a.default.wasHttpsNativePromptDismissed()];case 4:return r=i.sent(),s=t?"small":this.options.size,[4,this.launcher.resize(s)];case 5:if(i.sent(),"bottom-left"===this.options.position)c.addCssClass(this.container,"onesignal-bell-container-bottom-left"),c.addCssClass(this.launcher.selector,"onesignal-bell-launcher-bottom-left");else{if("bottom-right"!==this.options.position)throw new Error("Invalid OneSignal notify button position "+this.options.position);c.addCssClass(this.container,"onesignal-bell-container-bottom-right"),c.addCssClass(this.launcher.selector,"onesignal-bell-launcher-bottom-right")}if("default"===this.options.theme)c.addCssClass(this.launcher.selector,"onesignal-bell-launcher-theme-default");else{if("inverse"!==this.options.theme)throw new Error("Invalid OneSignal notify button theme "+this.options.theme);c.addCssClass(this.launcher.selector,"onesignal-bell-launcher-theme-inverse")}return this.applyOffsetIfSpecified(),this.setCustomColorsIfSpecified(),this.patchSafariSvgFilterBug(),o.info("Showing the notify button."),[4,(t?this.launcher.inactivate():c.nothing()).then(function(){return OneSignal.getSubscription()}).then(function(e){return!t&&e||null!==l.dialog.notificationIcons?c.nothing():a.default.getNotificationIcons().then(function(e){l.dialog.notificationIcons=e})}).then(function(){return c.delay(l.options.showLauncherAfter)}).then(function(){return u.default.isUsingSubscriptionWorkaround()&&n&&!0!==r&&!t&&!0===OneSignal.config.userConfig.autoRegister&&!a.default.isHttpPromptAlreadyShown()?(o.debug("Not showing notify button because popover will be shown."),c.nothing()):l.launcher.show()}).then(function(){return c.delay(l.options.showBadgeAfter)}).then(function(){return l.options.prenotify&&!t&&OneSignal._isNewVisitor?l.message.enqueue(l.text["message.prenotify"]).then(function(){return l.badge.show()}):c.nothing()}).then(function(){return l.initialized=!0})];case 6:return i.sent(),[2]}})})},e.prototype.patchSafariSvgFilterBug=function(){if(!(r.safari&&Number(r.version)>=9.1)){var e="drop-shadow(0 2px 4px rgba(34,36,38,0.35));",t="drop-shadow(0 2px 4px rgba(34,36,38,0));",n="drop-shadow(0px 2px 2px rgba(34,36,38,.15));";this.graphic.setAttribute("style","filter: "+e+"; -webkit-filter: "+e+";"),this.badge.element.setAttribute("style","filter: "+t+"; -webkit-filter: "+t+";"),this.dialog.element.setAttribute("style","filter: "+n+"; -webkit-filter: "+n+";")}r.safari&&this.badge.element.setAttribute("style","display: none;")},e.prototype.applyOffsetIfSpecified=function(){var e=this.options.offset;e&&(this.launcher.element.style.cssText="",e.bottom&&(this.launcher.element.style.cssText+="bottom: "+e.bottom+";"),"bottom-right"===this.options.position?e.right&&(this.launcher.element.style.cssText+="right: "+e.right+";"):"bottom-left"===this.options.position&&e.left&&(this.launcher.element.style.cssText+="left: "+e.left+";"))},e.prototype.setCustomColorsIfSpecified=function(){var e=this.dialog.element.querySelector("button.action"),t=this.button.element.querySelector(".pulse-ring");this.graphic.querySelector(".background").style.cssText="";for(var n=this.graphic.querySelectorAll(".foreground"),i=0;i<n.length;i++){var r=n[i];r.style.cssText=""}if(this.graphic.querySelector(".stroke").style.cssText="",this.badge.element.style.cssText="",e&&(e.style.cssText="",e.style.cssText=""),t&&(t.style.cssText=""),this.options.colors){var o=this.options.colors;if(o["circle.background"]&&(this.graphic.querySelector(".background").style.cssText+="fill: "+o["circle.background"]),o["circle.foreground"]){for(var s=this.graphic.querySelectorAll(".foreground"),i=0;i<s.length;i++){var r=s[i];r.style.cssText+="fill: "+o["circle.foreground"]}this.graphic.querySelector(".stroke").style.cssText+="stroke: "+o["circle.foreground"]}o["badge.background"]&&(this.badge.element.style.cssText+="background: "+o["badge.background"]),o["badge.bordercolor"]&&(this.badge.element.style.cssText+="border-color: "+o["badge.bordercolor"]),o["badge.foreground"]&&(this.badge.element.style.cssText+="color: "+o["badge.foreground"]),e&&(o["dialog.button.background"]&&(this.dialog.element.querySelector("button.action").style.cssText+="background: "+o["dialog.button.background"]),o["dialog.button.foreground"]&&(this.dialog.element.querySelector("button.action").style.cssText+="color: "+o["dialog.button.foreground"]),o["dialog.button.background.hovering"]&&this.addCssToHead("onesignal-background-hover-style","#onesignal-bell-container.onesignal-reset .onesignal-bell-launcher .onesignal-bell-launcher-dialog button.action:hover { background: "+o["dialog.button.background.hovering"]+" !important; }"),o["dialog.button.background.active"]&&this.addCssToHead("onesignal-background-active-style","#onesignal-bell-container.onesignal-reset .onesignal-bell-launcher .onesignal-bell-launcher-dialog button.action:active { background: "+o["dialog.button.background.active"]+" !important; }")),t&&o["pulse.color"]&&(this.button.element.querySelector(".pulse-ring").style.cssText="border-color: "+o["pulse.color"])}},e.prototype.addCssToHead=function(e,t){if(!document.getElementById(e)){var n=document.createElement("style");n.id=e,n.type="text/css",n.appendChild(document.createTextNode(t)),document.head.appendChild(n)}},e.prototype.updateState=function(){var t=this;Promise.all([OneSignal.isPushNotificationsEnabled(),OneSignal.getNotificationPermission()]).then(function(n){var i=n[0],r=n[1];t.setState(i?e.STATES.SUBSCRIBED:e.STATES.UNSUBSCRIBED),"denied"===r&&t.setState(e.STATES.BLOCKED)})},e.prototype.setState=function(t,n){void 0===n&&(n=!1);var i=this.state;this.state=t,i===t||n||s.default.trigger(e.EVENTS.STATE_CHANGED,{from:i,to:t})},Object.defineProperty(e.prototype,"container",{get:function(){return document.querySelector("#onesignal-bell-container")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphic",{get:function(){return this.button.element.querySelector("svg")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"launcher",{get:function(){return this._launcher||(this._launcher=new p.default(this)),this._launcher},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"button",{get:function(){return this._button||(this._button=new d.default(this)),this._button},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"badge",{get:function(){return this._badge||(this._badge=new l.default),this._badge},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message||(this._message=new g.default(this)),this._message},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dialog",{get:function(){return this._dialog||(this._dialog=new f.default(this)),this._dialog},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"subscribed",{get:function(){return this.state===e.STATES.SUBSCRIBED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"unsubscribed",{get:function(){return this.state===e.STATES.UNSUBSCRIBED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blocked",{get:function(){return this.state===e.STATES.BLOCKED},enumerable:!0,configurable:!0}),e}();t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(18),o=n(2),s=n(30),a=n(4),u=n(1),c=n(6);!function(e){e.WorkerVersion="GetWorkerVersion",e.Subscribe="Subscribe",e.AmpSubscriptionState="amp-web-push-subscription-state",e.AmpSubscribe="amp-web-push-subscribe",e.AmpUnsubscribe="amp-web-push-unsubscribe",e.NotificationDisplayed="notification.displayed",e.NotificationClicked="notification.clicked",e.NotificationDismissed="notification.dismissed",e.RedirectPage="command.redirect"}(t.WorkerMessengerCommand||(t.WorkerMessengerCommand={}));var l=function(){function e(){this.replies={}}return e.prototype.addListener=function(e,t,n){var i={callback:t,onceListenerOnly:n};this.findListenersForMessage(e).length>0?this.replies[e.toString()].push(i):this.replies[e.toString()]=[i]},e.prototype.findListenersForMessage=function(e){return this.replies[e.toString()]||[]},e.prototype.deleteListenerRecords=function(e){this.replies[e.toString()]=null},e.prototype.deleteAllListenerRecords=function(){this.replies={}},e.prototype.deleteListenerRecord=function(e,t){for(var n=this.replies[e.toString()],i=n.length-1;i>=0;i--){n[i]===t&&n.splice(i,1)}},e}();t.WorkerMessengerReplyBuffer=l;var d=function(){function e(e){this.context=e,this.replies=new l,this.debug=!0}return e.prototype.broadcast=function(e,t){return i.__awaiter(this,void 0,void 0,function(){var n,r,s,c,l;return i.__generator(this,function(i){switch(i.label){case 0:return n=o.default.getWindowEnv(),n===a.WindowEnvironmentKind.ServiceWorker?[3,1]:[2];case 1:return[4,self.clients.matchAll({type:"window",includeUncontrolled:!0})];case 2:for(r=i.sent(),s=0,c=r;s<c.length;s++)l=c[s],u.debug("[Worker Messenger] [SW -> Page] Broadcasting '"+e.toString()+"' to window client "+l.url+"."),l.postMessage({command:e,payload:t});i.label=3;case 3:return[2]}})})},e.prototype.unicast=function(e,t,n){return i.__awaiter(this,void 0,void 0,function(){var s;return i.__generator(this,function(i){switch(i.label){case 0:if((s=o.default.getWindowEnv())!==a.WindowEnvironmentKind.ServiceWorker)return[3,1];if(!n)throw new r.InvalidArgumentError("windowClient",r.InvalidArgumentReason.Empty);return u.debug("[Worker Messenger] [SW -> Page] Unicasting '"+e.toString()+"' to window client "+n.url+"."),n.postMessage({command:e,payload:t}),[3,4];case 1:return[4,this.isWorkerControllingPage()];case 2:return i.sent()||u.debug("[Worker Messenger] The page is not controlled by the service worker yet. Waiting...",self.registration),[4,this.waitUntilWorkerControlsPage()];case 3:i.sent(),u.debug("[Worker Messenger] [Page -> SW] Unicasting '"+e.toString()+"' to service worker."),navigator.serviceWorker.controller.postMessage({command:e,payload:t}),i.label=4;case 4:return[2]}})})},e.prototype.listen=function(e){if(c.default.supportsServiceWorkers()){o.default.getWindowEnv()===a.WindowEnvironmentKind.ServiceWorker?(self.addEventListener("message",this.onWorkerMessageReceivedFromPage.bind(this)),u.debug("[Worker Messenger] Service worker is now listening for messages.")):this.listenForPage(e)}},e.prototype.listenForPage=function(e){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(t){switch(t.label){case 0:return e?[3,3]:[4,this.isWorkerControllingPage()];case 1:return t.sent()||u.debug("("+location.origin+") [Worker Messenger] The page is not controlled by the service worker yet. Waiting...",self.registration),[4,this.waitUntilWorkerControlsPage()];case 2:t.sent(),u.debug("("+location.origin+") [Worker Messenger] The page is now controlled by the service worker."),t.label=3;case 3:return navigator.serviceWorker.addEventListener("message",this.onPageMessageReceivedFromServiceWorker.bind(this)),u.debug("("+location.origin+") [Worker Messenger] Page is now listening for messages."),[2]}})})},e.prototype.onWorkerMessageReceivedFromPage=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,r,o,s,a,c,l,c,d,f,c;return i.__generator(this,function(i){for(t=e.data,n=this.replies.findListenersForMessage(t.command),r=[],o=[],u.debug("[Worker Messenger] Service worker received message:",e.data),s=0,a=n;s<a.length;s++)c=a[s],c.onceListenerOnly&&r.push(c),o.push(c);for(l=r.length-1;l>=0;l--)c=r[l],this.replies.deleteListenerRecord(t.command,c);for(d=0,f=o;d<f.length;d++)c=f[d],c.callback.apply(null,[t.payload]);return[2]})})},e.prototype.onPageMessageReceivedFromServiceWorker=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,r,o,s,a,c,l,c,d,f,c;return i.__generator(this,function(i){for(t=e.data,n=this.replies.findListenersForMessage(t.command),r=[],o=[],u.debug("[Worker Messenger] Page received message:",e.data),s=0,a=n;s<a.length;s++)c=a[s],c.onceListenerOnly&&r.push(c),o.push(c);for(l=r.length-1;l>=0;l--)c=r[l],this.replies.deleteListenerRecord(t.command,c);for(d=0,f=o;d<f.length;d++)c=f[d],c.callback.apply(null,[t.payload]);return[2]})})},e.prototype.on=function(e,t){this.replies.addListener(e,t,!1)},e.prototype.once=function(e,t){this.replies.addListener(e,t,!0)},e.prototype.off=function(e){e?this.replies.deleteListenerRecords(e):this.replies.deleteAllListenerRecords()},e.prototype.isWorkerControllingPage=function(){return i.__awaiter(this,void 0,void 0,function(){var e,t;return i.__generator(this,function(n){switch(n.label){case 0:return e=o.default.getWindowEnv(),e!==a.WindowEnvironmentKind.ServiceWorker?[3,1]:[2,!!self.registration.active];case 1:return[4,this.context.serviceWorkerManager.getActiveState()];case 2:return t=n.sent(),[2,t===s.ServiceWorkerActiveState.WorkerA||t===s.ServiceWorkerActiveState.WorkerB]}})})},e.prototype.waitUntilWorkerControlsPage=function(){return i.__awaiter(this,void 0,void 0,function(){var e=this;return i.__generator(this,function(t){return[2,new Promise(function(t){return i.__awaiter(e,void 0,void 0,function(){var e,n=this;return i.__generator(this,function(r){switch(r.label){case 0:return[4,this.isWorkerControllingPage()];case 1:return r.sent()?t():(e=o.default.getWindowEnv(),e===a.WindowEnvironmentKind.ServiceWorker?self.addEventListener("activate",function(e){return i.__awaiter(n,void 0,void 0,function(){return i.__generator(this,function(e){switch(e.label){case 0:return[4,this.isWorkerControllingPage()];case 1:return e.sent()&&t(),[2]}})})}):navigator.serviceWorker.addEventListener("controllerchange",function(e){return i.__awaiter(n,void 0,void 0,function(){return i.__generator(this,function(e){switch(e.label){case 0:return[4,this.isWorkerControllingPage()];case 1:return e.sent()&&t(),[2]}})})})),[2]}})})})]})})},e}();t.WorkerMessenger=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.Development="Development",e.Staging="Staging",e.Production="Production"}(t.BuildEnvironmentKind||(t.BuildEnvironmentKind={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(12),r=function(){function e(){this.metrics={enable:!1,mixpanelReportingToken:""}}return e.prototype.serialize=function(){return{appId:this.appId.serialize(),subdomain:this.subdomain,httpUseOneSignalCom:this.httpUseOneSignalCom,cookieSyncEnabled:this.cookieSyncEnabled,safariWebId:this.safariWebId,vapidPublicKey:this.vapidPublicKey,userConfig:this.userConfig}},e.deserialize=function(t){var n=new e;return n.appId=i.Uuid.deserialize(t.appId),n.subdomain=t.subdomain,n.httpUseOneSignalCom=t.httpUseOneSignalCom,n.cookieSyncEnabled=t.cookieSyncEnabled,n.safariWebId=t.safariWebId,n.vapidPublicKey=t.vapidPublicKey,n.userConfig=t.userConfig,n},e}();t.AppConfig=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(12),r=function(){function e(){}return e.prototype.serialize=function(){return{deviceId:this.deviceId.serialize(),subscriptionToken:this.subscriptionToken,optedOut:this.optedOut}},e.deserialize=function(t){var n=new e;return n.deviceId=i.Uuid.deserialize(t.deviceId),n.subscriptionToken=t.subscriptionToken,n.optedOut=t.optedOut,n},e}();t.Subscription=r},function(e,t,n){var i,r;!function(o){var s=!1;if(i=o,void 0!==(r="function"==typeof i?i.call(t,n,t,e):i)&&(e.exports=r),s=!0,e.exports=o(),s=!0,!s){var a=window.Cookies,u=window.Cookies=o();u.noConflict=function(){return window.Cookies=a,u}}}(function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var i in n)t[i]=n[i]}return t}function t(n){function i(t,r,o){var s;if("undefined"!=typeof document){if(arguments.length>1){if(o=e({path:"/"},i.defaults,o),"number"==typeof o.expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*o.expires),o.expires=a}try{s=JSON.stringify(r),/^[\{\[]/.test(s)&&(r=s)}catch(e){}return r=n.write?n.write(r,t):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)),t=t.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),t=t.replace(/[\(\)]/g,escape),document.cookie=[t,"=",r,o.expires?"; expires="+o.expires.toUTCString():"",o.path?"; path="+o.path:"",o.domain?"; domain="+o.domain:"",o.secure?"; secure":""].join("")}t||(s={});for(var u=document.cookie?document.cookie.split("; "):[],c=/(%[0-9A-Z]{2})+/g,l=0;l<u.length;l++){var d=u[l].split("="),f=d.slice(1).join("=");'"'===f.charAt(0)&&(f=f.slice(1,-1));try{var p=d[0].replace(c,decodeURIComponent);if(f=n.read?n.read(f,p):n(f,p)||f.replace(c,decodeURIComponent),this.json)try{f=JSON.parse(f)}catch(e){}if(t===p){s=f;break}t||(s[p]=f)}catch(e){}}return s}}return i.set=i,i.get=function(e){return i.call(i,e)},i.getJSON=function(){return i.apply({json:!0},[].slice.call(arguments))},i.defaults={},i.remove=function(t,n){i(t,"",e(n,{expires:-1}))},i.withConverter=t,i}return t(function(){})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(1),o=n(8),s=n(5),a=n(3),u=n(29),c=function(e){function t(t,n,i,r,o,s,a,u,c){void 0===s&&(s="shown"),void 0===a&&(a="active"),void 0===u&&(u=["opacity","transform"]);var l=e.call(this,t,n,i,s,u)||this;return l.selector=t,l.showClass=n,l.hideClass=i,l.activeClass=r,l.inactiveClass=o,l.state=s,l.activeState=a,l.targetTransitionEvents=u,l.nestedContentSelector=c,l}return i.__extends(t,e),t.prototype.activate=function(){var e=this;return this.inactive&&this.shown?new Promise(function(n){if(e.activeState="activating",s.default.trigger(t.EVENTS.ACTIVATING,e),e.inactiveClass&&a.removeCssClass(e.element,e.inactiveClass),e.activeClass&&a.addCssClass(e.element,e.activeClass),!e.shown)return r.debug("Ending activate() transition (alternative)."),e.activeState="active",s.default.trigger(t.EVENTS.ACTIVE,e),n(e);if(0==e.targetTransitionEvents.length)return n(e);var i=setTimeout(function(){r.debug("Element did not completely activate (state: "+e.state+", activeState: "+e.activeState+").")},e.transitionCheckTimeout);a.once(e.element,"transitionend",function(r,o){if(r.target===e.element&&a.contains(e.targetTransitionEvents,r.propertyName))return clearTimeout(i),o(),e.activeState="active",s.default.trigger(t.EVENTS.ACTIVE,e),n(e)},!0)}):Promise.resolve(this)},t.prototype.inactivate=function(){var e=this;return this.active?new Promise(function(n){if(e.activeState="inactivating",s.default.trigger(t.EVENTS.INACTIVATING,e),e.activeClass&&a.removeCssClass(e.element,e.activeClass),e.inactiveClass&&a.addCssClass(e.element,e.inactiveClass),!e.shown)return e.activeState="inactive",s.default.trigger(t.EVENTS.INACTIVE,e),n(e);if(0==e.targetTransitionEvents.length)return n(e);var i=setTimeout(function(){r.debug("Element did not completely inactivate (state: "+e.state+", activeState: "+e.activeState+").")},e.transitionCheckTimeout);a.once(e.element,"transitionend",function(r,o){if(r.target===e.element&&a.contains(e.targetTransitionEvents,r.propertyName))return clearTimeout(i),o(),e.activeState="inactive",s.default.trigger(t.EVENTS.INACTIVE,e),n(e)},!0)}):Promise.resolve(this)},t.prototype.waitUntilActive=function(){var e=this;return this.active?Promise.resolve(this):new Promise(function(n){OneSignal.once(t.EVENTS.ACTIVE,function(t){if(t===e)return n(e)},!0)})},t.prototype.waitUntilInactive=function(){var e=this;return this.inactive?Promise.resolve(this):new Promise(function(n){OneSignal.once(t.EVENTS.INACTIVE,function(t){if(t===e)return n(e)},!0)})},Object.defineProperty(t,"EVENTS",{get:function(){return o({},u.default.EVENTS,{ACTIVATING:"activeAnimatedElementActivating",ACTIVE:"activeAnimatedElementActive",INACTIVATING:"activeAnimatedElementInactivating",INACTIVE:"activeAnimatedElementInactive"})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activating",{get:function(){return"activating"===this.activeState},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return"active"===this.activeState},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inactivating",{get:function(){return"inactivating"===this.activeState},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inactive",{get:function(){return"inactive"===this.activeState},enumerable:!0,configurable:!0}),t}(u.default);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),r=n(1),o=n(5),s=function(){function e(e,t,n,i,r,o,s){void 0===i&&(i="shown"),void 0===r&&(r=["opacity","transform"]),void 0===s&&(s=500),this.selector=e,this.showClass=t,this.hideClass=n,this.state=i,this.targetTransitionEvents=r,this.nestedContentSelector=o,this.transitionCheckTimeout=s}return e.prototype.show=function(){var t=this;return this.hidden?new Promise(function(n){if(t.state="showing",o.default.trigger(e.EVENTS.SHOWING,t),t.hideClass&&i.removeCssClass(t.element,t.hideClass),t.showClass&&i.addCssClass(t.element,t.showClass),0==t.targetTransitionEvents.length)return n(t);var s=setTimeout(function(){r.debug("Element did not completely show (state: "+t.state+").")},t.transitionCheckTimeout);i.once(t.element,"transitionend",function(r,a){if(r.target===t.element&&i.contains(t.targetTransitionEvents,r.propertyName))return clearTimeout(s),a(),t.state="shown",o.default.trigger(e.EVENTS.SHOWN,t),n(t)},!0)}):Promise.resolve(this)},e.prototype.hide=function(){var t=this;return this.shown?new Promise(function(n){if(t.state="hiding",o.default.trigger(e.EVENTS.HIDING,t),t.showClass&&i.removeCssClass(t.element,t.showClass),t.hideClass&&i.addCssClass(t.element,t.hideClass),0==t.targetTransitionEvents.length)return n(t);i.once(t.element,"transitionend",function(s,a){var u=setTimeout(function(){r.debug("Element did not completely hide (state: "+t.state+").")},t.transitionCheckTimeout);if(s.target===t.element&&i.contains(t.targetTransitionEvents,s.propertyName))return clearTimeout(u),a(),t.state="hidden",o.default.trigger(e.EVENTS.HIDDEN,t),n(t)},!0)}):Promise.resolve(this)},e.prototype.waitUntilShown=function(){var t=this;return"shown"===this.state?Promise.resolve(this):new Promise(function(n){OneSignal.once(e.EVENTS.SHOWN,function(e){if(e===t)return n(t)},!0)})},e.prototype.waitUntilHidden=function(){var t=this;return"hidden"===this.state?Promise.resolve(this):new Promise(function(n){OneSignal.once(e.EVENTS.HIDDEN,function(e){if(e===t)return n(t)},!0)})},Object.defineProperty(e,"EVENTS",{get:function(){return{SHOWING:"animatedElementShowing",SHOWN:"animatedElementShown",HIDING:"animatedElementHiding",HIDDEN:"animatedElementHidden"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"content",{get:function(){return this.nestedContentSelector?this.element.querySelector(this.nestedContentSelector).innerHTML:this.element.innerHTML},set:function(e){this.nestedContentSelector?this.element.querySelector(this.nestedContentSelector).innerHTML=e:this.element.innerHTML=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return document.querySelector(this.selector)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showing",{get:function(){return"showing"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shown",{get:function(){return"shown"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hiding",{get:function(){return"hiding"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return"hidden"===this.state},enumerable:!0,configurable:!0}),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n(0),o=n(1),s=n(6),a=n(16),u=n(23),c=n(42),l=n(26),d=n(3),f=n(10),p=n(13);!function(e){e.WorkerA="Worker A (Main)",e.WorkerB="Worker B (Updater)",e.ThirdParty="3rd Party",e.Installing="Installing",e.None="None",e.Bypassed="Bypassed",e.Indeterminate="Indeterminate"}(i=t.ServiceWorkerActiveState||(t.ServiceWorkerActiveState={}));var g=function(){function e(e,t){this.context=e,this.config=t}return e.prototype.getActiveState=function(){return r.__awaiter(this,void 0,void 0,function(){var e,t,n;return r.__generator(this,function(r){switch(r.label){case 0:return"undefined"!=typeof OneSignal&&OneSignal.subscriptionHelper.isUsingSubscriptionWorkaround()?[2,i.Indeterminate]:[4,navigator.serviceWorker.getRegistration()];case 1:return(e=r.sent())?e.installing?[2,i.Installing]:e.active?(t=new URL(e.active.scriptURL).pathname,n=new c.default(t).getFileName()==this.config.workerAPath.getFileName()?i.WorkerA:new c.default(t).getFileName()==this.config.workerBPath.getFileName()?i.WorkerB:i.ThirdParty,navigator.serviceWorker.controller||n!==i.WorkerA&&n!==i.WorkerB?[2,n]:[2,i.Bypassed]):[2,i.ThirdParty]:[2,i.None]}})})},e.prototype.getWorkerVersion=function(){return r.__awaiter(this,void 0,void 0,function(){var e,t=this;return r.__generator(this,function(n){switch(n.label){case 0:return[4,this.getActiveState()];case 1:return e=n.sent(),[2,new Promise(function(e){return r.__awaiter(t,void 0,void 0,function(){return r.__generator(this,function(t){return f.default.isUsingSubscriptionWorkaround()?e(NaN):(this.context.workerMessenger.once(u.WorkerMessengerCommand.WorkerVersion,function(t){e(t)}),this.context.workerMessenger.unicast(u.WorkerMessengerCommand.WorkerVersion)),[2]})})})]}})})},e.prototype.shouldInstallWorker=function(){return r.__awaiter(this,void 0,void 0,function(){var e;return r.__generator(this,function(t){switch(t.label){case 0:return[4,this.getActiveState()];case 1:return e=t.sent(),e!==i.WorkerA&&e!==i.WorkerB?[2,!0]:[2,!1]}})})},e.prototype.subscribeForPushNotifications=function(){return r.__awaiter(this,void 0,void 0,function(){var e,t=this;return r.__generator(this,function(n){switch(n.label){case 0:return[4,this.getActiveState()];case 1:if((e=n.sent())!==i.WorkerA&&e!==i.WorkerB)throw new a.InvalidStateError(a.InvalidStateReason.ServiceWorkerNotActivated);return[2,new Promise(function(e){t.context.workerMessenger.once(u.WorkerMessengerCommand.Subscribe,function(t){e(l.Subscription.deserialize(t))}),t.context.workerMessenger.unicast(u.WorkerMessengerCommand.Subscribe,t.context.appConfig.serialize())})]}})})},e.prototype.updateWorker=function(){return r.__awaiter(this,void 0,void 0,function(){var e,t,n;return r.__generator(this,function(r){switch(r.label){case 0:return s.default.supportsServiceWorkers()?[4,this.getActiveState()]:[2];case 1:e=r.sent(),o.info("[Service Worker Update] Checking service worker version..."),r.label=2;case 2:return r.trys.push([2,4,,5]),[4,d.timeoutPromise(this.getWorkerVersion(),2e3)];case 3:return t=r.sent(),[3,5];case 4:return n=r.sent(),o.info("[Service Worker Update] Worker did not reply to version query; assuming older version."),t=1,[3,5];case 5:return e!==i.WorkerA&&e!==i.WorkerB?(o.debug("[Service Worker Update] Not updating service worker, current active worker state is "+e+"."),[2]):(t!==s.default.version()?(o.info("[Service Worker Update] Updating service worker from v"+t+" --\x3e v"+s.default.version()+"."),this.installWorker()):o.info("[Service Worker Update] Service worker version is current at v"+t+" (no update required)."),[2])}})})},e.prototype.installWorker=function(){return r.__awaiter(this,void 0,void 0,function(){var e,t=this;return r.__generator(this,function(n){switch(n.label){case 0:return s.default.supportsServiceWorkers()?[4,this.getActiveState()]:[2];case 1:return e=n.sent(),[4,this.installAlternatingWorker()];case 2:return n.sent(),[4,new Promise(function(n){return r.__awaiter(t,void 0,void 0,function(){var t,o=this;return r.__generator(this,function(s){switch(s.label){case 0:return[4,this.getActiveState()];case 1:return t=s.sent(),e!==t&&t!==i.Installing?n():navigator.serviceWorker.addEventListener("controllerchange",function(t){return r.__awaiter(o,void 0,void 0,function(){var t;return r.__generator(this,function(r){switch(r.label){case 0:return[4,this.getActiveState()];case 1:return t=r.sent(),t!==e&&t!==i.Installing&&n(),[2]}})})}),[2]}})})})];case 3:return n.sent(),[4,this.getActiveState()];case 4:return n.sent()!==i.WorkerB?[3,6]:[4,this.installAlternatingWorker()];case 5:n.sent(),n.label=6;case 6:return p.default.establishServiceWorkerChannel(),[2]}})})},e.prototype.installAlternatingWorker=function(){return r.__awaiter(this,void 0,void 0,function(){var e,t,n,s,u,c;return r.__generator(this,function(r){switch(r.label){case 0:return[4,this.getActiveState()];case 1:return e=r.sent(),e!==i.ThirdParty?[3,4]:[4,navigator.serviceWorker.getRegistration()];case 2:return t=r.sent(),[4,t.unregister()];case 3:r.sent(),r.label=4;case 4:if(e===i.WorkerA)n=this.config.workerBPath.getPathWithoutFileName(),s=this.config.workerBPath.getFileName();else if(e===i.WorkerB||e===i.ThirdParty||e===i.None)n=this.config.workerAPath.getPathWithoutFileName(),s=this.config.workerAPath.getFileName();else if(e===i.Bypassed)throw new a.InvalidStateError(a.InvalidStateReason.UnsupportedEnvironment);return c={appId:this.context.appConfig.appId.toString()},u=n+"/"+s+"?"+d.encodeHashAsUriComponent(c),o.info("[Service Worker Installation] Installing service worker "+u+"."),[4,navigator.serviceWorker.register(u,this.config.registrationOptions)];case 5:return r.sent(),o.debug("[Service Worker Installation] Service worker installed."),[2]}})})},e}();t.ServiceWorkerManager=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n(0),o=n(7);!function(e){e[e.InvalidAppId=0]="InvalidAppId",e[e.AppNotConfiguredForWebPush=1]="AppNotConfiguredForWebPush",e[e.MissingSubdomain=2]="MissingSubdomain",e[e.MultipleInitialization=3]="MultipleInitialization",e[e.MissingSafariWebId=4]="MissingSafariWebId",e[e.Unknown=5]="Unknown"}(i=t.SdkInitErrorKind||(t.SdkInitErrorKind={}));var SdkInitError=function(e){function SdkInitError(t){var n=this;switch(t){case i.InvalidAppId:n=e.call(this,"OneSignal: This app ID does match any existing app. Double check your app ID.")||this;break;case i.AppNotConfiguredForWebPush:n=e.call(this,"OneSignal: This app ID does not have any web platforms enabled. Double check your app ID, or see step 1 on our setup guide (https://goo.gl/01h7fZ).")||this;break;case i.MissingSubdomain:n=e.call(this,"OneSignal: Non-HTTPS pages require a subdomain of OneSignal to be chosen on your dashboard. See step 1.4 on our setup guide (https://goo.gl/xip6JB).")||this;break;case i.MultipleInitialization:n=e.call(this,"OneSignal: The OneSignal web SDK can only be initialized once. Extra initializations are ignored. Please remove calls initializing the SDK more than once.")||this;break;case i.MissingSafariWebId:n=e.call(this,"OneSignal: Safari browser support on Mac OS X requires the Safari web platform to be enabled. Please see the Safari Support steps in our web setup guide.")||this;break;case i.Unknown:n=e.call(this,"OneSignal: An unknown initialization error occurred.")||this}return n.reason=i[t],n}return r.__extends(SdkInitError,e),SdkInitError}(o.default);t.SdkInitError=SdkInitError},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(9),o=n(1),s=n(8),a=n(46),u=n(16),c=n(47),l=n(5),d=n(21),f=n(20),p=n(2),g=n(4),h=n(73),v=n(11),m=n(3),b=n(15),S=n(13),w=n(10),_=n(31),y=n(19),O=n(12),E=n(49),P=n(33),I=n(14),C=function(){function e(){}return e.storeInitialValues=function(){return Promise.all([OneSignal.isPushNotificationsEnabled(),OneSignal.getNotificationPermission(),OneSignal.isOptedOut()]).then(function(e){var t=e[0],n=e[1],i=e[2];return d.default.put("subscription.optedOut",i),Promise.all([v.default.put("Options",{key:"isPushEnabled",value:t}),v.default.put("Options",{key:"notificationPermission",value:n})])})},e.onSdkInitialized=function(){return i.__awaiter(this,void 0,void 0,function(){var t,n,s,a,u;return i.__generator(this,function(i){switch(i.label){case 0:return e.storeInitialValues(),e.installNativePromptPermissionChangedHook(),t=OneSignal.context,[4,OneSignal.getNotificationPermission()];case 1:return i.sent()===f.NotificationPermission.Granted&&(OneSignal.__doNotShowWelcomeNotification=!0),n=navigator.serviceWorker&&"https:"===window.location.protocol,n?[4,w.default.hasInsecureParentOrigin()]:[3,3];case 2:n=!i.sent(),i.label=3;case 3:return n&&navigator.serviceWorker.getRegistration().then(function(e){e&&e.active&&S.default.establishServiceWorkerChannel()}).catch(function(e){9===e.code?"http:"!==location.protocol&&p.default.getWindowEnv()!==g.WindowEnvironmentKind.OneSignalProxyFrame||o.debug("Expected error getting service worker registration on "+location.href+":",e):o.error("Error getting Service Worker registration on "+location.href+":",e)}),(S.default.showNotifyButton(),r.safari&&!1===OneSignal.config.userConfig.autoRegister&&OneSignal.isPushNotificationsEnabled(function(t){t&&e.sessionInit({__sdkCall:!0})}),w.default.isUsingSubscriptionWorkaround()&&t.sessionManager.isFirstPageView())?(o.debug("("+p.default.getWindowEnv().toString()+") Updating session info for HTTP site."),[4,OneSignal.isPushNotificationsEnabled()]):[3,6];case 4:return(s=i.sent())?(a=OneSignal.context,[4,v.default.getSubscription()]):[3,6];case 5:u=i.sent().deviceId,y.default.updateUserSession(u,new P.PushRegistration),i.label=6;case 6:return OneSignal.context.cookieSyncer.install(),[2]}})})},e.installNativePromptPermissionChangedHook=function(){!navigator.permissions||r.firefox&&Number(r.version)<=45||(OneSignal._usingNativePermissionHook=!0,navigator.permissions.query({name:"notifications"}).then(function(e){e.onchange=function(){b.default.triggerNotificationPermissionChanged()}}))},e.saveInitOptions=function(){var e=[];!1===OneSignal.config.userConfig.persistNotification?e.push(v.default.put("Options",{key:"persistNotification",value:!1})):!0===OneSignal.config.userConfig.persistNotification?e.push(v.default.put("Options",{key:"persistNotification",value:"force"})):e.push(v.default.put("Options",{key:"persistNotification",value:!0}));var t=OneSignal.config.userConfig.webhooks;return["notification.displayed","notification.clicked","notification.dismissed"].forEach(function(n){t&&t[n]?e.push(v.default.put("Options",{key:"webhooks."+n,value:t[n]})):e.push(v.default.put("Options",{key:"webhooks."+n,value:!1}))}),t&&t.cors?e.push(v.default.put("Options",{key:"webhooks.cors",value:!0})):e.push(v.default.put("Options",{key:"webhooks.cors",value:!1})),OneSignal.config.userConfig.notificationClickHandlerMatch?e.push(v.default.put("Options",{key:"notificationClickHandlerMatch",value:OneSignal.config.userConfig.notificationClickHandlerMatch})):e.push(v.default.put("Options",{key:"notificationClickHandlerMatch",value:"exact"})),OneSignal.config.userConfig.notificationClickHandlerAction?e.push(v.default.put("Options",{key:"notificationClickHandlerAction",value:OneSignal.config.userConfig.notificationClickHandlerAction})):e.push(v.default.put("Options",{key:"notificationClickHandlerAction",value:"navigate"})),Promise.all(e)},e.internalInit=function(){return i.__awaiter(this,void 0,void 0,function(){var t,n;return i.__generator(this,function(i){switch(i.label){case 0:return o.debug("Called %cinternalInit()",m.getConsoleStyle("code")),(t=OneSignal.context,t.serviceWorkerManager.updateWorker(),t.sessionManager.incrementPageViewCount(),!sessionStorage.getItem("ONE_SIGNAL_SESSION")||w.default.isUsingSubscriptionWorkaround()||"denied"!=window.Notification.permission&&sessionStorage.getItem("ONE_SIGNAL_NOTIFICATION_PERMISSION")!=window.Notification.permission)?(sessionStorage.setItem("ONE_SIGNAL_NOTIFICATION_PERMISSION",window.Notification.permission),r.safari&&!1===OneSignal.config.userConfig.autoRegister?(o.debug("On Safari and autoregister is false, skipping sessionInit()."),w.default.isUsingSubscriptionWorkaround()||l.default.trigger(OneSignal.EVENTS.SDK_INITIALIZED),[2]):!1!==OneSignal.config.userConfig.autoRegister||OneSignal.config.subdomain?[3,2]:(o.debug("Skipping internal init. Not auto-registering and no subdomain."),l.default.trigger(OneSignal.EVENTS.SDK_INITIALIZED),[4,OneSignal.isPushNotificationsEnabled()])):(l.default.trigger(OneSignal.EVENTS.SDK_INITIALIZED),[2]);case 1:return n=i.sent(),n&&!w.default.isUsingSubscriptionWorkaround()&&(o.info("Because the user is already subscribed and has enabled notifications, we will re-register their GCM token."),w.default.registerForPush()),[2];case 2:return"visible"!==document.visibilityState?(m.once(document,"visibilitychange",function(t,n){"visible"===document.visibilityState&&(n(),e.sessionInit({__sdkCall:!0}))},!0),[2]):(e.sessionInit({__sdkCall:!0}),[2])}})})},e.initSaveState=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n;return i.__generator(this,function(i){switch(i.label){case 0:return[4,S.default.getAppId()];case 1:return t=i.sent(),[4,v.default.put("Ids",{type:"appId",id:t.value})];case 2:return i.sent(),n=e||document.title||"Notification",[4,v.default.put("Options",{key:"pageTitle",value:n})];case 3:return i.sent(),o.info("OneSignal: Set pageTitle to be '"+n+"'."),[2]}})})},e.sessionInit=function(e){var t=OneSignal.context.appConfig;if(o.debug("Called %csessionInit("+JSON.stringify(e)+")",m.getConsoleStyle("code")),OneSignal._sessionInitAlreadyRunning)return void o.debug("Returning from sessionInit because it has already been called.");OneSignal._sessionInitAlreadyRunning=!0,e.modalPrompt&&e.fromRegisterFor?(OneSignal.subscriptionModalHost=new h.default(t.appId,e),OneSignal.subscriptionModalHost.load()):w.default.isUsingSubscriptionWorkaround()?(!0!==OneSignal.config.userConfig.autoRegister&&o.debug("OneSignal: Not automatically showing popover because autoRegister is not specifically true."),S.default.isHttpPromptAlreadyShown()&&o.debug("OneSignal: Not automatically showing popover because it was previously shown in the same session."),!0!==OneSignal.config.userConfig.autoRegister||S.default.isHttpPromptAlreadyShown()||OneSignal.showHttpPrompt().catch(function(e){e instanceof u.InvalidStateError&&e.reason===u.InvalidStateReason[u.InvalidStateReason.RedundantPermissionMessage]||e instanceof c.default||e instanceof a.default||e instanceof I.default?o.debug("[Prompt Not Showing]",e):o.info(e)}),OneSignal._sessionInitAlreadyRunning=!1):e.__sdkCall&&S.default.wasHttpsNativePromptDismissed()?(o.debug("OneSignal: Not automatically showing native HTTPS prompt because the user previously dismissed it."),OneSignal._sessionInitAlreadyRunning=!1):w.default.registerForPush(),l.default.trigger(OneSignal.EVENTS.SDK_INITIALIZED)},e.ponyfillSafariFetch=function(){return i.__awaiter(this,void 0,void 0,function(){var e;return i.__generator(this,function(t){switch(t.label){case 0:if(!r.safari||void 0!==window.fetch)return[3,4];o.debug("Loading fetch polyfill for Safari.."),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,(new E.DynamicResourceLoader).loadFetchPolyfill()];case 2:return t.sent(),o.debug("Done loading fetch polyfill."),[3,4];case 3:return e=t.sent(),o.debug("Error loading fetch polyfill:",e),[3,4];case 4:return[2]}})})},e.errorIfInitAlreadyCalled=function(){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(e){if(OneSignal._initCalled)throw new _.SdkInitError(_.SdkInitErrorKind.MultipleInitialization);return OneSignal._initCalled=!0,[2]})})},e.downloadAndMergeAppConfig=function(t){return i.__awaiter(this,void 0,void 0,function(){var n,r,o;return i.__generator(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,y.default.getAppConfig(new O.Uuid(t.appId))];case 1:return n=i.sent(),r=e.getMergedUserServerAppConfig(t,n),[2,r];case 2:if(o=i.sent()){if(1===o.code)throw new _.SdkInitError(_.SdkInitErrorKind.InvalidAppId);if(2===o.code)throw new _.SdkInitError(_.SdkInitErrorKind.AppNotConfiguredForWebPush)}throw o;case 3:return[2]}})})},e.getMergedUserServerAppConfig=function(t,n){var i=s({},n);return i.appId=new O.Uuid(t.appId),i.userConfig=s({},t),i.userConfig.serviceWorkerParam="undefined"!=typeof OneSignal&&OneSignal.SERVICE_WORKER_PARAM?OneSignal.SERVICE_WORKER_PARAM:{scope:"/"},i.userConfig.serviceWorkerPath="undefined"!=typeof OneSignal&&OneSignal.SERVICE_WORKER_PATH?OneSignal.SERVICE_WORKER_PATH:"OneSignalSDKWorker.js",i.userConfig.serviceWorkerUpdaterPath="undefined"!=typeof OneSignal&&OneSignal.SERVICE_WORKER_UPDATER_PATH?OneSignal.SERVICE_WORKER_UPDATER_PATH:"OneSignalSDUpdaterKWorker.js",i.userConfig.path=t.path?t.path:"/",i.subdomain&&!e.shouldUseServerConfigSubdomain(i)&&delete i.subdomain,i},e.shouldUseServerConfigSubdomain=function(e){switch(window.location.protocol){case"https:":return e&&e.userConfig&&!!e.userConfig.subdomainName;case"http:":return!0;default:return!1}},e}();t.default=C},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(9),r=n(6),o=n(50),s=n(74),a=function(){function e(){this.language=r.default.getLanguage(),this.timezone=-60*(new Date).getTimezoneOffset(),this.browserName=i.name,this.browserVersion=NaN!==parseInt(String(i.version))?parseInt(String(i.version)):-1,this.operatingSystem=this.getBrowserOperatingSystem(),this.operatingSystemVersion=String(i.osversion),this.devicePlatform=this.getDevicePlatformKind(),this.deviceModel=navigator.platform,this.sdkVersion=r.default.version().toString()}return e.prototype.getDevicePlatformKind=function(){var e=i.mobile,t=i.tablet;return e?s.DevicePlatformKind.Mobile:t?s.DevicePlatformKind.Tablet:s.DevicePlatformKind.Desktop},e.prototype.getBrowserOperatingSystem=function(){return i.mac?"Mac OS X":i.windows?"Microsoft Windows":i.windowsphone?"Microsoft Windows Phone":i.linux?"Linux":i.chromeos?"Google Chrome OS":i.android?"Google Android":i.ios?"Apple iOS":i.blackberry?"Blackberry":i.firefoxos?"Mozilla Firefox OS":i.webos?"WebOS":i.tizen?"Tizen":i.sailfish?"Sailfish OS":"Unknown"},e.prototype.serialize=function(){var e={device_type:this.deliveryPlatform,language:this.language,timezone:this.timezone,device_os:this.browserVersion,sdk:this.sdkVersion,notification_types:this.subscriptionState,delivery_platform:this.deliveryPlatform,browser_name:this.browserName,browser_version:this.browserVersion,operating_system:this.operatingSystem,operating_system_version:this.operatingSystemVersion,device_platform:this.devicePlatform,device_model:this.deviceModel};return this.appId&&(e.app_id=this.appId.value),this.subscription&&(e.identifier=i.safari?this.subscription.safariDeviceToken:this.subscription.w3cEndpoint.toString(),e.web_auth=this.subscription.w3cAuth,e.web_p256=this.subscription.w3cP256dh),e},e.prototype.deserialize=function(e){throw new o.default},e}();t.PushRegistration=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(8),o=n(10),s=n(12),a=n(35),u=n(32),c=function(){function e(e){this.options={appId:new s.Uuid(e.appId),subdomain:e.subdomainName,origin:e.origin,serialize:void 0,metrics:{enable:!1,mixpanelReportingToken:null}}}return e.prototype.initialize=function(){return i.__awaiter(this,void 0,void 0,function(){var e,t,n,o=this;return i.__generator(this,function(i){switch(i.label){case 0:return(e=window.opener||window.parent)==window?(document.write("<span style='font-size: 14px; color: red; font-family: sans-serif;'>OneSignal: This page cannot be directly opened, and must be opened as a result of a subscription call.</span>"),[2,Promise.resolve()]):(t=r(this.options),t.appId=t.appId.value,t.origin=t.origin,OneSignal.config=t||{},[4,u.default.downloadAndMergeAppConfig(t)]);case 1:return n=i.sent(),OneSignal.context=new a.default(n),OneSignal.context.workerMessenger.listen(!0),OneSignal.initialized=!0,this.loadPromise={},this.loadPromise.promise=new Promise(function(e,t){o.loadPromise.resolver=e,o.loadPromise.rejector=t}),this.establishCrossOriginMessaging(),[2,this.loadPromise.promise]}})})},e.prototype.establishCrossOriginMessaging=function(){},e.prototype.dispose=function(){this.messenger.destroy()},e.prototype.finishInitialization=function(){this.loadPromise.resolver()},e.prototype.subscribe=function(){return i.__awaiter(this,void 0,void 0,function(){var e,t;return i.__generator(this,function(n){switch(n.label){case 0:return[4,OneSignal.isPushNotificationsEnabled()];case 1:return e=n.sent(),t=opener||parent,e?t&&window.close():o.default.registerForPush(),[2]}})})},e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(23),r=n(30),o=n(75),s=n(49),a=n(79),u=n(42),c=n(2),l=n(80),d=n(81),f=n(54),p=function(){function e(e){this.appConfig=e,this.cookieSyncer=new a.default(e.cookieSyncEnabled),this.subscriptionManager=new o.SubscriptionManager(this,{safariWebId:e.safariWebId,appId:e.appId,vapidPublicKey:e.vapidPublicKey,onesignalVapidPublicKey:e.onesignalVapidPublicKey});var t={workerAPath:new u.default("/"+c.default.getBuildEnvPrefix()+"OneSignalSDKWorker.js"),workerBPath:new u.default("/"+c.default.getBuildEnvPrefix()+"OneSignalSDKUpdaterWorker.js"),registrationOptions:{scope:"/"}};e.userConfig&&(e.userConfig.path&&(t.workerAPath=new u.default(e.userConfig.path+c.default.getBuildEnvPrefix()+e.userConfig.serviceWorkerPath),t.workerBPath=new u.default(e.userConfig.path+c.default.getBuildEnvPrefix()+e.userConfig.serviceWorkerUpdaterPath)),e.userConfig.serviceWorkerParam&&(t.registrationOptions=e.userConfig.serviceWorkerParam)),this.serviceWorkerManager=new r.ServiceWorkerManager(this,t),this.workerMessenger=new i.WorkerMessenger(this),this.dynamicResourceLoader=new s.DynamicResourceLoader,this.sessionManager=new l.SessionManager,this.permissionManager=new d.default,this.metricsManager=new f.default(e.metrics.enable,e.metrics.mixpanelReportingToken)}return e}();t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.None="None",e.UnitTesting="Unit Testing"}(t.TestEnvironmentKind||(t.TestEnvironmentKind={}))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this._events={}}return e.prototype.on=function(e,t){return this._events[e]=this._events[e]||[],this._events[e].push(t),this},e.prototype.once=function(e,t){function n(){i.off(e,n),t.apply(this,arguments)}var i=this;return n.listener=t,this.on(e,n),this},e.prototype.off=function(e,t){var n=this._events[e];if(void 0!==n){for(var i=0;i<n.length;i+=1)if(n[i]===t||n[i].listener===t){n.splice(i,1);break}0===n.length&&this.removeAllListeners(e)}return this},e.prototype.removeAllListeners=function(e){try{delete this._events[e]}catch(e){}return this},e.prototype.listeners=function(e){try{return this._events[e]}catch(e){return}},e.prototype.emit=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[].slice.call(arguments,0),i=n.shift(),r=this._events[i];if(void 0!==r){r=r.slice(0);for(var o=r.length,s=0;s<o;s+=1)r[s].apply(this,n)}return this},e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(1),o=n(38),s=n(3),a=function(){function e(e){this.databaseName=e,this.emitter=new o.default}return e.prototype.open=function(e){var t=this;return new Promise(function(n){try{var i=indexedDB.open(e,1)}catch(e){}i.onerror=t.onDatabaseOpenError,i.onblocked=t.onDatabaseOpenBlocked,i.onupgradeneeded=t.onDatabaseUpgradeNeeded,i.onsuccess=function(){t.database=i.result,t.database.onerror=t.onDatabaseError,t.database.onversionchange=t.onDatabaseVersionChange,n(t.database)}})},e.prototype.ensureDatabaseOpen=function(){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(e){switch(e.label){case 0:return this.openLock||(this.openLock=this.open(this.databaseName)),[4,this.openLock];case 1:return e.sent(),[2,this.database]}})})},e.prototype.onDatabaseOpenError=function(e){e.preventDefault();var t=e.target.error;s.contains(t.message,"The operation failed for reasons unrelated to the database itself and not covered by any other error code")||s.contains(t.message,"A mutation operation was attempted on a database that did not allow mutations")?r.warn("OneSignal: IndexedDb web storage is not available on this origin since this profile's IndexedDb schema has been upgraded in a newer version of Firefox. See: https://bugzilla.mozilla.org/show_bug.cgi?id=1236557#c6"):r.warn("OneSignal: Fatal error opening IndexedDb database:",t)},e.prototype.onDatabaseError=function(e){r.debug("IndexedDb: Generic database error",e.target.errorCode)},e.prototype.onDatabaseOpenBlocked=function(){r.debug("IndexedDb: Blocked event")},e.prototype.onDatabaseVersionChange=function(e){r.debug("IndexedDb: versionchange event")},e.prototype.onDatabaseUpgradeNeeded=function(e){r.debug("IndexedDb: Database is being rebuilt or upgraded (upgradeneeded event).");var t=e.target.result;t.createObjectStore("Ids",{keyPath:"type"}),t.createObjectStore("NotificationOpened",{keyPath:"url"}),t.createObjectStore("Options",{keyPath:"key"}),"undefined"!=typeof OneSignal&&(OneSignal._isNewVisitor=!0)},e.prototype.get=function(e,t){return i.__awaiter(this,void 0,void 0,function(){var n=this;return i.__generator(this,function(i){switch(i.label){case 0:return[4,this.ensureDatabaseOpen()];case 1:return i.sent(),t?[4,new Promise(function(i,r){var o=n.database.transaction(e).objectStore(e).get(t);o.onsuccess=function(){i(o.result)},o.onerror=function(){r(o.error)}})]:[3,3];case 2:return[2,i.sent()];case 3:return[4,new Promise(function(t,i){var r={},o=n.database.transaction(e).objectStore(e).openCursor();o.onsuccess=function(e){var n=e.target.result;if(n){var i=n.key;r[i]=n.value,n.continue()}else t(r)},o.onerror=function(){i(o.error)}})];case 4:return[2,i.sent()]}})})},e.prototype.put=function(e,t){return i.__awaiter(this,void 0,void 0,function(){var n=this;return i.__generator(this,function(i){switch(i.label){case 0:return[4,this.ensureDatabaseOpen()];case 1:return i.sent(),[4,new Promise(function(i,o){try{var s=n.database.transaction([e],"readwrite").objectStore(e).put(t);s.onsuccess=function(){i(t)},s.onerror=function(e){r.error("Database PUT Transaction Error:",e),o(e)}}catch(e){r.error("Database PUT Error:",e),o(e)}})];case 2:return[2,i.sent()]}})})},e.prototype.remove=function(e,t){var n=this;if(t)var i="delete";else var i="clear";return new Promise(function(o,s){try{var a=n.database.transaction([e],"readwrite").objectStore(e)[i](t);a.onsuccess=function(){o(t)},a.onerror=function(e){r.error("Database REMOVE Transaction Error:",e),s(e)}}catch(e){r.error("Database REMOVE Error:",e),s(e)}})},e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(1),o=n(3),s=n(29),a=n(22),u=function(e){function t(t){var n=e.call(this,".onesignal-bell-launcher-message","onesignal-bell-launcher-message-opened",null,"hidden",["opacity","transform"],".onesignal-bell-launcher-message-body")||this;return n.bell=t,n.contentType="",n.queued=[],n}return i.__extends(t,e),Object.defineProperty(t,"TIMEOUT",{get:function(){return 2500},enumerable:!0,configurable:!0}),Object.defineProperty(t,"TYPES",{get:function(){return{TIP:"tip",MESSAGE:"message",QUEUED:"queued"}},enumerable:!0,configurable:!0}),t.prototype.display=function(e,t,n){var i=this;return void 0===n&&(n=0),r.debug("Calling %cdisplay("+e+", "+t+", "+n+").",o.getConsoleStyle("code")),(this.shown?this.hide():o.nothing()).then(function(){i.content=o.decodeHtmlEntities(t),i.contentType=e}).then(function(){return i.show()}).then(function(){return o.delay(n)}).then(function(){return i.hide()}).then(function(){i.content=i.getTipForState(),i.contentType="tip"})},t.prototype.getTipForState=function(){return this.bell.state===a.default.STATES.UNSUBSCRIBED?this.bell.text["tip.state.unsubscribed"]:this.bell.state===a.default.STATES.SUBSCRIBED?this.bell.text["tip.state.subscribed"]:this.bell.state===a.default.STATES.BLOCKED?this.bell.text["tip.state.blocked"]:void 0},t.prototype.enqueue=function(e){var t=this;return this.queued.push(o.decodeHtmlEntities(e)),new Promise(function(e){t.bell.badge.shown?t.bell.badge.hide().then(function(){return t.bell.badge.increment()}).then(function(){return t.bell.badge.show()}).then(e):(t.bell.badge.increment(),t.bell.initialized?t.bell.badge.show().then(e):e())})},t.prototype.dequeue=function(e){var t=this,n=this.queued.pop(e);return new Promise(function(e){t.bell.badge.shown?t.bell.badge.hide().then(function(){return t.bell.badge.decrement()}).then(function(e){return e>0?t.bell.badge.show():Promise.resolve(t)}).then(e(n)):(t.bell.badge.decrement(),e(n))})},t}(s.default);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e[e.HttpsPermissionRequest="HTTPS permission request"]="HttpsPermissionRequest",e[e.FullscreenHttpPermissionMessage="fullscreen HTTP permission message"]="FullscreenHttpPermissionMessage",e[e.FullscreenHttpsPermissionMessage="fullscreen HTTPS permission message"]="FullscreenHttpsPermissionMessage",e[e.SlidedownPermissionMessage="slidedown permission message"]="SlidedownPermissionMessage",e[e.SubscriptionBell="subscription bell"]="SubscriptionBell"}(t.PermissionPromptType||(t.PermissionPromptType={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),r=function(){function e(e){if(!e)throw new i.InvalidArgumentError("path",i.InvalidArgumentReason.Empty);this.path=e.trim()}return e.prototype.getQueryString=function(){var e=this.path.indexOf("?");return-1===e?null:this.path.length>e?this.path.substring(e+1):null},e.prototype.getWithoutQueryString=function(){return this.path.split(e.QUERY_STRING)[0]},e.prototype.getFileName=function(){return this.getWithoutQueryString().split("\\").pop().split("/").pop()},e.prototype.getFileNameWithQuery=function(){return this.path.split("\\").pop().split("/").pop()},e.prototype.getFullPath=function(){return this.path},e.prototype.getPathWithoutFileName=function(){var e=this.getWithoutQueryString(),t=e.lastIndexOf(this.getFileName()),n=e.substring(0,t);return n=n.replace(/[\\\/]$/,"")},e.QUERY_STRING="?",e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(9),o=n(44),s=n(27),a=n(1),u=n(8),c=n(45),l=n(6),d=n(46),f=n(18),p=n(16),g=n(70),h=n(47),v=n(14),m=n(14),b=n(31),S=n(5),w=n(15),_=n(71),y=n(32),O=n(13),E=n(10),P=n(51),I=n(21),C=n(84),N=n(48),T=n(2),A=n(30),M=n(35),k=n(20),R=n(41),x=n(4),D=n(86),W=n(19),U=n(87),L=n(88),B=n(11),F=n(39),j=n(3),H=n(89),V=n(33),K=n(90),G=function(){function e(){}return e.setDefaultNotificationUrl=function(e){return i.__awaiter(this,void 0,void 0,function(){var t;return i.__generator(this,function(n){switch(n.label){case 0:if(!H.ValidatorUtils.isValidUrl(e,{allowNull:!0}))throw new f.InvalidArgumentError("url",f.InvalidArgumentReason.Malformed);return[4,j.awaitOneSignalInitAndSupported()];case 1:return n.sent(),j.logMethodCall("setDefaultNotificationUrl",e),[4,B.default.getAppState()];case 2:return t=n.sent(),t.defaultNotificationUrl=e,[4,B.default.setAppState(t)];case 3:return n.sent(),[2]}})})},e.setDefaultTitle=function(e){return i.__awaiter(this,void 0,void 0,function(){var t;return i.__generator(this,function(n){switch(n.label){case 0:return[4,j.awaitOneSignalInitAndSupported()];case 1:return n.sent(),j.logMethodCall("setDefaultTitle",e),[4,B.default.getAppState()];case 2:return t=n.sent(),t.defaultNotificationTitle=e,[4,B.default.setAppState(t)];case 3:return n.sent(),[2]}})})},e.syncHashedEmail=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,r,o;return i.__generator(this,function(i){switch(i.label){case 0:if(!e)throw new f.InvalidArgumentError("email",f.InvalidArgumentReason.Empty);if(t=j.prepareEmailForHashing(e),!j.isValidEmail(t))throw new f.InvalidArgumentError("email",f.InvalidArgumentReason.Malformed);return[4,j.awaitOneSignalInitAndSupported()];case 1:return i.sent(),j.logMethodCall("syncHashedEmail",e),[4,B.default.getAppConfig()];case 2:return n=i.sent().appId,[4,B.default.getSubscription()];case 3:if(!(r=i.sent().deviceId)||!r.value)throw new g.NotSubscribedError(g.NotSubscribedReason.NoDeviceId);return[4,W.default.updatePlayer(n,r,{em_m:L.default.md5(t),em_s:L.default.sha1(t),em_s256:L.default.sha256(t)})];case 4:if((o=i.sent())&&o.success)return[2,!0];throw o}})})},e.isPushNotificationsSupported=function(){return j.logMethodCall("isPushNotificationsSupported"),!0},e.init=function(t){return i.__awaiter(this,void 0,void 0,function(){function n(){return i.__awaiter(this,void 0,void 0,function(){var t;return i.__generator(this,function(n){switch(n.label){case 0:if(e.__initAlreadyCalled)return[2];if(e.__initAlreadyCalled=!0,O.default.fixWordpressManifestIfMisplaced(),e.on(e.EVENTS.NATIVE_PROMPT_PERMISSIONCHANGED,w.default.onNotificationPermissionChange),e.on(e.EVENTS.SUBSCRIPTION_CHANGED,w.default._onSubscriptionChanged),e.on(e.EVENTS.SDK_INITIALIZED,y.default.onSdkInitialized),!E.default.isUsingSubscriptionWorkaround())return[3,2];if(e.appConfig=o,!o.subdomain)throw new b.SdkInitError(b.SdkInitErrorKind.MissingSubdomain);return t=e,[4,C.default.discoverAltOrigin(o)];case 1:t.proxyFrameHost=n.sent(),n.label=2;case 2:return window.addEventListener("focus",function(){O.default.checkAndTriggerNotificationPermissionChanged()}),y.default.initSaveState(document.title).then(function(){return y.default.saveInitOptions()}).then(function(){T.default.getWindowEnv()===x.WindowEnvironmentKind.CustomIframe?S.default.trigger(e.EVENTS.SDK_INITIALIZED):y.default.internalInit()}),[2]}})})}var o;return i.__generator(this,function(i){switch(i.label){case 0:return j.logMethodCall("init"),y.default.ponyfillSafariFetch(),y.default.errorIfInitAlreadyCalled(),[4,y.default.downloadAndMergeAppConfig(t)];case 1:return o=i.sent(),(a.debug("OneSignal: Final web app config: %c"+JSON.stringify(o,null,4),j.getConsoleStyle("code")),e.context=new M.default(o),e.config=e.context.appConfig,e.context.workerMessenger.listen(),r.safari&&!e.config.safariWebId)?(a.warn(new b.SdkInitError(b.SdkInitErrorKind.MissingSafariWebId)),[2]):("complete"===document.readyState||"interactive"===document.readyState?n():(a.debug("OneSignal: Waiting for DOMContentLoaded or readyStateChange event before continuing initialization..."),window.addEventListener("DOMContentLoaded",function(){n()}),document.onreadystatechange=function(){"complete"!==document.readyState&&"interactive"!==document.readyState||n()}),[2])}})})},e.showHttpPermissionRequest=function(t){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(t){return a.debug("Called showHttpPermissionRequest(), redirecting to HTTP prompt."),e.showHttpPrompt().catch(function(e){return a.info(e)}),[2]})})},e.showHttpPrompt=function(t){return i.__awaiter(this,void 0,void 0,function(){var n,r,o,s,u;return i.__generator(this,function(i){switch(i.label){case 0:return t||(t={}),[4,j.awaitOneSignalInitAndSupported()];case 1:if(i.sent(),e.__isPopoverShowing)throw new p.InvalidStateError(p.InvalidStateReason.RedundantPermissionMessage,{permissionPromptType:R.PermissionPromptType.SlidedownPermissionMessage});return[4,e.getNotificationPermission()];case 2:return n=i.sent(),[4,e.isPushNotificationsEnabled()];case 3:return r=i.sent(),[4,e.getSubscription()];case 4:return o=i.sent(),[4,O.default.wasHttpsNativePromptDismissed()];case 5:if((s=i.sent())&&!t.force)return a.info(new h.default),[2];if(n===k.NotificationPermission.Denied)return a.info(new v.default(m.PushPermissionNotGrantedErrorReason.Blocked)),[2];if(r)throw new d.default;if(!o)throw new g.NotSubscribedError(g.NotSubscribedReason.OptedOut);return O.default.markHttpPopoverShown(),[4,e.context.dynamicResourceLoader.loadSdkStylesheet()];case 6:return 0!==(u=i.sent())?(a.debug("Not showing slidedown permission message because styles failed to load."),[2]):(e.popover=new U.default(e.config.userConfig.promptOptions),e.popover.create(),a.debug("Showing the HTTP popover."),e.notifyButton&&e.notifyButton.options.enable&&"hidden"!==e.notifyButton.launcher.state&&e.notifyButton.launcher.waitUntilShown().then(function(){e.notifyButton.launcher.hide()}),e.once(U.default.EVENTS.SHOWN,function(){e.__isPopoverShowing=!0}),e.once(U.default.EVENTS.CLOSED,function(){e.__isPopoverShowing=!1,e.notifyButton&&e.notifyButton.options.enable&&e.notifyButton.launcher.show()}),e.once(U.default.EVENTS.ALLOW_CLICK,function(){e.popover.close(),a.debug("Setting flag to not show the popover to the user again."),P.default.markHttpsNativePromptDismissed(),e.registerForPushNotifications({autoAccept:!0})}),e.once(U.default.EVENTS.CANCEL_CLICK,function(){a.debug("Setting flag to not show the popover to the user again."),P.default.markHttpsNativePromptDismissed()}),[2])}})})},e.registerForPushNotifications=function(t){function n(){if(t&&t.httpPermissionRequest&&E.default.isUsingSubscriptionWorkaround())return void a.error(new K.DeprecatedApiError(K.DeprecatedApiReason.HttpPermissionRequest));E.default.isUsingSubscriptionWorkaround()?(e.subscriptionPopupHost=new D.default(e.proxyFrameHost.url,t),e.subscriptionPopupHost.load()):(t||(t={}),t.fromRegisterFor=!0,y.default.sessionInit(t))}if(e.initialized)return n();e.once(e.EVENTS.SDK_INITIALIZED,function(){return n()})},e.getNotificationPermission=function(t){return i.__awaiter(this,void 0,void 0,function(){var n;return i.__generator(this,function(i){switch(i.label){case 0:return[4,j.awaitOneSignalInitAndSupported()];case 1:return i.sent(),[4,e.context.permissionManager.getNotificationPermission(e.config.safariWebId)];case 2:return n=i.sent(),t&&t(n),[2,n]}})})},e.getTags=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,r;return i.__generator(this,function(i){switch(i.label){case 0:return[4,j.awaitOneSignalInitAndSupported()];case 1:return i.sent(),j.logMethodCall("getTags",e),[4,B.default.getAppConfig()];case 2:return t=i.sent().appId,[4,B.default.getSubscription()];case 3:return n=i.sent().deviceId,n&&n.value?[4,W.default.getPlayer(t,n)]:(a.info(new g.NotSubscribedError(g.NotSubscribedReason.NoDeviceId)),[2,null]);case 4:return r=i.sent().tags,j.executeCallback(e,r),[2,r]}})})},e.sendTag=function(t,n,r){return i.__awaiter(this,void 0,void 0,function(){var o;return i.__generator(this,function(i){switch(i.label){case 0:return o={},o[t]=n,[4,e.sendTags(o,r)];case 1:return[2,i.sent()]}})})},e.sendTags=function(t,n){return i.__awaiter(this,void 0,void 0,function(){var r,o,s;return i.__generator(this,function(i){switch(i.label){case 0:return[4,j.awaitOneSignalInitAndSupported()];case 1:return i.sent(),(j.logMethodCall("sendTags",t,n),t&&0!==Object.keys(t).length)?(Object.keys(t).forEach(function(e){!1===t[e]&&(t[e]="false")}),[4,B.default.getAppConfig()]):(a.info(new f.InvalidArgumentError("tags",f.InvalidArgumentReason.Empty)),[2,null]);case 2:return r=i.sent().appId,[4,B.default.getSubscription()];case 3:return o=i.sent().deviceId,o&&o.value?[3,5]:[4,j.awaitSdkEvent(e.EVENTS.REGISTERED)];case 4:i.sent(),i.label=5;case 5:return[4,B.default.getSubscription()];case 6:return s=i.sent().deviceId,[4,W.default.updatePlayer(r,s,{tags:t})];case 7:return i.sent(),j.executeCallback(n,t),[2,t]}})})},e.deleteTag=function(t){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(n){switch(n.label){case 0:return[4,e.deleteTags([t])];case 1:return[2,n.sent()]}})})},e.deleteTags=function(t,n){return i.__awaiter(this,void 0,void 0,function(){var r,o,s,u,c,l;return i.__generator(this,function(i){switch(i.label){case 0:return[4,j.awaitOneSignalInitAndSupported()];case 1:if(i.sent(),j.logMethodCall("deleteTags",t,n),!H.ValidatorUtils.isValidArray(t))throw new f.InvalidArgumentError("tags",f.InvalidArgumentReason.Malformed);for(0===t.length&&a.info(new f.InvalidArgumentError("tags",f.InvalidArgumentReason.Empty)),r={},o=0,s=t;o<s.length;o++)u=s[o],r[u]="";return[4,e.sendTags(r)];case 2:return c=i.sent(),l=Object.keys(c),j.executeCallback(n,l),[2,l]}})})},e.addListenerForNotificationOpened=function(t){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(n){switch(n.label){case 0:return[4,j.awaitOneSignalInitAndSupported()];case 1:return n.sent(),j.logMethodCall("addListenerForNotificationOpened",t),e.once(e.EVENTS.NOTIFICATION_CLICKED,function(e){j.executeCallback(t,e)}),w.default.fireStoredNotificationClicks(e.config.pageUrl||e.config.userConfig.pageUrl),[2]}})})},e.getIdsAvailable=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,r,o;return i.__generator(this,function(i){switch(i.label){case 0:return[4,j.awaitOneSignalInitAndSupported()];case 1:return i.sent(),j.logMethodCall("getIdsAvailable",e),[4,B.default.getSubscription()];case 2:return t=i.sent(),n=t.deviceId,r=t.subscriptionToken,o={userId:n.value,registrationId:r},j.executeCallback(e,o),[2,o]}})})},e.isPushNotificationsEnabled=function(t){return i.__awaiter(this,void 0,void 0,function(){var n,r,o,s,a,u,c,d,f,p,g;return i.__generator(this,function(i){switch(i.label){case 0:return[4,j.awaitOneSignalInitAndSupported()];case 1:return i.sent(),j.logMethodCall("isPushNotificationsEnabled",t),[4,E.default.hasInsecureParentOrigin()];case 2:return n=i.sent(),[4,B.default.getSubscription()];case 3:return r=i.sent(),o=r.deviceId,s=r.subscriptionToken,a=r.optedOut,[4,e.getNotificationPermission()];case 4:return u=i.sent(),c=!1,!l.default.supportsServiceWorkers()||E.default.isUsingSubscriptionWorkaround()||T.default.getWindowEnv()===x.WindowEnvironmentKind.OneSignalProxyFrame||n?[3,9]:[4,e.context.serviceWorkerManager.getActiveState()];case 5:return d=i.sent(),f=d===A.ServiceWorkerActiveState.WorkerA||d===A.ServiceWorkerActiveState.WorkerB,c=!(!o||!s||u!==k.NotificationPermission.Granted||a||!f),[4,navigator.serviceWorker.getRegistration()];case 6:return p=i.sent(),p?[4,p.pushManager.getSubscription()]:[3,8];case 7:g=i.sent(),g||(c=!1),i.label=8;case 8:return[3,10];case 9:c=!(!o||!s||u!==k.NotificationPermission.Granted||a),i.label=10;case 10:return j.executeCallback(t,c),[2,c]}})})},e.setSubscription=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,r,o;return i.__generator(this,function(i){switch(i.label){case 0:return[4,j.awaitOneSignalInitAndSupported()];case 1:return i.sent(),j.logMethodCall("setSubscription",e),[4,B.default.getAppConfig()];case 2:return t=i.sent(),n=t.appId,[4,B.default.getSubscription()];case 3:if(r=i.sent(),o=r.deviceId,!t.appId)throw new p.InvalidStateError(p.InvalidStateReason.MissingAppId);if(!H.ValidatorUtils.isValidBoolean(e))throw new f.InvalidArgumentError("newSubscription",f.InvalidArgumentReason.Malformed);return o&&o.value?(r.optedOut=!e,[4,W.default.updatePlayer(n,o,{notification_types:O.default.getNotificationTypeFromOptIn(e)})]):(a.info(new g.NotSubscribedError(g.NotSubscribedReason.NoDeviceId)),[2]);case 4:return i.sent(),[4,B.default.setSubscription(r)];case 5:return i.sent(),w.default.onInternalSubscriptionSet(r.optedOut),w.default.checkAndTriggerSubscriptionChanged(),[2]}})})},e.isOptedOut=function(e){return i.__awaiter(this,void 0,void 0,function(){var t;return i.__generator(this,function(n){switch(n.label){case 0:return[4,j.awaitOneSignalInitAndSupported()];case 1:return n.sent(),j.logMethodCall("isOptedOut",e),[4,B.default.getSubscription()];case 2:return t=n.sent().optedOut,j.executeCallback(e,t),[2,t]}})})},e.optOut=function(t,n){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(i){switch(i.label){case 0:return[4,j.awaitOneSignalInitAndSupported()];case 1:if(i.sent(),j.logMethodCall("optOut",t,n),!H.ValidatorUtils.isValidBoolean(t))throw new f.InvalidArgumentError("doOptOut",f.InvalidArgumentReason.Malformed);return[4,e.setSubscription(!t)];case 2:return i.sent(),j.executeCallback(n),[2]}})})},e.getUserId=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n;return i.__generator(this,function(i){switch(i.label){case 0:return[4,j.awaitOneSignalInitAndSupported()];case 1:return i.sent(),j.logMethodCall("getUserId",e),[4,B.default.getSubscription()];case 2:return t=i.sent(),n=t.deviceId,j.executeCallback(e,n.value),[2,n.value]}})})},e.getRegistrationId=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n;return i.__generator(this,function(i){switch(i.label){case 0:return[4,j.awaitOneSignalInitAndSupported()];case 1:return i.sent(),j.logMethodCall("getRegistrationId",e),[4,B.default.getSubscription()];case 2:return t=i.sent(),n=t.subscriptionToken,j.executeCallback(e,n),[2,n]}})})},e.getSubscription=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n;return i.__generator(this,function(i){switch(i.label){case 0:return[4,j.awaitOneSignalInitAndSupported()];case 1:return i.sent(),j.logMethodCall("getSubscription",e),[4,B.default.getSubscription()];case 2:return t=i.sent(),n=!t.optedOut,j.executeCallback(e,n),[2,n]}})})},e.sendSelfNotification=function(t,n,r,o,s,a){return void 0===t&&(t="OneSignal Test Message"),void 0===n&&(n="This is an example notification."),void 0===r&&(r=new URL(location.href).origin+"?_osp=do_not_open"),i.__awaiter(this,void 0,void 0,function(){var u,c;return i.__generator(this,function(i){switch(i.label){case 0:return[4,j.awaitOneSignalInitAndSupported()];case 1:return i.sent(),j.logMethodCall("sendSelfNotification",t,n,r,o,s,a),[4,B.default.getAppConfig()];case 2:return u=i.sent(),[4,B.default.getSubscription()];case 3:if(c=i.sent(),!u.appId)throw new p.InvalidStateError(p.InvalidStateReason.MissingAppId);return[4,e.isPushNotificationsEnabled()];case 4:if(!i.sent())throw new g.NotSubscribedError(g.NotSubscribedReason.NoDeviceId);if(!H.ValidatorUtils.isValidUrl(r))throw new f.InvalidArgumentError("url",f.InvalidArgumentReason.Malformed);if(!H.ValidatorUtils.isValidUrl(o,{allowEmpty:!0,requireHttps:!0}))throw new f.InvalidArgumentError("icon",f.InvalidArgumentReason.Malformed);return[4,W.default.sendNotification(u.appId,[c.deviceId],{en:t},{en:n},r,o,s,a)];case 5:return[2,i.sent()]}})})},e.push=function(t){if("function"==typeof t)t();else{e[t.shift()].apply(null,t)}},e.on=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.off=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.once=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.VERSION=l.default.version(),e._VERSION=l.default.version(),e.sdkEnvironment=T.default,e._notificationOpenedCallbacks=[],e._idsAvailable_callback=[],e._defaultLaunchURL=null,e.config=null,e.__isPopoverShowing=!1,e._sessionInitAlreadyRunning=!1,e._isNotificationEnabledCallback=[],e._subscriptionSet=!0,e.modalUrl=null,e._windowWidth=650,e._windowHeight=568,e._isNewVisitor=!1,e._channel=null,e.cookie=s,e.initialized=!1,e.notifyButton=null,e.store=I.default,e.environment=l.default,e.database=B.default,e.event=S.default,e.browser=r,e.popover=null,e.log=a,e.api=W.default,e.indexedDb=F.default,e.mainHelper=O.default,e.subscriptionHelper=E.default,e.httpHelper=_.default,e.eventHelper=w.default,e.initHelper=y.default,e.testHelper=P.default,e.objectAssign=u,e.appConfig=null,e.SERVICE_WORKER_UPDATER_PATH="OneSignalSDKUpdaterWorker.js",e.SERVICE_WORKER_PATH="OneSignalSDKWorker.js",e.SERVICE_WORKER_PARAM={scope:"/"},e._LOGGING=!1,e.LOGGING=!1,e._usingNativePermissionHook=!1,e._initCalled=!1,e.__initAlreadyCalled=!1,e.checkAndWipeUserSubscription=function(){},e.crypto=L.default,e.PushRegistration=V.PushRegistration,e.notificationPermission=k.NotificationPermission,e._initHttp=_.default.initHttp,e._initPopup=function(){return e.subscriptionPopup.subscribe()},e.POSTMAM_COMMANDS={CONNECTED:"connect",REMOTE_NOTIFICATION_PERMISSION:"postmam.remoteNotificationPermission",REMOTE_DATABASE_GET:"postmam.remoteDatabaseGet",REMOTE_DATABASE_PUT:"postmam.remoteDatabasePut",REMOTE_DATABASE_REMOVE:"postmam.remoteDatabaseRemove",REMOTE_OPERATION_COMPLETE:"postman.operationComplete",REMOTE_RETRIGGER_EVENT:"postmam.remoteRetriggerEvent",MODAL_LOADED:"postmam.modalPrompt.loaded",MODAL_PROMPT_ACCEPTED:"postmam.modalPrompt.accepted",MODAL_PROMPT_REJECTED:"postmam.modalPrompt.canceled",POPUP_LOADED:"postmam.popup.loaded",POPUP_ACCEPTED:"postmam.popup.accepted",POPUP_REJECTED:"postmam.popup.canceled",POPUP_CLOSING:"postman.popup.closing",REMOTE_NOTIFICATION_PERMISSION_CHANGED:"postmam.remoteNotificationPermissionChanged",IFRAME_POPUP_INITIALIZE:"postmam.iframePopupInitialize",UNSUBSCRIBE_FROM_PUSH:"postmam.unsubscribeFromPush",SET_SESSION_COUNT:"postmam.setSessionCount",REQUEST_HOST_URL:"postmam.requestHostUrl",WINDOW_TIMEOUT:"postmam.windowTimeout",FINISH_REMOTE_REGISTRATION:"postmam.finishRemoteRegistration",FINISH_REMOTE_REGISTRATION_IN_PROGRESS:"postmam.finishRemoteRegistrationInProgress",POPUP_BEGIN_MESSAGEPORT_COMMS:"postmam.beginMessagePortComms",SERVICEWORKER_COMMAND_REDIRECT:"postmam.command.redirect",MARK_PROMPT_DISMISSED:"postmam.markPromptDismissed",IS_SUBSCRIBED:"postmam.isSubscribed",UNSUBSCRIBE_PROXY_FRAME:"postman.unsubscribeProxyFrame",GET_EVENT_LISTENER_COUNT:"postmam.getEventListenerCount"},e.EVENTS={CUSTOM_PROMPT_CLICKED:"customPromptClick",NATIVE_PROMPT_PERMISSIONCHANGED:"notificationPermissionChange",SUBSCRIPTION_CHANGED:"subscriptionChange",WELCOME_NOTIFICATION_SENT:"sendWelcomeNotification",NOTIFICATION_DISPLAYED:"notificationDisplay",NOTIFICATION_DISMISSED:"notificationDismiss",NOTIFICATION_CLICKED:"notificationClick",SDK_INITIALIZED:"initialize",REGISTERED:"register",POPUP_CLOSING:"popupClose",PERMISSION_PROMPT_DISPLAYED:"permissionPromptDisplay",TEST_INIT_OPTION_DISABLED:"testInitOptionDisabled",TEST_WOULD_DISPLAY:"testWouldDisplay",POPUP_WINDOW_TIMEOUT:"popupWindowTimeout"},e.NOTIFICATION_TYPES={SUBSCRIBED:1,UNSUBSCRIBED:-2},e}();t.default=G,Object.defineProperty(G,"LOGGING",{get:function(){return G._LOGGING},set:function(e){e?(a.setDefaultLevel(a.levels.TRACE),G._LOGGING=!0):(a.setDefaultLevel(a.levels.WARN),G._LOGGING=!1)},enumerable:!0,configurable:!0}),o.merge(G,new c),G.LOGGING?a.setDefaultLevel(a.levels.TRACE):a.setDefaultLevel(a.levels.WARN),N.default.ensureBackwardsCompatibility(G),a.info("%cOneSignal Web SDK loaded (version "+G._VERSION+", "+T.default.getWindowEnv().toString()+" environment).",j.getConsoleStyle("bold")),a.debug("Current Page URL: "+("undefined"==typeof location?"NodeJS":location.href)),a.debug("Browser Environment: "+r.name+" "+r.version)},function(e,t,n){var i,r;!function(o,s,a){i=a,void 0!==(r="function"==typeof i?i.call(t,n,t,e):i)&&(e.exports=r)}(0,0,function(){"use strict";var e={inherit:function(t,n,i){(t.prototype=e.createObject(n.prototype)).constructor=t,(i||void 0===i)&&(t._super=n.prototype)},createObject:Object.create||function(e){var t=function(){};return t.prototype=e,new t},mixin:function(t,n){return e.merge(t.prototype,n)},merge:function(e,t){var n;for(n in t)e[n]=t[n]},hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}};return e})},function(e,t,n){var i;!function(t){"use strict";function r(){}function o(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function s(e){return function(){return this[e].apply(this,arguments)}}function a(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&a(e.listener)}var u=r.prototype,c=t.EventEmitter;u.getListeners=function(e){var t,n,i=this._getEvents();if(e instanceof RegExp){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},u.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},u.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},u.addListener=function(e,t){if(!a(t))throw new TypeError("listener must be a function");var n,i=this.getListenersAsObject(e),r="object"==typeof t;for(n in i)i.hasOwnProperty(n)&&-1===o(i[n],t)&&i[n].push(r?t:{listener:t,once:!1});return this},u.on=s("addListener"),u.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},u.once=s("addOnceListener"),u.defineEvent=function(e){return this.getListeners(e),this},u.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},u.removeListener=function(e,t){var n,i,r=this.getListenersAsObject(e);for(i in r)r.hasOwnProperty(i)&&-1!==(n=o(r[i],t))&&r[i].splice(n,1);return this},u.off=s("removeListener"),u.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},u.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},u.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},u.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if(e instanceof RegExp)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},u.removeAllListeners=s("removeEvent"),u.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(o in s)if(s.hasOwnProperty(o))for(n=s[o].slice(0),r=0;r<n.length;r++)i=n[r],!0===i.once&&this.removeListener(e,i.listener),i.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,i.listener);return this},u.trigger=s("emitEvent"),u.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},u.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},u._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},u._getEvents=function(){return this._events||(this._events={})},r.noConflict=function(){return t.EventEmitter=c,r},void 0!==(i=function(){return r}.call(t,n,t,e))&&(e.exports=i)}(this||{})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(7),AlreadySubscribedError=function(e){function AlreadySubscribedError(){return e.call(this,"This operation can only be performed when the user is not subscribed.")||this}return i.__extends(AlreadySubscribedError,e),AlreadySubscribedError}(r.default);t.default=AlreadySubscribedError},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(7),PermissionMessageDismissedError=function(e){function PermissionMessageDismissedError(){return e.call(this,"The permission message was previously dismissed.")||this}return i.__extends(PermissionMessageDismissedError,e),PermissionMessageDismissedError}(r.default);t.default=PermissionMessageDismissedError},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),r=n(2),o=function(){function e(){}return e.ensureBackwardsCompatibility=function(t){e.environmentPolyfill(t),e.postmams(t)},e.environmentPolyfill=function(e){e.environment={},e.environment.getEnv=function(){return""},e.environment.isPopup=function(){return r.default.getWindowEnv()===i.WindowEnvironmentKind.OneSignalSubscriptionPopup},e.environment.isIframe=function(){return r.default.getWindowEnv()===i.WindowEnvironmentKind.OneSignalProxyFrame}},e.postmams=function(e){function t(e){e.message=n,e.postMessage=i}var n=function(){this.messenger.message.apply(this.messenger,arguments)},i=function(){this.messenger.postMessage.apply(this.messenger,arguments)};e.proxyFrame&&(e.iframePostmam=e.proxyFrame,t(e.iframePostmam)),e.subscriptionPopup&&(e.popupPostmam=e.subscriptionPopup,t(e.popupPostmam)),e.subscriptionModal&&(e.modalPostmam=e.subscriptionModal,t(e.modalPostmam))},e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(8),o=n(2),s=n(6),a=function(){function e(){this.cache={}}return e.prototype.getCache=function(){return r({},this.cache)},e.prototype.loadSdkStylesheet=function(){return i.__awaiter(this,void 0,void 0,function(){var e;return i.__generator(this,function(t){switch(t.label){case 0:return e=o.default.getOneSignalApiUrl().origin,[4,this.loadIfNew(0,new URL(e+"/sdks/OneSignalSDKStyles.css?v="+s.default.getSdkStylesVersionHash()))];case 1:return[2,t.sent()]}})})},e.prototype.loadFetchPolyfill=function(){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(e){switch(e.label){case 0:return[4,this.loadIfNew(1,new URL("https://cdnjs.cloudflare.com/ajax/libs/fetch/2.0.3/fetch.min.js"))];case 1:return[2,e.sent()]}})})},e.prototype.loadIfNew=function(t,n){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(i){switch(i.label){case 0:return this.cache[n.toString()]||(this.cache[n.toString()]=e.load(t,n)),[4,this.cache[n.toString()]];case 1:return[2,i.sent()]}})})},e.load=function(e,t){return i.__awaiter(this,void 0,void 0,function(){var n;return i.__generator(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,new Promise(function(n,i){switch(e){case 1:var r=document.createElement("script");r.setAttribute("type","text/javascript"),r.setAttribute("async","async"),r.setAttribute("src",t.toString());break;case 0:var r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href",t.toString())}r.onerror=i,r.onload=n,document.querySelector("head").appendChild(r)})];case 1:return i.sent(),[2,0];case 2:return n=i.sent(),[2,1];case 3:return[2]}})})},e}();t.DynamicResourceLoader=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(7),o=function(e){function t(){return e.call(this,"This code is not implemented yet.")||this}return i.__extends(t,e),t}(r.default);t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(27),o=n(1),s=n(2),a=n(11),u=n(10),c=function(){function e(){}return e.unmarkHttpsNativePromptDismissed=function(){r.remove("onesignal-notification-prompt")?o.debug("OneSignal: Removed the native notification prompt dismissed cookie."):o.debug("OneSignal: Cookie not marked.")},e.markHttpsNativePromptDismissed=function(){return i.__awaiter(this,void 0,void 0,function(){var e,t;return i.__generator(this,function(n){switch(n.label){case 0:return u.default.isUsingSubscriptionWorkaround()?[4,new Promise(function(e,t){OneSignal.proxyFrameHost.message(OneSignal.POSTMAM_COMMANDS.MARK_PROMPT_DISMISSED,{},function(n){n.data===OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE?e():t()})})]:[3,2];case 1:n.sent(),n.label=2;case 2:return[4,a.default.get("Options","promptDismissCount")];case 3:return e=n.sent(),e||(e=0),u.default.isUsingSubscriptionWorkaround()||(e+=1),t=3,2==e?t=7:e>2&&(t=30),o.debug("("+s.default.getWindowEnv().toString()+") OneSignal: User dismissed the native notification prompt; reprompt after "+t+" days."),[4,a.default.put("Options",{key:"promptDismissCount",value:e})];case 4:return n.sent(),[2,r.set("onesignal-notification-prompt","dismissed",{expires:t})]}})})},e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n(0),o=n(7);!function(e){e[e.InvalidSafariSetup=0]="InvalidSafariSetup",e[e.Blocked=1]="Blocked",e[e.Dismissed=2]="Dismissed"}(i=t.SubscriptionErrorReason||(t.SubscriptionErrorReason={}));var s=function(e){function t(t){var n=this;switch(t){case i.InvalidSafariSetup:n=e.call(this,"The Safari site URL, icon size, or push certificate is invalid, or Safari is in a private session.")||this;break;case i.Blocked:n=e.call(this,"Notification permissions are blocked.")||this;break;case i.Dismissed:n=e.call(this,"The notification permission prompt was dismissed.")||this}return n}return r.__extends(t,e),t}(o.default);t.default=s},function(e,t,n){"use strict";function i(e){for(var t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/\-/g,"+").replace(/_/g,"/"),i=atob(n),r=new Uint8Array(i.length),o=0;o<i.length;++o)r[o]=i.charCodeAt(o);return r}function r(e){for(var t,n,i,r,o,s="",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=new Uint8Array(e),c=u.byteLength,l=c%3,d=c-l,f=0;f<d;f+=3)o=u[f]<<16|u[f+1]<<8|u[f+2],t=(16515072&o)>>18,n=(258048&o)>>12,i=(4032&o)>>6,r=63&o,s+=a[t]+a[n]+a[i]+a[r];return 1==l?(o=u[d],t=(252&o)>>2,n=(3&o)<<4,s+=a[t]+a[n]+"=="):2==l&&(o=u[d]<<8|u[d+1],t=(64512&o)>>10,n=(1008&o)>>4,i=(15&o)<<2,s+=a[t]+a[n]+a[i]+"="),s}function o(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}function s(e){return decodeURIComponent(atob(e).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}Object.defineProperty(t,"__esModule",{value:!0}),t.base64ToUint8Array=i,t.arrayBufferToBase64=r,t.base64Encode=o,t.base64Decode=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(8),o=n(53),s=n(6),a=function(){function e(){}return e.prototype.getPropertiesAsJson=function(){return{origin:location.origin,url:location.href,sdkVersion:s.default.version()}},e}();!function(e){e.HttpPermissionRequest="HttpPermissionRequest"}(t.ApiUsageMetricKind||(t.ApiUsageMetricKind={}));var u=function(e){function t(t){var n=e.call(this)||this;return n.apiName=t,n}return i.__extends(t,e),t.prototype.getEventName=function(){return"api-usage"},t.prototype.getPropertiesAsJson=function(){return r({},{api:this.apiName.toString()},e.prototype.getPropertiesAsJson.call(this))},t}(a);t.ApiUsageMetricEvent=u;var c=function(){function e(e,t){this.isFeatureEnabled=e,this.mixpanelReportingToken=t}return Object.defineProperty(e,"MIXPANEL_REPORTING_URL",{get:function(){return"https://api.mixpanel.com"},enumerable:!0,configurable:!0}),e.prototype.isEnabled=function(){return this.isFeatureEnabled&&!!this.mixpanelReportingToken},e.prototype.reportEvent=function(t){if(!this.isEnabled())return Promise.resolve(null);var n={event:t.getEventName(),properties:r({},{token:this.mixpanelReportingToken},t.getPropertiesAsJson())},i=o.base64Encode(JSON.stringify(n)),s={method:"GET",headers:new Headers,cache:"no-cache"};return fetch(e.MIXPANEL_REPORTING_URL+"/track/?data="+i,s)},e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),r=n(3),o=n(1),s=n(2),a=n(4);if(i.default.isBrowser())if(r.incrementSdkLoadCount(),r.getSdkLoadCount()>1)o.warn("OneSignal: The web push SDK is included more than once. For optimal performance, please include our SDK only once on your page."),o.debug("OneSignal: Exiting from SDK initialization to prevent double-initialization errors. Occurred "+r.getSdkLoadCount()+" times.");else{if("undefined"!=typeof OneSignal)var u=OneSignal;if(r.isPushNotificationsSupported()?window.OneSignal=n(43).default:(o.debug("OneSignal: Push notifications are not supported. A stubbed version of the SDK will be initialized."),window.OneSignal=n(91).default),u)for(var c=0;c<u.length;c++)OneSignal.push(u[c])}else s.default.getWindowEnv()===a.WindowEnvironmentKind.ServiceWorker&&(self.OneSignal=n(92).default)},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";i(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return Object.defineProperty(n,"message",{configurable:!0,enumerable:!1,value:e,writable:!0}),Object.defineProperty(n,"name",{configurable:!0,enumerable:!1,value:n.constructor.name,writable:!0}),Error.hasOwnProperty("captureStackTrace")?(Error.captureStackTrace(n,n.constructor),r(n)):(Object.defineProperty(n,"stack",{configurable:!0,enumerable:!1,value:new Error(e).stack,writable:!0}),n)}return o(t,e),t}(function(e){function t(){e.apply(this,arguments)}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error));t.default=s,e.exports=t.default},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(7),TimeoutError=function(e){function TimeoutError(t){void 0===t&&(t="The asynchronous operation has timed out.");var n=e.call(this,t)||this;return n.message=t,n}return i.__extends(TimeoutError,e),TimeoutError}(r.default);t.default=TimeoutError},function(e,t){function n(){}function i(e,t,i){function o(){a.parentNode&&a.parentNode.removeChild(a),window[l]=n,u&&clearTimeout(u)}function s(){window[l]&&o()}"function"==typeof t&&(i=t,t={}),t||(t={});var a,u,c=t.prefix||"__jp",l=t.name||c+r++,d=t.param||"callback",f=null!=t.timeout?t.timeout:6e4,p=encodeURIComponent,g=document.getElementsByTagName("script")[0]||document.head;return f&&(u=setTimeout(function(){o(),i&&i(new Error("Timeout"))},f)),window[l]=function(e){o(),i&&i(null,e)},e+=(~e.indexOf("?")?"&":"?")+d+"="+p(l),e=e.replace("?&","?"),a=document.createElement("script"),a.src=e,g.parentNode.insertBefore(a,g),s}e.exports=i;var r=0},function(e,t,n){"use strict";function i(e){var t=arguments.length<=1||void 0===arguments[1]?"all":arguments[1];(0,o.default)(e);var n=s[t];return n&&n.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=n(61),o=function(e){return e&&e.__esModule?e:{default:e}}(r),s={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};e.exports=t.default},function(e,t,n){"use strict";function i(e){if("string"!=typeof e)throw new TypeError("This library (validator.js) validates strings only")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(7),PushNotSupportedError=function(e){function PushNotSupportedError(t){return e.call(this,"'"+t+"' is not a valid UUID")||this}return i.__extends(PushNotSupportedError,e),PushNotSupportedError}(r.default);t.default=PushNotSupportedError},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n(0),o=n(7);!function(e){e[e.MissingAppId=0]="MissingAppId"}(i=t.OneSignalApiErrorKind||(t.OneSignalApiErrorKind={}));var s=function(e){function t(t){var n=this;switch(t){case i.MissingAppId:n=e.call(this,"The API call is missing an app ID.")||this}return n}return r.__extends(t,e),t}(o.default);t.OneSignalApiError=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e}();t.AppState=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e}();t.ServiceWorkerState=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(28),o=function(e){function t(){return e.call(this,".onesignal-bell-launcher-badge","onesignal-bell-launcher-badge-opened",null,"onesignal-bell-launcher-badge-active",null,"hidden")||this}return i.__extends(t,e),t.prototype.increment=function(){if(!isNaN(this.content)){var e=+this.content;e+=1,this.content=e.toString()}},t.prototype.show=function(){var t=e.prototype.show.call(this);return OneSignal.notifyButton.setCustomColorsIfSpecified(),t},t.prototype.decrement=function(){if(!isNaN(this.content)){var e=+this.content;e-=1,this.content=e>0?e.toString():""}},t}(r.default);t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(3),o=n(5),s=n(28),a=n(22),u=n(21),c=n(40),l=n(10),d=function(e){function t(t){var n=e.call(this,".onesignal-bell-launcher-button",null,null,"onesignal-bell-launcher-button-active",null,"shown","")||this;return n.bell=t,n.events={mouse:"bell.launcher.button.mouse"},n.element.addEventListener("touchstart",function(){n.onHovering(),n.onTap()},{passive:!0}),n.element.addEventListener("mouseenter",function(){n.onHovering()}),n.element.addEventListener("mouseleave",function(){n.onHovered()}),n.element.addEventListener("touchmove",function(){n.onHovered()},{passive:!0}),n.element.addEventListener("mousedown",function(){n.onTap()}),n.element.addEventListener("mouseup",function(){n.onEndTap()}),n.element.addEventListener("click",function(){n.onHovered(),n.onClick()}),n}return i.__extends(t,e),t.prototype.onHovering=function(){(u.default.isEmpty(this.events.mouse)||"out"===u.default.getLast(this.events.mouse))&&o.default.trigger(a.default.EVENTS.HOVERING),u.default.put(this.events.mouse,"over")},t.prototype.onHovered=function(){u.default.put(this.events.mouse,"out"),o.default.trigger(a.default.EVENTS.HOVERED)},t.prototype.onTap=function(){this.pulse(),this.activate(),this.bell.badge.activate()},t.prototype.onEndTap=function(){this.inactivate(),this.bell.badge.inactivate()},t.prototype.onClick=function(){var e=this;if(o.default.trigger(a.default.EVENTS.BELL_CLICK),o.default.trigger(a.default.EVENTS.LAUNCHER_CLICK),!this.bell.message.shown||this.bell.message.contentType!=c.default.TYPES.MESSAGE){var t=u.default.getLast("subscription.optedOut");return this.bell.unsubscribed?t?this.bell.launcher.activateIfInactive().then(function(){e.bell.showDialogProcedure()}):(OneSignal.registerForPushNotifications(),this.bell._ignoreSubscriptionState=!0,OneSignal.once(OneSignal.EVENTS.SUBSCRIPTION_CHANGED,function(){e.bell.message.display(c.default.TYPES.MESSAGE,e.bell.text["message.action.subscribed"],c.default.TIMEOUT).then(function(){e.bell._ignoreSubscriptionState=!1,e.bell.launcher.inactivate()})})):this.bell.subscribed?this.bell.launcher.activateIfInactive().then(function(){e.bell.showDialogProcedure()}):this.bell.blocked&&(l.default.isUsingSubscriptionWorkaround()?OneSignal.registerForPushNotifications():this.bell.launcher.activateIfInactive().then(function(){e.bell.showDialogProcedure()})),this.bell.message.hide()}},t.prototype.pulse=function(){r.removeDomElement(".pulse-ring"),r.addDomElement(this.element,"beforeend",'<div class="pulse-ring"></div>'),this.bell.setCustomColorsIfSpecified()},t}(s.default);t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(9),o=n(5),s=n(2),a=n(3),u=n(29),c=n(22),l=function(e){function t(t){var n=e.call(this,".onesignal-bell-launcher-dialog","onesignal-bell-launcher-dialog-opened",null,"hidden",["opacity","transform"],".onesignal-bell-launcher-dialog-body")||this;return n.bell=t,n.subscribeButtonId="#onesignal-bell-container .onesignal-bell-launcher #subscribe-button",n.unsubscribeButtonId="#onesignal-bell-container .onesignal-bell-launcher #unsubscribe-button",n.notificationIcons=null,n}return i.__extends(t,e),t.prototype.getPlatformNotificationIcon=function(){return this.notificationIcons?a.isChromeLikeBrowser()||r.firefox?this.notificationIcons.chrome||this.notificationIcons.safari:r.safari?this.notificationIcons.safari||this.notificationIcons.chrome:void 0:null},t.prototype.show=function(){var t=this;return this.updateBellLauncherDialogBody().then(function(){return e.prototype.show.call(t)})},Object.defineProperty(t.prototype,"subscribeButtonSelectorId",{get:function(){return"subscribe-button"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"unsubscribeButtonSelectorId",{get:function(){return"unsubscribe-button"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subscribeButton",{get:function(){return this.element.querySelector("#"+this.subscribeButtonSelectorId)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"unsubscribeButton",{get:function(){return this.element.querySelector("#"+this.unsubscribeButtonSelectorId)},enumerable:!0,configurable:!0}),t.prototype.updateBellLauncherDialogBody=function(){var e=this;return OneSignal.getSubscription().then(function(t){a.clearDomElementChildren(document.querySelector(e.nestedContentSelector));var n="Nothing to show.",i="";if(e.bell.options.showCredit&&(i='<div class="divider"></div><div class="kickback">Powered by <a href="https://onesignal.com" class="kickback" target="_blank">OneSignal</a></div>'),e.bell.state===c.default.STATES.SUBSCRIBED&&!0===t||e.bell.state===c.default.STATES.UNSUBSCRIBED&&!1===t){var u="",l=e.getPlatformNotificationIcon();u=l?'<div class="push-notification-icon"><img src="'+l+'"></div>':'<div class="push-notification-icon push-notification-icon-default"></div>';var d="";d=e.bell.state!==c.default.STATES.SUBSCRIBED?'<button type="button" class="action" id="'+e.subscribeButtonSelectorId+'">'+e.bell.text["dialog.main.button.subscribe"]+"</button>":'<button type="button" class="action" id="'+e.unsubscribeButtonSelectorId+'">'+e.bell.text["dialog.main.button.unsubscribe"]+"</button>",n="<h1>"+e.bell.text["dialog.main.title"]+'</h1><div class="divider"></div><div class="push-notification">'+u+'<div class="push-notification-text-container"><div class="push-notification-text push-notification-text-short"></div><div class="push-notification-text"></div><div class="push-notification-text push-notification-text-medium"></div><div class="push-notification-text"></div><div class="push-notification-text push-notification-text-medium"></div></div></div><div class="action-container">'+d+"</div>"+i}else if(e.bell.state===c.default.STATES.BLOCKED){var l=null;r.chrome?r.mobile||r.tablet||(l=s.default.getOneSignalApiUrl().origin+"/bell/chrome-unblock.jpg"):r.firefox?l=s.default.getOneSignalApiUrl().origin+"/bell/firefox-unblock.jpg":r.safari&&(l=s.default.getOneSignalApiUrl().origin+"/bell/safari-unblock.jpg");var f="";l&&(f='<a href="'+l+'" target="_blank"><img src="'+l+'"></a></div>'),(r.mobile||r.tablet)&&r.chrome&&(f="<ol><li>Access <strong>Settings</strong> by tapping the three menu dots <strong>⋮</strong></li><li>Click <strong>Site settings</strong> under Advanced.</li><li>Click <strong>Notifications</strong>.</li><li>Find and click this entry for this website.</li><li>Click <strong>Notifications</strong> and set it to <strong>Allow</strong>.</li></ol>"),n="<h1>"+e.bell.text["dialog.blocked.title"]+'</h1><div class="divider"></div><div class="instructions"><p>'+e.bell.text["dialog.blocked.message"]+"</p>"+f+"</div>"+i}a.addDomElement(document.querySelector(e.nestedContentSelector),"beforeend",n),e.subscribeButton&&e.subscribeButton.addEventListener("click",function(){OneSignal.__doNotShowWelcomeNotification=!1,o.default.trigger(c.default.EVENTS.SUBSCRIBE_CLICK)}),e.unsubscribeButton&&e.unsubscribeButton.addEventListener("click",function(){return o.default.trigger(c.default.EVENTS.UNSUBSCRIBE_CLICK)}),e.bell.setCustomColorsIfSpecified()})},t}(u.default);t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(1),o=n(16),s=n(3),a=n(28),u=function(e){function t(t){var n=e.call(this,".onesignal-bell-launcher","onesignal-bell-launcher-active",null,null,"onesignal-bell-launcher-inactive","hidden","active")||this;return n.bell=t,n.wasInactive=!1,n}return i.__extends(t,e),t.prototype.resize=function(e){return i.__awaiter(this,void 0,void 0,function(){var t=this;return i.__generator(this,function(n){switch(n.label){case 0:if(!this.element)throw new o.InvalidStateError(o.InvalidStateReason.MissingDomElement);if("small"===e&&s.hasCssClass(this.element,"onesignal-bell-launcher-sm")||"medium"===e&&s.hasCssClass(this.element,"onesignal-bell-launcher-md")||"large"===e&&s.hasCssClass(this.element,"onesignal-bell-launcher-lg"))return[2,Promise.resolve(this)];if(s.removeCssClass(this.element,"onesignal-bell-launcher-sm"),s.removeCssClass(this.element,"onesignal-bell-launcher-md"),s.removeCssClass(this.element,"onesignal-bell-launcher-lg"),"small"===e)s.addCssClass(this.element,"onesignal-bell-launcher-sm");else if("medium"===e)s.addCssClass(this.element,"onesignal-bell-launcher-md");else{if("large"!==e)throw new Error("Invalid OneSignal bell size "+e);s.addCssClass(this.element,"onesignal-bell-launcher-lg")}return this.shown?[3,1]:[2,this];case 1:return[4,new Promise(function(e){if(0==t.targetTransitionEvents.length)return e(t);var n=setTimeout(function(){r.debug("Launcher did not completely resize (state: "+t.state+", activeState: "+t.activeState+").")},t.transitionCheckTimeout);s.once(t.element,"transitionend",function(i,r){if(i.target===t.element&&s.contains(t.targetTransitionEvents,i.propertyName))return clearTimeout(n),r(),e(t)},!0)})];case 2:return[2,n.sent()]}})})},t.prototype.activateIfInactive=function(){return this.inactive?(this.wasInactive=!0,this.activate()):s.nothing()},t.prototype.inactivateIfWasInactive=function(){return this.wasInactive?(this.wasInactive=!1,this.inactivate()):s.nothing()},t.prototype.clearIfWasInactive=function(){this.wasInactive=!1},t.prototype.inactivate=function(){var t=this;return this.bell.message.hide().then(function(){return t.bell.badge.content.length>0?t.bell.badge.hide().then(function(){return Promise.all([e.prototype.inactivate.call(t),t.resize("small")])}).then(function(){return t.bell.badge.show()}):Promise.all([e.prototype.inactivate.call(t),t.resize("small")])})},t.prototype.activate=function(){var t=this;return this.bell.badge.content.length>0?this.bell.badge.hide().then(function(){return Promise.all([e.prototype.activate.call(t),t.resize(t.bell.options.size)])}):Promise.all([e.prototype.activate.call(this),this.resize(this.bell.options.size)])},t}(a.default);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n(0),o=n(7);!function(e){e[e.Unknown=0]="Unknown",e[e.NoDeviceId=1]="NoDeviceId",e[e.OptedOut=2]="OptedOut"}(i=t.NotSubscribedReason||(t.NotSubscribedReason={}));var NotSubscribedError=function(e){function NotSubscribedError(t){var n=this;switch(t){case i.Unknown||i.NoDeviceId:n=e.call(this,"This operation can only be performed after the user is subscribed.")||this;break;case i.OptedOut:n=e.call(this,"The user has manually opted out of receiving of notifications. This operation can only be performed after the user is fully resubscribed.")||this}return n.reason=i[t],n}return r.__extends(NotSubscribedError,e),NotSubscribedError}(o.default);t.NotSubscribedError=NotSubscribedError},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(1),o=n(5),s=n(48),a=n(2),u=n(4),c=n(72),l=n(82),d=n(83),f=n(3),p=function(){function e(){}return e.initHttp=function(e){return i.__awaiter(this,void 0,void 0,function(){var t;return i.__generator(this,function(n){switch(n.label){case 0:switch(r.debug("Called %cinitHttp("+JSON.stringify(e,null,4)+")",f.getConsoleStyle("code")),t=a.default.getWindowEnv()){case u.WindowEnvironmentKind.OneSignalProxyFrame:return[3,1];case u.WindowEnvironmentKind.OneSignalSubscriptionPopup:return[3,3];case u.WindowEnvironmentKind.OneSignalSubscriptionModal:return[3,5]}return[3,6];case 1:return OneSignal.proxyFrame=new c.default(e),[4,OneSignal.proxyFrame.initialize()];case 2:return n.sent(),s.default.ensureBackwardsCompatibility(OneSignal),[3,7];case 3:return OneSignal.subscriptionPopup=new d.default(e),[4,OneSignal.subscriptionPopup.initialize()];case 4:return n.sent(),s.default.ensureBackwardsCompatibility(OneSignal),o.default.trigger("httpInitialize"),[3,7];case 5:return OneSignal.subscriptionModal=new l.default(e),OneSignal.subscriptionModal.establishCrossOriginMessaging(),OneSignal.subscriptionModal.initialize(),s.default.ensureBackwardsCompatibility(OneSignal),o.default.trigger("httpInitialize"),[3,7];case 6:return r.error("Unsupported HTTP initialization branch."),[3,7];case 7:return[2]}})})},e}();t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(1),o=n(8),s=n(5),a=n(32),u=n(13),c=n(51),l=n(2),d=n(17),f=n(11),p=n(3),g=n(34),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(){var t=e.prototype.initialize.call(this);return s.default.trigger("httpInitialize"),t},t.prototype.establishCrossOriginMessaging=function(){this.messenger&&this.messenger.destroy(),this.messenger=new d.default(window,this.options.origin,this.options.origin),this.messenger.on(OneSignal.POSTMAM_COMMANDS.CONNECTED,this.onMessengerConnect.bind(this)),this.messenger.on(OneSignal.POSTMAM_COMMANDS.IFRAME_POPUP_INITIALIZE,this.onProxyFrameInitializing.bind(this)),this.messenger.on(OneSignal.POSTMAM_COMMANDS.REMOTE_NOTIFICATION_PERMISSION,this.onRemoteNotificationPermission.bind(this)),this.messenger.on(OneSignal.POSTMAM_COMMANDS.REMOTE_DATABASE_GET,this.onRemoteDatabaseGet.bind(this)),this.messenger.on(OneSignal.POSTMAM_COMMANDS.REMOTE_DATABASE_PUT,this.onRemoteDatabasePut.bind(this)),this.messenger.on(OneSignal.POSTMAM_COMMANDS.REMOTE_DATABASE_REMOVE,this.onRemoteDatabaseRemove.bind(this)),this.messenger.on(OneSignal.POSTMAM_COMMANDS.UNSUBSCRIBE_FROM_PUSH,this.onUnsubscribeFromPush.bind(this)),this.messenger.on(OneSignal.POSTMAM_COMMANDS.MARK_PROMPT_DISMISSED,this.onMarkPromptDismissed.bind(this)),this.messenger.on(OneSignal.POSTMAM_COMMANDS.IS_SUBSCRIBED,this.onIsSubscribed.bind(this)),this.messenger.on(OneSignal.POSTMAM_COMMANDS.UNSUBSCRIBE_PROXY_FRAME,this.onUnsubscribeProxyFrame.bind(this)),this.messenger.listen()},t.prototype.retriggerRemoteEvent=function(e,t){this.messenger.message(OneSignal.POSTMAM_COMMANDS.REMOTE_RETRIGGER_EVENT,{eventName:e,eventData:t})},t.prototype.onMessengerConnect=function(e){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(e){return r.debug("("+l.default.getWindowEnv().toString()+") Successfully established cross-origin communication."),this.finishInitialization(),[2,!1]})})},t.prototype.onProxyFrameInitializing=function(e){return i.__awaiter(this,void 0,void 0,function(){var t;return i.__generator(this,function(n){switch(n.label){case 0:return r.info("("+l.default.getWindowEnv().toString()+") The iFrame has just received initOptions from the host page!"),OneSignal.config=o(e.data.hostInitOptions,OneSignal.config,{pageUrl:e.data.pageUrl,pageTitle:e.data.pageTitle}),a.default.installNativePromptPermissionChangedHook(),[4,f.default.get("Options","defaultUrl")];case 1:return t=n.sent(),t?[3,3]:[4,f.default.put("Options",{key:"defaultUrl",value:new URL(OneSignal.config.pageUrl).origin})];case 2:n.sent(),n.label=3;case 3:return[4,f.default.put("Options",{key:"lastKnownHostUrl",value:OneSignal.config.pageUrl})];case 4:return n.sent(),[4,a.default.initSaveState(OneSignal.config.pageTitle)];case 5:return n.sent(),[4,a.default.storeInitialValues()];case 6:return n.sent(),[4,a.default.saveInitOptions()];case 7:if(n.sent(),navigator.serviceWorker&&"https:"===window.location.protocol)try{u.default.establishServiceWorkerChannel()}catch(e){r.error("Error interacting with Service Worker inside an HTTP-hosted iFrame:",e)}return e.reply(OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE),[2]}})})},t.prototype.onRemoteNotificationPermission=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n;return i.__generator(this,function(i){switch(i.label){case 0:return t=OneSignal.context,[4,t.permissionManager.getReportedNotificationPermission(t.appConfig.safariWebId)];case 1:return n=i.sent(),e.reply(n),[2,!1]}})})},t.prototype.onRemoteDatabaseGet=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,r,o,s,a,u,c;return i.__generator(this,function(i){switch(i.label){case 0:for(t=e.data,n=[],r=0,o=t;r<o.length;r++)s=o[r],a=s.table,u=s.key,n.push(f.default.get(a,u));return[4,Promise.all(n)];case 1:return c=i.sent(),e.reply(c),[2,!1]}})})},t.prototype.onRemoteDatabasePut=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,r,o,s,a,u;return i.__generator(this,function(i){switch(i.label){case 0:for(t=e.data,n=[],r=0,o=t;r<o.length;r++)s=o[r],a=s.table,u=s.keypath,n.push(f.default.put(a,u));return[4,Promise.all(n)];case 1:return i.sent(),e.reply(OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE),[2,!1]}})})},t.prototype.onRemoteDatabaseRemove=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,r,o,s,a,u;return i.__generator(this,function(i){switch(i.label){case 0:for(t=e.data,n=[],r=0,o=t;r<o.length;r++)s=o[r],a=s.table,u=s.keypath,n.push(f.default.remove(a,u));return[4,Promise.all(n)];case 1:return i.sent(),e.reply(OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE),[2,!1]}})})},t.prototype.onUnsubscribeFromPush=function(e){return i.__awaiter(this,void 0,void 0,function(){var t;return i.__generator(this,function(n){switch(n.label){case 0:r.debug("(Reposted from iFrame -> Host) User unsubscribed but permission granted. Re-prompting the user for push."),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,p.unsubscribeFromPush()];case 2:return n.sent(),e.reply(OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE),[3,4];case 3:return t=n.sent(),r.debug("Failed to unsubscribe from push remotely:",t),[3,4];case 4:return[2]}})})},t.prototype.onMarkPromptDismissed=function(e){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(t){return r.debug("(Reposted from iFrame -> Host) Marking prompt as dismissed."),c.default.markHttpsNativePromptDismissed(),e.reply(OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE),[2,!1]})})},t.prototype.onIsSubscribed=function(e){return i.__awaiter(this,void 0,void 0,function(){var t;return i.__generator(this,function(n){switch(n.label){case 0:return[4,OneSignal.isPushNotificationsEnabled()];case 1:return t=n.sent(),e.reply(t),[2,!1]}})})},t.prototype.onUnsubscribeProxyFrame=function(e){return i.__awaiter(this,void 0,void 0,function(){var t;return i.__generator(this,function(n){switch(n.label){case 0:return[4,OneSignal.isPushNotificationsEnabled()];case 1:return t=n.sent(),t?[4,OneSignal.setSubscription(!1)]:[3,4];case 2:return n.sent(),[4,OneSignal.database.rebuild()];case 3:n.sent(),n.label=4;case 4:return e.reply(OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE),[2,!1]}})})},t}(g.default);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(1),o=n(5),s=n(13),a=n(10),u=n(2),c=n(17),l=function(){function e(e,t){this.appId=e,this.registrationOptions=t}return e.prototype.load=function(){return i.__awaiter(this,void 0,void 0,function(){var e,t;return i.__generator(this,function(n){switch(n.label){case 0:return[4,OneSignal.isPushNotificationsEnabled()];case 1:return e=n.sent(),[4,OneSignal.getNotificationPermission()];case 2:return t=n.sent(),this.url=u.default.getOneSignalApiUrl(),this.url.pathname="webPushModal",this.url.search=s.default.getPromptOptionsQueryString()+"&id="+this.appId.value+"&httpsPrompt=true&pushEnabled="+e+"&permissionBlocked="+("denied"===t)+"&promptType=modal",r.info("Loading iFrame for HTTPS subscription modal at "+this.url.toString()),this.modal=this.createHiddenSubscriptionDomModal(this.url.toString()),this.establishCrossOriginMessaging(),[2]}})})},e.prototype.createHiddenSubscriptionDomModal=function(e){var t=document.createElement("div");t.setAttribute("id","OneSignal-iframe-modal"),t.setAttribute("style","display:none !important"),t.innerHTML='<div id="notif-permission" style="background: rgba(0, 0, 0, 0.7); position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 3000000000; display: flex; align-items: center; justify-content: center;"></div>',document.body.appendChild(t);var n=document.createElement("style");n.innerHTML="@media (max-width: 560px) { .OneSignal-permission-iframe { width: 100%; height: 100%;} }",document.getElementsByTagName("head")[0].appendChild(n);var i=document.createElement("iframe");return i.className="OneSignal-permission-iframe",i.setAttribute("frameborder","0"),i.width=OneSignal._windowWidth.toString(),i.height=OneSignal._windowHeight.toString(),i.src=e,document.getElementById("notif-permission").appendChild(i),i},e.prototype.removeFrame=function(){var e=document.querySelector("#OneSignal-iframe-modal");e&&e.remove()},e.prototype.showSubscriptionDomModal=function(){document.getElementById("OneSignal-iframe-modal").setAttribute("style","")},e.prototype.establishCrossOriginMessaging=function(){this.messenger=new c.default(this.modal,this.url.origin,this.url.origin),this.messenger.startPostMessageReceive(),this.messenger.once(OneSignal.POSTMAM_COMMANDS.MODAL_LOADED,this.onModalLoaded.bind(this)),this.messenger.once(OneSignal.POSTMAM_COMMANDS.MODAL_PROMPT_ACCEPTED,this.onModalAccepted.bind(this)),this.messenger.once(OneSignal.POSTMAM_COMMANDS.MODAL_PROMPT_REJECTED,this.onModalRejected.bind(this)),this.messenger.once(OneSignal.POSTMAM_COMMANDS.POPUP_CLOSING,this.onModalClosing.bind(this))},e.prototype.onModalLoaded=function(e){this.showSubscriptionDomModal(),o.default.trigger("modalLoaded")},e.prototype.onModalAccepted=function(e){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(e){switch(e.label){case 0:return r.debug("User accepted the HTTPS modal prompt.",location.origin),OneSignal._sessionInitAlreadyRunning=!1,this.dispose(),s.default.triggerCustomPromptClicked("granted"),r.debug("Calling setSubscription(true)"),[4,a.default.registerForPush()];case 1:return e.sent(),[4,OneSignal.setSubscription(!0)];case 2:return e.sent(),[2]}})})},e.prototype.onModalRejected=function(e){r.debug("User rejected the HTTPS modal prompt."),OneSignal._sessionInitAlreadyRunning=!1,this.dispose(),s.default.triggerCustomPromptClicked("denied")},e.prototype.onModalClosing=function(e){r.info("Detected modal is closing."),this.dispose()},e.prototype.dispose=function(){this.messenger&&this.messenger.destroy(),this.removeFrame()},e.prototype.message=function(){this.messenger.message.apply(this.messenger,arguments)},e}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.Mobile="mobile",e.Tablet="tablet",e.Desktop="desktop"}(t.DevicePlatformKind||(t.DevicePlatformKind={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(9),o=n(1),s=n(16),a=n(14),u=n(14),c=n(31),l=n(52),d=n(52),f=n(5),p=n(15),g=n(76),h=n(20),v=n(33),m=n(77),b=n(78),S=n(4),w=n(19),_=n(11),y=n(2),O=n(26),E=n(50),P=n(53),I=function(){function e(e,t){this.context=e,this.config=t}return e.prototype.isSafari=function(){return r.safari&&void 0!==window.safari&&void 0!==window.safari.pushNotification},e.prototype.subscribe=function(){return i.__awaiter(this,void 0,void 0,function(){var e,t,n;return i.__generator(this,function(i){switch(i.label){case 0:switch(e=y.default.getWindowEnv()){case S.WindowEnvironmentKind.CustomIframe:case S.WindowEnvironmentKind.Unknown:case S.WindowEnvironmentKind.OneSignalSubscriptionModal:case S.WindowEnvironmentKind.OneSignalSubscriptionPopup:case S.WindowEnvironmentKind.OneSignalProxyFrame:throw new s.InvalidStateError(s.InvalidStateReason.UnsupportedEnvironment)}switch(n=e){case S.WindowEnvironmentKind.ServiceWorker:return[3,1];case S.WindowEnvironmentKind.Host:return[3,3]}return[3,9];case 1:return[4,this.subscribeFcmFromWorker()];case 2:return t=i.sent(),[3,9];case 3:return[4,OneSignal.getNotificationPermission()];case 4:if(i.sent()===h.NotificationPermission.Denied)throw new a.default(u.PushPermissionNotGrantedErrorReason.Blocked);return this.isSafari()?[4,this.subscribeSafari()]:[3,6];case 5:return t=i.sent(),[3,8];case 6:return[4,this.subscribeFcmFromPage()];case 7:t=i.sent(),i.label=8;case 8:return[3,9];case 9:return[2,this.registerSubscriptionWithOneSignal(t)]}})})},e.prototype.subscribePartially=function(){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(e){switch(e.label){case 0:return[4,this.subscribeFcmFromPage()];case 1:return[2,e.sent()]}})})},e.prototype.requestPresubscribeNotificationPermission=function(){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(t){return[2,e.requestNotificationPermission()]})})},e.prototype.unsubscribe=function(e){return i.__awaiter(this,void 0,void 0,function(){var t;return i.__generator(this,function(n){switch(n.label){case 0:if(0!==e)return[3,1];throw new E.default;case 1:return 1!==e?[3,7]:y.default.getWindowEnv()!==S.WindowEnvironmentKind.ServiceWorker?[3,5]:[4,_.default.getSubscription()];case 2:return t=n.sent().deviceId,[4,w.default.updatePlayer(this.context.appConfig.appId,t,{notification_types:b.SubscriptionStateKind.MutedByApi})];case 3:return n.sent(),[4,_.default.put("Options",{key:"optedOut",value:!0})];case 4:return n.sent(),[3,6];case 5:throw new E.default;case 6:return[3,8];case 7:throw new E.default;case 8:return[2]}})})},e.requestNotificationPermission=function(){return new Promise(function(e){return window.Notification.requestPermission(e)})},e.prototype.registerSubscriptionWithOneSignal=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,s,a,u;return i.__generator(this,function(i){switch(i.label){case 0:return t=new v.PushRegistration,t.appId=this.config.appId,this.isSafari()?t.deliveryPlatform=g.DeliveryPlatformKind.Safari:r.firefox?t.deliveryPlatform=g.DeliveryPlatformKind.Firefox:t.deliveryPlatform=g.DeliveryPlatformKind.ChromeLike,t.subscriptionState=b.SubscriptionStateKind.Subscribed,e=m.RawPushSubscription.deserialize(e),t.subscription=e,[4,this.isAlreadyRegisteredWithOneSignal()];case 1:return i.sent()?[4,_.default.getSubscription()]:[3,6];case 2:return s=i.sent().deviceId,e.isNewSubscription()?[4,w.default.updateUserSession(s,t)]:[3,4];case 3:return n=i.sent(),o.info("Updated the subscriber's OneSignal session:",t),[3,5];case 4:n=s,o.debug("The existing push subscription was resubscribed, but not registering with OneSignal because the new subscription is identical."),i.label=5;case 5:return[3,8];case 6:return[4,w.default.createUser(t)];case 7:a=i.sent(),n=a,o.info("Subscribed to web push and registered with OneSignal:",t),i.label=8;case 8:return y.default.getWindowEnv()!==S.WindowEnvironmentKind.ServiceWorker&&f.default.trigger(OneSignal.EVENTS.REGISTERED),u=new O.Subscription,u.deviceId=n,u.optedOut=!1,this.isSafari()?u.subscriptionToken=e.safariDeviceToken:u.subscriptionToken=e.w3cEndpoint.toString(),[4,_.default.setSubscription(u)];case 9:return i.sent(),[2,u]}})})},e.prototype.isAlreadyRegisteredWithOneSignal=function(){return i.__awaiter(this,void 0,void 0,function(){var e;return i.__generator(this,function(t){switch(t.label){case 0:return[4,_.default.getSubscription()];case 1:return e=t.sent().deviceId,[2,!!e.value]}})})},e.prototype.subscribeSafariPromptPermission=function(){var e=this;return new Promise(function(t){window.safari.pushNotification.requestPermission(y.default.getOneSignalApiUrl().toString()+"/safari",e.config.safariWebId,{app_id:e.config.appId.value},function(e){t(e.deviceToken?e.deviceToken.toLowerCase():null)})})},e.prototype.subscribeSafari=function(){return i.__awaiter(this,void 0,void 0,function(){var e,t,n;return i.__generator(this,function(i){switch(i.label){case 0:if(e=new m.RawPushSubscription,!this.config.safariWebId)throw new c.SdkInitError(c.SdkInitErrorKind.MissingSafariWebId);return t=window.safari.pushNotification.permission(this.config.safariWebId).deviceToken,e.existingSafariDeviceToken=t,t||f.default.trigger(OneSignal.EVENTS.PERMISSION_PROMPT_DISPLAYED),[4,this.subscribeSafariPromptPermission()];case 1:if(n=i.sent(),p.default.triggerNotificationPermissionChanged(),!n)throw new l.default(d.SubscriptionErrorReason.InvalidSafariSetup);return e.setFromSafariSubscription(n),[2,e]}})})},e.prototype.subscribeFcmFromPage=function(){return i.__awaiter(this,void 0,void 0,function(){var e,t;return i.__generator(this,function(n){switch(n.label){case 0:return y.default.getWindowEnv()===S.WindowEnvironmentKind.ServiceWorker||window.Notification.permission!==h.NotificationPermission.Default?[3,2]:(f.default.trigger(OneSignal.EVENTS.PERMISSION_PROMPT_DISPLAYED),[4,this.requestPresubscribeNotificationPermission()]);case 1:switch(e=n.sent(),e===h.NotificationPermission.Default&&p.default.triggerNotificationPermissionChanged(!0),e){case h.NotificationPermission.Default:throw o.debug("Exiting subscription and not registering worker because the permission was dismissed."),OneSignal._sessionInitAlreadyRunning=!1,OneSignal._isRegisteringForPush=!1,new a.default(u.PushPermissionNotGrantedErrorReason.Dismissed);case h.NotificationPermission.Denied:throw o.debug("Exiting subscription and not registering worker because the permission was blocked."),OneSignal._sessionInitAlreadyRunning=!1,OneSignal._isRegisteringForPush=!1,new a.default(u.PushPermissionNotGrantedErrorReason.Blocked)}n.label=2;case 2:return[4,this.context.serviceWorkerManager.shouldInstallWorker()];case 3:return n.sent()?[4,this.context.serviceWorkerManager.installWorker()]:[3,5];case 4:n.sent(),n.label=5;case 5:return o.debug("Waiting for the service worker to activate..."),[4,navigator.serviceWorker.ready];case 6:return t=n.sent(),o.debug("Service worker is ready to continue subscribing."),[4,this.subscribeFcmVapidOrLegacyKey(t)];case 7:return[2,n.sent()]}})})},e.prototype.subscribeFcmFromWorker=function(){return i.__awaiter(this,void 0,void 0,function(){var e;return i.__generator(this,function(t){switch(t.label){case 0:if(!self.registration.active&&!r.firefox)throw new s.InvalidStateError(s.InvalidStateReason.ServiceWorkerNotActivated);return[4,self.registration.pushManager.permissionState({userVisibleOnly:!0})];case 1:if("denied"===(e=t.sent()))throw OneSignal._sessionInitAlreadyRunning=!1,new a.default(u.PushPermissionNotGrantedErrorReason.Blocked);if("prompt"===e)throw OneSignal._sessionInitAlreadyRunning=!1,new a.default(u.PushPermissionNotGrantedErrorReason.Default);return[4,this.subscribeFcmVapidOrLegacyKey(self.registration)];case 2:return[2,t.sent()]}})})},e.prototype.getVapidKeyForBrowser=function(){var e=void 0;return e=r.firefox?this.config.onesignalVapidPublicKey:this.config.vapidPublicKey,e?P.base64ToUint8Array(e).buffer:void 0},e.prototype.subscribeFcmVapidOrLegacyKey=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,r,s;return i.__generator(this,function(i){switch(i.label){case 0:return t={userVisibleOnly:!0,applicationServerKey:this.getVapidKeyForBrowser()?this.getVapidKeyForBrowser():void 0},[4,e.pushManager.getSubscription()];case 1:return(r=i.sent())&&r.options?(o.debug("[Subscription Manager] An existing push subscription exists and options is not null. Using existing options to resubscribe."),t=r.options,[3,4]):[3,2];case 2:return!r||r.options?[3,4]:(o.debug("[Subscription Manager] An existing push subscription exists and options is null. Unsubscribing from push first now."),[4,r.unsubscribe()]);case 3:i.sent(),i.label=4;case 4:return o.debug("[Subscription Manager] Subscribing to web push with these options:",t),[4,e.pushManager.subscribe(t)];case 5:return n=i.sent(),s=new m.RawPushSubscription,s.setFromW3cSubscription(n),r&&(s.existingW3cPushSubscription=new m.RawPushSubscription,s.existingW3cPushSubscription.setFromW3cSubscription(r)),[2,s]}})})},e}();t.SubscriptionManager=I},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e[e.ChromeLike=5]="ChromeLike",e[e.Safari=7]="Safari",e[e.Firefox=8]="Firefox"}(t.DeliveryPlatformKind||(t.DeliveryPlatformKind={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.prototype.isNewSubscription=function(){return this.existingW3cPushSubscription?this.existingW3cPushSubscription.w3cEndpoint.toString()!==this.w3cEndpoint.toString()||this.existingW3cPushSubscription.w3cP256dh!==this.w3cP256dh||this.existingW3cPushSubscription.w3cAuth!==this.w3cAuth:!this.existingSafariDeviceToken||this.existingSafariDeviceToken!==this.safariDeviceToken},e.prototype.setFromW3cSubscription=function(e){if(e&&(this.w3cEndpoint=new URL(e.endpoint),e.getKey)){var t=null;try{t=e.getKey("p256dh")}catch(e){}var n=null;try{n=e.getKey("auth")}catch(e){}if(t){var i=btoa(String.fromCharCode.apply(null,new Uint8Array(t)));this.w3cP256dh=i}if(n){var r=btoa(String.fromCharCode.apply(null,new Uint8Array(n)));this.w3cAuth=r}}},e.prototype.setFromSafariSubscription=function(e){this.safariDeviceToken=e},e.prototype.serialize=function(){return{w3cEndpoint:this.w3cEndpoint.toString(),w3cP256dh:this.w3cP256dh,w3cAuth:this.w3cAuth,safariDeviceToken:this.safariDeviceToken,existingPushSubscription:this.existingW3cPushSubscription?this.existingW3cPushSubscription.serialize():null,existingSafariDeviceToken:this.existingSafariDeviceToken}},e.deserialize=function(t){var n=new e;try{n.w3cEndpoint=new URL(t.w3cEndpoint)}catch(e){}return n.w3cP256dh=t.w3cP256dh,n.w3cAuth=t.w3cAuth,n.existingW3cPushSubscription=t.existingPushSubscription?e.deserialize(t.existingPushSubscription):null,n.safariDeviceToken=t.safariDeviceToken,n.existingSafariDeviceToken=t.existingSafariDeviceToken,n},e}();t.RawPushSubscription=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e[e.Subscribed=1]="Subscribed",e[e.MutedByApi=-2]="MutedByApi",e[e.MutedByUser=-3]="MutedByUser"}(t.SubscriptionStateKind||(t.SubscriptionStateKind={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),r=function(){function e(e){this.isFeatureEnabled=e}return Object.defineProperty(e,"SYNC_URL",{get:function(){return"https://rc.rlcdn.com/463096.gif?n=5"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"DOM_ID",{get:function(){return"onesignal-cookie-sync"},enumerable:!0,configurable:!0}),e.prototype.getElement=function(){return document.getElementById(e.DOM_ID)},e.prototype.uninstall=function(){this.getElement()&&this.getElement().remove()},e.prototype.install=function(){if(!this.isFeatureEnabled)return void i.debug("Cookie sync feature is disabled.");this.uninstall();var t=document.createElement("img");t.setAttribute("id",e.DOM_ID),t.setAttribute("border","0"),t.setAttribute("hspace","0"),t.setAttribute("vspace","0"),t.setAttribute("width","1"),t.setAttribute("height","1"),t.setAttribute("src",e.SYNC_URL),document.querySelector("body").appendChild(t),i.debug("Enabled cookie sync feature.")},e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),r=n(2),o=n(4),s=function(){function e(){}return e.prototype.getPageViewCount=function(){try{var t=sessionStorage.getItem(e.SESSION_STORAGE_KEY_NAME),n=parseInt(t);return isNaN(n)?0:n}catch(e){return 0}},e.prototype.setPageViewCount=function(t){try{sessionStorage.setItem(e.SESSION_STORAGE_KEY_NAME,t.toString()),r.default.getWindowEnv()===o.WindowEnvironmentKind.OneSignalSubscriptionPopup&&OneSignal.subscriptionPopup&&OneSignal.subscriptionPopup.message(OneSignal.POSTMAM_COMMANDS.SET_SESSION_COUNT)}catch(e){}},e.prototype.incrementPageViewCount=function(){if(!this.incrementedPageViewCount){var e=this.getPageViewCount()+1;this.setPageViewCount(e),i.debug("Incremented page view count to "+e+"."),this.incrementedPageViewCount=!0}},e.prototype.simulatePageNavigationOrRefresh=function(){this.incrementedPageViewCount=!1},e.prototype.isFirstPageView=function(){return 1===this.getPageViewCount()},e.SESSION_STORAGE_KEY_NAME="onesignal-pageview-count",e}();t.SessionManager=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(3),o=n(10),s=n(9),a=n(18),u=n(11),c=n(20),l=function(){function e(){}return Object.defineProperty(e,"STORED_PERMISSION_KEY",{get:function(){return"storedNotificationPermission"},enumerable:!0,configurable:!0}),e.prototype.getNotificationPermission=function(e){return i.__awaiter(this,void 0,void 0,function(){var t;return i.__generator(this,function(n){switch(n.label){case 0:return[4,this.getReportedNotificationPermission(e)];case 1:return t=n.sent(),[4,this.isPermissionEnvironmentAmbiguous(t)];case 2:return n.sent()?[2,this.getInterpretedAmbiguousPermission(t)]:[2,t]}})})},e.prototype.getReportedNotificationPermission=function(e){return i.__awaiter(this,void 0,void 0,function(){var t;return i.__generator(this,function(n){switch(n.label){case 0:return s.safari?[2,this.getSafariNotificationPermission(e)]:[3,1];case 1:return[4,o.default.isUsingSubscriptionWorkaround()];case 2:return t=n.sent(),t?[4,r.awaitOneSignalInitAndSupported()]:[3,4];case 3:return n.sent(),[2,this.getOneSignalSubdomainNotificationPermission(e)];case 4:return[2,this.getW3cNotificationPermission()]}})})},e.prototype.getSafariNotificationPermission=function(e){if(e)return window.safari.pushNotification.permission(e).permission;throw new a.InvalidArgumentError("safariWebId",a.InvalidArgumentReason.Empty)},e.prototype.getW3cNotificationPermission=function(){return window.Notification.permission},e.prototype.getOneSignalSubdomainNotificationPermission=function(e){return new Promise(function(t){OneSignal.proxyFrameHost.message(OneSignal.POSTMAM_COMMANDS.REMOTE_NOTIFICATION_PERMISSION,{safariWebId:e},function(e){var n=e.data;t(n)})})},e.prototype.isPermissionEnvironmentAmbiguous=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,s;return i.__generator(this,function(i){switch(i.label){case 0:return t=r.redetectBrowserUserAgent(),(n=!t.safari&&!t.firefox&&e===c.NotificationPermission.Denied)?(s=this.isCurrentFrameContextCrossOrigin(),s?[3,2]:[4,o.default.hasInsecureParentOrigin()]):[3,3];case 1:s=i.sent(),i.label=2;case 2:n=s||o.default.isInsecureOrigin(),i.label=3;case 3:return[2,n]}})})},e.prototype.isCurrentFrameContextCrossOrigin=function(){var e;try{e=window.top.location.origin}catch(e){return!0}return window.top!==window&&e!==window.location.origin},e.prototype.getInterpretedAmbiguousPermission=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n;return i.__generator(this,function(i){switch(i.label){case 0:switch(t=e){case c.NotificationPermission.Denied:return[3,1]}return[3,3];case 1:return[4,this.getStoredPermission()];case 2:return n=i.sent(),n?[2,n]:[2,c.NotificationPermission.Default];case 3:return[2,e]}})})},e.prototype.getStoredPermission=function(){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(t){switch(t.label){case 0:return[4,u.default.get("Options",e.STORED_PERMISSION_KEY)];case 1:return[2,t.sent()]}})})},e.prototype.setStoredPermission=function(t){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(n){switch(n.label){case 0:return[4,u.default.put("Options",{key:e.STORED_PERMISSION_KEY,value:t})];case 1:return n.sent(),[2]}})})},e.prototype.updateStoredPermission=function(){return i.__awaiter(this,void 0,void 0,function(){var e;return i.__generator(this,function(t){switch(t.label){case 0:return[4,this.getNotificationPermission(null)];case 1:return e=t.sent(),[4,this.setStoredPermission(e)];case 2:return[2,t.sent()]}})})},e}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(17),o=n(34),s=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.prototype.establishCrossOriginMessaging=function(){this.messenger&&this.messenger.destroy(),this.messenger=new r.default(window.parent,this.options.origin,this.options.origin)},t}(o.default);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(1),o=n(2),s=n(17),a=n(34),u=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.prototype.establishCrossOriginMessaging=function(){this.messenger=new s.default(window.opener,this.options.origin,this.options.origin),this.messenger.once(OneSignal.POSTMAM_COMMANDS.CONNECTED,this.onMessengerConnected.bind(this)),this.messenger.postMessage(OneSignal.POSTMAM_COMMANDS.POPUP_BEGIN_MESSAGEPORT_COMMS,null),this.messenger.listen()},t.prototype.onMessengerConnected=function(e){r.debug("("+o.default.getWindowEnv().toString()+") The host page is now ready to receive commands from the HTTP popup."),this.finishInitialization()},t}(a.default);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(24),o=n(85),s=n(3),a=n(2),u=function(){function e(){}return e.discoverAltOrigin=function(t){return i.__awaiter(this,void 0,void 0,function(){var n,r,a,u,c,l,d,f,p,g,d;return i.__generator(this,function(i){switch(i.label){case 0:n=e.getOneSignalProxyIframeUrls(t),r=[],u=0,c=n,i.label=1;case 1:return u<c.length?(l=c[u],d=new o.default(l),[4,d.load()]):[3,4];case 2:i.sent(),r.push(d),i.label=3;case 3:return u++,[3,1];case 4:return[4,e.removeDuplicatedAltOriginSubscription(r)];case 5:return(f=i.sent())?(a=f[0],[3,10]):[3,6];case 6:p=0,g=r,i.label=7;case 7:return p<g.length?(d=g[p],[4,d.isSubscribed()]):[3,10];case 8:if(i.sent())a=d;else{if(!s.contains(d.url.host,".os.tc"))return d.dispose(),[3,9];a?d.dispose():a=d}i.label=9;case 9:return p++,[3,7];case 10:return[2,a]}})})},e.removeDuplicatedAltOriginSubscription=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,o,u,c,c,l,d;return i.__generator(this,function(i){switch(i.label){case 0:t=[],n=0,o=e,i.label=1;case 1:return n<o.length?(u=o[n],[4,u.isSubscribed()]):[3,4];case 2:i.sent()&&t.push(u),i.label=3;case 3:return n++,[3,1];case 4:return t.length<2?[2,null]:(a.default.getBuildEnv()==r.BuildEnvironmentKind.Development?c=".localhost:3001":a.default.getBuildEnv()==r.BuildEnvironmentKind.Production&&(c=".onesignal.com"),l=t.find(function(e){return s.contains(e.url.host,c)}),l?[3,5]:[2,null]);case 5:return[4,l.unsubscribeFromPush()];case 6:return i.sent(),l.dispose(),d=e.indexOf(l),e.splice(d,1),[2,e]}})})},e.getCanonicalSubscriptionUrls=function(e,t){void 0===t&&(t=a.default.getBuildEnv());var n=[];if(e.httpUseOneSignalCom){var i=a.default.getOneSignalApiUrl(t);i.host=[e.subdomain,i.host].join("."),n.push(i)}var r=a.default.getOneSignalApiUrl(t);r.host=[e.subdomain,"os.tc"].join("."),n.push(r);for(var o=0,s=n;o<s.length;o++){s[o].pathname=""}return n},e.getOneSignalProxyIframeUrls=function(t){for(var n=e.getCanonicalSubscriptionUrls(t),i=0,r=n;i<r.length;i++){r[i].pathname="webPushIframe"}return n},e.getOneSignalSubscriptionPopupUrls=function(t){for(var n=e.getCanonicalSubscriptionUrls(t),i=0,r=n;i<r.length;i++){r[i].pathname="subscribe"}return n},e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(1),o=n(6),s=n(5),a=n(15),u=n(17),c=n(3),l=function(){function e(e){this.url=e,this.url.pathname="webPushIframe"}return Object.defineProperty(e,"LOAD_TIMEOUT_MS",{get:function(){return 15e3},enumerable:!0,configurable:!0}),e.prototype.load=function(){return i.__awaiter(this,void 0,void 0,function(){var t,n=this;return i.__generator(this,function(i){return r.debug("Opening an iFrame to",this.url.toString()),this.removeFrame(),t=document.createElement("iframe"),t.style.display="none",t.src=this.url.toString(),t.sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation",this.loadPromise={},this.loadPromise.promise=new Promise(function(e,t){n.loadPromise.resolver=e,n.loadPromise.rejector=t}),document.body.appendChild(t),t.onload=this.onFrameLoad.bind(this),this.element=t,c.timeoutPromise(this.loadPromise.promise,e.LOAD_TIMEOUT_MS).catch(function(){window===window.top&&r.warn("OneSignal: Loading the required iFrame "+n.url.toString()+" timed out. Check that the Site URL onesignal.com dashboard web config is "+location.origin+". Only the Site URL specified there is allowed to use load the iFrame.")}),[2,this.loadPromise.promise]})})},e.prototype.removeFrame=function(){if(o.default.isBrowser()){var e=document.querySelector("iFrame[src='"+this.url.toString()+"'");e&&e.remove()}},e.prototype.onFrameLoad=function(e){this.establishCrossOriginMessaging()},e.prototype.establishCrossOriginMessaging=function(){this.messenger&&this.messenger.destroy(),this.messenger=new u.default(this.element.contentWindow,this.url.toString(),this.url.toString()),this.messenger.on(OneSignal.POSTMAM_COMMANDS.CONNECTED,this.onMessengerConnect.bind(this)),this.messenger.on(OneSignal.POSTMAM_COMMANDS.REMOTE_RETRIGGER_EVENT,this.onRemoteRetriggerEvent.bind(this)),this.messenger.on(OneSignal.POSTMAM_COMMANDS.REMOTE_NOTIFICATION_PERMISSION_CHANGED,this.onRemoteNotificationPermissionChanged.bind(this)),this.messenger.on(OneSignal.POSTMAM_COMMANDS.REQUEST_HOST_URL,this.onRequestHostUrl.bind(this)),this.messenger.on(OneSignal.POSTMAM_COMMANDS.SERVICEWORKER_COMMAND_REDIRECT,this.onServiceWorkerCommandRedirect.bind(this)),this.messenger.on(OneSignal.POSTMAM_COMMANDS.GET_EVENT_LISTENER_COUNT,this.onGetEventListenerCount.bind(this)),this.messenger.connect()},e.prototype.dispose=function(){this.messenger&&this.messenger.destroy(),this.removeFrame()},e.prototype.onMessengerConnect=function(e){return i.__awaiter(this,void 0,void 0,function(){var e=this;return i.__generator(this,function(t){return r.debug("Successfully established cross-origin communication for iFrame at "+this.url.toString()),this.messenger.message(OneSignal.POSTMAM_COMMANDS.IFRAME_POPUP_INITIALIZE,{hostInitOptions:JSON.parse(JSON.stringify(OneSignal.config)),pageUrl:window.location.href,pageTitle:document.title},function(t){return t.data===OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE&&e.loadPromise.resolver(),!1}),[2]})})},e.prototype.onRemoteRetriggerEvent=function(e){var t=e.data,n=t.eventName,i=t.eventData;return s.default.trigger(n,i,e.source),!1},e.prototype.onRemoteNotificationPermissionChanged=function(e){var t=e.data.forceUpdatePermission;return a.default.triggerNotificationPermissionChanged(t),!1},e.prototype.onRequestHostUrl=function(e){return e.reply(location.href),!1},e.prototype.onServiceWorkerCommandRedirect=function(e){return window.location.href=e.data,!1},e.prototype.onGetEventListenerCount=function(e){var t=e.data;r.debug("(Reposted from iFrame -> Host) Getting event listener count for ",t);var n=OneSignal.getListeners(t).length;return e.reply(n),!1},e.prototype.isSubscribed=function(){var e=this;return new Promise(function(t){e.messenger.message(OneSignal.POSTMAM_COMMANDS.IS_SUBSCRIBED,null,function(e){t(e.data)})})},e.prototype.unsubscribeFromPush=function(){var e=this;return new Promise(function(t){e.messenger.message(OneSignal.POSTMAM_COMMANDS.UNSUBSCRIBE_PROXY_FRAME,null,function(e){t()})})},e.prototype.message=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.messenger.message.apply(this.messenger,arguments)},e}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(1),o=n(8),s=n(5),a=n(15),u=n(13),c=n(2),l=n(17),d=function(){function e(e,t){this.url=e,this.url.pathname="subscribe",this.options=t||{autoAccept:!1}}return e.prototype.load=function(){var e=this,t=o({},u.default.getPromptOptionsPostHash(),{promptType:"popup",parentHostname:encodeURIComponent(location.hostname)});return this.options.autoAccept&&(t.autoAccept=!0),r.info("Opening a popup to "+this.url.toString()+" with POST data:",t),this.popupWindow=this.openWindowViaPost(this.url.toString(),t,null),this.establishCrossOriginMessaging(),this.loadPromise={},this.loadPromise.promise=new Promise(function(t,n){e.loadPromise.resolver=t,e.loadPromise.rejector=n}),this.loadPromise.promise},e.prototype.openWindowViaPost=function(e,t,n){var i=document.createElement("form");i.action=e,i.method="POST",i.target="onesignal-http-popup";var r=void 0!=window.screenLeft?window.screenLeft:screen.left,o=void 0!=window.screenTop?window.screenTop:screen.top,s=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,a=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,u=OneSignal._windowWidth,c=OneSignal._windowHeight,l=s/2-u/2+r,d=a/2-c/2+o;n&&(n.childWidth&&(u=n.childWidth),n.childHeight&&(c=n.childHeight),n.left&&(l=n.left),n.top&&(d=n.top));var f=window.open("about:blank","onesignal-http-popup","'scrollbars=yes, width="+u+", height="+c+", top="+d+", left="+l);if(t)for(var p in t){var g=document.createElement("textarea");g.name=p,g.value="object"==typeof t[p]?JSON.stringify(t[p]):t[p],i.appendChild(g)}return i.style.display="none",document.body.appendChild(i),i.submit(),document.body.removeChild(i),f},e.prototype.establishCrossOriginMessaging=function(){this.messenger=new l.default(this.popupWindow,this.url.toString(),this.url.toString()),this.messenger.on(OneSignal.POSTMAM_COMMANDS.POPUP_BEGIN_MESSAGEPORT_COMMS,this.onBeginMessagePortCommunications.bind(this)),this.messenger.once(OneSignal.POSTMAM_COMMANDS.POPUP_LOADED,this.onPopupLoaded.bind(this)),this.messenger.once(OneSignal.POSTMAM_COMMANDS.POPUP_ACCEPTED,this.onPopupAccepted.bind(this)),this.messenger.once(OneSignal.POSTMAM_COMMANDS.POPUP_REJECTED,this.onPopupRejected.bind(this)),this.messenger.once(OneSignal.POSTMAM_COMMANDS.POPUP_CLOSING,this.onPopupClosing.bind(this)),this.messenger.once(OneSignal.POSTMAM_COMMANDS.SET_SESSION_COUNT,this.onSetSessionCount.bind(this)),this.messenger.once(OneSignal.POSTMAM_COMMANDS.WINDOW_TIMEOUT,this.onWindowTimeout.bind(this)),this.messenger.once(OneSignal.POSTMAM_COMMANDS.FINISH_REMOTE_REGISTRATION,this.onFinishingRegistrationRemotely.bind(this)),this.messenger.on(OneSignal.POSTMAM_COMMANDS.REMOTE_RETRIGGER_EVENT,this.onRemoteRetriggerEvent.bind(this)),this.messenger.startPostMessageReceive()},e.prototype.dispose=function(){this.messenger.destroy()},e.prototype.onBeginMessagePortCommunications=function(e){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(e){return r.debug("("+c.default.getWindowEnv().toString()+") Successfully established cross-origin messaging with the popup window."),this.messenger.connect(),[2,!1]})})},e.prototype.onPopupLoaded=function(e){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(e){return this.loadPromise.resolver(),s.default.trigger("popupLoad"),[2]})})},e.prototype.onPopupAccepted=function(e){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(e){return u.default.triggerCustomPromptClicked("granted"),[2]})})},e.prototype.onPopupRejected=function(e){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(e){return u.default.triggerCustomPromptClicked("denied"),[2]})})},e.prototype.onPopupClosing=function(e){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(e){return r.info("Popup window is closing, running cleanup events."),s.default.trigger(OneSignal.EVENTS.POPUP_CLOSING),this.dispose(),[2]})})},e.prototype.onSetSessionCount=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n;return i.__generator(this,function(i){return r.debug(c.default.getWindowEnv().toString()+" Marking current session as a continuing browsing session."),t=e.data.sessionCount,n=OneSignal.context,n.sessionManager.setPageViewCount(t),[2]})})},e.prototype.onWindowTimeout=function(e){return i.__awaiter(this,void 0,void 0,function(){return i.__generator(this,function(e){return r.debug(c.default.getWindowEnv().toString()+" Popup window timed out and was closed."),s.default.trigger(OneSignal.EVENTS.POPUP_WINDOW_TIMEOUT),[2]})})},e.prototype.onFinishingRegistrationRemotely=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,o,s;return i.__generator(this,function(i){switch(i.label){case 0:return r.debug(location.origin,c.default.getWindowEnv().toString()+" Finishing HTTP popup registration inside the iFrame, sent from popup."),e.reply({progress:!0}),t=e.data.rawPushSubscription,[4,u.default.getAppId()];case 1:return n=i.sent(),this.messenger.stopPostMessageReceive(),o=OneSignal.context.subscriptionManager,[4,o.registerSubscriptionWithOneSignal(t)];case 2:return s=i.sent(),a.default.checkAndTriggerSubscriptionChanged(),u.default.checkAndTriggerNotificationPermissionChanged(),[2]}})})},e.prototype.onRemoteRetriggerEvent=function(e){var t=e.data,n=t.eventName,i=t.eventData;return s.default.trigger(n,i,e.source),!1},e.prototype.message=function(){this.messenger.message.apply(this.messenger,arguments)},e}();t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(9),o=n(8),s=n(5),a=n(13),u=n(3),c=function(){function e(e){this.options=e?o({},e):{},this.options.actionMessage&&"string"==typeof this.options.actionMessage||(this.options.actionMessage="We'd like to show you notifications for the latest news and updates."),this.options.acceptButtonText&&"string"==typeof this.options.acceptButtonText||(this.options.acceptButtonText="Allow"),this.options.cancelButtonText&&"string"==typeof this.options.cancelButtonText||(this.options.cancelButtonText="No Thanks"),this.options.actionMessage=this.options.actionMessage.substring(0,90),this.options.acceptButtonText=this.options.acceptButtonText.substring(0,15),this.options.cancelButtonText=this.options.cancelButtonText.substring(0,15),this.notificationIcons=null}return Object.defineProperty(e,"EVENTS",{get:function(){return{ALLOW_CLICK:"popoverAllowClick",CANCEL_CLICK:"popoverCancelClick",SHOWN:"popoverShown",CLOSED:"popoverClosed"}},enumerable:!0,configurable:!0}),e.prototype.create=function(){return i.__awaiter(this,void 0,void 0,function(){var t,n,o,c;return i.__generator(this,function(i){switch(i.label){case 0:return null!==this.notificationIcons?[3,2]:[4,a.default.getNotificationIcons()];case 1:t=i.sent(),this.notificationIcons=t,this.container&&u.removeDomElement("#onesignal-popover-container"),n=this.getPlatformNotificationIcon(),o="data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2239.5%22%20height%3D%2240.5%22%20viewBox%3D%220%200%2079%2081%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ctitle%3EOneSignal-Bell%3C%2Ftitle%3E%3Cg%20fill%3D%22%23BBB%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M39.96%2067.12H4.12s-3.2-.32-3.2-3.36%202.72-3.2%202.72-3.2%2010.72-5.12%2010.72-8.8c0-3.68-1.76-6.24-1.76-21.28%200-15.04%209.6-26.56%2021.12-26.56%200%200%201.6-3.84%206.24-3.84%204.48%200%206.08%203.84%206.08%203.84%2011.52%200%2021.12%2011.52%2021.12%2026.56s-1.6%2017.6-1.6%2021.28c0%203.68%2010.72%208.8%2010.72%208.8s2.72.16%202.72%203.2c0%202.88-3.36%203.36-3.36%203.36H39.96zM27%2070.8h24s-1.655%2010.08-11.917%2010.08S27%2070.8%2027%2070.8z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",c='<div id="normal-popover"><div class="popover-body"><div class="popover-body-icon"><img class="'+("default-icon"===n?"default-icon":"")+'" src="'+("default-icon"===n?o:n)+'"></div><div class="popover-body-message">'+this.options.actionMessage+'</div><div class="clearfix"></div></div><div class="popover-footer"><button id="onesignal-popover-allow-button" class="align-right primary popover-button">'+this.options.acceptButtonText+'</button><button id="onesignal-popover-cancel-button" class="align-right secondary popover-button">'+this.options.cancelButtonText+'</button><div class="clearfix"></div></div></div>',u.addDomElement("body","beforeend",'<div id="onesignal-popover-container" class="onesignal-popover-container onesignal-reset"></div>'),u.addDomElement(this.container,"beforeend",'<div id="onesignal-popover-dialog" class="onesignal-popover-dialog">'+c+"</div>"),u.addCssClass(this.container,r.mobile?"slide-up":"slide-down"),this.allowButton.addEventListener("click",this.onPopoverAllowed.bind(this)),this.cancelButton.addEventListener("click",this.onPopoverCanceled.bind(this)),s.default.trigger(e.EVENTS.SHOWN),i.label=2;case 2:return[2]}})})},e.prototype.onPopoverAllowed=function(t){s.default.trigger(e.EVENTS.ALLOW_CLICK)},e.prototype.onPopoverCanceled=function(t){s.default.trigger(e.EVENTS.CANCEL_CLICK),this.close()},e.prototype.close=function(){var t=this;u.addCssClass(this.container,"close-popover"),u.once(this.dialog,"animationend",function(n,i){n.target!==t.dialog||"slideDownExit"!==n.animationName&&"slideUpExit"!==n.animationName||(u.removeDomElement("#onesignal-popover-container"),i(),s.default.trigger(e.EVENTS.CLOSED))},!0)},e.prototype.getPlatformNotificationIcon=function(){return this.notificationIcons?u.isChromeLikeBrowser()||r.firefox?this.notificationIcons.chrome?this.notificationIcons.chrome:this.notificationIcons.firefox?this.notificationIcons.firefox:"default-icon":r.safari?this.notificationIcons.safari?this.notificationIcons.safari:this.notificationIcons.chrome?this.notificationIcons.chrome:"default-icon":void 0:"default-icon"},Object.defineProperty(e.prototype,"container",{get:function(){return document.querySelector("#onesignal-popover-container")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dialog",{get:function(){return document.querySelector("#onesignal-popover-dialog")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowButton",{get:function(){return document.querySelector("#onesignal-popover-allow-button")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cancelButton",{get:function(){return document.querySelector("#onesignal-popover-cancel-button")},enumerable:!0,configurable:!0}),e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=null;i={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(e){this.toString=function(){return"CORRUPT: "+this.message},this.message=e},invalid:function(e){this.toString=function(){return"INVALID: "+this.message},this.message=e},bug:function(e){this.toString=function(){return"BUG: "+this.message},this.message=e},notReady:function(e){this.toString=function(){return"NOT READY: "+this.message},this.message=e}}},i.bitArray={bitSlice:function(e,t,n){return e=i.bitArray._shiftRight(e.slice(t/32),32-(31&t)).slice(1),void 0===n?e:i.bitArray.clamp(e,n-t)},extract:function(e,t,n){var i=Math.floor(-t-n&31);return(-32&(t+n-1^t)?e[t/32|0]<<32-i^e[t/32+1|0]>>>i:e[t/32|0]>>>i)&(1<<n)-1},concat:function(e,t){if(0===e.length||0===t.length)return e.concat(t);var n=e[e.length-1],r=i.bitArray.getPartial(n);return 32===r?e.concat(t):i.bitArray._shiftRight(t,r,0|n,e.slice(0,e.length-1))},bitLength:function(e){var t,n=e.length;return 0===n?0:(t=e[n-1],32*(n-1)+i.bitArray.getPartial(t))},clamp:function(e,t){if(32*e.length<t)return e;e=e.slice(0,Math.ceil(t/32));var n=e.length;return t&=31,n>0&&t&&(e[n-1]=i.bitArray.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial:function(e,t,n){return 32===e?t:(n?0|t:t<<32-e)+1099511627776*e},getPartial:function(e){return Math.round(e/1099511627776)||32},equal:function(e,t){if(i.bitArray.bitLength(e)!==i.bitArray.bitLength(t))return!1;var n,r=0;for(n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r},_shiftRight:function(e,t,n,r){var o,s,a=0;for(void 0===r&&(r=[]);t>=32;t-=32)r.push(n),n=0;if(0===t)return r.concat(e);for(o=0;o<e.length;o++)r.push(n|e[o]>>>t),n=e[o]<<32-t;return a=e.length?e[e.length-1]:0,s=i.bitArray.getPartial(a),r.push(i.bitArray.partial(t+s&31,t+s>32?n:r.pop(),1)),r},_xor4:function(e,t){return[e[0]^t[0],e[1]^t[1],e[2]^t[2],e[3]^t[3]]},byteswapM:function(e){var t,n;for(t=0;t<e.length;++t)n=e[t],e[t]=n>>>24|n>>>8&65280|(65280&n)<<8|n<<24;return e}},i.codec.utf8String={fromBits:function(e){var t,n,r="",o=i.bitArray.bitLength(e);for(t=0;t<o/8;t++)0==(3&t)&&(n=e[t/4]),r+=String.fromCharCode(n>>>24),n<<=8;return decodeURIComponent(window.escape(r))},toBits:function(e){e=window.unescape(encodeURIComponent(e));var t,n=[],r=0;for(t=0;t<e.length;t++)r=r<<8|e.charCodeAt(t),3==(3&t)&&(n.push(r),r=0);return 3&t&&n.push(i.bitArray.partial(8*(3&t),r)),n}},i.codec.hex={fromBits:function(e){var t,n="";for(t=0;t<e.length;t++)n+=(0xf00000000000+(0|e[t])).toString(16).substr(4);return n.substr(0,i.bitArray.bitLength(e)/4)},toBits:function(e){var t,n,r=[];for(e=e.replace(/\s|0x/g,""),n=e.length,e+="00000000",t=0;t<e.length;t+=8)r.push(0^parseInt(e.substr(t,8),16));return i.bitArray.clamp(r,4*n)}},i.hash.md5=function(e){this._T[0]||this._precompute(),e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()},i.hash.md5.hash=function(e){return(new i.hash.md5).update(e).finalize()},i.hash.md5.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(e){"string"==typeof e&&(e=i.codec.utf8String.toBits(e));var t,n=this._buffer=i.bitArray.concat(this._buffer,e),r=this._length,o=this._length=r+i.bitArray.bitLength(e);for(t=this.blockSize+r&-this.blockSize;t<=o;t+=this.blockSize)this._block(n.splice(0,16),!0);return this},finalize:function(){var e,t=this._buffer,n=this._h;for(t=i.bitArray.concat(t,[i.bitArray.partial(1,1)]),e=t.length+2;15&e;e++)t.push(0);for(t.push(0|this._length),t.push(this._length/4294967296|0);t.length;)this._block(t.splice(0,16),t.length);return this.reset(),this._BS(n,4),n},_init:[1732584193,4023233417,2562383102,271733878],_BS:function(e,t){var n,i;for(n=0;n<t;n++)i=e[n],e[n]=i>>>24|i>>8&65280|(65280&i)<<8|(255&i)<<24},_T:[],_precompute:function(){var e;for(e=0;e<64;e++)this._T[e]=4294967296*Math.abs(Math.sin(e+1))|0},_block:function(e,t){var n,i,r,o,s,a=e.slice(0),u=this._h,c=this._T;for(i=u[0],r=u[1],o=u[2],s=u[3],this._BS(a,t?16:14),n=0;n<64;n++){var l,d,f,p;n<32?n<16?(l=r&o|~r&s,d=n,f=[7,12,17,22]):(l=s&r|~s&o,d=(5*n+1)%16,f=[5,9,14,20]):n<48?(l=r^o^s,d=(3*n+5)%16,f=[4,11,16,23]):(l=o^(r|~s),d=7*n%16,f=[6,10,15,21]),p=i+l+a[d]+c[n],i=s,s=o,o=r,r=(p<<f[n%4]|p>>>32-f[n%4])+r|0}u[0]+=i,u[1]+=r,u[2]+=o,u[3]+=s}},i.hash.sha256=function(e){this._key[0]||this._precompute(),e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()},i.hash.sha256.hash=function(e){return(new i.hash.sha256).update(e).finalize()},i.hash.sha256.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(e){"string"==typeof e&&(e=i.codec.utf8String.toBits(e));var t,n=this._buffer=i.bitArray.concat(this._buffer,e),r=this._length,o=this._length=r+i.bitArray.bitLength(e);if(o>9007199254740991)throw new i.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var s=new Uint32Array(n),a=0;for(t=512+r-(512+r&511);t<=o;t+=512)this._block(s.subarray(16*a,16*(a+1))),a+=1;n.splice(0,16*a)}else for(t=512+r-(512+r&511);t<=o;t+=512)this._block(n.splice(0,16));return this},finalize:function(){var e,t=this._buffer,n=this._h;for(t=i.bitArray.concat(t,[i.bitArray.partial(1,1)]),e=t.length+2;15&e;e++)t.push(0);for(t.push(Math.floor(this._length/4294967296)),t.push(0|this._length);t.length;)this._block(t.splice(0,16));return this.reset(),n},_init:[],_key:[],_precompute:function(){function e(e){return 4294967296*(e-Math.floor(e))|0}for(var t,n,i=0,r=2;i<64;r++){for(n=!0,t=2;t*t<=r;t++)if(r%t==0){n=!1;break}n&&(i<8&&(this._init[i]=e(Math.pow(r,.5))),this._key[i]=e(Math.pow(r,1/3)),i++)}},_block:function(e){var t,n,i,r,o=this._h,s=this._key,a=o[0],u=o[1],c=o[2],l=o[3],d=o[4],f=o[5],p=o[6],g=o[7];for(t=0;t<64;t++)t<16?n=e[t]:(i=e[t+1&15],r=e[t+14&15],n=e[15&t]=(i>>>7^i>>>18^i>>>3^i<<25^i<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+e[15&t]+e[t+9&15]|0),n=n+g+(d>>>6^d>>>11^d>>>25^d<<26^d<<21^d<<7)+(p^d&(f^p))+s[t],g=p,p=f,f=d,d=l+n|0,l=c,c=u,u=a,a=n+(u&c^l&(u^c))+(u>>>2^u>>>13^u>>>22^u<<30^u<<19^u<<10)|0;o[0]=o[0]+a|0,o[1]=o[1]+u|0,o[2]=o[2]+c|0,o[3]=o[3]+l|0,o[4]=o[4]+d|0,o[5]=o[5]+f|0,o[6]=o[6]+p|0,o[7]=o[7]+g|0}},i.hash.sha1=function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()},i.hash.sha1.hash=function(e){return(new i.hash.sha1).update(e).finalize()},i.hash.sha1.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(e){"string"==typeof e&&(e=i.codec.utf8String.toBits(e));var t,n=this._buffer=i.bitArray.concat(this._buffer,e),r=this._length,o=this._length=r+i.bitArray.bitLength(e);if(o>9007199254740991)throw new i.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var s=new Uint32Array(n),a=0;for(t=this.blockSize+r-(this.blockSize+r&this.blockSize-1);t<=o;t+=this.blockSize)this._block(s.subarray(16*a,16*(a+1))),a+=1;n.splice(0,16*a)}else for(t=this.blockSize+r-(this.blockSize+r&this.blockSize-1);t<=o;t+=this.blockSize)this._block(n.splice(0,16));return this},finalize:function(){var e,t=this._buffer,n=this._h;for(t=i.bitArray.concat(t,[i.bitArray.partial(1,1)]),e=t.length+2;15&e;e++)t.push(0);for(t.push(Math.floor(this._length/4294967296)),t.push(0|this._length);t.length;)this._block(t.splice(0,16));return this.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(e,t,n,i){return e<=19?t&n|~t&i:e<=39?t^n^i:e<=59?t&n|t&i|n&i:e<=79?t^n^i:void 0},_S:function(e,t){return t<<e|t>>>32-e},_block:function(e){var t,n,i,r,o,s,a,u,c=this._h;if("undefined"!=typeof Uint32Array){u=Array(80);for(var l=0;l<16;l++)u[l]=e[l]}else u=e;for(i=c[0],r=c[1],o=c[2],s=c[3],a=c[4],t=0;t<=79;t++)t>=16&&(u[t]=this._S(1,u[t-3]^u[t-8]^u[t-14]^u[t-16])),n=this._S(5,i)+this._f(t,r,o,s)+a+u[t]+this._key[Math.floor(t/20)]|0,a=s,s=o,o=this._S(30,r),r=i,i=n;c[0]=c[0]+i|0,c[1]=c[1]+r|0,c[2]=c[2]+o|0,c[3]=c[3]+s|0,c[4]=c[4]+a|0}};var r=function(){function e(){}return e.md5=function(e){return i.codec.hex.fromBits(i.hash.md5.hash(e))},e.sha1=function(e){return i.codec.hex.fromBits(i.hash.sha1.hash(e))},e.sha256=function(e){return i.codec.hex.fromBits(i.hash.sha256.hash(e))},e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.isValidUrl=function(e,t){if(t&&t.allowNull&&null===e)return!0;if(t&&t.allowEmpty&&(null===e||void 0===e))return!0;try{var n=new URL(e);return!t||!t.requireHttps||"https:"===n.protocol}catch(e){return!1}},e.isValidBoolean=function(e,t){return!(!t||!t.allowNull||null!==e)||(!0===e||!1===e)},e.isValidArray=function(e,t){return!(!t||!t.allowNull||null!==e)||(!(!t||!t.allowEmpty||null!==e&&void 0!==e)||e instanceof Array)},e}();t.ValidatorUtils=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n(0),o=n(7),s=n(43),a=n(54);!function(e){e[e.HttpPermissionRequest=0]="HttpPermissionRequest"}(i=t.DeprecatedApiReason||(t.DeprecatedApiReason={}));var u=function(e){function t(t){var n=this;switch(t){case i.HttpPermissionRequest:n=e.call(this,"The HTTP permission request has been deprecated. Please remove any custom popups from your code.")||this,n.reportUsage()}return n}return r.__extends(t,e),t.prototype.reportUsage=function(){void 0!==s.default&&s.default.context&&s.default.context.metricsManager&&s.default.context.metricsManager.reportEvent(new a.ApiUsageMetricEvent(a.ApiUsageMetricKind.HttpPermissionRequest))},t}(o.default);t.DeprecatedApiError=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.promiseStub=function(){return{then:e.promiseStub,catch:e.promiseStub}},Object.defineProperty(e,"log",{get:function(){return{setLevel:function(){}}},enumerable:!0,configurable:!0}),e.isPushNotificationsSupported=function(){return!1},e.push=function(e){if("function"==typeof e)e();else{var t=e.shift();OneSignal[t].apply(null,e)}},e}();t.default=i;var r=i;r.init=r.showHttpPrompt=r.registerForPushNotifications=r.showHttpPermissionRequest=r.getNotificationPermission=r.on=r.off=r.once=r.config=r.SERVICE_WORKER_PATH=r.SERVICE_WORKER_UPDATER_PATH=r.checkAndWipeUserSubscription=r.subscriptionBell=r.notifyButton=function(){},r.setDefaultNotificationUrl=r.setDefaultTitle=r.syncHashedEmail=r.getTags=r.sendTag=r.sendTags=r.deleteTag=r.deleteTags=r.addListenerForNotificationOpened=r.getIdsAvailable=r.isPushNotificationsEnabled=r.setSubscription=r.getUserId=r.getRegistrationId=r.getSubscription=r.sendSelfNotification=r.promiseStub},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(9),o=n(1),s=n(8),a=n(6),u=n(23),c=n(2),l=n(24),d=n(35),f=n(19),p=n(11),g=n(3),h=n(12),v=n(25),m=function(){function e(){}return Object.defineProperty(e,"VERSION",{get:function(){return a.default.version()},enumerable:!0,configurable:!0}),Object.defineProperty(e,"environment",{get:function(){return a.default},enumerable:!0,configurable:!0}),Object.defineProperty(e,"log",{get:function(){return o},enumerable:!0,configurable:!0}),Object.defineProperty(e,"database",{get:function(){return p.default},enumerable:!0,configurable:!0}),Object.defineProperty(e,"sdkEnvironment",{get:function(){return c.default},enumerable:!0,configurable:!0}),Object.defineProperty(e,"browser",{get:function(){return r},enumerable:!0,configurable:!0}),Object.defineProperty(e,"workerMessenger",{get:function(){return self.workerMessenger||(self.workerMessenger=new u.WorkerMessenger(null)),self.workerMessenger},enumerable:!0,configurable:!0}),e.run=function(){self.addEventListener("push",e.onPushReceived),self.addEventListener("notificationclose",e.onNotificationClosed),self.addEventListener("notificationclick",function(t){return t.waitUntil(e.onNotificationClicked(t))}),self.addEventListener("install",e.onServiceWorkerInstalled),self.addEventListener("activate",e.onServiceWorkerActivated),self.addEventListener("pushsubscriptionchange",e.onPushSubscriptionChange),o.debug("Setting up message listeners."),e.workerMessenger.listen(),e.setupMessageListeners()},e.getAppId=function(){return i.__awaiter(this,void 0,void 0,function(){var e,e;return i.__generator(this,function(t){switch(t.label){case 0:return self.location.search?(e=self.location.search.match(/appId=([0-9a-z-]+)&?/i)[1],[2,new h.Uuid(e)]):[3,1];case 1:return[4,p.default.getAppConfig()];case 2:return e=t.sent().appId,[2,e]}})})},e.setupMessageListeners=function(){return i.__awaiter(this,void 0,void 0,function(){var t=this;return i.__generator(this,function(n){return e.workerMessenger.on(u.WorkerMessengerCommand.WorkerVersion,function(t){o.debug("[Service Worker] Received worker version message."),e.workerMessenger.broadcast(u.WorkerMessengerCommand.WorkerVersion,a.default.version())}),e.workerMessenger.on(u.WorkerMessengerCommand.Subscribe,function(n){return i.__awaiter(t,void 0,void 0,function(){var t,r,s;return i.__generator(this,function(i){switch(i.label){case 0:return t=v.AppConfig.deserialize(n),o.debug("[Service Worker] Received subscribe message."),r=new d.default(t),[4,r.subscriptionManager.subscribe()];case 1:return s=i.sent(),e.workerMessenger.broadcast(u.WorkerMessengerCommand.Subscribe,s.serialize()),[2]}})})}),e.workerMessenger.on(u.WorkerMessengerCommand.AmpSubscriptionState,function(n){return i.__awaiter(t,void 0,void 0,function(){var t,n,r,s;return i.__generator(this,function(i){switch(i.label){case 0:return o.debug("[Service Worker] Received AMP subscription state message."),[4,self.registration.pushManager.getSubscription()];case 1:return(t=i.sent())?[3,2]:(e.workerMessenger.broadcast(u.WorkerMessengerCommand.AmpSubscriptionState,!1),[3,5]);case 2:return[4,self.registration.pushManager.permissionState(t.options)];case 3:return n=i.sent(),[4,p.default.getSubscription()];case 4:r=i.sent().optedOut,s=!!t&&"granted"===n&&!0!==r,e.workerMessenger.broadcast(u.WorkerMessengerCommand.AmpSubscriptionState,s),i.label=5;case 5:return[2]}})})}),e.workerMessenger.on(u.WorkerMessengerCommand.AmpSubscribe,function(){return i.__awaiter(t,void 0,void 0,function(){var t,n,r,s;return i.__generator(this,function(i){switch(i.label){case 0:return o.debug("[Service Worker] Received AMP subscribe message."),[4,e.getAppId()];case 1:return t=i.sent(),[4,f.default.getAppConfig(t)];case 2:return n=i.sent(),r=new d.default(n),[4,r.subscriptionManager.subscribe()];case 3:return s=i.sent(),e.workerMessenger.broadcast(u.WorkerMessengerCommand.AmpSubscribe,s.deviceId),[2]}})})}),e.workerMessenger.on(u.WorkerMessengerCommand.AmpUnsubscribe,function(){return i.__awaiter(t,void 0,void 0,function(){var t,n,r;return i.__generator(this,function(i){switch(i.label){case 0:return o.debug("[Service Worker] Received AMP unsubscribe message."),[4,e.getAppId()];case 1:return t=i.sent(),[4,f.default.getAppConfig(t)];case 2:return n=i.sent(),r=new d.default(n),[4,r.subscriptionManager.unsubscribe(1)];case 3:return i.sent(),e.workerMessenger.broadcast(u.WorkerMessengerCommand.AmpUnsubscribe,null),[2]}})})}),[2]})})},e.onPushReceived=function(t){o.debug("Called %conPushReceived("+JSON.stringify(t,null,4)+"):",g.getConsoleStyle("code"),t),t.waitUntil(e.parseOrFetchNotifications(t).then(function(t){if(!t||0==t.length)return o.debug("Because no notifications were retrieved, we'll display the last known notification, so long as it isn't the welcome notification."),e.displayBackupNotification();for(var n=[],i=0,r=t;i<r.length;i++){var s=r[i];o.debug("Raw Notification from OneSignal:",s);var a=e.buildStructuredNotificationObject(s);n.push(function(t){return e.displayNotification(t).then(function(){return e.updateBackupNotification(t).catch(function(e){return o.error(e)})}).then(function(){return e.workerMessenger.broadcast(u.WorkerMessengerCommand.NotificationDisplayed,t).catch(function(e){return o.error(e)})}).then(function(){return e.executeWebhooks("notification.displayed",t).catch(function(e){return o.error(e)})})}.bind(null,a))}return n.reduce(function(e,t){return e=e.then(t)},Promise.resolve())}).catch(function(t){return o.debug("Failed to display a notification:",t),e.UNSUBSCRIBED_FROM_NOTIFICATIONS?void o.debug("Because we have just unsubscribed from notifications, we will not show anything."):(o.debug("Because a notification failed to display, we'll display the last known notification, so long as it isn't the welcome notification."),e.displayBackupNotification())}))},e.executeWebhooks=function(e,t){return i.__awaiter(this,void 0,void 0,function(){var n,r,s,a,u;return i.__generator(this,function(i){switch(i.label){case 0:return[4,p.default.getSubscription()];case 1:return n=i.sent().deviceId,[4,p.default.get("Options","webhooks.cors")];case 2:return r=i.sent(),[4,p.default.get("Options","webhooks."+e)];case 3:return(s=i.sent())?(a={event:e,id:t.id,userId:n,action:t.action,buttons:t.buttons,heading:t.heading,content:t.content,url:t.url,icon:t.icon,data:t.data},u={method:"post",mode:"no-cors",body:JSON.stringify(a)},r&&(u.mode="cors",u.headers={"X-OneSignal-Event":e,"Content-Type":"application/json"}),o.debug("Executing "+e+" webhook "+(r?"with":"without")+" CORS %cPOST "+s,g.getConsoleStyle("code"),":",a),[4,fetch(s,u)]):[3,5];case 4:return[2,i.sent()];case 5:return[2]}})})},e.getActiveClients=function(){return i.__awaiter(this,void 0,void 0,function(){var e,t,n,r,o;return i.__generator(this,function(i){switch(i.label){case 0:return[4,self.clients.matchAll({type:"window",includeUncontrolled:!0})];case 1:for(e=i.sent(),t=[],n=0,r=e;n<r.length;n++){if(o=r[n],o.frameType&&"nested"===o.frameType){if(!g.contains(o.url,c.default.getOneSignalApiUrl().host)&&!g.contains(o.url,".os.tc"))continue;o.isSubdomainIframe=!0}t.push(o)}return[2,t]}})})},e.buildStructuredNotificationObject=function(e){var t={id:e.custom.i,heading:e.title,content:e.alert,data:e.custom.a,url:e.custom.u,icon:e.icon,image:e.image,tag:e.tag,badge:e.badge,vibrate:e.vibrate};if(e.o){t.buttons=[];for(var n=0,i=e.o;n<i.length;n++){var r=i[n];t.buttons.push({action:r.i,title:r.n,icon:r.p,url:r.u})}}return g.trimUndefined(t)},e.ensureImageResourceHttps=function(e){if(!e)return null;try{var t=new URL(e);if("localhost"===t.hostname||-1!==t.hostname.indexOf("192.168")||"127.0.0.1"===t.hostname||"https:"===t.protocol)return e;if("i0.wp.com"===t.hostname||"i1.wp.com"===t.hostname||"i2.wp.com"===t.hostname||"i3.wp.com"===t.hostname)return"https://"+t.hostname+t.pathname;return"https://i0.wp.com/"+(t.host+t.pathname)}catch(e){}},e.ensureNotificationResourcesHttps=function(t){if(t&&(t.icon&&(t.icon=e.ensureImageResourceHttps(t.icon)),t.image&&(t.image=e.ensureImageResourceHttps(t.image)),t.buttons&&t.buttons.length>0))for(var n=0,i=t.buttons;n<i.length;n++){var r=i[n];r.icon&&(r.icon=e.ensureImageResourceHttps(r.icon))}},e.displayNotification=function(t,n){return i.__awaiter(this,void 0,void 0,function(){var r,a,u,c,l,d;return i.__generator(this,function(i){switch(i.label){case 0:return o.debug("Called %cdisplayNotification("+JSON.stringify(t,null,4)+"):",g.getConsoleStyle("code"),t),[4,e._getTitle()];case 1:return r=i.sent(),[4,p.default.get("Options","defaultIcon")];case 2:return a=i.sent(),[4,p.default.get("Options","persistNotification")];case 3:return u=i.sent(),[4,e.getAppId()];case 4:return c=i.sent(),t.heading=t.heading?t.heading:r,t.icon=t.icon?t.icon:a||void 0,l={},l.tag=t.tag||c.toString(),l.persistNotification="force"===u||u,n||(n={}),t=s(t,n),e.ensureNotificationResourcesHttps(t),d={body:t.content,icon:t.icon,image:t.image,data:t,actions:t.buttons,tag:l.tag,requireInteraction:l.persistNotification,renotify:!0,badge:t.badge,vibrate:t.vibrate},d=e.filterNotificationOptions(d,"force"===u),[2,self.registration.showNotification(t.heading,d)]}})})},e.filterNotificationOptions=function(e,t){if("object"!=typeof e)return e;var n=s({},e);if(""===r.name&&""===r.version)var i=r._detect(navigator.userAgent);else var i=r;return i.chrome&&i.mac&&n&&(n.requireInteraction=!1),t&&(n.requireInteraction=!0),n},e.updateBackupNotification=function(e){return i.__awaiter(this,void 0,void 0,function(){var t;return i.__generator(this,function(n){switch(n.label){case 0:return t=e.data&&e.data.__isOneSignalWelcomeNotification,t?[2]:[4,p.default.put("Ids",{type:"backupNotification",id:e})];case 1:return n.sent(),[2]}})})},e.displayBackupNotification=function(){return p.default.get("Ids","backupNotification").then(function(t){var n={persistNotification:!1,data:{__isOneSignalBackupNotification:!0}};return t?e.displayNotification(t,n):e.displayNotification({content:"You have new updates."},n)})},e.shouldOpenNotificationUrl=function(e){return"javascript:void(0);"!==e&&"do_not_open"!==e&&!g.contains(e,"_osp=do_not_open")},e.onNotificationClosed=function(t){o.debug("Called %conNotificationClosed("+JSON.stringify(t,null,4)+"):",g.getConsoleStyle("code"),t);var n=t.notification.data;e.workerMessenger.broadcast(u.WorkerMessengerCommand.NotificationDismissed,n).catch(function(e){return o.error(e)}),t.waitUntil(e.executeWebhooks("notification.dismissed",n))},e.getNotificationUrlToOpen=function(e){return i.__awaiter(this,void 0,void 0,function(){var t,n,r,o,s;return i.__generator(this,function(i){switch(i.label){case 0:return t=self.registration.scope,[4,p.default.getAppState()];case 1:if(n=i.sent().defaultNotificationUrl,n&&(t=n),e.action)for(r=0,o=e.buttons;r<o.length;r++)s=o[r],s.action===e.action&&s.url&&""!==s.url&&(t=s.url);else e.url&&""!==e.url&&(t=e.url);return[2,t]}})})},e.onNotificationClicked=function(t){return i.__awaiter(this,void 0,void 0,function(){var n,r,s,a,c,l,d,h,v,m,b,S,w,_,y,O,E,P,I,C,N,T;return i.__generator(this,function(i){switch(i.label){case 0:return o.debug("Called %conNotificationClicked("+JSON.stringify(t,null,4)+"):",g.getConsoleStyle("code"),t),t.notification.close(),n=t.notification.data,t.action&&(n.action=t.action),r="exact",s="navigate",[4,p.default.get("Options","notificationClickHandlerMatch")];case 1:return a=i.sent(),a&&(r=a),[4,this.database.get("Options","notificationClickHandlerAction")];case 2:return c=i.sent(),c&&(s=c),[4,e.getActiveClients()];case 3:return l=i.sent(),[4,e.getNotificationUrlToOpen(n)];case 4:d=i.sent(),h=e.shouldOpenNotificationUrl(d),v=!1,m=0,b=l,i.label=5;case 5:return m<b.length?(S=b[m],w=S.url,S.isSubdomainIframe?[4,p.default.get("Options","lastKnownHostUrl")]:[3,8]):[3,37];case 6:return _=i.sent(),w=_,_?[3,8]:[4,p.default.get("Options","defaultUrl")];case 7:w=i.sent(),i.label=8;case 8:y="";try{y=new URL(w).origin}catch(e){o.error("Failed to get the HTTP site's actual origin:",e)}O=null;try{O=new URL(d).origin}catch(e){}if(!("exact"===r&&w===d||"origin"===r&&y===O))return[3,36];if(!(S.isSubdomainIframe&&w===d||!S.isSubdomainIframe&&S.url===d||"focus"===s&&y===O))return[3,13];e.workerMessenger.unicast(u.WorkerMessengerCommand.NotificationClicked,n,S),i.label=9;case 9:return i.trys.push([9,11,,12]),[4,S.focus()];case 10:return i.sent(),[3,12];case 11:return E=i.sent(),o.error("Failed to focus:",S,E),[3,12];case 12:return[3,35];case 13:if(!S.isSubdomainIframe)return[3,21];i.label=14;case 14:return i.trys.push([14,16,,17]),o.debug("Client is subdomain iFrame. Attempting to focus() client."),[4,S.focus()];case 15:return i.sent(),[3,17];case 16:return P=i.sent(),o.error("Failed to focus:",S,P),[3,17];case 17:return h?(o.debug("Redirecting HTTP site to "+d+"."),[4,p.default.put("NotificationOpened",{url:d,data:n,timestamp:Date.now()})]):[3,19];case 18:return i.sent(),e.workerMessenger.unicast(u.WorkerMessengerCommand.RedirectPage,d,S),[3,20];case 19:o.debug("Not navigating because link is special."),i.label=20;case 20:return[3,35];case 21:if(!S.navigate)return[3,32];i.label=22;case 22:return i.trys.push([22,24,,25]),o.debug("Client is standard HTTPS site. Attempting to focus() client."),[4,S.focus()];case 23:return i.sent(),[3,25];case 24:return I=i.sent(),o.error("Failed to focus:",S,I),[3,25];case 25:return i.trys.push([25,30,,31]),h?(o.debug("Redirecting HTTPS site to ("+d+")."),[4,p.default.put("NotificationOpened",{url:d,data:n,timestamp:Date.now()})]):[3,28];case 26:return i.sent(),[4,S.navigate(d)];case 27:return i.sent(),[3,29];case 28:o.debug("Not navigating because link is special."),i.label=29;case 29:return[3,31];case 30:return C=i.sent(),console.error("Failed to navigate."),console.error("Failed to navigate because:",C),console.error("Failed to navigate to "+d+" because:",C),o.error("Failed to navigate:",S,d,C),[3,31];case 31:return[3,35];case 32:return[4,p.default.put("NotificationOpened",{url:d,data:n,timestamp:Date.now()})];case 33:return i.sent(),[4,e.openUrl(d)];case 34:i.sent(),i.label=35;case 35:return v=!0,[3,37];case 36:return m++,[3,5];case 37:return!h||v?[3,40]:[4,p.default.put("NotificationOpened",{url:d,data:n,timestamp:Date.now()})];case 38:return i.sent(),[4,e.openUrl(d)];case 39:i.sent(),i.label=40;case 40:return[4,p.default.getAppConfig()];case 41:return N=i.sent().appId,[4,p.default.getSubscription()];case 42:return T=i.sent().deviceId,N&&T?[4,f.default.put("notifications/"+n.id,{app_id:N.toString(),player_id:T.toString(),opened:!0})]:[3,44];case 43:i.sent(),i.label=44;case 44:return[4,e.executeWebhooks("notification.clicked",n)];case 45:return[2,i.sent()]}})})},e.openUrl=function(e){return i.__awaiter(this,void 0,void 0,function(){var t;return i.__generator(this,function(n){switch(n.label){case 0:o.debug("Opening notification URL:",e),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,self.clients.openWindow(e)];case 2:return[2,n.sent()];case 3:return t=n.sent(),o.warn("Failed to open the URL '"+e+"':",t),[2,void 0];case 4:return[2]}})})},e.onServiceWorkerInstalled=function(e){e.waitUntil(self.skipWaiting())},e.onServiceWorkerActivated=function(e){o.info("%cOneSignal Service Worker activated (version "+a.default.version()+", "+c.default.getWindowEnv().toString()+" environment).",g.getConsoleStyle("bold")),e.waitUntil(self.clients.claim())},e.onPushSubscriptionChange=function(e){o.debug("Called %conPushSubscriptionChange("+JSON.stringify(e,null,4)+"):",g.getConsoleStyle("code"),e)},e.simulateEvent=function(e){self.dispatchEvent(new ExtendableEvent(e))},e._getTitle=function(){return new Promise(function(e){Promise.all([p.default.get("Options","defaultTitle"),p.default.get("Options","pageTitle")]).then(function(t){var n=t[0],i=t[1];e(null!==n?n:null!=i?i:"")})})},e.parseOrFetchNotifications=function(t){if(t.data){return e.isValidPushPayload(t.data)?(o.debug("Received a valid encrypted push payload."),Promise.resolve([t.data.json()])):Promise.reject("Unexpected push message payload received: "+t.data.text())}return e.retrieveNotifications()},e.isValidPushPayload=function(e){try{var t=e.json();return!!(t&&t.custom&&t.custom.i&&g.isValidUuid(t.custom.i))||(o.debug("isValidPushPayload: Valid JSON but missing notification UUID:",t),!1)}catch(e){return o.debug("isValidPushPayload: Parsing to JSON failed with:",e),!1}},e.retrieveNotifications=function(){return new Promise(function(t){var n=[];p.default.get("Ids","userId").then(function(t){return t?(o.debug("Legacy push signal received, retrieving contents from players/"+t+"/chromeweb_notification"),f.default.get("players/"+t+"/chromeweb_notification")):(o.debug("Tried to get notification contents, but IndexedDB is missing user ID info."),Promise.all([e.getAppId(),self.registration.pushManager.getSubscription().then(function(e){return e.endpoint})]).then(function(e){var t=e[0],n=e[1],i=g.getDeviceTypeForBrowser();return f.default.getUserIdFromSubscriptionIdentifier(t.toString(),i,n).then(function(e){return e?(o.debug("Recovered OneSignal user ID:",e),Promise.all([p.default.put("Ids",{type:"userId",id:e}),p.default.put("Ids",{type:"registrationId",id:n.replace(new RegExp("^(https://android.googleapis.com/gcm/send/|https://updates.push.services.mozilla.com/push/)"),"")})]).then(function(){return o.debug("Attempting to retrieve the notification again now with a recovered user ID."),f.default.get("players/"+e+"/chromeweb_notification")})):Promise.reject("Recovered user ID was null. Unsubscribing from push notifications.")})}).catch(function(t){return o.debug("Unsuccessfully attempted to recover OneSignal user ID:",t),self.registration.pushManager.getSubscription().then(function(e){return e.unsubscribe()}).then(function(t){o.debug("Unsubscribed from push notifications result:",t),e.UNSUBSCRIBED_FROM_NOTIFICATIONS=!0})}))}).then(function(e){for(var i=0;i<e.length;i++)n.push(JSON.parse(e[i]));0==n.length&&o.warn("OneSignal Worker: Received a GCM push signal, but there were no messages to retrieve. Are you using the wrong API URL?",c.default.getOneSignalApiUrl().toString()),t(n)})})},e}();t.ServiceWorker=m,"undefined"==typeof self&&void 0!==e?e.OneSignalWorker=m:self.OneSignalWorker=m,o.setDefaultLevel(c.default.getBuildEnv()===l.BuildEnvironmentKind.Development?o.levels.TRACE:o.levels.ERROR),"undefined"!=typeof self&&m.run()}).call(t,n(37))}]);
2
- //# sourceMappingURL=OneSignalSDK.js.map
 
 
includes/onesignal-integration/amp-helper-frame.html CHANGED
@@ -1,31 +1,6 @@
1
- <!doctype html>
2
- <html>
3
- <!-- AMP Web Push Helper IFrame -->
4
-
5
- <head>
6
- <meta charset="utf-8">
7
- <script>(function(){var f,g=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a}(this);function h(a,b){b=void 0===b?"":b;try{return decodeURIComponent(a)}catch(c){return b}};var m=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;Date.now();self.log=self.log||{user:null,dev:null,userForEmbed:null};var n=self.log;var p,r;
8
- function t(a){var b;p||(p=self.document.createElement("a"),r=self.UrlCache||(self.UrlCache=Object.create(null)));var c=r[a];if(c)return c;var d=p;d.href=a;d.protocol||(d.href=d.href);var e={href:d.href,protocol:d.protocol,host:d.host,hostname:d.hostname,port:"0"==d.port?"":d.port,pathname:d.pathname,search:d.search,hash:d.hash,origin:null};"/"!==e.pathname[0]&&(e.pathname="/"+e.pathname);if("http:"==e.protocol&&80==e.port||"https:"==e.protocol&&443==e.port)e.port="",e.host=e.hostname;e.origin=d.origin&&
9
- "null"!=d.origin?d.origin:"data:"!=e.protocol&&e.host?e.protocol+"//"+e.host:e.href;var k=e,l=k;return b?l:r[a]=l};function u(a){a||(a={debug:!1,windowContext:window});this.h={};this.c={};this.u=a.debug;this.i=this.B=this.C=!1;this.j=this.o=this.s=this.b=this.m=null;this.a=a.windowContext||window}f=u.prototype;
10
- f.listen=function(a){var b=this;return(new Promise(function(c,d){b.i?d(Error("Already connected.")):b.C?d(Error("Already listening for connections.")):Array.isArray(a)?(b.s=b.K.bind(b,a,c,d),b.a.addEventListener("message",b.s)):d(Error("allowedOrigins should be a string array of allowed origins to accept messages from. Got:",a))})).then(function(){b.send(u.Topics.CONNECT_HANDSHAKE,null);b.i=!0})};
11
- f.K=function(a,b,c,d){var e=d.data,k=d,l=k.ports;a:{for(var k=t(k.origin).origin,q=0;q<a.length;q++)if(t(a[q]).origin===k){a=!0;break a}a=!1}a&&e&&e.topic===u.Topics.CONNECT_HANDSHAKE&&(this.a.removeEventListener("message",this.s),this.b=l[0],this.j=this.w.bind(this),this.b.addEventListener("message",this.j,!1),this.b.start(),b())};
12
- f.connect=function(a,b){var c=this;return new Promise(function(d,e){a||e(Error("Provide a valid Window context to connect to."));b||e(Error("Provide an expected origin for the remote Window or provide the wildcard *."));c.i?e(Error("Already connected.")):c.B?e(Error("Already connecting.")):(c.m=new MessageChannel,c.b=c.m.port1,c.o=c.J.bind(c,c.b,b,d),c.b.addEventListener("message",c.o),c.b.start(),a.postMessage({topic:u.Topics.CONNECT_HANDSHAKE},"*"===b?"*":t(b).origin,[c.m.port2]))})};
13
- f.J=function(a,b,c){this.i=!0;a.removeEventListener("message",this.o);this.j=this.w.bind(this);a.addEventListener("message",this.j,!1);c()};f.w=function(a){a=a.data;if(this.h[a.id]&&a.isReply){var b=this.h[a.id];delete this.h[a.id];var c=b.promiseResolver;b.message=a.data;c([a.data,this.A.bind(this,a.id,b.topic)])}else{var d=this.c[a.topic];if(d)for(var e=0;e<d.length;e++)(0,d[e])(a.data,this.A.bind(this,a.id,a.topic))}};f.on=function(a,b){this.c[a]?this.c[a].push(b):this.c[a]=[b]};
14
- f.off=function(a,b){if(b){var c=this.c[a].indexOf(b);-1!==c&&this.c[a].splice(c,1)}else this.c[a]&&delete this.c[a]};f.A=function(a,b,c){var d=this,e={id:a,topic:b,data:c,isReply:!0};this.b.postMessage(e);return new Promise(function(a){d.h[e.id]={message:c,topic:b,promiseResolver:a}})};f.send=function(a,b){var c=this,d={id:crypto.getRandomValues(new Uint8Array(10)).join(""),topic:a,data:b};this.b.postMessage(d);return new Promise(function(e){c.h[d.id]={message:b,topic:a,promiseResolver:e}})};
15
- g.Object.defineProperties(u,{Topics:{configurable:!0,enumerable:!0,get:function(){return{CONNECT_HANDSHAKE:"topic-connect-handshake",NOTIFICATION_PERMISSION_STATE:"topic-notification-permission-state",SERVICE_WORKER_STATE:"topic-service-worker-state",SERVICE_WORKER_REGISTRATION:"topic-service-worker-registration",SERVICE_WORKER_QUERY:"topic-service-worker-query",STORAGE_GET:"topic-storage-get"}}}});function v(a){this.u=a&&a.debug;this.a=a.windowContext||window;this.g=new u({debug:this.u,windowContext:this.a});this.l={}}function w(a,b){var c=!0,d=null;a({success:c,error:c?void 0:d,result:c?b:void 0})}f=v.prototype;f.D=function(a,b){if(a&&a.isQueryTopicSupported){var c=!1,d;for(d in u.Topics)a.isQueryTopicSupported===u.Topics[d]&&(c=!0);w(b,c)}else w(b,Notification.permission)};
16
- f.I=function(a,b){var c=null;try{if(a&&a.key&&this.a.localStorage)c=this.a.localStorage.getItem(a.key);else{if(!n.user)throw Error("failed to call initLogConstructor");n.user.warn("amp-web-push","LocalStorage retrieval failed.")}}catch(d){}w(b,c)};
17
- f.H=function(a,b){var c={isControllingFrame:!!this.a.navigator.serviceWorker.controller,url:this.a.navigator.serviceWorker.controller?this.a.navigator.serviceWorker.controller.scriptURL:null,state:this.a.navigator.serviceWorker.controller?this.a.navigator.serviceWorker.controller.state:null};w(b,c)};
18
- f.G=function(a,b){if(!a||!a.workerUrl||!a.registrationOptions)throw Error("Expected arguments workerUrl and registrationOptions in message, got:",a);this.a.navigator.serviceWorker.register(a.workerUrl,a.registrationOptions).then(function(){w(b,null)}).catch(function(a){w(b,a?a.message||a.toString():null)})};f.messageServiceWorker=function(a){this.a.navigator.serviceWorker.controller.postMessage({command:a.topic,payload:a.payload})};
19
- f.F=function(a,b){var c=this;if(!a||!a.topic)throw Error("Expected argument topic in message, got:",a);(new Promise(function(b){c.l[a.topic]=b;c.waitUntilWorkerControlsPage().then(function(){c.messageServiceWorker(a)})})).then(function(d){delete c.l[a.topic];return w(b,d)})};
20
- function x(a){a=a.a.location.search;var b=Object.create(null);if(a)for(var c;c=m.exec(a);){var d=h(c[1],c[1]).trim();c=c[2]?h(c[2],c[2]).trim():"";b[d]=c}var e=b;if(!e.parentOrigin)throw Error("Expecting parentOrigin URL query parameter.");return e.parentOrigin}f.L=function(a){a=a.data;var b=a.command;a=a.payload;var c=this.l[b];"function"===typeof c&&c(a)};
21
- function y(a){return a.a.navigator.serviceWorker&&a.a.navigator.serviceWorker.controller&&"activated"===a.a.navigator.serviceWorker.controller.state}f.waitUntilWorkerControlsPage=function(){var a=this;return new Promise(function(b){y(a)?b():a.a.navigator.serviceWorker.addEventListener("controllerchange",function(){y(a)?b():a.a.navigator.serviceWorker.controller.addEventListener("statechange",function(){y(a)&&b()})})})};
22
- f.run=function(a){var b=this;this.g.on(u.Topics.NOTIFICATION_PERMISSION_STATE,this.D.bind(this));this.g.on(u.Topics.SERVICE_WORKER_STATE,this.H.bind(this));this.g.on(u.Topics.SERVICE_WORKER_REGISTRATION,this.G.bind(this));this.g.on(u.Topics.SERVICE_WORKER_QUERY,this.F.bind(this));this.g.on(u.Topics.STORAGE_GET,this.I.bind(this));this.waitUntilWorkerControlsPage().then(function(){b.a.navigator.serviceWorker.addEventListener("message",b.L.bind(b))});this.g.listen([a||x(this)])};
23
- window._ampWebPushHelperFrame=new v({debug:!1});window._ampWebPushHelperFrame.run();})();
24
- //# sourceMappingURL=amp-web-push-helper-frame.js.map
25
-
26
- </script>
27
- <script src="https://cdn.onesignal.com/sdks/amp-helper-frame.js"></script>
28
- </head>
29
- <body>
30
- </body>
31
- </html>
1
+ <html>
2
+ <head></head>
3
+ <body>
4
+ <script src="https://cdn.onesignal.com/sdks/amp/amp-helper-frame.js"></script>
5
+ </body>
6
+ </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/onesignal-integration/amp-permission-dialog.html CHANGED
@@ -1,158 +1,6 @@
1
- <!doctype html>
2
- <html>
3
- <!-- AMP Web Push Permission Dialog -->
4
-
5
- <head>
6
- <meta charset="utf-8">
7
-
8
- <!-- Do not edit styles in this section -->
9
- <style builtin>
10
- /* Do not edit styles in this section. Add custom styles in the next
11
- style section */
12
- html, body {
13
- height: 100%;
14
- margin: 0;
15
- padding: 0;
16
- }
17
-
18
- /* Default loading spinner */
19
- .spinner,
20
- .spinner:after {
21
- border-radius: 50%;
22
- width: 10em;
23
- height: 10em;
24
- }
25
- .spinner {
26
- margin: 60px auto;
27
- font-size: 10px;
28
- position: relative;
29
- text-indent: -9999em;
30
- border-top: 1.1em solid rgba(140, 140, 140, 0.2);
31
- border-right: 1.1em solid rgba(140, 140, 140, 0.2);
32
- border-bottom: 1.1em solid rgba(140, 140, 140, 0.2);
33
- border-left: 1.1em solid rgb(140, 140, 140);
34
- -webkit-transform: translateZ(0);
35
- -ms-transform: translateZ(0);
36
- transform: translateZ(0);
37
- -webkit-animation: spinner 1.1s infinite linear;
38
- animation: spinner 1.1s infinite linear;
39
- }
40
- @-webkit-keyframes spinner {
41
- 0% {
42
- -webkit-transform: rotate(0deg);
43
- transform: rotate(0deg);
44
- }
45
- 100% {
46
- -webkit-transform: rotate(360deg);
47
- transform: rotate(360deg);
48
- }
49
- }
50
- @keyframes spinner {
51
- 0% {
52
- -webkit-transform: rotate(0deg);
53
- transform: rotate(0deg);
54
- }
55
- 100% {
56
- -webkit-transform: rotate(360deg);
57
- transform: rotate(360deg);
58
- }
59
- }
60
-
61
- /* Horizontally and vertically center items */
62
- body {
63
- display: flex;
64
- justify-content: center;
65
- align-items: center;
66
- padding: 15px;
67
- }
68
-
69
- /* Page message text styles */
70
- .message {
71
- font-size: 22px;
72
- font-family: sans-serif;
73
- text-align: center;
74
- }
75
-
76
- /* Close icon styles */
77
- #close {
78
- position: fixed;
79
- right: 32px;
80
- top: 32px;
81
- width: 32px;
82
- height: 32px;
83
- opacity: 0.5;
84
- cursor: pointer;
85
- }
86
- #close:before, #close:after {
87
- position: fixed;
88
- right: 48px;
89
- content: ' ';
90
- height: 33px;
91
- width: 3px;
92
- background-color: #333;
93
- }
94
- #close:before {
95
- transform: rotate(45deg);
96
- }
97
- #close:after {
98
- transform: rotate(-45deg);
99
- }
100
-
101
- /* Used to hide the preload and postload sections */
102
- .invisible {
103
- display: none;
104
- }
105
- </style>
106
-
107
- <!-- Optional: Add custom styles here -->
108
- <style custom>
109
- /* Add custom styles here */
110
- </style>
111
- </head>
112
- <body>
113
- <div id="preload">
114
- <!-- Anything in this section will be shown before the main script
115
- runs, and will be hidden after -->
116
- <div class="spinner"></div>
117
- </div>
118
- <div id="postload" class="invisible">
119
- <span id="close"></span>
120
- <div permission="default">
121
- <p class="message">
122
- <!--
123
- Customize the subscribing message here
124
- (e.g. "Click Allow to receive notifications")
125
- -->
126
- Click Allow to receive notifications.
127
- </p>
128
- </div>
129
- <div permission="denied">
130
- <!--
131
- Customize the unblocking message here
132
- (e.g. "Please unblock notifications in your browser settings
133
- to receive notifications from this website.")
134
- -->
135
- <p class="message">
136
- Please unblock notifications in your browser settings to receive notifications from this website.
137
- </p>
138
- </div>
139
- </div>
140
- <script>(function(){var f,h=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a}(this);function l(a,b){b=void 0===b?"":b;try{return decodeURIComponent(a)}catch(d){return b}};var m=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;Date.now();self.log=self.log||{user:null,dev:null,userForEmbed:null};var n,p;
141
- function q(a){var b;n||(n=self.document.createElement("a"),p=self.UrlCache||(self.UrlCache=Object.create(null)));var d=p[a];if(d)return d;var c=n;c.href=a;c.protocol||(c.href=c.href);var e={href:c.href,protocol:c.protocol,host:c.host,hostname:c.hostname,port:"0"==c.port?"":c.port,pathname:c.pathname,search:c.search,hash:c.hash,origin:null};"/"!==e.pathname[0]&&(e.pathname="/"+e.pathname);if("http:"==e.protocol&&80==e.port||"https:"==e.protocol&&443==e.port)e.port="",e.host=e.hostname;e.origin=c.origin&&
142
- "null"!=c.origin?c.origin:"data:"!=e.protocol&&e.host?e.protocol+"//"+e.host:e.href;var g=e,k=g;return b?k:p[a]=k};function t(a){a||(a={debug:!1,windowContext:window});this.g={};this.c={};this.s=a.debug;this.h=this.A=this.B=!1;this.i=this.l=this.m=this.b=this.j=null;this.a=a.windowContext||window}f=t.prototype;
143
- f.listen=function(a){var b=this;return(new Promise(function(d,c){b.h?c(Error("Already connected.")):b.B?c(Error("Already listening for connections.")):Array.isArray(a)?(b.m=b.D.bind(b,a,d,c),b.a.addEventListener("message",b.m)):c(Error("allowedOrigins should be a string array of allowed origins to accept messages from. Got:",a))})).then(function(){b.send(t.Topics.CONNECT_HANDSHAKE,null);b.h=!0})};
144
- f.D=function(a,b,d,c){var e=c.data,g=c,k=g.ports;a:{for(var g=q(g.origin).origin,r=0;r<a.length;r++)if(q(a[r]).origin===g){a=!0;break a}a=!1}a&&e&&e.topic===t.Topics.CONNECT_HANDSHAKE&&(this.a.removeEventListener("message",this.m),this.b=k[0],this.i=this.u.bind(this),this.b.addEventListener("message",this.i,!1),this.b.start(),b())};
145
- f.connect=function(a,b){var d=this;return new Promise(function(c,e){a||e(Error("Provide a valid Window context to connect to."));b||e(Error("Provide an expected origin for the remote Window or provide the wildcard *."));d.h?e(Error("Already connected.")):d.A?e(Error("Already connecting.")):(d.j=new MessageChannel,d.b=d.j.port1,d.l=d.C.bind(d,d.b,b,c),d.b.addEventListener("message",d.l),d.b.start(),a.postMessage({topic:t.Topics.CONNECT_HANDSHAKE},"*"===b?"*":q(b).origin,[d.j.port2]))})};
146
- f.C=function(a,b,d){this.h=!0;a.removeEventListener("message",this.l);this.i=this.u.bind(this);a.addEventListener("message",this.i,!1);d()};f.u=function(a){a=a.data;if(this.g[a.id]&&a.isReply){var b=this.g[a.id];delete this.g[a.id];var d=b.promiseResolver;b.message=a.data;d([a.data,this.w.bind(this,a.id,b.topic)])}else{var c=this.c[a.topic];if(c)for(var e=0;e<c.length;e++)(0,c[e])(a.data,this.w.bind(this,a.id,a.topic))}};f.on=function(a,b){this.c[a]?this.c[a].push(b):this.c[a]=[b]};
147
- f.off=function(a,b){if(b){var d=this.c[a].indexOf(b);-1!==d&&this.c[a].splice(d,1)}else this.c[a]&&delete this.c[a]};f.w=function(a,b,d){var c=this,e={id:a,topic:b,data:d,isReply:!0};this.b.postMessage(e);return new Promise(function(a){c.g[e.id]={message:d,topic:b,promiseResolver:a}})};f.send=function(a,b){var d=this,c={id:crypto.getRandomValues(new Uint8Array(10)).join(""),topic:a,data:b};this.b.postMessage(c);return new Promise(function(e){d.g[c.id]={message:b,topic:a,promiseResolver:e}})};
148
- h.Object.defineProperties(t,{Topics:{configurable:!0,enumerable:!0,get:function(){return{CONNECT_HANDSHAKE:"topic-connect-handshake",NOTIFICATION_PERMISSION_STATE:"topic-notification-permission-state",SERVICE_WORKER_STATE:"topic-service-worker-state",SERVICE_WORKER_REGISTRATION:"topic-service-worker-registration",SERVICE_WORKER_QUERY:"topic-service-worker-query",STORAGE_GET:"topic-storage-get"}}}});function u(a){this.s=a&&a.debug;this.a=a.windowContext||window;this.o=new t({debug:this.s,windowContext:this.a})}f=u.prototype;f.isCurrentDialogPopup=function(){return!!this.a.opener&&this.a.opener!==this.a};f.requestNotificationPermission=function(){var a=this;return new Promise(function(b,d){try{a.a.Notification.requestPermission(function(a){return b(a)})}catch(c){d(c)}})};
149
- f.run=function(){v(this);w(this);for(var a=this.a.document.querySelectorAll("[permission]"),b=0;b<a.length;b++)x(a[b],!1);(a=this.a.document.querySelector("[permission="+this.a.Notification.permission+"]"))&&x(a,!0);a=this.a.document.querySelector("#preload");b=this.a.document.querySelector("#postload");a&&b&&(x(a,!1),x(b,!0));"denied"!==this.a.Notification.permission?y(this):z(this)};
150
- function v(a){var b=a.a.document.querySelector("#close");b&&b.addEventListener("click",function(){a.closeDialog()})}f.closeDialog=function(){if(this.isCurrentDialogPopup())this.a.close();else{var a=this.a.fakeLocation||this.a.location;var b=a.search,d=Object.create(null);if(b)for(var c;c=m.exec(b);){var e=l(c[1],c[1]).trim();c=c[2]?l(c[2],c[2]).trim():"";d[e]=c}var g=d;if(!g["return"])throw Error("Expecting return URL query parameter to redirect back.");var k=l(g["return"],void 0);this.redirectToUrl(k)}};
151
- function z(a){navigator.permissions.query({name:"notifications"}).then(function(b){b.onchange=function(){w(a);switch(a.a.Notification.permission){case "default":case "granted":y(a)}}})}function w(a){a.a.localStorage.setItem("amp-web-push-notification-permission",a.a.Notification.permission)}function x(a,b){if(a){var d="invisible";b?a.classList.remove(d):a.classList.add(d)}}
152
- function y(a){a.requestNotificationPermission().then(function(b){w(a);if(a.isCurrentDialogPopup())return a.o.connect(opener,"*"),a.o.send(t.Topics.NOTIFICATION_PERMISSION_STATE,b).then(function(b){var c=b[0];c&&c.closeFrame&&a.closeDialog()});a.closeDialog()})}f.redirectToUrl=function(a){this.a.location.href=a};window._ampWebPushPermissionDialog=new u({debug:!1});window._ampWebPushPermissionDialog.run();})();
153
- //# sourceMappingURL=amp-web-push-permission-dialog.js.map
154
-
155
- </script>
156
- <script src="https://cdn.onesignal.com/sdks/amp-permission-dialog.js"></script>
157
- </body>
158
- </html>
1
+ <html>
2
+ <head></head>
3
+ <body>
4
+ <script src="https://cdn.onesignal.com/sdks/amp/amp-permission-dialog.js"></script>
5
+ </body>
6
+ </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/options/admin-config.php CHANGED
@@ -1,3381 +1,3458 @@
1
- <?php
2
- //Admin Panel Options
3
- if ( ! class_exists( 'Redux' ) ) {
4
- return;
5
- }
6
- // Option name where all the Redux data is stored.
7
- $opt_name = "redux_builder_amp";
8
- $amptfad = '<strong>DID YOU KNOW?</strong></br ><a href="https://ampforwp.com/amp-theme-framework/" target="_blank">You can create your own <strong>Custom theme with AMP Theme Framework</strong></a>';
9
- // #1093 Display only If AMP Comments is Not Installed
10
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
11
- if(!is_plugin_active( 'amp-comments/amp-comments.php' )){
12
- $comment_AD_URL = "http://ampforwp.com/amp-comments/#utm_source=options-panel&utm_medium=comments-tab&utm_campaign=AMP%20Plugin";
13
- $comment_desc = '<a href="'.$comment_AD_URL.'" target="_blank"><img class="ampforwp-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/comments-banner.png" width="560" height="85" /></a>';
14
- }
15
- // If CTA is not Activated
16
- $cta_desc = "";
17
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
18
- if(!is_plugin_active( 'AMP-cta/amp-cta.php' )){
19
- $cta_AD_URL = "http://ampforwp.com/call-to-action/#utm_source=options-panel&utm_medium=call-to-action_banner_in_notification_bar&utm_campaign=AMP%20Plugin";
20
- $cta_desc = '<a href="'.$cta_AD_URL.'" target="_blank"><img class="ampforwp-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/cta-banner.png" width="560" height="85" /></a>';
21
- }
22
- $extension_listing = '
23
- <div class="extension_listing">
24
- <p style="font-size:13px">Take your AMP to the next level with these premium extensions which gives you advanced features.</p>
25
- <ul>
26
- <li class="first"><a href="http://ampforwp.com/advanced-amp-ads/#utm_source=options-panel&utm_medium=extension-tab_advanced-amp-ads&utm_campaign=AMP%20Plugin" target="_blank">
27
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/click.png" /></div>
28
- <div class="extension_desc">
29
- <h2>Advanced AMP ADS</h2>
30
- <p>Add Advertisement directly in the content</p>
31
- <div class="extension_btn">From: $29</div>
32
- </div>
33
- </a></li>
34
- <li class="second"><a href="http://ampforwp.com/contact-form-7/#utm_source=options-panel&utm_medium=extension-tab_cf7&utm_campaign=AMP%20Plugin" target="_blank">
35
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/cf7.png" /></div>
36
- <div class="extension_desc">
37
- <h2>Contact Form 7</h2>
38
- <p>Add Contact Us Form in AMP.</p>
39
- <div class="extension_btn">From: $39</div>
40
- </div>
41
- </a></li>
42
- <li class="second"><a href="http://ampforwp.com/gravity-forms/#utm_source=options-panel&utm_medium=extension-tab_gf&utm_campaign=AMP%20Plugin" target="_blank">
43
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/gf.png" /></div>
44
- <div class="extension_desc">
45
- <h2>Gravity Forms</h2>
46
- <p>Add Gravity Forms Support in AMP.</p>
47
- <div class="extension_btn">From: $79</div>
48
- </div>
49
- </a></li>
50
- <li class="first"><a href="http://ampforwp.com/opt-in-forms/#utm_source=options-panel&utm_medium=extension-tab_opt-in-forms&utm_campaign=AMP%20Plugin" target="_blank">
51
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/email.png" /></div>
52
- <div class="extension_desc">
53
- <h2>Email Opt-in Forms</h2>
54
- <p>Capture Leads with Email Subscription.</p>
55
- <div class="extension_btn">From: $79</div>
56
- </div>
57
- </a></li>
58
- <li class="second"><a href="http://ampforwp.com/call-to-action/#utm_source=options-panel&utm_medium=extension-tab_amp-cta&utm_campaign=AMP%20Plugin" target="_blank">
59
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/mac-click.png" /></div>
60
- <div class="extension_desc">
61
- <h2>Call To Action (CTA)</h2>
62
- <p>Higher Visibility & More Conversions</p>
63
- <div class="extension_btn">From: $29</div>
64
- </div>
65
- </a></li>
66
- <li class="first"><a href="http://ampforwp.com/custom-post-type/#utm_source=options-panel&utm_medium=extension-tab_custom-post-type&utm_campaign=AMP%20Plugin" target="_blank">
67
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/comments.png" /></div>
68
- <div class="extension_desc">
69
- <h2>Custom Post Type</h2>
70
- <p>Enable Custom Post type support in AMP.</p>
71
- <div class="extension_btn">From: $19</div>
72
- </div>
73
- </a></li>
74
-
75
- <li class="second"><a href="http://ampforwp.com/acf-amp/#utm_source=options-panel&utm_medium=extension-tab_opt-in-forms&utm_campaign=AMP%20Plugin" target="_blank">
76
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/acf.png" /></div>
77
- <div class="extension_desc">
78
- <h2>Advanced Custom Fields</h2>
79
- <p>Easily add ACF support in AMP.</p>
80
- <div class="extension_btn">From: $29</div>
81
- </div>
82
- </a></li>
83
- <li class="first"><a href="http://ampforwp.com/doubleclick-for-publishers/#utm_source=options-panel&utm_medium=extension-tab_doubleclick&utm_campaign=AMP%20Plugin" target="_blank">
84
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/dfp.png" /></div>
85
- <div class="extension_desc">
86
- <h2>DoubleClick For Publishers</h2>
87
- <p>Enable DFP Support for AMP.</p>
88
- <div class="extension_btn">From: $19</div>
89
- </div>
90
- </a></li>
91
-
92
-
93
- <li class="second"><a href="http://ampforwp.com/amp-ratings/#utm_source=options-panel&utm_medium=extension-tab_amp-ratings&utm_campaign=AMP%20Plugin" target="_blank">
94
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/star.png" /></div>
95
- <div class="extension_desc">
96
- <h2>Star Ratings</h2>
97
- <p>Star Review Ratings for AMP.</p>
98
- <div class="extension_btn">From: $19</div>
99
- </div>
100
- </a></li>
101
- <li class="first"><a href="https://ampforwp.com/woocommerce/" target="_blank">
102
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/woo.png" /></div>
103
- <div class="extension_desc">
104
- <h2>AMP WooCommerce Pro</h2>
105
- <p>Advanced WooCommerce in AMP in two clicks.</p>
106
- <div class="extension_btn">From: $79</div>
107
- </div>
108
- </a></li>
109
-
110
- <li class="second"><a href="http://ampforwp.com/amp-category-base-remove-support/#utm_source=options-panel&utm_medium=extension-tab_amp-category-base-remove-support&utm_campaign=AMP%20Plugin" target="_blank">
111
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/puzzel.png" /></div>
112
- <div class="extension_desc">
113
- <h2>Category Base Removal</h2>
114
- <p>Remove Category Base Support in AMP</p>
115
- <div class="extension_btn">FREE</div>
116
- </div>
117
- </a></li>
118
- <li class="first"><a href="https://ampforwp.com/extensions/#utm_source=options-panel&utm_medium=extension-tab_amp-more-comingsoon&utm_campaign=AMP%20Plugin" target="_blank">
119
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/comments.png" /></div>
120
- <div class="extension_desc">
121
- <h2>View All Extensions</h2>
122
- <p>See all the extensions available for AMP</p>
123
- </div>
124
- </a></li>
125
-
126
-
127
- </ul>
128
- </div>
129
- ';
130
-
131
-
132
- $gettingstarted_extension_listing = '
133
- <div class="extension_listing getting_started_listing">
134
- <p style="font-size:13px">Take your AMP to the next level with these premium extensions which gives you advanced features.</p>
135
- <ul>
136
- <li class="first"><a href="http://ampforwp.com/advanced-amp-ads/#utm_source=options-panel&utm_medium=gettingstarted-amp-ads&utm_campaign=AMP%20Plugin" target="_blank">
137
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/click.png" /></div>
138
- <div class="extension_desc">
139
- <h2>Advanced AMP ADS</h2>
140
- <p>Add Advertisement directly in the content</p>
141
- <div class="extension_btn">From: $29</div>
142
- </div>
143
- </a></li>
144
- <li class="second"><a href="http://ampforwp.com/opt-in-forms/#utm_source=options-panel&utm_medium=gettingstarted_opt-in-forms&utm_campaign=AMP%20Plugin" target="_blank">
145
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/email.png" /></div>
146
- <div class="extension_desc">
147
- <h2>Email Opt-in Forms</h2>
148
- <p>Capture Leads with Email Subscription.</p>
149
- <div class="extension_btn">From: $79</div>
150
- </div>
151
- </a></li>
152
- <li class="first"><a href="http://ampforwp.com/call-to-action/#utm_source=options-panel&utm_medium=gettingstarted_amp-cta&utm_campaign=AMP%20Plugin" target="_blank">
153
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/mac-click.png" /></div>
154
- <div class="extension_desc">
155
- <h2>Call To Action (CTA)</h2>
156
- <p>Higher Visibility & More Conversions</p>
157
- <div class="extension_btn">From: $29</div>
158
- </div>
159
- </a></li>
160
- <li class="second"><a href="http://ampforwp.com/custom-post-type/#utm_source=options-panel&utm_medium=gettingstarted_custom-post-type&utm_campaign=AMP%20Plugin" target="_blank">
161
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/comments.png" /></div>
162
- <div class="extension_desc">
163
- <h2>Custom Post Type</h2>
164
- <p>Enable Custom Post type support in AMP.</p>
165
- <div class="extension_btn">From: $19</div>
166
- </div>
167
- </a></li>
168
-
169
- <li class="first"><a href="http://ampforwp.com/acf-amp/#utm_source=options-panel&utm_medium=gettingstarted_acf&utm_campaign=AMP%20Plugin" target="_blank">
170
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/acf.png" /></div>
171
- <div class="extension_desc">
172
- <h2>Advanced Custom Fields</h2>
173
- <p>Easily add ACF support in AMP.</p>
174
- <div class="extension_btn">From: $29</div>
175
- </div>
176
- </a></li>
177
- <li class="second"><a href="http://ampforwp.com/doubleclick-for-publishers/#utm_source=options-panel&utm_medium=gettingstarted_doubleclick&utm_campaign=AMP%20Plugin" target="_blank">
178
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/dfp.png" /></div>
179
- <div class="extension_desc">
180
- <h2>DoubleClick For Publishers</h2>
181
- <p>Enable DFP Support for AMP.</p>
182
- <div class="extension_btn">From: $19</div>
183
- </div>
184
- </a></li>
185
-
186
-
187
- <li class="first"><a href="http://ampforwp.com/amp-ratings/#utm_source=options-panel&utm_medium=gettingstarted_amp-ratings&utm_campaign=AMP%20Plugin" target="_blank">
188
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/star.png" /></div>
189
- <div class="extension_desc">
190
- <h2>Star Ratings</h2>
191
- <p>Star Review Ratings for AMP.</p>
192
- <div class="extension_btn">From: $19</div>
193
- </div>
194
- </a></li>
195
- <li class="second"><a href="https://ampforwp.com/woocommerce/" target="_blank">
196
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/woo.png" /></div>
197
- <div class="extension_desc">
198
- <h2>AMP WooCommerce Pro</h2>
199
- <p>Advanced WooCommerce in AMP in two clicks.</p>
200
- <div class="extension_btn">From: $79</div>
201
- </div>
202
- </a></li>
203
-
204
- <li class="first"><a href="http://ampforwp.com/amp-category-base-remove-support/#utm_source=options-panel&utm_medium=gettingstarted_amp-category-base-remove-support&utm_campaign=AMP%20Plugin" target="_blank">
205
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/puzzel.png" /></div>
206
- <div class="extension_desc">
207
- <h2>Category Base Removal</h2>
208
- <p>Remove Category Base Support in AMP</p>
209
- <div class="extension_btn">FREE</div>
210
- </div>
211
- </a></li>
212
- <li class="second"><a href="https://ampforwp.com/extensions/#utm_source=options-panel&utm_medium=gettingstarted_amp-more-comingsoon&utm_campaign=AMP%20Plugin" target="_blank">
213
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/comments.png" /></div>
214
- <div class="extension_desc">
215
- <h2>View All Extensions</h2>
216
- <p>See all the extensions available for AMP</p>
217
- <div class="extension_btn">View All</div> </div>
218
- </a></li>
219
-
220
-
221
- </ul>
222
- </div>
223
- ';
224
-
225
-
226
-
227
-
228
-
229
-
230
- $single_extension_listing = '
231
- <div class="extension_listing single_ex_listing">
232
- <h3>Increase the Revenue, Leads and Conversation with these Handpicked extensions</h3>
233
- <ul>
234
- <li class="first"><a href="http://ampforwp.com/advanced-amp-ads/#utm_source=options-panel&utm_medium=gettingstarted-amp-ads&utm_campaign=AMP%20Plugin" target="_blank">
235
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/click.png" /></div>
236
- <div class="extension_desc">
237
- <h2>Advanced AMP ADS</h2>
238
- <p>Add Advertisement directly in the content</p>
239
- <div class="extension_btn">View Details</div>
240
- </div>
241
- </a></li>
242
- <li class="second"><a href="http://ampforwp.com/opt-in-forms/#utm_source=options-panel&utm_medium=gettingstarted_opt-in-forms&utm_campaign=AMP%20Plugin" target="_blank">
243
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/email.png" /></div>
244
- <div class="extension_desc">
245
- <h2>Email Opt-in Forms</h2>
246
- <p>Capture Leads with Email Subscription.</p>
247
- <div class="extension_btn">View Details</div>
248
- </div>
249
- </a></li>
250
- <li class="first"><a href="http://ampforwp.com/call-to-action/#utm_source=options-panel&utm_medium=gettingstarted_amp-cta&utm_campaign=AMP%20Plugin" target="_blank">
251
- <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/mac-click.png" /></div>
252
- <div class="extension_desc">
253
- <h2>Call To Action (CTA)</h2>
254
- <p>Higher Visibility & More Conversions</p>
255
- <div class="extension_btn">View Details</div>
256
- </div>
257
- </a></li>
258
- </ul>
259
- </div>
260
- ';
261
-
262
- // All the possible arguments for Redux.
263
- //$amp_redux_header = '<span id="name"><span style="color: #4dbefa;">U</span>ltimate <span style="color: #4dbefa;">W</span>idgets</span>';
264
-
265
- $args = array(
266
- // TYPICAL -> Change these values as you need/desire
267
- 'opt_name' => 'redux_builder_amp', // This is where your data is stored in the database and also becomes your global variable name.
268
- 'display_name' => __( 'AMPforWP Options','accelerated-mobile-pages' ), // Name that appears at the top of your panel
269
- 'menu_type' => 'menu', //Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only)
270
- 'allow_sub_menu' => true, // Show the sections below the admin menu item or not
271
- 'menu_title' => __( 'AMP', 'accelerated-mobile-pages' ),
272
- 'page_title' => __('Accelerated Mobile Pages Options','accelerated-mobile-pages'),
273
- 'display_version' => AMPFORWP_VERSION,
274
- 'update_notice' => false,
275
- 'intro_text' => '<a href="http://ampforwp.com/tutorials/#utm_source=options-panel&utm_medium=tuts_link_btn&utm_campaign=AMP%20Plugin" target="_blank">'.__('View Documentation','accelerated-mobile-pages').'</a> | <a href="http://ampforwp.com/support/#utm_source=options-panel&utm_medium=contact_link_btn&utm_campaign=AMP%20Plugin" target="_blank">'.__('Contact','accelerated-mobile-pages').'</a> <a class="premium_features_btn" href="http://ampforwp.com/extensions/#utm_source=options-panel&utm_medium=view_premium_features_btn&utm_campaign=AMP%20Plugin">VIEW PREMIUM FEATURES</a> ',
276
- 'global_variable' => '', // Set a different name for your global variable other than the opt_name
277
- 'dev_mode' => false, // Show the time the page took to load, etc
278
- 'customizer' => false, // Enable basic customizer support,
279
- 'async_typography' => false, // Enable async for fonts,
280
- 'disable_save_warn' => true,
281
- 'open_expanded' => false,
282
- // OPTIONAL -> Give you extra features
283
- 'page_priority' => null, // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning.
284
- 'page_parent' => 'themes.php', // For a full list of options, visit: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters
285
- 'page_permissions' => 'manage_options', // Permissions needed to access the options panel.
286
- 'last_tab' => '', // Force your panel to always open to a specific tab (by id)
287
- 'page_icon' => 'icon-themes', // Icon displayed in the admin panel next to your menu_title
288
- 'page_slug' => 'amp_options', // Page slug used to denote the panel
289
- 'save_defaults' => true, // On load save the defaults to DB before user clicks save or not
290
- 'default_show' => false, // If true, shows the default value next to each field that is not the default value.
291
- 'default_mark' => '', // What to print by the field's title if the value shown is default. Suggested: *
292
- 'admin_bar' => false,
293
- 'admin_bar_icon' => 'dashicons-admin-generic',
294
- // CAREFUL -> These options are for advanced use only
295
- 'output' => false, // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output
296
- 'output_tag' => false, // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head
297
- //'domain' => 'redux-framework', // Translation domain key. Don't change this unless you want to retranslate all of Redux.
298
- 'footer_credit' => false, // Disable the footer credit of Redux. Please leave if you can help it.
299
- 'footer_text' => "",
300
- 'show_import_export' => true,
301
- 'system_info' => true,
302
-
303
- );
304
-
305
- $args['share_icons'][] = array(
306
- 'url' => 'https://github.com/ahmedkaludi/Accelerated-Mobile-Pages',
307
- 'title' => __('Visit us on GitHub','accelerated-mobile-pages'),
308
- 'icon' => 'el el-github'
309
- //'img' => '', // You can use icon OR img. IMG needs to be a full URL.
310
- );
311
-
312
-
313
- Redux::setArgs( "redux_builder_amp", $args );
314
-
315
-
316
-
317
-
318
- $tabs = array(
319
- array(
320
- 'id' => 'redux-help-tab-1',
321
- 'title' => __( 'Theme Information 1', 'accelerated-mobile-pages' ),
322
- 'content' => __( '<p>This is the tab content, HTML is allowed.</p>', 'accelerated-mobile-pages' )
323
- ),
324
- array(
325
- 'id' => 'redux-help-tab-2',
326
- 'title' => __( 'Theme Information 2', 'accelerated-mobile-pages' ),
327
- 'content' => __( '<p>This is the tab content, HTML is allowed.</p>', 'accelerated-mobile-pages' )
328
- )
329
- );
330
- Redux::setHelpTab( $opt_name, $tabs );
331
-
332
- // Set the help sidebar
333
- $content = __( '<p>This is the sidebar content, HTML is allowed.</p>', 'admin_folder' );
334
- Redux::setHelpSidebar( $opt_name, $content );
335
-
336
-
337
- /*
338
- * <--- END HELP TABS
339
- */
340
-
341
- /*
342
- *
343
- * ---> START SECTIONS
344
- *
345
- */
346
-
347
- Redux::setSection( $opt_name, array(
348
- 'title' => __( 'Basic Field', 'accelerated-mobile-pages' ),
349
- 'id' => 'basic',
350
- 'desc' => __( 'Basic field with no subsections.', 'accelerated-mobile-pages' ),
351
- 'icon' => 'el el-home',
352
- 'fields' => array(
353
- array(
354
- 'id' => 'opt-blank',
355
- 'title' => __( 'Example Text', 'accelerated-mobile-pages' ),
356
- 'desc' => __( 'Example description.', 'accelerated-mobile-pages' ),
357
- 'subtitle' => __( 'Example subtitle.', 'accelerated-mobile-pages' ),
358
- )
359
- )
360
- ) );
361
-
362
- Redux::setSection( $opt_name, array(
363
- 'title' => __( 'Settings', 'accelerated-mobile-pages' ),
364
- 'id' => 'basic',
365
- 'desc' => __( '<div class="amp-faq">Thank you for using Accelerated Mobile Pages plugin. '. ' ' .
366
-
367
- sprintf( __( ' <h2 style="width: 150px;float: right;
368
- padding: 8px 11px;background: #4CAF50;
369
- font-size: 13px;margin: -24px 0 0 10px;
370
- border-radius: 5px;line-height: 22px;"><a style="color: #fff;text-decoration: none;" href="https://wordpress.org/support/view/plugin-reviews/accelerated-mobile-pages?rate=5#postform">Like this plugin? <br /> Leave a 5 Star Rating</a></h2>We are actively working on updating the plugin. We have built user friendly options which allows you to make changes on your AMP version.', 'accelerated-mobile-pages' ), 'accelerated-mobile-pages' )
371
- . '<div style="width:100%;margin:20px 0px 10px 0px" class="getstarted_wrapper">
372
- <div class="getstarted_options">
373
- <p><b>Getting Started</b></p>
374
- <ul class="getstarted_ul">
375
- <li><a href="https://ampforwp.com/tutorials/article-categories/installation-updating/" target="_blank">Installation & Setup</a></li>
376
- <li><a href="https://ampforwp.com/tutorials/article-categories/settings-options/" target="_blank">Settings & Options</a></li>
377
- <li><a href="https://ampforwp.com/tutorials/article-categories/setup-amp/" target="_blank">Setup AMP</a></li>
378
- <li><a href="https://ampforwp.com/tutorials/article-categories/page-builder/" target="_blank">Page Builder</a></li>
379
- </ul>
380
- </div>
381
- <div class="getstarted_options">
382
- <p><b>Useful Links</b></p>
383
- <ul class="getstarted_ul">
384
- <li><a href="https://ampforwp.com/tutorials/article-categories/extension/" target="_blank">Extensions & Themes Docs</a></li>
385
- <li><a href="https://ampforwp.com/tutorials/article-categories/extending/" target="_blank">Developers Docs</a></li>
386
- <li><a href="https://ampforwp.com/amp-theme-framework/" target="_blank">Create a Custom Theme for AMP</a></li>
387
- <li><a href="https://ampforwp.com/tutorials/article-categories/how-to/" target="_blank">General How To\'s</a></li>
388
- </ul>
389
- </div>
390
- <div class="clear"></div>
391
- </div>'
392
- . '<p><strong>' . __( '1. <a href="https://ampforwp.com/priority-support/" target="_blank">Fixing AMP Validation Errors</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'We will personally take care that your website’s AMP version is perfectly validated. We will make sure that your AMP version gets approved and indexed by Google Webmaster Tools properly and we will even keep an eye on AMP updates from Google and implement them into your website.' ) . '</p>'
393
- . '<p><strong>' . __( '2. <a href="https://ampforwp.com/help/#support-forum" target="_blank">Community Support Forum</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'We have a special community support forum where you can ask us questions and get help about your AMP related questions. Delivering a good user experience means alot to us and so we try our best to reply each and every question that gets asked.' ) . '</p>'
394
- . '<p><strong>' . __( '3. <a href="https://ampforwp.com/help/#contact" target="_blank">Hire Us / Other queries</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'We try to answer each and every email, so remember to give us some time. For any other queries, please use the contact form. Please be descriptive as possible.' ) . '</p>'
395
- . '<p><strong>' . __( '4. <a href="http://ampforwp.com/new/" target="_blank"> What\'s New in this Version?</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'If you want to know whats new in the latest version of the plugin, then please use this link. ') . '</p>'
396
-
397
- . '</p></div>
398
- <br /><p><h3>Take AMP to the Next Level with Premium Extensions</h3></p>
399
- ' .$gettingstarted_extension_listing
400
-
401
- , 'accelerated-mobile-pages' ),
402
- 'icon' => 'el el-cogs'
403
- ) );
404
-
405
- function ampforwp_default_logo_settings($param=""){
406
- $custom_logo_id = '';
407
- $image = '';
408
- $value = '';
409
- $custom_logo_id = get_theme_mod( 'custom_logo' );
410
- $image = wp_get_attachment_image_src( $custom_logo_id , 'full');
411
- if( $image ){
412
- return $image[0];
413
- }
414
- return $value;
415
- }
416
- Redux::setSection( $opt_name, array(
417
- 'title' => __( 'General', 'accelerated-mobile-pages' ),
418
- // 'desc' => __( 'For full documentation on this field, visit: ', 'accelerated-mobile-pages' ) . '<a href="http://docs.reduxframework.com/core/fields/text/" target="_blank">http://docs.reduxframework.com/core/fields/text/</a>',
419
- 'id' => 'opt-text-subsection',
420
- 'subsection' => true,
421
- 'fields' => array(
422
-
423
- array(
424
- 'id' => 'opt-media',
425
- 'type' => 'media',
426
- 'url' => true,
427
- 'title' => __('Logo', 'accelerated-mobile-pages'),
428
- 'subtitle' => __('Upload a logo for the AMP version.', 'accelerated-mobile-pages'),
429
- 'desc' => __('Recommend logo size is: 190x36', 'accelerated-mobile-pages'),
430
- 'default' => array('url' => ampforwp_default_logo_settings() ),
431
- ),
432
- array(
433
- 'id' => 'ampforwp-custom-logo-dimensions',
434
- 'title' => __('Custom Logo Size', 'accelerated-mobile-pages'),
435
- 'type' => 'switch',
436
- 'default' => 0,
437
- ),
438
- array(
439
- 'id' => 'opt-media-width',
440
- 'type' => 'text',
441
- 'title' => __('Logo Width', 'accelerated-mobile-pages'),
442
- 'desc' => __('Default width is 190 pixels', 'accelerated-mobile-pages'),
443
- 'default' => '190',
444
- 'required'=>array('ampforwp-custom-logo-dimensions','=','1'),
445
- ),
446
- array(
447
- 'id' => 'opt-media-height',
448
- 'type' => 'text',
449
- 'title' => __('Logo Height', 'accelerated-mobile-pages'),
450
- 'desc' => __('Default height is 36 pixels', 'accelerated-mobile-pages'),
451
- 'default' => '36',
452
- 'required'=>array('ampforwp-custom-logo-dimensions','=','1'),
453
-
454
- ),
455
- array(
456
- 'id' => 'amp-support',
457
- 'type' => 'section',
458
- 'title' => __('AMP Support', 'accelerated-mobile-pages'),
459
- 'indent' => true,
460
- ),
461
- array(
462
- 'id' =>'amp-on-off-for-all-posts',
463
- 'type' => 'switch',
464
- 'title' => __('Posts', 'accelerated-mobile-pages'),
465
- 'subtitle' => __('Enable AMP Support on Posts', 'accelerated-mobile-pages'),
466
- 'default' => 1,
467
- // 'desc' => __( 'Re-Save permalink if you make changes in this option, please have a look <a href="https://ampforwp.com/flush-rewrite-urls/">here</a> on how to do it', 'accelerated-mobile-pages' ),
468
- ),
469
- array(
470
- 'id' =>'amp-on-off-for-all-pages',
471
- 'type' => 'switch',
472
- 'title' => __('Pages', 'accelerated-mobile-pages'),
473
- 'subtitle' => __('Enable AMP Support on Pages.', 'accelerated-mobile-pages'),
474
- 'default' => 1,
475
- // 'subtitle' => __( '<a href="https://ampforwp.com/flush-rewrite-urls/">Re-Save permalink</a> if you make changes in this option, please have a look here on how to do it', 'accelerated-mobile-pages' ),
476
- ),
477
- array(
478
- 'id' => 'ampforwp-homepage-on-off-support',
479
- 'type' => 'switch',
480
- 'title' => __('Homepage', 'accelerated-mobile-pages'),
481
- 'subtitle' => __('Enable AMP Support on Homepage.', 'accelerated-mobile-pages'),
482
- 'default' => '1'
483
- ),
484
- array(
485
- 'id' =>'amp-frontpage-select-option',
486
- 'type' => 'switch',
487
- 'title' => __('Custom Front Page', 'accelerated-mobile-pages'),
488
- 'default' => 0,
489
- 'subtitle' => __('Set Custom Front Page as Homepage', 'accelerated-mobile-pages'),
490
- 'true' => 'true',
491
- 'false' => 'false',
492
- 'required' => array('ampforwp-homepage-on-off-support','=','1'),
493
- // 'desc' => __( 'Re-Save permalink if front page or custom post page\'s pagination is not working. Please have a look <a href="https://ampforwp.com/flush-rewrite-urls/">here</a> on how to do it', 'accelerated-mobile-pages' ),
494
- ),
495
- array(
496
- 'id' => 'amp-frontpage-select-option-pages',
497
- 'type' => 'select',
498
- 'title' => __('Select Page as Front Page', 'accelerated-mobile-pages'),
499
- 'required' => array('amp-frontpage-select-option', '=' , '1'),
500
- // Must provide key => value pairs for select options
501
- 'data' => 'page',
502
- 'args' => array(
503
- 'post_type' => 'page',
504
- 'posts_per_page' => 500
505
- ),
506
- 'default' => '2',
507
- ),
508
- array(
509
- 'id' => 'ampforwp-title-on-front-page',
510
- 'type' => 'switch',
511
- 'url' => true,
512
- 'title' => __('Title on Static Front Page', 'accelerated-mobile-pages'),
513
- 'subtitle' => __('Enable/Disable display of title on the Static Front Page.', 'accelerated-mobile-pages'),
514
- 'default' => 0,
515
- 'required' => array('amp-frontpage-select-option', '=' , '1'),
516
- ),
517
- array(
518
- 'id' => 'ampforwp-archive-support',
519
- 'type' => 'switch',
520
- 'title' => __('Archives [Category & Tags]', 'accelerated-mobile-pages'),
521
- 'subtitle' => __('Enable AMP Support on Archives.', 'accelerated-mobile-pages'),
522
- 'default' => '0'
523
- ),
524
-
525
- // array(
526
- // 'id' => 'amp-ad-places',
527
- // 'type' => 'select',
528
- // 'title' => __( 'Ads on Page', 'accelerated-mobile-pages' ),
529
- // 'subtitle' => __( 'select your preferece for Ads on Post Types', 'accelerated-mobile-pages' ),
530
- // 'options' => array(
531
- // '1' => __('Only on Posts', 'accelerated-mobile-pages' ),
532
- // '2' => __('Only on Pages', 'accelerated-mobile-pages' ),
533
- // '3' => __('on Both', 'accelerated-mobile-pages' ),
534
- // ),
535
- // 'default' => '3'
536
- // ),
537
-
538
- )
539
- ) );//END
540
-
541
- // AMP Content Page Builder SECTION
542
- Redux::setSection( $opt_name, array(
543
- 'title' => __( 'Page Builder', 'accelerated-mobile-pages' ),
544
- 'desc' => __( 'With AMP Content Builder, you can easily build landing pages for AMP. <a href="https://ampforwp.com/tutorials/article/amp-page-builder-installation/">(See Video Tutorial)</a>' , 'accelerated-mobile-pages'),
545
- 'id' => 'amp-content-builder',
546
- 'class' => 'amp_content_builder',
547
- 'subsection' => true,
548
- 'fields' => array(
549
-
550
- array(
551
- 'id' => 'ampforwp-content-builder',
552
- 'type' => 'switch',
553
- 'title' => __('Legacy Page Builder (widgets)', 'accelerated-mobile-pages'),
554
- 'subtitle' => __('Build AMP Landing pages in minutes.', 'accelerated-mobile-pages'),
555
- 'true' => 'true',
556
- 'desc' => '<div style=" background: #FFF9C4;
557
- display: inline-block;
558
- padding: 10px 20px;
559
- margin-top: 15px;
560
- left: 0;
561
- line-height: 1.6;
562
- position: absolute;
563
- left: 20px;
564
- font-size: 15px;"><b>Introducing AMP Page Builder 2.0</b>, Re-Engineered! <br /> <a href="https://ampforwp.com/tutorials/article/amp-page-builder-installation/" target="_blank">Learn how to use this Feature</a></div>
565
-
566
- <iframe style=" position: absolute;
567
- left: 20px;
568
- margin-top: 100px;" width="600" height="400" src="https://www.youtube.com/embed/vAGPFKKm5G4" frameborder="0" allowfullscreen></iframe>
569
-
570
- ',
571
- 'false' => 'false',
572
- 'default' => 0
573
- ),
574
- )
575
- )
576
-
577
- ) ;
578
-
579
- $AD_URL = "http://ampforwp.com/advanced-amp-ads/#utm_source=options-panel&utm_medium=advertisement-tab&utm_campaign=AMP%20Plugin";
580
- $desc = '';
581
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
582
- if(!is_plugin_active( 'amp-incontent-ads/amptoolkit-incontent-ads.php' ) ){
583
-
584
- $desc = '<a href="'.$AD_URL.'" target="_blank"><img class="ampforwp-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/amp-ads-retina.png" width="560" height="85" /></a>';
585
- }
586
-
587
- // ADS SECTION
588
- Redux::setSection( $opt_name, array(
589
- 'title' => __( 'Advertisement', 'accelerated-mobile-pages' ),
590
- 'desc' => $desc,
591
- 'id' => 'amp-ads',
592
- 'subsection' => true,
593
- 'fields' => array(
594
- // Ad 1 Starts
595
- array(
596
- 'id' =>'ampforwp-ads-data-loading-strategy',
597
- 'type' => 'switch',
598
- 'title' => __('Optimize For Viewability', 'accelerated-mobile-pages'),
599
- 'default' => 0,
600
- 'subtitle' => __('This will increase the loading speed of the Ads', 'accelerated-mobile-pages'),
601
- 'true' => 'Enabled',
602
- 'false' => 'Disabled',
603
- ),
604
- array(
605
- 'id' =>'enable-amp-ads-1',
606
- 'type' => 'switch',
607
- 'title' => __('AD #1', 'accelerated-mobile-pages'),
608
- 'default' => 0,
609
- 'subtitle' => __('Below the Header (SiteWide)', 'accelerated-mobile-pages'),
610
- 'true' => 'Enabled',
611
- 'false' => 'Disabled',
612
- ),
613
- array(
614
- 'id' => 'enable-amp-ads-select-1',
615
- 'type' => 'select',
616
- 'title' => __('AD Size', 'accelerated-mobile-pages'),
617
- 'required' => array('enable-amp-ads-1', '=' , '1'),
618
- // Must provide key => value pairs for select options
619
- 'options' => array(
620
- '1' => __('300x250','accelerated-mobile-pages'),
621
- '2' => __('336x280','accelerated-mobile-pages'),
622
- '3' => __('728x90','accelerated-mobile-pages'),
623
- '4' => __('300x600','accelerated-mobile-pages'),
624
- '5' => __('320x100','accelerated-mobile-pages'),
625
- '6' => __('200x50','accelerated-mobile-pages'),
626
- '7' => __('320x50','accelerated-mobile-pages'), ),
627
- 'default' => '2',
628
- ),
629
- array(
630
- 'id' =>'enable-amp-ads-text-feild-client-1',
631
- 'type' => 'text',
632
- 'required' => array('enable-amp-ads-1', '=' , '1'),
633
- 'title' => __('Data AD Client', 'accelerated-mobile-pages'),
634
- 'subtitle' => __('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
635
- 'default' => '',
636
- 'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
637
- ),
638
- array(
639
- 'id' => 'enable-amp-ads-text-feild-slot-1',
640
- 'type' => 'text',
641
- 'title' => __('Data AD Slot', 'accelerated-mobile-pages'),
642
- 'subtitle' => __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code.', 'accelerated-mobile-pages'),
643
- 'default' => '',
644
- 'required' => array('enable-amp-ads-1', '=' , '1'),
645
- 'placeholder'=> '70XXXXXX12'
646
- ),
647
- // Ad 1 ends
648
-
649
- // Ad 2 Starts
650
- array(
651
- 'id'=>'enable-amp-ads-2',
652
- 'type' => 'switch',
653
- 'title' => __('AD #2', 'accelerated-mobile-pages'),
654
- 'default' => 0,
655
- 'subtitle' => __('Below the Footer (SiteWide)', 'accelerated-mobile-pages'),
656
- 'true' => 'Enabled',
657
- 'false' => 'Disabled',
658
- ),
659
- array(
660
- 'id' => 'enable-amp-ads-select-2',
661
- 'type' => 'select',
662
- 'title' => __('AD Size', 'accelerated-mobile-pages'),
663
- 'required' => array('enable-amp-ads-2', '=' , '1'),
664
- // Must provide key => value pairs for select options
665
- 'options' => array(
666
- '1' => '300x250',
667
- '2' => '336x280',
668
- '3' => '728x90',
669
- '4' => '300x600',
670
- '5' => '320x100',
671
- '6' => '200x50',
672
- '7' => '320x50'
673
- ),
674
- 'default' => '2',
675
- ),
676
- array(
677
- 'id' =>'enable-amp-ads-text-feild-client-2',
678
- 'type' => 'text',
679
- 'required' => array('enable-amp-ads-2', '=' , '1'),
680
- 'title' => __('Data AD Client', 'accelerated-mobile-pages'),
681
- 'subtitle' => __('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
682
- 'default' => '',
683
- 'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
684
- ),
685
- array(
686
- 'id' => 'enable-amp-ads-text-feild-slot-2',
687
- 'type' => 'text',
688
- 'title' => __('Data AD Slot', 'accelerated-mobile-pages'),
689
- 'subtitle' => __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code.', 'accelerated-mobile-pages'),
690
- 'default' => '',
691
- 'required' => array('enable-amp-ads-2', '=' , '1'),
692
- 'placeholder'=> '70XXXXXX12'
693
- ),
694
- // Ad 2 ends
695
-
696
- // Ad 3 starts
697
- array(
698
- 'id' => 'enable-amp-ads-3',
699
- 'type' => 'switch',
700
- 'title' => __('AD #3', 'accelerated-mobile-pages'),
701
- 'default' => 0,
702
- 'subtitle' => __('Above the Post Content (Single Post)', 'accelerated-mobile-pages'),
703
- 'true' => 'Enabled',
704
- 'false' => 'Disabled',
705
- ),
706
- array(
707
- 'id' => 'enable-amp-ads-select-3',
708
- 'type' => 'select',
709
- 'title' => __('AD Size', 'accelerated-mobile-pages'),
710
- 'required' => array('enable-amp-ads-3', '=' , '1'),
711
- // Must provide key => value pairs for select options
712
- 'options' => array(
713
- '1' => '300x250',
714
- '2' => '336x280',
715
- '3' => '728x90',
716
- '4' => '300x600',
717
- '5' => '320x100',
718
- '6' => '200x50',
719
- '7' => '320x50'
720
- ),
721
- 'default' => '2',
722
- ),
723
- array(
724
- 'id' =>'enable-amp-ads-text-feild-client-3',
725
- 'type' => 'text',
726
- 'required' => array('enable-amp-ads-3', '=' , '1'),
727
- 'title' => __('Data AD Client', 'accelerated-mobile-pages'),
728
- 'subtitle' => __('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
729
- 'default' => '',
730
- 'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
731
- ),
732
- array(
733
- 'id' => 'enable-amp-ads-text-feild-slot-3',
734
- 'type' => 'text',
735
- 'title' => __('Data AD Slot', 'accelerated-mobile-pages'),
736
- 'subtitle' => __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code.', 'accelerated-mobile-pages'),
737
- 'default' => '',
738
- 'required' => array('enable-amp-ads-3', '=' , '1'),
739
- 'placeholder'=> '70XXXXXX12'
740
- ),
741
- // Ad 3 ends
742
-
743
- // Ad 4 Starts
744
- array(
745
- 'id' => 'enable-amp-ads-4',
746
- 'type' => 'switch',
747
- 'title' => __('AD #4', 'accelerated-mobile-pages'),
748
- 'default' => 0,
749
- 'subtitle' => __('Below the Post Content (Single Post)', 'accelerated-mobile-pages'),
750
- 'true' => 'Enabled',
751
- 'false' => 'Disabled',
752
- ),
753
- array(
754
- 'id' => 'enable-amp-ads-select-4',
755
- 'type' => 'select',
756
- 'title' => __('AD Size', 'accelerated-mobile-pages'),
757
- 'required' => array('enable-amp-ads-4', '=' , '1'),
758
- // Must provide key => value pairs for select options
759
- 'options' => array(
760
- '1' => __('300x250','accelerated-mobile-pages'),
761
- '2' => __('336x280','accelerated-mobile-pages'),
762
- '3' => __('728x90','accelerated-mobile-pages'),
763
- '4' => __('300x600','accelerated-mobile-pages'),
764
- '5' => __('320x100','accelerated-mobile-pages'),
765
- '6' => __('200x50','accelerated-mobile-pages'),
766
- '7' => __('320x50','accelerated-mobile-pages')
767
- ),
768
- 'default' => '2',
769
- ),
770
- array(
771
- 'id' =>'enable-amp-ads-text-feild-client-4',
772
- 'type' => 'text',
773
- 'required' => array('enable-amp-ads-4', '=' , '1'),
774
- 'title' => __('Data AD Client', 'accelerated-mobile-pages'),
775
- 'subtitle' => __('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
776
- 'default' => '',
777
- 'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
778
- ),
779
- array(
780
- 'id' => 'enable-amp-ads-text-feild-slot-4',
781
- 'type' => 'text',
782
- 'title' => __('Data AD Slot', 'accelerated-mobile-pages'),
783
- 'subtitle' => __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. ', 'accelerated-mobile-pages'),
784
- 'default' => '',
785
- 'required' => array('enable-amp-ads-4', '=' , '1'),
786
- 'placeholder'=> '70XXXXXX12'
787
- ),
788
- // Ad 4 ends
789
-
790
- //Ad 5 Starts
791
- array(
792
- 'id' => 'enable-amp-ads-5',
793
- 'type' => 'switch',
794
- 'title' => __('AD #5', 'accelerated-mobile-pages'),
795
- 'default' => 0,
796
- 'subtitle' => __('Below The Title (Single Post)', 'accelerated-mobile-pages'),
797
- 'true' => 'Enabled',
798
- 'false' => 'Disabled',
799
- ),
800
- array(
801
- 'id' => 'enable-amp-ads-select-5',
802
- 'type' => 'select',
803
- 'title' => __('AD Size', 'accelerated-mobile-pages'),
804
- 'required' => array('enable-amp-ads-5', '=' , '1'),
805
- // Must provide key => value pairs for select options
806
- 'options' => array(
807
- '1' => __('300x250','accelerated-mobile-pages'),
808
- '2' => __('336x280','accelerated-mobile-pages'),
809
- '3' => __('728x90','accelerated-mobile-pages'),
810
- '4' => __('300x600','accelerated-mobile-pages'),
811
- '5' => __('320x100','accelerated-mobile-pages'),
812
- '6' => __('200x50','accelerated-mobile-pages'),
813
- '7' => __('320x50','accelerated-mobile-pages')
814
- ),
815
- 'default' => '2',
816
- ),
817
- array(
818
- 'id' =>'enable-amp-ads-text-feild-client-5',
819
- 'type' => 'text',
820
- 'required' => array('enable-amp-ads-5', '=' , '1'),
821
- 'title' => __('Data AD Client', 'accelerated-mobile-pages'),
822
- 'subtitle' => __('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
823
- 'default' => '',
824
- 'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
825
- ),
826
- array(
827
- 'id' => 'enable-amp-ads-text-feild-slot-5',
828
- 'type' => 'text',
829
- 'title' => __('Data AD Slot', 'accelerated-mobile-pages'),
830
- 'subtitle' => __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. ', 'accelerated-mobile-pages'),
831
- 'default' => '',
832
- 'required' => array('enable-amp-ads-5', '=' , '1'),
833
- 'placeholder'=> '70XXXXXX12'
834
- ),
835
-
836
- //Ad 6 Starts
837
- array(
838
- 'id' => 'enable-amp-ads-6',
839
- 'type' => 'switch',
840
- 'title' => __('AD #6', 'accelerated-mobile-pages'),
841
- 'default' => 0,
842
- 'subtitle' => __('Above the Related Posts (Single Post)', 'accelerated-mobile-pages'),
843
- 'true' => 'Enabled',
844
- 'false' => 'Disabled',
845
- ),
846
- array(
847
- 'id' => 'enable-amp-ads-select-6',
848
- 'type' => 'select',
849
- 'title' => __('AD Size', 'accelerated-mobile-pages'),
850
- 'required' => array('enable-amp-ads-6', '=' , '1'),
851
- // Must provide key => value pairs for select options
852
- 'options' => array(
853
- '1' => __('300x250','accelerated-mobile-pages'),
854
- '2' => __('336x280','accelerated-mobile-pages'),
855
- '3' => __('728x90','accelerated-mobile-pages'),
856
- '4' => __('300x600','accelerated-mobile-pages'),
857
- '5' => __('320x100','accelerated-mobile-pages'),
858
- '6' => __('200x50','accelerated-mobile-pages'),
859
- '7' => __('320x50','accelerated-mobile-pages')
860
- ),
861
- 'default' => '2',
862
- ),
863
- array(
864
- 'id' =>'enable-amp-ads-text-feild-client-6',
865
- 'type' => 'text',
866
- 'required' => array('enable-amp-ads-6', '=' , '1'),
867
- 'title' => __('Data AD Client', 'accelerated-mobile-pages'),
868
- 'subtitle' => __('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
869
- 'default' => '',
870
- 'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
871
- ),
872
- array(
873
- 'id' => 'enable-amp-ads-text-feild-slot-6',
874
- 'type' => 'text',
875
- 'title' => __('Data AD Slot', 'accelerated-mobile-pages'),
876
- 'subtitle' => __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. ', 'accelerated-mobile-pages'),
877
- 'default' => '',
878
- 'required' => array('enable-amp-ads-6', '=' , '1'),
879
- 'placeholder'=> '70XXXXXX12'
880
- )
881
-
882
-
883
- ),
884
- ) );
885
-
886
- // SEO SECTION
887
- Redux::setSection( $opt_name, array(
888
- 'title' => __( 'SEO', 'accelerated-mobile-pages' ),
889
- 'id' => 'amp-seo',
890
- 'subsection' => true,
891
- 'fields' => array(
892
-
893
- array(
894
- 'id' => 'ampforwp-seo-meta-description',
895
- 'type' => 'switch',
896
- 'title' => __('Meta Description', 'accelerated-mobile-pages'),
897
- 'subtitle' => __('The meta tag that displays in head', 'accelerated-mobile-pages'),
898
- 'default' => 0
899
- ),
900
-
901
- array(
902
- 'id' => 'ampforwp-seo-custom-additional-meta',
903
- 'type' => 'textarea',
904
- 'title' => __('Additional tags for Head section AMP page', 'accelerated-mobile-pages'),
905
- 'subtitle' => __('Adds additional Meta to the head section', 'accelerated-mobile-pages', 'accelerated-mobile-pages'),
906
- 'desc' => __('Only link and meta tags allowed', 'accelerated-mobile-pages'),
907
- 'placeholder' => __('<!-- Paste your Additional HTML , that goes between <head> </head> tags -->','accelerated-mobile-pages')
908
- ),
909
-
910
-
911
- array(
912
- 'id' => 'ampforwp-yoast-seo-sub-section',
913
- 'type' => 'section',
914
- 'title' => __('Yoast SEO Options', 'accelerated-mobile-pages'),
915
- 'indent' => true
916
- ),
917
-
918
- array(
919
- 'id' => 'ampforwp-seo-yoast-meta',
920
- 'type' => 'switch',
921
- 'subtitle' => __('Adds Social and Open Graph Meta Tags from Yoast', 'accelerated-mobile-pages'),
922
- 'title' => __( 'Meta Tags from Yoast', 'accelerated-mobile-pages' ),
923
- 'default' => '1'
924
- ),
925
- array(
926
- 'id' => 'ampforwp-seo-yoast-description',
927
- 'type' => 'switch',
928
- 'subtitle' => __('Adds Yoast Custom description to ld+json for AMP page', 'accelerated-mobile-pages'),
929
- 'title' => __( 'Yoast Description in ld+json', 'accelerated-mobile-pages' ),
930
- 'default' => 0
931
- ),
932
-
933
- array(
934
- 'id' => 'ampforwp-seo-index-noindex-sub-section',
935
- 'type' => 'section',
936
- 'title' => __('Advanced Index & No Index Options', 'accelerated-mobile-pages'),
937
- 'indent' => true
938
- ),
939
- array(
940
- 'id' => 'ampforwp-robots-archive-sub-pages-sitewide',
941
- 'type' => 'switch',
942
- 'title' => __('Archive subpages (sitewide)', 'accelerated-mobile-pages'),
943
- 'subtitle' => __("Such as /page/2 so on and so forth",'accelerated-mobile-pages'),
944
- 'default' => 0,
945
- 'on' => 'index',
946
- 'off' => 'noindex'
947
- ),
948
- array(
949
- 'id' => 'ampforwp-robots-archive-author-pages',
950
- 'type' => 'switch',
951
- 'title' => __('Author Archive pages', 'accelerated-mobile-pages'),
952
- 'default' => 1,
953
- 'on' => 'index',
954
- 'off' => 'noindex'
955
-
956
- ),
957
- array(
958
- 'id' => 'ampforwp-robots-archive-date-pages',
959
- 'type' => 'switch',
960
- 'title' => __('Date Archive pages', 'accelerated-mobile-pages'),
961
- 'default' => 1,
962
- 'on' => 'index',
963
- 'off' => 'noindex'
964
-
965
- ),
966
- array(
967
- 'id' => 'ampforwp-robots-archive-category-pages',
968
- 'type' => 'switch',
969
- 'title' => __('Categories', 'accelerated-mobile-pages'),
970
- 'default' => 1,
971
- 'on' => 'index',
972
- 'off' => 'noindex'
973
- ),
974
- array(
975
- 'id' => 'ampforwp-robots-archive-tag-pages',
976
- 'type' => 'switch',
977
- 'title' => __('Tags', 'accelerated-mobile-pages'),
978
- 'default' => 1,
979
- 'on' => 'index',
980
- 'off' => 'noindex'
981
- ),
982
-
983
-
984
- )
985
-
986
- )
987
-
988
- );
989
-
990
- // SEO SECTION
991
- Redux::setSection( $opt_name, array(
992
- 'title' => __( 'Performance', 'accelerated-mobile-pages' ),
993
- 'id' => 'amp-performance',
994
- 'subsection' => true,
995
- 'fields' => array(
996
-
997
- array(
998
- 'id' => 'ampforwp_cache_minimize_mode',
999
- 'type' => 'switch',
1000
- 'title' => __('Minify AMP Page', 'accelerated-mobile-pages'),
1001
- 'subtitle' => __('Improve the Page Speed and Loading time with Minification option', 'accelerated-mobile-pages'),
1002
- 'default' => 0
1003
- ),
1004
-
1005
- )
1006
-
1007
- )
1008
-
1009
- );
1010
-
1011
- // Analytics SECTION
1012
- Redux::setSection( $opt_name, array(
1013
- 'title' => __('Analytics'),
1014
- // 'icon' => 'el el-th-large',
1015
- 'desc' => __('You can either use Google Tag Manager or Other Analytics Providers','accelerated-mobile-pages'),
1016
- 'subsection' => true,
1017
- 'fields' =>
1018
- array(
1019
-
1020
-
1021
- array(
1022
- 'id' => 'amp-analytics-select-option',
1023
- 'type' => 'select',
1024
- 'title' => __( 'Analytics Type', 'accelerated-mobile-pages' ),
1025
- 'subtitle' => __( 'Select your Analytics provider.', 'accelerated-mobile-pages' ),
1026
- 'options' => array(
1027
- '1' => __('Google Analytics', 'accelerated-mobile-pages' ),
1028
- '2' => __('Segment Analytics', 'accelerated-mobile-pages' ),
1029
- '3' => __('Piwik Analytics', 'accelerated-mobile-pages' ),
1030
- '4' => __('Quantcast Measurement', 'accelerated-mobile-pages' ),
1031
- '5' => __('comScore', 'accelerated-mobile-pages' ),
1032
- '6' => __('Effective Measure', 'accelerated-mobile-pages' ),
1033
- '7' => __('StatCounter', 'accelerated-mobile-pages' ),
1034
- '8' => __('Histats Analytics', 'accelerated-mobile-pages'),
1035
- '9' => __('Yandex Metrika', 'accelerated-mobile-pages'),
1036
- '10' => __('Chartbeat Analytics', 'accelerated-mobile-pages'),
1037
- ),
1038
- 'required' => array(
1039
- array('amp-use-gtm-option', '=' , '0'),
1040
- ),
1041
- 'default' => '1',
1042
- ),
1043
- array(
1044
- 'id' => 'ga-feild',
1045
- 'type' => 'text',
1046
- 'title' => __( 'Google Analytics', 'accelerated-mobile-pages' ),
1047
- 'required' => array(
1048
- array('amp-use-gtm-option', '=' , '0'),
1049
- array('amp-analytics-select-option', '=' , '1')
1050
- ),
1051
- 'subtitle' => __( 'Enter your Google Analytics ID.', 'accelerated-mobile-pages' ),
1052
- 'desc' => __('Example: UA-XXXXX-Y', 'accelerated-mobile-pages' ),
1053
- 'default' => 'UA-XXXXX-Y',
1054
- ),
1055
-
1056
- // Advance Tracking options for Google Analytics
1057
- array(
1058
- 'id' => 'ampforwp-ga-field-advance-switch',
1059
- 'type' => 'switch',
1060
- 'title' => __( 'Advanced Analytics Tracking Event Options', 'accelerated-mobile-pages' ),
1061
- 'required' => array(
1062
- array('amp-use-gtm-option', '=' , '0'),
1063
- array('amp-analytics-select-option', '=' , '1')
1064
- ),
1065
- 'subtitle' => __( 'Enable the Advance Tracking options', 'accelerated-mobile-pages' ),
1066
- 'default' => 0,
1067
- ),
1068
- array(
1069
- 'id' => 'ampforwp-ga-field-advance',
1070
- 'type' => 'ace_editor',
1071
- 'title' => __('Advance Google Analytics', 'accelerated-mobile-pages'),
1072
- 'required' => array(
1073
- array('amp-use-gtm-option', '=' , '0'),
1074
- array('amp-analytics-select-option', '=' , '1'),
1075
- array('ampforwp-ga-field-advance-switch', '=' , '1')
1076
- ),
1077
- 'subtitle' => __('Enter the Advance Tracking options', 'accelerated-mobile-pages'),
1078
- 'mode' => 'javascript',
1079
- 'theme' => 'monokai',
1080
- 'desc' => '',
1081
- 'default' => __('','accelerated-mobile-pages')
1082
- ),
1083
- array(
1084
- 'id' => 'sa-feild',
1085
- 'type' => 'text',
1086
- 'title' => __( 'Segment Analytics', 'accelerated-mobile-pages' ),
1087
- 'subtitle' => __( 'Enter your Segment Analytics Key.', 'accelerated-mobile-pages' ),
1088
- 'required' => array(
1089
- array('amp-use-gtm-option', '=' , '0'),
1090
- array('amp-analytics-select-option', '=' , '2')
1091
- ),
1092
- 'default' => 'SEGMENT-WRITE-KEY',
1093
- ),
1094
- array(
1095
- 'id' => 'pa-feild',
1096
- 'type' => 'text',
1097
- 'title' => __( 'Piwik Analytics', 'accelerated-mobile-pages' ),
1098
- 'required' => array(
1099
- array('amp-use-gtm-option', '=' , '0'),
1100
- array('amp-analytics-select-option', '=' , '3')
1101
- ),
1102
- 'desc' => __( 'Example: https://piwik.example.org/piwik.php?idsite=YOUR_SITE_ID&rec=1&action_name=TITLE&urlref=DOCUMENT_REFERRER&url=CANONICAL_URL&rand=RANDOM', 'accelerated-mobile-pages' ),
1103
- 'subtitle' => __('Enter your Piwik Analytics URL.', 'accelerated-mobile-pages' ),
1104
- 'default' => '#',
1105
- ),
1106
- array(
1107
- 'id' => 'eam-feild',
1108
- 'type' => 'text',
1109
- 'title' => __( 'Effective Measure Analytics', 'accelerated-mobile-pages' ),
1110
- 'required' => array(
1111
- array('amp-use-gtm-option', '=' , '0'),
1112
- array('amp-analytics-select-option', '=' , '6')
1113
- ),
1114
- 'desc' => __( 'Example: https://s.effectivemeasure.net/d/6/i?pu=CANONICAL_URL&ru=DOCUMENT_REFERRER&rnd=RANDOM', 'accelerated-mobile-pages' ),
1115
- 'subtitle' => __('Enter your Effective Measure URL.', 'accelerated-mobile-pages' ),
1116
- 'default' => '#',
1117
- ),
1118
- array(
1119
- 'id' => 'sc-feild',
1120
- 'type' => 'text',
1121
- 'title' => __( 'StatCounter', 'accelerated-mobile-pages' ),
1122
- 'required' => array(
1123
- array('amp-use-gtm-option', '=' , '0'),
1124
- array('amp-analytics-select-option', '=' , '7')
1125
- ),
1126
- 'desc' => __( 'Example: https://c.statcounter.com/PROJECT_ID/0/SECURITY_CODE/1/', 'accelerated-mobile-pages' ),
1127
- 'subtitle' => __('Enter your StatCounter URL.', 'accelerated-mobile-pages' ),
1128
- 'default' => '#',
1129
- ),
1130
-
1131
- array(
1132
- 'id' =>'amp-quantcast-analytics-code',
1133
- 'type' => 'text',
1134
- 'title' => __('p-code','accelerated-mobile-pages'),
1135
- 'default' => '',
1136
- 'required' => array(
1137
- array('amp-analytics-select-option', '=' , '4')),
1138
- ),
1139
- array(
1140
- 'id' =>'amp-comscore-analytics-code-c1',
1141
- 'type' => 'text',
1142
- 'title' => __('C1','accelerated-mobile-pages'),
1143
- 'default' => 1,
1144
- 'required' => array(
1145
- array('amp-analytics-select-option', '=' , '5')),
1146
- ),
1147
- array(
1148
- 'id' =>'amp-comscore-analytics-code-c2',
1149
- 'type' => 'text',
1150
- 'title' => __('C2','accelerated-mobile-pages'),
1151
- 'default' => '',
1152
- 'required' => array(
1153
- array('amp-analytics-select-option', '=' , '5')),
1154
- ),
1155
- array(
1156
- 'id' => 'histats-feild',
1157
- 'type' => 'text',
1158
- 'title' => __( 'Histats Analytics', 'accelerated-mobile-pages' ),
1159
- 'required' => array(
1160
- array('amp-use-gtm-option', '=' , '0'),
1161
- array('amp-analytics-select-option', '=' , '8')
1162
- ),
1163
- 'subtitle' => __( 'Enter your Histats Analytics ID.', 'accelerated-mobile-pages' ),
1164
- 'desc' => 'Tutorial: <a href="https://ampforwp.com/tutorials/how-to-get-histats-analytics-id/">How to get Histats Analytics ID for AMP?</a>',
1165
- 'default' => '',
1166
- ),
1167
- array(
1168
- 'id' =>'amp-Yandex-Metrika-analytics-code',
1169
- 'type' => 'text',
1170
- 'title' => __('Yandex Metrika Analytics ID','accelerated-mobile-pages'),
1171
- 'default' => '',
1172
- 'required' => array(
1173
- array('amp-use-gtm-option', '=' , '0'),
1174
- array('amp-analytics-select-option', '=' , '9')),
1175
- 'subtitle' => __( 'Enter your Counter ID.', 'accelerated-mobile-pages' ),
1176
- ),
1177
- array(
1178
- 'id' =>'amp-Chartbeat-analytics-code',
1179
- 'type' => 'text',
1180
- 'title' => __('Chartbeat Analytics ID','accelerated-mobile-pages'),
1181
- 'default' => '',
1182
- 'required' => array(
1183
- array('amp-use-gtm-option', '=' , '0'),
1184
- array('amp-analytics-select-option', '=' , '10')),
1185
- 'subtitle' => __( 'Enter your Account ID.', 'accelerated-mobile-pages' ),
1186
- ),
1187
-
1188
- //GTM
1189
- array(
1190
- 'id' => 'amp-use-gtm-option',
1191
- 'type' => 'switch',
1192
- 'title' => __( 'Google Tag Manager', 'accelerated-mobile-pages' ),
1193
- 'subtitle' => __( 'Select your Analytics provider.', 'accelerated-mobile-pages' ),
1194
- 'default' => 0,
1195
- ),
1196
- array(
1197
- 'id' =>'amp-gtm-id',
1198
- 'type' => 'text',
1199
- 'title' => __('Tag Manager ID (Container ID)','accelerated-mobile-pages'),
1200
- 'default' => '',
1201
- 'desc' => __('Eg: GTM-5XXXXXP (<a href="https://ampforwp.com/tutorials/article/gtm-in-amp/">Getting Started?</a>)','accelerated-mobile-pages'),
1202
- // 'validate' => 'not_empty',
1203
- 'required' => array(
1204
- array('amp-use-gtm-option', '=' , '1')
1205
- ),
1206
- ),
1207
- array(
1208
- 'id' =>'amp-gtm-analytics-type',
1209
- 'type' => 'text',
1210
- 'title' => __('Analytics Type','accelerated-mobile-pages'),
1211
- 'default' => '',
1212
- 'desc' => __('Eg: googleanalytics','accelerated-mobile-pages'),
1213
- // 'validate' => 'not_empty',
1214
- 'required' => array(
1215
- array('amp-use-gtm-option', '=' , '1')
1216
- ),
1217
- ),
1218
- array(
1219
- 'id' =>'amp-gtm-analytics-code',
1220
- 'type' => 'text',
1221
- 'title' => __('Analytics ID','accelerated-mobile-pages'),
1222
- 'default' => '',
1223
- 'desc' => 'Eg: UA-XXXXXX-Y',
1224
- // 'validate' => 'not_empty',
1225
- 'required' => array(
1226
- array('amp-use-gtm-option', '=' , '1')),
1227
- ),
1228
- // Google Cliend ID API
1229
- array(
1230
- 'id' => 'ampforwp-ga-clientid-api-gtm',
1231
- 'type' => 'info',
1232
- 'style' => 'info',
1233
- 'desc' => '<a href="https://ampforwp.com/tutorials/article/set-google-amp-client-id-api/" target="_blank">Check this Tutorial to set it up</a>',
1234
- 'title' => __('Set up Google AMP Client ID API', 'accelerated-mobile-pages'),
1235
- 'required' => array(
1236
- array('amp-use-gtm-option', '=' , '1'),
1237
- ),
1238
- ),
1239
- array(
1240
- 'id' =>'amp-fb-pixel',
1241
- 'type' => 'switch',
1242
- 'title' => __('Facebook Pixel','accelerated-mobile-pages'),
1243
- 'default' => 0,
1244
- ),
1245
- array(
1246
- 'id' =>'amp-fb-pixel-id',
1247
- 'type' => 'text',
1248
- 'title' => __('Facebook Pixel ID','accelerated-mobile-pages'),
1249
- 'default' => '',
1250
- 'desc' => 'Example: 153246987501548',
1251
- 'required' => array(
1252
- array('amp-fb-pixel', '=' , '1')),
1253
- ),
1254
-
1255
- )
1256
- )
1257
- );
1258
- //Get options for Structured Data Type
1259
- if( !function_exists('ampforwp_get_sd_types') ){
1260
- function ampforwp_get_sd_types(){
1261
- $options = array();
1262
- $options = array(
1263
- 'BlogPosting' => 'BlogPosting',
1264
- 'NewsArticle' => 'NewsArticle',
1265
- 'Recipe' => 'Recipe',
1266
- 'Product' => 'Product',
1267
- 'VideoObject' => 'VideoObject',
1268
- 'Article' => 'Article'
1269
- );
1270
- return $options;
1271
- }
1272
- }
1273
-
1274
- add_filter('ampforwp_sd_custom_fields', 'ampforwp_add_extra_fields');
1275
- function ampforwp_add_extra_fields($fields){
1276
- $post_types = '';
1277
- $custom_fields = array();
1278
- $extra_fields = array();
1279
- $post_types = get_option('ampforwp_custom_post_types');
1280
- if($post_types){
1281
- foreach ($post_types as $post_type) {
1282
- if( $post_type == 'post' || $post_type == 'page' ) {
1283
- continue;
1284
- }
1285
- $custom_fields[] = array(
1286
- 'id' => 'ampforwp-sd-type-'. $post_type,
1287
- 'type' => 'select',
1288
- 'title' => __($post_type, 'accelerated-mobile-pages'),
1289
- 'subtitle' => __('Select the Structured Data Type for '.$post_type, 'accelerated-mobile-pages'),
1290
- 'options' => ampforwp_get_sd_types(),
1291
- 'default' => 'BlogPosting',
1292
- );
1293
- $extra_fields = array_merge($extra_fields, $custom_fields);
1294
- }
1295
- }
1296
- array_splice($fields, 2, 0, $extra_fields);
1297
- return $fields;
1298
-
1299
- }
1300
- // Structured Data
1301
- Redux::setSection( $opt_name, array(
1302
- 'title' => __( 'Structured Data', 'accelerated-mobile-pages' ),
1303
- 'id' => 'opt-structured-data',
1304
- 'subsection' => true,
1305
- 'fields' => apply_filters('ampforwp_sd_custom_fields', $fields = array(
1306
- array(
1307
- 'id' => 'ampforwp-sd-type-posts',
1308
- 'type' => 'select',
1309
- 'title' => __('Posts', 'accelerated-mobile-pages'),
1310
- 'subtitle' => __('Select the Structured Data Type for Posts', 'accelerated-mobile-pages'),
1311
- 'options' => ampforwp_get_sd_types(),
1312
- 'default' => 'BlogPosting',
1313
- ),
1314
- array(
1315
- 'id' => 'ampforwp-sd-type-pages',
1316
- 'type' => 'select',
1317
- 'title' => __('Pages', 'accelerated-mobile-pages'),
1318
- 'subtitle' => __('Select the Structured Data Type for Pages', 'accelerated-mobile-pages'),
1319
- 'options' => ampforwp_get_sd_types(),
1320
- 'default' => 'BlogPosting',
1321
- ),
1322
- array(
1323
- 'id' => 'amp-structured-data-logo',
1324
- 'type' => 'media',
1325
- 'url' => true,
1326
- 'title' => __('Default Structured Data Logo', 'accelerated-mobile-pages'),
1327
- 'subtitle' => __('Upload the logo you want to show in Google Structured Data. ', 'accelerated-mobile-pages'),
1328
- ),
1329
- array(
1330
- 'id' => 'ampforwp-sd-logo-dimensions',
1331
- 'title' => __('Custom Logo Size', 'accelerated-mobile-pages'),
1332
- 'type' => 'switch',
1333
- 'default' => 0,
1334
- ),
1335
- array(
1336
- 'id' => 'ampforwp-sd-logo-width',
1337
- 'type' => 'text',
1338
- 'title' => __('Logo Width', 'accelerated-mobile-pages'),
1339
- 'desc' => __('Default width is 600 pixels', 'accelerated-mobile-pages'),
1340
- 'default' => '600',
1341
- 'required'=>array('ampforwp-sd-logo-dimensions','=','1'),
1342
- ),
1343
- array(
1344
- 'id' => 'ampforwp-sd-logo-height',
1345
- 'type' => 'text',
1346
- 'title' => __('Logo Height', 'accelerated-mobile-pages'),
1347
- 'desc' => __('Default height is 60 pixels', 'accelerated-mobile-pages'),
1348
- 'default' => '60',
1349
- 'required'=>array('ampforwp-sd-logo-dimensions','=','1'),
1350
-
1351
- ),
1352
- array(
1353
- 'id' => 'amp-structured-data-placeholder-image',
1354
- 'type' => 'media',
1355
- 'url' => true,
1356
- 'title' => __('Default Post Image', 'accelerated-mobile-pages'),
1357
- 'subtitle' => __('Upload the Image you want to show as Placeholder Image.', 'accelerated-mobile-pages'),
1358
- 'placeholder' => __('when there is no featured image set in the post','accelerated-mobile-pages'),
1359
- ),
1360
- array(
1361
- 'id' => 'amp-structured-data-placeholder-image-width',
1362
- 'title' => __('Default Post Image Width', 'accelerated-mobile-pages'),
1363
- 'type' => 'text',
1364
- 'placeholder' => '550',
1365
- 'subtitle' => __('Please don\'t add "PX" in the image size.','accelerated-mobile-pages'),
1366
- 'default' => '700'
1367
- ),
1368
- array(
1369
- 'id' => 'amp-structured-data-placeholder-image-height',
1370
- 'title' => __('Default Post Image Height', 'accelerated-mobile-pages'),
1371
- 'type' => 'text',
1372
- 'placeholder' => '350',
1373
- 'subtitle' => __('Please don\'t add "PX" in the image size.','accelerated-mobile-pages'),
1374
- 'default' => '550'
1375
- ),
1376
- array(
1377
- 'id' => 'amporwp-structured-data-video-thumb-url',
1378
- 'type' => 'media',
1379
- 'url' => true,
1380
- 'title' => __('Default Thumbnail for VideoObject', 'accelerated-mobile-pages'),
1381
- 'subtitle' => __('Upload the Thumbnail you want to show as Video Thumbnail.', 'accelerated-mobile-pages'),
1382
- 'placeholder' => __('When there is no thumbnail set for the video','accelerated-mobile-pages'),
1383
- ),
1384
- )
1385
- )
1386
- ) );
1387
-
1388
- // Notifications SECTION
1389
- Redux::setSection( $opt_name, array(
1390
- 'title' => __( 'Notice Bar', 'accelerated-mobile-pages' ),
1391
- 'desc' => $cta_desc ,
1392
- 'id' => 'amp-notifications',
1393
- 'subsection' => true,
1394
- 'fields' => array(
1395
- array(
1396
- 'id' =>'amp-enable-notifications',
1397
- 'type' => 'switch',
1398
- 'title' => __('Enable Notifications', 'accelerated-mobile-pages'),
1399
- 'default' => '',
1400
- 'subtitle' => __('Show notifications on all of your AMP pages for cookie purposes, or anything else.', 'accelerated-mobile-pages'),
1401
- 'true' => 'Enabled',
1402
- 'false' => 'Disabled',
1403
- ),
1404
- array(
1405
- 'id' => 'amp-notification-text',
1406
- 'title' => __('Notification text', 'accelerated-mobile-pages'),
1407
- 'type' => 'text',
1408
- 'required' => array('amp-enable-notifications', '=' , '1'),
1409
- 'default' => __('This website uses cookies.','accelerated-mobile-pages'),
1410
- 'placeholder' => __('Enter Text here','accelerated-mobile-pages'),
1411
- ),
1412
- array(
1413
- 'id' => 'amp-accept-button-text',
1414
- 'title' => __('Notification accept button text', 'accelerated-mobile-pages'),
1415
- 'type' => 'text',
1416
- 'required' => array('amp-enable-notifications', '=' , '1'),
1417
- 'default' => __('Accept','accelerated-mobile-pages'),
1418
- 'placeholder' => __('Enter Text here','accelerated-mobile-pages'),
1419
- ),
1420
-
1421
- ),
1422
-
1423
- ) );
1424
-
1425
- // Push Notifications section
1426
- Redux::setSection( $opt_name, array(
1427
- 'title' => __( 'Push Notifications', 'accelerated-mobile-pages' ),
1428
- // 'icon' => 'el el-podcast',
1429
- 'id' => 'ampforwp-push-notifications',
1430
- 'desc' => " ",
1431
- 'subsection' => true,
1432
- 'class' =>'ampforwp-new-element',
1433
- 'fields' => array(
1434
- array(
1435
- 'id' => 'ampforwp-web-push-onesignal',
1436
- 'type' => 'switch',
1437
- 'title' => 'OneSignal Push Notifications',
1438
- 'true' => 'true',
1439
- 'false' => 'false',
1440
- 'default' => 0,
1441
- ),
1442
- array(
1443
- 'id' => 'ampforwp-one-signal-app-id',
1444
- 'subtitle' => '<a href="https://ampforwp.com/tutorials/one-signal-in-amp/" target="_blank">View Integration Tutorial</a>',
1445
- 'type' => 'text',
1446
- 'title' => 'APP ID',
1447
- 'required' => array('ampforwp-web-push-onesignal', '=' , '1'),
1448
- ),
1449
- array(
1450
- 'id' => 'ampforwp-onesignal-http-site',
1451
- 'type' => 'switch',
1452
- 'title' => 'HTTP Site',
1453
- 'subtitle' => 'For HTTP Sites Only',
1454
- 'required' => array('ampforwp-web-push-onesignal', '=' , '1'),
1455
- 'true' => 'true',
1456
- 'false' => 'false',
1457
- 'default' => 0
1458
- ),
1459
- array(
1460
- 'id' => 'ampforwp-onesignal-subdomain',
1461
- 'type' => 'text',
1462
- 'title' => 'Subdomain',
1463
- 'desc' => __('Example: ampforwp', 'accelerated-mobile-pages'),
1464
- 'required' => array(
1465
- array('ampforwp-web-push-onesignal', '=' , '1'),
1466
- array('ampforwp-onesignal-http-site', '=','1')),
1467
- ),
1468
- array(
1469
- 'id' => 'translation',
1470
- 'type' => 'section',
1471
- 'title' => __('Translation', 'accelerated-mobile-pages'),
1472
- 'required' => array(
1473
- array( 'ampforwp-web-push-onesignal', '=' , 1 ),
1474
- array( 'amp-use-pot', '=' , 0 )
1475
- ),
1476
- 'indent' => true,
1477
- ),
1478
- array(
1479
- 'id' => 'ampforwp-onesignal-translator-subscribe',
1480
- 'type' => 'text',
1481
- 'title' => __('Subscribe', 'accelerated-mobile-pages'),
1482
- 'default' => __('Subscribe to updates','accelerated-mobile-pages'),
1483
- 'placeholder'=>__('Add some text','accelerated-mobile-pages'),
1484
- ),
1485
- array(
1486
- 'id' => 'ampforwp-onesignal-translator-unsubscribe',
1487
- 'type' => 'text',
1488
- 'title' => __('Unsubsribe', 'accelerated-mobile-pages'),
1489
- 'default' => __('Unsubscribe from updates','accelerated-mobile-pages'),
1490
- 'placeholder'=>__('Add some text','accelerated-mobile-pages'),
1491
- ),
1492
- )
1493
- )
1494
- );
1495
- // contact form 7
1496
- $forms_support[] = array(
1497
- 'id' =>'amp-enable-contactform',
1498
- 'type' => 'switch',
1499
- 'title' => __('Contact Form 7 Support', 'accelerated-mobile-pages'),
1500
- 'default' => '',
1501
- 'true' => 'Enabled',
1502
- 'false' => 'Disabled',
1503
- );
1504
-
1505
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
1506
- if(!is_plugin_active( 'amp-cf7/amp-cf7.php' ) ){
1507
- $forms_support[]= array(
1508
- 'id' => 'info_normal_cf7',
1509
- 'type' => 'info',
1510
- 'required' => array('amp-enable-contactform', '=' , '1'),
1511
- 'desc' => '<div style=" background: #FFF9C4;padding: 12px;line-height: 1.6;margin:-45px -14px -18px -17px;"><b>ONE LAST STEP REQUIRED:</b> This feature requires <a href="https://ampforwp.com/contact-form-7/#utm_source=options-panel&utm_medium=cf7-tab_cf7_installation_link&utm_campaign=AMP%20Plugin" target="_blank">Contact Form 7 extension</a>.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/contact-form-7/#utm_source=options-panel&utm_medium=cf7-tab_cf7_installation_link&utm_campaign=AMP%20Plugin" target="_blank">Click here for more info</a>)</div></div>',
1512
- );
1513
- }
1514
- // gravity form
1515
- $forms_support[]= array(
1516
- 'id' =>'amp-enable-gravityforms_support',
1517
- 'type' => 'switch',
1518
- 'title' => __('Gravity Forms Support', 'accelerated-mobile-pages'),
1519
- 'default' => '',
1520
- 'true' => 'Enabled',
1521
- 'false' => 'Disabled',
1522
- );
1523
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
1524
- if(!is_plugin_active( 'amp-gravity-forms/amp-gravity-forms.php' ) ){
1525
- $forms_support[]= array(
1526
- 'id' => 'info_normal_2',
1527
- 'type' => 'info',
1528
- 'required' => array('amp-enable-gravityforms_support', '=' , '1'),
1529
- 'desc' => '<div style=" background: #FFF9C4;padding: 12px;line-height: 1.6;margin:-45px -14px -18px -17px;"><b>ONE LAST STEP REQUIRED:</b> This feature requires <a href="https://ampforwp.com/gravity-forms/#utm_source=options-panel&utm_medium=gf-tab_gf_installation_link&utm_campaign=AMP%20Plugin" target="_blank">Gravity Forms extension</a>.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/gravity-forms/#utm_source=options-panel&utm_medium=gf-tab_gf_installation_link&utm_campaign=AMP%20Plugin" target="_blank">Click here for more info</a>)</div></div>',
1530
- );}
1531
-
1532
- // Contact Form SECTION
1533
- Redux::setSection( $opt_name, array(
1534
- 'title' => __( 'Contact Form', 'accelerated-mobile-pages' ),
1535
- 'desc' => 'Contact form 7 forms will automatically be converted into AMP compatible.',
1536
- 'id' => 'amp-contact',
1537
- 'subsection' => true,
1538
- 'fields' => $forms_support
1539
-
1540
- ) );
1541
-
1542
- // comments
1543
- Redux::setSection( $opt_name, array(
1544
- 'title' => __( 'Comments', 'accelerated-mobile-pages' ),
1545
- 'desc' => $comment_desc,
1546
- 'id' => 'disqus-comments',
1547
- 'subsection' => true,
1548
- 'fields' => array(
1549
- array(
1550
- 'title' =>__('WordPress Comments','accelerated-mobile-pages'),
1551
- 'id' => 'wordpress-comments-support',
1552
- 'subtitle' => __('Enable/Disable WordPress comments using this switch.', 'accelerated-mobile-pages'),
1553
- 'type' => 'switch',
1554
-
1555
- ),
1556
- array(
1557
- 'id' => 'ampforwp-number-of-comments',
1558
- 'type' => 'text',
1559
- 'subtitle' => __('This refers to the normal comments','accelerated-mobile-pages'),
1560
- 'title' => __('No of Comments', 'accelerated-mobile-pages'),
1561
- 'default' => 10,
1562
- 'required' => array('wordpress-comments-support' , '=' , 1
1563
- ),
1564
- ),
1565
- array(
1566
- 'id' => 'ampforwp-disqus-comments-support',
1567
- 'type' => 'switch',
1568
- 'title' => __('Disqus comments', 'accelerated-mobile-pages'),
1569
- 'subtitle' => __('Enable/Disable Disqus comments using this switch.', 'accelerated-mobile-pages'),
1570
- 'default' => 0
1571
- ),
1572
- array(
1573
- 'id' => 'ampforwp-disqus-comments-name',
1574
- 'type' => 'text',
1575
- 'title' => __('Disqus Name', 'accelerated-mobile-pages'),
1576
- 'subtitle' => __('Eg: https://xyz.disqus.com', 'accelerated-mobile-pages'),
1577
- 'required' => array('ampforwp-disqus-comments-support', '=' , '1'),
1578
- 'default' => ''
1579
- ),
1580
-
1581
- array(
1582
- 'id' => 'ampforwp-disqus-host-position',
1583
- 'type' => 'switch',
1584
- 'title' => __('Host Disqus Comments through AMPforWP Servers', 'accelerated-mobile-pages'),
1585
- 'subtitle' => __('Use AMPforWP secure servers to serve Comments file. Recommended if your site is non HTTPS', 'accelerated-mobile-pages'),
1586
- 'default' => 1,
1587
- 'required' => array('ampforwp-disqus-comments-support', '=' , '1'),
1588
- ),
1589
-
1590
- array(
1591
- 'id' => 'ampforwp-disqus-host-file',
1592
- 'type' => 'text',
1593
- 'title' => __('Disqus Host File', 'accelerated-mobile-pages'),
1594
- 'subtitle' => __('<a href="https://ampforwp.com/host-disqus-comments/"> Click here to know, How to Setup Disqus Host file on your servers </a>', 'accelerated-mobile-pages'),
1595
- 'placeholder' => 'https://comments.example.com/disqus.php',
1596
- 'required' => array('ampforwp-disqus-host-position', '=' , '0'),
1597
- ),
1598
- array(
1599
- 'id' => 'ampforwp-facebook-comments-support',
1600
- 'type' => 'switch',
1601
- 'title' => __('Facebook Comments', 'accelerated-mobile-pages'),
1602
- 'subtitle' => __('Enable/Disable Facebook comments using this switch.', 'accelerated-mobile-pages'),
1603
- 'default' => 0,
1604
- ),
1605
- array(
1606
- 'id' => 'ampforwp-number-of-fb-no-of-comments',
1607
- 'type' => 'text',
1608
- 'subtitle' => __('Enter the number of comments','accelerated-mobile-pages'),
1609
- 'title' => __('No of Comments', 'accelerated-mobile-pages'),
1610
- 'default' => 10,
1611
- 'required' => array(
1612
- array('ampforwp-facebook-comments-support', '=' , 1),
1613
-
1614
-
1615
- ),
1616
- )
1617
- )
1618
- ) );
1619
-
1620
- function fb_instant_article() {
1621
- $feedname = '';
1622
- $fb_instant_article_feed = '';
1623
- $input = '';
1624
-
1625
- $feedname = 'instant_articles';
1626
- $fb_instant_article_feed = trailingslashit( site_url() ).$feedname ;
1627
- $input = '<a href=" '. $fb_instant_article_feed . '" target="_blank">' . esc_url( $fb_instant_article_feed ). '</a>' ;
1628
-
1629
- return strip_tags($input, '<a>');
1630
- }
1631
-
1632
- // Facebook Instant Articles
1633
- Redux::setSection( $opt_name, array(
1634
- 'title' => __( 'Instant Articles', 'accelerated-mobile-pages' ),
1635
- 'id' => 'fb-instant-article',
1636
- 'subsection' => true,
1637
- 'fields' => array(
1638
- array(
1639
- 'id' =>'fb-instant-article-switch',
1640
- 'type' => 'switch',
1641
- 'title' => __('Facebook Instant Articles Support', 'accelerated-mobile-pages'),
1642
- 'default' => 0,
1643
- 'true' => 'true',
1644
- 'false' => 'false',
1645
- 'desc' => __('Re-Save permalink when you enable this option, please have a look <a href="https://ampforwp.com/flush-rewrite-urls/">here</a> on how to do it', 'accelerated-mobile-pages'),
1646
- ),
1647
- array(
1648
- 'id' => 'fb-instant-article-feed-url',
1649
- 'type' => 'info',
1650
- 'style' => 'critical',
1651
- 'desc' => fb_instant_article(),
1652
- 'title' => __('Facebook Instant Articles Feed URL', 'accelerated-mobile-pages'),
1653
- 'required' => array('fb-instant-article-switch', '=', 1)
1654
- ),
1655
- array(
1656
- 'id' => 'ampforwp-fb-instant-article-posts',
1657
- 'type' => 'text',
1658
- 'title' => __('Number of Posts', 'accelerated-mobile-pages'),
1659
- 'subtitle' => __('Enter the number of posts to generate for Instant Articles.', 'accelerated-mobile-pages'),
1660
- 'desc' => __('Leave this empty to generate All Posts.', 'accelerated-mobile-pages'),
1661
- 'required' => array('fb-instant-article-switch', '=', 1),
1662
- 'default' => '50'
1663
- ),
1664
- array(
1665
- 'id' => 'fb-instant-article-ads',
1666
- 'type' => 'switch',
1667
- 'title' => __('Advertisement', 'accelerated-mobile-pages'),
1668
- 'default' => 0,
1669
- 'true' => 'true',
1670
- 'false' => 'false',
1671
- 'desc' => __('Switch this on to enable advertising on Instant Article pages.', 'accelerated-mobile-pages'),
1672
- 'required' => array('fb-instant-article-switch', '=', 1)
1673
- ),
1674
- array(
1675
- 'id' => 'fb-instant-article-ad-id',
1676
- 'type' => 'text',
1677
- 'title' => __('Enter your Audience Network Placement ID', 'accelerated-mobile-pages'),
1678
- 'subtitle' => __('You can find out more about this <a href="https://developers.facebook.com/docs/instant-articles/monetization/audience-network">here</a>. ', 'accelerated-mobile-pages'),
1679
- 'required' => array('fb-instant-article-ads', '=', 1)
1680
- ),
1681
- array(
1682
- 'id' => 'fb-instant-article-ad-density-setup',
1683
- 'type' => 'select',
1684
- 'title' => __('How often should ads show in Instant Article pages', 'accelerated-mobile-pages'),
1685
- 'options' => array(
1686
- 'default' => __('Every 250 words', 'accelerated-mobile-pages' ),
1687
- 'medium' => __('Every 350 words', 'accelerated-mobile-pages' ),
1688
- 'low' => __('Every 500 words', 'accelerated-mobile-pages' ),
1689
- ),
1690
- 'required' => array('fb-instant-article-ads', '=', 1),
1691
- 'default' => 'default',
1692
- ),
1693
- array(
1694
- 'id' => 'fb-instant-article-analytics',
1695
- 'type' => 'switch',
1696
- 'title' => __('Analytics', 'accelerated-mobile-pages'),
1697
- 'default' => 0,
1698
- 'true' => 'true',
1699
- 'false' => 'false',
1700
- 'desc' => __('Switch this on to enable analytics on Instant Article pages.', 'accelerated-mobile-pages'),
1701
- 'required' => array('fb-instant-article-switch', '=', 1)
1702
- ),
1703
- array(
1704
- 'id' => 'fb-instant-article-analytics-code',
1705
- 'type' => 'textarea',
1706
- 'title' => __('Enter your Analytics script code', 'accelerated-mobile-pages'),
1707
- 'subtitle' => __('Do not enter iframe tag. Find out more about support <a href="https://developers.facebook.com/docs/instant-articles/analytics">here</a> ', 'accelerated-mobile-pages'),
1708
- 'required' => array('fb-instant-article-analytics', '=', 1)
1709
- ),
1710
- ),
1711
- )
1712
- );
1713
-
1714
- // Hide AMP Bulk Tools
1715
- Redux::setSection( $opt_name, array(
1716
- 'title' => __( 'Hide AMP Bulk Tools', 'accelerated-mobile-pages' ),
1717
- 'id' => 'hide-amp-section',
1718
- 'subsection' => true,
1719
- 'desc' => 'Here are some Advanced options to help you exclude AMP from your prefered pages',
1720
- 'fields' => array(
1721
-
1722
- array(
1723
- 'id' => 'amp-pages-meta-default',
1724
- 'type' => 'select',
1725
- 'title' => __( 'Individual AMP Page (Bulk Edit)', 'accelerated-mobile-pages' ),
1726
- 'subtitle' => __( 'Allows you to Show or Hide AMP from All pages, so it can be changed individually later. This option will change the Default value of AMP metabox in Pages', 'accelerated-mobile-pages' ),
1727
- 'desc' => __( 'NOTE: Changes will overwrite the previous settings.', 'accelerated-mobile-pages' ),
1728
- 'options' => array(
1729
- 'show' => __('Show by Default', 'accelerated-mobile-pages' ),
1730
- 'hide' => __('Hide by default', 'accelerated-mobile-pages' ),
1731
- ),
1732
- 'default' => 'show',
1733
- 'required'=>array('amp-on-off-for-all-pages','=','1'),
1734
- ),
1735
- array(
1736
- 'id' =>'hide-amp-categories',
1737
- 'type' => 'checkbox',
1738
- 'title' => __('Select Categories to Hide AMP'),
1739
- 'subtitle' => __( 'Hide AMP from all the posts of a selected category.', 'accelerated-mobile-pages' ),
1740
- 'default' => 0,
1741
- 'data' => 'categories',
1742
- ),
1743
- )
1744
- )
1745
- );
1746
-
1747
- // Advance Settings SECTION
1748
- Redux::setSection( $opt_name, array(
1749
- 'title' => __( 'Advance Settings', 'accelerated-mobile-pages' ),
1750
- 'desc' => __( 'This section has some advanced settings, please use it with care','accelerated-mobile-pages'),
1751
- 'id' => 'amp-advance',
1752
- 'subsection' => true,
1753
- 'fields' => array(
1754
-
1755
- /* array(
1756
- 'id' => 'ampforwp-homepage-on-off-support',
1757
- 'type' => 'switch',
1758
- 'title' => __('Homepage Support', 'accelerated-mobile-pages'),
1759
- 'subtitle' => __('Enable/Disable Home page using this switch.', 'accelerated-mobile-pages'),
1760
- 'default' => '1'
1761
- ),*/
1762
-
1763
- array(
1764
- 'id' => 'amp-mobile-redirection',
1765
- 'type' => 'switch',
1766
- 'title' => __('Mobile Redirection', 'accelerated-mobile-pages'),
1767
- 'subtitle' => __('
1768
- Enable AMP for your mobile users. Give your visitors a Faster mobile User Experience.','accelerated-mobile-pages'),
1769
- 'default' => 0,
1770
-
1771
- ),
1772
- array(
1773
- 'id' => 'amp-header-text-area-for-html',
1774
- 'type' => 'textarea',
1775
- 'title' => __('Enter HTML in Head', 'accelerated-mobile-pages'),
1776
- 'subtitle' => __('please enter markup that is AMP validated', 'accelerated-mobile-pages'),
1777
- 'desc' => __('check your markup here (enter markup between HEAD tag) : https://validator.ampproject.org/', 'accelerated-mobile-pages'),
1778
- 'default' => ''
1779
- ),
1780
- array(
1781
- 'id' => 'amp-body-text-area',
1782
- 'type' => 'textarea',
1783
- 'title' => __('Enter HTML in Body (beginning of body tag) ', 'accelerated-mobile-pages'),
1784
- 'subtitle' => __('please enter markup that is AMP validated', 'accelerated-mobile-pages'),
1785
- 'desc' => __('check your markup here (enter markup in the beginning of body tag) : https://validator.ampproject.org/', 'accelerated-mobile-pages'),
1786
- 'default' => ''
1787
- ),
1788
- array(
1789
- 'id' => 'amp-footer-text-area-for-html',
1790
- 'type' => 'textarea',
1791
- 'title' => __('Enter HTML in Footer', 'accelerated-mobile-pages'),
1792
- 'subtitle' => __('please enter markup that is AMP validated', 'accelerated-mobile-pages'),
1793
- 'desc' => __('check your markup here (enter markup between BODY tag) : https://validator.ampproject.org/',
1794
- 'accelerated-mobile-pages'),
1795
- 'default' => ''
1796
- ),
1797
- array(
1798
- 'id' => 'ampforwp-auto-amp-menu-link',
1799
- 'type' => 'switch',
1800
- 'title' => __('Auto Add AMP in Menu URL', 'accelerated-mobile-pages'),
1801
- 'subtitle' => __('Automatically add <code>AMP</code> at the end of menu url', 'accelerated-mobile-pages'),
1802
- 'true' => 'true',
1803
- 'false' => 'false',
1804
- 'default' => 0,
1805
- //'required' => array('ampforwp-amp-menu', '=' , '1')
1806
- ),
1807
- //Category Base Removal in AMP
1808
- array(
1809
- 'id' => 'ampforwp-category-base-removel-link',
1810
- 'type' => 'switch',
1811
- 'title' => __('Category base remove in AMP', 'accelerated-mobile-pages'),
1812
- 'subtitle' => __('Category base removal in <code>AMP</code> from url', 'accelerated-mobile-pages'),
1813
- 'true' => 'true',
1814
- 'false' => 'false',
1815
- 'default' => 0,
1816
-
1817
- ),
1818
- //Tag base Removal in AMP
1819
- array(
1820
- 'id' => 'ampforwp-tag-base-removal-link',
1821
- 'type' => 'switch',
1822
- 'title' => __('Tag base remove in AMP', 'accelerated-mobile-pages'),
1823
- 'subtitle' => __('Tag base remove in <code>AMP</code> from url', 'accelerated-mobile-pages'),
1824
- 'true' => 'true',
1825
- 'false' => 'false',
1826
- 'default' => 0,
1827
-
1828
- ),
1829
- // Featured Image from Custom Fields
1830
- array(
1831
- 'id' => 'ampforwp-custom-fields-featured-image-switch',
1832
- 'type' => 'switch',
1833
- 'title' => __('Featured Image from Custom Fields', 'accelerated-mobile-pages'),
1834
- 'subtitle' => __('This will allow you to add Featured Image from Custom Fields', 'accelerated-mobile-pages'),
1835
- 'true' => 'true',
1836
- 'false' => 'false',
1837
- 'default' => 0,
1838
- ),
1839
- array(
1840
- 'id' => 'ampforwp-custom-fields-featured-image',
1841
- 'type' => 'text',
1842
- 'title' => __('Custom Field For Featured Image', 'accelerated-mobile-pages'),
1843
- 'default' => __ ('','accelerated-mobile-pages'),
1844
- 'placeholder'=>__('Write the Custom Field of Featured Image','accelerated-mobile-pages'),
1845
- 'required' => array( 'ampforwp-custom-fields-featured-image-switch', '=' , 1 )
1846
- ),
1847
- // Grab the First Image for Featured Image if there is none
1848
- array(
1849
- 'id' => 'ampforwp-featured-image-from-content',
1850
- 'type' => 'switch',
1851
- 'title' => __('Featured Image from The Content', 'accelerated-mobile-pages'),
1852
- 'subtitle' => __('Show the first image of the content as Featured Image if there is no featured image', 'accelerated-mobile-pages'),
1853
- 'true' => 'true',
1854
- 'false' => 'false',
1855
- 'default' => 0,
1856
- ),
1857
- // Duplicate Featured Image
1858
- array(
1859
- 'id' => 'ampforwp-duplicate-featured-image',
1860
- 'type' => 'switch',
1861
- 'title' => __('Duplicate Featured Image', 'accelerated-mobile-pages'),
1862
- 'subtitle' => __('Turn On the support if you want to show the Featured Image if it already exists in post content.', 'accelerated-mobile-pages'),
1863
- 'true' => 'true',
1864
- 'false' => 'false',
1865
- 'default' => 0,
1866
- ),
1867
- array(
1868
- 'id' => 'amp-meta-permissions',
1869
- 'type' => 'select',
1870
- 'title' => __('Show Metabox in Post Editor to', 'accelerated-mobile-pages'),
1871
- 'options' => array(
1872
- 'all' => 'All users who can post',
1873
- 'admin' => 'Only to Admin'
1874
- ),
1875
- 'default' => 'all',
1876
- ),
1877
- array(
1878
- 'id' => 'ampforwp-development-mode',
1879
- 'type' => 'switch',
1880
- 'title' => __('Dev Mode in AMP'),
1881
- 'subtitle' => __('This will enable the Development mode in AMP', 'accelerated-mobile-pages'),
1882
- 'true' => 'true',
1883
- 'false' => 'false',
1884
- 'default' => 0,
1885
- ),
1886
- array(
1887
- 'id' => 'ampforwp-development-mode-notice',
1888
- 'type' => 'info',
1889
- 'style' => 'info',
1890
- 'desc' => __('Add /amp at the end of url to view the AMP version of the site. Search Engines will not be able to Crawl the AMP site when in Dev Mode.', 'accelerated-mobile-pages'),
1891
- 'title' => __('Dev Mode', 'accelerated-mobile-pages'),
1892
- 'required' => array('ampforwp-development-mode', '=', 1)
1893
- ),
1894
- array(
1895
- 'id' => 'ampforwp-update-notification-bar',
1896
- 'type' => 'switch',
1897
- 'title' => __('Plugin Update Notification Bar'),
1898
- 'subtitle' => __('Enable/Disable the Plugin Update Notification Bar', 'accelerated-mobile-pages'),
1899
- 'true' => 'true',
1900
- 'false' => 'false',
1901
- 'default' => 1,
1902
- ),
1903
-
1904
- ),
1905
-
1906
- ) );
1907
-
1908
-
1909
- // Translation Panel
1910
- Redux::setSection( $opt_name, array(
1911
- 'title' => __( 'Translation Panel', 'accelerated-mobile-pages' ),
1912
- 'desc' => __( 'Please translate the following words of page accordingly else default content is in English Language', 'accelerated-mobile-pages' ),
1913
- 'id' => 'amp-translator',
1914
- 'subsection' => true,
1915
- 'fields' => array(
1916
- array(
1917
- 'id' => 'amp-use-pot',
1918
- 'type' => 'switch',
1919
- 'title' => __('Use POT file method of Translation', 'accelerated-mobile-pages'),
1920
- 'subtitle' => __('Else you can use normal translation method', 'accelerated-mobile-pages'),
1921
- 'desc' => __('Use this if you want Multilingual Translations', 'accelerated-mobile-pages'),
1922
- 'default' => 0
1923
- ),
1924
- array(
1925
- 'id' => 'amp-translator-breadcrumbs-homepage-text',
1926
- 'type' => 'text',
1927
- 'title' => __('Breadcrumbs Homepage Title', 'accelerated-mobile-pages'),
1928
- 'default' => __('Homepage','accelerated-mobile-pages'),
1929
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
1930
- 'required' => array( 'amp-use-pot', '=' , 0 )
1931
- ),
1932
- array(
1933
- 'id' => 'amp-translator-show-more-posts-text',
1934
- 'type' => 'text',
1935
- 'title' => __('Show more Posts', 'accelerated-mobile-pages'),
1936
- 'default' => __('Show more Posts','accelerated-mobile-pages'),
1937
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
1938
- 'required' => array( 'amp-use-pot', '=' , 0 )
1939
- ),
1940
- array(
1941
- 'id' => 'amp-translator-show-previous-posts-text',
1942
- 'type' => 'text',
1943
- 'title' => __('Show previous Posts', 'accelerated-mobile-pages'),
1944
- 'default' => __('Show previous Posts','accelerated-mobile-pages'),
1945
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
1946
- 'required' => array( 'amp-use-pot', '=' , 0 )
1947
- ),
1948
- array(
1949
- 'id' => 'amp-translator-top-text',
1950
- 'type' => 'text',
1951
- 'title' => __('Top', 'accelerated-mobile-pages'),
1952
- 'default' => __('Top','accelerated-mobile-pages'),
1953
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
1954
- 'required' => array( 'amp-use-pot', '=' , 0 )
1955
- ),
1956
- array(
1957
- 'id' => 'amp-translator-non-amp-page-text',
1958
- 'type' => 'text',
1959
- 'title' => __('View Non-AMP Version', 'accelerated-mobile-pages'),
1960
- 'default' => __('View Non-AMP Version','accelerated-mobile-pages'),
1961
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
1962
- 'required' => array( 'amp-use-pot', '=' , 0 )
1963
- ),
1964
- array(
1965
- 'id' => 'amp-translator-related-text',
1966
- 'type' => 'text',
1967
- 'title' => __('Related Post', 'accelerated-mobile-pages'),
1968
- 'default' => __('Related Post','accelerated-mobile-pages'),
1969
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
1970
- 'required' => array( 'amp-use-pot', '=' , 0 )
1971
- ),
1972
- array(
1973
- 'id' => 'amp-translator-navigate-text',
1974
- 'type' => 'text',
1975
- 'title' => __('Navigate', 'accelerated-mobile-pages'),
1976
- 'default' => __('Navigate','accelerated-mobile-pages'),
1977
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
1978
- 'required' => array( 'amp-use-pot', '=' , 0 )
1979
- ),
1980
- array(
1981
- 'id' => 'amp-translator-on-text',
1982
- 'type' => 'text',
1983
- 'title' => __('On', 'accelerated-mobile-pages'),
1984
- 'default' => __('On','accelerated-mobile-pages'),
1985
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
1986
- 'required' => array( 'amp-use-pot', '=' , 0 )
1987
- ),
1988
- array(
1989
- 'id' => 'amp-translator-next-text',
1990
- 'type' => 'text',
1991
- 'title' => __('Next', 'accelerated-mobile-pages'),
1992
- 'default' => __('Next','accelerated-mobile-pages'),
1993
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
1994
- 'required' => array( 'amp-use-pot', '=' , 0 )
1995
- ),
1996
- array(
1997
- 'id' => 'amp-translator-previous-text',
1998
- 'type' => 'text',
1999
- 'title' => __('Previous', 'accelerated-mobile-pages'),
2000
- 'default' => __('Previous','accelerated-mobile-pages'),
2001
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2002
- 'required' => array( 'amp-use-pot', '=' , 0 )
2003
- ),
2004
- array(
2005
- 'id' => 'amp-translator-footer-text',
2006
- 'type' => 'textarea',
2007
- 'title' => __('Footer', 'accelerated-mobile-pages'),
2008
- 'default' => __('All Rights Reserved','accelerated-mobile-pages'),
2009
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2010
- 'required' => array( 'amp-use-pot', '=' , 0 )
2011
- ),
2012
- array(
2013
- 'id' => 'amp-translator-categories-text',
2014
- 'type' => 'text',
2015
- 'title' => __('Categories', 'accelerated-mobile-pages'),
2016
- 'default' => __('Categories: ','accelerated-mobile-pages'),
2017
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2018
- 'required' => array( 'amp-use-pot', '=' , 0 )
2019
- ),
2020
- array(
2021
- 'id' => 'amp-translator-tags-text',
2022
- 'type' => 'text',
2023
- 'title' => __('Tags', 'accelerated-mobile-pages'),
2024
- 'default' => __('Tags: ','accelerated-mobile-pages'),
2025
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2026
- 'required' => array( 'amp-use-pot', '=' , 0 )
2027
- ),
2028
- array(
2029
- 'id' => 'amp-translator-by-text',
2030
- 'type' => 'text',
2031
- 'title' => __('By', 'accelerated-mobile-pages'),
2032
- 'default' => __('By','accelerated-mobile-pages'),
2033
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2034
- 'required' => array( 'amp-use-pot', '=' , 0 )
2035
- ),
2036
- array(
2037
- 'id' => 'amp-translator-published-by',
2038
- 'type' => 'text',
2039
- 'title' => __('Published by', 'accelerated-mobile-pages'),
2040
- 'default' => __('Published by','accelerated-mobile-pages'),
2041
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2042
- 'required' => array( 'amp-use-pot', '=' , 0 )
2043
- ),
2044
- array(
2045
- 'id' => 'amp-translator-in-designthree',
2046
- 'type' => 'text',
2047
- 'title' => __('in', 'accelerated-mobile-pages'),
2048
- 'default' =>__( 'in','accelerated-mobile-pages'),
2049
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2050
- 'required' => array( 'amp-use-pot', '=' , 0 )
2051
- ),
2052
- array(
2053
- 'id' => 'amp-translator-view-comments-text',
2054
- 'type' => 'text',
2055
- 'title' => __('View Comments', 'accelerated-mobile-pages'),
2056
- 'default' => __('View Comments','accelerated-mobile-pages'),
2057
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2058
- 'required' => array( 'amp-use-pot', '=' , 0 )
2059
- ),
2060
- array(
2061
- 'id' => 'amp-translator-leave-a-comment-text',
2062
- 'type' => 'text',
2063
- 'title' => __('Leave a Comment', 'accelerated-mobile-pages'),
2064
- 'default' => __('Leave a Comment','accelerated-mobile-pages'),
2065
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2066
- 'required' => array( 'amp-use-pot', '=' , 0 )
2067
- ),
2068
- array(
2069
- 'id' => 'amp-translator-at-text',
2070
- 'type' => 'text',
2071
- 'title' => __('at', 'accelerated-mobile-pages'),
2072
- 'default' => __('at','accelerated-mobile-pages'),
2073
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2074
- 'required' => array( 'amp-use-pot', '=' , 0 )
2075
- ),
2076
- array(
2077
- 'id' => 'amp-translator-says-text',
2078
- 'type' => 'text',
2079
- 'title' => __('says', 'accelerated-mobile-pages'),
2080
- 'default' =>__( 'says','accelerated-mobile-pages'),
2081
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2082
- 'required' => array( 'amp-use-pot', '=' , 0 )
2083
- ),
2084
- array(
2085
- 'id' => 'amp-translator-Edit-text',
2086
- 'type' => 'text',
2087
- 'title' => __('Edit', 'accelerated-mobile-pages'),
2088
- 'default' => __('Edit','accelerated-mobile-pages'),
2089
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2090
- 'required' => array( 'amp-use-pot', '=' , 0 )
2091
- ),
2092
- array(
2093
- 'id' => 'amp-translator-ago-date-text',
2094
- 'type' => 'text',
2095
- 'title' => __('ago', 'accelerated-mobile-pages'),
2096
- 'default' => __('ago','accelerated-mobile-pages'),
2097
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2098
- 'required' => array( 'amp-use-pot', '=' , 0 )
2099
- ),
2100
- array(
2101
- 'id' => 'amp-translator-modified-date-text',
2102
- 'type' => 'text',
2103
- 'title' => __('This post was last modified on ', 'accelerated-mobile-pages'),
2104
- 'default' => __('This post was last modified on ','accelerated-mobile-pages'),
2105
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2106
- 'required' => array( 'amp-use-pot', '=' , 0 )
2107
- ),
2108
- array(
2109
- 'id' => 'amp-translator-archive-cat-text',
2110
- 'type' => 'text',
2111
- 'title' => __('Category (archive title)', 'accelerated-mobile-pages'),
2112
- 'default' => __('Category: ','accelerated-mobile-pages'),
2113
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2114
- 'required' => array( 'amp-use-pot', '=' , 0 )
2115
- ),
2116
- array(
2117
- 'id' => 'amp-translator-archive-tag-text',
2118
- 'type' => 'text',
2119
- 'title' => __('Tag (archive title)', 'accelerated-mobile-pages'),
2120
- 'default' => __('Tag: ','accelerated-mobile-pages'),
2121
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2122
- 'required' => array( 'amp-use-pot', '=' , 0 )
2123
- ),
2124
- array(
2125
- 'id' => 'amp-translator-show-more-text',
2126
- 'type' => 'text',
2127
- 'title' => __('View More Posts (Widget Button)', 'accelerated-mobile-pages'),
2128
- 'default' => __('View More Posts','accelerated-mobile-pages'),
2129
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2130
- 'required' => array( 'amp-use-pot', '=' , 0 )
2131
- ),
2132
- array(
2133
- 'id' => 'amp-translator-next-read-text',
2134
- 'type' => 'text',
2135
- 'title' => __('Next Read', 'accelerated-mobile-pages'),
2136
- 'default' => __('Next Read: ','accelerated-mobile-pages'),
2137
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2138
- 'required' => array( 'amp-use-pot', '=' , 0 )
2139
- ),
2140
- array(
2141
- 'id' => 'amp-translator-via-text',
2142
- 'type' => 'text',
2143
- 'title' => __('via', 'accelerated-mobile-pages'),
2144
- 'default' => __('via','accelerated-mobile-pages'),
2145
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2146
- 'required' => array( 'amp-use-pot', '=' , 0 )
2147
- ),
2148
- array(
2149
- 'id' => 'amp-translator-search-text',
2150
- 'type' => 'text',
2151
- 'title' => __(' You searched for: ', 'accelerated-mobile-pages'),
2152
- 'default' => __(' You searched for: ','accelerated-mobile-pages'),
2153
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2154
- 'required' => array( 'amp-use-pot', '=' , 0 )
2155
- ),
2156
- array(
2157
- 'id' => 'amp-translator-search-no-found',
2158
- 'type' => 'text',
2159
- 'title' => __(' It seems we can\'t find what you\'re looking for. ', 'accelerated-mobile-pages'),
2160
- 'default' => __(' It seems we can\'t find what you\'re looking for. ','accelerated-mobile-pages'),
2161
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2162
- 'required' => array( 'amp-use-pot', '=' , 0 )
2163
- ),
2164
- array(
2165
- 'id' => 'design-3-search-subsection',
2166
- 'type' => 'section',
2167
- 'title' => __('Search bar Translation Text', 'accelerated-mobile-pages'),
2168
- 'indent' => true,
2169
- 'required' => array( 'amp-use-pot', '=' , 0 )
2170
- ),
2171
- array(
2172
- 'id' => 'ampforwp-search-placeholder',
2173
- 'type' => 'text',
2174
- 'title' => __('Type Here', 'accelerated-mobile-pages'),
2175
- 'default' => 'Type Here','accelerated-mobile-pages'),
2176
- 'desc' => __('This is the text that gets shown in for Search Box','accelerated-mobile-pages'),
2177
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2178
- 'required' => array( 'amp-use-pot', '=' , 0 )
2179
-
2180
- ),
2181
- array(
2182
- 'id' => 'ampforwp-search-label',
2183
- 'type' => 'text',
2184
- 'title' => __('Type your search query and hit enter', 'accelerated-mobile-pages'),
2185
- 'desc' => __('This is the text that gets shown above Search Box','accelerated-mobile-pages'),
2186
- 'default' => __('Type your search query and hit enter: ','accelerated-mobile-pages'),
2187
- 'placeholder'=>__('write here','accelerated-mobile-pages'),
2188
- 'required' => array( 'amp-use-pot', '=' , 0 )
2189
-
2190
- )
2191
- ) );
2192
-
2193
-
2194
- // Appearance Section
2195
- Redux::setSection( $opt_name, array(
2196
- 'title' => __( 'Design', 'accelerated-mobile-pages' ),
2197
- 'icon' => 'el el-adjust-alt',
2198
- 'desc' => ''
2199
-
2200
- ));
2201
-
2202
- //get All design
2203
- function amp_extra_plugin_theme_header($headers){
2204
- $headers['AMP Theme Name'] = "AMP";
2205
- $headers['AMP Theme Demo'] = "AMP Demo";
2206
- return $headers;
2207
- }
2208
- add_filter("extra_plugin_headers","amp_extra_plugin_theme_header");
2209
- $themeDesign = array(
2210
- array(
2211
- 'demo_link' => 'https://ampforwp.com/demo/#one',
2212
- 'upgreade'=>true,
2213
- 'title'=>__('Design One', 'accelerated-mobile-pages' ),
2214
- 'value'=>1,
2215
- 'alt'=>__('Design One', 'accelerated-mobile-pages' ),
2216
- 'img'=>AMPFORWP_PLUGIN_DIR_URI.'/images/design-1.png',
2217
- ),
2218
- array(
2219
- 'demo_link' => 'https://ampforwp.com/demo/#two',
2220
- 'upgreade'=>true,
2221
- 'title'=>__('Design Two', 'accelerated-mobile-pages' ),
2222
- 'value'=>2,
2223
- 'alt'=>__('Design Two', 'accelerated-mobile-pages' ),
2224
- 'img'=>AMPFORWP_PLUGIN_DIR_URI.'/images/design-2.png',
2225
- ),
2226
- array(
2227
- 'demo_link' => 'https://ampforwp.com/demo/#three',
2228
- 'upgreade'=>true,
2229
- 'title'=>__('Design Three', 'accelerated-mobile-pages' ),
2230
- 'value'=>3,
2231
- 'alt'=>__('Design Three', 'accelerated-mobile-pages' ),
2232
- 'img'=>AMPFORWP_PLUGIN_DIR_URI.'/images/design-3.png',
2233
- )
2234
- );
2235
- if(count(get_plugins())>0){
2236
- foreach (get_plugins() as $key => $value) {
2237
- $plugin = get_plugin_data(WP_PLUGIN_DIR.'/'.$key);
2238
- if(!empty($plugin['AMP'])){//$plugin['AMP']
2239
- $imageUrl = '';
2240
- if(file_exists(AMPFORWP_MAIN_PLUGIN_DIR.$value['TextDomain'].'/screenshot.png')){
2241
- $imageUrl = plugins_url($value['TextDomain'].'/screenshot.png');
2242
- }
2243
- $themeDesign[] = array(
2244
- 'demo_link' => $plugin['AMP Demo'],
2245
- 'upgreade'=>true,
2246
- 'title'=>$plugin['AMP'],
2247
- 'value'=>$value['TextDomain'],
2248
- 'alt'=>$plugin['AMP'],
2249
- 'img'=>$imageUrl,
2250
- );
2251
- }
2252
- }
2253
- }
2254
- // Themes Section
2255
- Redux::setSection( $opt_name, array(
2256
- 'title' => __( 'Themes', 'accelerated-mobile-pages' ),
2257
- 'id' => 'amp-theme-settings',
2258
- 'subsection' => true,
2259
- 'fields' => array(
2260
-
2261
- $fields = array(
2262
- 'id' => 'amp-design-selector',
2263
- 'type' => 'demolink_image_select',
2264
- 'title' => __( 'Themes Selector', 'accelerated-mobile-pages' ),
2265
- 'subtitle' => __( 'Select your design from dropdown or <br /><a href="https://ampforwp.com/themes/" style="position: relative;
2266
- top: 20px;text-decoration: none;
2267
- background: #eee;padding: 5px 8px 5px 9px;
2268
- border-radius: 30px;" target="_blank">View More AMP Themes →</a>', 'accelerated-mobile-pages' ),
2269
- 'options' => $themeDesign,
2270
- 'default' => '2'
2271
- ),
2272
-
2273
- $fields = array(
2274
- 'id' => 'info_theme_framework',
2275
- 'type' => 'info',
2276
- 'style' => 'success',
2277
- 'desc' => $amptfad
2278
- )
2279
-
2280
- )
2281
- ) );
2282
-
2283
- // Global Theme Settings
2284
- Redux::setSection($opt_name, array(
2285
- 'title' => __( 'Global', 'accelerated-mobile-pages' ),
2286
- 'id' => 'amp-theme-global-subsection',
2287
- 'subsection' => true,
2288
- 'fields' => array(
2289
-
2290
- array(
2291
- 'id' => 'amp-opt-color-rgba-colorscheme',
2292
- 'type' => 'color_rgba',
2293
- 'title' => __('Color Scheme','accelerated-mobile-pages'),
2294
- 'default' => array(
2295
- 'color' => '#F42F42',
2296
- ),
2297
- 'required' => array(
2298
- array('amp-design-selector', '=' , '3')
2299
- )
2300
- ),
2301
- array(
2302
- 'id' => 'amp-opt-color-rgba-font',
2303
- 'type' => 'color_rgba',
2304
- 'title' => __('Color Scheme Font Color','accelerated-mobile-pages'),
2305
- 'default' => array(
2306
- 'color' => '#fff',
2307
- ),
2308
- 'required' => array(
2309
- array('amp-design-selector', '=' , '3')
2310
- )
2311
- ),
2312
- // Design 3
2313
- array(
2314
- 'id' => 'amp-opt-color-rgba-link',
2315
- 'type' => 'color_rgba',
2316
- 'title' => __('Anchor Link Color','accelerated-mobile-pages'),
2317
- 'default' => array(
2318
- 'color' => '#f42f42',
2319
- ),
2320
- 'required' => array(
2321
- array('amp-design-selector', '=' , '3')
2322
- )
2323
- ),
2324
- // Design 2
2325
- array(
2326
- 'id' => 'amp-opt-color-rgba-link-design2',
2327
- 'type' => 'color_rgba',
2328
- 'title' => __('Anchor Link Color','accelerated-mobile-pages'),
2329
- 'default' => array(
2330
- 'color' => '#0a89c0',
2331
- ),
2332
- 'required' => array(
2333
- array('amp-design-selector', '=' , '2')
2334
- )
2335
- ),
2336
- // Design 1
2337
- array(
2338
- 'id' => 'amp-opt-color-rgba-link-design1',
2339
- 'type' => 'color_rgba',
2340
- 'title' => __('Anchor Link Color','accelerated-mobile-pages'),
2341
- 'default' => array(
2342
- 'color' => '#0a89c0',
2343
- ),
2344
- 'required' => array(
2345
- array('amp-design-selector', '=' , '1')
2346
- )
2347
- ),
2348
- array(
2349
- 'id' => 'amp-opt-color-rgba-colorscheme-call',
2350
- 'type' => 'color_rgba',
2351
- 'title' => __('Call Button Color','accelerated-mobile-pages'),
2352
- 'default' => array(
2353
- 'color' => '#0a89c0',
2354
- ),
2355
- 'required' => array(
2356
- array('ampforwp-callnow-button', '=' , '1')
2357
- )
2358
- ),
2359
- // Date Format
2360
- array(
2361
- 'id' =>'ampforwp-post-date-format',
2362
- 'type' =>'select',
2363
- 'title' =>__('Date Format','accelerated-mobile-pages'),
2364
- 'subtitle' => __('Select the Date Format of Posts', 'accelerated-mobile-pages'),
2365
- 'options' => array(
2366
- '1' => 'Ago',
2367
- '2' => 'Traditional view'
2368
- ),
2369
- 'default' =>'1',
2370
- ),
2371
- array(
2372
- 'id' =>'ampforwp-post-date-format-text',
2373
- 'type' =>'text',
2374
- 'title' =>__('Text for the Date Format','accelerated-mobile-pages'),
2375
- 'desc' =>__('Example: English - % days ago, Spain - ago % days','accelerated-mobile-pages'),
2376
- 'required' => array( array('ampforwp-post-date-format', '=', '1') ),
2377
- 'default' =>'% days ago',
2378
- ),
2379
-
2380
- array(
2381
- 'id' => 'css_editor',
2382
- 'type' => 'ace_editor',
2383
- 'title' => __('Custom CSS', 'accelerated-mobile-pages'),
2384
- 'subtitle' => __('You can customize the Stylesheet of the AMP version by using this option.', 'accelerated-mobile-pages'),
2385
- 'mode' => 'css',
2386
- 'theme' => 'monokai',
2387
- 'desc' => '',
2388
- 'default' => __('/******* Paste your Custom CSS in this Editor *******/','accelerated-mobile-pages')
2389
- ),
2390
- )
2391
- ));
2392
-
2393
- // Header Elements default Color
2394
- function ampforwp_get_element_default_color() {
2395
- $default_value = get_option('redux_builder_amp', true);
2396
- $default_value = $default_value['amp-opt-color-rgba-colorscheme']['color'];
2397
- if ( empty( $default_value ) ) {
2398
- $default_value = '#333';
2399
- }
2400
- return $default_value;
2401
- }
2402
-
2403
- // Header Section
2404
- Redux::setSection( $opt_name, array(
2405
- 'title' => __( 'Header', 'accelerated-mobile-pages' ),
2406
- 'id' => 'amp-theme-header-settings',
2407
- 'subsection' => true,
2408
- 'fields' => array(
2409
- array(
2410
- 'id' => 'ampforwp-amp-menu',
2411
- 'type' => 'switch',
2412
- 'title' => __('Navigation Menu', 'accelerated-mobile-pages'),
2413
- 'desc' => __( 'Add Menus to your AMP pages by clicking on this <a href="'.trailingslashit(get_admin_url()).'nav-menus.php?action=locations">link</a>' , 'accelerated-mobile-pages'),
2414
- 'subtitle' => __('Enable/Disable Menu from header', 'accelerated-mobile-pages'),
2415
- 'true' => 'true',
2416
- 'false' => 'false',
2417
- 'default' => 1
2418
- ),
2419
- array(
2420
- 'id' => 'amp-design-3-search-feature',
2421
- 'type' => 'switch',
2422
- 'subtitle' => __('HTTPS is recommened for Search', 'accelerated-mobile-pages'),
2423
- 'title' => __( 'Search', 'accelerated-mobile-pages' ),
2424
- 'required' => array(
2425
- array('amp-design-selector', '=' , '3')
2426
- ),
2427
- 'default' => '0'
2428
- ),
2429
-
2430
- array(
2431
- 'id' => 'amp-design-2-search-feature',
2432
- 'subtitle' => __('HTTPS is recommened for Search', 'accelerated-mobile-pages'),
2433
- 'type' => 'switch',
2434
- 'title' => __( 'Search', 'accelerated-mobile-pages' ),
2435
- 'required' => array(
2436
- array('amp-design-selector', '=' , '2')
2437
- ),
2438
- 'default' => '0'
2439
- ),
2440
-
2441
- array(
2442
- 'id' => 'amp-design-1-search-feature',
2443
- 'subtitle' => __('HTTPS is recommened for Search', 'accelerated-mobile-pages'),
2444
- 'type' => 'switch',
2445
- 'title' => __( 'Search', 'accelerated-mobile-pages' ),
2446
- 'required' => array(
2447
- array('amp-design-selector', '=' , '1')
2448
- ),
2449
- 'default' => '0'
2450
- ),
2451
- // Call Now button
2452
- array(
2453
- 'id' => 'ampforwp-callnow-button',
2454
- 'type' => 'switch',
2455
- 'title' => __('Call Now Button', 'accelerated-mobile-pages'),
2456
- 'true' => 'true',
2457
- 'false' => 'false',
2458
- 'required' => array(
2459
- array('amp-design-selector', '!=' , '1')
2460
- ),
2461
- 'default' => 0
2462
- ),
2463
- array(
2464
- 'id' =>'enable-amp-call-numberfield',
2465
- 'type' => 'text',
2466
- 'required' => array(
2467
- array('ampforwp-callnow-button', '=' , '1'),
2468
- array('amp-design-selector', '!=' , '1')
2469
- ),
2470
- 'title' => __('Enter Phone Number', 'accelerated-mobile-pages'),
2471
- 'default' => '',
2472
- ),
2473
- array(
2474
- 'id' => 'amp-opt-color-rgba-headercolor',
2475
- 'type' => 'color_rgba',
2476
- 'title' => __('Header Background Color','accelerated-mobile-pages'),
2477
- 'default' => array(
2478
- 'color' => '#FFFFFF',
2479
- ),
2480
- 'required' => array(
2481
- array('amp-design-selector', '=' , '3')
2482
- )
2483
- ),
2484
- array(
2485
- 'id' => 'amp-opt-color-rgba-headerelements',
2486
- 'type' => 'color_rgba',
2487
- 'title' => __('Header Elements Color','accelerated-mobile-pages'),
2488
- 'default' => array(
2489
- 'color' => ampforwp_get_element_default_color(),
2490
- ),
2491
- 'required' => array(
2492
- array('amp-design-selector', '=' , '3')
2493
- )
2494
- ),
2495
- array(
2496
- 'id' =>'amp-on-off-support-for-non-amp-home-page',
2497
- 'type' => 'switch',
2498
- 'title' => __('Non-AMP HomePage link in Header and Logo', 'accelerated-mobile-pages'),
2499
- 'subtitle' => __('If you want users in header to go to non-AMP website from the Header, then you can enable this option', 'accelerated-mobile-pages'),
2500
- 'default' => 0,
2501
- ),
2502
- array(
2503
- 'id' => 'amp-opt-sticky-head',
2504
- 'type' => 'switch',
2505
- 'title' => __('Make Header UnSticky','accelerated-mobile-pages'),
2506
- 'required' => array(
2507
- array('amp-design-selector', '=' , '3')
2508
- ),
2509
- 'subtitle' => __('Turning it ON will remove the sticky head from the design.', 'accelerated-mobile-pages' ),
2510
- 'default' => '0'
2511
- ),
2512
-
2513
-
2514
- )
2515
- )
2516
- );
2517
-
2518
-
2519
- //code for fetching ctegories to show as a list in redux settings
2520
- $categories = get_categories( array(
2521
- 'orderby' => 'name',
2522
- 'order' => 'ASC'
2523
- ) );
2524
- $categories_array = array();
2525
- if ( $categories ) :
2526
- foreach ($categories as $cat ) {
2527
- $cat_id = $cat->cat_ID;
2528
- $key = "".$cat_id;
2529
- //building assosiative array of ID-cat_name
2530
- $categories_array[ $key ] = $cat->name;
2531
- }
2532
- endif;
2533
- //End of code for fetching ctegories to show as a list in redux settings
2534
-
2535
- // HomePage Section
2536
- Redux::setSection( $opt_name, array(
2537
- 'title' => __( 'HomePage', 'accelerated-mobile-pages' ),
2538
- 'id' => 'amp-theme-homepage-settings',
2539
- 'subsection' => true,
2540
- 'fields' => array(
2541
- array(
2542
- 'id' => 'amp-design-3-featured-slider',
2543
- 'type' => 'switch',
2544
- 'title' => __( 'Featured Slider', 'accelerated-mobile-pages' ),
2545
- 'required' => array(
2546
- array('amp-design-selector', '=' , '3')
2547
- ),
2548
- 'default' => '1'
2549
- ),
2550
- array(
2551
- 'id' => 'amp-design-3-category-selector',
2552
- 'type' => 'select',
2553
- 'title' => __( 'Featured Slider Category', 'accelerated-mobile-pages' ),
2554
- 'options' => $categories_array,
2555
- 'required' => array(
2556
- array('amp-design-selector', '=' , '3'),
2557
- array('amp-design-3-featured-slider', '=' , '1')
2558
- ),
2559
- ),
2560
- // Excerpt Length for design1 #1013
2561
- array(
2562
-
2563
- 'id' => 'excerpt-option-design-1',
2564
- 'type' => 'switch',
2565
- 'title' => __('Excerpt', 'accelerated-mobile-pages'),
2566
- 'default' => '1',
2567
- 'required' => array(
2568
- array('amp-design-selector', '=' , '1'),
2569
- )
2570
- ),
2571
- array(
2572
- 'id' =>'amp-design-1-excerpt',
2573
- 'type' =>'text',
2574
- 'subtitle' =>__('Enter the number of words Eg: 10','accelerated-mobile-pages'),
2575
- 'title' =>__('Excerpt Length','accelerated-mobile-pages'),
2576
- 'required' => array(
2577
- array('amp-design-selector', '=' , '1'),
2578
- array('excerpt-option-design-1', '=' , '1'),
2579
- ),
2580
- 'validate' =>'numeric',
2581
- 'default' =>'20',
2582
- ),
2583
- array(
2584
- 'id' => 'ampforwp-design1-cats-home',
2585
- 'type' => 'switch',
2586
- 'title' => __('Category label', 'accelerated-mobile-pages'),
2587
- 'default' => '0',
2588
- 'required' => array(
2589
- array('amp-design-selector', '=' , '1'),
2590
- )
2591
- ),
2592
-
2593
- // Excerpt Length for design2 #1122
2594
- array(
2595
-
2596
- 'id' => 'excerpt-option-design-2',
2597
- 'type' => 'switch',
2598
- 'title' => __('Excerpt on Small Screens', 'accelerated-mobile-pages'),
2599
- 'default' => '0',
2600
- 'required' => array(
2601
- array('amp-design-selector', '=' , '2'),
2602
- )
2603
- ),
2604
- array(
2605
- 'id' =>'amp-design-2-excerpt',
2606
- 'type' =>'text',
2607
- 'subtitle' =>__('Enter the number of words Eg: 10','accelerated-mobile-pages'),
2608
- 'title' =>__('Excerpt Length','accelerated-mobile-pages'),
2609
- 'required' => array(
2610
- array('amp-design-selector', '=' , '2'),
2611
- array('excerpt-option-design-2', '=' , '1'),
2612
- ),
2613
- 'validate' =>'numeric',
2614
- 'default' =>'20',
2615
- ),
2616
-
2617
- // Excerpt Length for design3 #1122
2618
- array(
2619
- 'id' => 'excerpt-option-design-3',
2620
- 'type' => 'switch',
2621
- 'title' => __('Excerpt on Small Screens', 'accelerated-mobile-pages'),
2622
- 'default' => '0',
2623
- 'required' => array(
2624
- array('amp-design-selector', '=' , '3'),
2625
- )
2626
- ),
2627
- array(
2628
- 'id' =>'amp-design-3-excerpt',
2629
- 'type' =>'text',
2630
- 'subtitle' =>__('Enter the number of words Eg: 10','accelerated-mobile-pages'),
2631
- 'title' =>__('Excerpt Length','accelerated-mobile-pages'),
2632
- 'required' => array(
2633
- array('amp-design-selector', '=' , '3'),
2634
- array('excerpt-option-design-3', '=' , '1'),
2635
- ),
2636
- 'validate' =>'numeric',
2637
- 'default' =>'20',
2638
- ),
2639
-
2640
- // Featured Time
2641
- array(
2642
- 'id' =>'amp-design-1-featured-time',
2643
- 'type' =>'switch',
2644
- 'title' =>__('Published Time','accelerated-mobile-pages'),
2645
- 'subtitle' => __('Display published time of the post on homepage', 'accelerated-mobile-pages'),
2646
- 'required' => array(array('amp-design-selector', '=' , '1') ),
2647
- 'default' =>'1',
2648
- ),
2649
-
2650
- array(
2651
- 'id' =>'amp-design-3-featured-time',
2652
- 'type' =>'switch',
2653
- 'title' =>__('Published Time','accelerated-mobile-pages'),
2654
- 'subtitle' => __('Display published time of the post on homepage', 'accelerated-mobile-pages'),
2655
- 'required' => array(array('amp-design-selector', '=' , '3') ),
2656
- 'default' =>'1',
2657
- ),
2658
-
2659
- // Homepage thumbnail
2660
- array(
2661
- 'id' => 'ampforwp-homepage-posts-image-modify-size',
2662
- 'type' => 'switch',
2663
- 'title' => __('Override Homepage Thumbnail Size', 'accelerated-mobile-pages'),
2664
- 'required' => array( array( 'amp-design-selector','!=',3 ) ),
2665
- 'default' => 0,
2666
- ),
2667
- array(
2668
- 'id' => 'ampforwp-homepage-posts-design-1-2-width',
2669
- 'type' => 'text',
2670
- 'title' => __('Image Width', 'accelerated-mobile-pages'),
2671
- 'subtitle' => __('Defaults to 100', 'accelerated-mobile-pages'),
2672
- 'default' => 100,
2673
- 'required' => array(
2674
- array('amp-design-selector','!=',3),
2675
- array('ampforwp-homepage-posts-image-modify-size','=',1)
2676
- )
2677
- ),
2678
- array(
2679
- 'id' => 'ampforwp-homepage-posts-design-1-2-height',
2680
- 'type' => 'text',
2681
- 'title' => __('Image Height', 'accelerated-mobile-pages'),
2682
- 'subtitle' => __('Defaults to 75', 'accelerated-mobile-pages'),
2683
- 'default' => 75,
2684
- 'required' => array(
2685
- array('amp-design-selector','!=',3),
2686
- array('ampforwp-homepage-posts-image-modify-size','=',1)
2687
- )
2688
- ),
2689
- )
2690
- ));
2691
-
2692
- // Single Section
2693
- Redux::setSection( $opt_name, array(
2694
- 'title' => __( 'Single', 'accelerated-mobile-pages' ),
2695
- // 'desc' => __( 'Additional Options to control the look of Single <a href="' . esc_url(admin_url('customize.php?autofocus[section]=amp_design&customize_amp=1')) .'"> Click here </a> ', 'accelerated-mobile-pages' ),
2696
- 'id' => 'amp-single',
2697
- 'subsection' => true,
2698
- 'fields' => array(
2699
- //Breadcrumb ON/OFF
2700
- array(
2701
- 'id' => 'ampforwp-bread-crumb',
2702
- 'type' => 'switch',
2703
- 'default' => '1',
2704
- 'title' => __('Breadcrumb', 'accelerated-mobile-pages'),
2705
- 'subtitle' => __('Enable or Disable Breadcrumb'),
2706
- ),
2707
- //Categories ON/OFF
2708
- array(
2709
- 'id' => 'ampforwp-cats-single',
2710
- 'type' => 'switch',
2711
- 'default' => '1',
2712
- 'title' => __('Categories', 'accelerated-mobile-pages'),
2713
- 'subtitle' => __('Enable or Disable Categories in Single', 'accelerated-mobile-pages'),
2714
- ),
2715
- //Tags ON/OFF
2716
- array(
2717
- 'id' => 'ampforwp-tags-single',
2718
- 'type' => 'switch',
2719
- 'default' => '1',
2720
- 'title' => __('Tags', 'accelerated-mobile-pages'),
2721
- 'subtitle' => __('Enable or Disable Tags in Single', 'accelerated-mobile-pages'),
2722
- ),
2723
- //Categories and Tags Links
2724
- array(
2725
- 'id' => 'ampforwp-cats-tags-links-single',
2726
- 'type' => 'switch',
2727
- 'default' => '1',
2728
- 'title' => __('Categories and Tags Links', 'accelerated-mobile-pages'),
2729
- 'subtitle' => __('Enable or Disable Categories/Tags links in Single', 'accelerated-mobile-pages'),
2730
- 'required' => array('ampforwp-archive-support', '=' , '1'),
2731
- ),
2732
- // Social Icons ON/OFF
2733
- array(
2734
- 'id' => 'enable-single-social-icons',
2735
- 'type' => 'switch',
2736
- 'title' => __('Sticky Social Icons', 'accelerated-mobile-pages'),
2737
- 'default' => 1,
2738
- 'subtitle' => __('Enable Social Icons in single', 'accelerated-mobile-pages'),
2739
- ),
2740
- // Excerpt ON/OFF
2741
- array(
2742
- 'id' => 'enable-excerpt-single',
2743
- 'type' => 'switch',
2744
- 'title' => __('Excerpt', 'accelerated-mobile-pages'),
2745
- 'default' => 0,
2746
- 'subtitle' => __('Enable feature to add Excerpt above Content in single', 'accelerated-mobile-pages'),
2747
- ),
2748
- //deselectable next previous links
2749
- array(
2750
- 'id' => 'enable-single-next-prev',
2751
- 'type' => 'switch',
2752
- 'title' => __('Next-Previous Links', 'accelerated-mobile-pages'),
2753
- 'default' => 1,
2754
- 'subtitle' => __('Enable Next-Previous links in single', 'accelerated-mobile-pages'),
2755
- ),
2756
- // Post Modified Date
2757
- array(
2758
- 'id' => 'post-modified-date',
2759
- 'type' => 'switch',
2760
- 'title' => __('Show Post Modified Date', 'accelerated-mobile-pages'),
2761
- 'default' => 0,
2762
- 'subtitle' => __('Show Modified date of an article at the end of the post.', 'accelerated-mobile-pages'),
2763
- ),
2764
- // Author Bio
2765
- array(
2766
- 'id' => 'amp-author-description',
2767
- 'type' => 'switch',
2768
- 'title' => __( 'Author Bio', 'accelerated-mobile-pages' ),
2769
- 'default' => '1',
2770
- ),
2771
- // Author Pages
2772
- array(
2773
- 'id' => 'ampforwp-author-page-url',
2774
- 'type' => 'switch',
2775
- 'title' => __( 'Link to Author Pages', 'accelerated-mobile-pages' ),
2776
- 'default' => '0',
2777
- ),
2778
- // Date on Single
2779
- array(
2780
- 'id' => 'amp-design-3-date-feature',
2781
- 'type' => 'switch',
2782
- 'title' => __( 'Published Date', 'accelerated-mobile-pages' ),
2783
- 'required' => array(
2784
- array('amp-design-selector', '=' , '3')
2785
- ),
2786
- 'subtitle' => __('Display date along with author and category', 'accelerated-mobile-pages' ),
2787
- 'default' => '0'
2788
- ),
2789
- // Pagination //#1015
2790
- array(
2791
- 'id' => 'amp-pagination',
2792
- 'type' => 'switch',
2793
- 'title' => __( 'Post Pagination', 'accelerated-mobile-pages' ),
2794
- 'default' => 0,
2795
- 'subtitle' => __('Enable the feature to add Pagination in single', 'accelerated-mobile-pages'),
2796
- ),
2797
- // Related Post
2798
- array(
2799
- 'id' => 'ampforwp-single-select-type-of-related',
2800
- 'type' => 'select',
2801
- 'title' => __('Related Post by', 'accelerated-mobile-pages'),
2802
- 'data' => 'page',
2803
- 'subtitle' => __('select the type of related posts', 'accelerated-mobile-pages'),
2804
- 'options' => array(
2805
- '1' => 'Tags',
2806
- '2' => 'Categories',
2807
- ),
2808
- 'default' => '2',
2809
- ),
2810
- array(
2811
- 'id' => 'ampforwp-single-order-of-related-posts',
2812
- 'type' => 'switch',
2813
- 'title' => __('Sort Related Posts Randomly', 'accelerated-mobile-pages'),
2814
- 'subtitle' => __('Related posts by random order', 'accelerated-mobile-pages'),
2815
- 'default' => 0,
2816
- ),
2817
- array(
2818
- 'id' => 'ampforwp-number-of-related-posts',
2819
- 'type' => 'text',
2820
- 'title' => __('Number of Related Post', 'accelerated-mobile-pages'),
2821
- 'subtitle' => __('Type the number of related posts you need, Eg : 2', 'accelerated-mobile-pages'),
2822
- 'validate' => 'numeric',
2823
- 'default' => '3',
2824
- ),
2825
- array(
2826
- 'id' => 'ampforwp-inline-related-posts',
2827
- 'type' => 'switch',
2828
- 'title' => __('In-Content Related Post', 'accelerated-mobile-pages'),
2829
- 'subtitle' => __('Insert Related Posts between the content', 'accelerated-mobile-pages'),
2830
- 'default' => 0,
2831
- ),
2832
- array(
2833
- 'id' => 'ampforwp-number-of-inline-related-posts',
2834
- 'type' => 'text',
2835
- 'title' => __('Number of In-Content Related Post', 'accelerated-mobile-pages'),
2836
- 'subtitle' => __('Type the number of In-Content related posts you need, Eg : 2', 'accelerated-mobile-pages'),
2837
- 'validate' => 'numeric',
2838
- 'default' => '3',
2839
- 'required' => array( array('ampforwp-inline-related-posts', '=' , '1') ),
2840
- ),
2841
-
2842
- // array(
2843
- // 'id' => 'ampforwp-comments-banner',
2844
- // 'type' => 'select',
2845
- // 'desc' => $comment_desc,
2846
- // 'title' => __(' df', 'accelerated-mobile-pages'),
2847
- // 'class' => 'new-class',
2848
- //
2849
- // // 'desc' => ' <br /><a href="' . esc_url(admin_url('customize.php?autofocus[section]=amp_design&customize_amp=1')) .'" target="_blank"><img class="ampforwp-post-builder-img" src="'.AMPFORWP_IMAGE_DIR . '/amp-post-builder.png" width="489" height="72" /></a>',
2850
- // ),
2851
- //
2852
- $fields = array(
2853
- 'id' => 'info_normal',
2854
- 'type' => 'info',
2855
- 'class' => 'extension_banner_bg',
2856
- 'desc' => $single_extension_listing )
2857
-
2858
- ),
2859
-
2860
- ) );
2861
-
2862
- // Footer Section
2863
- Redux::setSection( $opt_name, array(
2864
- 'title' => __( 'Footer', 'accelerated-mobile-pages' ),
2865
- 'id' => 'amp-theme-footer-settings',
2866
- 'subsection' => true,
2867
- 'fields' => array(
2868
-
2869
- array(
2870
- 'id' => 'amp-footer-link-non-amp-page',
2871
- 'type' => 'switch',
2872
- 'title' => __('Link to Non-AMP page in Footer', 'accelerated-mobile-pages'),
2873
- 'subtitle' => __('Enable / Disable Link to Non-AMP page in the footer', 'accelerated-mobile-pages'),
2874
- 'true' => 'true',
2875
- 'false' => 'false',
2876
- 'default' => 1
2877
- ),
2878
-
2879
- array(
2880
- 'id' => 'ampforwp-footer-top',
2881
- 'type' => 'switch',
2882
- 'title' => __('Back to Top link', 'accelerated-mobile-pages'),
2883
- 'subtitle' => __('Enable / Disable Link to top of the page in the footer', 'accelerated-mobile-pages'),
2884
- 'true' => 'true',
2885
- 'false' => 'false',
2886
- 'default' => 1,
2887
- 'required' => array(
2888
- array('amp-design-selector', '!=' , '3')
2889
- )
2890
- ),
2891
- array(
2892
- 'id' => 'ampforwp-footer-top-design3',
2893
- 'type' => 'switch',
2894
- 'title' => __('Back to Top link', 'accelerated-mobile-pages'),
2895
- 'subtitle' => __('Enable / Disable Link to top of the page in the footer', 'accelerated-mobile-pages'),
2896
- 'true' => 'true',
2897
- 'false' => 'false',
2898
- 'default' => 0,
2899
- 'required' => array( array( 'amp-design-selector', '=' , '3' ) )
2900
- ),
2901
-
2902
- array(
2903
- 'id' => 'amp-design-3-credit-link',
2904
- 'type' => 'switch',
2905
- 'title' => __( 'Credit link', 'accelerated-mobile-pages' ),
2906
- 'required' => array(
2907
- array('amp-design-selector', '=' , '3')
2908
- ),
2909
- 'default' => '1'
2910
- ),
2911
- )
2912
- ));
2913
-
2914
- // Page Section
2915
- Redux::setSection( $opt_name, array(
2916
- 'title' => __( 'Page', 'accelerated-mobile-pages' ),
2917
- 'id' => 'amp-theme-page-settings',
2918
- 'subsection' => true,
2919
- 'fields' => array(
2920
- /* // Pages Separator
2921
- array(
2922
- 'id' => 'Page',
2923
- 'type' => 'section',
2924
- 'title' => __('Pages', 'accelerated-mobile-pages'),
2925
- 'indent' => true,
2926
- ),*/
2927
- // Meta ON/OFF Pages
2928
- array(
2929
- 'id' => 'meta_page',
2930
- 'type' => 'switch',
2931
- 'default' => '0',
2932
- 'title' => __('Meta Information', 'accelerated-mobile-pages'),
2933
- 'subtitle' => __('Enable or disable the Meta info on Pages'),
2934
- ),
2935
- )
2936
- ));
2937
-
2938
- // Social Section
2939
- Redux::setSection( $opt_name, array(
2940
- 'title' => __( 'Social', 'accelerated-mobile-pages' ),
2941
- 'id' => 'amp-social',
2942
- 'desc' => __('All the Social sharing and the social profile related settings are here','accelerated-mobile-pages'),
2943
- 'subsection' => true,
2944
- 'fields' => array(
2945
- // Facebook Like
2946
- array(
2947
- 'id' => 'ampforwp-facebook-like-button',
2948
- 'type' => 'switch',
2949
- 'title' => __('Facebook Like Button', 'accelerated-mobile-pages'),
2950
- 'default' => 0,
2951
- ),
2952
- // Facebook ON/OFF
2953
- array(
2954
- 'id' => 'enable-single-facebook-share',
2955
- 'type' => 'switch',
2956
- //'required' => array('enable-single-social-icons', '=' , '1'),
2957
- 'title' => __('Facebook', 'accelerated-mobile-pages'),
2958
- 'default' => 0,
2959
- ),
2960
- // Facebook app ID
2961
- array(
2962
- 'id' => 'amp-facebook-app-id',
2963
- 'title' => __('Facebook App ID', 'accelerated-mobile-pages'),
2964
- 'subtitle' => __('In order to use Facebook share you need to register an app ID, you can register one here: https://developers.facebook.com/apps.', 'accelerated-mobile-pages'),
2965
- 'type' => 'text',
2966
- 'required' => array('enable-single-facebook-share', '=' , '1'),
2967
- 'placeholder' => __('Enter your facebook app id','accelerated-mobile-pages'),
2968
- 'default' => ''
2969
- ),
2970
- // Twitter ON/OFF
2971
- array(
2972
- 'id' => 'enable-single-twitter-share',
2973
- 'type' => 'switch',
2974
- 'title' => __('Twitter', 'accelerated-mobile-pages'),
2975
- 'default' => 1,
2976
- ),
2977
- array(
2978
- 'id' => 'enable-single-twitter-share-handle',
2979
- 'type' => 'text',
2980
- 'title' => __('Twitter Handle', 'accelerated-mobile-pages'),
2981
- 'required' => array('enable-single-twitter-share', '=' , '1'),
2982
- 'placeholder' => __('Eg: @xyx','accelerated-mobile-pages'),
2983
- 'default' => '',
2984
- ),
2985
- array(
2986
- 'id' => 'enable-single-twitter-share-link',
2987
- 'type' => 'switch',
2988
- 'title' => __('Pretty Permalinks for Twitter Share?', 'accelerated-mobile-pages'),
2989
- 'subtitle' => __('Enable this to have pretty links for twitter sharing'),
2990
- 'default' => 0,
2991
- 'required' => array('enable-single-twitter-share', '=' , '1'),
2992
- ),
2993
- // GooglePlus ON/OFF
2994
- array(
2995
- 'id' => 'enable-single-gplus-share',
2996
- 'type' => 'switch',
2997
- 'title' => __('GooglePlus', 'accelerated-mobile-pages'),
2998
- 'default' => 1,
2999
- ),
3000
- // Email ON/OFF
3001
- array(
3002
- 'id' => 'enable-single-email-share',
3003
- 'type' => 'switch',
3004
- 'title' => __('Email', 'accelerated-mobile-pages'),
3005
- 'default' => 1,
3006
- ),
3007
- // Pinterest ON/OFF
3008
- array(
3009
- 'id' => 'enable-single-pinterest-share',
3010
- 'type' => 'switch',
3011
- 'title' => __('Pinterest', 'accelerated-mobile-pages'),
3012
- 'default' => 1,
3013
- ),
3014
- // LinkedIn ON/OFF
3015
- array(
3016
- 'id' => 'enable-single-linkedin-share',
3017
- 'type' => 'switch',
3018
- 'title' => __('LinkedIn', 'accelerated-mobile-pages'),
3019
- 'default' => 1,
3020
- ),
3021
- // WhatsApp
3022
- array(
3023
- 'id' => 'enable-single-whatsapp-share',
3024
- 'type' => 'switch',
3025
- 'title' => __('WhatsApp', 'accelerated-mobile-pages'),
3026
- 'default' => 1,
3027
- ),
3028
- // LINE
3029
- array(
3030
- 'id' => 'enable-single-line-share',
3031
- 'type' => 'switch',
3032
- 'title' => __('Line', 'accelerated-mobile-pages'),
3033
- 'default' => 1,
3034
- ),
3035
- // VKontakte
3036
- array(
3037
- 'id' => 'enable-single-vk-share',
3038
- 'type' => 'switch',
3039
- 'title' => __('VKontakte', 'accelerated-mobile-pages'),
3040
- 'default' => 0,
3041
- ),
3042
- // Odnoklassniki
3043
- array(
3044
- 'id' => 'enable-single-odnoklassniki-share',
3045
- 'type' => 'switch',
3046
- 'title' => __('Odnoklassniki', 'accelerated-mobile-pages'),
3047
- 'default' => 0,
3048
- ),
3049
- array(
3050
- 'id' => 'social-media-profiles-subsection',
3051
- 'type' => 'section',
3052
- 'title' => __('Social Media Profiles (Design #3)', 'accelerated-mobile-pages'),
3053
- 'subtitle' => __('Please enter your personal/organizational social media profiles here', 'accelerated-mobile-pages'),
3054
- 'indent' => true,
3055
- 'required' => array(
3056
- array('amp-design-selector', '=' , '3')
3057
- ),
3058
- ),
3059
- //#1
3060
- array(
3061
- 'id' => 'enable-single-twittter-profile',
3062
- 'type' => 'switch',
3063
- 'title' => __('Twitter ', 'accelerated-mobile-pages'),
3064
- 'default' => 1,
3065
- 'required' => array(
3066
- array('amp-design-selector', '=' , '3')
3067
- ),
3068
- ),
3069
- array(
3070
- 'id' => 'enable-single-twittter-profile-url',
3071
- 'type' => 'text',
3072
- 'title' => __('Twitter URL', 'accelerated-mobile-pages'),
3073
- 'default' => '#',
3074
- 'required' => array(
3075
- array('amp-design-selector', '=' , '3'),
3076
- array('enable-single-twittter-profile', '=' , '1')
3077
- ),
3078
- ),
3079
- //#2
3080
- array(
3081
- 'id' => 'enable-single-facebook-profile',
3082
- 'type' => 'switch',
3083
- 'title' => __('Facebook ', 'accelerated-mobile-pages'),
3084
- 'default' => 1,
3085
- 'required' => array(
3086
- array('amp-design-selector', '=' , '3')
3087
- ),
3088
- ),
3089
- array(
3090
- 'id' => 'enable-single-facebook-profile-url',
3091
- 'type' => 'text',
3092
- 'title' => __('Facebook URL', 'accelerated-mobile-pages'),
3093
- 'default' => '#',
3094
- 'required' => array(
3095
- array('amp-design-selector', '=' , '3'),
3096
- array('enable-single-facebook-profile', '=' , '1')
3097
- ),
3098
- ),
3099
- //#3
3100
- array(
3101
- 'id' => 'enable-single-pintrest-profile',
3102
- 'type' => 'switch',
3103
- 'title' => __('Pintrest ', 'accelerated-mobile-pages'),
3104
- 'default' => 1,
3105
- 'required' => array(
3106
- array('amp-design-selector', '=' , '3')
3107
- ),
3108
- ),
3109
- array(
3110
- 'id' => 'enable-single-pintrest-profile-url',
3111
- 'type' => 'text',
3112
- 'title' => __('Pintrest URL', 'accelerated-mobile-pages'),
3113
- 'default' => '#',
3114
- 'required' => array(
3115
- array('amp-design-selector', '=' , '3'),
3116
- array('enable-single-pintrest-profile', '=' , '1')
3117
- ),
3118
- ),
3119
- //#4
3120
- array(
3121
- 'id' => 'enable-single-google-plus-profile',
3122
- 'type' => 'switch',
3123
- 'title' => __('Google Plus ', 'accelerated-mobile-pages'),
3124
- 'default' => 0,
3125
- 'required' => array(
3126
- array('amp-design-selector', '=' , '3')
3127
- ),
3128
- ),
3129
- array(
3130
- 'id' => 'enable-single-google-plus-profile-url',
3131
- 'type' => 'text',
3132
- 'title' => __('Google Plus URL', 'accelerated-mobile-pages'),
3133
- 'default' => '',
3134
- 'required' => array(
3135
- array('amp-design-selector', '=' , '3'),
3136
- array('enable-single-google-plus-profile', '=' , '1')
3137
- ),
3138
- ),
3139
- //#5
3140
- array(
3141
- 'id' => 'enable-single-linkdin-profile',
3142
- 'type' => 'switch',
3143
- 'title' => __('LinkedIn', 'accelerated-mobile-pages'),
3144
- 'default' => 0,
3145
- 'required' => array(
3146
- array('amp-design-selector', '=' , '3')
3147
- ),
3148
- ),
3149
- array(
3150
- 'id' => 'enable-single-linkdin-profile-url',
3151
- 'type' => 'text',
3152
- 'title' => __('LinkedIn URL', 'accelerated-mobile-pages'),
3153
- 'default' => '',
3154
- 'required' => array(
3155
- array('amp-design-selector', '=' , '3'),
3156
- array('enable-single-linkdin-profile', '=' , '1')
3157
- ),
3158
- ),
3159
- //#6
3160
- array(
3161
- 'id' => 'enable-single-youtube-profile',
3162
- 'type' => 'switch',
3163
- 'title' => __('Youtube ', 'accelerated-mobile-pages'),
3164
- 'default' => 1,
3165
- 'required' => array(
3166
- array('amp-design-selector', '=' , '3')
3167
- ),
3168
- ),
3169
- array(
3170
- 'id' => 'enable-single-youtube-profile-url',
3171
- 'type' => 'text',
3172
- 'default' => '#',
3173
- 'title' => __('Youtube URL', 'accelerated-mobile-pages'),
3174
- 'required' => array(
3175
- array('amp-design-selector', '=' , '3'),
3176
- array('enable-single-youtube-profile', '=' , '1')
3177
- ),
3178
- ),
3179
- //#7
3180
- array(
3181
- 'id' => 'enable-single-instagram-profile',
3182
- 'type' => 'switch',
3183
- 'title' => __('Instagram ', 'accelerated-mobile-pages'),
3184
- 'default' => 0,
3185
- 'required' => array(
3186
- array('amp-design-selector', '=' , '3')
3187
- ),
3188
- ),
3189
- array(
3190
- 'id' => 'enable-single-instagram-profile-url',
3191
- 'type' => 'text',
3192
- 'default' => '',
3193
- 'title' => __('Instagram URL', 'accelerated-mobile-pages'),
3194
- 'required' => array(
3195
- array('amp-design-selector', '=' , '3'),
3196
- array('enable-single-instagram-profile', '=' , '1')
3197
- ),
3198
- ),
3199
- //#8
3200
- array(
3201
- 'id' => 'enable-single-VKontakte-profile',
3202
- 'type' => 'switch',
3203
- 'title' => __('VKontakte ', 'accelerated-mobile-pages'),
3204
- 'default' => 0,
3205
- 'required' => array(
3206
- array('amp-design-selector', '=' , '3')
3207
- ),
3208
- ),
3209
- array(
3210
- 'id' => 'enable-single-VKontakte-profile-url',
3211
- 'type' => 'text',
3212
- 'default' => '',
3213
- 'title' => __('VKontakte URL', 'accelerated-mobile-pages'),
3214
- 'required' => array(
3215
- array('amp-design-selector', '=' , '3'),
3216
- array('enable-single-VKontakte-profile', '=' , '1')
3217
- ),
3218
- ),
3219
- //#9
3220
- //removed whatsapp
3221
- //#10
3222
- array(
3223
- 'id' => 'enable-single-reddit-profile',
3224
- 'type' => 'switch',
3225
- 'title' => __('Reddit', 'accelerated-mobile-pages'),
3226
- 'default' => 0,
3227
- 'required' => array(
3228
- array('amp-design-selector', '=' , '3')
3229
- ),
3230
- ),
3231
- array(
3232
- 'id' => 'enable-single-reddit-profile-url',
3233
- 'type' => 'text',
3234
- 'title' => __('Reddit URL', 'accelerated-mobile-pages'),
3235
- 'default' => '',
3236
- 'required' => array(
3237
- array('amp-design-selector', '=' , '3'),
3238
- array('enable-single-reddit-profile', '=' , '1')
3239
- ),
3240
- ),
3241
- //#11
3242
- array(
3243
- 'id' => 'enable-single-snapchat-profile',
3244
- 'type' => 'switch',
3245
- 'title' => __('Snapchat ', 'accelerated-mobile-pages'),
3246
- 'default' => 0,
3247
- 'required' => array(
3248
- array('amp-design-selector', '=' , '3')
3249
- ),
3250
- ),
3251
- array(
3252
- 'id' => 'enable-single-snapchat-profile-url',
3253
- 'type' => 'text',
3254
- 'title' => __('Snapchat URL', 'accelerated-mobile-pages'),
3255
- 'default' => '',
3256
- 'required' => array(
3257
- array('amp-design-selector', '=' , '3'),
3258
- array('enable-single-snapchat-profile', '=' , '1')
3259
- ),
3260
- ),
3261
- //#12
3262
- array(
3263
- 'id' => 'enable-single-Tumblr-profile',
3264
- 'type' => 'switch',
3265
- 'title' => __('Tumblr', 'accelerated-mobile-pages'),
3266
- 'default' => 0,
3267
- 'required' => array(
3268
- array('amp-design-selector', '=' , '3')
3269
- ),
3270
- ),
3271
- array(
3272
- 'id' => 'enable-single-Tumblr-profile-url',
3273
- 'type' => 'text',
3274
- 'title' => __('Tumblr URL', 'accelerated-mobile-pages'),
3275
- 'default' => '',
3276
- 'required' => array(
3277
- array('amp-design-selector', '=' , '3'),
3278
- array('enable-single-Tumblr-profile', '=' , '1')
3279
- ),
3280
- ),
3281
- )
3282
- ) );
3283
-
3284
-
3285
- // Misc SECTION
3286
- Redux::setSection( $opt_name, array(
3287
- 'title' => __( 'Misc', 'accelerated-mobile-pages' ),
3288
- 'desc' => '
3289
- <br /><a href="' . esc_url(admin_url('customize.php?autofocus[section]=amp_design&customize_amp=1')) .'" target="_blank"><img class="ampforwp-post-builder-img" src="'.AMPFORWP_IMAGE_DIR . '/amp-post-builder.png" width="489" height="72" /></a>',
3290
- 'id' => 'amp-design',
3291
- 'subsection' => true,
3292
- 'fields' => array(
3293
-
3294
- // RTL
3295
- array(
3296
- 'id' =>'amp-rtl-select-option',
3297
- 'type' => 'switch',
3298
- 'title' => __('RTL Support', 'accelerated-mobile-pages'),
3299
- 'default' => 0,
3300
- 'subtitle' => __('Enable Right to Left language support', 'accelerated-mobile-pages'),
3301
- 'true' => 'true',
3302
- 'false' => 'false',
3303
- ),
3304
- array(
3305
- 'id' => 'ampforwp-sub-categories-support',
3306
- 'type' => 'switch',
3307
- 'title' => __('Sub-Categories under Category', 'accelerated-mobile-pages'),
3308
- 'subtitle' => __('Display sub-categories on category pages', 'accelerated-mobile-pages'),
3309
- 'default' => '0'
3310
- ),
3311
- )
3312
-
3313
- ) );
3314
-
3315
-
3316
-
3317
- // Extension Section
3318
- Redux::setSection( $opt_name, array(
3319
- 'title' => __( 'Extensions', 'accelerated-mobile-pages' ),
3320
- // 'desc' => __( 'For full documentation on this field, visit: ', 'accelerated-mobile-pages' ) . '<a href="http://docs.reduxframework.com/core/fields/textarea/" target="_blank">http://docs.reduxframework.com/core/fields/textarea/</a>',
3321
- 'id' => 'opt-go-premium',
3322
- 'subsection' => false,
3323
- 'desc' => $extension_listing,
3324
- 'icon' => 'el el-puzzle',
3325
- // 'desc' => '<a href="http://ampforwp.com/advanced-amp-ads/#utm_source=options-panel&utm_medium=extension-tab_advanced-amp-ads&utm_campaign=AMP%20Plugin" target="_blank"><img class="ampforwp-extension-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/amp-ads-extension.png" width="345" height="500" /></a>
3326
- //
3327
- // <a href="http://ampforwp.com/custom-post-type/#utm_source=options-panel&utm_medium=extension-tab_custom-post-type&utm_campaign=AMP%20Plugin" target="_blank"><img class="ampforwp-extension-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/amp-custom-post-type-extension.png" width="345" height="500" /></a>
3328
- //
3329
- // <a href="http://ampforwp.com/doubleclick-for-publishers/#utm_source=options-panel&utm_medium=extension-tab_doubleclick&utm_campaign=AMP%20Plugin" target="_blank"><img class="ampforwp-extension-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/amp-DoubleClick-extensions.png" width="345" height="500" /></a>
3330
- //
3331
- // <a href="http://ampforwp.com/amp-ratings/#utm_source=options-panel&utm_medium=extension-tab_amp-ratings&utm_campaign=AMP%20Plugin" target="_blank"><img class="ampforwp-extension-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/amp-rating-extension.png" width="345" height="500" /></a>
3332
- //
3333
- //
3334
- // <a href="http://ampforwp.com/extensions/#utm_source=options-panel&utm_medium=extension-tab_coming-soon&utm_campaign=AMP%20Plugin" target="_blank"><img class="ampforwp-extension-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/extension-coming-soon.png" width="345" height="500" /></a>',
3335
- // 'icon' => 'el el-puzzle',
3336
- ) );
3337
-
3338
-
3339
-
3340
- // Priority Support
3341
- Redux::setSection( $opt_name, array(
3342
- 'title' => __( 'Fix AMP Errors', 'accelerated-mobile-pages' ),
3343
- // 'desc' => __( 'For full documentation on this field, visit: ', 'accelerated-mobile-pages' ) . '<a href="http://docs.reduxframework.com/core/fields/textarea/" target="_blank">http://docs.reduxframework.com/core/fields/textarea/</a>',
3344
- 'id' => 'opt-go-premium-support',
3345
- 'subsection' => false,
3346
- 'desc' => ' <a href="http://ampforwp.com/priority-support/#utm_source=options-panel&utm_medium=extension-tab_priority_support&utm_campaign=AMP%20Plugin" target="_blank"><img class="ampforwp-support-banner" src="'.AMPFORWP_IMAGE_DIR . '/priority-support-banner.png" width="345" height="500" /></a>',
3347
- 'icon' => 'el el-hand-right',
3348
- ) );
3349
-
3350
-
3351
-
3352
- // Plugin Manager
3353
- Redux::setSection( $opt_name, array(
3354
- 'title' => __( 'Plugins Manager', 'accelerated-mobile-pages' ),
3355
- 'id' => 'opt-plugins-manager',
3356
- 'subsection' => false,
3357
- 'desc' => 'You can Disable Plugins only in AMP which are causing AMP validation errors. <a href="http://ampforwp.com/plugins-manager" target="_blank">More Information.</a>',
3358
- 'icon' => 'el el-magic',
3359
- 'fields' => array(
3360
-
3361
- array(
3362
- 'id' => 'ampforwp-plugin-manager-core',
3363
- 'type' => 'switch',
3364
- 'title' => __('Enable Plugin Manager', 'accelerated-mobile-pages'),
3365
- 'default' => 0
3366
- ),
3367
- array(
3368
- // 'title' => __('Notification text', 'accelerated-mobile-pages'),
3369
- 'id' => 'info_normal',
3370
- 'type' => 'info',
3371
- 'required' => array('ampforwp-plugin-manager-core', '=' , '1'),
3372
- 'desc' => '<div style=" background: #FFF9C4;padding: 12px;line-height: 1.6;margin: -45px -14px -18px -17px;"><b>ONE LAST STEP REQUIRED:</b> This feature requires <a href="https://ampforwp.com/plugins-manager" target="_blank">AMP Plugin Manager</a>.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/plugins-manager" target="_blank">Click here for more info</a>)</div></div>',
3373
- ),
3374
- )
3375
- ) );
3376
-
3377
-
3378
- Redux::setExtensions( $opt_name, AMPFORWP_PLUGIN_DIR.'includes/options/extensions/demolink_image_select' );
3379
- /*
3380
- * <--- END SECTIONS
1
+ <?php
2
+ //Admin Panel Options
3
+ if ( ! class_exists( 'Redux' ) ) {
4
+ return;
5
+ }
6
+ // Option name where all the Redux data is stored.
7
+ $opt_name = "redux_builder_amp";
8
+ $amptfad = '<strong>DID YOU KNOW?</strong></br ><a href="https://ampforwp.com/amp-theme-framework/" target="_blank">You can create your own <strong>Custom theme with AMP Theme Framework</strong></a>';
9
+ // #1093 Display only If AMP Comments is Not Installed
10
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
11
+ if(!is_plugin_active( 'amp-comments/amp-comments.php' )){
12
+ $comment_AD_URL = "http://ampforwp.com/amp-comments/#utm_source=options-panel&utm_medium=comments-tab&utm_campaign=AMP%20Plugin";
13
+ $comment_desc = '<a href="'.$comment_AD_URL.'" target="_blank"><img class="ampforwp-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/comments-banner.png" width="560" height="85" /></a>';
14
+ }
15
+ // If CTA is not Activated
16
+ $cta_desc = "";
17
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
18
+ if(!is_plugin_active( 'AMP-cta/amp-cta.php' )){
19
+ $cta_AD_URL = "http://ampforwp.com/call-to-action/#utm_source=options-panel&utm_medium=call-to-action_banner_in_notification_bar&utm_campaign=AMP%20Plugin";
20
+ $cta_desc = '<a href="'.$cta_AD_URL.'" target="_blank"><img class="ampforwp-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/cta-banner.png" width="560" height="85" /></a>';
21
+ }
22
+ $extension_listing = '
23
+ <div class="extension_listing">
24
+ <p style="font-size:13px">Take your AMP to the next level with these premium extensions which gives you advanced features.</p>
25
+ <ul>
26
+ <li class="first"><a href="http://ampforwp.com/advanced-amp-ads/#utm_source=options-panel&utm_medium=extension-tab_advanced-amp-ads&utm_campaign=AMP%20Plugin" target="_blank">
27
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/click.png" /></div>
28
+ <div class="extension_desc">
29
+ <h2>Advanced AMP ADS</h2>
30
+ <p>Add Advertisement directly in the content</p>
31
+ <div class="extension_btn">From: $29</div>
32
+ </div>
33
+ </a></li>
34
+ <li class="second"><a href="http://ampforwp.com/contact-form-7/#utm_source=options-panel&utm_medium=extension-tab_cf7&utm_campaign=AMP%20Plugin" target="_blank">
35
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/cf7.png" /></div>
36
+ <div class="extension_desc">
37
+ <h2>Contact Form 7</h2>
38
+ <p>Add Contact Us Form in AMP.</p>
39
+ <div class="extension_btn">From: $39</div>
40
+ </div>
41
+ </a></li>
42
+ <li class="second"><a href="http://ampforwp.com/gravity-forms/#utm_source=options-panel&utm_medium=extension-tab_gf&utm_campaign=AMP%20Plugin" target="_blank">
43
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/gf.png" /></div>
44
+ <div class="extension_desc">
45
+ <h2>Gravity Forms</h2>
46
+ <p>Add Gravity Forms Support in AMP.</p>
47
+ <div class="extension_btn">From: $79</div>
48
+ </div>
49
+ </a></li>
50
+ <li class="first"><a href="http://ampforwp.com/opt-in-forms/#utm_source=options-panel&utm_medium=extension-tab_opt-in-forms&utm_campaign=AMP%20Plugin" target="_blank">
51
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/email.png" /></div>
52
+ <div class="extension_desc">
53
+ <h2>Email Opt-in Forms</h2>
54
+ <p>Capture Leads with Email Subscription.</p>
55
+ <div class="extension_btn">From: $79</div>
56
+ </div>
57
+ </a></li>
58
+ <li class="second"><a href="http://ampforwp.com/call-to-action/#utm_source=options-panel&utm_medium=extension-tab_amp-cta&utm_campaign=AMP%20Plugin" target="_blank">
59
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/mac-click.png" /></div>
60
+ <div class="extension_desc">
61
+ <h2>Call To Action (CTA)</h2>
62
+ <p>Higher Visibility & More Conversions</p>
63
+ <div class="extension_btn">From: $29</div>
64
+ </div>
65
+ </a></li>
66
+ <li class="first"><a href="http://ampforwp.com/custom-post-type/#utm_source=options-panel&utm_medium=extension-tab_custom-post-type&utm_campaign=AMP%20Plugin" target="_blank">
67
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/comments.png" /></div>
68
+ <div class="extension_desc">
69
+ <h2>Custom Post Type</h2>
70
+ <p>Enable Custom Post type support in AMP.</p>
71
+ <div class="extension_btn">From: $19</div>
72
+ </div>
73
+ </a></li>
74
+
75
+ <li class="second"><a href="http://ampforwp.com/acf-amp/#utm_source=options-panel&utm_medium=extension-tab_opt-in-forms&utm_campaign=AMP%20Plugin" target="_blank">
76
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/acf.png" /></div>
77
+ <div class="extension_desc">
78
+ <h2>Advanced Custom Fields</h2>
79
+ <p>Easily add ACF support in AMP.</p>
80
+ <div class="extension_btn">From: $29</div>
81
+ </div>
82
+ </a></li>
83
+ <li class="first"><a href="http://ampforwp.com/doubleclick-for-publishers/#utm_source=options-panel&utm_medium=extension-tab_doubleclick&utm_campaign=AMP%20Plugin" target="_blank">
84
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/dfp.png" /></div>
85
+ <div class="extension_desc">
86
+ <h2>DoubleClick For Publishers</h2>
87
+ <p>Enable DFP Support for AMP.</p>
88
+ <div class="extension_btn">From: $19</div>
89
+ </div>
90
+ </a></li>
91
+
92
+
93
+ <li class="second"><a href="http://ampforwp.com/amp-ratings/#utm_source=options-panel&utm_medium=extension-tab_amp-ratings&utm_campaign=AMP%20Plugin" target="_blank">
94
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/star.png" /></div>
95
+ <div class="extension_desc">
96
+ <h2>Star Ratings</h2>
97
+ <p>Star Review Ratings for AMP.</p>
98
+ <div class="extension_btn">From: $19</div>
99
+ </div>
100
+ </a></li>
101
+ <li class="first"><a href="https://ampforwp.com/woocommerce/" target="_blank">
102
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/woo.png" /></div>
103
+ <div class="extension_desc">
104
+ <h2>AMP WooCommerce Pro</h2>
105
+ <p>Advanced WooCommerce in AMP in two clicks.</p>
106
+ <div class="extension_btn">From: $79</div>
107
+ </div>
108
+ </a></li>
109
+
110
+ <li class="second"><a href="http://ampforwp.com/amp-category-base-remove-support/#utm_source=options-panel&utm_medium=extension-tab_amp-category-base-remove-support&utm_campaign=AMP%20Plugin" target="_blank">
111
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/puzzel.png" /></div>
112
+ <div class="extension_desc">
113
+ <h2>Category Base Removal</h2>
114
+ <p>Remove Category Base Support in AMP</p>
115
+ <div class="extension_btn">FREE</div>
116
+ </div>
117
+ </a></li>
118
+ <li class="first"><a href="https://ampforwp.com/extensions/#utm_source=options-panel&utm_medium=extension-tab_amp-more-comingsoon&utm_campaign=AMP%20Plugin" target="_blank">
119
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/comments.png" /></div>
120
+ <div class="extension_desc">
121
+ <h2>View All Extensions</h2>
122
+ <p>See all the extensions available for AMP</p>
123
+ </div>
124
+ </a></li>
125
+
126
+
127
+ </ul>
128
+ </div>
129
+ ';
130
+
131
+
132
+ $gettingstarted_extension_listing = '
133
+ <div class="extension_listing getting_started_listing">
134
+ <p style="font-size:13px">Take your AMP to the next level with these premium extensions which gives you advanced features.</p>
135
+ <ul>
136
+ <li class="first"><a href="http://ampforwp.com/advanced-amp-ads/#utm_source=options-panel&utm_medium=gettingstarted-amp-ads&utm_campaign=AMP%20Plugin" target="_blank">
137
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/click.png" /></div>
138
+ <div class="extension_desc">
139
+ <h2>Advanced AMP ADS</h2>
140
+ <p>Add Advertisement directly in the content</p>
141
+ <div class="extension_btn">From: $29</div>
142
+ </div>
143
+ </a></li>
144
+ <li class="second"><a href="http://ampforwp.com/opt-in-forms/#utm_source=options-panel&utm_medium=gettingstarted_opt-in-forms&utm_campaign=AMP%20Plugin" target="_blank">
145
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/email.png" /></div>
146
+ <div class="extension_desc">
147
+ <h2>Email Opt-in Forms</h2>
148
+ <p>Capture Leads with Email Subscription.</p>
149
+ <div class="extension_btn">From: $79</div>
150
+ </div>
151
+ </a></li>
152
+ <li class="first"><a href="http://ampforwp.com/call-to-action/#utm_source=options-panel&utm_medium=gettingstarted_amp-cta&utm_campaign=AMP%20Plugin" target="_blank">
153
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/mac-click.png" /></div>
154
+ <div class="extension_desc">
155
+ <h2>Call To Action (CTA)</h2>
156
+ <p>Higher Visibility & More Conversions</p>
157
+ <div class="extension_btn">From: $29</div>
158
+ </div>
159
+ </a></li>
160
+ <li class="second"><a href="http://ampforwp.com/custom-post-type/#utm_source=options-panel&utm_medium=gettingstarted_custom-post-type&utm_campaign=AMP%20Plugin" target="_blank">
161
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/comments.png" /></div>
162
+ <div class="extension_desc">
163
+ <h2>Custom Post Type</h2>
164
+ <p>Enable Custom Post type support in AMP.</p>
165
+ <div class="extension_btn">From: $19</div>
166
+ </div>
167
+ </a></li>
168
+
169
+ <li class="first"><a href="http://ampforwp.com/acf-amp/#utm_source=options-panel&utm_medium=gettingstarted_acf&utm_campaign=AMP%20Plugin" target="_blank">
170
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/acf.png" /></div>
171
+ <div class="extension_desc">
172
+ <h2>Advanced Custom Fields</h2>
173
+ <p>Easily add ACF support in AMP.</p>
174
+ <div class="extension_btn">From: $29</div>
175
+ </div>
176
+ </a></li>
177
+ <li class="second"><a href="http://ampforwp.com/doubleclick-for-publishers/#utm_source=options-panel&utm_medium=gettingstarted_doubleclick&utm_campaign=AMP%20Plugin" target="_blank">
178
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/dfp.png" /></div>
179
+ <div class="extension_desc">
180
+ <h2>DoubleClick For Publishers</h2>
181
+ <p>Enable DFP Support for AMP.</p>
182
+ <div class="extension_btn">From: $19</div>
183
+ </div>
184
+ </a></li>
185
+
186
+
187
+ <li class="first"><a href="http://ampforwp.com/amp-ratings/#utm_source=options-panel&utm_medium=gettingstarted_amp-ratings&utm_campaign=AMP%20Plugin" target="_blank">
188
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/star.png" /></div>
189
+ <div class="extension_desc">
190
+ <h2>Star Ratings</h2>
191
+ <p>Star Review Ratings for AMP.</p>
192
+ <div class="extension_btn">From: $19</div>
193
+ </div>
194
+ </a></li>
195
+ <li class="second"><a href="https://ampforwp.com/woocommerce/" target="_blank">
196
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/woo.png" /></div>
197
+ <div class="extension_desc">
198
+ <h2>AMP WooCommerce Pro</h2>
199
+ <p>Advanced WooCommerce in AMP in two clicks.</p>
200
+ <div class="extension_btn">From: $79</div>
201
+ </div>
202
+ </a></li>
203
+
204
+ <li class="first"><a href="http://ampforwp.com/amp-category-base-remove-support/#utm_source=options-panel&utm_medium=gettingstarted_amp-category-base-remove-support&utm_campaign=AMP%20Plugin" target="_blank">
205
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/puzzel.png" /></div>
206
+ <div class="extension_desc">
207
+ <h2>Category Base Removal</h2>
208
+ <p>Remove Category Base Support in AMP</p>
209
+ <div class="extension_btn">FREE</div>
210
+ </div>
211
+ </a></li>
212
+ <li class="second"><a href="https://ampforwp.com/extensions/#utm_source=options-panel&utm_medium=gettingstarted_amp-more-comingsoon&utm_campaign=AMP%20Plugin" target="_blank">
213
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/comments.png" /></div>
214
+ <div class="extension_desc">
215
+ <h2>View All Extensions</h2>
216
+ <p>See all the extensions available for AMP</p>
217
+ <div class="extension_btn">View All</div> </div>
218
+ </a></li>
219
+
220
+
221
+ </ul>
222
+ </div>
223
+ ';
224
+
225
+
226
+
227
+
228
+
229
+
230
+ $single_extension_listing = '
231
+ <div class="extension_listing single_ex_listing">
232
+ <h3>Increase the Revenue, Leads and Conversation with these Handpicked extensions</h3>
233
+ <ul>
234
+ <li class="first"><a href="http://ampforwp.com/advanced-amp-ads/#utm_source=options-panel&utm_medium=gettingstarted-amp-ads&utm_campaign=AMP%20Plugin" target="_blank">
235
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/click.png" /></div>
236
+ <div class="extension_desc">
237
+ <h2>Advanced AMP ADS</h2>
238
+ <p>Add Advertisement directly in the content</p>
239
+ <div class="extension_btn">View Details</div>
240
+ </div>
241
+ </a></li>
242
+ <li class="second"><a href="http://ampforwp.com/opt-in-forms/#utm_source=options-panel&utm_medium=gettingstarted_opt-in-forms&utm_campaign=AMP%20Plugin" target="_blank">
243
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/email.png" /></div>
244
+ <div class="extension_desc">
245
+ <h2>Email Opt-in Forms</h2>
246
+ <p>Capture Leads with Email Subscription.</p>
247
+ <div class="extension_btn">View Details</div>
248
+ </div>
249
+ </a></li>
250
+ <li class="first"><a href="http://ampforwp.com/call-to-action/#utm_source=options-panel&utm_medium=gettingstarted_amp-cta&utm_campaign=AMP%20Plugin" target="_blank">
251
+ <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/mac-click.png" /></div>
252
+ <div class="extension_desc">
253
+ <h2>Call To Action (CTA)</h2>
254
+ <p>Higher Visibility & More Conversions</p>
255
+ <div class="extension_btn">View Details</div>
256
+ </div>
257
+ </a></li>
258
+ </ul>
259
+ </div>
260
+ ';
261
+
262
+ // All the possible arguments for Redux.
263
+ //$amp_redux_header = '<span id="name"><span style="color: #4dbefa;">U</span>ltimate <span style="color: #4dbefa;">W</span>idgets</span>';
264
+
265
+ $args = array(
266
+ // TYPICAL -> Change these values as you need/desire
267
+ 'opt_name' => 'redux_builder_amp', // This is where your data is stored in the database and also becomes your global variable name.
268
+ 'display_name' => __( 'AMPforWP Options','accelerated-mobile-pages' ), // Name that appears at the top of your panel
269
+ 'menu_type' => 'menu', //Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only)
270
+ 'allow_sub_menu' => true, // Show the sections below the admin menu item or not
271
+ 'menu_title' => __( 'AMP', 'accelerated-mobile-pages' ),
272
+ 'page_title' => __('Accelerated Mobile Pages Options','accelerated-mobile-pages'),
273
+ 'display_version' => AMPFORWP_VERSION,
274
+ 'update_notice' => false,
275
+ 'intro_text' => '<a href="http://ampforwp.com/tutorials/#utm_source=options-panel&utm_medium=tuts_link_btn&utm_campaign=AMP%20Plugin" target="_blank">'.__('View Documentation','accelerated-mobile-pages').'</a> | <a href="http://ampforwp.com/support/#utm_source=options-panel&utm_medium=contact_link_btn&utm_campaign=AMP%20Plugin" target="_blank">'.__('Contact','accelerated-mobile-pages').'</a> <a class="premium_features_btn" href="http://ampforwp.com/extensions/#utm_source=options-panel&utm_medium=view_premium_features_btn&utm_campaign=AMP%20Plugin">VIEW PREMIUM FEATURES</a> ',
276
+ 'global_variable' => '', // Set a different name for your global variable other than the opt_name
277
+ 'dev_mode' => false, // Show the time the page took to load, etc
278
+ 'customizer' => false, // Enable basic customizer support,
279
+ 'async_typography' => false, // Enable async for fonts,
280
+ 'disable_save_warn' => true,
281
+ 'open_expanded' => false,
282
+ // OPTIONAL -> Give you extra features
283
+ 'page_priority' => null, // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning.
284
+ 'page_parent' => 'themes.php', // For a full list of options, visit: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters
285
+ 'page_permissions' => 'manage_options', // Permissions needed to access the options panel.
286
+ 'last_tab' => '', // Force your panel to always open to a specific tab (by id)
287
+ 'page_icon' => 'icon-themes', // Icon displayed in the admin panel next to your menu_title
288
+ 'page_slug' => 'amp_options', // Page slug used to denote the panel
289
+ 'save_defaults' => true, // On load save the defaults to DB before user clicks save or not
290
+ 'default_show' => false, // If true, shows the default value next to each field that is not the default value.
291
+ 'default_mark' => '', // What to print by the field's title if the value shown is default. Suggested: *
292
+ 'admin_bar' => false,
293
+ 'admin_bar_icon' => 'dashicons-admin-generic',
294
+ // CAREFUL -> These options are for advanced use only
295
+ 'output' => false, // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output
296
+ 'output_tag' => false, // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head
297
+ //'domain' => 'redux-framework', // Translation domain key. Don't change this unless you want to retranslate all of Redux.
298
+ 'footer_credit' => false, // Disable the footer credit of Redux. Please leave if you can help it.
299
+ 'footer_text' => "",
300
+ 'show_import_export' => true,
301
+ 'system_info' => true,
302
+
303
+ );
304
+
305
+ $args['share_icons'][] = array(
306
+ 'url' => 'https://github.com/ahmedkaludi/Accelerated-Mobile-Pages',
307
+ 'title' => __('Visit us on GitHub','accelerated-mobile-pages'),
308
+ 'icon' => 'el el-github'
309
+ //'img' => '', // You can use icon OR img. IMG needs to be a full URL.
310
+ );
311
+
312
+
313
+ Redux::setArgs( "redux_builder_amp", $args );
314
+
315
+
316
+
317
+
318
+ $tabs = array(
319
+ array(
320
+ 'id' => 'redux-help-tab-1',
321
+ 'title' => __( 'Theme Information 1', 'accelerated-mobile-pages' ),
322
+ 'content' => __( '<p>This is the tab content, HTML is allowed.</p>', 'accelerated-mobile-pages' )
323
+ ),
324
+ array(
325
+ 'id' => 'redux-help-tab-2',
326
+ 'title' => __( 'Theme Information 2', 'accelerated-mobile-pages' ),
327
+ 'content' => __( '<p>This is the tab content, HTML is allowed.</p>', 'accelerated-mobile-pages' )
328
+ )
329
+ );
330
+ Redux::setHelpTab( $opt_name, $tabs );
331
+
332
+ // Set the help sidebar
333
+ $content = __( '<p>This is the sidebar content, HTML is allowed.</p>', 'admin_folder' );
334
+ Redux::setHelpSidebar( $opt_name, $content );
335
+
336
+
337
+ /*
338
+ * <--- END HELP TABS
339
+ */
340
+
341
+ /*
342
+ *
343
+ * ---> START SECTIONS
344
+ *
345
+ */
346
+
347
+ Redux::setSection( $opt_name, array(
348
+ 'title' => __( 'Basic Field', 'accelerated-mobile-pages' ),
349
+ 'id' => 'basic',
350
+ 'desc' => __( 'Basic field with no subsections.', 'accelerated-mobile-pages' ),
351
+ 'icon' => 'el el-home',
352
+ 'fields' => array(
353
+ array(
354
+ 'id' => 'opt-blank',
355
+ 'title' => __( 'Example Text', 'accelerated-mobile-pages' ),
356
+ 'desc' => __( 'Example description.', 'accelerated-mobile-pages' ),
357
+ 'subtitle' => __( 'Example subtitle.', 'accelerated-mobile-pages' ),
358
+ )
359
+ )
360
+ ) );
361
+
362
+ Redux::setSection( $opt_name, array(
363
+ 'title' => __( 'Settings', 'accelerated-mobile-pages' ),
364
+ 'id' => 'basic',
365
+ 'desc' => __( '<div class="amp-faq">Thank you for using Accelerated Mobile Pages plugin. '. ' ' .
366
+
367
+ sprintf( __( ' <h2 style="width: 150px;float: right;
368
+ padding: 8px 11px;background: #4CAF50;
369
+ font-size: 13px;margin: -24px 0 0 10px;
370
+ border-radius: 5px;line-height: 22px;"><a style="color: #fff;text-decoration: none;" href="https://wordpress.org/support/view/plugin-reviews/accelerated-mobile-pages?rate=5#postform">Like this plugin? <br /> Leave a 5 Star Rating</a></h2>We are actively working on updating the plugin. We have built user friendly options which allows you to make changes on your AMP version.', 'accelerated-mobile-pages' ), 'accelerated-mobile-pages' )
371
+ . '<div style="width:100%;margin:20px 0px 10px 0px" class="getstarted_wrapper">
372
+ <div class="getstarted_options">
373
+ <p><b>Getting Started</b></p>
374
+ <ul class="getstarted_ul">
375
+ <li><a href="https://ampforwp.com/tutorials/article-categories/installation-updating/" target="_blank">Installation & Setup</a></li>
376
+ <li><a href="https://ampforwp.com/tutorials/article-categories/settings-options/" target="_blank">Settings & Options</a></li>
377
+ <li><a href="https://ampforwp.com/tutorials/article-categories/setup-amp/" target="_blank">Setup AMP</a></li>
378
+ <li><a href="https://ampforwp.com/tutorials/article-categories/page-builder/" target="_blank">Page Builder</a></li>
379
+ </ul>
380
+ </div>
381
+ <div class="getstarted_options">
382
+ <p><b>Useful Links</b></p>
383
+ <ul class="getstarted_ul">
384
+ <li><a href="https://ampforwp.com/tutorials/article-categories/extension/" target="_blank">Extensions & Themes Docs</a></li>
385
+ <li><a href="https://ampforwp.com/tutorials/article-categories/extending/" target="_blank">Developers Docs</a></li>
386
+ <li><a href="https://ampforwp.com/amp-theme-framework/" target="_blank">Create a Custom Theme for AMP</a></li>
387
+ <li><a href="https://ampforwp.com/tutorials/article-categories/how-to/" target="_blank">General How To\'s</a></li>
388
+ </ul>
389
+ </div>
390
+ <div class="clear"></div>
391
+ </div>'
392
+ . '<p><strong>' . __( '1. <a href="https://ampforwp.com/priority-support/" target="_blank">Fixing AMP Validation Errors</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'We will personally take care that your website’s AMP version is perfectly validated. We will make sure that your AMP version gets approved and indexed by Google Webmaster Tools properly and we will even keep an eye on AMP updates from Google and implement them into your website.' ) . '</p>'
393
+ . '<p><strong>' . __( '2. <a href="https://ampforwp.com/help/#support-forum" target="_blank">Community Support Forum</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'We have a special community support forum where you can ask us questions and get help about your AMP related questions. Delivering a good user experience means alot to us and so we try our best to reply each and every question that gets asked.' ) . '</p>'
394
+ . '<p><strong>' . __( '3. <a href="https://ampforwp.com/help/#contact" target="_blank">Hire Us / Other queries</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'We try to answer each and every email, so remember to give us some time. For any other queries, please use the contact form. Please be descriptive as possible.' ) . '</p>'
395
+ . '<p><strong>' . __( '4. <a href="http://ampforwp.com/new/" target="_blank"> What\'s New in this Version?</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'If you want to know whats new in the latest version of the plugin, then please use this link. ') . '</p>'
396
+
397
+ . '</p></div>
398
+ <br /><p><h3>Take AMP to the Next Level with Premium Extensions</h3></p>
399
+ ' .$gettingstarted_extension_listing
400
+
401
+ , 'accelerated-mobile-pages' ),
402
+ 'icon' => 'el el-cogs'
403
+ ) );
404
+
405
+ function ampforwp_default_logo_settings($param=""){
406
+ $custom_logo_id = '';
407
+ $image = '';
408
+ $value = '';
409
+ $custom_logo_id = get_theme_mod( 'custom_logo' );
410
+ $image = wp_get_attachment_image_src( $custom_logo_id , 'full');
411
+ if( $image ){
412
+ return $image[0];
413
+ }
414
+ return $value;
415
+ }
416
+ Redux::setSection( $opt_name, array(
417
+ 'title' => __( 'General', 'accelerated-mobile-pages' ),
418
+ // 'desc' => __( 'For full documentation on this field, visit: ', 'accelerated-mobile-pages' ) . '<a href="http://docs.reduxframework.com/core/fields/text/" target="_blank">http://docs.reduxframework.com/core/fields/text/</a>',
419
+ 'id' => 'opt-text-subsection',
420
+ 'subsection' => true,
421
+ 'fields' => array(
422
+
423
+ array(
424
+ 'id' => 'opt-media',
425
+ 'type' => 'media',
426
+ 'url' => true,
427
+ 'title' => __('Logo', 'accelerated-mobile-pages'),
428
+ 'subtitle' => __('Upload a logo for the AMP version.', 'accelerated-mobile-pages'),
429
+ 'desc' => __('Recommend logo size is: 190x36', 'accelerated-mobile-pages'),
430
+ 'default' => array('url' => ampforwp_default_logo_settings() ),
431
+ ),
432
+ array(
433
+ 'id' => 'ampforwp-custom-logo-dimensions',
434
+ 'title' => __('Custom Logo Size', 'accelerated-mobile-pages'),
435
+ 'type' => 'switch',
436
+ 'default' => 0,
437
+ ),
438
+ array(
439
+ 'id' => 'opt-media-width',
440
+ 'type' => 'text',
441
+ 'title' => __('Logo Width', 'accelerated-mobile-pages'),
442
+ 'desc' => __('Default width is 190 pixels', 'accelerated-mobile-pages'),
443
+ 'default' => '190',
444
+ 'required'=>array('ampforwp-custom-logo-dimensions','=','1'),
445
+ ),
446
+ array(
447
+ 'id' => 'opt-media-height',
448
+ 'type' => 'text',
449
+ 'title' => __('Logo Height', 'accelerated-mobile-pages'),
450
+ 'desc' => __('Default height is 36 pixels', 'accelerated-mobile-pages'),
451
+ 'default' => '36',
452
+ 'required'=>array('ampforwp-custom-logo-dimensions','=','1'),
453
+
454
+ ),
455
+ array(
456
+ 'id' => 'amp-support',
457
+ 'type' => 'section',
458
+ 'title' => __('AMP Support', 'accelerated-mobile-pages'),
459
+ 'indent' => true,
460
+ ),
461
+ array(
462
+ 'id' =>'amp-on-off-for-all-posts',
463
+ 'type' => 'switch',
464
+ 'title' => __('Posts', 'accelerated-mobile-pages'),
465
+ 'subtitle' => __('Enable AMP Support on Posts', 'accelerated-mobile-pages'),
466
+ 'default' => 1,
467
+ // 'desc' => __( 'Re-Save permalink if you make changes in this option, please have a look <a href="https://ampforwp.com/flush-rewrite-urls/">here</a> on how to do it', 'accelerated-mobile-pages' ),
468
+ ),
469
+ array(
470
+ 'id' =>'amp-on-off-for-all-pages',
471
+ 'type' => 'switch',
472
+ 'title' => __('Pages', 'accelerated-mobile-pages'),
473
+ 'subtitle' => __('Enable AMP Support on Pages.', 'accelerated-mobile-pages'),
474
+ 'default' => 1,
475
+ // 'subtitle' => __( '<a href="https://ampforwp.com/flush-rewrite-urls/">Re-Save permalink</a> if you make changes in this option, please have a look here on how to do it', 'accelerated-mobile-pages' ),
476
+ ),
477
+ array(
478
+ 'id' => 'ampforwp-homepage-on-off-support',
479
+ 'type' => 'switch',
480
+ 'title' => __('Homepage', 'accelerated-mobile-pages'),
481
+ 'subtitle' => __('Enable AMP Support on Homepage.', 'accelerated-mobile-pages'),
482
+ 'default' => '1'
483
+ ),
484
+ array(
485
+ 'id' =>'amp-frontpage-select-option',
486
+ 'type' => 'switch',
487
+ 'title' => __('Custom Front Page', 'accelerated-mobile-pages'),
488
+ 'default' => 0,
489
+ 'subtitle' => __('Set Custom Front Page as Homepage', 'accelerated-mobile-pages'),
490
+ 'true' => 'true',
491
+ 'false' => 'false',
492
+ 'required' => array('ampforwp-homepage-on-off-support','=','1'),
493
+ // 'desc' => __( 'Re-Save permalink if front page or custom post page\'s pagination is not working. Please have a look <a href="https://ampforwp.com/flush-rewrite-urls/">here</a> on how to do it', 'accelerated-mobile-pages' ),
494
+ ),
495
+ array(
496
+ 'id' => 'amp-frontpage-select-option-pages',
497
+ 'type' => 'select',
498
+ 'title' => __('Select Page as Front Page', 'accelerated-mobile-pages'),
499
+ 'required' => array('amp-frontpage-select-option', '=' , '1'),
500
+ // Must provide key => value pairs for select options
501
+ 'data' => 'page',
502
+ 'args' => array(
503
+ 'post_type' => 'page',
504
+ 'posts_per_page' => 500
505
+ ),
506
+ 'default' => '2',
507
+ ),
508
+ array(
509
+ 'id' => 'ampforwp-title-on-front-page',
510
+ 'type' => 'switch',
511
+ 'url' => true,
512
+ 'title' => __('Title on Static Front Page', 'accelerated-mobile-pages'),
513
+ 'subtitle' => __('Enable/Disable display of title on the Static Front Page.', 'accelerated-mobile-pages'),
514
+ 'default' => 0,
515
+ 'required' => array('amp-frontpage-select-option', '=' , '1'),
516
+ ),
517
+