Easy Forms for MailChimp - Version 2.2.0

Version Description

  • Change plugin name
  • Add better MailChimp error messaging
  • Add Advanced Error Messaging option
  • Add required fields indication
  • Improve admin UI
  • Update FAQ and screenshots
  • Add list name to forms on Manage List Forms page
  • Implement fetching list fields via MailChimp API key
  • Fix incorrect use of register_uninstall_hook()
Download this release

Release Info

Developer yikesinc
Plugin Icon 128x128 Easy Forms for MailChimp
Version 2.2.0
Comparing to
See all releases

Code changes from version 2.1.0 to 2.2.0

classes/class.yksemeBase.php CHANGED
@@ -92,6 +92,7 @@ public function getOptionValue()
92
  'version' => YKSEME_VERSION_CURRENT,
93
  'api-key' => '',
94
  'flavor' => '0',
 
95
  'lists' => array()
96
  );
97
  $ov = get_option(YKSEME_OPTION, $defaultVals);
@@ -307,6 +308,7 @@ public function updateOptions($p)
307
  parse_str($p['form_data'], $fd);
308
  $this->optionVal['api-key'] = $fd['yks-mailchimp-api-key'];
309
  $this->optionVal['flavor'] = $fd['yks-mailchimp-flavor'];
 
310
  return update_option(YKSEME_OPTION, $this->optionVal);
311
  }
312
  return false;
@@ -323,12 +325,158 @@ public function updateVersion($k)
323
  }
324
 
325
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
326
 
327
 
328
 
329
  /***** LIST ACTIONS
330
  ****************************************************************************************************/
331
- public function addList($lid='')
332
  {
333
  if($lid == '' || isset($this->optionVal['lists'][$list['id']])) return false;
334
  $api = new wpyksMCAPI($this->optionVal['api-key']);
@@ -338,6 +486,7 @@ public function addList($lid='')
338
  $list = array(
339
  'id' => $lid,
340
  'list-id' => $lid,
 
341
  'fields' => $this->getImportedFieldsArray($lid, $mv)
342
  );
343
  $this->optionVal['lists'][$list['id']] = $list;
@@ -348,6 +497,54 @@ public function addList($lid='')
348
  }
349
  return false;
350
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
351
  public function sortList($p)
352
  {
353
  if(empty($p['update_string'])
@@ -415,6 +612,7 @@ public function importList($i=false)
415
  else
416
  {
417
  $lid = $this->optionVal['lists'][$i]['list-id'];
 
418
  $api = new wpyksMCAPI($this->optionVal['api-key']);
419
  $mv = $api->listMergeVars($lid);
420
  if($mv)
@@ -533,8 +731,9 @@ public function processSnippet($list=false)
533
  public function addAdministrationMenu()
534
  {
535
  // Top Level Menu
536
- add_menu_page('Mailchimp Forms', 'Mailchimp Forms', 'manage_options', 'yks-mailchimp-form', array(&$this, 'generatePageOptions'), YKSEME_URL.'images/ykseme_16px.png', 400);
537
  // Sub Items
 
538
  add_submenu_page('yks-mailchimp-form', 'Manage List Forms', 'Manage List Forms', 'manage_options', 'yks-mailchimp-form-lists', array(&$this, 'generatePageLists'));
539
  add_submenu_page('yks-mailchimp-form', 'About YIKES, Inc.', 'About YIKES, Inc.', 'manage_options', 'yks-mailchimp-about-yikes', array(&$this, 'generatePageAboutYikes'));
540
  }
@@ -607,7 +806,8 @@ public function addUserToMailchimp($p)
607
  endif; endforeach;
608
 
609
  // If no email, fail
610
- if($email === false) return false;
 
611
 
612
  // By default this sends a confirmation email - you will not see new members
613
  // until the link contained in it is clicked!
@@ -615,12 +815,12 @@ public function addUserToMailchimp($p)
615
 
616
  if($api->errorCode)
617
  {
618
- return false;
619
  }
620
- else return true;
621
  }
622
  }
623
- return false;
624
  }
625
 
626
  private function getFieldMergeVar($fn, $lid)
@@ -651,6 +851,7 @@ private function getFieldMergeVar($fn, $lid)
651
  public function generateListContainers($listArr=false)
