Changeset 2436563
- Timestamp:
- 12/10/2020 01:07:33 PM (5 years ago)
- Location:
- wonderpush-web-push-notifications
- Files:
-
- 12 edited
- 1 copied
-
tags/1.6.6 (copied) (copied from wonderpush-web-push-notifications/trunk)
-
tags/1.6.6/readme.txt (modified) (2 diffs)
-
tags/1.6.6/wonderpush-admin-page.css (modified) (2 diffs)
-
tags/1.6.6/wonderpush-admin.php (modified) (1 diff)
-
tags/1.6.6/wonderpush-public.php (modified) (3 diffs)
-
tags/1.6.6/wonderpush-utils.php (modified) (1 diff)
-
tags/1.6.6/wonderpush.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wonderpush-admin-page.css (modified) (2 diffs)
-
trunk/wonderpush-admin.php (modified) (1 diff)
-
trunk/wonderpush-public.php (modified) (3 diffs)
-
trunk/wonderpush-utils.php (modified) (1 diff)
-
trunk/wonderpush.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wonderpush-web-push-notifications/tags/1.6.6/readme.txt
r2396191 r2436563 5 5 Requires at least: 5.0 6 6 Tested up to: 5.5.1 7 Stable tag: 1.6. 57 Stable tag: 1.6.6 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 88 88 89 89 == Changelog == 90 = 1.6.6 = 91 - AMP: support for the standard and transitional modes of the official AMP plugin. 92 90 93 = 1.6.5 = 91 94 - WooCommerce: Send a WonderPush event when users place an order and visit the thank-you page. -
wonderpush-web-push-notifications/tags/1.6.6/wonderpush-admin-page.css
r2396191 r2436563 43 43 transform: rotate(360deg); 44 44 } 45 }46 .access-token-form input[type=text] {47 height: 28px;48 margin-right: 5px;49 45 } 50 46 .wonderpush-admin-page > header { … … 114 110 padding: 50px 0; 115 111 } 112 .access-token-form input[type=text] { 113 height: 28px; 114 margin-right: 5px; 115 } 116 116 .metric { 117 117 display: inline-block; -
wonderpush-web-push-notifications/tags/1.6.6/wonderpush-admin.php
r2396191 r2436563 3 3 4 4 class WonderPushAdmin { 5 const RESOURCES_VERSION = '1.6. 5';5 const RESOURCES_VERSION = '1.6.6'; 6 6 const MENU_SLUG = 'wonderpush'; 7 7 const META_BOX_ID = 'wonderpush_meta_box'; -
wonderpush-web-push-notifications/tags/1.6.6/wonderpush-public.php
r2340994 r2436563 6 6 static function init() { 7 7 add_action('wp_head', array(__CLASS__, 'wonderpush_snippet'), 10); 8 add_filter( 'the_content', array(__CLASS__, 'the_content'), 10); 8 9 if (WonderPushUtils::get_woocommerce() 9 10 && WonderPushSettings::getSettings()->getEnableCartReminder()) { 10 11 add_action('wp_head', array(__CLASS__, 'wonderpush_cookie'), 10); 11 12 } 12 // AMP support through plugin:13 // AMP support through official plugin (https://amp-wp.org/): 13 14 // https://wordpress.org/plugins/amp/ 14 15 add_filter('amp_post_template_file', array(__CLASS__, 'amp_post_template_file'), 10, 3); … … 17 18 // add_filter('amp_post_template_data', array(__CLASS__, 'amp_post_template_data'), 10, 3 ); 18 19 19 // AMP support through plugin:20 // AMP support through alternative plugin (AMP for WP, https://ampforwp.com/): 20 21 // https://wordpress.org/plugins/accelerated-mobile-pages/ 21 22 add_filter('ampforwp_after_header', array(__CLASS__, 'ampforwp_after_header'), 10, 3); … … 87 88 include WONDERPUSH_PLUGIN_PATH . '/amp/amp-web-push-widget.php'; 88 89 } 90 public static function the_content($content) { 91 // Only single post, attachment, page, custom post types 92 if ( 93 is_main_query() 94 && in_the_loop() 95 && is_singular() // post, attachment, page, custom post types 96 ) { 97 if (WonderPushUtils::is_amp_request()) { 98 $disableTop = WonderPushSettings::getSettings()->getDisableAmpTopSubscribeButton(); 99 $disableBottom = WonderPushSettings::getSettings()->getDisableAmpBottomSubscribeButton(); 100 if ($disableBottom && $disableTop) return $content; 101 ob_start(); 102 include WONDERPUSH_PLUGIN_PATH . '/amp/amp-web-push-widget.php'; 103 $file_content = ob_get_clean(); 104 return ($disableTop ? '' : $file_content) . $content . ($disableBottom ? '' : $file_content); 105 } 106 } 107 108 return $content; 109 } 89 110 public static function wonderpush_snippet() { 90 111 if (!WonderPushUtils::is_wonderpush_installed()) return; 112 if (WonderPushUtils::is_amp_request()) { 113 echo '<style>'; 114 include WONDERPUSH_PLUGIN_PATH . '/amp/style.php'; 115 echo '</style>'; 116 include WONDERPUSH_PLUGIN_PATH . '/amp/amp-web-push.php'; 117 return; 118 } 91 119 $settings = WonderPushSettings::getSettings(); 92 120 $access_token = $settings->getAccessToken(); -
wonderpush-web-push-notifications/tags/1.6.6/wonderpush-utils.php
r2233734 r2436563 132 132 } 133 133 134 public static function is_amp_request() { 135 if (function_exists('amp_is_request')) { 136 return amp_is_request(); 137 } 138 return false; 139 } 140 141 134 142 /** 135 143 * Converts a DateTime object to a string representing its date. -
wonderpush-web-push-notifications/tags/1.6.6/wonderpush.php
r2396191 r2436563 8 8 Author: WonderPush 9 9 Author URI: https://www.wonderpush.com/ 10 Version: 1.6. 510 Version: 1.6.6 11 11 License: GPLv2 or later 12 12 */ -
wonderpush-web-push-notifications/trunk/readme.txt
r2396191 r2436563 5 5 Requires at least: 5.0 6 6 Tested up to: 5.5.1 7 Stable tag: 1.6. 57 Stable tag: 1.6.6 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 88 88 89 89 == Changelog == 90 = 1.6.6 = 91 - AMP: support for the standard and transitional modes of the official AMP plugin. 92 90 93 = 1.6.5 = 91 94 - WooCommerce: Send a WonderPush event when users place an order and visit the thank-you page. -
wonderpush-web-push-notifications/trunk/wonderpush-admin-page.css
r2396191 r2436563 43 43 transform: rotate(360deg); 44 44 } 45 }46 .access-token-form input[type=text] {47 height: 28px;48 margin-right: 5px;49 45 } 50 46 .wonderpush-admin-page > header { … … 114 110 padding: 50px 0; 115 111 } 112 .access-token-form input[type=text] { 113 height: 28px; 114 margin-right: 5px; 115 } 116 116 .metric { 117 117 display: inline-block; -
wonderpush-web-push-notifications/trunk/wonderpush-admin.php
r2396191 r2436563 3 3 4 4 class WonderPushAdmin { 5 const RESOURCES_VERSION = '1.6. 5';5 const RESOURCES_VERSION = '1.6.6'; 6 6 const MENU_SLUG = 'wonderpush'; 7 7 const META_BOX_ID = 'wonderpush_meta_box'; -
wonderpush-web-push-notifications/trunk/wonderpush-public.php
r2340994 r2436563 6 6 static function init() { 7 7 add_action('wp_head', array(__CLASS__, 'wonderpush_snippet'), 10); 8 add_filter( 'the_content', array(__CLASS__, 'the_content'), 10); 8 9 if (WonderPushUtils::get_woocommerce() 9 10 && WonderPushSettings::getSettings()->getEnableCartReminder()) { 10 11 add_action('wp_head', array(__CLASS__, 'wonderpush_cookie'), 10); 11 12 } 12 // AMP support through plugin:13 // AMP support through official plugin (https://amp-wp.org/): 13 14 // https://wordpress.org/plugins/amp/ 14 15 add_filter('amp_post_template_file', array(__CLASS__, 'amp_post_template_file'), 10, 3); … … 17 18 // add_filter('amp_post_template_data', array(__CLASS__, 'amp_post_template_data'), 10, 3 ); 18 19 19 // AMP support through plugin:20 // AMP support through alternative plugin (AMP for WP, https://ampforwp.com/): 20 21 // https://wordpress.org/plugins/accelerated-mobile-pages/ 21 22 add_filter('ampforwp_after_header', array(__CLASS__, 'ampforwp_after_header'), 10, 3); … … 87 88 include WONDERPUSH_PLUGIN_PATH . '/amp/amp-web-push-widget.php'; 88 89 } 90 public static function the_content($content) { 91 // Only single post, attachment, page, custom post types 92 if ( 93 is_main_query() 94 && in_the_loop() 95 && is_singular() // post, attachment, page, custom post types 96 ) { 97 if (WonderPushUtils::is_amp_request()) { 98 $disableTop = WonderPushSettings::getSettings()->getDisableAmpTopSubscribeButton(); 99 $disableBottom = WonderPushSettings::getSettings()->getDisableAmpBottomSubscribeButton(); 100 if ($disableBottom && $disableTop) return $content; 101 ob_start(); 102 include WONDERPUSH_PLUGIN_PATH . '/amp/amp-web-push-widget.php'; 103 $file_content = ob_get_clean(); 104 return ($disableTop ? '' : $file_content) . $content . ($disableBottom ? '' : $file_content); 105 } 106 } 107 108 return $content; 109 } 89 110 public static function wonderpush_snippet() { 90 111 if (!WonderPushUtils::is_wonderpush_installed()) return; 112 if (WonderPushUtils::is_amp_request()) { 113 echo '<style>'; 114 include WONDERPUSH_PLUGIN_PATH . '/amp/style.php'; 115 echo '</style>'; 116 include WONDERPUSH_PLUGIN_PATH . '/amp/amp-web-push.php'; 117 return; 118 } 91 119 $settings = WonderPushSettings::getSettings(); 92 120 $access_token = $settings->getAccessToken(); -
wonderpush-web-push-notifications/trunk/wonderpush-utils.php
r2233734 r2436563 132 132 } 133 133 134 public static function is_amp_request() { 135 if (function_exists('amp_is_request')) { 136 return amp_is_request(); 137 } 138 return false; 139 } 140 141 134 142 /** 135 143 * Converts a DateTime object to a string representing its date. -
wonderpush-web-push-notifications/trunk/wonderpush.php
r2396191 r2436563 8 8 Author: WonderPush 9 9 Author URI: https://www.wonderpush.com/ 10 Version: 1.6. 510 Version: 1.6.6 11 11 License: GPLv2 or later 12 12 */
Note: See TracChangeset
for help on using the changeset viewer.