Plugin Directory

Changeset 2436563


Ignore:
Timestamp:
12/10/2020 01:07:33 PM (5 years ago)
Author:
wonderpush
Message:

v1.6.6

Location:
wonderpush-web-push-notifications
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wonderpush-web-push-notifications/tags/1.6.6/readme.txt

    r2396191 r2436563  
    55Requires at least: 5.0
    66Tested up to: 5.5.1
    7 Stable tag: 1.6.5
     7Stable tag: 1.6.6
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8888
    8989== Changelog ==
     90= 1.6.6 =
     91- AMP: support for the standard and transitional modes of the official AMP plugin.
     92
    9093= 1.6.5 =
    9194- 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  
    4343    transform: rotate(360deg);
    4444  }
    45 }
    46 .access-token-form input[type=text] {
    47   height: 28px;
    48   margin-right: 5px;
    4945}
    5046.wonderpush-admin-page > header {
     
    114110  padding: 50px 0;
    115111}
     112.access-token-form input[type=text] {
     113  height: 28px;
     114  margin-right: 5px;
     115}
    116116.metric {
    117117  display: inline-block;
  • wonderpush-web-push-notifications/tags/1.6.6/wonderpush-admin.php

    r2396191 r2436563  
    33
    44class WonderPushAdmin {
    5   const RESOURCES_VERSION = '1.6.5';
     5  const RESOURCES_VERSION = '1.6.6';
    66  const MENU_SLUG = 'wonderpush';
    77  const META_BOX_ID = 'wonderpush_meta_box';
  • wonderpush-web-push-notifications/tags/1.6.6/wonderpush-public.php

    r2340994 r2436563  
    66  static function init() {
    77    add_action('wp_head', array(__CLASS__, 'wonderpush_snippet'), 10);
     8    add_filter( 'the_content', array(__CLASS__, 'the_content'), 10);
    89    if (WonderPushUtils::get_woocommerce()
    910        && WonderPushSettings::getSettings()->getEnableCartReminder()) {
    1011      add_action('wp_head', array(__CLASS__, 'wonderpush_cookie'), 10);
    1112    }
    12     // AMP support through plugin:
     13    // AMP support through official plugin (https://amp-wp.org/):
    1314    // https://wordpress.org/plugins/amp/
    1415    add_filter('amp_post_template_file', array(__CLASS__, 'amp_post_template_file'), 10, 3);
     
    1718//    add_filter('amp_post_template_data', array(__CLASS__, 'amp_post_template_data'), 10, 3 );
    1819
    19     // AMP support through plugin:
     20    // AMP support through alternative plugin (AMP for WP, https://ampforwp.com/):
    2021    // https://wordpress.org/plugins/accelerated-mobile-pages/
    2122    add_filter('ampforwp_after_header', array(__CLASS__, 'ampforwp_after_header'), 10, 3);
     
    8788      include WONDERPUSH_PLUGIN_PATH . '/amp/amp-web-push-widget.php';
    8889  }
     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  }
    89110  public static function wonderpush_snippet() {
    90111    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    }
    91119    $settings = WonderPushSettings::getSettings();
    92120    $access_token = $settings->getAccessToken();
  • wonderpush-web-push-notifications/tags/1.6.6/wonderpush-utils.php

    r2233734 r2436563  
    132132  }
    133133
     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
    134142  /**
    135143   * Converts a DateTime object to a string representing its date.
  • wonderpush-web-push-notifications/tags/1.6.6/wonderpush.php

    r2396191 r2436563  
    88Author: WonderPush
    99Author URI: https://www.wonderpush.com/
    10 Version: 1.6.5
     10Version: 1.6.6
    1111License: GPLv2 or later
    1212*/
  • wonderpush-web-push-notifications/trunk/readme.txt

    r2396191 r2436563  
    55Requires at least: 5.0
    66Tested up to: 5.5.1
    7 Stable tag: 1.6.5
     7Stable tag: 1.6.6
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8888
    8989== Changelog ==
     90= 1.6.6 =
     91- AMP: support for the standard and transitional modes of the official AMP plugin.
     92
    9093= 1.6.5 =
    9194- 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  
    4343    transform: rotate(360deg);
    4444  }
    45 }
    46 .access-token-form input[type=text] {
    47   height: 28px;
    48   margin-right: 5px;
    4945}
    5046.wonderpush-admin-page > header {
     
    114110  padding: 50px 0;
    115111}
     112.access-token-form input[type=text] {
     113  height: 28px;
     114  margin-right: 5px;
     115}
    116116.metric {
    117117  display: inline-block;
  • wonderpush-web-push-notifications/trunk/wonderpush-admin.php

    r2396191 r2436563  
    33
    44class WonderPushAdmin {
    5   const RESOURCES_VERSION = '1.6.5';
     5  const RESOURCES_VERSION = '1.6.6';
    66  const MENU_SLUG = 'wonderpush';
    77  const META_BOX_ID = 'wonderpush_meta_box';
  • wonderpush-web-push-notifications/trunk/wonderpush-public.php

    r2340994 r2436563  
    66  static function init() {
    77    add_action('wp_head', array(__CLASS__, 'wonderpush_snippet'), 10);
     8    add_filter( 'the_content', array(__CLASS__, 'the_content'), 10);
    89    if (WonderPushUtils::get_woocommerce()
    910        && WonderPushSettings::getSettings()->getEnableCartReminder()) {
    1011      add_action('wp_head', array(__CLASS__, 'wonderpush_cookie'), 10);
    1112    }
    12     // AMP support through plugin:
     13    // AMP support through official plugin (https://amp-wp.org/):
    1314    // https://wordpress.org/plugins/amp/
    1415    add_filter('amp_post_template_file', array(__CLASS__, 'amp_post_template_file'), 10, 3);
     
    1718//    add_filter('amp_post_template_data', array(__CLASS__, 'amp_post_template_data'), 10, 3 );
    1819
    19     // AMP support through plugin:
     20    // AMP support through alternative plugin (AMP for WP, https://ampforwp.com/):
    2021    // https://wordpress.org/plugins/accelerated-mobile-pages/
    2122    add_filter('ampforwp_after_header', array(__CLASS__, 'ampforwp_after_header'), 10, 3);
     
    8788      include WONDERPUSH_PLUGIN_PATH . '/amp/amp-web-push-widget.php';
    8889  }
     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  }
    89110  public static function wonderpush_snippet() {
    90111    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    }
    91119    $settings = WonderPushSettings::getSettings();
    92120    $access_token = $settings->getAccessToken();
  • wonderpush-web-push-notifications/trunk/wonderpush-utils.php

    r2233734 r2436563  
    132132  }
    133133
     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
    134142  /**
    135143   * Converts a DateTime object to a string representing its date.
  • wonderpush-web-push-notifications/trunk/wonderpush.php

    r2396191 r2436563  
    88Author: WonderPush
    99Author URI: https://www.wonderpush.com/
    10 Version: 1.6.5
     10Version: 1.6.6
    1111License: GPLv2 or later
    1212*/
Note: See TracChangeset for help on using the changeset viewer.