├── .gitignore
├── LICENSE
├── README.md
├── assets
└── images
│ ├── better-amp-symbol.svg
│ └── publisher-ad.jpg
├── better-amp.php
├── bootstrap.php
├── gulpfile.js
├── includes
├── backend
│ └── index.php
├── classes
│ ├── Fastimage.php
│ ├── class-better-amp-backend-util.php
│ ├── class-better-amp-component-base.php
│ ├── class-better-amp-component.php
│ ├── class-better-amp-content-sanitizer.php
│ ├── class-better-amp-custom-script.php
│ ├── class-better-amp-html-util.php
│ ├── class-better-amp-menu-walker.php
│ ├── class-better-amp-plugin-compatibility.php
│ ├── class-better-amp-redirect-router.php
│ ├── class-better-amp-rewrite-rule-generator.php
│ ├── class-better-amp-scripts.php
│ ├── class-better-amp-styles.php
│ ├── index.php
│ └── interface-better-amp-component.php
├── components
│ ├── class-better-amp-carousel-component.php
│ ├── class-better-amp-iframe-component.php
│ ├── class-better-amp-img-component.php
│ ├── class-better-amp-instagram-component.php
│ ├── class-better-amp-playbuzz-component.php
│ └── index.php
├── default-filters.php
├── functions
│ ├── ad-function.php
│ ├── core-functions.php
│ ├── index.php
│ ├── theme-functions.php
│ └── utility-function.php
├── index.php
├── libs
│ └── class-bf-json-ld-generator.php
├── panel
│ ├── assets
│ │ ├── font-awesome.min.css
│ │ ├── fonts
│ │ │ ├── fontawesome-webfont.eot
│ │ │ ├── fontawesome-webfont.svg
│ │ │ ├── fontawesome-webfont.ttf
│ │ │ ├── fontawesome-webfont.woff
│ │ │ └── fontawesome-webfont.woff2
│ │ ├── panel-scripts.js
│ │ └── panel-styles.css
│ ├── class-better-amp-panel-render.php
│ ├── class-better-amp-panel.php
│ ├── fields
│ │ ├── container.php
│ │ ├── group_end.php
│ │ ├── group_start.php
│ │ └── text.php
│ └── panel-view.php
├── sanitizer-rules.php
└── tags-list.php
├── index.php
├── js
├── mobile_redirect.js
└── mobile_redirect.min.js
├── languages
└── index.php
├── package.json
├── phpunit.xml
├── readme.txt
├── screenshot-1.png
├── screenshot-2.png
├── screenshot-3.png
├── screenshot-4.png
├── screenshot-5.png
├── template
├── 404.php
├── archive-product.php
├── archive.php
├── attachment.php
├── comment-item.php
├── css
│ ├── 404.css
│ ├── 404.min.css
│ ├── 404.rtl.css
│ ├── 404.rtl.min.css
│ ├── ads.css
│ ├── ads.min.css
│ ├── ads.rtl.css
│ ├── ads.rtl.min.css
│ ├── archive.css
│ ├── archive.min.css
│ ├── archive.rtl.css
│ ├── archive.rtl.min.css
│ ├── attachment.css
│ ├── attachment.min.css
│ ├── attachment.rtl.css
│ ├── attachment.rtl.min.css
│ ├── block
│ │ ├── button.css
│ │ ├── button.min.css
│ │ ├── button.rtl.css
│ │ ├── button.rtl.min.css
│ │ ├── columns.css
│ │ ├── columns.min.css
│ │ ├── columns.rtl.css
│ │ ├── columns.rtl.min.css
│ │ ├── cover.css
│ │ ├── cover.min.css
│ │ ├── cover.rtl.css
│ │ ├── cover.rtl.min.css
│ │ ├── file.css
│ │ ├── file.min.css
│ │ ├── file.rtl.css
│ │ ├── file.rtl.min.css
│ │ ├── gallery.css
│ │ ├── gallery.min.css
│ │ ├── gallery.rtl.css
│ │ ├── gallery.rtl.min.css
│ │ ├── image.css
│ │ ├── image.min.css
│ │ ├── image.rtl.css
│ │ ├── image.rtl.min.css
│ │ ├── latest-comments.css
│ │ ├── latest-comments.min.css
│ │ ├── latest-comments.rtl.css
│ │ ├── latest-comments.rtl.min.css
│ │ ├── list.css
│ │ ├── list.min.css
│ │ ├── list.rtl.css
│ │ ├── list.rtl.min.css
│ │ ├── quote.css
│ │ ├── quote.min.css
│ │ ├── quote.rtl.css
│ │ ├── quote.rtl.min.css
│ │ ├── separator.css
│ │ ├── separator.min.css
│ │ ├── separator.rtl.css
│ │ ├── separator.rtl.min.css
│ │ ├── table.css
│ │ ├── table.min.css
│ │ ├── table.rtl.css
│ │ ├── table.rtl.min.css
│ │ ├── verse.css
│ │ ├── verse.min.css
│ │ ├── verse.rtl.css
│ │ └── verse.rtl.min.css
│ ├── listing-1.css
│ ├── listing-1.min.css
│ ├── listing-1.rtl.css
│ ├── listing-1.rtl.min.css
│ ├── listing-2.css
│ ├── listing-2.min.css
│ ├── listing-2.rtl.css
│ ├── listing-2.rtl.min.css
│ ├── listing-grid.css
│ ├── listing-grid.min.css
│ ├── listing-grid.rtl.css
│ ├── listing-grid.rtl.min.css
│ ├── listing.css
│ ├── listing.min.css
│ ├── listing.rtl.css
│ ├── listing.rtl.min.css
│ ├── normalize.css
│ ├── normalize.min.css
│ ├── normalize.rtl.css
│ ├── normalize.rtl.min.css
│ ├── page.css
│ ├── page.min.css
│ ├── page.rtl.css
│ ├── page.rtl.min.css
│ ├── pagination.css
│ ├── pagination.min.css
│ ├── pagination.rtl.css
│ ├── pagination.rtl.min.css
│ ├── post-terms.css
│ ├── post-terms.min.css
│ ├── post-terms.rtl.css
│ ├── post-terms.rtl.min.css
│ ├── post.css
│ ├── post.min.css
│ ├── post.rtl.css
│ ├── post.rtl.min.css
│ ├── search.css
│ ├── search.min.css
│ ├── search.rtl.css
│ ├── search.rtl.min.css
│ ├── sidebar.css
│ ├── sidebar.min.css
│ ├── sidebar.rtl.css
│ ├── sidebar.rtl.min.css
│ ├── single.css
│ ├── single.min.css
│ ├── single.rtl.css
│ ├── single.rtl.min.css
│ ├── slider.css
│ ├── slider.min.css
│ ├── slider.rtl.css
│ ├── slider.rtl.min.css
│ ├── social-list.css
│ ├── social-list.min.css
│ ├── social-list.rtl.css
│ ├── social-list.rtl.min.css
│ ├── wc-cart.css
│ ├── wc-cart.min.css
│ ├── wc-cart.rtl.css
│ ├── wc-cart.rtl.min.css
│ ├── wc-single.css
│ ├── wc-single.min.css
│ ├── wc-single.rtl.css
│ ├── wc-single.rtl.min.css
│ ├── wc.css
│ ├── wc.min.css
│ ├── wc.rtl.css
│ └── wc.rtl.min.css
├── customizer
│ ├── class-amp-customize-controls.php
│ ├── class-amp-customize-social-sorter-control.php
│ ├── css
│ │ ├── bs-switch.css
│ │ ├── bs-switch.min.css
│ │ ├── index.php
│ │ ├── sorter-checkbox.css
│ │ └── sorter-checkbox.min.css
│ ├── customize-preview.js
│ ├── customizer.css
│ ├── customizer.js
│ ├── customizer.min.css
│ ├── customizer.php
│ ├── index.php
│ └── js
│ │ ├── bs-switch.js
│ │ ├── index.php
│ │ └── sorter-checkbox.js
├── footer.php
├── functions.php
├── header.php
├── includes
│ └── ads.php
├── index.php
├── page.php
├── register-template.php
├── sass
│ ├── 404.scss
│ ├── ads.scss
│ ├── archive.scss
│ ├── attachment.scss
│ ├── block
│ │ ├── button.scss
│ │ ├── columns.scss
│ │ ├── cover.scss
│ │ ├── file.scss
│ │ ├── gallery.scss
│ │ ├── image.scss
│ │ ├── latest-comments.scss
│ │ ├── list.scss
│ │ ├── quote.scss
│ │ ├── separator.scss
│ │ ├── table.scss
│ │ └── verse.scss
│ ├── listing-1.scss
│ ├── listing-2.scss
│ ├── listing-grid.scss
│ ├── listing.scss
│ ├── normalize.scss
│ ├── page.scss
│ ├── pagination.scss
│ ├── post-terms.scss
│ ├── post.scss
│ ├── search.scss
│ ├── sidebar.scss
│ ├── single.scss
│ ├── slider.scss
│ ├── social-list.scss
│ ├── style.scss
│ ├── wc-cart.scss
│ ├── wc-single.scss
│ └── wc.scss
├── search.php
├── searchform.php
├── sidebar.php
├── single-product-reviews.php
├── single-product.php
├── single.php
├── style.css
├── style.min.css
├── style.rtl.css
├── style.rtl.min.css
├── taxonomy-product_cat.php
├── taxonomy-product_tag.php
├── views
│ ├── archive
│ │ ├── pagination.php
│ │ └── title.php
│ ├── home
│ │ └── featured.php
│ ├── loop
│ │ ├── listing-1.php
│ │ └── listing-2.php
│ ├── misc
│ │ └── social-links.php
│ └── post
│ │ ├── related.php
│ │ └── social-share.php
├── woocommerce.php
└── woocommerce
│ ├── cart
│ └── cart.php
│ ├── loop.php
│ ├── notices
│ └── success.php
│ └── single-product
│ └── review-rating.php
├── tests
├── bootstrap.php
├── class-amp-testcase.php
├── index.php
└── url-transformer
│ ├── test-end-point.php
│ └── test-start-point.php
└── theme-compat
├── index.php
├── no-template.php
├── searchform.php
└── shortcodes
├── amp-slider.php
├── gallery.php
└── index.php
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .idea/
3 | workspace.xml
4 | modules.xml
5 |
6 | /vendor/
7 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Better AMP
2 | Full Google AMP support for WordPress with custom themes and customizations -
3 |
4 | More information: https://betterstudio.com/wp-plugins/better-amp/
5 |
6 | Demo: http://demo.betterstudio.com/publisher/amp-demo/
7 |
--------------------------------------------------------------------------------
/assets/images/better-amp-symbol.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/assets/images/publisher-ad.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/better-studio/better-amp/727ee783f88f7dea328161c6a4c11a2d246b2c65/assets/images/publisher-ad.jpg
--------------------------------------------------------------------------------
/bootstrap.php:
--------------------------------------------------------------------------------
1 | tag
25 | * scripts list should added in config method
26 | * @see Better_AMP_Component_Interface::config documentation
27 | *
28 | * IF( false )
29 | * The scripts will not append into theme head
30 | *
31 | * @since 1.0.0
32 | *
33 | * @var bool
34 | */
35 | public $enable_enqueue_scripts = FALSE;
36 |
37 |
38 | /**
39 | * Retrieve the content of the highest priority amp template file that exists.
40 | *
41 | * @param array|string $template_names
42 | * @param array $props
43 | * @param bool $load If true the template file will be loaded if it is found.
44 | * @param bool $require_once Whether to require_once or require. Default true. Has no effect if $load is
45 | * false.
46 | *
47 | * @since 1.0.0
48 | *
49 | * @return string file content
50 | */
51 | protected function locate_template( $template_names, $props = array(), $load = TRUE, $require_once = TRUE ) {
52 |
53 | ob_start();
54 |
55 | better_amp_set_prop( get_class( $this ), $props );
56 |
57 | better_amp_locate_template( $template_names, $load, $require_once );
58 |
59 | return ob_get_clean();
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/includes/classes/class-better-amp-scripts.php:
--------------------------------------------------------------------------------
1 | registered[ $handle ] ) ) {
31 | return FALSE;
32 | }
33 |
34 | $this->registered[ $handle ] = new _WP_Dependency( $handle, $src, $deps, '', $args );
35 |
36 | return TRUE;
37 | }
38 |
39 |
40 | /**
41 | * Determines script dependencies.
42 | *
43 | * @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).
44 | * @param bool $recursion Internal flag that function is calling itself.
45 | * @param bool|false|int $group Optional. Group level: (int) level, (false) no groups. Default false.
46 | *
47 | * @since 1.2.1
48 | * @return bool True on success, false on failure.
49 | */
50 | public function all_deps( $handles, $recursion = FALSE, $group = FALSE ) {
51 | return WP_Dependencies::all_deps( $handles, $recursion, $group );
52 | }
53 | }
54 |
55 |
56 | add_filter( 'script_loader_tag', 'better_amp_handle_scripts_tag_attrs', 99, 2 );
57 |
58 | /**
59 | * @param $tag The `
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |