Plugin Directory

Changeset 2749139


Ignore:
Timestamp:
06/28/2022 01:42:11 PM (4 years ago)
Author:
chirpyweb
Message:

Revenue API changes

Location:
chirpyweb
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • chirpyweb/tags/1.2/includes/class-chirpyweb-init.php

    r2748450 r2749139  
    404404        $wpurl    = get_bloginfo( 'wpurl' );
    405405        $settings = get_option( 'cw-settings' );
     406        if( !empty( $settings ) ) {
    406407        $tokan    = $settings['token'];
     408        }
    407409        global  $woocommerce;
    408         $currency = get_woocommerce_currency_symbol();
     410        $currency = get_option('woocommerce_currency');
    409411        if ( ( ! empty( $settings['token'] ) ) ) {
    410412            if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
     
    499501                $response_code = json_decode( wp_remote_retrieve_body( $response ) );
    500502               
    501                 echo '<pre>';
    502                 print_r($response);
    503                 echo '</pre>';
    504503                $price_drop    = $response_code->is_price_drop;
    505504                $back_in_stock = $response_code->is_back_in_stock;
     
    591590            $tokan         = $settings['token'];
    592591            $cart_url      = wc_get_cart_url();
    593             $sub_id        = sanitize_text_field( $_COOKIE['subscription_id'] ); // phpcs:ignore
     592            if ( isset( $_COOKIE['subscription_id'] ) ) {
     593            $sub_id        = sanitize_text_field( $_COOKIE['subscription_id'] );
     594             // phpcs:ignore
     595            }
    594596        if ( empty( $cart_session ) ) {
    595597            $cart_session = WC()->session->set( 'cw_cart_token', bin2hex( random_bytes( 20 ) ) );
     
    699701         */
    700702        public function chirpyweb_revenue_cookie() {
    701             $alert = sanitize_text_field( ! empty( isset( $_GET['alert'] ) ) );
    702             $id    = sanitize_text_field( ! empty( isset( $_GET['id'] ) ) );
     703            if( isset( $_GET['alert'] ) ) {
     704            $alert = $_GET['alert'];
     705            }
     706            if( isset( $_GET['id'] ) ) {
     707            $id  = $_GET['id'];
     708            }
    703709            if ( isset( $alert ) && isset( $id ) ) {
    704710                if ( ! isset( $_COOKIE['cw_revenue_alert'] ) && ! isset( $_COOKIE['cw_revenue_id'] ) && !empty( $alert ) && !empty( $id ) ) {
  • chirpyweb/tags/1.2/readme.txt

    r2748488 r2749139  
    44Tags: Web Push Notifications, Owned audience marketing, Chrome Push Notifications, Mobile Web Notifications, Chrome, Firefox, Safari, Opera, Edge, Firefox push notifications, Notification drip, Safari push notifications, Web Push, Chrome push, Desktop Push Notifications, iZooto, Android Chrome Notifications, OneSignal, GoRoost, Wordpress Notifications, Blog Notifications, RSS Feed, Email Notifications, Subscribers, Subscription, Personalization, User Profiling, Geo-targetting, Segmentation,Abandoned Cart Notifications,Price Drop Notifications,Back In Stock Notifications,
    55Shipping Notifications
    6 Tested up to: 5.9
     6Tested up to: 6.0
    77Stable tag: 1.2
    88License: GPLv2 or later
  • chirpyweb/trunk/includes/class-chirpyweb-init.php

    r2748450 r2749139  
    404404        $wpurl    = get_bloginfo( 'wpurl' );
    405405        $settings = get_option( 'cw-settings' );
     406        if( !empty( $settings ) ) {
    406407        $tokan    = $settings['token'];
     408        }
    407409        global  $woocommerce;
    408         $currency = get_woocommerce_currency_symbol();
     410        $currency = get_option('woocommerce_currency');
    409411        if ( ( ! empty( $settings['token'] ) ) ) {
    410412            if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
     
    499501                $response_code = json_decode( wp_remote_retrieve_body( $response ) );
    500502               
    501                 echo '<pre>';
    502                 print_r($response);
    503                 echo '</pre>';
    504503                $price_drop    = $response_code->is_price_drop;
    505504                $back_in_stock = $response_code->is_back_in_stock;
     
    591590            $tokan         = $settings['token'];
    592591            $cart_url      = wc_get_cart_url();
    593             $sub_id        = sanitize_text_field( $_COOKIE['subscription_id'] ); // phpcs:ignore
     592            if ( isset( $_COOKIE['subscription_id'] ) ) {
     593            $sub_id        = sanitize_text_field( $_COOKIE['subscription_id'] );
     594             // phpcs:ignore
     595            }
    594596        if ( empty( $cart_session ) ) {
    595597            $cart_session = WC()->session->set( 'cw_cart_token', bin2hex( random_bytes( 20 ) ) );
     
    699701         */
    700702        public function chirpyweb_revenue_cookie() {
    701             $alert = sanitize_text_field( ! empty( isset( $_GET['alert'] ) ) );
    702             $id    = sanitize_text_field( ! empty( isset( $_GET['id'] ) ) );
     703            if( isset( $_GET['alert'] ) ) {
     704            $alert = $_GET['alert'];
     705            }
     706            if( isset( $_GET['id'] ) ) {
     707            $id  = $_GET['id'];
     708            }
    703709            if ( isset( $alert ) && isset( $id ) ) {
    704710                if ( ! isset( $_COOKIE['cw_revenue_alert'] ) && ! isset( $_COOKIE['cw_revenue_id'] ) && !empty( $alert ) && !empty( $id ) ) {
  • chirpyweb/trunk/readme.txt

    r2748488 r2749139  
    44Tags: Web Push Notifications, Owned audience marketing, Chrome Push Notifications, Mobile Web Notifications, Chrome, Firefox, Safari, Opera, Edge, Firefox push notifications, Notification drip, Safari push notifications, Web Push, Chrome push, Desktop Push Notifications, iZooto, Android Chrome Notifications, OneSignal, GoRoost, Wordpress Notifications, Blog Notifications, RSS Feed, Email Notifications, Subscribers, Subscription, Personalization, User Profiling, Geo-targetting, Segmentation,Abandoned Cart Notifications,Price Drop Notifications,Back In Stock Notifications,
    55Shipping Notifications
    6 Tested up to: 5.9
     6Tested up to: 6.0
    77Stable tag: 1.2
    88License: GPLv2 or later
Note: See TracChangeset for help on using the changeset viewer.