Plugin Directory

Changeset 2225635


Ignore:
Timestamp:
01/10/2020 08:28:00 PM (6 years ago)
Author:
emfluencekc
Message:

Plugin version 2.8.

Location:
wp-emfluence/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • wp-emfluence/trunk/admin.php

    r1914929 r2225635  
    118118  if(empty($data['api_key'])) return $data;
    119119
    120   // Create a new instance of the api
    121   $api = emfluence_get_api($data['api_key'], TRUE);
    122 
    123   // Ensure it works
    124   $result = $api->ping();
     120  try {
     121    $api = emfluence_get_api($data['api_key'], TRUE);
     122    // Ensure it works
     123    $result = $api->ping();
     124  } catch(Exception $e) {
     125    $result = FALSE;
     126    $exception_message = $e->getMessage();
     127  }
    125128  if( !$result || !$result->success ){
    126     $message = __('Unable to access the API using the api key provided. Error message: ') . $api->errors->get_last();
     129    $message = __('Unable to access the API using the api key provided. Error message: ') .
     130        (empty($exception_message) ? $api->errors->get_last(): $exception_message);
    127131    add_settings_error( 'api_key', 'api_key', $message , 'error' );
    128132    $data['api_key'] = '';
  • wp-emfluence/trunk/emfluence.php

    r1970139 r2225635  
    55Description: Easily add forms to your website for contacts to add or update their details in your emfluence Marketing Platform account.
    66Author: emfluence Digital Marketing
    7 Version: 2.7.1
     7Version: 2.8
    88Author URI: https://www.emfluence.com
    99Text Domain: emfl_form
  • wp-emfluence/trunk/notification/template-field.html

    r1914929 r2225635  
    1 <tr valign="top">
     1<tr valign="top" class="{{alternating}}">
    22  <td width="145"><label>{{label}}</label></td>
    33  <td>{{value}}</td>
  • wp-emfluence/trunk/notification/template.html

    r1914929 r2225635  
    243243        <tbody>
    244244        <tr>
    245           <td width="558" align="center"><span style="font-size:11px; font-family:Arial, Helvetica, sans-serif; color:#c2c6c9;"><strong>emfluence</strong> 106 W. 11th Street, Ste. 2220, Kansas City, MO 64105</span></td>
     245          <td width="558" align="center"><span style="font-size:11px; font-family:Arial, Helvetica, sans-serif; color:#c2c6c9;"><strong>emfluence</strong> 1720 Wyandotte St, Kansas City, MO 64108</span></td>
    246246        </tr>
    247247        </tbody>
  • wp-emfluence/trunk/readme.txt

    r2044686 r2225635  
    22Tags: email, email marketing, emailmarketing, emfluence, api, marketing automation, widget, email widget, email signup, mailing list, newsletter, form, automation
    33Requires at least: 4.0
    4 Tested up to: 5.1
    5 Stable tag: 2.7.1
     4Tested up to: 5.3.2
     5Stable tag: 2.8
    66Requires PHP: 5.6
    77Contributors: emfluencekc, mightyturtle
     
    5757== Changelog ==
    5858
     59= 2.8 =
     60* Minor style update to notification email.
     61* Minor improvements to emfluence API exception handling.
     62
    5963= 2.7.1 =
    6064* Performance improvement for admins.
  • wp-emfluence/trunk/widget.php

    r1970139 r2225635  
    3333
    3434    $options = get_option('emfluence_global');
    35     $api = emfluence_get_api($options['api_key']);
     35    try {
     36      $api = emfluence_get_api($options['api_key']);
     37    } catch(Exception $e) {
     38      return NULL;
     39    }
    3640    $groups = array();
    3741    $more = TRUE;
     
    225229      if( empty($messages) ){
    226230        // Try to subscribe them
    227         $options = get_option('emfluence_global');
    228         $api = emfluence_get_api($options['api_key']);
    229231
    230232        $data = array();
     
    277279        if(empty($data['customFields'])) unset($data['customFields']);
    278280
    279         $result = $api->contacts_save($data);
     281        try {
     282          $options = get_option('emfluence_global');
     283          $api = emfluence_get_api($options['api_key']);
     284          $result = $api->contacts_save($data);
     285        } catch(Exception $e) {
     286          $result = NULL;
     287        }
    280288
    281289        if( empty($result) ) {
     
    434442    $fields_html = array();
    435443    $field_template = file_get_contents(__DIR__ . '/notification/template-field.html');
     444    $alternating = 'even'; // a class that alternates on each row between "even" and "odd".
    436445    foreach($data as $field=>$val) {
     446      $alternating = ('even' === $alternating) ? 'odd' : 'even';
    437447      if($field == 'customFields') {
    438448        foreach($val as $custom_id=>$custom_val) {
     
    445455            $custom_val['value'] = wpautop($custom_val['value']);
    446456          }
    447           $fields_html[] = str_replace(array('{{label}}', '{{value}}'), array($label, $custom_val['value']), $field_template);
     457          $fields_html[] = str_replace(array('{{label}}', '{{value}}', '{{alternating}}'), array($label, $custom_val['value'], $alternating), $field_template);
    448458        }
    449459        continue;
    450460      }
    451       $fields_html[] = str_replace(array('{{label}}', '{{value}}'), array($field, $this->recursively_convert_to_string($val)), $field_template);
     461      $fields_html[] = str_replace(array('{{label}}', '{{value}}', '{{alternating}}'), array($field, $this->recursively_convert_to_string($val), $alternating), $field_template);
    452462    }
    453463    $intro = (empty($instance['notify-intro']) ? '' : wpautop($instance['notify-intro']));
     
    985995      return;
    986996    }
    987     $api = emfluence_get_api($options['api_key']);
    988997    static $ping = NULL;
    989     if(NULL === $ping) $ping = $api->ping();
    990     if( !$ping || !$ping->success ){
     998    try {
     999      $api = emfluence_get_api($options['api_key']);
     1000      if (NULL === $ping) $ping = $api->ping();
     1001    } catch(Exception $e) {}
     1002    if( (NULL === $ping) || !$ping || !$ping->success ){
    9911003      $output = '<h3>' . __('Authentication Failed') . '</h3>';
    9921004      $output .= '<p>' . __('Please check your api key to continue.') . '</p>';
Note: See TracChangeset for help on using the changeset viewer.