652
  {
653
  $listArr = ($listArr == false ? $this->optionVal['lists'] : $listArr);
 
654
  if(count($listArr) > 0)
655
  {
656
  ob_start();
@@ -661,22 +862,59 @@ public function generateListContainers($listArr=false)
661
  <div class="yks-status" id="yks-status_<?php echo $list['id']; ?>"></div>
662
  <form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
663
  <input type="hidden" name="yks-mailchimp-unique-id" id="yks-mailchimp-unique-id_<?php echo $list['id']; ?>" value="<?php echo $list['id']; ?>" />
664
- <table class="form-table">
665
  <tbody>
666
  <tr valign="top">
667
- <th scope="row"><label for="yks-mailchimp-api-key">Shortcode</label></th>
668
- <td><strong>[yks-mailchimp-list id="<?php echo $list['id']; ?>"]</strong></td>
669
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
670
  <tr valign="top">
671
- <th scope="row"><label for="yks-mailchimp-api-key">Snippet</label></th>
672
- <td><strong><?php echo htmlentities('<?php echo yksemeProcessSnippet(\''.$list['id'].'\'); ?>'); ?></strong></td>
 
 
 
673
  </tr>
674
  <tr valign="top">
675
- <th scope="row"><label for="yks-mailchimp-api-key">Mailchimp List Id</label></th>
676
- <td><strong><?php echo $list['list-id']; ?></strong></td>
 
 
 
677
  </tr>
678
  <tr valign="top">
679
- <th scope="row"><label for="api-key">Active Fields</label></th>
 
 
 
 
 
 
 
 
 
680
  <td class="yks-mailchimp-fields-td" id="yks-mailchimp-fields-td_<?php echo $list['id']; ?>">
681
  <fieldset class="yks-mailchimp-fields-container" id="yks-mailchimp-fields-container_<?php echo $list['id']; ?>">
682
  <legend class="screen-reader-text"><span>Active Fields</span></legend>
@@ -687,23 +925,27 @@ public function generateListContainers($listArr=false)
687
  <span class="yks-mailchimp-sorthandle">Drag &amp; drop</span>
688
  <input type="checkbox" name="<?php echo $field['name']; ?>" id="<?php echo $field['id']; ?>" value="1" <?php echo ($field['active'] == 1 ? 'checked="checked"' : ''); ?><?php echo ($field['require'] == 1 ? 'disabled="disabled"' : ''); ?> />
689
  &nbsp;
690
- <span class="yks-mailchimp-field-name"><?php echo $field['label']; ?></span>
691
  </label>
692
- <span class="yks-mailchimp-field-merge">*|<input type="text" name="<?php echo $field['name']; ?>-merge" id="<?php echo $field['id']; ?>-merge" value="<?php echo $field['merge']; ?>"<?php echo (($field['locked'] == 1 || $field['merge'] == false) ? ' disabled="disabled"' : ''); ?> />|*</span>
693
  </div>
694
  <?php } ?>
695
  </div>
696
  </fieldset>
697
  </td>
698
  </tr>
 
 
 
 
 
 
 
 
699
  </tbody>
700
  </table>
701
 
702
- <p class="submit">
703
- <input type="submit" name="submit" class="yks-mailchimp-list-update button-primary" value="Update List Options" rel="<?php echo $list['id']; ?>" />
704
- <input type="button" name="delete" class="yks-mailchimp-delete button-primary" value="Delete List" rel="<?php echo $list['id']; ?>" />
705
- <input type="button" name="import" class="yks-mailchimp-import button-primary" value="Import List Data" rel="<?php echo $list['id']; ?>" />
706
- </p>
707
  </form>
708
  </div>
709
  <?php
@@ -722,13 +964,15 @@ public function getFrontendFormJavascript($list='')
722
  foreach($list['fields'] as $field) : if($field['active'] == 1) :
723
  // Setup javascript
724
  if($field['require'] == '1') :
725
- $prefix = "ymce";
726
  $js .= "\n";
727
  switch($field['type'])
728
  {
729
  default:
 
 
730
  $js .= <<<JSC
731
- if($$prefix('#{$field[id]}').val() == '')
732
  {
733
  msg += '* {$field[label]}'+"\\n";
734
  err++;
@@ -737,22 +981,22 @@ JSC;
737
  break;
738
  case 'address':
739
  $js .= <<<JSC
740
- if($$prefix('#{$field[id]}').val() == '')
741
  {
742
  msg += '* {$field[label]}: Street Address'+"\\n";
743
  err++;
744
  }
745
- if($$prefix('#{$field[id]}-city').val() == '')
746
  {
747
  msg += '* {$field[label]}: City'+"\\n";
748
  err++;
749
  }
750
- if($$prefix('#{$field[id]}-state').val() == '')
751
  {
752
  msg += '* {$field[label]}: State'+"\\n";
753
  err++;
754
  }
755
- if($$prefix('#{$field[id]}-zip').val() == '')
756
  {
757
  msg += '* {$field[label]}: Zip Code'+"\\n";
758
  err++;
@@ -761,7 +1005,7 @@ JSC;
761
  break;
762
  case 'radio':
763
  $js .= <<<JSC
764
- if($$prefix('.{$field[name]}:checked').length <= 0)
765
  {
766
  msg += '* {$field[label]}'+"\\n";
767
  err++;
@@ -787,29 +1031,55 @@ public function getFrontendFormDisplay($list='')
787
  <table class="yks-mailchimpFormTable">
788
  <tbody>
789
  <?php foreach($list['fields'] as $field) : if($field['active'] == 1) : ?>
790
- <tr class="yks-mailchimpFormTableRow">
791
- <td class="prompt yks-mailchimpFormTableRowLabel"><label class="yks-mailchimpFormTdLabel" for="<?php echo $field['name']; ?>"><?php echo $field['label']; ?></label></td>
792
- <td class="yks-mailchimpFormTableRowField">
793
- <?php echo $this->getFrontendFormDisplay_field($field); ?>
794
- </td>
795
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
796
  <?php endif; endforeach; ?>
797
  <tr>
798
  <td colspan="2" class="yks-mailchimpFormTableSubmit">
799
- <p><input type="submit" class="ykfmc-submit" id="ykfmc-submit_<?php echo $list['id']; ?>" value="Submit" /></p>
 
 
800
  </td>
801
  </tr>
802
  </tbody>
803
  </table>
804
  <?php
805
- break;
806
-
807
- case '1':
808
  ?>
809
  <div class="yks-mailchimpFormDiv">
810
  <?php foreach($list['fields'] as $field) : if($field['active'] == 1) : ?>
 
 
 
 
 
 
 
 
 
 
 
 
811
  <div class="yks-mailchimpFormDivRow">
812
- <label class="prompt yks-mailchimpFormDivRowLabel" for="<?php echo $field['name']; ?>"><?php echo $field['label']; ?></label>
813
  <div class="yks-mailchimpFormDivRowField">
814
  <?php echo $this->getFrontendFormDisplay_field($field); ?>
815
  </div>
@@ -1027,6 +1297,7 @@ private function runUpdateTasks_1_2_0()
1027
  private function runUpdateTasks_1_3_0()
1028
  {
1029
  $this->optionVal['flavor'] = '0';
 
1030
  if($this->optionVal['lists'])
1031
  {
1032
  foreach($this->optionVal['lists'] as $uid => $list)
92
  'version' => YKSEME_VERSION_CURRENT,
93
  'api-key' => '',
94
  'flavor' => '0',
95
+ 'debug' => '0',
96
  'lists' => array()
97
  );
98
  $ov = get_option(YKSEME_OPTION, $defaultVals);
308
  parse_str($p['form_data'], $fd);
309
  $this->optionVal['api-key'] = $fd['yks-mailchimp-api-key'];
310
  $this->optionVal['flavor'] = $fd['yks-mailchimp-flavor'];
311
+ $this->optionVal['debug'] = $fd['yks-mailchimp-debug'];
312
  return update_option(YKSEME_OPTION, $this->optionVal);
313
  }
314
  return false;
325
  }
326
 
327
 
328
+ /********Mailchimp Error Codes
329
+ *****************************************************************************************************/
330
+
331
+ public function YksMCErrorCodes ($error)
332
+ {
333
+ //Server Errors
334
+ $errorcode['-32601'][1] = 'ServerError_MethodUnknown';
335
+ $errorcode['-32602'][1] = 'ServerError_InvalidParameters';
336
+ $errorcode['-99'][1] = 'Unknown_Exception';
337
+ $errorcode['-98'][1] = 'Request_TimedOut';
338
+ $errorcode['-92'][1] = 'Zend_Uri_Exception';
339
+ $errorcode['-91'][1] = 'PDOException';
340
+ $errorcode['-91'][1] = 'Avesta_Db_Exception';
341
+ $errorcode['-90'][1] = 'XML_RPC2_Exception';
342
+ $errorcode['-90'][1] = 'XML_RPC2_FaultException';
343
+ $errorcode['-50'][1] = 'Too_Many_Connections';
344
+ $errorcode['0'][1] = 'Parse_Exception';
345
+
346
+ $errormessage[1] = "Sorry, we can't connect to MailChimp at this time. Please come back later and try again.";
347
+
348
+ //API User or API Key error
349
+ $errorcode['100'][2] = 'User_Unknown';
350
+ $errorcode['101'][2] = 'User_Disabled';
351
+ $errorcode['102'][2] = 'User_DoesNotExist';
352
+ $errorcode['103'][2] = 'User_NotApproved';
353
+ $errorcode['104'][2] = 'Invalid_ApiKey';
354
+ $errorcode['105'][2] = 'User_UnderMaintenance';
355
+ $errorcode['106'][2] = 'Invalid_AppKey';
356
+ $errorcode['107'][2] = 'Invalid_IP';
357
+ $errorcode['108'][2] = 'User_DoesExist';
358
+ $errorcode['109'][2] = 'User_InvalidRole';
359
+ $errorcode['120'][2] = 'User_InvalidAction';
360
+ $errorcode['121'][2] = 'User_MissingEmail';
361
+ $errorcode['122'][2] = 'User_CannotSendCampaign';
362
+ $errorcode['123'][2] = 'User_MissingModuleOutbox';
363
+ $errorcode['124'][2] = 'User_ModuleAlreadyPurchased';
364
+ $errorcode['125'][2] = 'User_ModuleNotPurchased';
365
+ $errorcode['126'][2] = 'User_NotEnoughCredit';
366
+ $errorcode['127'][2] = 'MC_InvalidPayment';
367
+
368
+ $errormessage[2] = "Sorry, this MailChimp account does not exist.";
369
+
370
+ // List errors
371
+ $errorcode['200'][3] = 'List_DoesNotExist';
372
+ $errorcode['210'][3] = 'List_InvalidInterestFieldType';
373
+ $errorcode['211'][3] = 'List_InvalidOption';
374
+ $errorcode['212'][3] = 'List_InvalidUnsubMember';
375
+ $errorcode['213'][3] = 'List_InvalidBounceMember';
376
+
377
+ $errormessage[3] = "Sorry, this list does not exist.";
378
+
379
+ //Already subscribed or unsubscribed
380
+ $errorcode['214'][4] = 'List_AlreadySubscribed';
381
+ $errorcode['215'][4] = 'List_NotSubscribed';
382
+ $errorcode['220'][4] = 'List_InvalidImport';
383
+ $errorcode['221'][4] = 'MC_PastedList_Duplicate';
384
+ $errorcode['222'][4] = 'MC_PastedList_InvalidImport';
385
+ $errorcode['230'][4] = 'Email_AlreadySubscribed';
386
+ $errorcode['231'][4] = 'Email_AlreadyUnsubscribed';
387
+ $errorcode['232'][4] = 'Email_NotExists';
388
+ $errorcode['233'][4] = 'Email_NotSubscribed';
389
+
390
+ $errormessage[4] = "Sorry, you are already subscribed to this list.";
391
+
392
+ // General Message
393
+ $errorcode['250'][5] = 'List_MergeFieldRequired';
394
+ $errorcode['251'][5] = 'List_CannotRemoveEmailMerge';
395
+ $errorcode['252'][5] = 'List_Merge_InvalidMergeID';
396
+ $errorcode['253'][5] = 'List_TooManyMergeFields';
397
+ $errorcode['254'][5] = 'List_InvalidMergeField';
398
+ $errorcode['270'][5] = 'List_InvalidInterestGroup';
399
+ $errorcode['271'][5] = 'List_TooManyInterestGroups';
400
+ $errorcode['300'][5] = 'Campaign_DoesNotExist';
401
+ $errorcode['301'][5] = 'Campaign_StatsNotAvailable';
402
+ $errorcode['310'][5] = 'Campaign_InvalidAbsplit';
403
+ $errorcode['311'][5] = 'Campaign_InvalidContent';
404
+ $errorcode['312'][5] = 'Campaign_InvalidOption';
405
+ $errorcode['313'][5] = 'Campaign_InvalidStatus';
406
+ $errorcode['314'][5] = 'Campaign_NotSaved';
407
+ $errorcode['315'][5] = 'Campaign_InvalidSegment';
408
+ $errorcode['316'][5] = 'Campaign_InvalidRss';
409
+ $errorcode['317'][5] = 'Campaign_InvalidAuto';
410
+ $errorcode['318'][5] = 'MC_ContentImport_InvalidArchive';
411
+ $errorcode['319'][5] = 'Campaign_BounceMissing';
412
+ $errorcode['330'][5] = 'Invalid_EcommOrder';
413
+ $errorcode['350'][5] = 'Absplit_UnknownError';
414
+ $errorcode['351'][5] = 'Absplit_UnknownSplitTest';
415
+ $errorcode['352'][5] = 'Absplit_UnknownTestType';
416
+ $errorcode['353'][5] = 'Absplit_UnknownWaitUnit';
417
+ $errorcode['354'][5] = 'Absplit_UnknownWinnerType';
418
+ $errorcode['355'][5] = 'Absplit_WinnerNotSelected';
419
+
420
+ $errormessage[5] = 'Sorry, MailChimp could not process your signup.';
421
+
422
+ // Validation errors
423
+ $errorcode['500'][6] = 'Invalid_Analytics';
424
+ $errorcode['503'][6] = 'Invalid_SendType';
425
+ $errorcode['504'][6] = 'Invalid_Template';
426
+ $errorcode['505'][6] = 'Invalid_TrackingOptions';
427
+ $errorcode['506'][6] = 'Invalid_Options';
428
+ $errorcode['507'][6] = 'Invalid_Folder';
429
+ $errorcode['550'][6] = 'Module_Unknown';
430
+ $errorcode['551'][6] = 'MonthlyPlan_Unknown';
431
+ $errorcode['552'][6] = 'Order_TypeUnknown';
432
+ $errorcode['553'][6] = 'Invalid_PagingLimit';
433
+ $errorcode['554'][6] = 'Invalid_PagingStart';
434
+ $errorcode['555'][6] = 'Max_Size_Reached';
435
+ $errorcode['556'][6] = 'MC_SearchException';
436
+
437
+ $errormessage[6] = "Sorry, MailChimp doesn't like the data you are trying to send.";
438
+
439
+ // Validate date and time field
440
+ $errorcode['501'][7] = 'Invalid_DateTimel';
441
+
442
+ $errormessage[7] = "Sorry, that date and time is invalid. Please try again.";
443
+
444
+ //Validate Email
445
+ $errorcode['502'][8] = 'Invalid_Email';
446
+
447
+ $errormessage[8] = "Sorry, that email address is invalid. Please try again.";
448
+
449
+ // Validate URL fields
450
+ $errorcode['508'][9] = 'Invalid_URL';
451
+
452
+ $errormessage[9] = "Sorry, that URL is invalid. Please try again.";
453
+
454
+ // Get error message
455
+
456
+ foreach ($errorcode as $eid => $value )
457
+ {
458
+ if ($eid == $error)
459
+ {
460
+ foreach ($value as $key => $mssg)
461
+ {
462
+ $Message = $errormessage[$key];
463
+ if ( $this->optionVal['debug'] == '1')
464
+ {
465
+ $Message .= '<br /><strong>Error Code: '.$error.' - '.$mssg.'</strong><br />';
466
+ $Message .= 'For more info, <a href="http://apidocs.mailchimp.com/api/1.3/exceptions.field.php">visit the MailChimp website</a> or <a href="http://kb.mailchimp.com/home">contact MailChimp</a>';
467
+ }
468
+ }
469
+ }
470
+ }
471
+ return $Message;
472
+
473
+ }
474
 
475
 
476
 
477
  /***** LIST ACTIONS
478
  ****************************************************************************************************/
479
+ public function addList($lid='' , $name='')
480
  {
481
  if($lid == '' || isset($this->optionVal['lists'][$list['id']])) return false;
482
  $api = new wpyksMCAPI($this->optionVal['api-key']);
486
  $list = array(
487
  'id' => $lid,
488
  'list-id' => $lid,
489
+ 'name' => $name,
490
  'fields' => $this->getImportedFieldsArray($lid, $mv)
491
  );
492
  $this->optionVal['lists'][$list['id']] = $list;
497
  }
498
  return false;
499
  }
500
+ public function getLists()
501
+ {
502
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
503
+ $lists = $this->getListsData();
504
+ $listArr = ($listArr == false ? $this->optionVal['lists'] : $listArr);
505
+ $theusedlist = array();
506
+ if(count($listArr) > 0)
507
+ {
508
+ foreach($listArr as $list)
509
+ {
510
+ $theusedlist[] = $list['id'];
511
+ }
512
+ }
513
+ if($lists)
514
+ {
515
+ echo "<select id='yks-list-select' name='yks-list-select'>";
516
+ echo "<option value=''> Select List</option>";
517
+ foreach ($lists as $lkey => $lvalue)
518
+ {
519
+ if (!in_array($lkey, $theusedlist))
520
+ {
521
+ echo "<option value='".$lkey."'>".$lvalue."</option>";
522
+ }
523
+ }
524
+ echo "</select>";
525
+ }
526
+ return false;
527
+ }
528
+ public function getListsData()
529
+ {
530
+ $theListItems = get_transient('yks-mcp-listdata-retrieved');
531
+ if (!$theListItems)
532
+ {
533
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
534
+ $lists = $api->lists();
535
+ if($lists)
536
+ {
537
+ foreach ($lists['data'] as $list)
538
+ {
539
+
540
+ $theListItems[$list['id']] = $list['name'];
541
+
542
+ }
543
+ }
544
+ set_transient( 'yks-mcp-listdata-retrieved', $theListItems, 60*5 ); //cache lists for 5 minutes
545
+ }
546
+ return $theListItems;
547
+ }
548
  public function sortList($p)
549
  {
550
  if(empty($p['update_string'])
612
  else
613
  {
614
  $lid = $this->optionVal['lists'][$i]['list-id'];
615
+ $name = $this->optionVal['lists'][$i]['name'];
616
  $api = new wpyksMCAPI($this->optionVal['api-key']);
617
  $mv = $api->listMergeVars($lid);
618
  if($mv)
731
  public function addAdministrationMenu()
732
  {
733
  // Top Level Menu
734
+ add_menu_page('MailChimp Forms', 'MailChimp Forms', 'manage_options', 'yks-mailchimp-form', array(&$this, 'generatePageOptions'), YKSEME_URL.'images/ykseme_16px.png', 400);
735
  // Sub Items
736
+ add_submenu_page('yks-mailchimp-form', 'MailChimp Forms', 'MailChimp Settings', 'manage_options', 'yks-mailchimp-form', array(&$this, 'generatePageOptions'));
737
  add_submenu_page('yks-mailchimp-form', 'Manage List Forms', 'Manage List Forms', 'manage_options', 'yks-mailchimp-form-lists', array(&$this, 'generatePageLists'));
738
  add_submenu_page('yks-mailchimp-form', 'About YIKES, Inc.', 'About YIKES, Inc.', 'manage_options', 'yks-mailchimp-about-yikes', array(&$this, 'generatePageAboutYikes'));
739
  }
806
  endif; endforeach;
807
 
808
  // If no email, fail
809
+ $noemail = "The email address is blank";
810
+ if($email === false) return $noemail;
811
 
812
  // By default this sends a confirmation email - you will not see new members
813
  // until the link contained in it is clicked!
815
 
816
  if($api->errorCode)
817
  {
818
+ return $this->YksMCErrorCodes ($api->errorCode);
819
  }
820
+ else return "done";
821
  }
822
  }
823
+ return "One or more fields are empty";
824
  }
825
 
826
  private function getFieldMergeVar($fn, $lid)
851
  public function generateListContainers($listArr=false)
852
  {
853
  $listArr = ($listArr == false ? $this->optionVal['lists'] : $listArr);
854
+ $thelistdata = $this->getListsData(); //Get list names from API
855
  if(count($listArr) > 0)
856
  {
857
  ob_start();
862
  <div class="yks-status" id="yks-status_<?php echo $list['id']; ?>"></div>
863
  <form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
864
  <input type="hidden" name="yks-mailchimp-unique-id" id="yks-mailchimp-unique-id_<?php echo $list['id']; ?>" value="<?php echo $list['id']; ?>" />
865
+ <table class="form-table yks-admin-form">
866
  <tbody>
867
  <tr valign="top">
868
+ <th scope="row"><label for="yks-mailchimp-api-key">MailChimp List name</label></th>
869
+ <td class="yks-mailchimp-listname"><?php
870
+ if ($list['name'])
871
+ {
872
+ $thename = $list['name'];
873
+ echo $thename;
874
+ }
875
+ else
876
+ {
877
+ foreach ($thelistdata as $lkey => $lval)
878
+ {
879
+ if ($lkey == $list['id'])
880
+ {
881
+ $thename = $lval;
882
+ echo $thename;
883
+ }
884
+ }
885
+ }
886
+ ?></td>
887
+ </tr>
888
+ <tr valign="top">
889
+ <th scope="row"><label for="yks-mailchimp-api-key">MailChimp List ID</label></th>
890
+ <td><?php echo $list['list-id']; ?>
891
+ </td>
892
+ </tr>
893
  <tr valign="top">
894
+ <th scope="row"><label for="yks-mailchimp-api-key">Shortcode</label></th>
895
+ <td>
896
+ [yks-mailchimp-list id="<?php echo $list['id']; ?>"]
897
+ <span class="description yks-margin-left">Paste this shortcode into whatever page or post you want to add this form to</span>
898
+ </td>
899
  </tr>
900
  <tr valign="top">
901
+ <th scope="row"><label for="yks-mailchimp-api-key">PHP Snippet</label></th>
902
+ <td>
903
+ <?php echo htmlentities('<?php echo yksemeProcessSnippet(\''.$list['id'].'\'); ?>'); ?>
904
+ <span class="description yks-margin-left">Use this code to add this form to a template file</span>
905
+ </td>
906
  </tr>
907
  <tr valign="top">
908
+ <td scope="row">
909
+ <label for="api-key"><strong>Form Fields</strong></label>
910
+ <p class="description">
911
+ Check the fields you want included in your form (Email Address is required).
912
+ </p>
913
+ <p class="description">
914
+ Use the green arrows to drag-and-drop the fields and rearrange their order.
915
+ <span class="yks-mailchimp-sorthandle-img"></span>
916
+ </p>
917
+ </th>
918
  <td class="yks-mailchimp-fields-td" id="yks-mailchimp-fields-td_<?php echo $list['id']; ?>">
919
  <fieldset class="yks-mailchimp-fields-container" id="yks-mailchimp-fields-container_<?php echo $list['id']; ?>">
920
  <legend class="screen-reader-text"><span>Active Fields</span></legend>
925
  <span class="yks-mailchimp-sorthandle">Drag &amp; drop</span>
926
  <input type="checkbox" name="<?php echo $field['name']; ?>" id="<?php echo $field['id']; ?>" value="1" <?php echo ($field['active'] == 1 ? 'checked="checked"' : ''); ?><?php echo ($field['require'] == 1 ? 'disabled="disabled"' : ''); ?> />
927
  &nbsp;
928
+ <div class="yks-mailchimp-field-name"><?php echo $field['label']; ?></div>
929
  </label>
930
+ <span class="yks-mailchimp-field-merge"><span class="description">Merge field:</span> &nbsp; *|<input type="text" name="<?php echo $field['name']; ?>-merge" id="<?php echo $field['id']; ?>-merge" value="<?php echo $field['merge']; ?>"<?php echo (($field['locked'] == 1 || $field['merge'] == false) ? ' disabled="disabled"' : ''); ?> />|*</span>
931
  </div>
932
  <?php } ?>
933
  </div>
934
  </fieldset>
935
  </td>
936
  </tr>
937
+ <tr>
938
+ <td></td>
939
+ <td>
940
+ <input type="submit" name="submit" class="yks-mailchimp-list-update button-primary" value="Save Form Settings" rel="<?php echo $list['id']; ?>" />
941
+ <input type="button" name="delete" class="yks-mailchimp-delete button-primary" value="Delete Form" rel="<?php echo $list['id']; ?>" data-title="<?php echo $thename; ?>" />
942
+ <input type="button" name="import" class="yks-mailchimp-import button-primary" value="Re-Import Form Fields from MailChimp" rel="<?php echo $list['id']; ?>" />
943
+ </td>
944
+ </tr>
945
  </tbody>
946
  </table>
947
 
948
+
 
 
 
 
949
  </form>
950
  </div>
951
  <?php
964
  foreach($list['fields'] as $field) : if($field['active'] == 1) :
965
  // Setup javascript
966
  if($field['require'] == '1') :
967
+ $prefix = "$ymce";
968
  $js .= "\n";
969
  switch($field['type'])
970
  {
971
  default:
972
+ $prefixa = "ymce";
973
+ $js .= "if ($".$prefixa."('#{$field[id]}').val() == '')";
974
  $js .= <<<JSC
975
+
976
  {
977
  msg += '* {$field[label]}'+"\\n";
978
  err++;
981
  break;
982
  case 'address':
983
  $js .= <<<JSC
984
+ if($prefix('#{$field[id]}').val() == '')
985
  {
986
  msg += '* {$field[label]}: Street Address'+"\\n";
987
  err++;
988
  }
989
+ if($prefix('#{$field[id]}-city').val() == '')
990
  {
991
  msg += '* {$field[label]}: City'+"\\n";
992
  err++;
993
  }
994
+ if($prefix('#{$field[id]}-state').val() == '')
995
  {
996
  msg += '* {$field[label]}: State'+"\\n";
997
  err++;
998
  }
999
+ if($prefix('#{$field[id]}-zip').val() == '')
1000
  {
1001
  msg += '* {$field[label]}: Zip Code'+"\\n";
1002
  err++;
1005
  break;
1006
  case 'radio':
1007
  $js .= <<<JSC
1008
+ if($prefix('.{$field[name]}:checked').length <= 0)
1009
  {
1010
  msg += '* {$field[label]}'+"\\n";
1011
  err++;
1031
  <table class="yks-mailchimpFormTable">
1032
  <tbody>
1033
  <?php foreach($list['fields'] as $field) : if($field['active'] == 1) : ?>
1034
+ <?php
1035
+ if ($field['require'] == 1)
1036
+ {
1037
+ $reqindicator = " <span class='yks-required-label'>*</span>";
1038
+ $reqlabel = " yks-mailchimpFormDivRowLabel-required";
1039
+ }
1040
+ else
1041
+ {
1042
+ $reqindicator = "";
1043
+ $reqlabel = "";
1044
+ }
1045
+ ?>
1046
+ <tr class="yks-mailchimpFormTableRow">
1047
+ <td class="prompt yks-mailchimpFormTableRowLabel"><label class="yks-mailchimpFormTdLabel<?php echo $reqlabel; ?>" for="<?php echo $field['name']; ?>"><?php echo $field['label']; ?></label><?php echo $reqindicator; ?></td>
1048
+ <td class="yks-mailchimpFormTableRowField">
1049
+ <?php echo $this->getFrontendFormDisplay_field($field); ?>
1050
+ </td>
1051
+ </tr>
1052
  <?php endif; endforeach; ?>
1053
  <tr>
1054
  <td colspan="2" class="yks-mailchimpFormTableSubmit">
1055
+ <p>
1056
+ <input type="submit" class="ykfmc-submit" id="ykfmc-submit_<?php echo $list['id']; ?>" value="Submit" />
1057
+ </p>
1058
  </td>
1059
  </tr>
1060
  </tbody>
1061
  </table>
1062
  <?php
1063
+ break;
1064
+
1065
+ case '1':
1066
  ?>
1067
  <div class="yks-mailchimpFormDiv">
1068
  <?php foreach($list['fields'] as $field) : if($field['active'] == 1) : ?>
1069
+ <?php
1070
+ if ($field['require'] == 1)
1071
+ {
1072
+ $reqindicator = " <span class='yks-required-label'>*</span>";
1073
+ $reqlabel = " yks-mailchimpFormDivRowLabel-required";
1074
+ }
1075
+ else
1076
+ {
1077
+ $reqindicator = "";
1078
+ $reqlabel = "";
1079
+ }
1080
+ ?>
1081
  <div class="yks-mailchimpFormDivRow">
1082
+ <label class="prompt yks-mailchimpFormDivRowLabel<?php echo $reqlabel; ?>" for="<?php echo $field['name']; ?>"><?php echo $field['label']; ?><?php echo $reqindicator; ?></label>
1083
  <div class="yks-mailchimpFormDivRowField">
1084
  <?php echo $this->getFrontendFormDisplay_field($field); ?>
1085
  </div>
1297
  private function runUpdateTasks_1_3_0()
1298
  {
1299
  $this->optionVal['flavor'] = '0';
1300
+ $this->optionVal['debug'] = '0';
1301
  if($this->optionVal['lists'])
1302
  {
1303
  foreach($this->optionVal['lists'] as $uid => $list)
css/style.ykseme.css CHANGED
@@ -1,34 +1,31 @@
1
- #ykseme-icon
2
- {
3
- background: transparent url('../images/ykseme_32px_color.png') no-repeat 0 0;
4
- }
5
 
6
- #yksme-yikes-logo-container {float:right;
7
- margin: 0 20px 20px 20px;
8
- width: 300px;}
9
-
10
- #yksme-yikes-logo-container .b-sbn {float:right;
11
- margin: 0 0 0 -8px;}
12
 
13
- #yksme-yikes-logo
14
- {
15
- border: 0;
16
- padding: 0;
17
- margin: 0 0 20px 0;
18
- display: block;
19
- }
20
- .yks-hidden
21
- {
22
- display: none;
23
- }
24
- .yks-status
25
- {
 
 
 
 
 
 
26
  display: none;
27
  width: 100%;
28
  clear: both;
29
- }
30
- .yks-status .yks-success
31
- {
32
  color: #000;
33
  width: 80%;
34
  height: auto;
@@ -37,9 +34,8 @@
37
  clear: both;
38
  margin: 15px auto 15px auto;
39
  text-align: center;
40
- }
41
- .yks-status .yks-error
42
- {
43
  color: #000;
44
  width: 80%;
45
  height: auto;
@@ -48,9 +44,12 @@
48
  clear: both;
49
  margin: 15px auto 15px auto;
50
  text-align: center;
51
- }
52
- .yks-status .yks-notice
53
- {
 
 
 
54
  color: #000;
55
  width: 80%;
56
  height: auto;
@@ -61,12 +60,9 @@
61
  padding: 5px;
62
  position: relative;
63
  text-align: left;
64
- }
65
- .yks-status .yks-notice a.yks-notice-close,
66
- .yks-status .yks-notice a.yks-notice-close:active,
67
- .yks-status .yks-notice a.yks-notice-close:link,
68
- .yks-status .yks-notice a.yks-notice-close:visited
69
- {
70
  background: #0033AA;
71
  color: #FFF;
72
  position: absolute;
@@ -76,161 +72,210 @@
76
  right: 0;
77
  font-size: 10px;
78
  text-decoration: none;
79
- }
80
- .yks-status .yks-notice a.yks-notice-close:hover
81
- {
82
  text-decoration: underline;
83
- }
84
- .yks-status .yks-notice p
85
- {
86
- padding: 5px;
87
  }
88
-
89
- .yks-notice-toggle
90
- {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  background: #c9cced !important;
92
  border-color: #9ea0ba !important;
93
  color: #3c3a44 !important;
94
- }
95
-
96
- .yks-mailchimp-fields-td
97
- {
98
- display: block;
99
- padding: 15px 0 15px 0;
100
- }
101
-
102
- .yks-mailchimp-fields-container label
103
- {
104
- clear: both;
105
- display: block;
106
- padding: 5px 0 5px 0;
107
- }
108
-
109
- .yks-mailchimp-fields-placeholder
110
- {
111
- background: #DEDEDE;
112
- display: block;
113
- height: 22px;
114
- }
115
-
116
- .yks-mailchimp-sorthandle
117
- {
118
- background: transparent url('../images/16px_sortable_color.png') no-repeat 0 0;
119
- margin: 4px 7px 2px 4px !important;
120
- padding: 0;
121
- overflow: hidden;
122
- height: 16px !important;
123
- width: 16px !important;
124
- text-indent: -9000px;
125
- display: inline-block;
126
- }
127
-
128
  .yks-mailchimp-delete {
129
  background: #890B0B !important;
130
  border-color: #890B0B !important;
131
- }
 
132
  .yks-mailchimp-import {
133
  background: #ffc000 !important;
134
  border-color: #ffc000 !important;
135
  float: right;
136
  margin: 0 10px 0 0;
137
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
 
139
- #yks-list-wrapper .yks-list-container
140
- {
141
- border-bottom: 3px dashed #DEDEDE;
 
 
 
 
 
 
 
142
  }
143
- #yks-list-wrapper .yks-list-container:last-child
144
- {
 
 
 
 
145
  border-bottom: 0px dashed #DEDEDE !important;
146
- }
147
 
148
- .yks-mailchimp-fields-list
149
- {
150
  background-color: #F9F9F9;
151
  border: 1px solid #EEE;
152
- }
153
- .yks-mailchimp-fields-list .yks-mailchimp-fields-list-row:nth-child(even)
154
- {
155
  background-color: #EEE;
156
- }
157
- .yks-mailchimp-fields-list .yks-mailchimp-fields-list-row:nth-child(odd)
158
- {
159
- }
160
- .yks-mailchimp-fields-list .yks-mailchimp-fields-list-row
161
- {
162
  display: block;
163
- }
164
- .yks-mailchimp-fields-list .yks-mailchimp-fields-list-row label
165
- {
 
166
  display: inline-block;
167
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
 
169
- .yks-mailchimp-field-name
170
- {
171
- display: inline-block;
172
- width: 200px;
173
- }
174
- .yks-mailchimp-field-merge
175
- {
176
- display: inline-block;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  }
178
- .yks-mailchimp-field-merge .yks-mailchimp-field-merge
179
- {
180
- width: 100px;
181
- }
182
 
183
- .yks-mailchimpFormTable
184
- {
185
  border-bottom: 0px !important;
186
- }
187
- .yks-mailchimpFormTableSubmit
188
- {
189
  text-align: center;
190
- }
191
 
192
- .yks-mailchimpFormTableRow,
193
- .yks-mailchimpFormDivRow
194
- {
195
  width: 100%;
196
- }
197
- .yks-mailchimpFormTableRowLabel,
198
- .yks-mailchimpFormTableRowField,
199
- .yks-mailchimpFormDivRowLabel,
200
- .yks-mailchimpFormDivRowField
201
- {
202
  vertical-align: top !important;
203
- }
204
- .yks-mailchimpFormDivRowLabel,
205
- .yks-mailchimpFormDivRowField
206
- {
207
  display: inline-block;
208
  width: 50%;
209
- }
210
- .yks-mailchimpFormDivSubmit
211
- {
212
  display: inline-block;
213
  width: 100%;
214
- }
 
215
 
216
- .yks-mailchimp-form-tooltip
217
- {
218
  color: #CCC !important;
219
  font-size: 10px;
220
  margin: 0;
221
  padding: 0 0 0 10px;
222
- }
223
 
224
- #yks-mailchimp-debug-info,
225
- #yks-mailchimp-debug-info table,
226
- #yks-mailchimp-debug-info table label,
227
- #yks-mailchimp-debug-info table th,
228
- #yks-mailchimp-debug-info table td
229
- {
230
  color: #CCC !important;
231
  font-size: 10px;
232
  margin-top: 0;
233
  margin-bottom: 0;
234
  padding-top: 0;
235
  padding-bottom: 0;
236
- }
1
+ /* =========== Helper Classes =========== */
 
 
 
2
 
3
+ .yks-hidden {display: none;}
 
 
 
 
 
4
 
5
+ .yks-text-right {text-align: right;}
6
+ .yks-text-left {text-align: left;}
7
+ .yks-text-center {text-align: center;}
8
+
9
+ .yks-right {float: right;}
10
+ .yks-left {float: left;}
11
+
12
+ .yks-margin-left {margin-left: 2em;}
13
+
14
+
15
+ /* =========== Admin screens =========== */
16
+
17
+ /* general */
18
+
19
+ #ykseme-icon {
20
+ background: transparent url('../images/ykseme_32px_color.png') no-repeat 0 0;
21
+ }
22
+
23
+ .yks-status {
24
  display: none;
25
  width: 100%;
26
  clear: both;
27
+ }
28
+ .yks-status .yks-success {
 
29
  color: #000;
30
  width: 80%;
31
  height: auto;
34
  clear: both;
35
  margin: 15px auto 15px auto;
36
  text-align: center;
37
+ }
38
+ .yks-status .yks-error {
 
39
  color: #000;
40
  width: 80%;
41
  height: auto;
44
  clear: both;
45
  margin: 15px auto 15px auto;
46
  text-align: center;
47
+ }
48
+ .yks-status .yks-error p, .yks-status .yks-success p {
49
+ margin: .4em 0;
50
+ }
51
+
52
+ .yks-status .yks-notice {
53
  color: #000;
54
  width: 80%;
55
  height: auto;
60
  padding: 5px;
61
  position: relative;
62
  text-align: left;
63
+ }
64
+ .yks-status .yks-notice a.yks-notice-close, .yks-status .yks-notice a.yks-notice-close:active,
65
+ .yks-status .yks-notice a.yks-notice-close:link, .yks-status .yks-notice a.yks-notice-close:visited {
 
 
 
66
  background: #0033AA;
67
  color: #FFF;
68
  position: absolute;
72
  right: 0;
73
  font-size: 10px;
74
  text-decoration: none;
75
+ }
76
+ .yks-status .yks-notice a.yks-notice-close:hover {
 
77
  text-decoration: underline;
 
 
 
 
78
  }
79
+ .yks-status .yks-notice p {
80
+ padding: 5px;
81
+ }
82
+
83
+ /* Plugin settings page*/
84
+
85
+ .yks-admin-form {
86
+ margin-bottom: 3em;
87
+ }
88
+
89
+ .yks-admin-form th {
90
+ font-weight: bold;
91
+ }
92
+
93
+ .yks-settings-description {
94
+ padding-bottom: 2em !important;
95
+ color: #666;
96
+ }
97
+
98
+
99
+ /* Configure Lists page*/
100
+
101
+ .yks-notice-toggle {
102
  background: #c9cced !important;
103
  border-color: #9ea0ba !important;
104
  color: #3c3a44 !important;
105
+ }
106
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  .yks-mailchimp-delete {
108
  background: #890B0B !important;
109
  border-color: #890B0B !important;
110
+ }
111
+
112
  .yks-mailchimp-import {
113
  background: #ffc000 !important;
114
  border-color: #ffc000 !important;
115
  float: right;
116
  margin: 0 10px 0 0;
117
+ }
118
+
119
+ .yks-mailchimp-fields-placeholder {
120
+ background: #DEDEDE;
121
+ display: block;
122
+ height: 22px;
123
+ }
124
+
125
+ .yks-mailchimp-sorthandle {
126
+ background: transparent url('../images/16px_sortable_color.png') no-repeat 0 0;
127
+ margin: 0 7px -4px 4px !important;
128
+ padding: 0;
129
+ overflow: hidden;
130
+ height: 16px !important;
131
+ width: 16px !important;
132
+ text-indent: -9000px;
133
+ display: inline-block;
134
+ }
135
+
136
+ .yks-mailchimp-sorthandle-img {
137
+ background: transparent url('../images/16px_sortable_color.png') no-repeat 0 0;
138
+ height: 16px !important;
139
+ width: 16px !important;
140
+ display: inline-block;
141
+ }
142
+
143
+ .yks-mailchimp-fields-container label input[type="checkbox"] {
144
+ margin-top: -1px;
145
+ }
146
 
147
+ .yks-mailchimp-field-name {
148
+ display: inline-block;
149
+ width: 200px;
150
+ }
151
+
152
+ .yks-mailchimp-field-merge {
153
+ display: inline-block;
154
+ }
155
+ .yks-mailchimp-field-merge .yks-mailchimp-field-merge {
156
+ width: 100px;
157
  }
158
+
159
+ #yks-list-wrapper .yks-list-container {
160
+ border-bottom: 3px dashed #DEDEDE;
161
+ }
162
+
163
+ #yks-list-wrapper .yks-list-container:last-child {
164
  border-bottom: 0px dashed #DEDEDE !important;
165
+ }
166
 
167
+ .yks-mailchimp-fields-list {
 
168
  background-color: #F9F9F9;
169
  border: 1px solid #EEE;
170
+ }
171
+ .yks-mailchimp-fields-list .yks-mailchimp-fields-list-row:nth-child(even) {
 
172
  background-color: #EEE;
173
+ }
174
+ .yks-mailchimp-fields-list .yks-mailchimp-fields-list-row:nth-child(odd) {
175
+ }
176
+ .yks-mailchimp-fields-list .yks-mailchimp-fields-list-row {
 
 
177
  display: block;
178
+ height: 30px;
179
+ padding-top: 3px;
180
+ }
181
+ .yks-mailchimp-fields-list .yks-mailchimp-fields-list-row label {
182
  display: inline-block;
183
+ }
184
+
185
+ .yks-mailchimp-listname {
186
+ font-size: 1.4em !important;
187
+ font-weight: 600;
188
+ }
189
+
190
+ /* About page */
191
+
192
+ .yksme-page-about {
193
+ width: 75%;
194
+ }
195
+
196
+ #yksme-yikes-logo-container {
197
+ float:right;
198
+ margin: 0 20px 20px 20px;
199
+ width: 300px;
200
+ }
201
 
202
+ #yksme-yikes-logo-container .b-sbn {
203
+ float: right;
204
+ margin: 0 2.4em 0 0;
205
+ }
206
+
207
+ #yksme-yikes-logo {
208
+ border: 0;
209
+ padding: 0;
210
+ margin: 0 0 20px 0;
211
+ display: block;
212
+ }
213
+
214
+
215
+ /* =========== Front-end Forms =========== */
216
+
217
+ .yks-mailchimp-fields-td {
218
+ display: block;
219
+ padding: 15px 0 15px 0;
220
+ }
221
+
222
+ .yks-mailchimp-fields-container label {
223
+ clear: both;
224
+ display: block;
225
+ padding: 2px 0;
226
+ }
227
+
228
+ .yks-require-description {
229
+ font-size: 0.9em;
230
+ padding: 1em 0;
231
+ }
232
+
233
+ .yks-mailchimpFormDivRowLabel-required {}
234
+ .yks-required-label {
235
+ font-weight: bold;
236
+ color: red;
237
  }
238
+ .yks-require {}
 
 
 
239
 
240
+ .yks-mailchimpFormTable {
 
241
  border-bottom: 0px !important;
242
+ }
243
+
244
+ .yks-mailchimpFormTableSubmit {
245
  text-align: center;
246
+ }
247
 
248
+ .yks-mailchimpFormTableRow, .yks-mailchimpFormDivRow {
 
 
249
  width: 100%;
250
+ }
251
+ .yks-mailchimpFormTableRowLabel, .yks-mailchimpFormTableRowField,
252
+ .yks-mailchimpFormDivRowLabel, .yks-mailchimpFormDivRowField {
 
 
 
253
  vertical-align: top !important;
254
+ }
255
+ .yks-mailchimpFormDivRowLabel, .yks-mailchimpFormDivRowField {
 
 
256
  display: inline-block;
257
  width: 50%;
258
+ }
259
+ .yks-mailchimpFormDivSubmit {
 
260
  display: inline-block;
261
  width: 100%;
262
+ margin-top: .4em;
263
+ }
264
 
265
+ .yks-mailchimp-form-tooltip {
 
266
  color: #CCC !important;
267
  font-size: 10px;
268
  margin: 0;
269
  padding: 0 0 0 10px;
270
+ }
271
 
272
+ #yks-mailchimp-debug-info, #yks-mailchimp-debug-info table,
273
+ #yks-mailchimp-debug-info table label, #yks-mailchimp-debug-info table th,
274
+ #yks-mailchimp-debug-info table td {
 
 
 
275
  color: #CCC !important;
276
  font-size: 10px;
277
  margin-top: 0;
278
  margin-bottom: 0;
279
  padding-top: 0;
280
  padding-bottom: 0;
281
+ }
images/Thumbs.db ADDED
Binary file
images/ykseme_16px.png CHANGED
Binary file
images/ykseme_16px_color.png CHANGED
Binary file
images/ykseme_32px_color.png CHANGED
Binary file
pages/about.php CHANGED
@@ -1,5 +1,5 @@
1
- <div class="wrap">
2
- <div id="ykseme-icon" class="icon32"><br /></div>
3
 
4
  <h2 id="ykseme-page-header">
5
  About YIKES, Inc.
@@ -7,31 +7,42 @@
7
 
8
  <div id="yksme-page-content">
9
  <div id="yksme-yikes-logo-container">
10
- <a href="http://www.yikesinc.com" title="YIKES, Inc." target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/yikes_logo.png" alt="YIKES, Inc." id="yksme-yikes-logo" /></a>
11
 
12
  <div class="b-sbn">
13
- <a href="http://www.bcorporation.net/yikes" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/bcorp.jpg" alt="Certified B Corporation"></a>
14
- <a href="http://www.sbnphiladelphia.org/" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/sbn_logo.png" alt="YA proud sponsor of the Sustainable Business Network of Philadelphia"></a>
15
  </div>
16
 
17
- <a href="http://facebook.com/yikesinc" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/facebook.png" style="border: 0px none;" alt="YIKES Philadelphia Web design and Development Facebook" height="24" width="24"></a> <a href="http://twitter.com/yikesinc" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/twitter.png" style="border: 0px none;" alt="YIKES Philadelphia Web design and Development Twitter" height="24" width="24"></a> <script gapi_processed="true" type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
18
- <div style="height: 24px; width: 106px; display: inline-block; text-indent: 0pt; margin: 0pt; padding: 0pt; background: none repeat scroll 0% 0% transparent; border-style: none; float: none; line-height: normal; font-size: 1px; vertical-align: baseline;" id="___plusone_0"><iframe allowtransparency="true" hspace="0" id="I1_1333575714870" marginheight="0" marginwidth="0" name="I1_1333575714870" src="https://plusone.google.com/_/+1/fastbutton?url=http%3A%2F%2Fwww.yikesinc.com%2F&amp;size=standard&amp;count=true&amp;hl=en-US&amp;jsh=m%3B%2F_%2Fapps-static%2F_%2Fjs%2Fgapi%2F__features__%2Frt%3Dj%2Fver%3DkJTTGFio1Bk.en.%2Fsv%3D1%2Fam%3D%21Ze6NnRS0VYCICGRMrA%2Fd%3D1%2Frs%3DAItRSTO0675vsQCIIVLyCqE1jWrDTqqpjw#id=I1_1333575714870&amp;parent=http%3A%2F%2Fwww.yikesinc.com&amp;rpctoken=371844436&amp;_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart" style="position: static; left: 0pt; top: 0pt; width: 106px; margin: 0px; border-style: none; height: 24px; visibility: visible;" tabindex="0" vspace="0" title="+1" frameborder="0" scrolling="no" width="100%"></iframe></div><br>
19
- <a href="http://yikesinc.tumblr.com/" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/tumblr.png" style="border: 0px none;" alt="YIKES Philadelphia Web design and Development Tumblr" height="24" width="24"></a>
20
- <a href="http://www.linkedin.com/companies/yikes-inc" title="Linkedin" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/linkedin.png" alt="YIKES Philadelphia Web design and Development Linkedin" border="0" height="24" width="24"></a>
21
- <a href="http://www.flickr.com/photos/yikesinc/" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/flickr.png" style="border: 0px none;" alt="YIKES Philadelphia Web design and Development Flickr" height="24" width="24"></a>
22
- <a href="http://www.youtube.com/yikesinc/" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/youtube.png" style="border: 0px none;" alt="YIKES Philadelphia Web design and Development YouTube" height="24" width="24"></a>
23
- <a href="http://pinterest.com/yikesinc/" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/PinterestIcon.png" style="border: 0px none;" alt="YIKES Philadelphia Web design and Development Pinterest" height="24" width="24"></a>
 
24
  </div>
25
 
26
  <h3>YIKES, Inc. Web Design and Development</h3>
27
 
28
- <h4>Smart, effective, beautifully designed web solutions for the Greater Philadelphia region and beyond. </h4>
29
-
30
- <p>Since 1996 YIKES, Inc. has built creative web design and development solutions for businesses and non-profit organizations. We specialize in creating custom WordPress themes and plugins.</p>
31
-
32
- <p>In addition to making great WordPress sites YIKES is also committed to being a socially responsible business observing the triple bottom line: people, planet, profit. We work to help build a more socially, environmentally and financially sustainable local economy.</p>
 
 
 
 
 
 
 
 
33
 
34
- <p>Learn more about us at <a href="http://www.yikesinc.com" title="YIKES, Inc." target="_blank">www.yikesinc.com</a></p>
 
 
35
  </div>
36
 
37
  </div>
1
+ <div class="wrap yksme-page-about">
2
+ <div id="ykseme-icon" class="icon32"></div>
3
 
4
  <h2 id="ykseme-page-header">
5
  About YIKES, Inc.
7
 
8
  <div id="yksme-page-content">
9
  <div id="yksme-yikes-logo-container">
10
+ <a href="http://www.yikesinc.com" title="YIKES, Inc." target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/yikes_logo.png" alt="YIKES, Inc." id="yksme-yikes-logo" /></a>
11
 
12
  <div class="b-sbn">
13
+ <a href="http://www.bcorporation.net/yikes" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/bcorp.jpg" alt="Certified B Corporation"></a>
14
+ <a href="http://www.sbnphiladelphia.org/" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/sbn_logo.png" alt="Proud sponsor of the Sustainable Business Network of Philadelphia"></a>
15
  </div>
16
 
17
+ <a href="http://facebook.com/yikesinc" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/facebook.png" style="border: 0px none;" alt="YIKES Philadelphia Web design and Development Facebook" height="24" width="24"></a>
18
+ <a href="http://twitter.com/yikesinc" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/twitter.png" style="border: 0px none;" alt="YIKES Philadelphia Web design and Development Twitter" height="24" width="24"></a>
19
+ <a href="http://www.linkedin.com/companies/yikes-inc" title="Linkedin" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/linkedin.png" alt="YIKES Philadelphia Web design and Development Linkedin" border="0" height="24" width="24"></a>
20
+
21
+ <script gapi_processed="true" type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
22
+ <div style="height: 24px; width: 106px; display: inline-block; text-indent: 0pt; margin: 0pt; padding: 0pt; background: none repeat scroll 0% 0% transparent; border-style: none; float: none; line-height: normal; font-size: 1px; vertical-align: baseline;" id="___plusone_0">
23
+ <iframe allowtransparency="true" hspace="0" id="I1_1333575714870" marginheight="0" marginwidth="0" name="I1_1333575714870" src="https://plusone.google.com/_/+1/fastbutton?url=http%3A%2F%2Fwww.yikesinc.com%2F&amp;size=standard&amp;count=true&amp;hl=en-US&amp;jsh=m%3B%2F_%2Fapps-static%2F_%2Fjs%2Fgapi%2F__features__%2Frt%3Dj%2Fver%3DkJTTGFio1Bk.en.%2Fsv%3D1%2Fam%3D%21Ze6NnRS0VYCICGRMrA%2Fd%3D1%2Frs%3DAItRSTO0675vsQCIIVLyCqE1jWrDTqqpjw#id=I1_1333575714870&amp;parent=http%3A%2F%2Fwww.yikesinc.com&amp;rpctoken=371844436&amp;_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart" style="position: static; left: 0pt; top: 0pt; width: 106px; margin: 0px; border-style: none; height: 24px; visibility: visible;" tabindex="0" vspace="0" title="+1" frameborder="0" scrolling="no" width="100%"></iframe>
24
+ </div>
25
  </div>
26
 
27
  <h3>YIKES, Inc. Web Design and Development</h3>
28
 
29
+ <h4>Smart, effective, beautifully designed web solutions</h4>
30
+
31
+ <p>
32
+ YIKES is located in the Fishtown neighborhood of Philadelphia where we build custom WordPress themes and plugins every day.
33
+ </p>
34
+
35
+ <p>
36
+ At YIKES we love WordPress! Co-Owner, Tracy Levesque has presented at WordCamps <a href="http://wordpress.tv/2013/04/12/tracy-levesque-custom-post-types-for-right-brained-folks/" target="_blank">Philly</a>, NYC, Montreal and <a href="http://wordpress.tv/2013/07/31/tracy-levesque-what-you-dont-know-you-can-do-wordpress-development-for-absolutely-everyone/" target="_blank">San Francisco</a>. She also teaches WordPress classes for <a href="http://www.meetup.com/Girl-Develop-It-Philadelphia/events/134330962/" target="_blank">Girl Develop It Philadelphia</a>.
37
+ </p>
38
+
39
+ <p>
40
+ In addition to making great WordPress sites we are also committed to the sustainable business movement. We observe the triple bottom line: people, planet, profit and work to help build a more socially, environmentally and financially sustainable local economy. We even have a <a href="http://www.yikesinc.com/company/our-office/" target="_blank">LEED Platinum office</a>.
41
+ </p>
42
 
43
+ <p>
44
+ If you're interested in hiring us for WordPress development, or just want to learn more about us, please visit <a href="http://www.yikesinc.com" title="YIKES, Inc." target="_blank">yikesinc.com</a>
45
+ </p>
46
  </div>
47
 
48
  </div>
pages/lists.php CHANGED
@@ -1,244 +1,274 @@
1
  <script type="text/javascript">
2
- jQuery(document).ready(function($)
3
- {
4
- function noListsCheck()
5
- {
6
- if($('#yks-list-wrapper .yks-list-container').size() <= 0)
7
- {
8
- $('#yks-list-wrapper').html('<p>In order to setup a form for your mailing list you will first need to retrieve the list ID code from the Mailchimp list you wish to use.</p><p><a href="http://kb.mailchimp.com/article/how-can-i-find-my-list-id/" target="_blank">Click here for instructions on retrieving your "MailChimp list ID"</a></p><p>After retrieving your list ID <a href="#" class="yks-mailchimp-list-add">click here to get started.</a></p>');
9
- }
10
- }
11
- function scrollToElement(e)
12
- {
13
- $('html,body').animate({
14
- scrollTop: $(e).offset().top
15
- }, 'slow');
16
- }
17
- function initializeScrollableLists()
18
- {
19
- $('.yks-mailchimp-fields-list').sortable({
20
- axis: 'y',
21
- handle: '.yks-mailchimp-sorthandle',
22
- placeholder: 'yks-mailchimp-fields-placeholder',
23
- update: function(event, ui)
24
- {
25
- var i = $(this).attr('rel');
26
- var newCt = 0;
27
- var updateString = '';
28
- var fieldCt = $('#yks-mailchimp-fields-list_'+i+' label').size();
29
- $('#yks-mailchimp-fields-list_'+i+' label').each(function(e){
30
- var fid = $(this).attr('rel');
31
- updateString += fid+':'+newCt;
32
- if((newCt+1) < fieldCt) updateString += ';';
33
- newCt++;
34
- });
35
- // Update the sort orders
36
- if(updateString !== '')
37
- {
38
- $.ajax({
39
- type: 'POST',
40
- url: ajaxurl,
41
- data: {
42
- action: 'yks_mailchimp_form',
43
- list_id: i,
44
- update_string: updateString,
45
- form_action: 'list_sort'
46
- },
47
- dataType: 'json',
48
- success: function(MAILCHIMP)
49
- {
50
- if(MAILCHIMP != '-1')
51
- {
52
- $('#yks-list-container_'+i).yksYellowFade();
53
- }
54
- else
55
- {
56
-
57
- }
58
- }
59
- });
60
- }
61
- }
62
- });
63
- }
64
- noListsCheck();
65
- initializeScrollableLists();
66
- $('.yks-mailchimp-list-add').live('click', function(e){
67
- lid = prompt("Please enter your MailChimp list ID code.");
68
- if(lid !== '')
69
- {
70
- $.ajax({
71
- type: 'POST',
72
- url: ajaxurl,
73
- data: {
74
- action: 'yks_mailchimp_form',
75
- form_action: 'list_add',
76
- list_id: lid
77
- },
78
- dataType: 'json',
79
- success: function(MAILCHIMP)
80
- {
81
- if(MAILCHIMP != '-1')
82
- {
83
- if($('#yks-list-wrapper .yks-list-container').size() <= 0)
84
- {
85
- $('#yks-list-wrapper').html('');
86
- }
87
- $('#yks-list-wrapper').append(MAILCHIMP);
88
- scrollToElement($('#yks-list-wrapper .yks-list-container').last());
89
- initializeScrollableLists();
90
- }
91
- else
92
- {
93
- alert('Oops.. The list ID you entered appears to be incorrect. If you need help retrieving your list ID click on the "How to find your MailChimp list ID" link located on this page');
94
- }
95
- }
96
- });
97
- }
98
-
99
- return false;
100
- });
101
- $('.yks-mailchimp-list-update').live('click', function(e){
102
- i = $(this).attr('rel');
103
- f = '#yks-mailchimp-form_'+i;
104
- $.ajax({
105
- type: 'POST',
106
- url: ajaxurl,
107
- data: {
108
- action: 'yks_mailchimp_form',
109
- form_action: 'list_update',
110
- form_data: $(f).serialize()
111
- },
112
- dataType: 'json',
113
- success: function(MAILCHIMP)
114
- {
115
- if(MAILCHIMP != '-1')
116
- {
117
- $('#yks-list-container_'+i).yksYellowFade();
118
- }
119
- else
120
- {
121
-
122
- }
123
- }
124
- });
125
- return false;
126
- });
127
- $('.yks-mailchimp-delete').live('click', function(e){
128
- i = $(this).attr('rel');
129
- a = confirm("Are you sure you want to delete this list?");
130
- if(a)
131
- {
132
- $.ajax({
133
- type: 'POST',
134
- url: ajaxurl,
135
- data: {
136
- action: 'yks_mailchimp_form',
137
- form_action: 'list_delete',
138
- id: i
139
- },
140
- dataType: 'json',
141
- success: function(MAILCHIMP)
142
- {
143
- if(MAILCHIMP == '1')
144
- {
145
- $('#yks-list-container_'+i).remove();
146
- noListsCheck();
147
- scrollToElement($('#yks-list-wrapper'));
148
- }
149
- }
150
- });
151
- }
152
- return false;
153
- });
154
- $('.yks-mailchimp-import').live('click', function(e){
155
- i = $(this).attr('rel');
156
- a = confirm("Are you sure you want to import the list data from MailChimp?\n\nNOTICE: THE CURRENT LIST DATA WILL BE REPLACED WITH THE FIELD DATA FROM MAILCHIMP!");
157
- if(a)
158
- {
159
- $.ajax({
160
- type: 'POST',
161
- url: ajaxurl,
162
- data: {
163
- action: 'yks_mailchimp_form',
164
- form_action: 'list_import',
165
- id: i
166
- },
167
- dataType: 'json',
168
- success: function(MAILCHIMP)
169
- {
170
- if(MAILCHIMP != '-1')
171
- {
172
- $($('#yks-list-container_'+i)).replaceWith(MAILCHIMP);
173
- $('#yks-list-container_'+i).yksYellowFade();
174
- initializeScrollableLists();
175
- }
176
- else
177
- {
178
- alert("Looks like this list is already up to date!");
179
- }
180
- }
181
- });
182
- }
183
- return false;
184
- });
185
- $('.yks-notice-close').live('click', function(e){
186
- $.ajax({
187
- type: 'POST',
188
- url: ajaxurl,
189
- data: {
190
- action: 'yks_mailchimp_form',
191
- form_action: 'notice_hide'
192
- },
193
- dataType: 'json',
194
- success: function(MAILCHIMP)
195
- {
196
- if(MAILCHIMP != '-1')
197
- {
198
- $('.yks-notice').slideUp('fast');
199
- }
200
- }
201
- });
202
- return false;
203
- });
204
- $('.yks-notice-toggle').live('click', function(e){
205
- if($('.yks-notice').hasClass('yks-hidden'))
206
- {
207
- $('.yks-notice').css('display', 'none');
208
- $('.yks-notice').removeClass('yks-hidden');
209
- }
210
- $('.yks-notice').slideDown('fast');
211
- return false;
212
- });
213
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  </script>
215
- <div class="wrap">
216
- <div id="ykseme-icon" class="icon32"><br /></div>
217
-
218
- <h2 id="ykseme-page-header">
219
- Easy Mailchimp Extender
220
- <a href="#" class="button add-new-h2 yks-mailchimp-list-add">Add New list form by MailChimp "list ID"</a>
221
- <a href="#" class="button add-new-h2 yks-notice-toggle">Show Notice for Version 1 Users</a>
222
- </h2>
223
- <p><a href="http://kb.mailchimp.com/article/how-can-i-find-my-list-id/" target="_blank">How to find your MailChimp list ID</a></p>
224
 
225
- <h3>Manage the Mailchimp List Forms</h3>
226
-
227
- <div class="yks-status" style="display: block;">
228
- <div class="yks-hidden<?php echo ($_COOKIE['yks-mailchimp-notice-hidden'] == '1' ? ' yks-notice' : ''); ?>">
229
- <a href="#" class="yks-notice-close">Hide Notice</a>
230
- <p>
231
- <strong>Notice:</strong> Version 2 is out! When you add a new list you will now be prompted to put the list id in immediately. We'll contact MailChimp for you and pull in all of your custom fields! <em>Lists created after version 2.0 use a different format for the shortcodes. Instead of a unique id being generated, I now use the MailChimp List Id. The 2.0 update had so many changes in functionality that I had to import the old lists to the new format -- if anything isn't working, please let me know!</em><br />
232
- <br />
233
- <strong>Please note -- due to the complexity of this update, all shortcodes have been changed to use the list id from MailChimp, please copy and paste them again! Additionally, if you make any changes on the MailChimp side, you need to click Import Changes on the appropriate list. I'm looking in to a way to automate this in future versions.</strong><br />
234
- <br />
235
- If you experience any bugs or have a feature request, please submit them to our <a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender">Github Issue Tracker</a>.
236
- </p>
237
- </div>
238
- </div>
239
-
240
- <div id="yks-list-wrapper"><?php echo $this->generateListContainers(); ?></div>
241
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  </div>
243
 
244
  <?php $this->getTrackingGif('lists'); ?>
1
  <script type="text/javascript">
2
+ jQuery(document).ready(function($)
3
+ {
4
+ function noListsCheck()
5
+ {
6
+ if($('#yks-list-wrapper .yks-list-container').size() <= 0)
7
+ {
8
+ $('#yks-list-wrapper').html('<p>No forms have been added yet.</p>');
9
+ }
10
+ }
11
+ function EnterListID (lid, name)
12
+ {
13
+ if(lid !== '')
14
+ {
15
+ $.ajax({
16
+ type: 'POST',
17
+ url: ajaxurl,
18
+ data: {
19
+ action: 'yks_mailchimp_form',
20
+ form_action: 'list_add',
21
+ list_id: lid,
22
+ name: name,
23
+ },
24
+ dataType: 'json',
25
+ success: function(MAILCHIMP)
26
+ {
27
+ if(MAILCHIMP != '-1')
28
+ {
29
+ if($('#yks-list-wrapper .yks-list-container').size() <= 0)
30
+ {
31
+ $('#yks-list-wrapper').html('');
32
+ }
33
+ $('#yks-list-wrapper').append(MAILCHIMP);
34
+ scrollToElement($('#yks-list-wrapper .yks-list-container').last());
35
+ initializeScrollableLists();
36
+ }
37
+ else
38
+ {
39
+ alert('Oops.. The list ID you entered appears to be incorrect.');
40
+ }
41
+ }
42
+ });
43
+ }
44
+
45
+ return false;
46
+ }
47
+ function scrollToElement(e)
48
+ {
49
+ $('html,body').animate({
50
+ scrollTop: $(e).offset().top
51
+ }, 'slow');
52
+ }
53
+ function initializeScrollableLists()
54
+ {
55
+ $('.yks-mailchimp-fields-list').sortable({
56
+ axis: 'y',
57
+ handle: '.yks-mailchimp-sorthandle',
58
+ placeholder: 'yks-mailchimp-fields-placeholder',
59
+ update: function(event, ui)
60
+ {
61
+ var i = $(this).attr('rel');
62
+ var newCt = 0;
63
+ var updateString = '';
64
+ var fieldCt = $('#yks-mailchimp-fields-list_'+i+' label').size();
65
+ $('#yks-mailchimp-fields-list_'+i+' label').each(function(e){
66
+ var fid = $(this).attr('rel');
67
+ updateString += fid+':'+newCt;
68
+ if((newCt+1) < fieldCt) updateString += ';';
69
+ newCt++;
70
+ });
71
+ // Update the sort orders
72
+ if(updateString !== '')
73
+ {
74
+ $.ajax({
75
+ type: 'POST',
76
+ url: ajaxurl,
77
+ data: {
78
+ action: 'yks_mailchimp_form',
79
+ list_id: i,
80
+ update_string: updateString,
81
+ form_action: 'list_sort'
82
+ },
83
+ dataType: 'json',
84
+ success: function(MAILCHIMP)
85
+ {
86
+ if(MAILCHIMP != '-1')
87
+ {
88
+ $('#yks-list-container_'+i).yksYellowFade();
89
+ }
90
+ else
91
+ {
92
+
93
+ }
94
+ }
95
+ });
96
+ }
97
+ }
98
+ });
99
+ }
100
+ noListsCheck();
101
+ initializeScrollableLists();
102
+ $('#yks-lists-dropdown').submit(function(e) {
103
+ e.preventDefault();
104
+ var lid = $("select#yks-list-select option:selected").val();
105
+ var name = $('select#yks-list-select option:selected').html();
106
+ if (lid)
107
+ {
108
+ EnterListID (lid, name);
109
+ $('#yks-submit-list-add').attr("disabled", true);
110
+ $("select#yks-list-select option[value='']").prop('selected',true);
111
+ $("select#yks-list-select option[value='" + lid + "']").remove();
112
+ setInterval(function()
113
+ {
114
+ $('#yks-submit-list-add').removeAttr("disabled");
115
+ },3000);
116
+ }
117
+ else
118
+ {
119
+ alert ('You need to select a Mailchimp list in order to create a form for it');
120
+ }
121
+ return false;
122
+ });
123
+
124
+ $('.yks-mailchimp-list-update').live('click', function(e){
125
+ var i = $(this).attr('rel');
126
+ var f = '#yks-mailchimp-form_'+i;
127
+ $.ajax({
128
+ type: 'POST',
129
+ url: ajaxurl,
130
+ data: {
131
+ action: 'yks_mailchimp_form',
132
+ form_action: 'list_update',
133
+ form_data: $(f).serialize()
134
+ },
135
+ dataType: 'json',
136
+ success: function(MAILCHIMP)
137
+ {
138
+ if(MAILCHIMP != '-1')
139
+ {
140
+ $('#yks-list-container_'+i).yksYellowFade();
141
+ }
142
+ else
143
+ {
144
+
145
+ }
146
+ }
147
+ });
148
+ return false;
149
+ });
150
+ $('.yks-mailchimp-delete').live('click', function(e){
151
+ var i = $(this).attr('rel');
152
+ var title = $(this).data('title');
153
+ var a = confirm("Are you sure you want to delete this form?");
154
+ $("select#yks-list-select").append('<option value="' + i + '">' + title +'</option>');
155
+ if(a)
156
+ {
157
+ $.ajax({
158
+ type: 'POST',
159
+ url: ajaxurl,
160
+ data: {
161
+ action: 'yks_mailchimp_form',
162
+ form_action: 'list_delete',
163
+ id: i
164
+ },
165
+ dataType: 'json',
166
+ success: function(MAILCHIMP)
167
+ {
168
+ if(MAILCHIMP == '1')
169
+ {
170
+ $('#yks-list-container_'+i).remove();
171
+ noListsCheck();
172
+ scrollToElement($('#yks-list-wrapper'));
173
+ }
174
+ }
175
+ });
176
+ }
177
+ return false;
178
+ });
179
+ $('.yks-mailchimp-import').live('click', function(e){
180
+ var i = $(this).attr('rel');
181
+ var a = confirm("Are you sure you want to re-import your fields from MailChimp?");
182
+ if(a)
183
+ {
184
+ $.ajax({
185
+ type: 'POST',
186
+ url: ajaxurl,
187
+ data: {
188
+ action: 'yks_mailchimp_form',
189
+ form_action: 'list_import',
190
+ id: i
191
+ },
192
+ dataType: 'json',
193
+ success: function(MAILCHIMP)
194
+ {
195
+ if(MAILCHIMP != '-1')
196
+ {
197
+ $($('#yks-list-container_'+i)).replaceWith(MAILCHIMP);
198
+ $('#yks-list-container_'+i).yksYellowFade();
199
+ initializeScrollableLists();
200
+ }
201
+ else
202
+ {
203
+ alert("Looks like this form is already up to date!");
204
+ }
205
+ }
206
+ });
207
+ }
208
+ return false;
209
+ });
210
+ $('.yks-notice-close').live('click', function(e){
211
+ $.ajax({
212
+ type: 'POST',
213
+ url: ajaxurl,
214
+ data: {
215
+ action: 'yks_mailchimp_form',
216
+ form_action: 'notice_hide'
217
+ },
218
+ dataType: 'json',
219
+ success: function(MAILCHIMP)
220
+ {
221
+ if(MAILCHIMP != '-1')
222
+ {
223
+ $('.yks-notice').slideUp('fast');
224
+ }
225
+ }
226
+ });
227
+ return false;
228
+ });
229
+ $('.yks-notice-toggle').live('click', function(e){
230
+ if($('.yks-notice').hasClass('yks-hidden'))
231
+ {
232
+ $('.yks-notice').css('display', 'none');
233
+ $('.yks-notice').removeClass('yks-hidden');
234
+ }
235
+ $('.yks-notice').slideDown('fast');
236
+ return false;
237
+ });
238
+ });
239
  </script>
 
 
 
 
 
 
 
 
 
240
 
241
+ <div class="wrap">
242
+ <div id="ykseme-icon" class="icon32"></div>
243
+ <h2 id="ykseme-page-header">
244
+ Easy Mailchimp Forms by YIKES, Inc.
245
+ </h2>
246
+ <?php if (!$this->optionVal['api-key']) { ?>
247
+ <p>
248
+ Before you can add MailChimp forms to your site, you need to <a href="admin.php?page=yks-mailchimp-form" class="yks-mailchimp-list-add">go to the MailChimp Settings page</a> and add your API Key.
249
+ </p>
250
+ <?php } else { //end if statement if no api key ?>
251
+ <h3>Add Forms</h3>
252
+ <form id="yks-lists-dropdown" name="yks-lists-dropdown">
253
+ <table class="form-table yks-admin-form">
254
+ <tbody>
255
+ <tr valign="top">
256
+ <th scope="row">
257
+ Your Lists
258
+ </th>
259
+ <td>
260
+ <?php $this->getLists(); ?>
261
+ <input type="submit" name="submit" class="button-primary" id="yks-submit-list-add" value="Create a Form For This List" >
262
+ </td>
263
+ </tr>
264
+ </tbody>
265
+ </table>
266
+ </form>
267
+ <h3>Manage Forms</h3>
268
+ <div id="yks-list-wrapper">
269
+ <?php echo $this->generateListContainers(); ?>
270
+ </div>
271
+ <?php } //end else statement if there is an api key ?>
272
  </div>
273
 
274
  <?php $this->getTrackingGif('lists'); ?>
pages/options.php CHANGED
@@ -33,7 +33,7 @@ jQuery(document).ready(function ($) {
33
  $('#yks-status').html('<div class="yks-success"><p>The options were saved successfully!</p></div>');
34
  $('#yks-status').slideDown('fast');
35
  } else {
36
- $('#yks-status').html('<div class="yks-error"><p>The options could not be saved (or you forgot to change them)!</p></div>');
37
  $('#yks-status').slideDown('fast');
38
  }
39
  }
@@ -43,71 +43,106 @@ jQuery(document).ready(function ($) {
43
  })
44
  });
45
  </script>
 
46
  <div class="wrap">
47
- <div id="ykseme-icon" class="icon32"><br /></div>
48
 
 
 
49
  <h2 id="ykseme-page-header">
50
- Easy Mailchimp Extender
51
  </h2>
52
 
53
- <h3>Manage the Mailchimp API Form Options</h3>
54
 
55
  <div class="yks-status" id="yks-status"></div>
56
 
57
  <form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form">
58
 
59
- <table class="form-table">
60
  <tbody>
61
 
62
  <tr valign="top">
63
- <th scope="row"><label for="yks-mailchimp-api-key">Mailchimp API Key</label></th>
64
  <td><input name="yks-mailchimp-api-key" type="text" id="yks-mailchimp-api-key" value="<?php echo $this->optionVal['api-key']; ?>" class="regular-text" /></td>
65
  </tr>
 
 
 
 
 
 
 
 
66
 
67
  <tr valign="top">
68
- <th scope="row"><label for="yks-mailchimp-flavor">What's Your Flavor?</label></th>
69
  <td>
70
  <select name="yks-mailchimp-flavor" id="yks-mailchimp-flavor" class="regular-text" />
71
- <option value="0"<?php echo ($this->optionVal['flavor'] === '0' ? ' selected' : ''); ?>>Tables</option>
72
- <option value="1"<?php echo ($this->optionVal['flavor'] === '1' ? ' selected' : ''); ?>>Divs</option>
73
  </select>
74
- <span class="description">What you choose determines how the form is built with the shortcode (Default: Tables)</span>
75
  </td>
76
  </tr>
77
-
78
- </tbody>
79
- </table>
80
-
81
- <p class="submit"><input type="submit" name="submit" id="submit" class="button-primary" value="Update Options"></p>
82
-
83
- </form>
84
-
85
- <div id="yks-mailchimp-debug-info">
86
- <table class="form-table">
87
- <tbody>
88
-
89
- <tr valign="top">
90
- <th scope="row"><label>Plugin Version</label></th>
91
- <td><?php echo YKSEME_VERSION_CURRENT; ?></td>
92
- </tr>
93
- <tr valign="top">
94
- <th scope="row"><label>Wordpress Version</label></th>
95
- <td><?php echo get_bloginfo( 'version' ); ?></td>
96
- </tr>
97
  <tr valign="top">
98
- <th scope="row"><label>Browser Information</label></th>
99
  <td>
100
- <?php
101
- $theBrowser = $this->getBrowser();
102
- echo $theBrowser['name'].' '.$theBrowser['version'].' on '.$theBrowser['platform'];
103
- ?>
 
 
 
 
 
 
104
  </td>
105
  </tr>
106
 
 
 
 
 
107
  </tbody>
108
  </table>
109
- </div>
 
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  </div>
112
 
113
  <?php $this->getTrackingGif('options'); ?>
33
  $('#yks-status').html('<div class="yks-success"><p>The options were saved successfully!</p></div>');
34
  $('#yks-status').slideDown('fast');
35
  } else {
36
+ $('#yks-status').html('<div class="yks-error"><p>The options could not be saved (or you did not change them).</p></div>');
37
  $('#yks-status').slideDown('fast');
38
  }
39
  }
43
  })
