AMP for WP – Accelerated Mobile Pages - Version 0.9.85.5

Version Description

(21st April 2018) = * Added: Filter added to modify frontpage post id ampforwp_modify_frontpage_id * Added: Filter added to modify amp template directory ampforwp_template_locate #1982 * Other minor bugs fixed

Download this release

Release Info

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

Code changes from version 0.9.85.4 to 0.9.85.5

README.md CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 4.9.5
7
- Stable tag: 0.9.85.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -13,11 +13,11 @@ AMP for WP is the most recommended AMP plugin by the community. Automatically ad
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://ampforwp.com/demo/) | [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).
@@ -31,13 +31,15 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
31
 
32
  = Features: =
33
 
 
 
 
34
  * NEW - Alexa Metrics Compatibility added
35
  * NEW - OneSignal Push Notifications integration
36
- * NEW - Structured Data Options
37
- * NEW - Page Builder 2.0 for AMP! [Learn More & Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
38
  * NEW - Advanced WooCommerce Support [More Info](https://ampforwp.com/woocommerce/)
39
- * NEW - Gravity Forms Support [More Info](https://ampforwp.com/gravity-forms/)
40
  * AMP Plugins Manager - Which allows you to disable a specific plugin functionality only in the AMP version
 
41
  * Page Break / NextPage (Pagination) Support
42
  * Contact Form 7 Support [More Info](https://ampforwp.com/contact-form-7/)
43
  * Facebook Comments Support
@@ -56,7 +58,7 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
56
  * Custom Post Type Support
57
  * Star Ratings
58
  * Drag & Drop Page builder Added
59
- * 2 Designs Added
60
  * Yoast SEO support on AMP pages and other SEO plugins
61
  * AMP WooCommerce Support
62
  * Switch on/off Support for Pages & Posts on AMP
@@ -94,16 +96,18 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
94
  * Genesis SEO Support
95
  * Breadcrumb Support added
96
  * Facebook Instant Articles Support Added
97
- * NEW - AMP Installation Wizard that makes it easy to setup for new users.
98
- * NEW - Category base remover support
99
- * NEW - Tag base remover support
100
- * NEW - 7 New Social Media Integrations added (Reddit, Tumblr, Telegram, Digg, StumbleUpon, Wechat, Viber)
101
- * 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/)**
 
 
102
 
103
- **[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.
104
 
105
  = Getting Started: =
106
- **[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.
107
 
108
  **[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.
109
 
@@ -111,15 +115,15 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
111
 
112
  **[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.
113
 
114
- **[5. Frequently Asked Questions:](http://ampforwp.com/faq/)** Some of the Frequently Asked questions.
115
 
116
 
117
  == Installation ==
118
- **[Visit Help area for the Documentation:](http://ampforwp.com/help/)**
119
 
120
  [youtube https://www.youtube.com/watch?v=Em1nsE_KaKw]
121
 
122
- **[Visit Help area for the Documentation:](http://ampforwp.com/help/)**
123
 
124
 
125
  == Frequently Asked Questions ==
@@ -159,7 +163,7 @@ Yes, Absolutely! We would suggest you send your feature request by creating an i
159
 
160
  = How do I get in touch? =
161
 
162
- You can contact us from [here](http://ampforwp.com/contact/)
163
 
164
 
165
  == Screenshots ==
@@ -178,6 +182,11 @@ You can contact us from [here](http://ampforwp.com/contact/)
178
 
179
  == Changelog ==
180
 
 
 
 
 
 
181
  = 0.9.85.3 (12th April 2018) =
182
  * Added: Custom Post type Archive Page support #1995
183
  * Fixed: AMP TakeOver redirection issues #1994
@@ -421,6 +430,7 @@ You can contact us from [here](http://ampforwp.com/contact/)
421
  * Ability to remove the excerpt and image from related post #1510
422
  * Thumbnails on-the-fly generation added for better control over the design.
423
 
 
424
  = 0.9.74 (23rd January 2018) =
425
  * View More details on the [blog post](https://ampforwp.com/0-9-74-released-stability-update-79th-update/)
426
  * Fixed: Push Notifications button alligned in center #1500
@@ -1375,7 +1385,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1375
  * Typo in Trailingslashit function which resulted in some issues in the Homepage version [Bug Fix]
1376
 
1377
  = 0.9.1.2 [20th December 2016] =
1378
- * Proper Details at http://ampforwp.com/new/
1379
  * DoubleClick Support
1380
  * Custom Post Type Support
1381
  * Ratings Support
@@ -1394,7 +1404,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1394
  * Page Performance: DNS Prefetch tag added for faster DNS Handshake
1395
 
1396
  = 0.9.1 [16th December 2016] =
1397
- * Proper Details at http://ampforwp.com/new/
1398
  * PHP7 Compatibility
1399
  * Pagination URLs (Prev & Next) was going to 404 ( #244 | #251 )
1400
  * Custom CSS not working in Design one (#249)
@@ -1424,7 +1434,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1424
  * Compatibility improved with AMP WooCommerce.
1425
 
1426
  = 0.9 =
1427
- * Proper Details at http://ampforwp.com/amp-pagebuilder/
1428
  * Drag & Drop Page builder Added: You can easily modify the look of the AMP page using this feature
1429
  * 100% Yoast Compatible , Now no need to have additionally Glue Installed
1430
  * 100% completed Translation panel, Now absolutely anything on page is translated
@@ -1442,7 +1452,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1442
  * SEO Panel Added
1443
 
1444
  = 0.8.8 =
1445
- * Proper Details at http://ampforwp.com/amp-0-8-8-released-translation-panel/
1446
  * Translation Panel added. You can now easily translate the AMP version from the backend without any complications.
1447
  * Badge Tag was throwing Validation error
1448
  * Plusone tag validation error was fixed
@@ -1460,7 +1470,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1460
  * Featured Image Size options added
1461
 
1462
  = 0.8.7 =
1463
- * Proper Details at http://ampforwp.com/amp-0-8-7/
1464
  * added option to enable/disable AMP on Archive pages (Ticket #188)
1465
  * Solved 404 on Related Posts (Ticket #178 )
1466
  * Related posts by either categories or Tags(Ticket #179)
@@ -1481,7 +1491,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1481
  * Few validation issues after 0.8.6 were fixed (Frontpage amp-img strip issue fixed)
1482
 
1483
  = 0.8.6 =
1484
- * Proper Details at http://ampforwp.com/amp-0-8-6-released-related-posts-comments/
1485
  * Related Posts
1486
  * Post Comments
1487
  * WhatsApp sharing button – Your visitors can now easily share the content over the whatsapp.
@@ -1500,7 +1510,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1500
  * Canonical issue fixed for FrontPage
1501
 
1502
  = 0.8.5.1 =
1503
- * Proper Details at http://ampforwp.com/new/
1504
  * Validation issue fixed: 'Value' tag
1505
  * Validation issue fixed: The attribute 'contenteditable' may not appear in tag 'a'.
1506
  * Validation issue fixed: Table markup
@@ -1511,14 +1521,14 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1511
  * NextGEN Gallery Validation Support Added
1512
 
1513
  = 0.8.5 =
1514
- * Proper Details at http://ampforwp.com/the-0-4-compatibility/
1515
  * AMP 0.4 Compatibility Check
1516
  * Even better Structured Data Validation, Once in for all!
1517
  * Structured Data Options to eliminate Validation errors
1518
  * AMP Page Exclude option
1519
 
1520
  = 0.8.4 =
1521
- * Proper Details at http://ampforwp.com/blog/structured-data-validation/
1522
  * Structured Data Validation
1523
  * Navigation Text Change
1524
  * Inline Style Validation
@@ -1531,7 +1541,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1531
  * Extra space after quote in Ads
1532
 
1533
  = 0.8.2 =
1534
- * Proper Details at http://ampforwp.com/blog/the-custom-frontpage/
1535
  * Custom AMP FrontPage
1536
  * Featured Image
1537
  * New Mobile Friendly Advertisement sizes
@@ -1551,7 +1561,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1551
  * Gaping in the smaller screens fixed
1552
 
1553
  = 0.8 =
1554
- * Proper Details at http://ampforwp.com/blog/the-change/
1555
  * 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.
1556
  * 99.5% Validation issues were fixed.
1557
  * Page builder & Shortcodes Compatibility Support Added
@@ -1566,7 +1576,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1566
  * Better Future Compatibility
1567
 
1568
  = 0.7.7 =
1569
- * Proper Details at http://ampforwp.com/blog/amp-0-7-7/
1570
  * Big Validation Error fix Update
1571
  * Disable AMP support on specific Pages and Posts
1572
  * Option to disable the Post meta from the Single
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 4.9.5
7
+ Stable tag: 0.9.85.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
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?](https://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://ampforwp.com/demo/) | [Screenshots](https://wordpress.org/plugins/accelerated-mobile-pages/screenshots/) | [Community](https://ampforwp.com/community/)
17
 
18
  [youtube https://www.youtube.com/watch?v=Em1nsE_KaKw]
19
 
20
+ [youtube https://www.youtube.com/watch?v=QTbkn2rHyqM]
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).
31
 
32
  = Features: =
33
 
34
+ * NEW - Introducing Page Builder 3.0 for AMP! [Learn More & Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
35
+ * NEW Default Theme for AMP called Swift
36
+ * NEW - 3 Pre-built AMP Layouts for Business websites and landing pages
37
  * NEW - Alexa Metrics Compatibility added
38
  * NEW - OneSignal Push Notifications integration
 
 
39
  * NEW - Advanced WooCommerce Support [More Info](https://ampforwp.com/woocommerce/)
40
+ * Gravity Forms Support [More Info](https://ampforwp.com/gravity-forms/)
41
  * AMP Plugins Manager - Which allows you to disable a specific plugin functionality only in the AMP version
42
+ * Structured Data Options
43
  * Page Break / NextPage (Pagination) Support
44
  * Contact Form 7 Support [More Info](https://ampforwp.com/contact-form-7/)
45
  * Facebook Comments Support
58
  * Custom Post Type Support
59
  * Star Ratings
60
  * Drag & Drop Page builder Added
61
+ * 4 Designs for AMP
62
  * Yoast SEO support on AMP pages and other SEO plugins
63
  * AMP WooCommerce Support
64
  * Switch on/off Support for Pages & Posts on AMP
96
  * Genesis SEO Support
97
  * Breadcrumb Support added
98
  * Facebook Instant Articles Support Added
99
+ * AMP Installation Wizard that makes it easy to setup for new users.
100
+ * Category base remover support
101
+ * Tag base remover support
102
+ * 7 New Social Media Integrations added (Reddit, Tumblr, Telegram, Digg, StumbleUpon, Wechat, Viber)
103
+ * 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/)**
104
+ * NEW - Make AMP & Non-AMP Same with just one click!
105
+ * NEW - Allows you to use AMP as primary website!
106
 
107
+ **[JOIN CHAT GROUP COMMUNITY](https://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.
108
 
109
  = Getting Started: =
110
+ **[1. User Documentation:](https://ampforwp.com/help/)** The AMP for WordPress plugin is easy to setup but we have some tutorials and guides prepared for you which will help you dive deep with the plugin.
111
 
112
  **[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.
113
 
115
 
116
  **[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.
117
 
118
+ **[5. Frequently Asked Questions:](https://ampforwp.com/faq/)** Some of the Frequently Asked questions.
119
 
120
 
121
  == Installation ==
122
+ **[Visit Help area for the Documentation:](https://ampforwp.com/help/)**
123
 
124
  [youtube https://www.youtube.com/watch?v=Em1nsE_KaKw]
125
 
126
+ **[Visit Help area for the Documentation:](https://ampforwp.com/help/)**
127
 
128
 
129
  == Frequently Asked Questions ==
163
 
164
  = How do I get in touch? =
165
 
166
+ You can contact us from [here](https://ampforwp.com/contact/)
167
 
168
 
169
  == Screenshots ==
182
 
183
  == Changelog ==
184
 
185
+ = 0.9.85.5 (21st April 2018) =
186
+ * Added: Filter added to modify frontpage post id `ampforwp_modify_frontpage_id`
187
+ * Added: Filter added to modify amp template directory `ampforwp_template_locate` #1982
188
+ * Other minor bugs fixed
189
+
190
  = 0.9.85.3 (12th April 2018) =
191
  * Added: Custom Post type Archive Page support #1995
192
  * Fixed: AMP TakeOver redirection issues #1994
430
  * Ability to remove the excerpt and image from related post #1510
431
  * Thumbnails on-the-fly generation added for better control over the design.
432
 
433
+
434
  = 0.9.74 (23rd January 2018) =
435
  * View More details on the [blog post](https://ampforwp.com/0-9-74-released-stability-update-79th-update/)
436
  * Fixed: Push Notifications button alligned in center #1500
1385
  * Typo in Trailingslashit function which resulted in some issues in the Homepage version [Bug Fix]
1386
 
1387
  = 0.9.1.2 [20th December 2016] =
1388
+ * Proper Details at https://ampforwp.com/new/
1389
  * DoubleClick Support
1390
  * Custom Post Type Support
1391
  * Ratings Support
1404
  * Page Performance: DNS Prefetch tag added for faster DNS Handshake
1405
 
1406
  = 0.9.1 [16th December 2016] =
1407
+ * Proper Details at https://ampforwp.com/new/
1408
  * PHP7 Compatibility
1409
  * Pagination URLs (Prev & Next) was going to 404 ( #244 | #251 )
1410
  * Custom CSS not working in Design one (#249)
1434
  * Compatibility improved with AMP WooCommerce.
1435
 
1436
  = 0.9 =
1437
+ * Proper Details at https://ampforwp.com/amp-pagebuilder/
1438
  * Drag & Drop Page builder Added: You can easily modify the look of the AMP page using this feature
1439
  * 100% Yoast Compatible , Now no need to have additionally Glue Installed
1440
  * 100% completed Translation panel, Now absolutely anything on page is translated
1452
  * SEO Panel Added
1453
 
1454
  = 0.8.8 =
1455
+ * Proper Details at https://ampforwp.com/amp-0-8-8-released-translation-panel/
1456
  * Translation Panel added. You can now easily translate the AMP version from the backend without any complications.
1457
  * Badge Tag was throwing Validation error
1458
  * Plusone tag validation error was fixed
1470
  * Featured Image Size options added
1471
 
1472
  = 0.8.7 =
1473
+ * Proper Details at https://ampforwp.com/amp-0-8-7/
1474
  * added option to enable/disable AMP on Archive pages (Ticket #188)
1475
  * Solved 404 on Related Posts (Ticket #178 )
1476
  * Related posts by either categories or Tags(Ticket #179)
1491
  * Few validation issues after 0.8.6 were fixed (Frontpage amp-img strip issue fixed)
1492
 
1493
  = 0.8.6 =
1494
+ * Proper Details at https://ampforwp.com/amp-0-8-6-released-related-posts-comments/
1495
  * Related Posts
1496
  * Post Comments
1497
  * WhatsApp sharing button – Your visitors can now easily share the content over the whatsapp.
1510
  * Canonical issue fixed for FrontPage
1511
 
1512
  = 0.8.5.1 =
1513
+ * Proper Details at https://ampforwp.com/new/
1514
  * Validation issue fixed: 'Value' tag
1515
  * Validation issue fixed: The attribute 'contenteditable' may not appear in tag 'a'.
1516
  * Validation issue fixed: Table markup
1521
  * NextGEN Gallery Validation Support Added
1522
 
1523
  = 0.8.5 =
1524
+ * Proper Details at https://ampforwp.com/the-0-4-compatibility/
1525
  * AMP 0.4 Compatibility Check
1526
  * Even better Structured Data Validation, Once in for all!
1527
  * Structured Data Options to eliminate Validation errors
1528
  * AMP Page Exclude option
1529
 
1530
  = 0.8.4 =
1531
+ * Proper Details at https://ampforwp.com/blog/structured-data-validation/
1532
  * Structured Data Validation
1533
  * Navigation Text Change
1534
  * Inline Style Validation
1541
  * Extra space after quote in Ads
1542
 
1543
  = 0.8.2 =
1544
+ * Proper Details at https://ampforwp.com/blog/the-custom-frontpage/
1545
  * Custom AMP FrontPage
1546
  * Featured Image
1547
  * New Mobile Friendly Advertisement sizes
1561
  * Gaping in the smaller screens fixed
1562
 
1563
  = 0.8 =
1564
+ * Proper Details at https://ampforwp.com/blog/the-change/
1565
  * 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.
1566
  * 99.5% Validation issues were fixed.
1567
  * Page builder & Shortcodes Compatibility Support Added
1576
  * Better Future Compatibility
1577
 
1578
  = 0.7.7 =
1579
+ * Proper Details at https://ampforwp.com/blog/amp-0-7-7/
1580
  * Big Validation Error fix Update
1581
  * Disable AMP support on specific Pages and Posts
1582
  * Option to disable the Post meta from the Single
accelerated-moblie-pages.php CHANGED
@@ -3,7 +3,7 @@
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.85.4
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
@@ -19,7 +19,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
19
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
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.85.4');
23
 
24
  // any changes to AMP_QUERY_VAR should be refelected here
25
  function ampforwp_generate_endpoint(){
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.85.5
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
19
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
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.85.5');
23
 
24
  // any changes to AMP_QUERY_VAR should be refelected here
25
  function ampforwp_generate_endpoint(){
components/components-core.php CHANGED
@@ -94,9 +94,9 @@ function amp_logo(){
94
  function amp_title(){
95
  global $redux_builder_amp, $post;
96
  $ID = '';
97
- if(is_home() && $redux_builder_amp['amp-frontpage-select-option'] == 1){
98
  if( $redux_builder_amp['ampforwp-title-on-front-page'] ) {
99
- $ID = $redux_builder_amp['amp-frontpage-select-option-pages'];
100
  }
101
  }
102
  elseif ( ampforwp_polylang_front_page() ) {
@@ -121,7 +121,7 @@ function amp_excerpt( $no_of_words=15 ) {
121
  global $redux_builder_amp, $post;
122
  $post_id = '';
123
  if ( ampforwp_is_front_page() ) {
124
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
125
  }
126
  else
127
  $post_id = $post->ID;
@@ -398,7 +398,7 @@ if ( empty( $post_id )) {
398
 
399
  $post_id = get_queried_object_id();
400
  if ( ampforwp_is_front_page() ) {
401
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
402
  }
403
  elseif ( ampforwp_polylang_front_page() ) {
404
  $post_id = pll_get_post(get_option('page_on_front'));
94
  function amp_title(){
95
  global $redux_builder_amp, $post;
96
  $ID = '';
97
+ if(is_home() && ampforwp_get_frontpage_id() ){
98
  if( $redux_builder_amp['ampforwp-title-on-front-page'] ) {
99
+ $ID = ampforwp_get_frontpage_id();
100
  }
101
  }
102
  elseif ( ampforwp_polylang_front_page() ) {
121
  global $redux_builder_amp, $post;
122
  $post_id = '';
123
  if ( ampforwp_is_front_page() ) {
124
+ $post_id = ampforwp_get_frontpage_id();
125
  }
126
  else
127
  $post_id = $post->ID;
398
 
399
  $post_id = get_queried_object_id();
400
  if ( ampforwp_is_front_page() ) {
401
+ $post_id = ampforwp_get_frontpage_id();
402
  }
403
  elseif ( ampforwp_polylang_front_page() ) {
404
  $post_id = pll_get_post(get_option('page_on_front'));
components/featured-image/featured-image.php CHANGED
@@ -7,7 +7,7 @@ function ampforwp_framework_get_featured_image(){
7
  $amp_html = "";
8
  $caption = "";
9
  if( ampforwp_is_front_page() ){
10
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
11
  }
12
  if( true == ampforwp_has_post_thumbnail() ) {
13
  if (has_post_thumbnail( $post_id ) ){
7
  $amp_html = "";
8
  $caption = "";
9
  if( ampforwp_is_front_page() ){
10
+ $post_id = ampforwp_get_frontpage_id();
11
  }
12
  if( true == ampforwp_has_post_thumbnail() ) {
13
  if (has_post_thumbnail( $post_id ) ){
includes/admin-script.js CHANGED
@@ -46,7 +46,6 @@ jQuery(function($) {
46
  $('.redux-tab-container').each(function(){
47
  $(this).find('.redux-tab-selector:first').click();
48
  });
49
- hideReduxFields();
50
  return false;
51
  }
52
  var item = $(this);
@@ -75,11 +74,91 @@ jQuery(function($) {
75
  captureLength:0
76
  });
77
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  $(document).ready(function() {
 
 
 
 
 
 
 
79
 
80
- /*---------Google Fonts ------------*/
81
- // Google Font details
82
 
 
 
83
 
84
 
85
  var gURL, gAPIkey;
@@ -293,10 +372,48 @@ var reduxOptionTab = function(){
293
  }
294
  //reduxOptionTab();
295
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
296
  $(".redux-ampforwp-ext-deactivate").click(function(){
297
  var currentThis = $(this);
298
  var plugin_id = currentThis.attr("id");
299
- currentThis.val("Please Wait...");
300
  $deactivateConfirm = confirm("Are you sure you want to Deactivate ?");
301
  if($deactivateConfirm){
302
  $.ajax({
@@ -305,8 +422,10 @@ $(".redux-ampforwp-ext-deactivate").click(function(){
305
  data: {action: 'ampforwp_deactivate_license', ampforwp_license_deactivate:plugin_id},
306
  dataType: 'json',
307
  success: function(response){
 
308
  if(response.status=='200'){
309
  currentThis.parents(".extension_desc").find("input[name='redux_builder_amp[amp-license][amp-ads-google-adsense][license]']").val("");
 
310
  window.location.href = window.location.href;
311
  }else{
312
  alert(response.message);
@@ -315,11 +434,8 @@ $(".redux-ampforwp-ext-deactivate").click(function(){
315
  })
316
  }
317
  });
318
-
319
- /*var hideReduxFields = function(){
320
- $("#redux_builder_amp-single-design-type").parents("tr").hide();
321
  }
322
- hideReduxFields();*/
323
 
324
 
325
  var helpSection = function(){
@@ -378,11 +494,10 @@ var redux_title_modify = function(){
378
  }
379
 
380
  });
381
- }
382
- if($( '.redux-group-tab-link-a' ).length){
383
- redux_title_modify();
384
- }
385
-
386
 
387
  });
388
 
 
 
 
46
  $('.redux-tab-container').each(function(){
47
  $(this).find('.redux-tab-selector:first').click();
48
  });
 
49
  return false;
50
  }
51
  var item = $(this);
74
  captureLength:0
75
  });
76
  }
77
+
78
+ //option panel Section Division
79
+ var optionSectionDevision = function(){
80
+ $('.afw-accordion-header').click(function(){
81
+ //Get Cookie Changes
82
+ if ( $.cookie( "redux_current_section_customize" )){
83
+ var allReduxTabs = JSON.parse($.cookie( "redux_current_section_customize" ));
84
+ }else{
85
+ var allReduxTabs = {};
86
+ }
87
+
88
+ var section = $(this).attr("id");
89
+ section = section.replace("section-","section-table-");
90
+
91
+ if($("#"+section).is(':visible')){
92
+ $("#"+section).hide();
93
+ $(this).removeClass("afw-accordion-tab-open").addClass("afw-accordion-tab-close");
94
+ allReduxTabs[section] = 'hide';
95
+ }else{
96
+ $("#"+section).show();
97
+ $(this).removeClass("afw-accordion-tab-close").addClass("afw-accordion-tab-open");
98
+ allReduxTabs[section] = 'show';
99
+ }
100
+
101
+ //Set Cookie Changes
102
+ $.cookie(
103
+ 'redux_current_section_customize', JSON.stringify(allReduxTabs), {
104
+ expires: 7,
105
+ path: '/'
106
+ }
107
+ );
108
+ });
109
+ //While loading at first time
110
+ if($('.afw-accordion-header').length>0){
111
+ //console.log($.cookie( "redux_current_section_customize" ));
112
+ if ( $.cookie( "redux_current_section_customize" ) ){
113
+ var tabsValue = JSON.parse($.cookie( "redux_current_section_customize" ));
114
+ }else{
115
+ var tabsValue = "";
116
+ }
117
+ $('.afw-accordion-header').each(function(){
118
+
119
+ var reduxAccordianHeader = $(this);
120
+ var section = reduxAccordianHeader.attr("id");
121
+ section = section.replace("section-","section-table-");
122
+
123
+ if(tabsValue[section]){
124
+ var currentSettings = tabsValue[section];
125
+ if(currentSettings=='hide'){
126
+ reduxAccordianHeader.removeClass("afw-accordion-tab-open").addClass("afw-accordion-tab-close");
127
+ }else if(currentSettings=='show'){
128
+ reduxAccordianHeader.removeClass("afw-accordion-tab-close").addClass("afw-accordion-tab-open");
129
+ }
130
+ }
131
+
132
+ if(reduxAccordianHeader.hasClass('afw-accordion-tab-close')){
133
+ $("#"+section).hide();
134
+ }else if(reduxAccordianHeader.hasClass('afw-accordion-tab-open')){
135
+ $("#"+section).show();
136
+ }
137
+
138
+ })
139
+ }
140
+ }//Cloesed function = optionSectionDevision
141
+
142
+
143
+ var showExtensionTabs = function(){
144
+ var currentTab = getQueryStringValue('tabid');
145
+ if(currentTab!="" && $("li."+currentTab).length>0){
146
+ $("li."+currentTab+" a").click();
147
+ }
148
+ }
149
  $(document).ready(function() {
150
+ if(getQueryStringValue('page')=='amp_options'){
151
+ //Tab section implementation
152
+ optionSectionDevision();
153
+ //To Show title on the top; In front of search bar
154
+ if($( '.redux-group-tab-link-a' ).length){
155
+ redux_title_modify();
156
+ }
157
 
158
+
 
159
 
160
+ showExtensionTabs();
161
+ }
162
 
163
 
164
  var gURL, gAPIkey;
372
  }
373
  //reduxOptionTab();
374
 
375
+ $(".redux-ampforwp-ext-activate").click(function(){
376
+ var currentThis = $(this);
377
+ var plugin_id = currentThis.attr("id");
378
+ var license = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][license]"]').val();
379
+ var item_name = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][item_name]"]').val();
380
+ var store_url = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][store_url]"]').val();
381
+ var plugin_active_path = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][plugin_active_path]"]').val();
382
+ currentThis.html("Please Wait...");
383
+ $.ajax({
384
+ url: ajaxurl,
385
+ method: 'post',
386
+ data: {action: 'ampforwp_get_licence_activate_update',
387
+ ampforwp_license_activate:plugin_id,
388
+ license:license,
389
+ item_name:item_name,
390
+ store_url:store_url,
391
+ plugin_active_path:plugin_active_path
392
+ },
393
+ dataType: 'json',
394
+ success: function(response){
395
+ currentThis.parents("li").find('.afw-license-response-message').remove();
396
+ if(response.status=='200'){
397
+ currentThis.parents("li").removeClass("not-active").removeClass("invalid").addClass("active").addClass("valid");
398
+ currentThis.html("Deactivate");
399
+ currentThis.after("<div class='afw-license-response-message'>"+response.message+'</div>');
400
+ currentThis.removeClass('redux-ampforwp-ext-activate').addClass('redux-ampforwp-ext-deactivate');
401
+ deactivatelicence();
402
+ //window.location.href = window.location.href;
403
+ }else{
404
+ currentThis.after("<div class='afw-license-response-message'>"+response.message+'</div>');
405
+ currentThis.html("Activate");
406
+ }
407
+ }
408
+ })
409
+ })
410
+
411
+ //Deactivate License key
412
+ function deactivatelicence(){
413
  $(".redux-ampforwp-ext-deactivate").click(function(){
414
  var currentThis = $(this);
415
  var plugin_id = currentThis.attr("id");
416
+ currentThis.html("Please Wait...");
417
  $deactivateConfirm = confirm("Are you sure you want to Deactivate ?");
418
  if($deactivateConfirm){
419
  $.ajax({
422
  data: {action: 'ampforwp_deactivate_license', ampforwp_license_deactivate:plugin_id},
423
  dataType: 'json',
424
  success: function(response){
425
+ currentThis.parents("li").find('.afw-license-response-message').remove();
426
  if(response.status=='200'){
427
  currentThis.parents(".extension_desc").find("input[name='redux_builder_amp[amp-license][amp-ads-google-adsense][license]']").val("");
428
+ currentThis.after("<div class='afw-license-response-message'>"+response.message+'</div>');
429
  window.location.href = window.location.href;
430
  }else{
431
  alert(response.message);
434
  })
435
  }
436
  });
 
 
 
437
  }
438
+ deactivatelicence();
439
 
440
 
441
  var helpSection = function(){
494
  }
495
 
496
  });
497
+ }
 
 
 
 
498
 
499
  });
500
 
501
+ function getQueryStringValue (key) {
502
+ return decodeURIComponent(window.location.search.replace(new RegExp("^(?:.*[&\\?]" + encodeURIComponent(key).replace(/[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"), "$1"));
503
+ }
includes/options/admin-config.php CHANGED
@@ -46,10 +46,10 @@ $extension_listing_array = array(
46
  'img_src'=>AMPFORWP_IMAGE_DIR . '/click.png',
47
  'price'=>'$29',
48
  'url_link'=>'http://ampforwp.com/advanced-amp-ads/#utm_source=options-panel&utm_medium=extension-tab_advanced-amp-ads&utm_campaign=AMP%20Plugin',
49
- 'plugin_active_path'=> 'amp-incontent-ads/amptoolkit-incontent-ads.php',
50
  'item_name'=>'Advanced AMP Ads',
51
  'store_url'=>'https://accounts.ampforwp.com',
52
- 'is_activated'=>(is_plugin_active('amp-incontent-ads/amptoolkit-incontent-ads.php')? 1:2),
53
  ),
54
  array(
55
  'name'=>'Contact Form 7',
@@ -61,6 +61,7 @@ $extension_listing_array = array(
61
  'item_name'=>'Contact Form 7 for AMP',
62
  'store_url'=>'https://accounts.ampforwp.com',
63
  'is_activated'=>(is_plugin_active('amp-cf7/amp-cf7.php')? 1 : 2),
 
64
  ),
65
  array(
66
  'name'=>'Gravity Forms',
@@ -72,6 +73,7 @@ $extension_listing_array = array(
72
  'item_name'=>'Gravity Forms',
73
  'store_url'=>'https://accounts.ampforwp.com',
74
  'is_activated'=>(is_plugin_active('amp-gravity-forms/amp-gravity-forms.php')? 1 : 2),
 
75
  ),
76
  array(
77
  'name'=>'Email Opt-in Forms',
@@ -83,6 +85,7 @@ $extension_listing_array = array(
83
  'item_name'=>'Opt-in-Forms for AMP',
84
  'store_url'=>'https://accounts.ampforwp.com',
85
  'is_activated'=>(is_plugin_active('amp-optin/amp-optin.php')? 1 : 2),
 
86
  ),
87
  array(
88
  'name'=>'AMP Cache',
@@ -94,6 +97,7 @@ $extension_listing_array = array(
94
  'item_name'=>'AMP Cache',
95
  'store_url'=>'https://accounts.ampforwp.com',
96
  'is_activated'=>(is_plugin_active('amp-cache/ampforwp-cache.php')? 1 : 2),
 
97
  ),
98
  array(
99
  'name'=>'Call To Action (CTA)',
@@ -101,10 +105,10 @@ $extension_listing_array = array(
101
  'img_src'=>AMPFORWP_IMAGE_DIR . '/mac-click.png',
102
  'price'=>'$29',
103
  'url_link'=>'http://ampforwp.com/call-to-action/#utm_source=options-panel&utm_medium=extension-tab_amp-cta&utm_campaign=AMP%20Plugin',
104
- 'plugin_active_path'=> 'AMP-cta/amp-cta.php',
105
  'item_name'=>'Call To Action for AMP',
106
  'store_url'=>'https://accounts.ampforwp.com',
107
- 'is_activated'=>(is_plugin_active('AMP-cta/amp-cta.php')? 1 : 2),
108
  ),
109
  array(
110
  'name'=>'AMP WooCommerce Pro',
@@ -116,30 +120,44 @@ $extension_listing_array = array(
116
  'item_name'=>'WooCommerce',
117
  'store_url'=>'https://accounts.ampforwp.com',
118
  'is_activated'=>(is_plugin_active('amp-woocommerce-pro/amp-woocommerce.php')? 1 : 2),
 
119
  ),
120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  array(
122
  'name'=>'Newspaper AMP Theme',
123
  'desc'=>'Advanced News Magazine theme built for AMP.',
124
  'img_src'=>AMPFORWP_IMAGE_DIR . '/click.png',
125
  'price'=>'$49',
126
  'url_link'=>'https://ampforwp.com/themes/newspaper/',
127
- 'plugin_active_path'=> 'AMP-Theme/ampforwp-custom-theme.php',
128
  'item_name'=>'Newspaper Theme for AMP',
129
  'store_url'=>'https://accounts.ampforwp.com',
130
- 'is_activated'=>(is_plugin_active('AMP-Theme/ampforwp-custom-theme.php')? 1 : 2),
131
  ),
132
 
133
  array(
134
- 'name'=>'Advanced Custom Fields',
135
  'desc'=>'Easily add ACF support in AMP.',
136
  'img_src'=>AMPFORWP_IMAGE_DIR . '/acf.png',
137
  'price'=>'$29',
138
  'url_link'=>'http://ampforwp.com/acf-amp/#utm_source=options-panel&utm_medium=extension-tab_opt-in-forms&utm_campaign=AMP%20Plugin',
139
- 'plugin_active_path'=> 'advanced-custom-fields/acf.php',
140
  'item_name'=>'ACF for AMP',
141
  'store_url'=>'https://accounts.ampforwp.com',
142
- 'is_activated'=>(is_plugin_active('advanced-custom-fields/acf.php')? 1 : 2),
143
  ),
144
  array(
145
  'name'=>'AMP Comments',
@@ -173,6 +191,7 @@ $extension_listing_array = array(
173
  'item_name'=>'Custom Post Type Support for AMP',
174
  'store_url'=>'https://accounts.ampforwp.com',
175
  'is_activated'=>(is_plugin_active('amp-custom-post-type/amp-custom-post-type.php')? 1 : 2),
 
176
  ),
177
  array(
178
  'name'=>'Structured Data for WP',
@@ -184,6 +203,7 @@ $extension_listing_array = array(
184
  'item_name'=>'Structured Data for WP',
185
  'store_url'=>'https://accounts.ampforwp.com',
186
  'is_activated'=>(is_plugin_active('structured-data-for-wp/structured-data-for-wp.php')? 1: 2),
 
187
  ),
188
  array(
189
  'name'=>'Polylang For AMP',
@@ -196,6 +216,17 @@ $extension_listing_array = array(
196
  'store_url'=>'https://accounts.ampforwp.com',
197
  'is_activated'=>(is_plugin_active('polylang-for-amp/amp_polylang.php')? 1: 2),
198
  ),
 
 
 
 
 
 
 
 
 
 
 
199
  array(
200
  'name'=>'AMP Teaser',
201
  'desc'=>'AMP Teaser automatically clips the content based on your selection',
@@ -206,6 +237,7 @@ $extension_listing_array = array(
206
  'item_name'=>'AMP Teaser',
207
  'store_url'=>'https://accounts.ampforwp.com',
208
  'is_activated'=>(is_plugin_active('amp-teaser/amp-teaser.php')? 1: 2),
 
209
  ),
210
  array(
211
  'name'=>'View All Extensions',
@@ -217,8 +249,10 @@ $extension_listing_array = array(
217
  'item_name'=>'',
218
  'store_url'=>'',
219
  'is_activated'=>2,
 
220
  ),
221
  );
 
222
  $extension_listing_array = apply_filters( 'ampforwp_extension_lists_filter', $extension_listing_array );
223
  $ampforwp_extension_list_html = '';
224
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
@@ -248,7 +282,7 @@ foreach ($extension_listing_array as $key => $extension) {
248
  if(isset($selectedOption['amp-license'][$pathExploded])){
249
  $amplicense = $selectedOption['amp-license'][$pathExploded]['license'];
250
  }
251
- $verify = '<button type="submit" id="'.$pathExploded.'">Activate</button>';
252
  if(isset($selectedOption['amp-license'][$pathExploded]['status']) && $selectedOption['amp-license'][$pathExploded]['status']==='valid'){
253
  $currentStatus = 'active valid';
254
  $verify = '<button type="button" id="'.$pathExploded.'" class="redux-ampforwp-ext-deactivate">Deactivate</button>';
@@ -266,7 +300,7 @@ foreach ($extension_listing_array as $key => $extension) {
266
 
267
  $pluginReview .= $verify;
268
  if(isset($selectedOption['amp-license'][$pathExploded]['message']) && $selectedOption['amp-license'][$pathExploded]['message']!=""){
269
- $pluginReview .= "<br/>".$selectedOption['amp-license'][$pathExploded]['message'];
270
  }
271
 
272
  }
@@ -428,7 +462,7 @@ $upcomingLayoutsDesign = '';
428
  $layouts = ampforwp_upcomming_layouts_demo();
429
  if(is_array($layouts)){
430
  foreach($layouts as $k=>$val){
431
- $upcomingLayoutsDesign .= '<div class="amp_layout_upcomming">
432
  <div class="amppb_ad-layout-layout">
433
  <div class="amppb_ad-layout-wrapper">
434
  <div class="amppb_ad-layout_pro"><a href="https://ampforwp.com/amp-layouts/" target="_blank">PRO</a></div>
@@ -447,9 +481,9 @@ if(is_array($layouts)){
447
  //$amp_redux_header = '<span id="name"><span style="color: #4dbefa;">U</span>ltimate <span style="color: #4dbefa;">W</span>idgets</span>';
448
  $proDetailsProvide = '<a class="premium_features_btn_txt" href="https://ampforwp.com/membership/#utm_source=options-panel&utm_medium=view_pro_features_btn&utm_campaign=AMP%20Plugin" target="_blank">'.__('Get more out of AMP','accelerated-mobile-pages').'</a> <a class="premium_features_btn" href="https://ampforwp.com/membership/#utm_source=options-panel&utm_medium=view_pro_features_btn&utm_campaign=AMP%20Plugin" target="_blank">Get PRO Version</a> ';
449
  if($ampforwp_nameOfUser!=""){
450
- $proDetailsProvide = "<span class='extension-menu-call'><span class='activated-plugins' style='color:#f2f2f2'>Hello, ".$ampforwp_nameOfUser."</span> <a class='' href='".admin_url('admin.php?page=amp_options&tab=29')."'><i class='dashicons-before dashicons-admin-generic'></i></a></span>";
451
  }elseif($ampforwp_is_productActivated){
452
- $proDetailsProvide = "<span class='extension-menu-call'>One more Step <a class='premium_features_btn' href='".admin_url('admin.php?page=amp_options&tab=29')."'>Enter license here</a></span>";
453
  }
454
  $args = array(
455
  // TYPICAL -> Change these values as you need/desire
@@ -557,37 +591,37 @@ Redux::setArgs( "redux_builder_amp", $args );
557
  padding: 8px 11px;background: #4CAF50;
558
  font-size: 13px;margin: -24px 0 0 10px;
559
  border-radius: 5px;line-height: 22px;position:relative;top:30px"><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' )
560
- . '<div style="width:100%;margin:20px 0px 10px 0px" class="getstarted_wrapper">
561
  <div class="getstarted_options">
562
  <p><b>Getting Started</b></p>
563
- <ul class="getstarted_ul">
564
- <li><a href="https://ampforwp.com/tutorials/article-categories/installation-updating/" target="_blank">Installation & Setup</a></li>
565
- <li><a href="https://ampforwp.com/tutorials/article-categories/settings-options/" target="_blank">Settings & Options</a></li>
566
- <li><a href="https://ampforwp.com/tutorials/article-categories/setup-amp/" target="_blank">Setup AMP</a></li>
567
- <li><a href="https://ampforwp.com/tutorials/article-categories/page-builder/" target="_blank">Page Builder</a></li>
568
- </ul>
569
  </div>
570
  <div class="getstarted_options">
571
  <p><b>Useful Links</b></p>
572
- <ul class="getstarted_ul">
573
- <li><a href="https://ampforwp.com/tutorials/article-categories/extension/" target="_blank">Extensions & Themes Docs</a></li>
574
- <li><a href="https://ampforwp.com/tutorials/article-categories/extending/" target="_blank">Developers Docs</a></li>
575
- <li><a href="https://ampforwp.com/amp-theme-framework/" target="_blank">Create a Custom Theme for AMP</a></li>
576
- <li><a href="https://ampforwp.com/tutorials/article-categories/how-to/" target="_blank">General How To\'s</a></li>
577
- </ul>
578
  </div>
579
  <div class="clear"></div>
580
  </div>'
581
  . '<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>'
582
- . '<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>'
583
- . '<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>'
584
- . '<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>'
585
 
586
- . '</p></div>
587
  <br /><p><h3>Take AMP to the Next Level with Premium Extensions</h3></p>
588
  ' .$gettingstarted_extension_listing
589
 
590
- , 'accelerated-mobile-pages' ),
591
  'icon' => 'el el-cogs'
592
  ) );
593
 
@@ -705,7 +739,7 @@ Redux::setArgs( "redux_builder_amp", $args );
705
  'default' => 1,
706
  // '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' ),
707
  ),
708
- array(
709
  'id' =>'amp-on-off-for-all-pages',
710
  'type' => 'switch',
711
  'title' => __('Pages', 'accelerated-mobile-pages'),
@@ -2408,8 +2442,8 @@ Redux::setSection( $opt_name, array(
2408
  'default' => 0,
2409
  //'required' => array('ampforwp-amp-menu', '=' , '1')
2410
  ),
2411
- //Category Base Removal in AMP
2412
- array(
2413
  'id' => 'ampforwp-category-base-removel-link',
2414
  'type' => 'switch',
2415
  'title' => __('Category base remove in AMP', 'accelerated-mobile-pages'),
@@ -2419,8 +2453,8 @@ Redux::setSection( $opt_name, array(
2419
  'default' => 0,
2420
 
2421
  ),
2422
- //Tag base Removal in AMP
2423
- array(
2424
  'id' => 'ampforwp-tag-base-removal-link',
2425
  'type' => 'switch',
2426
  'title' => __('Tag base remove in AMP', 'accelerated-mobile-pages'),
@@ -2860,30 +2894,30 @@ Redux::setSection( $opt_name, array(
2860
  }
2861
  add_filter("extra_plugin_headers","amp_extra_plugin_theme_header");
2862
  $themeDesign = array(
2863
- array(
2864
  'demo_link' => 'https://ampforwp.com/demo/#one',
2865
- 'upgrade'=>true,
2866
- 'title'=>__('Design One', 'accelerated-mobile-pages' ),
2867
- 'value'=>1,
2868
- 'alt'=>__('Design One', 'accelerated-mobile-pages' ),
2869
- 'img'=>AMPFORWP_PLUGIN_DIR_URI.'/images/design-1.png',
2870
- ),
2871
- array(
2872
  'demo_link' => 'https://ampforwp.com/demo/#two',
2873
- 'upgrade'=>true,
2874
- 'title'=>__('Design Two', 'accelerated-mobile-pages' ),
2875
- 'value'=>2,
2876
- 'alt'=>__('Design Two', 'accelerated-mobile-pages' ),
2877
- 'img'=>AMPFORWP_PLUGIN_DIR_URI.'/images/design-2.png',
2878
- ),
2879
- array(
2880
  'demo_link' => 'https://ampforwp.com/demo/#three',
2881
- 'upgrade'=>true,
2882
- 'title'=>__('Design Three', 'accelerated-mobile-pages' ),
2883
- 'value'=>3,
2884
- 'alt'=>__('Design Three', 'accelerated-mobile-pages' ),
2885
- 'img'=>AMPFORWP_PLUGIN_DIR_URI.'/images/design-3.png',
2886
- ),
2887
  array(
2888
  'demo_link' => 'https://ampforwp.com/demo/amp-pagebuilder/amp/',
2889
  'upgrade' => true,
@@ -2897,18 +2931,18 @@ Redux::setSection( $opt_name, array(
2897
  foreach (get_plugins() as $key => $value) {
2898
  $plugin = get_plugin_data(WP_PLUGIN_DIR.'/'.$key);
2899
  if(!empty($plugin['AMP'])){//$plugin['AMP']
2900
- $imageUrl = '';
2901
- if(file_exists(AMPFORWP_MAIN_PLUGIN_DIR.$value['TextDomain'].'/screenshot.png')){
2902
- $imageUrl = plugins_url($value['TextDomain'].'/screenshot.png');
2903
- }
2904
  $themeDesign[] = array(
2905
  'demo_link' => $plugin['AMP Demo'],
2906
- 'upgrade'=>true,
2907
- 'title'=>$plugin['AMP'],
2908
- 'value'=>$value['TextDomain'],
2909
- 'alt'=>$plugin['AMP'],
2910
- 'img'=>$imageUrl,
2911
- );
2912
  }
2913
  }
2914
  }
@@ -5265,4 +5299,4 @@ Redux::setSection( $opt_name, array(
5265
  Redux::setExtensions( $opt_name, AMPFORWP_PLUGIN_DIR.'includes/options/extensions/demolink_image_select' );
5266
  /*
5267
  * <--- END SECTIONS
5268
- */
46
  'img_src'=>AMPFORWP_IMAGE_DIR . '/click.png',
47
  'price'=>'$29',
48
  'url_link'=>'http://ampforwp.com/advanced-amp-ads/#utm_source=options-panel&utm_medium=extension-tab_advanced-amp-ads&utm_campaign=AMP%20Plugin',
49
+ 'plugin_active_path'=> 'amp-incontent-ads/amptoolkit-incontent-ads.php',
50
  'item_name'=>'Advanced AMP Ads',
51
  'store_url'=>'https://accounts.ampforwp.com',
52
+ 'is_activated'=>(is_plugin_active('amp-incontent-ads/amptoolkit-incontent-ads.php')? 1:2),
53
  ),
54
  array(
55
  'name'=>'Contact Form 7',
61
  'item_name'=>'Contact Form 7 for AMP',
62
  'store_url'=>'https://accounts.ampforwp.com',
63
  'is_activated'=>(is_plugin_active('amp-cf7/amp-cf7.php')? 1 : 2),
64
+ 'settingUrl'=>'',
65
  ),
66
  array(
67
  'name'=>'Gravity Forms',
73
  'item_name'=>'Gravity Forms',
74
  'store_url'=>'https://accounts.ampforwp.com',
75
  'is_activated'=>(is_plugin_active('amp-gravity-forms/amp-gravity-forms.php')? 1 : 2),
76
+ 'settingUrl'=>'',
77
  ),
78
  array(
79
  'name'=>'Email Opt-in Forms',
85
  'item_name'=>'Opt-in-Forms for AMP',
86
  'store_url'=>'https://accounts.ampforwp.com',
87
  'is_activated'=>(is_plugin_active('amp-optin/amp-optin.php')? 1 : 2),
88
+ 'settingUrl'=>'',
89
  ),
90
  array(
91
  'name'=>'AMP Cache',
97
  'item_name'=>'AMP Cache',
98
  'store_url'=>'https://accounts.ampforwp.com',
99
  'is_activated'=>(is_plugin_active('amp-cache/ampforwp-cache.php')? 1 : 2),
100
+ 'settingUrl'=>'',
101
  ),
102
  array(
103
  'name'=>'Call To Action (CTA)',
105
  'img_src'=>AMPFORWP_IMAGE_DIR . '/mac-click.png',
106
  'price'=>'$29',
107
  'url_link'=>'http://ampforwp.com/call-to-action/#utm_source=options-panel&utm_medium=extension-tab_amp-cta&utm_campaign=AMP%20Plugin',
108
+ 'plugin_active_path'=> 'amp-cta/amp-cta.php',
109
  'item_name'=>'Call To Action for AMP',
110
  'store_url'=>'https://accounts.ampforwp.com',
111
+ 'is_activated'=>(is_plugin_active('amp-cta/amp-cta.php')? 1 : 2),
112
  ),
113
  array(
114
  'name'=>'AMP WooCommerce Pro',
120
  'item_name'=>'WooCommerce',
121
  'store_url'=>'https://accounts.ampforwp.com',
122
  'is_activated'=>(is_plugin_active('amp-woocommerce-pro/amp-woocommerce.php')? 1 : 2),
123
+ 'settingUrl'=>'',
124
  ),
125
 
126
+ array(
127
+ 'name'=>'AMP Layouts',
128
+ 'desc'=>'layout system built for AMP that makes easy to create your own AMP templates.',
129
+ 'img_src'=>AMPFORWP_IMAGE_DIR . '/email.png',
130
+ 'price'=>'$89',
131
+ 'url_link'=>'https://ampforwp.com/amp-layouts/',
132
+ 'plugin_active_path'=> 'amp-layouts/amp-layouts.php',
133
+ 'item_name'=>'AMP Layouts',
134
+ 'store_url'=>'https://accounts.ampforwp.com',
135
+ 'is_activated'=>(is_plugin_active('amp-layouts/amp-layouts.php')? 1 : 2),
136
+ 'settingUrl'=>'',
137
+ ),
138
+
139
  array(
140
  'name'=>'Newspaper AMP Theme',
141
  'desc'=>'Advanced News Magazine theme built for AMP.',
142
  'img_src'=>AMPFORWP_IMAGE_DIR . '/click.png',
143
  'price'=>'$49',
144
  'url_link'=>'https://ampforwp.com/themes/newspaper/',
145
+ 'plugin_active_path'=> 'amp-newspaper-theme/ampforwp-custom-theme.php',
146
  'item_name'=>'Newspaper Theme for AMP',
147
  'store_url'=>'https://accounts.ampforwp.com',
148
+ 'is_activated'=>(is_plugin_active('amp-newspaper-theme/ampforwp-custom-theme.php')? 1 : 2),
149
  ),
150
 
151
  array(
152
+ 'name'=>'ACF for AMP',
153
  'desc'=>'Easily add ACF support in AMP.',
154
  'img_src'=>AMPFORWP_IMAGE_DIR . '/acf.png',
155
  'price'=>'$29',
156
  'url_link'=>'http://ampforwp.com/acf-amp/#utm_source=options-panel&utm_medium=extension-tab_opt-in-forms&utm_campaign=AMP%20Plugin',
157
+ 'plugin_active_path'=> 'acf-for-amp-v2/amp-acf.php',
158
  'item_name'=>'ACF for AMP',
159
  'store_url'=>'https://accounts.ampforwp.com',
160
+ 'is_activated'=>(is_plugin_active('acf-for-amp-v2/amp-acf.php')? 1 : 2),
161
  ),
162
  array(
163
  'name'=>'AMP Comments',
191
  'item_name'=>'Custom Post Type Support for AMP',
192
  'store_url'=>'https://accounts.ampforwp.com',
193
  'is_activated'=>(is_plugin_active('amp-custom-post-type/amp-custom-post-type.php')? 1 : 2),
194
+ 'settingUrl'=>'',
195
  ),
196
  array(
197
  'name'=>'Structured Data for WP',
203
  'item_name'=>'Structured Data for WP',
204
  'store_url'=>'https://accounts.ampforwp.com',
205
  'is_activated'=>(is_plugin_active('structured-data-for-wp/structured-data-for-wp.php')? 1: 2),
206
+ 'settingUrl'=>'',
207
  ),
208
  array(
209
  'name'=>'Polylang For AMP',
216
  'store_url'=>'https://accounts.ampforwp.com',
217
  'is_activated'=>(is_plugin_active('polylang-for-amp/amp_polylang.php')? 1: 2),
218
  ),
219
+ array(
220
+ 'name'=>'WPML for AMP',
221
+ 'desc'=>'WPML compatibility with AMP',
222
+ 'img_src'=>AMPFORWP_IMAGE_DIR . '/click.png',
223
+ 'price'=>'$29',
224
+ 'url_link'=>'https://ampforwp.com/wpml-for-amp/',
225
+ 'plugin_active_path'=> 'wpml-for-amp/wpml_for_amp.php',
226
+ 'item_name'=>'WPML For AMP',
227
+ 'store_url'=>'https://accounts.ampforwp.com',
228
+ 'is_activated'=>(is_plugin_active('wpml-for-amp/wpml_for_amp.php')? 1: 2),
229
+ ),
230
  array(
231
  'name'=>'AMP Teaser',
232
  'desc'=>'AMP Teaser automatically clips the content based on your selection',
237
  'item_name'=>'AMP Teaser',
238
  'store_url'=>'https://accounts.ampforwp.com',
239
  'is_activated'=>(is_plugin_active('amp-teaser/amp-teaser.php')? 1: 2),
240
+ 'settingUrl'=>'',
241
  ),
242
  array(
243
  'name'=>'View All Extensions',
249
  'item_name'=>'',
250
  'store_url'=>'',
251
  'is_activated'=>2,
252
+ 'settingUrl'=>'',
253
  ),
254
  );
255
+
256
  $extension_listing_array = apply_filters( 'ampforwp_extension_lists_filter', $extension_listing_array );
257
  $ampforwp_extension_list_html = '';
258
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
282
  if(isset($selectedOption['amp-license'][$pathExploded])){
283
  $amplicense = $selectedOption['amp-license'][$pathExploded]['license'];
284
  }
285
+ $verify = '<button type="button" id="'.$pathExploded.'" class="redux-ampforwp-ext-activate">Activate</button>';
286
  if(isset($selectedOption['amp-license'][$pathExploded]['status']) && $selectedOption['amp-license'][$pathExploded]['status']==='valid'){
287
  $currentStatus = 'active valid';
288
  $verify = '<button type="button" id="'.$pathExploded.'" class="redux-ampforwp-ext-deactivate">Deactivate</button>';
300
 
301
  $pluginReview .= $verify;
302
  if(isset($selectedOption['amp-license'][$pathExploded]['message']) && $selectedOption['amp-license'][$pathExploded]['message']!=""){
303
+ $pluginReview .= "<div class='afw-license-response-message'>".$selectedOption['amp-license'][$pathExploded]['message']."</div>";
304
  }
305
 
306
  }
462
  $layouts = ampforwp_upcomming_layouts_demo();
463
  if(is_array($layouts)){
464
  foreach($layouts as $k=>$val){
465
+ $upcomingLayoutsDesign .= '<div class="amp_layout_upcomming">
466
  <div class="amppb_ad-layout-layout">
467
  <div class="amppb_ad-layout-wrapper">
468
  <div class="amppb_ad-layout_pro"><a href="https://ampforwp.com/amp-layouts/" target="_blank">PRO</a></div>
481
  //$amp_redux_header = '<span id="name"><span style="color: #4dbefa;">U</span>ltimate <span style="color: #4dbefa;">W</span>idgets</span>';
482
  $proDetailsProvide = '<a class="premium_features_btn_txt" href="https://ampforwp.com/membership/#utm_source=options-panel&utm_medium=view_pro_features_btn&utm_campaign=AMP%20Plugin" target="_blank">'.__('Get more out of AMP','accelerated-mobile-pages').'</a> <a class="premium_features_btn" href="https://ampforwp.com/membership/#utm_source=options-panel&utm_medium=view_pro_features_btn&utm_campaign=AMP%20Plugin" target="_blank">Get PRO Version</a> ';
483
  if($ampforwp_nameOfUser!=""){
484
+ $proDetailsProvide = "<span class='extension-menu-call'><span class='activated-plugins' style='color:#f2f2f2'>Hello, ".$ampforwp_nameOfUser."</span> <a class='' href='".admin_url('admin.php?page=amp_options&tabid=opt-go-premium')."'><i class='dashicons-before dashicons-admin-generic'></i></a></span>";
485
  }elseif($ampforwp_is_productActivated){
486
+ $proDetailsProvide = "<span class='extension-menu-call'>One more Step <a class='premium_features_btn' href='".admin_url('admin.php?tabid=opt-go-premium&page=amp_options')."'>Enter license here</a></span>";
487
  }
488
  $args = array(
489
  // TYPICAL -> Change these values as you need/desire
591
  padding: 8px 11px;background: #4CAF50;
592
  font-size: 13px;margin: -24px 0 0 10px;
593
  border-radius: 5px;line-height: 22px;position:relative;top:30px"><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' )
594
+ . '<div style="width:100%;margin:20px 0px 10px 0px" class="getstarted_wrapper">
595
  <div class="getstarted_options">
596
  <p><b>Getting Started</b></p>
597
+ <ul class="getstarted_ul">
598
+ <li><a href="https://ampforwp.com/tutorials/article-categories/installation-updating/" target="_blank">Installation & Setup</a></li>
599
+ <li><a href="https://ampforwp.com/tutorials/article-categories/settings-options/" target="_blank">Settings & Options</a></li>
600
+ <li><a href="https://ampforwp.com/tutorials/article-categories/setup-amp/" target="_blank">Setup AMP</a></li>
601
+ <li><a href="https://ampforwp.com/tutorials/article-categories/page-builder/" target="_blank">Page Builder</a></li>
602
+ </ul>
603
  </div>
604
  <div class="getstarted_options">
605
  <p><b>Useful Links</b></p>
606
+ <ul class="getstarted_ul">
607
+ <li><a href="https://ampforwp.com/tutorials/article-categories/extension/" target="_blank">Extensions & Themes Docs</a></li>
608
+ <li><a href="https://ampforwp.com/tutorials/article-categories/extending/" target="_blank">Developers Docs</a></li>
609
+ <li><a href="https://ampforwp.com/amp-theme-framework/" target="_blank">Create a Custom Theme for AMP</a></li>
610
+ <li><a href="https://ampforwp.com/tutorials/article-categories/how-to/" target="_blank">General How To\'s</a></li>
611
+ </ul>
612
  </div>
613
  <div class="clear"></div>
614
  </div>'
615
  . '<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>'
616
+ . '<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>'
617
+ . '<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>'
618
+ . '<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>'
619
 
620
+ . '</p></div>
621
  <br /><p><h3>Take AMP to the Next Level with Premium Extensions</h3></p>
622
  ' .$gettingstarted_extension_listing
623
 
624
+ , 'accelerated-mobile-pages' ),
625
  'icon' => 'el el-cogs'
626
  ) );
627
 
739
  'default' => 1,
740
  // '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' ),
741
  ),
742
+ array(
743
  'id' =>'amp-on-off-for-all-pages',
744
  'type' => 'switch',
745
  'title' => __('Pages', 'accelerated-mobile-pages'),
2442
  'default' => 0,
2443
  //'required' => array('ampforwp-amp-menu', '=' , '1')
2444
  ),
2445
+ //Category Base Removal in AMP
2446
+ array(
2447
  'id' => 'ampforwp-category-base-removel-link',
2448
  'type' => 'switch',
2449
  'title' => __('Category base remove in AMP', 'accelerated-mobile-pages'),
2453
  'default' => 0,
2454
 
2455
  ),
2456
+ //Tag base Removal in AMP
2457
+ array(
2458
  'id' => 'ampforwp-tag-base-removal-link',
2459
  'type' => 'switch',
2460
  'title' => __('Tag base remove in AMP', 'accelerated-mobile-pages'),
2894
  }
2895
  add_filter("extra_plugin_headers","amp_extra_plugin_theme_header");
2896
  $themeDesign = array(
2897
+ array(
2898
  'demo_link' => 'https://ampforwp.com/demo/#one',
2899
+ 'upgrade'=>true,
2900
+ 'title'=>__('Design One', 'accelerated-mobile-pages' ),
2901
+ 'value'=>1,
2902
+ 'alt'=>__('Design One', 'accelerated-mobile-pages' ),
2903
+ 'img'=>AMPFORWP_PLUGIN_DIR_URI.'/images/design-1.png',
2904
+ ),
2905
+ array(
2906
  'demo_link' => 'https://ampforwp.com/demo/#two',
2907
+ 'upgrade'=>true,
2908
+ 'title'=>__('Design Two', 'accelerated-mobile-pages' ),
2909
+ 'value'=>2,
2910
+ 'alt'=>__('Design Two', 'accelerated-mobile-pages' ),
2911
+ 'img'=>AMPFORWP_PLUGIN_DIR_URI.'/images/design-2.png',
2912
+ ),
2913
+ array(
2914
  'demo_link' => 'https://ampforwp.com/demo/#three',
2915
+ 'upgrade'=>true,
2916
+ 'title'=>__('Design Three', 'accelerated-mobile-pages' ),
2917
+ 'value'=>3,
2918
+ 'alt'=>__('Design Three', 'accelerated-mobile-pages' ),
2919
+ 'img'=>AMPFORWP_PLUGIN_DIR_URI.'/images/design-3.png',
2920
+ ),
2921
  array(
2922
  'demo_link' => 'https://ampforwp.com/demo/amp-pagebuilder/amp/',
2923
  'upgrade' => true,
2931
  foreach (get_plugins() as $key => $value) {
2932
  $plugin = get_plugin_data(WP_PLUGIN_DIR.'/'.$key);
2933
  if(!empty($plugin['AMP'])){//$plugin['AMP']
2934
+ $imageUrl = '';
2935
+ if(file_exists(AMPFORWP_MAIN_PLUGIN_DIR.$value['TextDomain'].'/screenshot.png')){
2936
+ $imageUrl = plugins_url($value['TextDomain'].'/screenshot.png');
2937
+ }
2938
  $themeDesign[] = array(
2939
  'demo_link' => $plugin['AMP Demo'],
2940
+ 'upgrade'=>true,
2941
+ 'title'=>$plugin['AMP'],
2942
+ 'value'=>$value['TextDomain'],
2943
+ 'alt'=>$plugin['AMP'],
2944
+ 'img'=>$imageUrl,
2945
+ );
2946
  }
2947
  }
2948
  }
5299
  Redux::setExtensions( $opt_name, AMPFORWP_PLUGIN_DIR.'includes/options/extensions/demolink_image_select' );
5300
  /*
5301
  * <--- END SECTIONS
5302
+ */
includes/options/redux-core/framework.php CHANGED
@@ -3195,11 +3195,12 @@
3195
 
3196
  // DOVY! REPLACE $k with $section['ID'] when used properly.
3197
  //$active = ( ( is_numeric($this->current_tab) && $this->current_tab == $k ) || ( !is_numeric($this->current_tab) && $this->current_tab === $k ) ) ? ' active' : '';
 
3198
  $subsections = ( isset ( $sections[ ( $k + 1 ) ] ) && isset ( $sections[ ( $k + 1 ) ]['subsection'] ) && $sections[ ( $k + 1 ) ]['subsection'] == true ) ? true : false;
3199
  $subsectionsClass = $subsections ? ' hasSubSections' : '';
3200
  $subsectionsClass .= ( ! isset ( $section['fields'] ) || empty ( $section['fields'] ) ) ? ' empty_section' : '';
3201
  $extra_icon = $subsections ? '<span class="extraIconSubsections"><i class="el el-chevron-down">&nbsp;</i></span>' : '';
3202
- $string .= '<li id="' . esc_attr( $k . $suffix ) . '_section_group_li" class="redux-group-tab-link-li' . esc_attr( $hide_section ) . esc_attr( $section['class'] ) . esc_attr( $subsectionsClass ) . '">';
3203
  $string .= '<a href="javascript:void(0);" id="' . esc_attr( $k . $suffix ) . '_section_group_li_a" class="redux-group-tab-link-a" data-key="' . esc_attr( $k ) . '" data-rel="' . esc_attr( $k . $suffix ) . '">' . $extra_icon . $icon . '<span class="group_title">' . wp_kses_post( $section['title'] ) . '</span></a>';
3204
 
3205
  $nextK = $k;
3195
 
3196
  // DOVY! REPLACE $k with $section['ID'] when used properly.
3197
  //$active = ( ( is_numeric($this->current_tab) && $this->current_tab == $k ) || ( !is_numeric($this->current_tab) && $this->current_tab === $k ) ) ? ' active' : '';
3198
+ $addClass = ''; $style="";
3199
  $subsections = ( isset ( $sections[ ( $k + 1 ) ] ) && isset ( $sections[ ( $k + 1 ) ]['subsection'] ) && $sections[ ( $k + 1 ) ]['subsection'] == true ) ? true : false;
3200
  $subsectionsClass = $subsections ? ' hasSubSections' : '';
3201
  $subsectionsClass .= ( ! isset ( $section['fields'] ) || empty ( $section['fields'] ) ) ? ' empty_section' : '';
3202
  $extra_icon = $subsections ? '<span class="extraIconSubsections"><i class="el el-chevron-down">&nbsp;</i></span>' : '';
3203
+ $string .= '<li id="' . esc_attr( $k . $suffix ) . '_section_group_li" class="redux-group-tab-link-li '.$addClass.'' . esc_attr( $hide_section ) . esc_attr( $section['class'] ) . esc_attr( $subsectionsClass ) . ' ' . strtolower( wp_kses_post( $section['id'] )) . '" '.$style.'>';
3204
  $string .= '<a href="javascript:void(0);" id="' . esc_attr( $k . $suffix ) . '_section_group_li_a" class="redux-group-tab-link-a" data-key="' . esc_attr( $k ) . '" data-rel="' . esc_attr( $k . $suffix ) . '">' . $extra_icon . $icon . '<span class="group_title">' . wp_kses_post( $section['title'] ) . '</span></a>';
3205
 
3206
  $nextK = $k;
includes/updater/update.php CHANGED
@@ -5,12 +5,137 @@ if ( ! defined( 'ABSPATH' ) ) {
5
  exit;
6
  }
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  /**
10
  * Activate the license
11
  */
12
  function ampForWP_extension_activate_license() {
13
  //Get Data from Redux data
 
14
  $selectedOption = get_option('redux_builder_amp',true);
15
  if( isset($selectedOption['amp-license']) && "" != $selectedOption['amp-license']){
16
  foreach ($selectedOption['amp-license'] as $ext_key => $ext_value) {
@@ -61,7 +186,7 @@ function ampForWP_extension_activate_license() {
61
 
62
  case 'missing' :
63
 
64
- $message = __( 'Invalid license.', 'ampforwp-extension-updater' );
65
  break;
66
 
67
  case 'invalid' :
@@ -179,13 +304,15 @@ function ampforwp_deactivate_license() {
179
  wp_redirect( $redirect );*/
180
  echo json_encode(array('status'=>500,"message"=>$message,"test"=>$selectedOption['amp-license'][$_POST['ampforwp_license_deactivate']], "dsc"=>$pluginItemStoreUrl));
181
  exit();
 
 
182
  }
183
 
184
  // decode the license data
185
  $license_data = json_decode( wp_remote_retrieve_body( $response ) ,true);
186
 
187
  // $license_data->license will be either "deactivated" or "failed"
188
- if( $license_data->license == 'deactivated' ) {
189
  delete_option( 'amp_ads_license_status' );
190
  }
191
  if( isset($selectedOption['amp-license']) && "" != $selectedOption['amp-license']){
5
  exit;
6
  }
7
 
8
+ function ampforwp_get_licence_activate_update(){
9
+ $selectedOption = get_option('redux_builder_amp',true);
10
+ if($_POST){
11
+ $ampforwp_license_activate = $_POST['ampforwp_license_activate'];
12
+ $license = $_POST['license'];
13
+ $item_name = $_POST['item_name'];
14
+ $store_url = $_POST['store_url'];
15
+ $plugin_active_path = $_POST['plugin_active_path'];
16
+ $status = 300;
17
+ if($license==""){
18
+ $message = "Please Enter valid license key";
19
+ }else{
20
+ $selectedOption['amp-license'][$ampforwp_license_activate]['license'] = $license;
21
+ $selectedOption['amp-license'][$ampforwp_license_activate]['item_name'] = $item_name;
22
+ $selectedOption['amp-license'][$ampforwp_license_activate]['store_url'] = $store_url;
23
+ $selectedOption['amp-license'][$ampforwp_license_activate]['plugin_active_path'] = $plugin_active_path;
24
+ }
25
+
26
+
27
+ if( isset($selectedOption['amp-license']) && "" != $selectedOption['amp-license']){
28
+ // data to send in our API request
29
+ $api_params = array(
30
+ 'edd_action' => 'activate_license',
31
+ 'license' => $license,
32
+ 'item_name' => urlencode( $item_name ), // the name of our product in EDD
33
+ 'url' => home_url()
34
+ );
35
+
36
+ // Call the custom API.
37
+ $response = wp_remote_post( $store_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
38
+ $message = '';
39
+ // make sure the response came back okay
40
+ if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
41
+
42
+ if ( is_wp_error( $response ) ) {
43
+ $message = $response->get_error_message();
44
+ } else {
45
+ $message = __( 'An error occurred, please try again.', 'ampforwp-extension-updater' );
46
+ }
47
+
48
+ } else {
49
+ $response = wp_remote_retrieve_body( $response );
50
+ $license_data = json_decode( $response );
51
+ if ( false === $license_data->success ) {
52
+ switch( $license_data->error ) {
53
+ case 'expired' :
54
+ $message = sprintf(
55
+ __( 'Your license key expired on %s.', 'ampforwp-extension-updater' ),
56
+ date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )
57
+ );
58
+ $message .= "<a href='".$store_url."/checkout-2/?edd_license_key=16ed15c13524cc7e00346eeb3f76e412'>Renew Link</a>";
59
+ break;
60
+
61
+ case 'revoked' :
62
+
63
+ $message = __( 'Your license key has been disabled.', 'ampforwp-extension-updater' );
64
+ break;
65
+
66
+ case 'missing' :
67
+
68
+ $message = __( 'Please enter the license key.', 'ampforwp-extension-updater' );
69
+ break;
70
+
71
+ case 'invalid' :
72
+ case 'site_inactive' :
73
 
74
+ $message = __( 'Your license is not active for this URL.', 'ampforwp-extension-updater' );
75
+ break;
76
+
77
+ case 'item_name_mismatch' :
78
+
79
+ $message = sprintf(
80
+ __( 'This appears to be an invalid license key for %s.', 'ampforwp-extension-updater' ),
81
+ $item_name
82
+ );
83
+ break;
84
+
85
+ case 'no_activations_left':
86
+
87
+ $message = __( 'Your license key has reached its activation limit.', 'ampforwp-extension-updater' );
88
+ break;
89
+
90
+ default :
91
+
92
+ $message = __( 'An error occurred, please try again.', 'ampforwp-extension-updater' );
93
+ break;
94
+ }
95
+
96
+ }
97
+
98
+ }//else Closed
99
+ // Check if anything passed on a message constituting a failure
100
+ $status = false;
101
+ if ( ! empty( $message ) ) {
102
+ if(isset($license_data) && is_object($license_data)){
103
+ $status = $license_data->error;
104
+ }else{
105
+ $status = "An error occurred, Error type not found.";
106
+ }
107
+ }else{
108
+ $status = $license_data->license;
109
+ $limit = ampforwp_set_plugin_limit( true, $license_data, $ampforwp_license_activate);
110
+ $selectedOption['amp-license'][$ampforwp_license_activate]['limit'] = $limit;
111
+ $selectedOption['amp-license'][$ampforwp_license_activate]['all_data'] = json_decode($response,true);
112
+ }
113
+
114
+ $selectedOption['amp-license'][$ampforwp_license_activate]['status'] = $status;
115
+ $selectedOption['amp-license'][$ampforwp_license_activate]['message'] = $message;
116
+
117
+
118
+
119
+ update_option( 'redux_builder_amp', $selectedOption );
120
+ if($status=='valid'){
121
+ $status = "200";
122
+ $message = "Plugin activated successfully";
123
+ }else{
124
+ $status = "500";
125
+ }
126
+ }
127
+
128
+ echo json_encode(array("status"=>$status,"message"=>$message,"other"=> $selectedOption['amp-license'][$ampforwp_license_activate]));
129
+ die;
130
+ }
131
+ }
132
+ add_action( 'wp_ajax_ampforwp_get_licence_activate_update', 'ampforwp_get_licence_activate_update' );
133
  /**
134
  * Activate the license
135
  */
136
  function ampForWP_extension_activate_license() {
137
  //Get Data from Redux data
138
+
139
  $selectedOption = get_option('redux_builder_amp',true);
140
  if( isset($selectedOption['amp-license']) && "" != $selectedOption['amp-license']){
141
  foreach ($selectedOption['amp-license'] as $ext_key => $ext_value) {
186
 
187
  case 'missing' :
188
 
189
+ $message = __( 'Please enter the license key.', 'ampforwp-extension-updater' );
190
  break;
191
 
192
  case 'invalid' :
304
  wp_redirect( $redirect );*/
305
  echo json_encode(array('status'=>500,"message"=>$message,"test"=>$selectedOption['amp-license'][$_POST['ampforwp_license_deactivate']], "dsc"=>$pluginItemStoreUrl));
306
  exit();
307
+ }else{
308
+ $message = 'Plugin deactivated successfully';
309
  }
310
 
311
  // decode the license data
312
  $license_data = json_decode( wp_remote_retrieve_body( $response ) ,true);
313
 
314
  // $license_data->license will be either "deactivated" or "failed"
315
+ if(is_object($license_data) && $license_data->license == 'deactivated' ) {
316
  delete_option( 'amp_ads_license_status' );
317
  }
318
  if( isset($selectedOption['amp-license']) && "" != $selectedOption['amp-license']){
includes/vendor/amp/includes/class-amp-post-template.php CHANGED
@@ -436,7 +436,7 @@ class AMP_Post_Template {
436
 
437
  private function locate_template( $file ) {
438
  $location = 'ampforwp';
439
- $location = apply_filters("ampforwp_tamplate_locat",$location);
440
  $search_file = sprintf( $location.'/%s', basename( $file ) );
441
  return locate_template( array( $search_file ), false );
442
  }
436
 
437
  private function locate_template( $file ) {
438
  $location = 'ampforwp';
439
+ $location = apply_filters("ampforwp_template_locate",$location);
440
  $search_file = sprintf( $location.'/%s', basename( $file ) );
441
  return locate_template( array( $search_file ), false );
442
  }
pagebuilder/functions.php CHANGED
@@ -117,8 +117,8 @@ function js_templates() {
117
  function checkAMPforPageBuilderStatus($postId){
118
  global $post, $redux_builder_amp;
119
  $postId = $post->ID;
120
- if( ampforwp_is_front_page() && isset($redux_builder_amp['amp-frontpage-select-option-pages']) ){
121
- $postId = $redux_builder_amp['amp-frontpage-select-option-pages'];
122
  }
123
 
124
  $ampforwp_pagebuilder_enable = get_post_meta($postId,'ampforwp_page_builder_enable', true);
117
  function checkAMPforPageBuilderStatus($postId){
118
  global $post, $redux_builder_amp;
119
  $postId = $post->ID;
120
+ if( ampforwp_is_front_page() ){
121
+ $postId = ampforwp_get_frontpage_id();
122
  }
123
 
124
  $ampforwp_pagebuilder_enable = get_post_meta($postId,'ampforwp_page_builder_enable', true);
pagebuilder/inc/viewShowFrontData.php CHANGED
@@ -7,8 +7,8 @@ add_action('pre_amp_render_post','amp_pagebuilder_content');
7
  function amp_pagebuilder_content(){
8
  global $post, $redux_builder_amp;
9
  $postId = $post->ID;
10
- if( ampforwp_is_front_page() && isset($redux_builder_amp['amp-frontpage-select-option-pages']) ){
11
- $postId = $redux_builder_amp['amp-frontpage-select-option-pages'];
12
  }
13
  if ( ampforwp_polylang_front_page() ) {
14
  $front_page_id = get_option('page_on_front');
@@ -44,8 +44,8 @@ function ampforwp_pagebuilder_header_html_output(){
44
  //To load css of modules which are in use
45
  global $redux_builder_amp, $moduleTemplate, $post, $containerCommonSettings;
46
  $postId = $post->ID;
47
- if( ampforwp_is_front_page() && isset($redux_builder_amp['amp-frontpage-select-option-pages']) ){
48
- $postId = $redux_builder_amp['amp-frontpage-select-option-pages'];
49
  }
50
  $previousData = get_post_meta($postId,'amp-page-builder');
51
  $previousData = isset($previousData[0])? $previousData[0]: null;
@@ -63,8 +63,8 @@ function amp_pagebuilder_script_loader($scriptData){
63
  //To load css of modules which are in use
64
  global $redux_builder_amp, $moduleTemplate, $post, $containerCommonSettings;
65
  $postId = $post->ID;
66
- if( ampforwp_is_front_page() && isset($redux_builder_amp['amp-frontpage-select-option-pages']) ){
67
- $postId = $redux_builder_amp['amp-frontpage-select-option-pages'];
68
  }
69
  $previousData = get_post_meta($postId,'amp-page-builder');
70
  $previousData = isset($previousData[0])? $previousData[0]: null;
@@ -123,8 +123,8 @@ function amp_pagebuilder_content_styles(){
123
  //To load css of modules which are in use
124
  global $redux_builder_amp, $moduleTemplate, $post, $containerCommonSettings;
125
  $postId = $post->ID;
126
- if( ampforwp_is_front_page() && isset($redux_builder_amp['amp-frontpage-select-option-pages']) ) {
127
- $postId = $redux_builder_amp['amp-frontpage-select-option-pages'];
128
  }
129
  if ( ampforwp_polylang_front_page() ) {
130
  $front_page_id = get_option('page_on_front');
@@ -440,8 +440,8 @@ function amppb_post_content($content){
440
  global $post, $redux_builder_amp;
441
  global $moduleTemplate, $layoutTemplate, $containerCommonSettings;
442
  $postId = $post->ID;
443
- if( ampforwp_is_front_page() && isset($redux_builder_amp['amp-frontpage-select-option-pages']) ){
444
- $postId = $redux_builder_amp['amp-frontpage-select-option-pages'];
445
  }
446
  if ( ampforwp_polylang_front_page() ) {
447
  $front_page_id = get_option('page_on_front');
7
  function amp_pagebuilder_content(){
8
  global $post, $redux_builder_amp;
9
  $postId = $post->ID;
10
+ if( ampforwp_is_front_page() ){
11
+ $postId = ampforwp_get_frontpage_id();
12
  }
13
  if ( ampforwp_polylang_front_page() ) {
14
  $front_page_id = get_option('page_on_front');
44
  //To load css of modules which are in use
45
  global $redux_builder_amp, $moduleTemplate, $post, $containerCommonSettings;
46
  $postId = $post->ID;
47
+ if( ampforwp_is_front_page() ){
48
+ $postId = ampforwp_get_frontpage_id();
49
  }
50
  $previousData = get_post_meta($postId,'amp-page-builder');
51
  $previousData = isset($previousData[0])? $previousData[0]: null;
63
  //To load css of modules which are in use
64
  global $redux_builder_amp, $moduleTemplate, $post, $containerCommonSettings;
65
  $postId = $post->ID;
66
+ if( ampforwp_is_front_page() ){
67
+ $postId = ampforwp_get_frontpage_id();
68
  }
69
  $previousData = get_post_meta($postId,'amp-page-builder');
70
  $previousData = isset($previousData[0])? $previousData[0]: null;
123
  //To load css of modules which are in use
124
  global $redux_builder_amp, $moduleTemplate, $post, $containerCommonSettings;
125
  $postId = $post->ID;
126
+ if( ampforwp_is_front_page() ) {
127
+ $postId = ampforwp_get_frontpage_id();
128
  }
129
  if ( ampforwp_polylang_front_page() ) {
130
  $front_page_id = get_option('page_on_front');
440
  global $post, $redux_builder_amp;
441
  global $moduleTemplate, $layoutTemplate, $containerCommonSettings;
442
  $postId = $post->ID;
443
+ if( ampforwp_is_front_page() ){
444
+ $postId = ampforwp_get_frontpage_id();
445
  }
446
  if ( ampforwp_polylang_front_page() ) {
447
  $front_page_id = get_option('page_on_front');
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 4.9.5
7
- Stable tag: 0.9.85.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -13,7 +13,7 @@ AMP for WP is the most recommended AMP plugin by the community. Automatically ad
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://ampforwp.com/demo/) | [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
 
@@ -104,10 +104,10 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
104
  * NEW - Make AMP & Non-AMP Same with just one click!
105
  * NEW - Allows you to use AMP as primary website!
106
 
107
- **[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.
108
 
109
  = Getting Started: =
110
- **[1. User Documentation:](http://ampforwp.com/help/)** The AMP for WordPress plugin is easy to setup but we have some tutorials and guides prepared for you which will help you dive deep with the plugin.
111
 
112
  **[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.
113
 
@@ -115,15 +115,15 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
115
 
116
  **[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.
117
 
118
- **[5. Frequently Asked Questions:](http://ampforwp.com/faq/)** Some of the Frequently Asked questions.
119
 
120
 
121
  == Installation ==
122
- **[Visit Help area for the Documentation:](http://ampforwp.com/help/)**
123
 
124
  [youtube https://www.youtube.com/watch?v=Em1nsE_KaKw]
125
 
126
- **[Visit Help area for the Documentation:](http://ampforwp.com/help/)**
127
 
128
 
129
  == Frequently Asked Questions ==
@@ -163,7 +163,7 @@ Yes, Absolutely! We would suggest you send your feature request by creating an i
163
 
164
  = How do I get in touch? =
165
 
166
- You can contact us from [here](http://ampforwp.com/contact/)
167
 
168
 
169
  == Screenshots ==
@@ -182,6 +182,11 @@ You can contact us from [here](http://ampforwp.com/contact/)
182
 
183
  == Changelog ==
184
 
 
 
 
 
 
185
  = 0.9.85.3 (12th April 2018) =
186
  * Added: Custom Post type Archive Page support #1995
187
  * Fixed: AMP TakeOver redirection issues #1994
@@ -1380,7 +1385,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1380
  * Typo in Trailingslashit function which resulted in some issues in the Homepage version [Bug Fix]
1381
 
1382
  = 0.9.1.2 [20th December 2016] =
1383
- * Proper Details at http://ampforwp.com/new/
1384
  * DoubleClick Support
1385
  * Custom Post Type Support
1386
  * Ratings Support
@@ -1399,7 +1404,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1399
  * Page Performance: DNS Prefetch tag added for faster DNS Handshake
1400
 
1401
  = 0.9.1 [16th December 2016] =
1402
- * Proper Details at http://ampforwp.com/new/
1403
  * PHP7 Compatibility
1404
  * Pagination URLs (Prev & Next) was going to 404 ( #244 | #251 )
1405
  * Custom CSS not working in Design one (#249)
@@ -1429,7 +1434,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1429
  * Compatibility improved with AMP WooCommerce.
1430
 
1431
  = 0.9 =
1432
- * Proper Details at http://ampforwp.com/amp-pagebuilder/
1433
  * Drag & Drop Page builder Added: You can easily modify the look of the AMP page using this feature
1434
  * 100% Yoast Compatible , Now no need to have additionally Glue Installed
1435
  * 100% completed Translation panel, Now absolutely anything on page is translated
@@ -1447,7 +1452,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1447
  * SEO Panel Added
1448
 
1449
  = 0.8.8 =
1450
- * Proper Details at http://ampforwp.com/amp-0-8-8-released-translation-panel/
1451
  * Translation Panel added. You can now easily translate the AMP version from the backend without any complications.
1452
  * Badge Tag was throwing Validation error
1453
  * Plusone tag validation error was fixed
@@ -1465,7 +1470,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1465
  * Featured Image Size options added
1466
 
1467
  = 0.8.7 =
1468
- * Proper Details at http://ampforwp.com/amp-0-8-7/
1469
  * added option to enable/disable AMP on Archive pages (Ticket #188)
1470
  * Solved 404 on Related Posts (Ticket #178 )
1471
  * Related posts by either categories or Tags(Ticket #179)
@@ -1486,7 +1491,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1486
  * Few validation issues after 0.8.6 were fixed (Frontpage amp-img strip issue fixed)
1487
 
1488
  = 0.8.6 =
1489
- * Proper Details at http://ampforwp.com/amp-0-8-6-released-related-posts-comments/
1490
  * Related Posts
1491
  * Post Comments
1492
  * WhatsApp sharing button – Your visitors can now easily share the content over the whatsapp.
@@ -1505,7 +1510,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1505
  * Canonical issue fixed for FrontPage
1506
 
1507
  = 0.8.5.1 =
1508
- * Proper Details at http://ampforwp.com/new/
1509
  * Validation issue fixed: 'Value' tag
1510
  * Validation issue fixed: The attribute 'contenteditable' may not appear in tag 'a'.
1511
  * Validation issue fixed: Table markup
@@ -1516,14 +1521,14 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1516
  * NextGEN Gallery Validation Support Added
1517
 
1518
  = 0.8.5 =
1519
- * Proper Details at http://ampforwp.com/the-0-4-compatibility/
1520
  * AMP 0.4 Compatibility Check
1521
  * Even better Structured Data Validation, Once in for all!
1522
  * Structured Data Options to eliminate Validation errors
1523
  * AMP Page Exclude option
1524
 
1525
  = 0.8.4 =
1526
- * Proper Details at http://ampforwp.com/blog/structured-data-validation/
1527
  * Structured Data Validation
1528
  * Navigation Text Change
1529
  * Inline Style Validation
@@ -1536,7 +1541,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1536
  * Extra space after quote in Ads
1537
 
1538
  = 0.8.2 =
1539
- * Proper Details at http://ampforwp.com/blog/the-custom-frontpage/
1540
  * Custom AMP FrontPage
1541
  * Featured Image
1542
  * New Mobile Friendly Advertisement sizes
@@ -1556,7 +1561,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1556
  * Gaping in the smaller screens fixed
1557
 
1558
  = 0.8 =
1559
- * Proper Details at http://ampforwp.com/blog/the-change/
1560
  * 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.
1561
  * 99.5% Validation issues were fixed.
1562
  * Page builder & Shortcodes Compatibility Support Added
@@ -1571,7 +1576,7 @@ Reformatting and Minifying of stylesheet [Code Cleaning]
1571
  * Better Future Compatibility
1572
 
1573
  = 0.7.7 =
1574
- * Proper Details at http://ampforwp.com/blog/amp-0-7-7/
1575
  * Big Validation Error fix Update
1576
  * Disable AMP support on specific Pages and Posts
1577
  * Option to disable the Post meta from the Single
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 4.9.5
7
+ Stable tag: 0.9.85.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
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?](https://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://ampforwp.com/demo/) | [Screenshots](https://wordpress.org/plugins/accelerated-mobile-pages/screenshots/) | [Community](https://ampforwp.com/community/)
17
 
18
  [youtube https://www.youtube.com/watch?v=Em1nsE_KaKw]
19
 
104
  * NEW - Make AMP & Non-AMP Same with just one click!
105
  * NEW - Allows you to use AMP as primary website!
106
 
107
+ **[JOIN CHAT GROUP COMMUNITY](https://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.
108
 
109
  = Getting Started: =
110
+ **[1. User Documentation:](https://ampforwp.com/help/)** The AMP for WordPress plugin is easy to setup but we have some tutorials and guides prepared for you which will help you dive deep with the plugin.
111
 
112
  **[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.
113
 
115
 
116
  **[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.
117
 
118
+ **[5. Frequently Asked Questions:](https://ampforwp.com/faq/)** Some of the Frequently Asked questions.
119
 
120
 
121
  == Installation ==
122
+ **[Visit Help area for the Documentation:](https://ampforwp.com/help/)**
123
 
124
  [youtube https://www.youtube.com/watch?v=Em1nsE_KaKw]
125
 
126
+ **[Visit Help area for the Documentation:](https://ampforwp.com/help/)**
127
 
128
 
129
  == Frequently Asked Questions ==
163
 
164
  = How do I get in touch? =
165
 
166
+ You can contact us from [here](https://ampforwp.com/contact/)
167
 
168
 
169
  == Screenshots ==
182
 
183
  == Changelog ==
184
 
185
+ = 0.9.85.5 (21st April 2018) =
186
+ * Added: Filter added to modify frontpage post id `ampforwp_modify_frontpage_id`
187
+ * Added: Filter added to modify amp template directory `ampforwp_template_locate` #1982
188
+ * Other minor bugs fixed
189
+
190
  = 0.9.85.3 (12th April 2018) =
191
  * Added: Custom Post type Archive Page support #1995
192
  * Fixed: AMP TakeOver redirection issues #1994
1385
  * Typo in Trailingslashit function which resulted in some issues in the Homepage version [Bug Fix]
1386
 
1387
  = 0.9.1.2 [20th December 2016] =
1388
+ * Proper Details at https://ampforwp.com/new/
1389
  * DoubleClick Support
1390
  * Custom Post Type Support
1391
  * Ratings Support
1404
  * Page Performance: DNS Prefetch tag added for faster DNS Handshake
1405
 
1406
  = 0.9.1 [16th December 2016] =
1407
+ * Proper Details at https://ampforwp.com/new/
1408
  * PHP7 Compatibility
1409
  * Pagination URLs (Prev & Next) was going to 404 ( #244 | #251 )
1410
  * Custom CSS not working in Design one (#249)
1434
  * Compatibility improved with AMP WooCommerce.
1435
 
1436
  = 0.9 =
1437
+ * Proper Details at https://ampforwp.com/amp-pagebuilder/
1438
  * Drag & Drop Page builder Added: You can easily modify the look of the AMP page using this feature
1439
  * 100% Yoast Compatible , Now no need to have additionally Glue Installed
1440
  * 100% completed Translation panel, Now absolutely anything on page is translated
1452
  * SEO Panel Added
1453
 
1454
  = 0.8.8 =
1455
+ * Proper Details at https://ampforwp.com/amp-0-8-8-released-translation-panel/
1456
  * Translation Panel added. You can now easily translate the AMP version from the backend without any complications.
1457
  * Badge Tag was throwing Validation error
1458
  * Plusone tag validation error was fixed
1470
  * Featured Image Size options added
1471
 
1472
  = 0.8.7 =
1473
+ * Proper Details at https://ampforwp.com/amp-0-8-7/
1474
  * added option to enable/disable AMP on Archive pages (Ticket #188)
1475
  * Solved 404 on Related Posts (Ticket #178 )
1476
  * Related posts by either categories or Tags(Ticket #179)
1491
  * Few validation issues after 0.8.6 were fixed (Frontpage amp-img strip issue fixed)
1492
 
1493
  = 0.8.6 =
1494
+ * Proper Details at https://ampforwp.com/amp-0-8-6-released-related-posts-comments/
1495
  * Related Posts
1496
  * Post Comments
1497
  * WhatsApp sharing button – Your visitors can now easily share the content over the whatsapp.
1510
  * Canonical issue fixed for FrontPage
1511
 
1512
  = 0.8.5.1 =
1513
+ * Proper Details at https://ampforwp.com/new/
1514
  * Validation issue fixed: 'Value' tag
1515
  * Validation issue fixed: The attribute 'contenteditable' may not appear in tag 'a'.
1516
  * Validation issue fixed: Table markup
1521
  * NextGEN Gallery Validation Support Added
1522
 
1523
  = 0.8.5 =
1524
+ * Proper Details at https://ampforwp.com/the-0-4-compatibility/
1525
  * AMP 0.4 Compatibility Check
1526
  * Even better Structured Data Validation, Once in for all!
1527
  * Structured Data Options to eliminate Validation errors
1528
  * AMP Page Exclude option
1529
 
1530
  = 0.8.4 =
1531
+ * Proper Details at https://ampforwp.com/blog/structured-data-validation/
1532
  * Structured Data Validation
1533
  * Navigation Text Change
1534
  * Inline Style Validation
1541
  * Extra space after quote in Ads
1542
 
1543
  = 0.8.2 =
1544
+ * Proper Details at https://ampforwp.com/blog/the-custom-frontpage/
1545
  * Custom AMP FrontPage
1546
  * Featured Image
1547
  * New Mobile Friendly Advertisement sizes
1561
  * Gaping in the smaller screens fixed
1562
 
1563
  = 0.8 =
1564
+ * Proper Details at https://ampforwp.com/blog/the-change/
1565
  * 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.
1566
  * 99.5% Validation issues were fixed.
1567
  * Page builder & Shortcodes Compatibility Support Added
1576
  * Better Future Compatibility
1577
 
1578
  = 0.7.7 =
1579
+ * Proper Details at https://ampforwp.com/blog/amp-0-7-7/
1580
  * Big Validation Error fix Update
1581
  * Disable AMP support on specific Pages and Posts
1582
  * Option to disable the Post meta from the Single
templates/custom-amp-content.php CHANGED
@@ -11,7 +11,7 @@ function ampforwp_custom_post_content_sanitizer( $data, $post ) {
11
 
12
  global $post;
13
  $amp_current_post_id = get_the_ID();
14
- if ( ampforwp_is_front_page() && isset($redux_builder_amp['amp-frontpage-select-option-pages']) ) {
15
  //Custom AMP Editor Support for WPML #1138
16
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
17
  if ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ) {
@@ -19,7 +19,7 @@ function ampforwp_custom_post_content_sanitizer( $data, $post ) {
19
 
20
  }
21
  else {
22
- $amp_current_post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
23
  }
24
  }
25
  // Custom AMP Editor Support for Polylang #1779
@@ -131,7 +131,7 @@ function amp_content_editor_title_callback( $post ) {
131
  global $redux_builder_amp;
132
  $amp_current_post_id = $post->ID;
133
  if ( is_home() && $redux_builder_amp['amp-frontpage-select-option'] ) {
134
- $amp_current_post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
135
  }
136
 
137
  wp_nonce_field( basename( __FILE__) , 'amp_content_editor_nonce' );
11
 
12
  global $post;
13
  $amp_current_post_id = get_the_ID();
14
+ if ( ampforwp_is_front_page() && ampforwp_get_frontpage_id() ) {
15
  //Custom AMP Editor Support for WPML #1138
16
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
17
  if ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ) {
19
 
20
  }
21
  else {
22
+ $amp_current_post_id = ampforwp_get_frontpage_id();
23
  }
24
  }
25
  // Custom AMP Editor Support for Polylang #1779
131
  global $redux_builder_amp;
132
  $amp_current_post_id = $post->ID;
133
  if ( is_home() && $redux_builder_amp['amp-frontpage-select-option'] ) {
134
+ $amp_current_post_id = ampforwp_get_frontpage_id();
135
  }
136
 
137
  wp_nonce_field( basename( __FILE__) , 'amp_content_editor_nonce' );
templates/design-manager/design-1/frontpage.php CHANGED
@@ -1,9 +1,7 @@
1
  <?php global $redux_builder_amp,$wp;
2
- $post_id = '';
3
- if ( isset($redux_builder_amp['amp-frontpage-select-option-pages']) ) {
4
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
5
- }
6
- $post_id = apply_filters('ampforwp_frontpage_id', $post_id);
7
  $template = new AMP_Post_Template( $post_id );?>
8
  <!doctype html>
9
  <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $template->get( 'html_tag_attributes' ) ); ?>>
1
  <?php global $redux_builder_amp,$wp;
2
+ $post_id = '';
3
+ $post_id = ampforwp_get_frontpage_id();
4
+
 
 
5
  $template = new AMP_Post_Template( $post_id );?>
6
  <!doctype html>
7
  <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $template->get( 'html_tag_attributes' ) ); ?>>
templates/design-manager/design-2/frontpage.php CHANGED
@@ -1,9 +1,7 @@
1
  <?php global $redux_builder_amp , $wp;
2
- $post_id = '';
3
- if ( isset($redux_builder_amp['amp-frontpage-select-option-pages']) ) {
4
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
5
- }
6
- $post_id = apply_filters('ampforwp_frontpage_id', $post_id);
7
  $template = new AMP_Post_Template( $post_id );?>
8
  <!doctype html>
9
  <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $template->get( 'html_tag_attributes' ) ); ?>>
1
  <?php global $redux_builder_amp , $wp;
2
+ $post_id = '';
3
+ $post_id = ampforwp_get_frontpage_id();
4
+
 
 
5
  $template = new AMP_Post_Template( $post_id );?>
6
  <!doctype html>
7
  <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $template->get( 'html_tag_attributes' ) ); ?>>
templates/design-manager/design-3/frontpage.php CHANGED
@@ -1,9 +1,7 @@
1
  <?php global $redux_builder_amp,$wp;
2
- $post_id = '';
3
- if ( isset($redux_builder_amp['amp-frontpage-select-option-pages']) ) {
4
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
5
- }
6
- $post_id = apply_filters('ampforwp_frontpage_id', $post_id);
7
  $template = new AMP_Post_Template( $post_id );?>
8
  <!doctype html>
9
  <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $template->get( 'html_tag_attributes' ) ); ?>>
1
  <?php global $redux_builder_amp,$wp;
2
+ $post_id = '';
3
+ $post_id = ampforwp_get_frontpage_id();
4
+
 
 
5
  $template = new AMP_Post_Template( $post_id );?>
6
  <!doctype html>
7
  <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $template->get( 'html_tag_attributes' ) ); ?>>
templates/design-manager/swift/page.php CHANGED
@@ -1,4 +1,5 @@
1
- <?php amp_header(); ?>
 
2
  <div class="sp">
3
  <div <?php if(!checkAMPforPageBuilderStatus(get_the_ID())){ ?>class="cntr"<?php } ?>>
4
  <?php if(!checkAMPforPageBuilderStatus(get_the_ID())){ ?>
1
+ <?php global $redux_builder_amp;
2
+ amp_header(); ?>
3
  <div class="sp">
4
  <div <?php if(!checkAMPforPageBuilderStatus(get_the_ID())){ ?>class="cntr"<?php } ?>>
5
  <?php if(!checkAMPforPageBuilderStatus(get_the_ID())){ ?>
templates/features.php CHANGED
@@ -585,7 +585,7 @@ function ampforwp_new_dir( $dir ) {
585
  $optimize = '';
586
  $post_id = get_the_ID();
587
  if ( ampforwp_is_front_page() ) {
588
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
589
  }
590
  // If page builder is enabled then 'Return' and show no ads
591
  if ( checkAMPforPageBuilderStatus( $post_id ) ) {
@@ -653,7 +653,7 @@ function ampforwp_new_dir( $dir ) {
653
  $optimize = '';
654
  $post_id = get_the_ID();
655
  if ( ampforwp_is_front_page() ) {
656
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
657
  }
658
  // If page builder is enabled then 'Return' and show no ads
659
  if ( checkAMPforPageBuilderStatus( $post_id ) ) {
@@ -1379,7 +1379,7 @@ function ampforwp_new_dir( $dir ) {
1379
  }
1380
 
1381
  // Code for Custom Frontpage Yoast SEO Description
1382
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
1383
  if ( class_exists('WPSEO_Meta') ) {
1384
  $custom_fp_desc = WPSEO_Meta::get_value('metadesc', $post_id );
1385
  if ( is_home() && $redux_builder_amp['amp-frontpage-select-option'] ) {
@@ -2254,10 +2254,9 @@ function ampforwp_replace_title_tags() {
2254
  }
2255
 
2256
  else {
2257
- if(isset($redux_builder_amp['amp-frontpage-select-option-pages']) ) {
2258
- $ID = $redux_builder_amp['amp-frontpage-select-option-pages'];
2259
- $site_title = get_the_title( $ID ) . $sep . get_option( 'blogname' );
2260
- }
2261
  }
2262
  }
2263
  // Blog page
@@ -2269,7 +2268,7 @@ function ampforwp_replace_title_tags() {
2269
  // Custom Front Page Title From Yoast SEO #1163
2270
  if ( class_exists('WPSEO_Meta_Columns') ) {
2271
  Global $redux_builder_amp;
2272
- $ID = $redux_builder_amp['amp-frontpage-select-option-pages'];
2273
  if ( ampforwp_is_blog() ) {
2274
  $ID = ampforwp_get_blog_details('id');
2275
  }
@@ -3118,9 +3117,9 @@ function ampforwp_search_or_homepage_or_staticpage_metadata( $metadata, $post )
3118
  $structured_data_height = intval($redux_builder_amp['amp-structured-data-placeholder-image-height']); // Placeholder Image width
3119
  $structured_data_width = intval($redux_builder_amp['amp-structured-data-placeholder-image-width']); // Placeholder Image height
3120
  $current_url_in_pieces = explode( '/', $current_url );
3121
- if( ampforwp_is_front_page() && isset($redux_builder_amp['amp-frontpage-select-option-pages']) ) {
3122
  // ID of slected front page
3123
- $ID = $redux_builder_amp['amp-frontpage-select-option-pages'];
3124
  $headline = get_the_title( $ID ) . ' | ' . get_option('blogname');
3125
  $static_page_data = get_post( $ID );
3126
  $datePublished = $static_page_data->post_date;
@@ -3561,9 +3560,7 @@ function ampforwp_frontpage_comments() {
3561
  $enable_comments = false;
3562
  $post_id = "";
3563
 
3564
- if (isset($redux_builder_amp['amp-frontpage-select-option-pages']) ){
3565
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
3566
- }
3567
 
3568
  if ($data['elements'] == '') {
3569
  $data['elements'] = "meta_info:1,title:1,featured_image:1,content:1,meta_taxonomy:1,social_icons:1,comments:1,related_posts:1";
@@ -3584,8 +3581,7 @@ function ampforwp_frontpage_comments() {
3584
  $comment_button_url = "";
3585
  $postID = '';
3586
  // Gather comments for a Front from post id
3587
- if ( isset($redux_builder_amp['amp-frontpage-select-option-pages']) )
3588
- $postID = $redux_builder_amp['amp-frontpage-select-option-pages'];
3589
  $comments = get_comments(array(
3590
  'post_id' => $postID,
3591
  'status' => 'approve' //Change this to the type of comments to be displayed
@@ -3693,8 +3689,8 @@ add_action('pre_amp_render_post','ampforwp_apply_layout_builder_on_pages',20);
3693
  function ampforwp_apply_layout_builder_on_pages($post_id) {
3694
  global $redux_builder_amp;
3695
 
3696
- if ( ampforwp_is_front_page() && isset($redux_builder_amp['amp-frontpage-select-option-pages']) ) {
3697
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
3698
  }
3699
  $sidebar_check = get_post_meta( $post_id,'ampforwp_custom_sidebar_select',true);
3700
 
@@ -3778,8 +3774,8 @@ function ampforwp_builder_checker() {
3778
  if ( $post ) {
3779
  $post_id = $post->ID;
3780
  }
3781
- if ( ampforwp_is_front_page() && isset($redux_builder_amp['amp-frontpage-select-option-pages']) ) {
3782
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
3783
  }
3784
  if ( $post_id ) {
3785
  $pagebuilder_check = get_post_meta( $post_id,'ampforwp_custom_sidebar_select',true);
@@ -4260,7 +4256,7 @@ function ampforwp_generate_meta_desc(){
4260
  $post_id = get_option( 'page_on_front' );
4261
  }
4262
  else {
4263
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
4264
  }
4265
 
4266
  if ( class_exists('WPSEO_Meta') ) {
@@ -4300,8 +4296,8 @@ function ampforwp_generate_meta_desc(){
4300
  $desc = addslashes( ampforwp_translation($redux_builder_amp['amp-translator-search-text'], 'You searched for:') . ' ' . get_search_query() );
4301
  }
4302
 
4303
- if ( ampforwp_is_front_page() && isset($redux_builder_amp['amp-frontpage-select-option-pages']) ) {
4304
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
4305
  $desc = addslashes( wp_trim_words( strip_tags( get_post_field('post_content', $post_id) ) , '15' ) );
4306
  }
4307
  }
@@ -4555,8 +4551,8 @@ if (! function_exists( 'ampforwp_get_body_class' ) ) {
4555
  $classes[] = 'single-post';
4556
  }
4557
 
4558
- if ( ampforwp_is_front_page() && isset($redux_builder_amp['amp-frontpage-select-option-pages']) ) {
4559
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
4560
  }
4561
 
4562
  if ( ampforwp_is_front_page() ) {
@@ -5577,7 +5573,7 @@ function ampforwp_is_front_page(){
5577
  $get_custom_frontpage_settings = $redux_builder_amp['amp-frontpage-select-option'];
5578
 
5579
  // Frontpage id should be assigned
5580
- if ( isset($redux_builder_amp['amp-frontpage-select-option-pages']) ) {
5581
  $get_amp_custom_frontpage_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
5582
  }
5583
 
@@ -6241,7 +6237,7 @@ if ( ! function_exists('ampforwp_glue_css_comp') ) {
6241
  }
6242
 
6243
  // Filter for Frontpage id
6244
- add_filter('ampforwp_frontpage_id', 'ampforwp_modified_frontpage_id');
6245
  if( ! function_exists('ampforwp_modified_frontpage_id') ) {
6246
  function ampforwp_modified_frontpage_id($page_id){
6247
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
@@ -6342,4 +6338,21 @@ if ( ! function_exists('ampforwp_amp2wp_fb') ) {
6342
  }(document, "script", "facebook-jssdk"));</script>';
6343
  }
6344
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6345
  }
585
  $optimize = '';
586
  $post_id = get_the_ID();
587
  if ( ampforwp_is_front_page() ) {
588
+ $post_id = ampforwp_get_frontpage_id();
589
  }
590
  // If page builder is enabled then 'Return' and show no ads
591
  if ( checkAMPforPageBuilderStatus( $post_id ) ) {
653
  $optimize = '';
654
  $post_id = get_the_ID();
655
  if ( ampforwp_is_front_page() ) {
656
+ $post_id = ampforwp_get_frontpage_id();
657
  }
658
  // If page builder is enabled then 'Return' and show no ads
659
  if ( checkAMPforPageBuilderStatus( $post_id ) ) {
1379
  }
1380
 
1381
  // Code for Custom Frontpage Yoast SEO Description
1382
+ $post_id = ampforwp_get_frontpage_id();
1383
  if ( class_exists('WPSEO_Meta') ) {
1384
  $custom_fp_desc = WPSEO_Meta::get_value('metadesc', $post_id );
1385
  if ( is_home() && $redux_builder_amp['amp-frontpage-select-option'] ) {
2254
  }
2255
 
2256
  else {
2257
+ $ID = ampforwp_get_frontpage_id();
2258
+ $site_title = get_the_title( $ID ) . $sep . get_option( 'blogname' );
2259
+
 
2260
  }
2261
  }
2262
  // Blog page
2268
  // Custom Front Page Title From Yoast SEO #1163
2269
  if ( class_exists('WPSEO_Meta_Columns') ) {
2270
  Global $redux_builder_amp;
2271
+ $ID = ampforwp_get_frontpage_id();
2272
  if ( ampforwp_is_blog() ) {
2273
  $ID = ampforwp_get_blog_details('id');
2274
  }
3117
  $structured_data_height = intval($redux_builder_amp['amp-structured-data-placeholder-image-height']); // Placeholder Image width
3118
  $structured_data_width = intval($redux_builder_amp['amp-structured-data-placeholder-image-width']); // Placeholder Image height
3119
  $current_url_in_pieces = explode( '/', $current_url );
3120
+ if( ampforwp_is_front_page() ) {
3121
  // ID of slected front page
3122
+ $ID = ampforwp_get_frontpage_id();
3123
  $headline = get_the_title( $ID ) . ' | ' . get_option('blogname');
3124
  $static_page_data = get_post( $ID );
3125
  $datePublished = $static_page_data->post_date;
3560
  $enable_comments = false;
3561
  $post_id = "";
3562
 
3563
+ $post_id = ampforwp_get_frontpage_id();
 
 
3564
 
3565
  if ($data['elements'] == '') {
3566
  $data['elements'] = "meta_info:1,title:1,featured_image:1,content:1,meta_taxonomy:1,social_icons:1,comments:1,related_posts:1";
3581
  $comment_button_url = "";
3582
  $postID = '';
3583
  // Gather comments for a Front from post id
3584
+ $postID = ampforwp_get_frontpage_id();
 
3585
  $comments = get_comments(array(
3586
  'post_id' => $postID,
3587
  'status' => 'approve' //Change this to the type of comments to be displayed
3689
  function ampforwp_apply_layout_builder_on_pages($post_id) {
3690
  global $redux_builder_amp;
3691
 
3692
+ if ( ampforwp_is_front_page() ) {
3693
+ $post_id = ampforwp_get_frontpage_id();
3694
  }
3695
  $sidebar_check = get_post_meta( $post_id,'ampforwp_custom_sidebar_select',true);
3696
 
3774
  if ( $post ) {
3775
  $post_id = $post->ID;
3776
  }
3777
+ if ( ampforwp_is_front_page() ) {
3778
+ $post_id = ampforwp_get_frontpage_id();
3779
  }
3780
  if ( $post_id ) {
3781
  $pagebuilder_check = get_post_meta( $post_id,'ampforwp_custom_sidebar_select',true);
4256
  $post_id = get_option( 'page_on_front' );
4257
  }
4258
  else {
4259
+ $post_id = ampforwp_get_frontpage_id();
4260
  }
4261
 
4262
  if ( class_exists('WPSEO_Meta') ) {
4296
  $desc = addslashes( ampforwp_translation($redux_builder_amp['amp-translator-search-text'], 'You searched for:') . ' ' . get_search_query() );
4297
  }
4298
 
4299
+ if ( ampforwp_is_front_page() ) {
4300
+ $post_id = ampforwp_get_frontpage_id();
4301
  $desc = addslashes( wp_trim_words( strip_tags( get_post_field('post_content', $post_id) ) , '15' ) );
4302
  }
4303
  }
4551
  $classes[] = 'single-post';
4552
  }
4553
 
4554
+ if ( ampforwp_is_front_page() ) {
4555
+ $post_id = ampforwp_get_frontpage_id();
4556
  }
4557
 
4558
  if ( ampforwp_is_front_page() ) {
5573
  $get_custom_frontpage_settings = $redux_builder_amp['amp-frontpage-select-option'];
5574
 
5575
  // Frontpage id should be assigned
5576
+ if ( isset($redux_builder_amp['amp-frontpage-select-option-pages'])) {
5577
  $get_amp_custom_frontpage_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
5578
  }
5579
 
6237
  }
6238
 
6239
  // Filter for Frontpage id
6240
+ add_filter('ampforwp_modify_frontpage_id', 'ampforwp_modified_frontpage_id');
6241
  if( ! function_exists('ampforwp_modified_frontpage_id') ) {
6242
  function ampforwp_modified_frontpage_id($page_id){
6243
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
6338
  }(document, "script", "facebook-jssdk"));</script>';
6339
  }
6340
  }
6341
+ }
6342
+
6343
+ //Common function to get frontpageID
6344
+ function ampforwp_get_frontpage_id() {
6345
+ global $redux_builder_amp;
6346
+ $post_id = '';
6347
+
6348
+ //$post_id = get_the_ID();
6349
+ if ( ampforwp_is_front_page() && $redux_builder_amp['amp-frontpage-select-option']==1
6350
+ && isset( $redux_builder_amp['amp-frontpage-select-option'] )
6351
+ ) {
6352
+ $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
6353
+ }
6354
+
6355
+ $post_id = apply_filters('ampforwp_modify_frontpage_id', $post_id);
6356
+ return $post_id;
6357
+
6358
  }
templates/frontpage-elements.php CHANGED
@@ -208,7 +208,7 @@ function ampforwp_design_2_frontpage_title() {
208
  }
209
  if( $redux_builder_amp['ampforwp-title-on-front-page'] ) { ?>
210
  <header class="amp-wp-article-header ampforwp-title">
211
- <h1 class="amp-wp-title"><?php if( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' )){$ID = get_option('page_on_front');}else{$ID = $redux_builder_amp['amp-frontpage-select-option-pages'];}echo get_the_title( $ID );?></h1>
212
  </header>
213
 
214
  <?php }
@@ -233,7 +233,7 @@ function ampforwp_design_3_frontpage_title() {
233
 
234
  }
235
  else{
236
- $ID = $redux_builder_amp['amp-frontpage-select-option-pages'];
237
  }
238
  echo get_the_title( $ID );?></h1>
239
  </header> <?php
208
  }
209
  if( $redux_builder_amp['ampforwp-title-on-front-page'] ) { ?>
210
  <header class="amp-wp-article-header ampforwp-title">
211
+ <h1 class="amp-wp-title"><?php if( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' )){$ID = get_option('page_on_front');}else{$ID = ampforwp_get_frontpage_id();}echo get_the_title( $ID );?></h1>
212
  </header>
213
 
214
  <?php }
233
 
234
  }
235
  else{
236
+ $ID = ampforwp_get_frontpage_id();
237
  }
238
  echo get_the_title( $ID );?></h1>
239
  </header> <?php