Plugin Directory

Changeset 1987816


Ignore:
Timestamp:
12/07/2018 12:15:42 PM (7 years ago)
Author:
snappic
Message:

Fix version numbers

Location:
snappic
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • snappic/tags/1.1/includes/class-snappic-helper.php

    r1817427 r1987816  
    174174     */
    175175    public function get_api_url($bypassSandbox = false) {
    176         return add_query_arg('domain', $this->get_site_domain(), $this->get_api_host($bypassSandbox) . '/stores/current');
     176        return add_query_arg('domain', $this->get_site_domain(), $this->get_api_host($bypassSandbox) . '/admin_frontend/stores/current');
    177177    }
    178178
     
    209209    public function get_signup_url($plan = '') {
    210210        $settings = Snappic_Integration::instance();
     211
     212        // Check if API keys are correctly set.
     213        $settings->check_api_keys();
     214
    211215        $consumerKey = $settings->get_option('cust_key');
    212216        $consumerSecret = $settings->get_option('cust_secret');
  • snappic/tags/1.1/includes/class-snappic-integration.php

    r1715114 r1987816  
    2424
    2525        self::$_instance = $this;
     26    }
     27
     28    /**
     29     * Checks if API keys are set correctly. Otherwise regenerate new ones.
     30     *
     31     * @since  1.0.0
     32     */
     33    public function check_api_keys() {
     34        if ($this->get_option('cust_key') && $this->get_option('cust_secret')) {
     35            return;
     36        }
     37
     38        $this->set_api_keys();
     39    }
     40
     41    /**
     42     * Generate API keys and stored them in our own settings.
     43     *
     44     * @since  1.0.0
     45     */
     46    public function set_api_keys() {
     47        update_option( 'woocommerce_api_enabled', 'yes' );
     48
     49        include_once( 'class-snappic-auth.php' );
     50        $snappicAuth = new Snappic_Auth();
     51        $helper = Snappic_Helper::get_instance();
     52        $domain = $helper->get_site_domain();
     53        $result = $snappicAuth->generate_keys( __( 'Snappic', 'snappic-for-woocommerce' ), $domain, 'read' );
     54
     55        if( ! is_wp_error( $result ) && !empty($result['key_id']) && !empty($result['consumer_key']) && !empty($result['consumer_secret']) ) {
     56
     57            $updated_options = array(
     58                'key_id' => $result['key_id'],
     59                'cust_key' => $result['consumer_key'],
     60                'cust_secret'   => $result['consumer_secret'],
     61                'cleanup'   => 'yes'
     62            );
     63
     64            $helper->update_options( $updated_options );
     65            $this->init_settings();
     66        }
    2667    }
    2768
  • snappic/tags/1.1/languages/snappic-for-woocommerce.pot

    r1874793 r1987816  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Snappic for WooCommerce 1.0.7\n"
     5"Project-Id-Version: Snappic for WooCommerce 1.1.0\n"
    66"Report-Msgid-Bugs-To: "
    77"https://wordpress.org/support/plugin/snappic-for-woocommerce\n"
  • snappic/tags/1.1/readme.md

    r1715114 r1987816  
    1 # Snappic for WooCommerce #
    2 **Contributors:** [Snappic](https://profiles.wordpress.org/Snappic) 
    3 **Tags:** woocommerce, snappic, retargeting   
    4 **Requires at least:** 4.7 
    5 **Tested up to:** 4.8 
    6 **Stable tag:** 1.0.0-RC-2 
    7 **License:** GPLv3     
    8 **License URI:** http://www.gnu.org/licenses/gpl-3.0.html     
    9 **WC requires at least:** 3.0.0     
    10 **WC tested up to:** 3.1.1   
     1# Snappic for WooCommerce
    112
    12 Insert Snappic tracking pixel into relevant pages
    13 
    14 ## Description ##
    15 
    16 We analyze each of your visitors, the products they looked at, and learn what they like. Next time they’re browsing Instagram or Facebook they’ll see a highly relevant ad specifically tailored to what they were looking at and other product recommendations.
    17 
    18 ### Known Limitations ###
    19 
    20 * Works with WooCommmerce 3.0 and up
    21 
    22 ## Installation ##
    23 1. Upload 'snappic-for-woocommerce' to the '/wp-content/plugins/' directory
    24 1. Activate the plugin through the 'Plugins' menu in WordPress
    25 1. Add your Snappic API key to WooCommerce->Settings->Integration->Integration tab
    26 1. Enable shipping rate calculation in WooCommerce->Settings->Shipping->Snappic Shipping tab
    27 
    28 ## Frequently Asked Questions ##
    29 
    30 ### How do I get Snappic API key? ###
    31 
    32 
    33 
    34 ## Screenshots ##
    35 
    36 1. Plugin settings dialog
    37 
    38 ## Upgrade Notice ##
    39 
    40 
    41 ### 1.0 ###
    42 * First release
    43 
    44 ## Terms of Service ##
    45 
    46 http://snappic.io/terms-of-service.html
     3See the [text version](readme.txt).
  • snappic/tags/1.1/readme.txt

    r1874793 r1987816  
    44Tags: woocommerce, snappic, retargeting, facebook, Facebook Pixel, Facebook Conversion Pixel, New Facebook Pixel, Facebook retargeting, feed, Instagram, Instagram feed, Facebook ads, Instagram ads
    55Requires at least: 4.7
    6 Tested up to: 4.8
    7 Stable tag: 1.0.7
     6Tested up to: 5.0
     7Stable tag: 1.1
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    44441. Click on "Install Now"
    45451. Click on "Activate Plugin"
     46
     47== Changelog ==
     48
     49= 1.1 (2018-12-7) =
     50* Updated to the new API url
     51* Improved API key generation
     52
     53= 1.0 =
     54* First release
  • snappic/tags/1.1/snappic-for-woocommerce.php

    r1874793 r1987816  
    44Plugin URI: https://wordpress.org/plugins/snappic-for-woocommerce/
    55Description: Link your WooCommerce store to Snappic
    6 Version: 1.0
     6Version: 1.1.0
    77Author: Snappic
    88Author URI: https://www.snappic.io
     
    1515
    1616class Snappic_Base {
    17     const VERSION = '1.0.7';
     17    const VERSION = '1.1.0';
    1818    const REQUIRED_WOO = '3.1.0';
    1919
     
    155155     */
    156156    public function delayed_install() {
    157 
    158157        if( ! $this->helper->get_stored_pixel_id() ) {
    159 
    160             update_option( 'woocommerce_api_enabled', 'yes' );
    161 
    162             include_once( 'includes/class-snappic-auth.php' );
    163             $snappicAuth = new Snappic_Auth();
    164             $domain = $this->helper->get_site_domain();
    165             $result = $snappicAuth->generate_keys( __( 'Snappic', 'snappic-for-woocommerce' ), $domain, 'read' );
    166 
    167             if( ! is_wp_error( $result ) ) {
    168 
    169                 $updated_options = array(
    170                     'key_id' => $result['key_id'],
    171                     'cust_key' => $result['consumer_key'],
    172                     'cust_secret'   => $result['consumer_secret'],
    173                     'cleanup'   => 'yes'
    174                 );
    175 
    176                 $this->helper->update_options( $updated_options );
    177             }
    178 
    179         }
    180 
     158            $settings = Snappic_Integration::instance();
     159            $settings->set_api_keys();
     160        }
    181161    }
    182162
  • snappic/trunk/includes/class-snappic-helper.php

    r1817427 r1987816  
    174174     */
    175175    public function get_api_url($bypassSandbox = false) {
    176         return add_query_arg('domain', $this->get_site_domain(), $this->get_api_host($bypassSandbox) . '/stores/current');
     176        return add_query_arg('domain', $this->get_site_domain(), $this->get_api_host($bypassSandbox) . '/admin_frontend/stores/current');
    177177    }
    178178
     
    209209    public function get_signup_url($plan = '') {
    210210        $settings = Snappic_Integration::instance();
     211
     212        // Check if API keys are correctly set.
     213        $settings->check_api_keys();
     214
    211215        $consumerKey = $settings->get_option('cust_key');
    212216        $consumerSecret = $settings->get_option('cust_secret');
  • snappic/trunk/includes/class-snappic-integration.php

    r1715114 r1987816  
    2424
    2525        self::$_instance = $this;
     26    }
     27
     28    /**
     29     * Checks if API keys are set correctly. Otherwise regenerate new ones.
     30     *
     31     * @since  1.0.0
     32     */
     33    public function check_api_keys() {
     34        if ($this->get_option('cust_key') && $this->get_option('cust_secret')) {
     35            return;
     36        }
     37
     38        $this->set_api_keys();
     39    }
     40
     41    /**
     42     * Generate API keys and stored them in our own settings.
     43     *
     44     * @since  1.0.0
     45     */
     46    public function set_api_keys() {
     47        update_option( 'woocommerce_api_enabled', 'yes' );
     48
     49        include_once( 'class-snappic-auth.php' );
     50        $snappicAuth = new Snappic_Auth();
     51        $helper = Snappic_Helper::get_instance();
     52        $domain = $helper->get_site_domain();
     53        $result = $snappicAuth->generate_keys( __( 'Snappic', 'snappic-for-woocommerce' ), $domain, 'read' );
     54
     55        if( ! is_wp_error( $result ) && !empty($result['key_id']) && !empty($result['consumer_key']) && !empty($result['consumer_secret']) ) {
     56
     57            $updated_options = array(
     58                'key_id' => $result['key_id'],
     59                'cust_key' => $result['consumer_key'],
     60                'cust_secret'   => $result['consumer_secret'],
     61                'cleanup'   => 'yes'
     62            );
     63
     64            $helper->update_options( $updated_options );
     65            $this->init_settings();
     66        }
    2667    }
    2768
  • snappic/trunk/languages/snappic-for-woocommerce.pot

    r1874793 r1987816  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Snappic for WooCommerce 1.0.7\n"
     5"Project-Id-Version: Snappic for WooCommerce 1.1.0\n"
    66"Report-Msgid-Bugs-To: "
    77"https://wordpress.org/support/plugin/snappic-for-woocommerce\n"
  • snappic/trunk/readme.md

    r1715114 r1987816  
    1 # Snappic for WooCommerce #
    2 **Contributors:** [Snappic](https://profiles.wordpress.org/Snappic) 
    3 **Tags:** woocommerce, snappic, retargeting   
    4 **Requires at least:** 4.7 
    5 **Tested up to:** 4.8 
    6 **Stable tag:** 1.0.0-RC-2 
    7 **License:** GPLv3     
    8 **License URI:** http://www.gnu.org/licenses/gpl-3.0.html     
    9 **WC requires at least:** 3.0.0     
    10 **WC tested up to:** 3.1.1   
     1# Snappic for WooCommerce
    112
    12 Insert Snappic tracking pixel into relevant pages
    13 
    14 ## Description ##
    15 
    16 We analyze each of your visitors, the products they looked at, and learn what they like. Next time they’re browsing Instagram or Facebook they’ll see a highly relevant ad specifically tailored to what they were looking at and other product recommendations.
    17 
    18 ### Known Limitations ###
    19 
    20 * Works with WooCommmerce 3.0 and up
    21 
    22 ## Installation ##
    23 1. Upload 'snappic-for-woocommerce' to the '/wp-content/plugins/' directory
    24 1. Activate the plugin through the 'Plugins' menu in WordPress
    25 1. Add your Snappic API key to WooCommerce->Settings->Integration->Integration tab
    26 1. Enable shipping rate calculation in WooCommerce->Settings->Shipping->Snappic Shipping tab
    27 
    28 ## Frequently Asked Questions ##
    29 
    30 ### How do I get Snappic API key? ###
    31 
    32 
    33 
    34 ## Screenshots ##
    35 
    36 1. Plugin settings dialog
    37 
    38 ## Upgrade Notice ##
    39 
    40 
    41 ### 1.0 ###
    42 * First release
    43 
    44 ## Terms of Service ##
    45 
    46 http://snappic.io/terms-of-service.html
     3See the [text version](readme.txt).
  • snappic/trunk/readme.txt

    r1874793 r1987816  
    44Tags: woocommerce, snappic, retargeting, facebook, Facebook Pixel, Facebook Conversion Pixel, New Facebook Pixel, Facebook retargeting, feed, Instagram, Instagram feed, Facebook ads, Instagram ads
    55Requires at least: 4.7
    6 Tested up to: 4.8
    7 Stable tag: 1.0.7
     6Tested up to: 5.0
     7Stable tag: 1.1
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    44441. Click on "Install Now"
    45451. Click on "Activate Plugin"
     46
     47== Changelog ==
     48
     49= 1.1 (2018-12-7) =
     50* Updated to the new API url
     51* Improved API key generation
     52
     53= 1.0 =
     54* First release
  • snappic/trunk/snappic-for-woocommerce.php

    r1874793 r1987816  
    44Plugin URI: https://wordpress.org/plugins/snappic-for-woocommerce/
    55Description: Link your WooCommerce store to Snappic
    6 Version: 1.0
     6Version: 1.1.0
    77Author: Snappic
    88Author URI: https://www.snappic.io
     
    1515
    1616class Snappic_Base {
    17     const VERSION = '1.0.7';
     17    const VERSION = '1.1.0';
    1818    const REQUIRED_WOO = '3.1.0';
    1919
     
    155155     */
    156156    public function delayed_install() {
    157 
    158157        if( ! $this->helper->get_stored_pixel_id() ) {
    159 
    160             update_option( 'woocommerce_api_enabled', 'yes' );
    161 
    162             include_once( 'includes/class-snappic-auth.php' );
    163             $snappicAuth = new Snappic_Auth();
    164             $domain = $this->helper->get_site_domain();
    165             $result = $snappicAuth->generate_keys( __( 'Snappic', 'snappic-for-woocommerce' ), $domain, 'read' );
    166 
    167             if( ! is_wp_error( $result ) ) {
    168 
    169                 $updated_options = array(
    170                     'key_id' => $result['key_id'],
    171                     'cust_key' => $result['consumer_key'],
    172                     'cust_secret'   => $result['consumer_secret'],
    173                     'cleanup'   => 'yes'
    174                 );
    175 
    176                 $this->helper->update_options( $updated_options );
    177             }
    178 
    179         }
    180 
     158            $settings = Snappic_Integration::instance();
     159            $settings->set_api_keys();
     160        }
    181161    }
    182162
Note: See TracChangeset for help on using the changeset viewer.