44
  });
45
  </script>
46
+
47
  <div class="wrap">
 
48
 
49
+ <div id="ykseme-icon" class="icon32"></div>
50
+
51
  <h2 id="ykseme-page-header">
52
+ Easy Mailchimp Forms by YIKES, Inc.
53
  </h2>
54
 
55
+ <h3>Manage Mailchimp Forms Settings</h3>
56
 
57
  <div class="yks-status" id="yks-status"></div>
58
 
59
  <form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form">
60
 
61
+ <table class="form-table yks-admin-form">
62
  <tbody>
63
 
64
  <tr valign="top">
65
+ <th scope="row"><label for="yks-mailchimp-api-key">Your Mailchimp API Key</label></th>
66
  <td><input name="yks-mailchimp-api-key" type="text" id="yks-mailchimp-api-key" value="<?php echo $this->optionVal['api-key']; ?>" class="regular-text" /></td>
67
  </tr>
68
+
69
+ <tr>
70
+ <td></td>
71
+ <td class="yks-settings-description">
72
+ Please enter your MailChimp API Key above. The API Key allows your WordPress site to communicate with your MailChimp account.<br />
73
+ For more help, visit the MailChimp Support article <a href="http://kb.mailchimp.com/article/where-can-i-find-my-api-key" target="_blank">Where can I find my API Key?</a>
74
+ </td>
75
+ </tr>
76
 
