Plugin Directory

Changeset 1181908


Ignore:
Timestamp:
06/16/2015 02:54:14 PM (11 years ago)
Author:
FreshMail.com
Message:
  • NEW: redeveloped stable version * Fix: validation secret and API keys * Fix: checkboxes and integrations with: registration, comments, multisite form, WooCommerce, Easy Dig, bbPress, buddyPress, Contact Form 7
Location:
freshmail-newsletter/trunk
Files:
26 added
7 edited

Legend:

Unmodified
Added
Removed
  • freshmail-newsletter/trunk/CHANGELOG.md

    r1154498 r1181908  
    11### Changelog
     2
     3- 2.0 - 2015-06-15
     4    * NEW: redeveloped stable version
     5    * Fix: validation secret and API keys
     6    * Fix: checkboxes and integrations with: registration, comments, multisite form, WooCommerce, Easy Dig, bbPress, buddyPress, Contact Form 7
    27
    38- 1.6 - 2015-05-06
    49    * Fix: major security update
    5    
     10
    611- 1.5.8 - 2015-04-24
    712    * Fix: compatible with WordPress 4.2
  • freshmail-newsletter/trunk/README.md

    r1067272 r1181908  
    13134. Visit the plugins page in admin and activate it
    1414
     15### Important Info
     16
     17Downgrade from 2.x to 1.x is not supported
     18
    1519### Authors ###
    1620
  • freshmail-newsletter/trunk/assets/css/style.css

    r1061603 r1181908  
    1616 */
    1717
    18 .freshmail_popup{display:none;padding:0!important;border:0!important}.freshmail_dialog,.ui-dialog-titlebar{background:none!important;border:none!important;box-shadow:none!important}.freshmail_dialog .ui-button.ui-dialog-titlebar-close{top:22px!important;width:32px!important;height:31px!important;right:-12px!important}.freshmail_dialog .ui-dialog-titlebar-close:before{content:none!important;width:32px;height:31px}.form_container p{line-height:1.84615;margin-bottom:1.71429rem}.fm_popup_pos{position:fixed;top:0;left:0;right:0}
     18.freshmail_popup {
     19    display: none;
     20    padding: 0 !important;
     21    border: 0 !important
     22}
     23
     24.freshmail_dialog, .ui-dialog-titlebar {
     25    background: none !important;
     26    border: none !important;
     27    box-shadow: none !important
     28}
     29
     30.freshmail_dialog .ui-button.ui-dialog-titlebar-close {
     31    top: 22px !important;
     32    width: 32px !important;
     33    height: 31px !important;
     34    right: -12px !important
     35}
     36
     37.freshmail_dialog .ui-dialog-titlebar-close:before {
     38    content: none !important;
     39    width: 32px;
     40    height: 31px
     41}
     42
     43.form_container p {
     44    line-height: 1.84615;
     45    margin-bottom: 1.71429rem
     46}
     47
     48.fm_popup_pos {
     49    position: fixed;
     50    top: 0;
     51    left: 0;
     52    right: 0
     53}
     54
     55#freshmail-bbpress-checkbox {
     56    float: left;
     57    clear: left;
     58}
     59
     60._fm-sign_required {
     61    display: none !important;
     62}
  • freshmail-newsletter/trunk/assets/css/style_admin.css

    r1061603 r1181908  
    1616 */
    1717
    18 .freshmail{color:#333;font-family:"ArialMT","Arial";font-style:normal;line-height:normal;text-align:left;background:url(../images/freshmail_logo.png);background-repeat:no-repeat;background-position:top right;background-size:183px 42px}.freshmail h1{font-size:24px;font-weight:400}.freshmail h2{font-size:18px;font-weight:400}.freshmail_api span{float:left;width:150px}span.fm_code{font-style:italic;background:#ddd;padding:2px}.freshmail .button_fm:hover,.freshmail .button_fm{background:#09f;box-shadow:none;color:#fff;border:0 none;height:auto;padding:5px 15px;width:auto}.freshmail .button_fm:hover{background:#333}.freshmail .donthaveaccount{border-top:1px solid #ccc;width:100%;clear:left;background:url(../images/bg_1.png);background-repeat:no-repeat;background-position:top right;min-height:200px;margin-top:20px}.freshmail .donthaveaccount p{width:300px}.freshmail .donthaveaccount span{display:block;font-size:16px;padding-top:20px;width:300px}.freshmail .freshsupport a{color:#fff}.freshmail .freshsupport .f_circle{background:#fff;border-radius:50px;float:left;margin:30px 20px}.freshmail .freshsupport p{font-size:16px}.freshmail .freshsupport{background:#333;color:#fff;padding:10px;clear:left}#freshmail_fields{width:650px}#freshmail_fields th{font-weight:700}div.fm_error,div.fm_updated{margin:5px 0 15px}div.fm_updated{background-color:#fff;border-left:4px solid #7ad03a;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);padding:1px 12px}.fm_hidden{display:none}#form_preview_loader{display:none;}#freshmail_theme .widget-inside{display:none;}input.popup-colorpicker{width:70px !important;}
     18.freshmail {
     19    color: #333333;
     20    font-family: "ArialMT", "Arial";
     21    font-style: normal;
     22    line-height: normal;
     23    text-align: left;
     24    background: url(../images/freshmail_logo.png);
     25    background-repeat: no-repeat;
     26    background-position: top right;
     27    background-size: 183px 42px
     28}
     29
     30.freshmail h1 {
     31    font-size: 24px;
     32    font-weight: 400
     33}
     34
     35.freshmail h2 {
     36    font-size: 18px;
     37    font-weight: 400
     38}
     39
     40.freshmail_api span {
     41    float: left;
     42    width: 150px
     43}
     44
     45span.fm_code {
     46    font-style: italic;
     47    background: #dddddd;
     48    padding: 2px
     49}
     50
     51.freshmail .button_fm:hover, .freshmail .button_fm {
     52    background: #0099ff;
     53    box-shadow: none;
     54    color: #ffffff;
     55    border: 0 none;
     56    height: auto;
     57    padding: 5px 15px;
     58    width: auto
     59}
     60
     61.freshmail .button_fm:hover {
     62    background: #333333
     63}
     64
     65.freshmail .donthaveaccount {
     66    border-top: 1px solid #cccccc;
     67    width: 100%;
     68    clear: left;
     69    background: url(../images/bg_1.png);
     70    background-repeat: no-repeat;
     71    background-position: top right;
     72    min-height: 200px;
     73    margin-top: 20px
     74}
     75
     76.freshmail .donthaveaccount p {
     77    width: 300px
     78}
     79
     80.freshmail .donthaveaccount span {
     81    display: block;
     82    font-size: 16px;
     83    padding-top: 20px;
     84    width: 300px
     85}
     86
     87.freshmail .freshsupport a {
     88    color: #ffffff
     89}
     90
     91.freshmail .freshsupport .f_circle {
     92    background: #ffffff;
     93    border-radius: 50px;
     94    float: left;
     95    margin: 30px 20px
     96}
     97
     98.freshmail .freshsupport p {
     99    font-size: 16px
     100}
     101
     102.freshmail .freshsupport {
     103    background: #333333;
     104    color: #ffffff;
     105    padding: 10px;
     106    clear: left
     107}
     108
     109#freshmail_fields {
     110    width: 650px
     111}
     112
     113#freshmail_fields th {
     114    font-weight: 700
     115}
     116
     117div.fm_error, div.fm_updated {
     118    margin: 5px 0 15px
     119}
     120
     121div.fm_updated {
     122    background-color: #ffffff;
     123    border-left: 4px solid #7ad03a;
     124    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
     125    padding: 1px 12px
     126}
     127
     128.fm_hidden {
     129    display: none
     130}
     131
     132#form_preview_loader {
     133    display: none;
     134}
     135
     136#freshmail_theme .widget-inside {
     137    display: none;
     138}
     139
     140input.popup-colorpicker {
     141    width: 70px !important;
     142}
     143
     144.widget-inside {
     145    padding: 10px;
     146}
     147
     148.widget-inside input[type=text] {
     149    width: 50px;
     150}
     151
     152#freshmail_theme {
     153    width: 310px;
     154    float: left;
     155}
     156
     157td .nav-tab-wrapper {
     158    width: 100%;
     159}
     160
     161#messages table tr th {
     162    width: 250px;
     163}
     164
     165#messages table tr td {
     166    width: 550px;
     167}
     168
     169#messages table tr td input {
     170    width: 100%;
     171}
     172
     173#properties select[multiple] {
     174    width: 250px;
     175    height: 200px;
     176}
     177
     178#properties div .fm-select-pages {
     179    width: 270px;
     180    float: left;
     181}
     182
     183#chart_div {
     184    width: 850px;
     185    height: 500px;
     186}
     187
     188.fm-checkboxes-table {
     189    width: 700px;
     190    border: 1px solid #eeeeee;
     191}
     192
     193#fm-admin-checkboxes input[type=text] {
     194    width: 100%;
     195}
     196
     197#fm-connect-error {
     198    color: #b94a48;
     199    background-color: #f2dede;
     200    border-color: #eed3d7;
     201    border-radius: 4px;
     202    padding-left: 5px;
     203}
     204
     205#reports_form {
     206    float: left;
     207    margin-bottom: 20px;
     208}
     209
     210.fm-report-set-time {
     211    background: #ffffff;
     212    padding: 15px;
     213    text-align: center
     214}
     215
     216#reports_form .widefat {
     217    border: 1px solid #cccccc;
     218    width: 410px;
     219    float: left;
     220    margin-right: 20px;
     221    margin-top: 20px;
     222}
     223
     224#reports_form .widefat .table-bar {
     225    background: #f5f5f5;
     226    border: 1px solid #cccccc;
     227}
     228
     229#reports_form .widefat .table-bar th {
     230    font-weight: bold;
     231    border-bottom: 1px solid #cccccc;
     232}
     233
     234#reports_form .widefat td {
     235    border-bottom: 1px solid #cccccc;
     236}
     237
     238#reports_form .widefat tr td:last-child {
     239    text-align: right;
     240}
     241
     242.f_circle .img-padding{
     243    padding: 15px;
     244}
     245
     246#appearance .fm-preview-theme {
     247    float: left;
     248    padding-left: 20px;
     249}
  • freshmail-newsletter/trunk/assets/js/scripts.js

    r1081877 r1181908  
    1818// admin
    1919jQuery(document).ready(function() {
    20     jQuery(document).on("keypress", 'form#fm_form', function(e) {
     20    jQuery(document).on('keypress', 'form#fm_form', function(e) {
    2121        var code = e.keyCode || e.which;
    2222        if (code == 13) {
     
    2828    initAddForm();
    2929
    30     jQuery(".report_checkbox").click(function() {
     30    jQuery('.report_checkbox').click(function() {
    3131        console.log(jQuery(this).val());
    3232        refreshReports();
     
    131131        previewForm();
    132132    });
     133
    133134    jQuery("#accordion").accordion({
    134135        heightStyle: 'content',
     
    136137        active: false
    137138    });
     139
    138140    jQuery('body').click(function(){
    139141        if (jQuery('.wp-picker-open').length == 1) {
  • freshmail-newsletter/trunk/assets/js/user.js

    r1143591 r1181908  
    1717
    1818// user
    19 jQuery(document).ready(function($) {
    20     $('.form_subscribe').submit(function() {
     19jQuery(document).ready(function($){
     20    $('.form_subscribe').submit(function(){
     21        var fm_form_id = '.freshmail_form_' + $(this).find('input[name=fm_form_id]').val();
     22
     23
    2124        var btn_val = $(this).find('button.form_subscribe_button').html();
    22         $(this).find('button.form_subscribe_button').html("Sending...");
    23         $(this).find('button.form_subscribe_button').css("opacity", "0.6");
    24         $(this).find('button.form_subscribe_button').attr("disabled", "disabled");
    25         $.post(static_var.ajax, $(this).serialize(), function(data) {
     25        $(fm_form_id).find('button.form_subscribe_button').html("Sending...");
     26        $(fm_form_id).find('button.form_subscribe_button').css("opacity", "0.6");
     27        $(fm_form_id).find('button.form_subscribe_button').attr("disabled", "disabled");
     28        $.post(static_var.ajax, $(this).serialize(), function(data){
    2629            var obj = $.parseJSON(data);
    27             $('button.form_subscribe_button').html(btn_val);
    28             $('button.form_subscribe_button').css("opacity", "1");
    29             $('button.form_subscribe_button').removeAttr("disabled");
    30             if (obj.status == "success") {
    31                 $('.form_subscribe').html('<span class="message_' + obj.status + '">' + obj.message + '</span>');
    32                 if (obj.redirect != 0) {
    33                     setTimeout(function() {
     30            $(fm_form_id).find('button.form_subscribe_button').html(btn_val);
     31            $(fm_form_id).find('button.form_subscribe_button').css("opacity", "1");
     32            $(fm_form_id).find('button.form_subscribe_button').removeAttr("disabled");
     33            if(obj.status == "success"){
     34
     35                $(fm_form_id).html('<span class="message_' + obj.status + '">' + obj.message + '</span>');
     36                if(obj.redirect != 0){
     37                    setTimeout(function(){
    3438                        document.location = obj.redirect;
    3539                    }, 2000);
    3640                }
    3741            }
    38             if (obj.status == "error") {
     42            if(obj.status == "error"){
    3943                $('.message_error').remove();
    40                 $('.form_subscribe').prepend('<span class="message_' + obj.status + '">' + obj.message + '</span>');
     44                $(fm_form_id).prepend('<span class="message_' + obj.status + '">' + obj.message + '</span>');
    4145            }
    4246        });
  • freshmail-newsletter/trunk/wp-freshmail.php

    r1154498 r1181908  
    44 * Plugin URI: http://freshmail.com/plugin/wordpress-newsletter/
    55 * Description: FreshMail is an email marketing tool for creating and sending amazing newsletters. Our intuitive system leads users from campaign planning and creation to final reports. A free account lets you send up to 2000 messages to a maximum of 500 recipients each month.
    6  * Version: 1.6
     6 * Version: 2.0
    77 * Author: Borbis Media
    88 * Author URI: http://www.borbis.com
     
    2121// Define plugin version for upgrade
    2222if (!defined('WP_FRESHMAIL_VERSION')) {
    23     define('WP_FRESHMAIL_VERSION', '1.6');
     23    define('WP_FRESHMAIL_VERSION', '2.0');
    2424}
    2525
    26 register_activation_hook(__FILE__, 'freshmail_activation');
    27 add_action('plugins_loaded', 'freshmail_init');
    28 function freshmail_init()
    29 {
    30     if (!session_id()) {
    31         session_start();
     26add_action('plugins_loaded', function (){
     27
     28    // plugin use classes with namespaces
     29    if (version_compare(PHP_VERSION, '5.3.0', '<')) {
     30        add_action('admin_notices', function (){
     31            echo '<div class="error"><p>Freshmail Plugin requires php 5.3 or greater!</p></div>';
     32        });
     33    } else {
     34
     35        $currentVersion = get_option('WP_FRESHMAIL_VERSION', 0);
     36        if ($currentVersion < WP_FRESHMAIL_VERSION) {
     37
     38            global $wpdb;
     39
     40            require_once(ABSPATH.'wp-admin/includes/upgrade.php');
     41
     42            $sql = 'CREATE TABLE IF NOT EXISTS '.$wpdb->prefix.'freshmail_stats (
     43                            form_id VARCHAR( 100 ) NOT NULL,
     44                            referer VARCHAR( 100 ) NOT NULL,
     45                            insert_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
     46                            ) DEFAULT CHARSET = utf8;';
     47            dbDelta($sql);
     48
     49            $sql = 'CREATE TABLE IF NOT EXISTS '.$wpdb->prefix.'freshmail_forms (
     50                            form_id INT(11) NOT NULL AUTO_INCREMENT,
     51                            freshmail_list_id VARCHAR(50) NOT NULL DEFAULT \'\',
     52                            freshmail_list_name VARCHAR(255) NOT NULL DEFAULT \'\',
     53                            freshmail_form_var text NULL,
     54                            insert_date datetime NOT NULL DEFAULT \'0000-00-00 00:00:00\',
     55                            last_edited datetime NOT NULL DEFAULT \'0000-00-00 00:00:00\',
     56                            UNIQUE KEY form_id (form_id)
     57                            ) DEFAULT CHARSET=utf8;';
     58            dbDelta($sql);
     59
     60
     61            // check if old table exist
     62            $fm_forms = $wpdb->get_row('SELECT table_name FROM information_schema.tables WHERE table_name LIKE "'.$wpdb->prefix.'fm_forms"');
     63            if (!empty($fm_forms)) {
     64                $data = $wpdb->get_results('SELECT * FROM '.$wpdb->prefix.'fm_forms', ARRAY_A);
     65
     66                if (!empty($data)) {
     67                    //check if this column is from freshmail !
     68                    $correct = true;
     69                    foreach (array_keys(reset($data)) as $row) {
     70                        if (!in_array($row, array('form_id', 'freshmail_list_id', 'freshmail_list_name', 'freshmail_form_var', 'insert_date', 'last_edited'))) {
     71                            $correct = false;
     72                        }
     73                    }
     74
     75                    if ($correct === true) {
     76                        foreach ($data as $row) {
     77                            unset($row['form_id']);
     78                            $wpdb->insert($wpdb->prefix.'freshmail_forms', $row);
     79                        }
     80                    }
     81                }
     82            }
     83
     84            $stats = $wpdb->get_row('SELECT table_name FROM information_schema.tables WHERE table_name LIKE "'.$wpdb->prefix.'fm_forms"');
     85            if (!empty($stats)) {
     86                $data = $wpdb->get_results('SELECT * FROM '.$wpdb->prefix.'freshmail_stats', ARRAY_A);
     87
     88                if (!empty($data)) {
     89                    //check if this collumn is from freshmail !
     90                    $correct = true;
     91                    foreach (array_keys(reset($data)) as $row) {
     92                        if (!in_array($row, array('form_id', 'referer', 'insert_date', 'mail_id', 'email', 'ext_fields'))) {
     93                            $correct = false;
     94                        }
     95                    }
     96
     97                    if ($correct === true) {
     98                        foreach ($data as $row) {
     99                            $stat = array(
     100                                'form_id' => $row['form_id'],
     101                                'referer' => $row['referer'],
     102                                'insert_date' => $row['insert_date']
     103                            );
     104                            $wpdb->insert($wpdb->prefix.'freshmail_stats', $stat);
     105                        }
     106                    }
     107                }
     108            }
     109
     110            $oldCustomThemes = get_option('freshmail_custom_theme');
     111
     112            if ($oldCustomThemes === false) {
     113
     114                $defaultThemes = serialize(array(
     115                    __('Black_and_white', 'wp_freshmail') => array(
     116                        'form_container' => array(
     117                            'width' => 300,
     118                            'width2' => 'px',
     119                            'background_color' => '#ffffff',
     120                            'border_color' => '#000000',
     121                            'border_width' => 0,
     122                            'rounded_corners' => 5,
     123                            'padding1' => 0,
     124                            'padding2' => 24,
     125                        ),
     126                        'text_header' => array(
     127                            'display' => 'yes',
     128                            'text_color' => '#000000',
     129                            'text_size' => 18,
     130                            'text_alignment' => 'center',
     131                        ),
     132                        'sub_header' => array(
     133                            'display' => 'no',
     134                            'text_color' => '#000000',
     135                            'text_size' => 11,
     136                            'text_alignment' => 'center',
     137                        ),
     138                        'label' => array(
     139                            'width' => 100,
     140                            'select_width' => 'px',
     141                            'position' => 'clear:left;display:block;',
     142                            'text_color' => '#000000',
     143                            'text_size' => 9,
     144                            'select_text_style' => 'font-style:normal;',
     145                            'display_labels' => 'yes',
     146                            'display_placeholders' => 'yes',
     147                        ),
     148                        'field' => array(
     149                            'width' => 100,
     150                            'select_field_width' => '%',
     151                            'height' => 35,
     152                            'select_field_height' => 'px',
     153                            'text_color' => '#000000',
     154                            'text_size' => 12,
     155                            'border_color' => '#b7b7b7',
     156                            'border_width' => 1,
     157                        ),
     158                        'checkbox_agreement' => array(
     159                            'display' => 'no',
     160                            'checked' => 'no',
     161                            'text_color' => '#000000',
     162                            'text_size' => 9,
     163                            'text_aligment' => 'left',
     164                        ),
     165                        'button' => array(
     166                            'width' => 120,
     167                            'select_width' => 'px',
     168                            'height' => 40,
     169                            'select_height' => 'px',
     170                            'select_aligment' => 'center',
     171                            'text_size' => 11,
     172                            'text_color' => '#ffffff',
     173                            'background_color' => '#000000',
     174                            'border_color' => '#8c8c8c',
     175                            'border_width' => 0,
     176                            'rounded_corners' => 5,
     177                        ),
     178                        'button_hovered' => array(
     179                            'background_color' => '',
     180                            'border_color' => '',
     181                            'text_color' => '',
     182                        ),
     183                        'error_success' => array(
     184                            'error_text_color' => '',
     185                            'success_text_color' => '',
     186                        ),
     187                    ),
     188                    __('Yellow', 'wp_freshmail') => array(
     189                        'name' => '',
     190                        'form_container' => array(
     191                            'width' => 400,
     192                            'width2' => 'px',
     193                            'background_color' => '#fef200',
     194                            'border_color' => '#000000',
     195                            'border_width' => 0,
     196                            'rounded_corners' => 5,
     197                            'padding1' => 5,
     198                            'padding2' => 15,
     199                        ),
     200                        'text_header' => array(
     201                            'display' => 'yes',
     202                            'text_color' => '#000000',
     203                            'text_size' => 20,
     204                            'text_alignment' => 'center',
     205                        ),
     206                        'sub_header' => array(
     207                            'display' => 'no',
     208                            'text_color' => '#000000',
     209                            'text_size' => 12,
     210                            'text_alignment' => 'center',
     211                        ),
     212                        'label' => array(
     213                            'width' => 20,
     214                            'select_width' => '%',
     215                            'position' => 'display:block;float:left;',
     216                            'text_color' => '#0a0a0a',
     217                            'text_size' => 12,
     218                            'select_text_style' => 0,
     219                            'display_labels' => 'yes',
     220                            'display_placeholders' => 'yes',
     221                        ),
     222                        'field' => array(
     223                            'width' => 79,
     224                            'select_field_width' => '%',
     225                            'height' => 30,
     226                            'select_field_height' => 'px',
     227                            'text_color' => '#000000',
     228                            'text_size' => 10,
     229                            'border_color' => '#dddddd',
     230                            'border_width' => 1,
     231                        ),
     232                        'checkbox_agreement' => array(
     233                            'display' => 'no',
     234                            'text_color' => '#000000',
     235                            'text_size' => 10,
     236                            'text_aligment' => 'left',
     237                        ),
     238                        'button' => array(
     239                            'width' => 100,
     240                            'select_width' => '%',
     241                            'height' => 40,
     242                            'select_height' => 'px',
     243                            'select_aligment' => 'left',
     244                            'text_size' => 12,
     245                            'text_color' => '#ffffff',
     246                            'background_color' => '#000000',
     247                            'border_color' => '#383838',
     248                            'border_width' => 0,
     249                            'rounded_corners' => 5,
     250                        ),
     251                        'button_hovered' => array(
     252                            'background_color' => '',
     253                            'border_color' => '',
     254                            'text_color' => '',
     255                        ),
     256                        'error_success' => array(
     257                            'error_text_color' => '',
     258                            'success_text_color' => '',
     259                        ),
     260                    ),
     261                    __('Grey', 'wp_freshmail') => array(
     262                        'form_container' => array(
     263                            'width' => 400,
     264                            'width2' => 'px',
     265                            'background_color' => '#ededed',
     266                            'border_color' => '#000000',
     267                            'border_width' => 1,
     268                            'rounded_corners' => 0,
     269                            'padding1' => 0,
     270                            'padding2' => 20,
     271                        ),
     272                        'text_header' => array(
     273                            'display' => 'yes',
     274                            'text_color' => '#000000',
     275                            'text_size' => 14,
     276                            'text_alignment' => 'center',
     277                        ),
     278                        'sub_header' => array(
     279                            'display' => 'no',
     280                            'text_color' => '#000000',
     281                            'text_size' => 11,
     282                            'text_alignment' => 'center',
     283                        ),
     284                        'label' => array(
     285                            'width' => 100,
     286                            'select_width' => 'px',
     287                            'position' => 'clear:left;display:block;',
     288                            'text_color' => '#000000',
     289                            'text_size' => 9,
     290                            'select_text_style' => 'font-style:normal;',
     291                            'display_labels' => 'yes',
     292                            'display_placeholders' => 'yes',
     293                        ),
     294                        'field' => array(
     295                            'width' => 100,
     296                            'select_field_width' => '%',
     297                            'height' => 40,
     298                            'select_field_height' => 'px',
     299                            'text_color' => '#000000',
     300                            'text_size' => 12,
     301                            'border_color' => '#ededed',
     302                            'border_width' => 1,
     303                        ),
     304                        'checkbox_agreement' => array(
     305                            'display' => 'no',
     306                            'checked' => 'no',
     307                            'text_color' => '#000000',
     308                            'text_size' => 9,
     309                            'text_aligment' => 'left',
     310                        ),
     311                        'button' => array(
     312                            'width' => 120,
     313                            'select_width' => 'px',
     314                            'height' => 40,
     315                            'select_height' => 'px',
     316                            'select_aligment' => 'center',
     317                            'text_size' => 11,
     318                            'text_color' => '#000000',
     319                            'background_color' => '#ededed',
     320                            'border_color' => '#000000',
     321                            'border_width' => 2,
     322                            'rounded_corners' => 0,
     323                        ),
     324                        'button_hovered' => array(
     325                            'background_color' => '',
     326                            'border_color' => '',
     327                            'text_color' => '',
     328                        ),
     329                        'error_success' => array(
     330                            'error_text_color' => '',
     331                            'success_text_color' => '',
     332                        ),
     333                    ),
     334                    __('Blue', 'wp_freshmail') => array(
     335                        'form_container' => array(
     336                            'width' => 300,
     337                            'width2' => 'px',
     338                            'background_color' => '#1b3558',
     339                            'border_color' => '#f14231',
     340                            'border_width' => 0,
     341                            'rounded_corners' => 0,
     342                            'padding1' => 0,
     343                            'padding2' => 40,
     344                        ),
     345                        'text_header' => array(
     346                            'display' => 'yes',
     347                            'text_color' => '#ffffff',
     348                            'text_size' => 20,
     349                            'text_alignment' => 'center',
     350                        ),
     351                        'sub_header' => array(
     352                            'display' => 'no',
     353                            'text_color' => '#ffffff',
     354                            'text_size' => 11,
     355                            'text_alignment' => 'center',
     356                        ),
     357                        'label' => array(
     358                            'width' => 100,
     359                            'select_width' => 'px',
     360                            'position' => 'clear:left;display:block;',
     361                            'text_color' => '#ffffff',
     362                            'text_size' => 9,
     363                            'select_text_style' => 'font-style:normal;',
     364                            'display_labels' => 'yes',
     365                            'display_placeholders' => 'yes',
     366                        ),
     367                        'field' => array(
     368                            'width' => 100,
     369                            'select_field_width' => '%',
     370                            'height' => 30,
     371                            'select_field_height' => 'px',
     372                            'text_color' => '#5e5e5e',
     373                            'text_size' => 11,
     374                            'border_color' => '#b7b7b7',
     375                            'border_width' => 1,
     376                        ),
     377                        'checkbox_agreement' => array(
     378                            'display' => 'yes',
     379                            'checked' => 'no',
     380                            'text_color' => '#9aabb7',
     381                            'text_size' => 9,
     382                            'text_aligment' => 'center',
     383                        ),
     384                        'button' => array(
     385                            'width' => 120,
     386                            'select_width' => 'px',
     387                            'height' => 40,
     388                            'select_height' => 'px',
     389                            'select_aligment' => 'center',
     390                            'text_size' => 11,
     391                            'text_color' => '#ffffff',
     392                            'background_color' => '#f14231',
     393                            'border_color' => '#8c8c8c',
     394                            'border_width' => 0,
     395                            'rounded_corners' => 5,
     396                        ),
     397                        'button_hovered' => array(
     398                            'background_color' => '',
     399                            'border_color' => '',
     400                            'text_color' => '',
     401                        ),
     402                        'error_success' => array(
     403                            'error_text_color' => '',
     404                            'success_text_color' => '',
     405                        ),
     406                    ),
     407                    __('White_and_Red', 'wp_freshmail') => array(
     408                        'form_container' => array(
     409                            'width' => 300,
     410                            'width2' => 'px',
     411                            'background_color' => '#ffffff',
     412                            'border_color' => '#000000',
     413                            'border_width' => 1,
     414                            'rounded_corners' => 0,
     415                            'padding1' => 0,
     416                            'padding2' => 14,
     417                        ),
     418                        'text_header' => array(
     419                            'display' => 'no',
     420                            'text_color' => '#000000',
     421                            'text_size' => 18,
     422                            'text_alignment' => 'center',
     423                        ),
     424                        'sub_header' => array(
     425                            'display' => 'yes',
     426                            'text_color' => '#000000',
     427                            'text_size' => 13,
     428                            'text_alignment' => 'center',
     429                        ),
     430                        'label' => array(
     431                            'width' => 19,
     432                            'select_width' => '%',
     433                            'position' => 'display:block;float:left;',
     434                            'text_color' => '#000000',
     435                            'text_size' => 10,
     436                            'select_text_style' => 'font-style:normal;',
     437                            'display_labels' => 'yes',
     438                            'display_placeholders' => 'yes',
     439                        ),
     440                        'field' => array(
     441                            'width' => 80,
     442                            'select_field_width' => '%',
     443                            'height' => 30,
     444                            'select_field_height' => 'px',
     445                            'text_color' => '#000000',
     446                            'text_size' => 12,
     447                            'border_color' => '#b7b7b7',
     448                            'border_width' => 1,
     449                        ),
     450                        'checkbox_agreement' => array(
     451                            'display' => 'no',
     452                            'checked' => 'no',
     453                            'text_color' => '#000000',
     454                            'text_size' => 9,
     455                            'text_aligment' => 'left',
     456                        ),
     457                        'button' => array(
     458                            'width' => 110,
     459                            'select_width' => 'px',
     460                            'height' => 35,
     461                            'select_height' => 'px',
     462                            'select_aligment' => 'right',
     463                            'text_size' => 11,
     464                            'text_color' => '#ffffff',
     465                            'background_color' => '#f14231',
     466                            'border_color' => '#8c8c8c',
     467                            'border_width' => 0,
     468                            'rounded_corners' => 0,
     469                        ),
     470                        'button_hovered' => array(
     471                            'background_color' => '',
     472                            'border_color' => '',
     473                            'text_color' => '',
     474                        ),
     475                        'error_success' => array(
     476                            'error_text_color' => '',
     477                            'success_text_color' => '',
     478                        ),
     479                    ),
     480                    __('Green', 'wp_freshmail') => array(
     481                        'form_container' => array(
     482                            'width' => 350,
     483                            'width2' => 'px',
     484                            'background_color' => '#36c113',
     485                            'border_color' => '#417d07',
     486                            'border_width' => 0,
     487                            'rounded_corners' => 5,
     488                            'padding1' => 0,
     489                            'padding2' => 20,
     490                        ),
     491                        'text_header' => array(
     492                            'display' => 'yes',
     493                            'text_color' => '#ffffff',
     494                            'text_size' => 18,
     495                            'text_alignment' => 'center',
     496                        ),
     497                        'sub_header' => array(
     498                            'display' => 'no',
     499                            'text_color' => '#417d07',
     500                            'text_size' => 11,
     501                            'text_alignment' => 'center',
     502                        ),
     503                        'label' => array(
     504                            'width' => 19,
     505                            'select_width' => '%',
     506                            'position' => 'display:block;float:left;',
     507                            'text_color' => '#ffffff',
     508                            'text_size' => 12,
     509                            'select_text_style' => 'font-style:normal;',
     510                            'display_labels' => 'yes',
     511                            'display_placeholders' => 'yes',
     512                        ),
     513                        'field' => array(
     514                            'width' => 80,
     515                            'select_field_width' => '%',
     516                            'height' => 30,
     517                            'select_field_height' => 'px',
     518                            'text_color' => '#5e5e5e',
     519                            'text_size' => 11,
     520                            'border_color' => '#b7b7b7',
     521                            'border_width' => 1,
     522                        ),
     523                        'checkbox_agreement' => array(
     524                            'display' => 'no',
     525                            'checked' => 'no',
     526                            'text_color' => '#417d07',
     527                            'text_size' => 9,
     528                            'text_aligment' => 'center',
     529                        ),
     530                        'button' => array(
     531                            'width' => 120,
     532                            'select_width' => 'px',
     533                            'height' => 40,
     534                            'select_height' => 'px',
     535                            'select_aligment' => 'center',
     536                            'text_size' => 11,
     537                            'text_color' => '#ffffff',
     538                            'background_color' => '#417d07',
     539                            'border_color' => '#8c8c8c',
     540                            'border_width' => 0,
     541                            'rounded_corners' => 20,
     542                        ),
     543                        'button_hovered' => array(
     544                            'background_color' => '',
     545                            'border_color' => '',
     546                            'text_color' => '',
     547                        ),
     548                        'error_success' => array(
     549                            'error_text_color' => '',
     550                            'success_text_color' => '',
     551                        ),
     552                    ),
     553                    __('Black', 'wp_freshmail') => array(
     554                        'form_container' => array(
     555                            'width' => 300,
     556                            'width2' => 'px',
     557                            'background_color' => '#000000',
     558                            'border_color' => '#f14231',
     559                            'border_width' => 0,
     560                            'rounded_corners' => 0,
     561                            'padding1' => 0,
     562                            'padding2' => 40,
     563                        ),
     564                        'text_header' => array(
     565                            'display' => 'yes',
     566                            'text_color' => '#ffffff',
     567                            'text_size' => 20,
     568                            'text_alignment' => 'center',
     569                        ),
     570                        'sub_header' => array(
     571                            'display' => 'no',
     572                            'text_color' => '#ffffff',
     573                            'text_size' => 11,
     574                            'text_alignment' => 'center',
     575                        ),
     576                        'label' => array(
     577                            'width' => 100,
     578                            'select_width' => 'px',
     579                            'position' => 'clear:left;display:block;',
     580                            'text_color' => '#ffffff',
     581                            'text_size' => 9,
     582                            'select_text_style' => 'font-style:normal;',
     583                            'display_labels' => 'yes',
     584                            'display_placeholders' => 'yes',
     585                        ),
     586                        'field' => array(
     587                            'width' => 100,
     588                            'select_field_width' => '%',
     589                            'height' => 30,
     590                            'select_field_height' => 'px',
     591                            'text_color' => '#5e5e5e',
     592                            'text_size' => 12,
     593                            'border_color' => '#b7b7b7',
     594                            'border_width' => 1,
     595                        ),
     596                        'checkbox_agreement' => array(
     597                            'display' => 'yes',
     598                            'checked' => 'no',
     599                            'text_color' => '#c1c1c1',
     600                            'text_size' => 9,
     601                            'text_aligment' => 'center',
     602                        ),
     603                        'button' => array(
     604                            'width' => 130,
     605                            'select_width' => 'px',
     606                            'height' => 44,
     607                            'select_height' => 'px',
     608                            'select_aligment' => 'center',
     609                            'text_size' => 11,
     610                            'text_color' => '#ffffff',
     611                            'background_color' => '#000000',
     612                            'border_color' => '#ffffff',
     613                            'border_width' => 1,
     614                            'rounded_corners' => 25,
     615                        ),
     616                        'button_hovered' => array(
     617                            'background_color' => '',
     618                            'border_color' => '',
     619                            'text_color' => '',
     620                        ),
     621                        'error_success' => array(
     622                            'error_text_color' => '',
     623                            'success_text_color' => '',
     624                        ),
     625                    ),
     626                    __('green_only_placeholders', 'wp_freshmail') => array
     627                    (
     628                        'form_container' => array(
     629                            'width' => '350',
     630                            'width2' => 'px',
     631                            'background_color' => '#36c113',
     632                            'border_color' => '#417d07',
     633                            'border_width' => '0',
     634                            'rounded_corners' => '5',
     635                            'padding1' => '0',
     636                            'padding2' => '20',
     637                        ),
     638                        'text_header' => array(
     639                            'display' => 'yes',
     640                            'text_color' => '#ffffff',
     641                            'text_size' => '18',
     642                            'text_alignment' => 'center',
     643                        ),
     644                        'sub_header' => array(
     645                            'display' => 'no',
     646                            'text_color' => '#417d07',
     647                            'text_size' => '11',
     648                            'text_alignment' => 'center',
     649                        ),
     650                        'label' => array(
     651                            'width' => '0',
     652                            'select_width' => '%',
     653                            'position' => 'display:block;float:left;',
     654                            'text_color' => '#ffffff',
     655                            'text_size' => '12',
     656                            'select_text_style' => 'font-style:normal;',
     657                            'display_placeholders' => 'yes',
     658                        ),
     659                        'field' => array(
     660                            'width' => '100',
     661                            'select_field_width' => '%',
     662                            'height' => '30',
     663                            'select_field_height' => 'px',
     664                            'text_color' => '#5e5e5e',
     665                            'text_size' => '11',
     666                            'border_color' => '#b7b7b7',
     667                            'border_width' => '1',
     668                        ),
     669                        'checkbox_agreement' => array(
     670                            'display' => 'no',
     671                            'checked' => 'no',
     672                            'text_color' => '#417d07',
     673                            'text_size' => '9',
     674                            'text_aligment' => 'center',
     675                        ),
     676                        'button' => array(
     677                            'width' => '120',
     678                            'select_width' => 'px',
     679                            'height' => '40',
     680                            'select_height' => 'px',
     681                            'select_aligment' => 'center',
     682                            'text_size' => '11',
     683                            'text_color' => '#ffffff',
     684                            'background_color' => '#417d07',
     685                            'border_color' => '#8c8c8c',
     686                            'border_width' => '0',
     687                            'rounded_corners' => '20',
     688                        ),
     689                        'button_hovered' => array(
     690                            'background_color' => '',
     691                            'border_color' => '',
     692                            'text_color' => '',
     693                        ),
     694                        'error_success' => array(
     695                            'error_text_color' => '',
     696                            'success_text_color' => '',
     697                        ),
     698                    ),
     699                    __('black_only_placeholders', 'wp_freshmail') => array
     700                    (
     701                        'form_container' => array(
     702                            'width' => '300',
     703                            'width2' => 'px',
     704                            'background_color' => '#000000',
     705                            'border_color' => '#f14231',
     706                            'border_width' => '0',
     707                            'rounded_corners' => '0',
     708                            'padding1' => '0',
     709                            'padding2' => '40',
     710                        ),
     711                        'text_header' => array(
     712                            'display' => 'yes',
     713                            'text_color' => '#ffffff',
     714                            'text_size' => '20',
     715                            'text_alignment' => 'center',
     716                        ),
     717                        'sub_header' => array(
     718                            'display' => 'no',
     719                            'text_color' => '#ffffff',
     720                            'text_size' => '11',
     721                            'text_alignment' => 'center',
     722                        ),
     723                        'label' => array(
     724                            'width' => '0',
     725                            'select_width' => 'px',
     726                            'position' => 'clear:left;display:block;',
     727                            'text_color' => '#ffffff',
     728                            'text_size' => '0',
     729                            'select_text_style' => 'font-style:normal;',
     730                            'display_placeholders' => 'yes',
     731                        ),
     732                        'field' => array(
     733                            'width' => '100',
     734                            'select_field_width' => '%',
     735                            'height' => '30',
     736                            'select_field_height' => 'px',
     737                            'text_color' => '#5e5e5e',
     738                            'text_size' => '12',
     739                            'border_color' => '#b7b7b7',
     740                            'border_width' => '1',
     741                        ),
     742                        'checkbox_agreement' => array(
     743                            'display' => 'yes',
     744                            'checked' => 'no',
     745                            'text_color' => '#c1c1c1',
     746                            'text_size' => '9',
     747                            'text_aligment' => 'center',
     748                        ),
     749                        'button' => array(
     750                            'width' => '130',
     751                            'select_width' => 'px',
     752                            'height' => '44',
     753                            'select_height' => 'px',
     754                            'select_aligment' => 'center',
     755                            'text_size' => '11',
     756                            'text_color' => '#ffffff',
     757                            'background_color' => '#000000',
     758                            'border_color' => '#ffffff',
     759                            'border_width' => '1',
     760                            'rounded_corners' => '25',
     761                        ),
     762                        'button_hovered' => array(
     763                            'background_color' => '',
     764                            'border_color' => '',
     765                            'text_color' => '',
     766                        ),
     767                        'error_success' => array(
     768                            'error_text_color' => '',
     769                            'success_text_color' => '',
     770                        ),
     771                    ),
     772                    __('blue_only_placeholders', 'wp_freshmail') => array
     773                    (
     774                        'form_container' => array(
     775                            'width' => '300',
     776                            'width2' => 'px',
     777                            'background_color' => '#1b3558',
     778                            'border_color' => '#f14231',
     779                            'border_width' => '0',
     780                            'rounded_corners' => '0',
     781                            'padding1' => '0',
     782                            'padding2' => '40',
     783                        ),
     784                        'text_header' => array(
     785                            'display' => 'yes',
     786                            'text_color' => '#ffffff',
     787                            'text_size' => '20',
     788                            'text_alignment' => 'center',
     789                        ),
     790                        'sub_header' => array(
     791                            'display' => 'no',
     792                            'text_color' => '#ffffff',
     793                            'text_size' => '11',
     794                            'text_alignment' => 'center',
     795                        ),
     796                        'label' => array(
     797                            'width' => '0',
     798                            'select_width' => '%',
     799                            'position' => 'clear:left;display:block;',
     800                            'text_color' => '#ffffff',
     801                            'text_size' => '0',
     802                            'select_text_style' => 'font-style:normal;',
     803                            'display_placeholders' => 'yes',
     804                        ),
     805                        'field' => array(
     806                            'width' => '100',
     807                            'select_field_width' => '%',
     808                            'height' => '30',
     809                            'select_field_height' => 'px',
     810                            'text_color' => '#5e5e5e',
     811                            'text_size' => '11',
     812                            'border_color' => '#b7b7b7',
     813                            'border_width' => '1',
     814                        ),
     815                        'checkbox_agreement' => array(
     816                            'display' => 'yes',
     817                            'checked' => 'no',
     818                            'text_color' => '#9aabb7',
     819                            'text_size' => '9',
     820                            'text_aligment' => 'center',
     821                        ),
     822                        'button' => array(
     823                            'width' => '120',
     824                            'select_width' => 'px',
     825                            'height' => '40',
     826                            'select_height' => 'px',
     827                            'select_aligment' => 'center',
     828                            'text_size' => '11',
     829                            'text_color' => '#ffffff',
     830                            'background_color' => '#f14231',
     831                            'border_color' => '#8c8c8c',
     832                            'border_width' => '0',
     833                            'rounded_corners' => '5',
     834                        ),
     835                        'button_hovered' => array(
     836                            'background_color' => '',
     837                            'border_color' => '',
     838                            'text_color' => '',
     839                        ),
     840                        'error_success' => array(
     841                            'error_text_color' => '',
     842                            'success_text_color' => '',
     843                        ),
     844                    ),
     845                ));
     846
     847                update_option('freshmail_custom_theme', $defaultThemes);
     848            }
     849            update_option('WP_FRESHMAIL_VERSION', WP_FRESHMAIL_VERSION);
     850        }
     851
     852        if (!class_exists('Plugin\Newsletter\Freshmail')) {
     853
     854            if (!class_exists('FmRestApi')) {
     855                require_once(WP_FRESHMAIL_DIR.'/vendor/class.rest.php');
     856            }
     857
     858            load_plugin_textdomain('wp_freshmail', false, dirname(plugin_basename(__FILE__)).'/languages/');
     859
     860            require_once(WP_FRESHMAIL_DIR.'/src/Plugin/Newsletter/Freshmail.php');
     861            new Plugin\Newsletter\Freshmail();
     862
     863            if (!class_exists('Plugin\Newsletter\Widget\FreshmailWidget')) {
     864                require_once(WP_FRESHMAIL_DIR.'/src/Plugin/Newsletter/Widget/FreshmailWidget.php');
     865            }
     866
     867            add_action('widgets_init', function (){
     868                register_widget('Plugin\Newsletter\Widget\FreshmailWidget');
     869            });
     870        }
    32871    }
    33     include_once(WP_FRESHMAIL_DIR.'/wp-freshmail-functions.php');
    34     include_once(WP_FRESHMAIL_DIR.'/wp-freshmail-settings.php');
    35 }
    36 
    37 include_once(WP_FRESHMAIL_DIR.'/wp-freshmail-activation.php');
     872});
     873
Note: See TracChangeset for help on using the changeset viewer.