Plugin Directory

Changeset 3001900


Ignore:
Timestamp:
11/26/2023 10:14:05 PM (2 years ago)
Author:
newsmanapp
Message:

OAuthImplementation

Location:
newsmanapp
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • newsmanapp/trunk/README.md

    r2529583 r3001900  
    44This is the easiest way to connect your Blog with Newsman.com. Generate an API KEY in your [NewsmanApp](https://www.newsman.com) account, install this plugin and you will be able to collect and sync subscribers, remarketing and forms.
    55
     6![image](https://raw.githubusercontent.com/Newsman/WP-Plugin-NewsmanApp/master/assets/newsmanBr.jpg)
    67
    78# Instalation
     
    14152. Rename folder `WP-Plugin-NewsmanApp-master` to `newsmanapp`, upload the contents of `newsmanapp` to your plugins directory, which usually is `/wp-content/plugins/`.
    1516
    16 - Activate the plugin
     17## Activate the plugin
     18
     19If you're using woocommerce you will also need to activate Newsman Remarketing plugin
     20
     21![image](https://raw.githubusercontent.com/Newsman/WP-Plugin-NewsmanApp/master/assets/wp_activation.png)
     22
    1723- Go to *Newsman > Settings* and paste your API key and User ID (you can find those in your account section in NewsmanApp - https://www.newsman.com)
    1824
    19 ## Newsman plugin settings
    20 ![newsletter plugin settings](https://raw.githubusercontent.com/Newsman/WP-Plugin-NewsmanApp/master/assets/wp_newsman_settings.png)
     25# Newsman plugin settings
     26![image](https://raw.githubusercontent.com/Newsman/WP-Plugin-NewsmanApp/master/assets/wp_settings.png)
    2127
    22 ## Import subscribers to NewsmanApp
    23 ![newsletter import subscribers](https://raw.githubusercontent.com/Newsman/WP-Plugin-NewsmanApp/master/assets/wp_newsman_import_subscribers.png)
     28# Import subscribers to NewsmanApp
     29![image](https://raw.githubusercontent.com/Newsman/WP-Plugin-NewsmanApp/master/assets/wp_sync.png)
    2430
     31# SMS
     32![image](https://raw.githubusercontent.com/Newsman/WP-Plugin-NewsmanApp/master/assets/wp_sms.png)
    2533
    2634# Newsman Remarketing
     
    2836## You must be logged out of admin to be able to test Remarketing (forms, events).
    2937
    30 ## Widget
    31 
    32 - Log in to your <a target="_blank" href="https://newsman.app">Newsman account</a>: Select List -> Settings -> Subscription forms -> Create/Edit form -> Modal window -> Activate modal window for newsletter subscription -> Select embedded form. Copy paste Shortcode `newsman_subscribe_widget`
    33 
    3438NewsmanApp plugin for Woocommerce allows you to track your shop customers.
    3539
    36 1. Activate the plugin NewsmanApp Remarketing
    37 2. Go to *Woocommerce > Integrations* and paste your Newsman Remarketing ID (you can find those in your account section in NewsmanApp - https://www.newsman.com)
     40After the plugin is installed, you will also have: feed products, events (product impressions, AddToCart, purchase) automatically implemented.
    3841
    39 # Newsman Remarketing Screenshots
    40 Some quick screenshots of the Newsman Remarketing plugin features.
    41    
    42 ## Newsman Remarketing plugin settings
    43 ![newsletter plugin settings](https://raw.githubusercontent.com/Newsman/WP-Plugin-NewsmanApp/master/assets/1.jpg)
     42## Remarketing Id
     43
     44Go to Remarketing Tab and paste your Newsman Remarketing ID (you can find those in your account section in NewsmanApp - https://www.newsman.com)
     45
     46![image](https://raw.githubusercontent.com/Newsman/WP-Plugin-NewsmanApp/master/assets/wp_remarketingId.jpg)
     47
     48# Widget
     49
     50- Log in to your <a target="_blank" href="https://newsman.app">Newsman account</a>: Select List -> Settings -> Subscription forms -> Create/Edit form ->  select landing page -> Activate for newsletter subscription -> Select embedded form. Copy paste Shortcode `newsman_subscribe_widget`
     51
     52- If selected modal window -> Activate for newsletter subscription -> it will automatically be displayed on the website.
    4453
    4554# License
    4655
    4756This code is released under [GPLv2 license](https://github.com/Newsman/WP-Plugin-NewsmanApp/blob/master/LICENSE) by [NewsmanApp - Smart Email Service Provider](https://www.newsman.com).
     57
     58# Description
     59
     60With the NewsMAN Plugin, you have the power to streamline your email and SMS marketing efforts. This tool enables you to manage subscription forms, contact lists, newsletters, email campaigns, SMS functionalities, smart automations, detailed analytics, and ensure reliable transactional emails - all accessed through the NewsMAN platform, providing you with enhanced marketing capabilities.
     61
     62# Subscription Forms & Pop-ups:
     63
     64* Create: Craft visually engaging subscription forms and pop-ups, like embedded newsletter signups or exit-intent popups, strategically capturing potential leads before they leave. Customize these forms with compelling visuals and user-friendly designs to entice visitors effectively.
     65
     66* Sync: Ensure forms are consistent across multiple platforms by synchronizing them, regardless of the device used. This maintains a smooth user experience and upholds brand consistency.
     67
     68* Connect to Automations: Seamlessly integrate subscription forms with automated workflows. This enables the activation of welcome emails or specific responses upon form submissions, enhancing user engagement through automated processes.
     69
     70# Contact Lists & Segments:
     71
     72* Auto Import Sync: Automate the import and synchronization of contact lists from different sources such as websites, e-commerce platforms, or marketing/sales software. This streamlines data management, ensuring your contact information remains accurate and updated effortlessly.
     73
     74* Advanced Segmentation: Utilize demographic or behavioral segmentation techniques to better target specific audience segments. Tailor offers or promotions specific to regions based on users' interests and behaviors, enhancing the relevance of your marketing approaches.
     75
     76# Marketing Campaigns (Email and SMS):
     77
     78* Mass Campaigns: Send newsletters or promotional offers to a broad subscriber base with convenience. This keeps your audience engaged with regular updates on fresh products or services.
     79
     80* Segmented & Personalized: Tailor campaigns to resonate individually with subscribers by personalizing content. Address subscribers by name or suggest products aligned with their preferences or past interactions, ensuring personalized engagement.
     81
     82* Resend to Unopened: Re-engage subscribers effectively by resending campaigns to those who haven't opened the initial email. Modify content to enhance interaction and expand reach, fostering increased engagement.
     83
     84* A/B Tests: Improve campaign performance by experimenting with various elements such as subject lines, content formats, or visuals through A/B tests. Identify the most effective strategies to refine your approach.
     85
     86* Fully Automated: Optimize campaign performance through experimentation with various elements like subject lines, content formats, or visuals to identify the most effective strategies.
     87
     88# Marketing Automation (Email & SMS):
     89
     90* E-commerce & Non-E-commerce: Automate personalized product suggestions or follow-up emails based on user behavior, enhancing user engagement and providing customized experiences.
     91
     92* Cart Abandonment & Product Views: Strategically address cart abandonment or showcase related products to encourage users to finalize their purchase journey, reclaiming potential sales opportunities.
     93
     94* Order Review & Post-Purchase: Gather post-purchase feedback to bolster relationships and refine products/services based on valuable testimonials, strengthening customer satisfaction.
     95
     96* Extensive Automation Flows: Develop comprehensive workflows triggered by specific user actions. Guide users through diverse touchpoints in their journey, such as onboarding sequences or re-engagement strategies, ensuring a fluid user experience.
     97
     98# Ecommerce Remarketing:
     99
     100* Efficient Targeting: Reconnect with subscribers by sending targeted offers or reminders based on their past interactions, amplifying the effectiveness of re-engagement strategies.
     101
     102* Custom Flows: Personalize interactions by providing exclusive offers or reminders based on users' behavior or preferences, fostering a sense of exclusivity and engagement.
     103
     104# SMTP Transactional Email & SMS:
     105
     106* Transactional Emails: Guarantee the prompt and reliable delivery of critical messages, such as order confirmations or shipping notifications, through SMTP. This ensures users consistently receive important communications without delay.
     107
     108# Extended Email and SMS Statistics:
     109
     110* Comprehensive Insights: Gain comprehensive insights into open rates, click-through rates, conversion rates, and overall campaign performance. These detailed analytics empower data-driven decision-making, refining future campaigns and enhancing overall performance.
  • newsmanapp/trunk/includes/class-wc-newsman-remarketing-js.php

    r2958430 r3001900  
    164164
    165165        var remarketingid = '$remarketingid';
    166         var _nzmPluginInfo = '2.4.4:woocommerce';
     166        var _nzmPluginInfo = '2.6.0:woocommerce';
    167167       
    168168        //Newsman remarketing tracking code REPLACEABLE
  • newsmanapp/trunk/newsmanapp.php

    r2992350 r3001900  
    55Plugin URI: https://github.com/Newsman/WP-Plugin-NewsmanApp
    66Description: NewsmanApp for Wordpress (sign up widget, subscribers sync, create and send newsletters from blog posts)
    7 Version: 2.5.3
     7Version: 2.6.0
    88Author: Newsman
    99Author URI: https://www.newsman.com
     
    6868        }
    6969
     70        public function isOauth($insideOauth = false){
     71
     72            if($insideOauth)
     73            {
     74                if(!empty(get_option('newsman_userid')))
     75                    wp_redirect("https://" . $_SERVER["HTTP_HOST"] . "/wp-admin/admin.php?page=NewsmanSettings");
     76               
     77                return;
     78            }
     79
     80            if(empty(get_option('newsman_userid')))
     81                wp_redirect("https://" . $_SERVER["HTTP_HOST"] . "/wp-admin/admin.php?page=NewsmanOauth");
     82        }
     83
    7084        /*
    7185        * Set's up the Newsman_Client instance
     
    7690        public function constructClient($userid = null, $apikey = null)
    7791        {
    78 
    7992            $this->userid = (!is_null($userid)) ? $userid : get_option('newsman_userid');
    8093            $this->apikey = (!is_null($apikey)) ? $apikey : get_option('newsman_apikey');
     
    129142
    130143                if ($allowAPI != "on") {
    131                     $this->_json(array("status" => 403));
     144                    $this->_json(array("status" => 403, "message" => "API setting is not enabled in plugin"));
    132145                    return;
    133146                }
     
    289302                            }
    290303
     304                            $cat_ids = $prod->get_category_ids();
     305                            $category = "";
     306                       
     307                            foreach ( (array) $cat_ids as $cat_id) {
     308                                $cat_term = get_term_by('id', (int)$cat_id, 'product_cat');
     309                                if($cat_term){
     310                                    $category = $cat_term->name;
     311                                    break;
     312                                }
     313                            }
     314                           
    291315                            $productsJson[] = array(
    292316                                "id" => (string)$prod->get_id(),
     317                                "category" => $category,
    293318                                "name" => $prod->get_name(),
    294319                                "stock_quantity" => (empty($prod->get_stock_quantity())) ? null : (float)$prod->get_stock_quantity(),
     
    456481                    );
    457482                    if ((count($customers_to_import) % $this->batchSize) == 0) {
    458                         $this->_importData($customers_to_import, $list, $_segments, $this->client, "newsman plugin wordpress subscribers CRON");
     483                        $this->_importData($customers_to_import, $list, $this->client, "newsman plugin wordpress subscribers CRON", $_segments);
    459484                    }
    460485                }
    461486                if (count($customers_to_import) > 0) {
    462                     $this->_importData($customers_to_import, $list, $_segments, $this->client, "newsman plugin wordpress subscribers CRON");
     487                    $this->_importData($customers_to_import, $list, $this->client, "newsman plugin wordpress subscribers CRON", $_segments);
    463488                }
    464489                             
     
    529554
    530555                    if ((count($customers_to_import) % $this->batchSize) == 0) {
    531                         $this->_importData($customers_to_import, $list, $_segments, $this->client, "newsman plugin wordpress woocommerce CRON");
     556                        $this->_importData($customers_to_import, $list, $this->client, "newsman plugin wordpress woocommerce CRON", $_segments);
    532557                    }
    533558                }
    534559                if (count($customers_to_import) > 0) {
    535                     $this->_importData($customers_to_import, $list, $_segments, $this->client, "newsman plugin wordpress woocommerce CRON");
     560                    $this->_importData($customers_to_import, $list, $this->client, "newsman plugin wordpress woocommerce CRON", $_segments);
    536561                }         
    537562
     
    707732                    'label_class'   => array('woocommerce-form__label woocommerce-form__label-for-checkbox checkbox'),
    708733                    'input_class'   => array('woocommerce-form__input woocommerce-form__input-checkbox input-checkbox'),
    709                     'required'      => true,
     734                    'required'      => false,
    710735                    'label'         => $msg,
    711736                    'default'       => $default,
     
    901926            add_submenu_page("Newsman", "Settings", "Settings", "administrator", "NewsmanSettings", array($this, "includeAdminSettingsPage"));
    902927            add_submenu_page("Newsman", "Widget", "Widget", "administrator", "NewsmanWidget", array($this, "includeAdminWidgetPage"));
     928            add_submenu_page("Newsman", "Oauth", "Oauth", "administrator", "NewsmanOauth", array($this, "includeOauthPage"));
    903929        }
    904930
     
    925951        {
    926952            include 'src/backend-sync.php';
     953        }
     954
     955        public function includeOauthPage(){
     956            include 'src/backend-oauth.php';
    927957        }
    928958
     
    11611191        }
    11621192
    1163         function _importData(&$data, $list, $segments = null, $client, $source)
     1193        function _importData(&$data, $list, $client, $source, $segments = null)
    11641194        {
    11651195            $csv = '"email","firstname","lastname","tel","source"' . PHP_EOL;
  • newsmanapp/trunk/readme.txt

    r2859726 r3001900  
    44Tags: newsman, email, subscribers, sync, newsletter, create, form
    55Requires at least: 3.7
    6 Tested up to: 6.0
     6Tested up to: 6.4.1
    77Stable tag: trunk
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 NewsmanApp for WordPress - create and send newsletters from your blog posts, newsletter sign up widget and subscribers sync via API
     11NewsmanApp, you have the power to streamline your email and SMS marketing efforts. This tool enables you to manage subscription forms, contact lists, newsletters, email campaigns, SMS functionalities, smart automations, detailed analytics, and ensure reliable transactional emails - all accessed through the NewsMAN platform, providing you with enhanced marketing capabilities.
    1212
    1313== Description ==
     
    1515[NewsmanApp](https://www.newsman.com) plugin for WordPress allows you to place a newsletter signup form on your blog (widget), to sync your subscribers via API and to send newsletters based on the blog posts via [NewsmanApp](https://www.newsman.com).
    1616
    17 This is the easiest way to connect your Blog with Newsman.com. Generate an API KEY in your [NewsmanApp](https://www.newsman.com) account, install this plugin and you will be able to collect and sync subscribers, remarketing and forms.
     17This is the easiest way to connect your Blog with Newsman.com. Generate an API KEY in your [NewsmanApp](https://www.newsman.com) account, install this plugin and you will be able to collect and sync subscribers, remarketing and forms.
     18
     19With the NewsMAN Plugin, you have the power to streamline your email and SMS marketing efforts. This tool enables you to manage subscription forms, contact lists, newsletters, email campaigns, SMS functionalities, smart automations, detailed analytics, and ensure reliable transactional emails - all accessed through the NewsMAN platform, providing you with enhanced marketing capabilities.
     20
     21# Subscription Forms & Pop-ups:
     22
     23* Create: Craft visually engaging subscription forms and pop-ups, like embedded newsletter signups or exit-intent popups, strategically capturing potential leads before they leave. Customize these forms with compelling visuals and user-friendly designs to entice visitors effectively.
     24
     25* Sync: Ensure forms are consistent across multiple platforms by synchronizing them, regardless of the device used. This maintains a smooth user experience and upholds brand consistency.
     26
     27* Connect to Automations: Seamlessly integrate subscription forms with automated workflows. This enables the activation of welcome emails or specific responses upon form submissions, enhancing user engagement through automated processes.
     28
     29# Contact Lists & Segments:
     30
     31* Auto Import Sync: Automate the import and synchronization of contact lists from different sources such as websites, e-commerce platforms, or marketing/sales software. This streamlines data management, ensuring your contact information remains accurate and updated effortlessly.
     32
     33* Advanced Segmentation: Utilize demographic or behavioral segmentation techniques to better target specific audience segments. Tailor offers or promotions specific to regions based on users' interests and behaviors, enhancing the relevance of your marketing approaches.
     34
     35# Marketing Campaigns (Email and SMS):
     36
     37* Mass Campaigns: Send newsletters or promotional offers to a broad subscriber base with convenience. This keeps your audience engaged with regular updates on fresh products or services.
     38
     39* Segmented & Personalized: Tailor campaigns to resonate individually with subscribers by personalizing content. Address subscribers by name or suggest products aligned with their preferences or past interactions, ensuring personalized engagement.
     40
     41* Resend to Unopened: Re-engage subscribers effectively by resending campaigns to those who haven't opened the initial email. Modify content to enhance interaction and expand reach, fostering increased engagement.
     42
     43* A/B Tests: Improve campaign performance by experimenting with various elements such as subject lines, content formats, or visuals through A/B tests. Identify the most effective strategies to refine your approach.
     44
     45* Fully Automated: Optimize campaign performance through experimentation with various elements like subject lines, content formats, or visuals to identify the most effective strategies.
     46
     47# Marketing Automation (Email & SMS):
     48
     49* E-commerce & Non-E-commerce: Automate personalized product suggestions or follow-up emails based on user behavior, enhancing user engagement and providing customized experiences.
     50
     51* Cart Abandonment & Product Views: Strategically address cart abandonment or showcase related products to encourage users to finalize their purchase journey, reclaiming potential sales opportunities.
     52
     53* Order Review & Post-Purchase: Gather post-purchase feedback to bolster relationships and refine products/services based on valuable testimonials, strengthening customer satisfaction.
     54
     55* Extensive Automation Flows: Develop comprehensive workflows triggered by specific user actions. Guide users through diverse touchpoints in their journey, such as onboarding sequences or re-engagement strategies, ensuring a fluid user experience.
     56
     57# Ecommerce Remarketing:
     58
     59* Efficient Targeting: Reconnect with subscribers by sending targeted offers or reminders based on their past interactions, amplifying the effectiveness of re-engagement strategies.
     60
     61* Custom Flows: Personalize interactions by providing exclusive offers or reminders based on users' behavior or preferences, fostering a sense of exclusivity and engagement.
     62
     63# SMTP Transactional Email & SMS:
     64
     65* Transactional Emails: Guarantee the prompt and reliable delivery of critical messages, such as order confirmations or shipping notifications, through SMTP. This ensures users consistently receive important communications without delay.
     66
     67# Extended Email and SMS Statistics:
     68
     69* Comprehensive Insights: Gain comprehensive insights into open rates, click-through rates, conversion rates, and overall campaign performance. These detailed analytics empower data-driven decision-making, refining future campaigns and enhancing overall performance.
    1870
    1971== Installation ==
     
    25771. Download the plugin and upload the contents of newsmanapp.zip to your plugins directory, which usually is /wp-content/plugins/.
    2678
    27 - Activate the plugin
    28 - Go to *Newsman > Settings* and paste your API key and User ID (you can find those in your account section in NewsmanApp - https://www.newsman.com)
     79- Activate the plugin, NewsmanApp and Newsman Remarketing
     80- Go to *Newsman, you can login with Newsman via OAuth and automate the flow (API KEY, User ID, Remarketing ID), automated installer.
    2981
    30 widget
     82Widget
    3183
    32 - Log in to your https://www.newsman.com - Newsman account: Select List -> Settings -> Subscription forms -> Create/Edit form -> Modal window -> Activate modal window for newsletter subscription -> Select embedded form. Copy paste Shortcode `newsman_subscribe_widget`
     84- Log in to your <a target="_blank" href="https://newsman.app">Newsman account</a>: Select List -> Settings -> Subscription forms -> Create/Edit form ->  select landing page -> Activate for newsletter subscription -> Select embedded form. Copy paste Shortcode `newsman_subscribe_widget`
     85
     86- If selected modal window -> Activate for newsletter subscription -> it will automatically be displayed on the website.
     87
     88Newsman Remarketing
     89
     90You must be logged out of admin to be able to test Remarketing (forms, events).
     91
     92NewsmanApp plugin for Woocommerce allows you to track your shop customers.
     93
     94After the plugin is installed, you will also have: feed products, events (product impressions, AddToCart, purchase) automatically implemented.
     95
     96Remarketing Id
     97
     98Go to Remarketing Tab and paste your Newsman Remarketing ID (you can find those in your account section in NewsmanApp - https://www.newsman.com)
    3399
    34100== Frequently Asked Questions ==
     
    67133= 2.3.7 =
    68134 * Remarketing improvements
    69 = 2.4.2 =
    70  * Patch JS improvements
    71  
     135
    72136== Upgrade Notice ==
    73137
     
    76140== Screenshots ==
    77141
    78 1. Newsman settings
    79 2. Import Subscribers to NewsmanApp 
     1421. Sync settings
     1432. Settings
     1443. SMS
     1454. Remarketing
     1465. activation
     1476. Newsman OAuth login
  • newsmanapp/trunk/src/backend-remarketing.php

    r2979002 r3001900  
    11<?php
     2
     3$this->isOauth();
    24
    35if (!empty($_POST['newsman_remarketing']) && $_POST['newsman_remarketing'] == 'Y')
     
    6365
    6466            <div class="<?php echo (is_array($this->message) && array_key_exists("status", $this->message)) ? $this->message["status"] : ""; ?>"><p><strong><?php echo (is_array($this->message) && array_key_exists("message", $this->message)) ? $this->message["message"] : ""; ?></strong>
    65                 </p></div>     
     67                </p></div> 
    6668
    6769            <?php if (!$this->valid_credentials)
  • newsmanapp/trunk/src/backend-settings.php

    r2979002 r3001900  
    1 <?php
    2 
    3 if (!empty($_POST['newsman_submit']) && $_POST['newsman_submit'] == 'Y')
    4 {       
    5     $userid = (isset($_POST['newsman_userid']) && !empty($_POST['newsman_userid'])) ? strip_tags(trim($_POST['newsman_userid'])) : "";
    6     $apikey = (isset($_POST['newsman_apikey']) && !empty($_POST['newsman_apikey'])) ? strip_tags(trim($_POST['newsman_apikey'])) : ""; 
    7     $allowAPI = (isset($_POST['newsman_api']) && !empty($_POST['newsman_api'])) ? strip_tags(trim($_POST['newsman_api'])) : "";
    8     $checkoutSMS = (isset($_POST['newsman_checkoutsms']) && !empty($_POST['newsman_checkoutsms'])) ? strip_tags(trim($_POST['newsman_checkoutsms'])) : "";
    9     $checkoutNewsletter = (isset($_POST['newsman_checkoutnewsletter']) && !empty($_POST['newsman_checkoutnewsletter'])) ? strip_tags(trim($_POST['newsman_checkoutnewsletter'])) : "";
    10     $checkoutNewsletterType = (isset($_POST['newsman_checkoutnewslettertype']) && !empty($_POST['newsman_checkoutnewslettertype'])) ? strip_tags(trim($_POST['newsman_checkoutnewslettertype'])) : "";
    11     $newsman_checkoutnewslettermessage = (isset($_POST['newsman_checkoutnewslettermessage']) && !empty($_POST['newsman_checkoutnewslettermessage'])) ? strip_tags(trim($_POST['newsman_checkoutnewslettermessage'])) : "";     
    12     $checkoutNewsletterDefault = (isset($_POST['newsman_checkoutnewsletterdefault']) && !empty($_POST['newsman_checkoutnewsletterdefault'])) ? strip_tags(trim($_POST['newsman_checkoutnewsletterdefault'])) : "";
    13     $form_id = (isset($_POST['newsman_form_id']) && !empty($_POST['newsman_form_id'])) ? strip_tags(trim($_POST['newsman_form_id'])) : "";
    14 
    15     $this->constructClient($userid, $apikey);
    16 
    17     update_option("newsman_userid", $this->userid);
    18     update_option("newsman_apikey", $this->apikey);
    19     update_option("newsman_api", $allowAPI);
    20     update_option("newsman_checkoutsms", $checkoutSMS);
    21     update_option("newsman_checkoutnewsletter", $checkoutNewsletter);
    22     update_option("newsman_checkoutnewslettertype", $checkoutNewsletterType);               
    23     update_option("newsman_checkoutnewslettermessage", $newsman_checkoutnewslettermessage);
    24     update_option("newsman_checkoutnewsletterdefault", $checkoutNewsletterDefault);
    25     update_option("newsman_form_id", $form_id);
    26 
    27     try
    28     {
    29         $available_lists = $this->client->list->all();
    30 
    31         $available_segments = array();
    32         if (!empty($list))
    33         {
    34             $available_segments = $this->client->segment->all($list);
    35         }           
    36        
    37         $this->setMessageBackend("updated", "Options saved.");
    38     } catch (Exception $e)
    39     {
    40         $this->valid_credential = false;
    41         $this->setMessageBackend('error', 'Invalid Credentials');
     1    <?php
     2
     3$this->isOauth();
     4
     5    if (!empty($_POST['newsman_submit']) && $_POST['newsman_submit'] == 'Y')
     6    {       
     7        $userid = (isset($_POST['newsman_userid']) && !empty($_POST['newsman_userid'])) ? strip_tags(trim($_POST['newsman_userid'])) : "";
     8        $apikey = (isset($_POST['newsman_apikey']) && !empty($_POST['newsman_apikey'])) ? strip_tags(trim($_POST['newsman_apikey'])) : ""; 
     9        $allowAPI = (isset($_POST['newsman_api']) && !empty($_POST['newsman_api'])) ? strip_tags(trim($_POST['newsman_api'])) : "";
     10        $checkoutSMS = (isset($_POST['newsman_checkoutsms']) && !empty($_POST['newsman_checkoutsms'])) ? strip_tags(trim($_POST['newsman_checkoutsms'])) : "";
     11        $checkoutNewsletter = (isset($_POST['newsman_checkoutnewsletter']) && !empty($_POST['newsman_checkoutnewsletter'])) ? strip_tags(trim($_POST['newsman_checkoutnewsletter'])) : "";
     12        $checkoutNewsletterType = (isset($_POST['newsman_checkoutnewslettertype']) && !empty($_POST['newsman_checkoutnewslettertype'])) ? strip_tags(trim($_POST['newsman_checkoutnewslettertype'])) : "";
     13        $newsman_checkoutnewslettermessage = (isset($_POST['newsman_checkoutnewslettermessage']) && !empty($_POST['newsman_checkoutnewslettermessage'])) ? strip_tags(trim($_POST['newsman_checkoutnewslettermessage'])) : "";     
     14        $checkoutNewsletterDefault = (isset($_POST['newsman_checkoutnewsletterdefault']) && !empty($_POST['newsman_checkoutnewsletterdefault'])) ? strip_tags(trim($_POST['newsman_checkoutnewsletterdefault'])) : "";
     15        $form_id = (isset($_POST['newsman_form_id']) && !empty($_POST['newsman_form_id'])) ? strip_tags(trim($_POST['newsman_form_id'])) : "";
     16
     17        $this->constructClient($userid, $apikey);
     18
     19        update_option("newsman_userid", $this->userid);
     20        update_option("newsman_apikey", $this->apikey);
     21        update_option("newsman_api", $allowAPI);
     22        update_option("newsman_checkoutsms", $checkoutSMS);
     23        update_option("newsman_checkoutnewsletter", $checkoutNewsletter);
     24        update_option("newsman_checkoutnewslettertype", $checkoutNewsletterType);               
     25        update_option("newsman_checkoutnewslettermessage", $newsman_checkoutnewslettermessage);
     26        update_option("newsman_checkoutnewsletterdefault", $checkoutNewsletterDefault);
     27        update_option("newsman_form_id", $form_id);
     28
     29        $this->isOauth();
     30
     31        try
     32        {
     33            $available_lists = $this->client->list->all();
     34
     35            $available_segments = array();
     36            if (!empty($list))
     37            {
     38                $available_segments = $this->client->segment->all($list);
     39            }           
     40           
     41            $this->setMessageBackend("updated", "Options saved.");
     42        } catch (Exception $e)
     43        {
     44            $this->valid_credential = false;
     45            $this->setMessageBackend('error', 'Invalid Credentials');
     46        }
     47    } else
     48    {   
     49        $userid = get_option('newsman_userid');
     50        $apikey = get_option('newsman_apikey');
     51        $allowAPI = get_option('newsman_api');
     52        $checkoutSMS = get_option('newsman_checkoutsms');
     53        $checkoutNewsletter = get_option('newsman_checkoutnewsletter');
     54        $checkoutNewsletterType = get_option('newsman_checkoutnewslettertype');
     55        $newsman_checkoutnewslettermessage = get_option('newsman_checkoutnewslettermessage');
     56        $checkoutNewsletterDefault = get_option('newsman_checkoutnewsletterdefault');
     57        $form_id = get_option('newsman_form_id');
     58
     59        try
     60        {
     61            $available_lists = $this->client->list->all();
     62
     63            $available_segments = array();
     64            if (!empty($list))
     65            {
     66                $available_segments = $this->client->segment->all($list);
     67            }                   
     68
     69        } catch (Exception $e)
     70        {
     71            $this->valid_credential = false;
     72            $this->setMessageBackend('error', 'Invalid Credentials');
     73        }
    4274    }
    43 } else
    44 {   
    45     $userid = get_option('newsman_userid');
    46     $apikey = get_option('newsman_apikey');
    47     $allowAPI = get_option('newsman_api');
    48     $checkoutSMS = get_option('newsman_checkoutsms');
    49     $checkoutNewsletter = get_option('newsman_checkoutnewsletter');
    50     $checkoutNewsletterType = get_option('newsman_checkoutnewslettertype');
    51     $newsman_checkoutnewslettermessage = get_option('newsman_checkoutnewslettermessage');
    52     $checkoutNewsletterDefault = get_option('newsman_checkoutnewsletterdefault');
    53     $form_id = get_option('newsman_form_id');
    54 
    55     try
    56     {
    57         $available_lists = $this->client->list->all();
    58 
    59         $available_segments = array();
    60         if (!empty($list))
    61         {
    62             $available_segments = $this->client->segment->all($list);
    63         }                   
    64 
    65     } catch (Exception $e)
    66     {
    67         $this->valid_credential = false;
    68         $this->setMessageBackend('error', 'Invalid Credentials');
    69     }
    70 }
    71 
    72 ?>
     75
     76    ?>
    7377
    7478<div class="tabsetImg">
    75 <a href="https://newsman.com" target="_blank">
    76     <img src="/wp-content/plugins/newsmanapp/src/img/logo.png" />
    77 </a>
     79    <a href="https://newsman.com" target="_blank">
     80        <img src="/wp-content/plugins/newsmanapp/src/img/logo.png" />
     81    </a>
    7882</div>
    7983<div class="tabset">
    8084
    81 <input type="radio" name="tabset" id="" aria-controls="">
    82 <label for="" id="newsmanBtn">Newsman</label>
    83 <input type="radio" name="tabset" id="" aria-controls="">
    84 <label for="" id="syncBtn">Sync</label>
    85 <input type="radio" name="tabset" id="" aria-controls="">
    86 <label for="" id="remarketingBtn">Remarketing</label>
    87 <input type="radio" name="tabset" id="" aria-controls="">
    88 <label for="" id="smsBtn">SMS</label>
    89 <input type="radio" name="tabset" id="tabSettings" aria-controls="" checked>
    90 <label for="tabSettings" id="settingsBtn">Settings</label>
    91 <input type="radio" name="tabset" id="" aria-controls="">
    92 <label for="" id="widgetBtn">Widget</label>
    93 
    94 <div class="tab-panels">
    95 <section id="tabSettings" class="tab-panel">
    96  
    97 <div class="wrap wrap-settings-admin-page">
    98     <form method="post" enctype="multipart/form-data">
    99         <input type="hidden" name="newsman_submit" value="Y"/>
    100 
    101         <div class="<?php echo (is_array($this->message) && array_key_exists("status", $this->message)) ? $this->message["status"] : ""; ?>"><p><strong><?php echo (is_array($this->message) && array_key_exists("message", $this->message)) ? $this->message["message"] : ""; ?></strong>
     85    <input type="radio" name="tabset" id="" aria-controls="">
     86    <label for="" id="newsmanBtn">Newsman</label>
     87    <input type="radio" name="tabset" id="" aria-controls="">
     88    <label for="" id="syncBtn">Sync</label>
     89    <input type="radio" name="tabset" id="" aria-controls="">
     90    <label for="" id="remarketingBtn">Remarketing</label>
     91    <input type="radio" name="tabset" id="" aria-controls="">
     92    <label for="" id="smsBtn">SMS</label>
     93    <input type="radio" name="tabset" id="tabSettings" aria-controls="" checked>
     94    <label for="tabSettings" id="settingsBtn">Settings</label>
     95    <input type="radio" name="tabset" id="" aria-controls="">
     96    <label for="" id="widgetBtn">Widget</label>
     97   
     98  <div class="tab-panels">
     99    <section id="tabSettings" class="tab-panel">
     100     
     101    <div class="wrap wrap-settings-admin-page">
     102        <form method="post" enctype="multipart/form-data">
     103            <input type="hidden" name="newsman_submit" value="Y"/>
     104
     105            <div class="<?php echo (is_array($this->message) && array_key_exists("status", $this->message)) ? $this->message["status"] : ""; ?>"><p><strong><?php echo (is_array($this->message) && array_key_exists("message", $this->message)) ? $this->message["message"] : ""; ?></strong>
    102106                </p></div>         
    103107
    104         <h2>Newsman Connection</h2>
    105         <table class="form-table newsmanTable newsmanTblFixed">
    106             <tr>
    107                 <th scope="row">
    108                     <label for="newsman_apikey">API KEY</label>
    109                 </th>
    110                 <td>
    111                     <input type="text" name="newsman_apikey" value="<?php echo $apikey; ?>"/>
    112                     <p class="description">Your Newsman API KEY</p>
    113                 </td>
    114             </tr>
    115             <tr>
    116                 <th scope="row">
    117                     <label for="newsman_userid">User ID</label>
    118                 </th>
    119                 <td>
    120                     <input type="text" name="newsman_userid" value="<?php echo $userid; ?>"/>
    121                     <p class="description">Your Newsman User ID</p>
    122                 </td>
    123             </tr>           
    124 
    125             </table>               
    126 
    127             <h2>Settings</h2>
     108            <h2>Newsman Connection</h2>
    128109            <table class="form-table newsmanTable newsmanTblFixed">
    129 
    130110                <tr>
    131111                    <th scope="row">
    132                         <label for="newsman_api">Allow API access</label>
     112                        <label for="newsman_apikey">API KEY</label>
    133113                    </th>
    134114                    <td>
    135 
    136                     <input name="newsman_api" type="checkbox" id="newsman_api" <?php echo (!empty($allowAPI) && $allowAPI == "on") ? "checked" : ""; ?>/>                               
    137                    
     115                        <input type="text" name="newsman_apikey" value="<?php echo $apikey; ?>"/>
     116                        <p class="description">Your Newsman API KEY</p>
    138117                    </td>
    139118                </tr>
    140119                <tr>
    141120                    <th scope="row">
    142                         <label for="newsman_checkoutnewsletter">Checkout newsletter subscribe checkbox</label>
     121                        <label for="newsman_userid">User ID</label>
    143122                    </th>
    144123                    <td>
    145 
    146                     <input name="newsman_checkoutnewsletter" type="checkbox" id="newsman_checkoutnewsletter" <?php echo (!empty($checkoutNewsletter) && $checkoutNewsletter == "on") ? "checked" : ""; ?>/>                                                             
     124                        <input type="text" name="newsman_userid" value="<?php echo $userid; ?>"/>
     125                        <p class="description">Your Newsman User ID</p>
    147126                    </td>
    148                 </tr>
    149                 <tr>
    150                     <th scope="row">
    151                         <label for="newsman_checkoutsms">Checkout SMS, sync phone numbers to your SMS list</label>
     127                </tr>           
     128
     129                </table>               
     130
     131                <h2>Settings</h2>
     132                <table class="form-table newsmanTable newsmanTblFixed">
     133
     134                    <tr>
     135                        <th scope="row">
     136                            <label for="newsman_api">Allow API access</label>
     137                        </th>
     138                        <td>
     139
     140                        <input name="newsman_api" type="checkbox" id="newsman_api" <?php echo (!empty($allowAPI) && $allowAPI == "on") ? "checked" : ""; ?>/>                               
     141                       
     142                        </td>
     143                    </tr>
     144                    <tr>
     145                        <th scope="row">
     146                            <label for="newsman_checkoutnewsletter">Checkout newsletter subscribe checkbox</label>
     147                        </th>
     148                        <td>
     149
     150                        <input name="newsman_checkoutnewsletter" type="checkbox" id="newsman_checkoutnewsletter" <?php echo (!empty($checkoutNewsletter) && $checkoutNewsletter == "on") ? "checked" : ""; ?>/>                                                             
     151                        </td>
     152                    </tr>
     153                    <tr>
     154                        <th scope="row">
     155                            <label for="newsman_checkoutsms">Checkout SMS, sync phone numbers to your SMS list</label>
     156                        </th>
     157                        <td>
     158
     159                        <input name="newsman_checkoutsms" type="checkbox" id="newsman_checkoutsms" <?php echo (!empty($checkoutSMS) && $checkoutSMS == "on") ? "checked" : ""; ?>/>                                                             
     160                        </td>
     161                    </tr>
     162                    <tr class="newsman_checkoutnewslettertypePanel" style="display: <?php echo (!empty($checkoutNewsletter) && $checkoutNewsletter == 'on') ? 'table-row' : 'none'; ?>;">
     163                        <th scope="row">
     164                            <label for="newsman_checkoutnewslettertype">Checkout newsletter subscribe checkbox event type</label>
     165                        </th>
     166                        <td>
     167
     168                        <select name="newsman_checkoutnewslettertype" id="">                   
     169                                <option value="save" <?php echo $checkoutNewsletterType == "save" ? "selected = ''" : ""; ?>>Subscribes a subscriber to the list</option>
     170                                <option value="init" <?php echo $checkoutNewsletterType == "init" ? "selected = ''" : ""; ?>>Inits a confirmed opt in subscribe to the list</option>
     171                            </select>                                                       
     172                        </td>
     173                    </tr>
     174                    <tr class="newsman_checkoutnewslettertypePanel" style="display: <?php echo (!empty($checkoutNewsletter) && $checkoutNewsletter == 'on') ? 'table-row' : 'none'; ?>;">
     175                        <th scope="row">
     176                            <label for="newsman_checkoutnewslettermessage">Checkout newsletter subscribe checkbox message</label>
     177                        </th>
     178                        <td>
     179
     180                        <input type="text" id="newsman_checkoutnewslettermessage" name="newsman_checkoutnewslettermessage" value="<?php echo (!empty($newsman_checkoutnewslettermessage)) ? $newsman_checkoutnewslettermessage : "Subscribe to our newsletter"; ?>"/>                                                   
     181                        </td>
     182                    </tr>
     183                    <tr class="newsman_checkoutnewslettertypePanel" style="display: <?php echo (!empty($checkoutNewsletter) && $checkoutNewsletter == 'on') ? 'table-row' : 'none'; ?>;">
     184                        <th scope="row">
     185                            <label for="newsman_checkoutnewsletterdefault">Checkout newsletter subscribe checkbox checked by default</label>
     186                        </th>
     187                        <td>
     188
     189                        <input name="newsman_checkoutnewsletterdefault" type="checkbox" id="newsman_checkoutnewsletterdefault" <?php echo (!empty($checkoutNewsletterDefault) && $checkoutNewsletterDefault == "on") ? "checked" : ""; ?>/>                                                             
     190                        </td>
     191                    </tr>
     192                    <tr class="newsman_checkoutnewslettertypePanel" style="display: <?php echo (!empty($checkoutNewsletter) && $checkoutNewsletter == 'on') ? 'table-row' : 'none'; ?>;">
     193                        <th scope="row">
     194                            <label for="newsman_form_id">Form_id: the form of the form used for the confirmation email / form settings. Forms can be created admin.</label>
     195                        </th>
     196                        <td>
     197
     198                        <input type="text" id="newsman_form_id" name="newsman_form_id" value="<?php echo (!empty($form_id)) ? $form_id : ""; ?>" placeholder="form id"/>                                                   
     199                        </td>
     200                    </tr>
     201
     202                    <th>
    152203                    </th>
    153                     <td>
    154 
    155                     <input name="newsman_checkoutsms" type="checkbox" id="newsman_checkoutsms" <?php echo (!empty($checkoutSMS) && $checkoutSMS == "on") ? "checked" : ""; ?>/>                                                             
    156                     </td>
    157                 </tr>
    158                 <tr class="newsman_checkoutnewslettertypePanel" style="display: <?php echo (!empty($checkoutNewsletter) && $checkoutNewsletter == 'on') ? 'table-row' : 'none'; ?>;">
    159                     <th scope="row">
    160                         <label for="newsman_checkoutnewslettertype">Checkout newsletter subscribe checkbox event type</label>
    161                     </th>
    162                     <td>
    163 
    164                     <select name="newsman_checkoutnewslettertype" id="">                   
    165                             <option value="save" <?php echo $checkoutNewsletterType == "save" ? "selected = ''" : ""; ?>>Subscribes a subscriber to the list</option>
    166                             <option value="init" <?php echo $checkoutNewsletterType == "init" ? "selected = ''" : ""; ?>>Inits a confirmed opt in subscribe to the list</option>
    167                         </select>                                                       
    168                     </td>
    169                 </tr>
    170                 <tr class="newsman_checkoutnewslettertypePanel" style="display: <?php echo (!empty($checkoutNewsletter) && $checkoutNewsletter == 'on') ? 'table-row' : 'none'; ?>;">
    171                     <th scope="row">
    172                         <label for="newsman_checkoutnewslettermessage">Checkout newsletter subscribe checkbox message</label>
    173                     </th>
    174                     <td>
    175 
    176                     <input type="text" id="newsman_checkoutnewslettermessage" name="newsman_checkoutnewslettermessage" value="<?php echo (!empty($newsman_checkoutnewslettermessage)) ? $newsman_checkoutnewslettermessage : "Subscribe to our newsletter"; ?>"/>                                                   
    177                     </td>
    178                 </tr>
    179                 <tr class="newsman_checkoutnewslettertypePanel" style="display: <?php echo (!empty($checkoutNewsletter) && $checkoutNewsletter == 'on') ? 'table-row' : 'none'; ?>;">
    180                     <th scope="row">
    181                         <label for="newsman_checkoutnewsletterdefault">Checkout newsletter subscribe checkbox checked by default</label>
    182                     </th>
    183                     <td>
    184 
    185                     <input name="newsman_checkoutnewsletterdefault" type="checkbox" id="newsman_checkoutnewsletterdefault" <?php echo (!empty($checkoutNewsletterDefault) && $checkoutNewsletterDefault == "on") ? "checked" : ""; ?>/>                                                             
    186                     </td>
    187                 </tr>
    188                 <tr class="newsman_checkoutnewslettertypePanel" style="display: <?php echo (!empty($checkoutNewsletter) && $checkoutNewsletter == 'on') ? 'table-row' : 'none'; ?>;">
    189                     <th scope="row">
    190                         <label for="newsman_form_id">Form_id: the form of the form used for the confirmation email / form settings. Forms can be created admin.</label>
    191                     </th>
    192                     <td>
    193 
    194                     <input type="text" id="newsman_form_id" name="newsman_form_id" value="<?php echo (!empty($form_id)) ? $form_id : ""; ?>" placeholder="form id"/>                                                   
    195                     </td>
    196                 </tr>
    197 
    198                 <th>
    199                 </th>
    200 
    201         </table>
    202         <div style="padding-top: 5px;">
    203             <input type="submit" value="Save Changes" class="button button-primary"/>
    204         </div>
    205     </form>
     204
     205            </table>
     206            <div style="padding-top: 5px;">
     207                <input type="submit" value="Save Changes" class="button button-primary"/>
     208            </div>
     209        </form>
     210    </div>
     211
     212    </section> 
     213  </div> 
    206214</div>
    207 
    208   </section> 
    209 </div> 
    210 </div>
     215   
  • newsmanapp/trunk/src/backend-sms.php

    r2979002 r3001900  
    11<?php
     2
     3$this->isOauth();
    24
    35if(!empty($_POST["newsman_action"]) && $_POST["newsman_action"] == "newsman_smsdevbtn")
     
    169171
    170172            <div class="<?php echo (is_array($this->message) && array_key_exists("status", $this->message)) ? $this->message["status"] : ""; ?>"><p><strong><?php echo (is_array($this->message) && array_key_exists("message", $this->message)) ? $this->message["message"] : ""; ?></strong>
    171                 </p></div>             
     173                </p></div>     
    172174           
    173175            <table class="form-table newsmanTable">
     
    220222
    221223                    </td>
    222                     <td class="newsman_smspendingtextPanel" <?php echo (empty($newsman_smspendingtext) || $newsman_smspendingtext == "off") ? 'style="display: none;"' : ""; ?>>
     224                    <td class="newsman_smspendingtextPanel" <?php echo (empty($newsman_smspendingactivate) || $newsman_smspendingactivate == "off") ? 'style="display: none;"' : ""; ?>>
    223225                        <textarea id="newsman_smspendingtext" name="newsman_smspendingtext" style="width: 100%; min-height: 100px;"><?php echo (!empty($newsman_smspendingtext)) ? $newsman_smspendingtext : "Order no. {{order_number}}, in total of {{order_total}} EURO, from example.com"; ?></textarea>
    224226                       
     
    236238
    237239                    </td>
    238                     <td class="newsman_smsfailedtextPanel" <?php echo (empty($newsman_smsfailedtext) || $newsman_smsfailedtext == "off") ? 'style="display: none;"' : ""; ?>>
     240                    <td class="newsman_smsfailedtextPanel" <?php echo (empty($newsman_smsfailedactivate) || $newsman_smsfailedactivate == "off") ? 'style="display: none;"' : ""; ?>>
    239241                        <textarea id="newsman_smsfailedtext" name="newsman_smsfailedtext" style="width: 100%; min-height: 100px;"><?php echo (!empty($newsman_smsfailedtext)) ? $newsman_smsfailedtext : "Order no. {{order_number}}, in total of {{order_total}} EURO, from example.com"; ?></textarea>
    240242                        <p class="newsman_smsfaileddescription" style="padding: 5px;">Variables: <span class="nVariable">{{billing_first_name}}</span><span class="nVariable">{{billing_last_name}}</span><span class="nVariable">{{shipping_first_name}}</span><span class="nVariable">{{shipping_last_name}}</span><span class="nVariable">{{order_number}}</span><span class="nVariable">{{order_date}}</span><span class="nVariable">{{order_total}}</span><span class="nVariable">{{email}}</span></p>
     
    249251                    <label for="newsman_smsonholdactivate">Activate</label>             
    250252                    <input name="newsman_smsonholdactivate" type="checkbox" id="newsman_smsonholdactivate" <?php echo (!empty($newsman_smsonholdactivate) && $newsman_smsonholdactivate == "on") ? "checked" : ""; ?>/>     
    251 
    252                     </td>
    253                     <td class="newsman_smsonholdtextPanel" <?php echo (empty($newsman_smsonholdtext) || $newsman_smsonholdtext == "off") ? 'style="display: none;"' : ""; ?>>
     253                    </td>
     254                    <td class="newsman_smsonholdtextPanel" <?php echo (empty($newsman_smsonholdactivate) || $newsman_smsonholdactivate == "off") ? 'style="display: none;"' : ""; ?>>
    254255                        <textarea id="newsman_smsonholdtext" name="newsman_smsonholdtext" style="width: 100%; min-height: 100px;"><?php echo (!empty($newsman_smsonholdtext)) ? $newsman_smsonholdtext : "Order no. {{order_number}}, in total of {{order_total}} EURO, from example.com"; ?></textarea>
    255256                        <p class="newsman_smsonholddescription" style="padding: 5px;">Variables: <span class="nVariable">{{billing_first_name}}</span><span class="nVariable">{{billing_last_name}}</span><span class="nVariable">{{shipping_first_name}}</span><span class="nVariable">{{shipping_last_name}}</span><span class="nVariable">{{order_number}}</span><span class="nVariable">{{order_date}}</span><span class="nVariable">{{order_total}}</span><span class="nVariable">{{email}}</span></p>
     
    266267
    267268                    </td>
    268                     <td class="newsman_smsprocessingtextPanel" <?php echo (empty($newsman_smsprocessingtext) || $newsman_smsprocessingtext == "off") ? 'style="display: none;"' : ""; ?>>
     269                    <td class="newsman_smsprocessingtextPanel" <?php echo (empty($newsman_smsprocessingactivate) || $newsman_smsprocessingactivate == "off") ? 'style="display: none;"' : ""; ?>>
    269270                        <textarea id="newsman_smsprocessingtext" name="newsman_smsprocessingtext" style="width: 100%; min-height: 100px;"><?php echo (!empty($newsman_smsprocessingtext)) ? $newsman_smsprocessingtext : "Order no. {{order_number}}, in total of {{order_total}} EURO, from example.com"; ?></textarea>
    270271                        <p class="newsman_smsprocessingdescription" style="padding: 5px;">Variables: <span class="nVariable">{{billing_first_name}}</span><span class="nVariable">{{billing_last_name}}</span><span class="nVariable">{{shipping_first_name}}</span><span class="nVariable">{{shipping_last_name}}</span><span class="nVariable">{{order_number}}</span><span class="nVariable">{{order_date}}</span><span class="nVariable">{{order_total}}</span><span class="nVariable">{{email}}</span></p>
  • newsmanapp/trunk/src/backend-sync.php

    r2979002 r3001900  
    11<?php
     2
     3$this->isOauth();
    24
    35if (!empty($_POST['newsman_sync']) && $_POST['newsman_sync'] == 'Y')
     
    7981    {
    8082        $this->valid_credential = false;
    81         $this->setMessageBackend('error', 'Invalid Credentials');
     83        $this->setMessageBackend('error', $e->getMessage());
    8284    }
    8385}
  • newsmanapp/trunk/src/backend-widget.php

    r2979002 r3001900  
     1<?php
     2
     3$this->isOauth();
     4
     5?>
     6
     7
    18<div class="tabsetImg">
    29    <a href="https://newsman.com" target="_blank">
     
    2835
    2936            <div class="<?php echo (is_array($this->message) && array_key_exists("status", $this->message)) ? $this->message["status"] : ""; ?>"><p><strong><?php echo (is_array($this->message) && array_key_exists("message", $this->message)) ? $this->message["message"] : ""; ?></strong>
    30                 </p></div>             
     37                </p></div>         
    3138
    3239                <table class="form-table">
  • newsmanapp/trunk/src/backend.php

    r2592734 r3001900  
    11<?php
    2 //Check if credentials are valid
     2
     3$this->isOauth();
     4
    35try
    46{
  • newsmanapp/trunk/src/css/style.css

    r2592734 r3001900  
    1010.newsmanTblFixed{
    1111  table-layout: fixed;
     12}
     13
     14.newsmanOauth td {
     15  padding: 3px 10px;
    1216}
    1317
     
    105109
    106110  .tabsetImg{
    107     text-align: left;
     111    text-align: center;
    108112    padding: 20px 0px;
     113  }
     114
     115  #tabOauth{
     116    text-align: center;
     117  }
     118
     119  #tabOauth .button{
     120    padding: 10px;
     121    margin: 10px;
    109122  }
    110123
  • newsmanapp/trunk/vendor/Newsman/Client.php

    r2452041 r3001900  
    187187       
    188188        $ret = curl_exec($cu);             
    189        
     189
    190190        $http_status = curl_getinfo($cu, CURLINFO_HTTP_CODE);
    191191        if ($http_status != 200)
  • newsmanapp/trunk/wc-newsman-remarketing.php

    r2992350 r3001900  
    66 * Author: Newsman
    77 * Author URI: https://newsman.com
    8  * Version: 2.5.3
     8 * Version: 2.6.0
    99 * WC requires at least: 2.1
    10  * WC tested up to: 4.1
     10 * WC tested up to: 8.3.1
    1111 * License: GPLv2 or later
    1212 * Text Domain: newsman-remarketing
     
    7676                                "name" => $cart_item["data"]->get_name(),
    7777                                "price" => $cart_item["data"]->get_price(),                     
    78                                 "quantity" => $cart_item['quantity']   
     78                                "quantity" => $cart_item['quantity']
    7979                            );                         
    8080                                                   
    81                           }                                                         
    82  
     81                         }                                                         
     82
    8383                         header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
    8484                         header("Cache-Control: post-check=0, pre-check=0", false);
Note: See TracChangeset for help on using the changeset viewer.