77
  <tr valign="top">
78
+ <th scope="row"><label for="yks-mailchimp-flavor">Preferred Form Layout</label></th>
79
  <td>
80
  <select name="yks-mailchimp-flavor" id="yks-mailchimp-flavor" class="regular-text" />
81
+ <option value="0"<?php echo ($this->optionVal['flavor'] === '0' ? ' selected' : ''); ?>>table</option>
82
+ <option value="1"<?php echo ($this->optionVal['flavor'] === '1' ? ' selected' : ''); ?>>div</option>
83
  </select>
 
84
  </td>
85
  </tr>
86
+ <tr>
87
+ <td></td>
88
+ <td class="yks-settings-description">
89
+ Choose whether you want your forms to use a table or div layout.
90
+ </td>
91
+ </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  <tr valign="top">
93
+ <th scope="row"><label for="yks-mailchimp-debug">Advanced Error Messaging</label></th>
94
  <td>
95
+ <select name="yks-mailchimp-debug" id="yks-mailchimp-debug" class="regular-text" />
96
+ <option value="0"<?php echo ($this->optionVal['debug'] === '0' ? ' selected' : ''); ?>>Disabled</option>
97
+ <option value="1"<?php echo ($this->optionVal['debug'] === '1' ? ' selected' : ''); ?>>Enabled</option>
98
+ </select>
99
+ </td>
100
+ </tr>
101
+ <tr>
102
+ <td></td>
103
+ <td class="yks-settings-description">
104
+ Enable if you're having problems with your forms sending data to MailChimp. Enabling Advanced Error Messaging will show you the exact error codes MailChimp is returning.
105
  </td>
106
  </tr>
107
 
108
+ <tr>
109
+ <td></td>
110
+ <td><input type="submit" name="submit" id="submit" class="button-primary" value="Save Settings"></td>
111
+ </tr>
112
  </tbody>
113
  </table>
114
+
115
+ </form>
116
 
117
+ <h3>Plugin Information</h3>
118
+
119
+ <p>
120
+ If you experience any issues with our plugin, please <a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues" target="_blank">submit a New Issue on our Github Issue Tracker</a>. Please include the information below to help us troubleshoot your problem.
121
+ </p>
122
+
123
+ <table class="form-table yks-admin-form">
124
+ <tbody>
125
+
126
+ <tr valign="top">
127
+ <th scope="row"><label>Plugin Version</label></th>
128
+ <td><?php echo YKSEME_VERSION_CURRENT; ?></td>
129
+ </tr>
130
+ <tr valign="top">
131
+ <th scope="row"><label>Wordpress Version</label></th>
132
+ <td><?php echo get_bloginfo( 'version' ); ?></td>
133
+ </tr>
134
+ <tr valign="top">
135
+ <th scope="row"><label>Browser Information</label></th>
136
+ <td>
137
+ <?php
138
+ $theBrowser = $this->getBrowser();
139
+ echo $theBrowser['name'].' '.$theBrowser['version'].' on '.$theBrowser['platform'];
140
+ ?>
141
+ </td>
142
+ </tr>
143
+
144
+ </tbody>
145
+ </table>
146
  </div>
147
 
148
  <?php $this->getTrackingGif('options'); ?>
process/ajax.php CHANGED
@@ -25,13 +25,14 @@ case 'update_options':
25
  break;
26
 
27
  case 'list_add':
28
- $list = $yksemeBase->addList($_POST['list_id']);
29
  if($list)
30
  {
31
  echo json_encode($list);
32
  }
33
  else echo '-1';
34
  break;
 
35
 
36
  case 'list_update':
37
  $action = $yksemeBase->updateList($_POST);
@@ -71,11 +72,11 @@ case 'list_import':
71
 
72
  case 'frontend_submit_form':
73
  $action = $yksemeBase->addUserToMailchimp($_POST);
74
- if($action)
75
  {
76
  echo '1';
77
- }
78
- else echo '-1';
79
  break;
80
 
81
  case 'notice_hide':
25
  break;
26
 
27
  case 'list_add':
28
+ $list = $yksemeBase->addList($_POST['list_id'], $_POST['name']);
29
  if($list)
30
  {
31
  echo json_encode($list);
32
  }
33
  else echo '-1';
34
  break;
35
+
36
 
37
  case 'list_update':
38
  $action = $yksemeBase->updateList($_POST);
72
 
73
  case 'frontend_submit_form':
74
  $action = $yksemeBase->addUserToMailchimp($_POST);
75
+ if($action == "done")
76
  {
77
  echo '1';
78
+ }
79
+ else echo $action;
80
  break;
81
 
82
  case 'notice_hide':
readme.md CHANGED
@@ -1,10 +1,8 @@
1
- YIKES, Inc. Easy MailChimp Extender
2
  ===========
3
- The YIKES, Inc. Easy MailChimp extender gives you the ability to create sign up forms that allow site visitors to join your MailChimp lists. You can add forms to posts or pages with shortcodes or to template files with PHP tags. Simply copy and paste your API Key and List IDs created by MailChimp into the plugin admin and the plugin will pull in all your MailChimp list fields. You can check off the fields you want to include on your form and order them via an easy drag-and-drop interface. In addition, this plugin adds plenty of CSS hooks to the form code allowing you to completely customize the look of your forms.
4
 
5
- Targeted email messages are a more effective form of eMarketing for your business. The advantages of using MailChimp are vast and now you can expand upon its abilities in WordPress easily. With simple installation and easy to follow instructions, this extender will considerably improve your email marketing campaigns.
6
-
7
- If you notice any issues, please submit a bug on our [Github Issue Tracker](https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues "Github Issue Tracker") and we'll look in to it as soon as possible.
8
 
9
  Installation
10
  ===========
@@ -18,45 +16,52 @@ Installation
18
  Frequently Asked Questions
19
  ===========
20
 
21
- ### Do I need to have a MailChimp Account?
22
- Yes, you can register one for free at [MailChimp](https://mailchimp.com/signup/ "MailChimp Signup").
 
 
 
 
 
23
 
24
- ### Do I need to already have lists configured? =
25
- Yes, you can configure them through mailchimp. All the plugin needs is your list id and api key.
26
 
27
- ### Where do I find my API Key?
28
- From your MailChimp Dashboard go to Account > API Keys and Authorized Apps. There you will need to add a key if you do not already have one.
29
- For more help visit [The API Key Help Article](http://kb.mailchimp.com/article/where-can-i-find-my-api-key/ "API Key Help Article")
30
 
31
- ### Where do I find my List ID?
32
- From your MailChimp Dashboard go to Lists. Under the specific list you want to make a signup form for, click Settings > List Settings and Unique ID.
33
- For more help visit [The List Id Help Article](http://kb.mailchimp.com/article/how-can-i-find-my-list-id/ "List Id Help Article")
34
 
35
- ### Hey, my checkboxes are not appearing in the active Fields options. What gives? =
36
- Mailchimp only supports the following fields from the "FIELDS & MERGE tags"
37
 
38
- * Text
39
- * Number
40
- * Radio Buttons
41
- * Drop Down
42
- * Date
43
- * Birthday
44
- * Address
45
- * Zip Code
46
- * Phone
47
- * Website
48
- * Image
49
 
50
- Unfortunately, checkboxes is not currently an option. We will implement in our plugin as soon as MailChimp offers it as option from their API.
51
 
52
- ### My Information isn't showing up when people subscribe!
 
 
 
53
  You're likely using an old version of the plugin. Please update to the latest version and import your list data.
54
 
55
- ### My list data was changed/the form isn't showing up since the 2.0 update, what gives?
56
- Due to the code overhaul required for the features of the new version, the structure we were using to save data had to be completely changed over to conform to the MailChimp schema. The old unique ids that the plugin gave to lists have been deprecated. The custom fields that you have are now pulled in from the MailChimp servers. If your form isn't showing up with the shortcode, just copy and paste it again to fix this issue.
57
 
58
  Changes
59
  ===========
 
 
 
 
 
 
 
 
 
 
 
60
  ### 2.1.0
61
  * Fix more jquery conflict issues
62
  * Clarification on how to add and manage list forms
@@ -66,7 +71,7 @@ Changes
66
 
67
  ### 2.0.2:
68
  * Fix class MCAPI conflict issue
69
- * Automtically check for jquery if not use version 1.7.1
70
  * fix jquery conflict issue (specifically when multiple instance of "jQuery(document).ready..."
71
  * fix jquery conflict with ".cycle" jquery command commonly used in slideshows.
72
  * add jquery libraries 1.7.1 and prototype
1
+ Easy MailChimp Forms
2
  ===========
3
+ Easy MailChimp Forms allows you to painlessly add MailChimp signup forms to your WordPress site. You can add forms to posts or pages with shortcodes or to template files with PHP tags. Simply copy and paste your MailChimp API Key into the plugin admin settings and it will pull in all your MailChimp lists. From there you can choose the lists you want to make forms for. For a single list you can check off the fields you want to include on your form and order them via an easy drag-and-drop interface. This plugin adds plenty of CSS selectors to the form code allowing you to completely customize the look of your forms.
4
 
5
+ Instructions on how to use the plugin can be [found on the FAQ](http://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/faq/ "found on the FAQ"). If you experience any problems, please submit a New Issue on our [Github Issue Tracker](https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues "Github Issue Tracker") and we'll look in to it as soon as possible.
 
 
6
 
7
  Installation
8
  ===========
16
  Frequently Asked Questions
17
  ===========
18
 
19
+ ### Do I need to have a MailChimp Account?
20
+ Yes, you can register for one for free at [MailChimp](https://mailchimp.com/signup/ "MailChimp Signup").
21
+
22
+ ### Do I need to have lists already set up in MailChimp?
23
+ Yes, you have to have at least 1 list set up in MailChimp.
24
+
25
+ For more help, visit the MailChimp Support article [How do I create a new list?](http://kb.mailchimp.com/article/where-can-i-find-my-api-key "How do I create a new list?")
26
 
27
+ ### What do I do first?
28
+ The first step is to add your MailChimp API key. This will allow your site to communicate with your MailChimp account. This is done on the plugin "MailChimp Settings" page.
29
 
30
+ ### Where do I find my API Key?
31
+ From your MailChimp Dashboard, click on your account name in the upper left hand corner of the screen under the MailChimp logo to expose the "Account Settings" menu. Click on "Account Settings" to go to the Account Settings screen and the click on the "Extras" menu. Under "Extras" choose "API keys." From there you can create a new key if you do not already have one.
 
32
 
33
+ For more help, visit the MailChimp Support article [Where can I find my API Key?](http://kb.mailchimp.com/article/where-can-i-find-my-api-key "Where can I find my API Key?")
 
 
34
 
35
+ ### How do I add my MailChimp lists?
36
+ After you add your API key, the plugin will fetch all of your MailChimp list information and load it into the plugin admin. Go to the plugin "Manage List Forms" page to choose the lists you want to make forms for.
37
 
38
+ ### How do I add the MailChimp signup forms to my site?
39
+ You can use a shortcode to add a form to a page or post. For each list on the plugin "Manage List Forms" page you will see a shortcode at the top. Copy the shortcode and paste it into any post or page where you want a form to appear. For example, if my form had the shortcode [yks-mailchimp-list id="1234567891"] I would copy and paste that into the page or post I wanted to add that form to.
 
 
 
 
 
 
 
 
 
40
 
41
+ Alternatively, you can use the PHP snippet to add the form to a template file.
42
 
43
+ ### Don't I have to enter a list ID for each list I want to add to my site?
44
+ Not anymore! With the 2.0 version of the MailChimp API all list information can be imported with just the API key.
45
+
46
+ ### My Information isn't showing up when people subscribe, what gives?
47
  You're likely using an old version of the plugin. Please update to the latest version and import your list data.
48
 
49
+ ### My list data was changed/the form isn't showing up since the 2.0 update, what's up with that?
50
+ Due to the code overhaul required for new version features, the structure we were using to save data had to be completely changed over to conform to the MailChimp schema. The old unique IDs the plugin assigned to lists have been deprecated. The custom fields are now pulled in from the MailChimp servers. If your form isn't showing up with the shortcode, just copy and paste it again to fix this issue.
51
 
52
  Changes
53
  ===========
54
+ ### 2.2.0
55
+ * Change plugin name
56
+ * Add better MailChimp error messaging
57
+ * Add Advanced Error Messaging option
58
+ * Add required fields indication
59
+ * Improve admin UI
60
+ * Update FAQ and screenshots
61
+ * Add list name to forms on Manage List Forms page
62
+ * Implement fetching list fields via MailChimp API key
63
+ * Fix incorrect use of register_uninstall_hook()
64
+
65
  ### 2.1.0
66
  * Fix more jquery conflict issues
67
  * Clarification on how to add and manage list forms
71
 
72
  ### 2.0.2:
73
  * Fix class MCAPI conflict issue
74
+ * Automatically check for jquery if not use version 1.7.1
75
  * fix jquery conflict issue (specifically when multiple instance of "jQuery(document).ready..."
76
  * fix jquery conflict with ".cycle" jquery command commonly used in slideshows.
77
  * add jquery libraries 1.7.1 and prototype
readme.txt CHANGED
@@ -1,20 +1,18 @@
1
- === YIKES, Inc. Easy MailChimp Extender ===
2
- Contributors: seriouslysean, yikesinc, hiwhatsup, liljimmi
3
- Donate link: http://www.yikesinc.com
4
  Tags: mailchimp, marketing, email, mailing lists, newsletter, signup
5
  Requires at least: 3.0
6
- Tested up to: 3.3
7
- Stable tag: 2.1.0
8
 
9
- The YIKES, Inc. Easy MailChimp extender gives you the ability to create sign up forms that allow site visitors to join your MailChimp lists.
10
 
11
  == Description ==
12
 
13
- The YIKES, Inc. Easy MailChimp extender gives you the ability to create sign up forms that allow site visitors to join your MailChimp lists. You can add forms to posts or pages with shortcodes or to template files with PHP tags. Simply copy and paste your API Key and List IDs created by MailChimp into the plugin admin and the plugin will pull in all your MailChimp list fields. You can check off the fields you want to include on your form and order them via an easy drag-and-drop interface. In addition, this plugin adds plenty of CSS hooks to the form code allowing you to completely customize the look of your forms.
14
 
15
- Targeted email messages are a more effective form of eMarketing for your business. The advantages of using MailChimp are vast and now you can expand upon its abilities in WordPress easily. With simple installation and easy to follow instructions, this extender will considerably improve your email marketing campaigns.
16
-
17
- If you notice any issues, please submit a bug on our [Github Issue Tracker](https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues "Github Issue Tracker") and we'll look in to it as soon as possible.
18
 
19
  == Installation ==
20
 
@@ -27,51 +25,56 @@ If you notice any issues, please submit a bug on our [Github Issue Tracker](http
27
  == Frequently Asked Questions ==
28
 
29
  = Do I need to have a MailChimp Account? =
30
- Yes, you can register one for free at [MailChimp](https://mailchimp.com/signup/ "MailChimp Signup").
31
 
32
- = Do I need to already have lists configured? =
33
- Yes, you can configure them through mailchimp. All the plugin needs is your list id and api key.
34
 
35
- = Where do I find my API Key? =
36
- From your MailChimp Dashboard go to Account > API Keys and Authorized Apps. There you will need to add a key if you do not already have one.
37
- For more help visit [The API Key Help Article](http://kb.mailchimp.com/article/where-can-i-find-my-api-key/ "API Key Help Article")
38
 
39
- = Where do I find my List ID? =
40
- From your MailChimp Dashboard go to Lists. Under the specific list you want to make a signup form for, click Settings > List Settings and Unique ID.
41
- For more help visit [The List Id Help Article](http://kb.mailchimp.com/article/how-can-i-find-my-list-id/ "List Id Help Article")
42
 
43
- = Hey, my checkboxes are not appearing in the active Fields options. What gives? =
44
- Mailchimp only supports the following fields from the "FIELDS & MERGE tags"
45
 
46
- * Text
47
- * Number
48
- * Radio Buttons
49
- * Drop Down
50
- * Date
51
- * Birthday
52
- * Address
53
- * Zip Code
54
- * Phone
55
- * Website
56
- * Image
57
 
58
- Unfortunately, checkboxes is not currently an option. We will implement in our plugin as soon as MailChimp offers it as option from their API.
 
59
 
 
 
60
 
61
- = My Information isn't showing up when people subscribe! =
 
 
 
62
  You're likely using an old version of the plugin. Please update to the latest version and import your list data.
63
 
64
- = My list data was changed/the form isn't showing up since the 2.0 update, what gives? =
65
- Due to the code overhaul required for the features of the new version, the structure we were using to save data had to be completely changed over to conform to the MailChimp schema. The old unique ids that the plugin gave to lists have been deprecated. The custom fields that you have are now pulled in from the MailChimp servers. If your form isn't showing up with the shortcode, just copy and paste it again to fix this issue.
66
 
67
  == Screenshots ==
68
 
69
  1. Sidebar menu
70
- 2. Options page
71
- 3. List page
72
- 4. Sample list setup screen on MailChimp
 
73
 
74
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
75
  = 2.1.0 =
76
  * Fix more jquery conflict issues
77
  * Clarification on how to add and manage list forms
@@ -81,14 +84,13 @@ Due to the code overhaul required for the features of the new version, the struc
81
 
82
  = 2.0.2 =
83
  * Fix class MCAPI conflict issue
84
- * Automtically check for jquery if not use version 1.7.1
85
  * fix jquery conflict issue (specifically when multiple instance of "jQuery(document).ready..."
86
  * fix jquery conflict with ".cycle" jquery command commonly used in slideshows.
87
  * add jquery libraries 1.7.1 and protype
88
  * use "noConflict" in each jquery instance to avoid future conflicts.
89
  * update Yikes about us info.
90
 
91
-
92
  = 2.0.1 =
93
  * Now supports multiples of the same list
94
  * Fixed the date format issue
@@ -124,6 +126,10 @@ Due to the code overhaul required for the features of the new version, the struc
124
 
125
  == Upgrade Notice ==
126
 
 
 
 
 
127
  = 2.1.0 =
128
  * Added support for multiples of the same list
129
  * Bug fixes
1
+ === Easy MailChimp Forms ===
2
+ Contributors: yikesinc, hiwhatsup, liljimmi, seriouslysean
3
+ Donate link: http://yikesinc.com
4
  Tags: mailchimp, marketing, email, mailing lists, newsletter, signup
5
  Requires at least: 3.0
6
+ Tested up to: 3.6.1
7
+ Stable tag: 2.2
8
 
9
+ Easy MailChimp Forms allows you to painlessly add MailChimp signup forms to your WordPress site.
10
 
11
  == Description ==
12
 
13
+ Easy MailChimp Forms allows you to painlessly add MailChimp signup forms to your WordPress site. You can add forms to posts or pages with shortcodes or to template files with PHP tags. Simply copy and paste your MailChimp API Key into the plugin admin settings and it will pull in all your MailChimp lists. From there you can choose the lists you want to make forms for. For a single list you can check off the fields you want to include on your form and order them via an easy drag-and-drop interface. This plugin adds plenty of CSS selectors to the form code allowing you to completely customize the look of your forms.
14
 
15
+ Instructions on how to use the plugin can be [found on the FAQ](http://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/faq/ "found on the FAQ"). If you experience any problems, please submit a New Issue on our [Github Issue Tracker](https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues "Github Issue Tracker") and we'll look in to it as soon as possible.
 
 
16
 
17
  == Installation ==
18
 
25
  == Frequently Asked Questions ==
26
 
27
  = Do I need to have a MailChimp Account? =
28
+ Yes, you can register for one for free at [MailChimp](https://mailchimp.com/signup/ "MailChimp Signup").
29
 
30
+ = Do I need to have lists already set up in MailChimp? =
31
+ Yes, you have to have at least 1 list set up in MailChimp.
32
 
33
+ For more help, visit the MailChimp Support article [How do I create a new list?](http://kb.mailchimp.com/article/where-can-i-find-my-api-key "How do I create a new list?")
 
 
34
 
35
+ = What do I do first? =
36
+ The first step is to add your MailChimp API key. This will allow your site to communicate with your MailChimp account. This is done on the plugin "MailChimp Settings" page.
 
37
 
38
+ = Where do I find my API Key? =
39
+ From your MailChimp Dashboard, click on your account name in the upper left hand corner of the screen under the MailChimp logo to expose the "Account Settings" menu. Click on "Account Settings" to go to the Account Settings screen and the click on the "Extras" menu. Under "Extras" choose "API keys." From there you can create a new key if you do not already have one.
40
 
41
+ For more help, visit the MailChimp Support article [Where can I find my API Key?](http://kb.mailchimp.com/article/where-can-i-find-my-api-key "Where can I find my API Key?")
 
 
 
 
 
 
 
 
 
 
42
 
43
+ = How to I add my MailChimp lists? =
44
+ After you add your API key, the plugin will fetch all of your MailChimp list information and load it into the plugin admin. Go to the plugin "Manage List Forms" page to choose the lists you want to make forms for.
45
 
46
+ = How do I add the MailChimp signup forms to my site? =
47
+ You can use a shortcode to add a form to a page or post. For each list on the plugin "Manage List Forms" page you will see a shortcode at the top. Copy the shortcode and paste it into any post or page where you want a form to appear. For example, if my form had the shortcode [yks-mailchimp-list id="1234567891"] I would copy and paste that into the page or post I wanted to add that form to.
48
 
49
+ = Don't I have to enter a list ID for each list I want to add to my site? =
50
+ Not anymore! With the 2.0 version of the MailChimp API all list information can be imported with just the API key.
51
+
52
+ = My Information isn't showing up when people subscribe, what gives? =
53
  You're likely using an old version of the plugin. Please update to the latest version and import your list data.
54
 
55
+ = My list data was changed/the form isn't showing up since the 2.0 update, what's up with that? =
56
+ Due to the code overhaul required for the features of the new version, the structure we were using to save data had to be completely changed over to conform to the MailChimp schema. The old unique IDs the plugin gave to lists have been deprecated. The custom fields that you have are now pulled in from the MailChimp servers. If your form isn't showing up with the shortcode, just copy and paste it again to fix this issue.
57
 
58
  == Screenshots ==
59
 
60
  1. Sidebar menu
61
+ 2. MailChimp settings page
62
+ 3. Manage list forms page
63
+ 4. Inserting a MailChimp form shortcode on a page
64
+ 5. Form displays on the site front-end
65
 
66
  == Changelog ==
67
+ = 2.2.0 =
68
+ * Change plugin name
69
+ * Add better MailChimp error messaging
70
+ * Add Advanced Error Messaging option
71
+ * Add required fields indication
72
+ * Improve admin UI
73
+ * Update FAQ and screenshots
74
+ * Add list name to forms on Manage List Forms page
75
+ * Implement fetching list fields via MailChimp API key
76
+ * Fix incorrect use of register_uninstall_hook()
77
+
78
  = 2.1.0 =
79
  * Fix more jquery conflict issues
80
  * Clarification on how to add and manage list forms
84
 
85
  = 2.0.2 =
86
  * Fix class MCAPI conflict issue
87
+ * Automatically check for jquery if not use version 1.7.1
88
  * fix jquery conflict issue (specifically when multiple instance of "jQuery(document).ready..."
89
  * fix jquery conflict with ".cycle" jquery command commonly used in slideshows.
90
  * add jquery libraries 1.7.1 and protype
91
  * use "noConflict" in each jquery instance to avoid future conflicts.
92
  * update Yikes about us info.
93
 
 
94
  = 2.0.1 =
95
  * Now supports multiples of the same list
96
  * Fixed the date format issue
126
 
127
  == Upgrade Notice ==
128
 
129
+ = 2.2.0 =
130
+ * Added support for multiples of the same list
131
+ * Bug fixes
132
+
133
  = 2.1.0 =
134
  * Added support for multiples of the same list
135
  * Bug fixes
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file
screenshot-4.png CHANGED
Binary file
screenshot-5.png ADDED
Binary file
templates/shortcode_form.php CHANGED
@@ -26,9 +26,9 @@ $ymce = jQuery.noConflict();
26
  data: {
27
  action: 'yks_mailchimp_form',
28
  form_action: 'frontend_submit_form',
29
- form_data: $ymce(this).serialize()
30
  },
31
- dataType: 'json',
32
  success: function(MAILCHIMP)
33
  {
34
  if(MAILCHIMP == '1')
@@ -41,7 +41,7 @@ $ymce = jQuery.noConflict();
41
  else
42
  {
43
  $ymce('#ykfmc-submit_<?php echo $list['id']; ?>').removeAttr('disabled');
44
- $ymce('#yks-status-<?php echo $list['id']; ?>').html('<div class="yks-error"><p>Sorry the email address you entered was previously submitted.</p></div>');
45
  $ymce('#yks-status-<?php echo $list['id']; ?>').slideDown('fast');
46
  }
47
  }
@@ -60,9 +60,12 @@ $ymce = jQuery.noConflict();
60
  </script>
61
 
62
  <div class="yks-mailchimpFormContainer">
63
- <div class="yks-status" id="yks-status-<?php echo $list['id']; ?>"></div>
 
 
 
64
 
65
- <div class="yks-mailchimpFormContainerInner" id="yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>">
66
  <form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
67
  <input type="hidden" name="yks-mailchimp-list-ct" id="yks-mailchimp-list-ct_<?php echo $list['id']; ?>" value="<?php echo $listCt; ?>" />
68
  <input type="hidden" name="yks-mailchimp-list-id" id="yks-mailchimp-list-id_<?php echo $list['id']; ?>" value="<?php echo $list['list-id']; ?>" />
26
  data: {
27
  action: 'yks_mailchimp_form',
28
  form_action: 'frontend_submit_form',
29
+ form_data: $ymce(this).serialize(),
30
  },
31
+ dataType: 'text',
32
  success: function(MAILCHIMP)
33
  {
34
  if(MAILCHIMP == '1')
41
  else
42
  {
43
  $ymce('#ykfmc-submit_<?php echo $list['id']; ?>').removeAttr('disabled');
44
+ $ymce('#yks-status-<?php echo $list['id']; ?>').html('<div class="yks-error"><p>'+ MAILCHIMP +'</p></div>');
45
  $ymce('#yks-status-<?php echo $list['id']; ?>').slideDown('fast');
46
  }
47
  }
60
  </script>
61
 
62
  <div class="yks-mailchimpFormContainer">
63
+ <div class="yks-status" id="yks-status-<?php echo $list['id']; ?>"></div>
64
+ <div class="yks-require-description">
65
+ <span class='yks-required-label'>*</span> = required field
66
+ </div>
67
 
68
+ <div class="yks-mailchimpFormContainerInner" id="yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>">
69
  <form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
70
  <input type="hidden" name="yks-mailchimp-list-ct" id="yks-mailchimp-list-ct_<?php echo $list['id']; ?>" value="<?php echo $listCt; ?>" />
71
  <input type="hidden" name="yks-mailchimp-list-id" id="yks-mailchimp-list-id_<?php echo $list['id']; ?>" value="<?php echo $list['list-id']; ?>" />
yikes-inc-easy-mailchimp-extender.php CHANGED
@@ -1,16 +1,16 @@
1
  <?php
2
  /*
3
  #_________________________________________________ PLUGIN
4
- Plugin Name: YIKES, Inc Easy Mailchimp Extender
5
- Plugin URI: http://www.yikesinc.com
6
  Description: Mailchimp API integration in the form of a shortcode or php snippet
7
- Version: 2.1.0
8
- Author: Yikes, Inc, Sean Kennedy, Tracy Levesque, Carlos Zuniga
9
- Author URI: http://www.yikesinc.com
10
  License: GPL2
11
 
12
  #_________________________________________________ LICENSE
13
- Copyright 2012 Yikes, Inc (email : tech@yikesinc.com)
14
 
15
  This program is free software; you can redistribute it and/or modify
16
  it under the terms of the GNU General Public License, version 2, as
@@ -29,9 +29,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
  #_________________________________________________ CONSTANTS
30
  /** Configuration **/
31
  if(!defined('YKSEME_DEBUG')) define('YKSEME_DEBUG', true);
32
- if(!defined('YKSEME_VERSION_CURRENT')) define('YKSEME_VERSION_CURRENT', '2.1.0');
33
  if(!defined('YKSEME_REQ_PHP')) define('YKSEME_REQ_PHP', '5.0');
34
- if(!defined('YKSEME_AUTHOR')) define('YKSEME_AUTHOR', 'Yikes, Inc, Sean Kennedy, Tracy Levesque, Carlos Zuniga');
35
  if(!defined('YKSEME_SITE')) define('YKSEME_SITE', site_url().'/');
36
  if(!defined('YKSEME_PREFIX')) define('YKSEME_PREFIX', 'ykseme_');
37
  if(!defined('YKSEME_PATH')) define('YKSEME_PATH', ABSPATH.'wp-content/plugins/yikes-inc-easy-mailchimp-extender/');
@@ -57,9 +57,9 @@ require_once YKSEME_PATH.'lib/lib.func.php';
57
  $yksemeBase = new yksemeBase();
58
 
59
  /** Activation Hooks **/
60
- register_activation_hook(__FILE__, array(&$yksemeBase, 'activate'));
61
- register_deactivation_hook(__FILE__, array(&$yksemeBase, 'deactivate'));
62
- register_uninstall_hook(__FILE__, array(&$yksemeBase, 'uninstall'));
63
 
64
 
65
  // Output jquery
1
  <?php
2
  /*
3
  #_________________________________________________ PLUGIN
4
+ Plugin Name: Easy MailChimp Forms
5
+ Plugin URI: http://www.yikesinc.com/services/yikes-inc-easy-mailchimp-extender/
6
  Description: Mailchimp API integration in the form of a shortcode or php snippet
7
+ Version: 2.2.0
8
+ Author: YIKES Inc, Carlos Zuniga, Tracy Levesque, Sean Kennedy
9
+ Author URI: http://yikesinc.com
10
  License: GPL2
11
 
12
  #_________________________________________________ LICENSE
13
+ Copyright 2012-13 YIKES, Inc (email : tech@yikesinc.com)
14
 
15
  This program is free software; you can redistribute it and/or modify
16
  it under the terms of the GNU General Public License, version 2, as
29
  #_________________________________________________ CONSTANTS
30
  /** Configuration **/
31
  if(!defined('YKSEME_DEBUG')) define('YKSEME_DEBUG', true);
32
+ if(!defined('YKSEME_VERSION_CURRENT')) define('YKSEME_VERSION_CURRENT', '2.2.0');
33
  if(!defined('YKSEME_REQ_PHP')) define('YKSEME_REQ_PHP', '5.0');
34
+ if(!defined('YKSEME_AUTHOR')) define('YKSEME_AUTHOR', 'YIKES Inc, Carlos Zuniga, Tracy Levesque, Sean Kennedy');
35
  if(!defined('YKSEME_SITE')) define('YKSEME_SITE', site_url().'/');
36
  if(!defined('YKSEME_PREFIX')) define('YKSEME_PREFIX', 'ykseme_');
37
  if(!defined('YKSEME_PATH')) define('YKSEME_PATH', ABSPATH.'wp-content/plugins/yikes-inc-easy-mailchimp-extender/');
57
  $yksemeBase = new yksemeBase();
58
 
59
  /** Activation Hooks **/
60
+ register_activation_hook(__FILE__, array(&$yksemeBase, 'activate'));
61
+ register_deactivation_hook(__FILE__, array(&$yksemeBase, 'deactivate'));
62
+ register_uninstall_hook(__FILE__, array('yksemeBase', 'uninstall'));
63
 
64
 
65
  // Output jquery