PluginProbe
Contact Forms by Cimatti / 1.3.1
Contact Forms by Cimatti v1.3.1
2.3.6 2.3.5 2.3.0 2.2.32 2.2.4 2.2.0 2.1.2 2.1.1 trunk 1.0 1.1 1.2 1.2.1 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 All 62 releases
contact-forms / contact-forms.php

contact-forms.php in Contact Forms by Cimatti 1.3.1, at contact-forms.php

737 lines 19.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: WordPress Contact Forms by Cimatti
4 Description: Quickly create and publish forms in your WordPress powered website.
5 Version: 1.3.1
6 Plugin URI: http://www.cimatti.it/wordpress/contact-forms/
7 Author: Cimatti Consulting
8 Author URI: http://www.cimatti.it
9 */
10
11 /*
12 WordPress Contact Forms by Cimatti
13 Copyright (c) 2011-2013 Andrea Cimatti
14
15 This program is free software; you can redistribute it and/or
16 modify it under the terms of the GNU General Public License
17 as published by the Free Software Foundation; either version 2
18 of the License, or (at your option) any later version.
19
20 This program is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with this program; if not, write to the Free Software
27 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28
29
30 The full copy of the GNU General Public License is available here: http://www.gnu.org/licenses/gpl.txt
31
32 */
33
34 define('ACCUA_FORMS_DB_VERSION', '1');
35
36 require_once('accua-form-api.php');
37 require_once('accua-forms.php');
38 require_once('accua-shortcode-button.php');
39
40 function accua_dashboard_page_head(){
41 $screen = get_current_screen();
42 $screen->add_help_tab( array(
43 'id' => 'accua_help_tab',
44 'title' => __('WordPress Contact Forms by Cimatti'),
45 'content' => '<p>' . __( 'Marketing tools for WordPress', 'accua-form-api') . '</p>',
46 ) );
47
48 wp_enqueue_script('accua', plugins_url('/flot/jquery.flot.js', __FILE__ ), array( 'jquery' ));
49 //wp_enqueue_style('accua_flot', plugins_url('/flot/layout.css', __FILE__ ));
50 wp_enqueue_style('accua', plugins_url('accua.css', __FILE__ ));
51
52 }
53
54 function accua_dashboard_page()
55 {
56 global $wpdb;
57 $num_posts = $wpdb->get_results("SELECT count(DISTINCT afs_post_id ) as num_row
58 FROM {$wpdb->prefix}accua_forms_submissions WHERE afs_post_id <> 0 AND afs_status >= 0", ARRAY_A);
59 $num_forms = $wpdb->get_results("SELECT count(DISTINCT afs_form_id ) as num_row
60 FROM {$wpdb->prefix}accua_forms_submissions WHERE afs_status >= 0", ARRAY_A);
61 $num_submissions = $wpdb->get_results("SELECT count(*) as num_row
62 FROM {$wpdb->prefix}accua_forms_submissions WHERE afs_status >= 0", ARRAY_A);
63
64 //seleziono i campi email
65 $email_fields = array();
66 $avail_fields = get_option('accua_forms_avail_fields', array());
67 foreach($avail_fields as $key=>$single_field){
68 if($single_field['type'] == 'email' || $single_field['type'] == 'autoreply_email')
69 $email_fields[] = "'".$key."'";
70 }
71 $email_fields_string = implode(',',$email_fields);
72 $num_emails = $wpdb->get_results("SELECT COUNT(DISTINCT (`afsv_value`)) as num_row
73 FROM {$wpdb->prefix}accua_forms_submissions, {$wpdb->prefix}accua_forms_submissions_values
74 WHERE `afs_id` = `afsv_sub_id`
75 AND afsv_field_id IN ({$email_fields_string})
76 AND afs_status >= 0", ARRAY_A);
77
78
79 $forms_data = get_option('accua_forms_saved_forms', array());
80
81 $fid = '';
82 $fid_param = '';
83 if (isset($_GET['fid'])) {
84 $fid = stripslashes( (string) $_GET['fid'] );
85 if (isset($forms_data[$fid])) {
86 $fid_param = $wpdb->prepare('AND afs_form_id = %s', $fid);
87 } else {
88 $fid = '';
89 }
90 }
91
92
93 //costruisco il grafico
94
95 $query_grafico = $wpdb->get_results("SELECT YEAR( afs_submitted ) AS `year` , MONTH( afs_submitted ) AS `month` , COUNT( DISTINCT (`afs_id`) ) AS `submissions` , COUNT( DISTINCT (`afsv_value`)) AS `unique_submissions`
96 FROM `{$wpdb->prefix}accua_forms_submissions`
97 LEFT JOIN `{$wpdb->prefix}accua_forms_submissions_values` ON `afs_id` = `afsv_sub_id`
98 WHERE afsv_field_id IN ({$email_fields_string})
99 AND afs_status >= 0
100 $fid_param
101 GROUP BY `year` , `month`
102 ORDER BY `year` DESC , `month` DESC");
103 ?>
104
105 <div id="accua_dashboard_page" class="accua_forms_admin_page wrap">
106 <div id="icon-contact-forms-cimatti-logo" class="icon32"><br></div>
107 <h2>WordPress Contact Forms by Cimatti</h2>
108 <div class="metabox-holder accua-forms-metabox-holder">
109 <div class="postbox ">
110 <h3 class="hndle"><span><?php _e('Forms Stats', 'accua-form-api'); ?></span></h3>
111 <div class="inside" id="dashboard_right_now">
112 <table>
113 <tr class="first"><td class="first b"><?php echo $num_forms[0]['num_row']; ?></td><td class="t"><?php _e('Forms', 'accua-form-api'); ?></td></tr>
114 <tr class="first"><td class="first b"><?php echo $num_posts[0]['num_row']; ?></td><td class="t"><?php _e('Pages', 'accua-form-api'); ?></td></tr>
115 <tr class="first"><td class="first b"><?php echo $num_submissions[0]['num_row']; ?></td><td class="t"><?php _e('Submissions', 'accua-form-api'); ?></td></tr>
116 <tr class="first"><td class="first b"><?php echo $num_emails[0]['num_row']; ?></td><td class="t"><?php _e('Distinct Emails', 'accua-form-api'); ?></td></tr>
117 </table>
118 <form method="get">
119 <input type="hidden" name="page" value="accua_forms" />
120 <select name="fid">
121 <?php
122 $selected = ($fid === '') ? 'selected="selected"' : '';
123 echo "<option value='' $selected >", __('Submissions from all forms', 'accua-form-api'),'</option>';
124 foreach($forms_data as $ffid => $form) {
125 $selected = ($fid == $ffid) ? 'selected="selected"' : '';
126 $title = trim($form['title']);
127 if ($title === '') {
128 $title = $ffid;
129 }
130 $ffid = htmlspecialchars($ffid, ENT_QUOTES);
131 $title = htmlspecialchars($title, ENT_QUOTES);
132 echo "<option value='$ffid' $selected >$title</option>";
133 }
134 ?>
135 </select>
136 <input type="submit" value="<?php _e('filter', 'accua-form-api') ?>" />
137 </form>
138
139 <?php
140 if ($query_grafico) {
141 echo '<div id="accua-forms-graph-content" ><div id="accua-form-report-graph" style="width: 99%"></div></div>';
142
143 $data = array(
144 array( 'label' => __('Unique monthly Submissions', 'accua-form-api'), 'data' => array()),
145 array( 'label' => __('Total monthly Submissions', 'accua-form-api'), 'data' => array()),
146 );
147 for($i=date('Y'); $i>=$query_grafico[count($query_grafico)-1]->year; $i-- ) {
148 $start_month=12;
149 $end_month = 1;
150 if($i==date('Y')) $start_month= date('n');
151 if($i==$query_grafico[count($query_grafico)-1]->year) $end_month=$query_grafico[count($query_grafico)-1]->month;
152 for($j=$start_month;$j>=$end_month;$j--) {
153 $time = mktime(0, 0, 0, $j , 1, $i) * 1000;
154 $find=false;
155 foreach ($query_grafico as $result){
156 if(!$find && (int)$result->year == $i && (int)$result->month==$j) {
157 $data[0]['data'][] = array($time, (int)$result->unique_submissions,$j, $i);
158 $data[1]['data'][] = array($time, (int)$result->submissions,$j, $i);
159 $find=true;
160 }
161 }
162 if(!$find)
163 {
164 $data[0]['data'][] = array($time, 0,$j, $i);
165 $data[1]['data'][] = array($time, 0,$j, $i);
166 }
167 }
168 }
169 ?>
170 <script type="text/javascript">
171 var data = <?php echo json_encode($data); ?> ;
172 var options = {
173 xaxis: {
174 //autoscaleMargin: 0.005,
175 mode: "time",
176 timeformat: "%b %y",
177 minTickSize: [1, "month"]
178 },
179 legend: {
180 position: "nw"
181 },
182
183
184 };
185 jQuery(document).ready(function($) {
186 jQuery.plot($("#accua-form-report-graph"), data, options);
187 });
188
189 jQuery(window).resize(function() {
190 jQuery.plot(jQuery("#accua-form-report-graph"), data, options);
191 });
192 </script>
193 <?php
194 } else {
195 echo '<p style="height:100px;">', __('No forms submitted', 'accua-form-api'), '</p>';
196 } ?>
197 <?php
198 $plugin_data = get_plugin_data(__FILE__);
199 _e('Version', 'accua-form-api'); echo " ".$plugin_data['Version'];
200 ?>
201 </div>
202
203 </div>
204 <span id="accua-forms-version">by Cimatti - <a href="http://www.cimatti.it/wordpress/contact-forms/">www.cimatti.it/wordpress/contact-forms</a>
205 <br /><?php
206 $plugin_data = get_plugin_data( __FILE__ );
207 _e('Version', 'accua-form-api'); echo " ".$plugin_data['Version'];
208 ?></span>
209 </div>
210 <?php
211
212 }
213
214 register_activation_hook(__FILE__, 'accua_forms_install');
215 function accua_forms_install(){
216 $modified = false;
217 $keys = get_option('accua_form_api_keys', array());
218 if (!isset($keys['hash'])) {
219 $modified = true;
220 $keys['hash'] = wp_generate_password(64,true,true);
221 }
222 if (!isset($keys['aes'])) {
223 $modified = true;
224 $keys['aes'] = wp_generate_password(64,true,true);
225 }
226 if ($modified) {
227 update_option('accua_form_api_keys', $keys);
228 }
229
230 global $wpdb;
231
232 require_once(ABSPATH.'wp-admin/upgrade-functions.php');
233
234 $charset_collate = '';
235 if ( ! empty($wpdb->charset) )
236 $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
237 if ( ! empty($wpdb->collate) )
238 $charset_collate .= " COLLATE $wpdb->collate";
239
240 $sql = "CREATE TABLE `{$wpdb->prefix}accua_forms_submissions` (
241 afs_id BIGINT(20) NOT NULL AUTO_INCREMENT,
242 afs_form_id VARCHAR(77) NOT NULL DEFAULT '',
243 afs_post_id BIGINT(20) NOT NULL DEFAULT 0,
244 afs_ip VARCHAR(255) NOT NULL DEFAULT '',
245 afs_uri VARCHAR(255) NOT NULL DEFAULT '',
246 afs_referrer VARCHAR(255) NOT NULL DEFAULT '',
247 afs_lang VARCHAR(60) NOT NULL DEFAULT '',
248 afs_created TIMESTAMP NOT NULL DEFAULT 0,
249 afs_submitted TIMESTAMP NOT NULL DEFAULT 0,
250 afs_status TINYINT(1) NOT NULL DEFAULT 0,
251 afs_stats TEXT NOT NULL DEFAULT '',
252 PRIMARY KEY (afs_id),
253 KEY form (afs_form_id, afs_status),
254 KEY uri (afs_uri),
255 KEY pid (afs_post_id),
256 KEY referrer (afs_referrer),
257 KEY status (afs_status, afs_id)
258 ) $charset_collate;";
259 dbDelta($sql);
260
261 $sql = "CREATE TABLE `{$wpdb->prefix}accua_forms_submissions_values` (
262 afsv_sub_id BIGINT(20) NOT NULL,
263 afsv_field_id VARCHAR(77) NOT NULL,
264 afsv_type varchar(255) NOT NULL DEFAULT '',
265 afsv_value TEXT NOT NULL DEFAULT '',
266 PRIMARY KEY (afsv_sub_id, afsv_field_id),
267 KEY value_index (afsv_field_id(77), afsv_value(256))
268 ) $charset_collate;";
269 dbDelta($sql);
270
271 $avail_fields = get_option('accua_forms_avail_fields', array());
272 if (!is_array($avail_fields)) {
273 $avail_fields = array();
274 }
275 $avail_fields += array(
276 'first_name' => array(
277 'id' => 'first_name',
278 'name' => 'First Name',
279 'type' => 'textfield',
280 'description' => '',
281 'default_value' => '',
282 'allowed_values' => '',
283 ),
284 'last_name' => array(
285 'id' => 'last_name',
286 'name' => 'Last Name',
287 'type' => 'textfield',
288 'description' => '',
289 'default_value' => '',
290 'allowed_values' => '',
291 ),
292 'email' => array(
293 'id' => 'email',
294 'name' => 'Email',
295 'type' => 'autoreply_email',
296 'description' => '',
297 'default_value' => '',
298 'allowed_values' => '',
299 ),
300 'address' => array(
301 'id' => 'address',
302 'name' => 'Address',
303 'type' => 'textfield',
304 'description' => '',
305 'default_value' => '',
306 'allowed_values' => '',
307 ),
308 'city' => array(
309 'id' => 'city',
310 'name' => 'City',
311 'type' => 'textfield',
312 'description' => '',
313 'default_value' => '',
314 'allowed_values' => '',
315 ),
316 'state_province' => array(
317 'id' => 'state_province',
318 'name' => 'State/Province',
319 'type' => 'textfield',
320 'description' => '',
321 'default_value' => '',
322 'allowed_values' => '',
323 ),
324 'country' => array(
325 'id' => 'country',
326 'name' => 'Country',
327 'type' => 'select',
328 'description' => '',
329 'default_value' => '-',
330 'allowed_values' => "-|Select...
331 Afghanistan
332 �
333 land Islands
334 Albania
335 Algeria
336 American Samoa
337 Andorra
338 Angola
339 Anguilla
340 Antarctica
341 Antigua And Barbuda
342 Argentina
343 Armenia
344 Aruba
345 Australia
346 Austria
347 Azerbaijan
348 Bahamas
349 Bahrain
350 Bangladesh
351 Barbados
352 Belarus
353 Belgium
354 Belize
355 Benin
356 Bermuda
357 Bhutan
358 Bolivia
359 Bosnia And Herzegovina
360 Botswana
361 Bouvet Island
362 Brazil
363 British Indian Ocean Territory
364 Brunei Darussalam
365 Bulgaria
366 Burkina Faso
367 Burundi
368 Cambodia
369 Cameroon
370 Canada
371 Cape Verde
372 Cayman Islands
373 Central African Republic
374 Chad
375 Chile
376 China
377 Christmas Island
378 Cocos (Keeling) Islands
379 Colombia
380 Comoros
381 Congo
382 Congo, The Democratic Republic Of The
383 Cook Islands
384 Costa Rica
385 Côte D'Ivoire
386 Croatia
387 Cuba
388 Cyprus
389 Czech Republic
390 Denmark
391 Djibouti
392 Dominica
393 Dominican Republic
394 Ecuador
395 Egypt
396 El Salvador
397 Equatorial Guinea
398 Eritrea
399 Estonia
400 Ethiopia
401 Falkland Islands (Malvinas)
402 Faroe Islands
403 Fiji
404 Finland
405 France
406 French Guiana
407 French Polynesia
408 French Southern Territories
409 Gabon
410 Gambia
411 Georgia
412 Germany
413 Ghana
414 Gibraltar
415 Greece
416 Greenland
417 Grenada
418 Guadeloupe
419 Guam
420 Guatemala
421 Guernsey
422 Guinea
423 Guinea-Bissau
424 Guyana
425 Haiti
426 Heard Island And Mcdonald Islands
427 Holy See (Vatican City State)
428 Honduras
429 Hong Kong
430 Hungary
431 Iceland
432 India
433 Indonesia
434 Iran, Islamic Republic Of
435 Iraq
436 Ireland
437 Isle Of Man
438 Israel
439 Italy
440 Jamaica
441 Japan
442 Jersey
443 Jordan
444 Kazakhstan
445 Kenya
446 Kiribati
447 Korea, Democratic People'S Republic Of
448 Korea, Republic Of
449 Kuwait
450 Kyrgyzstan
451 Lao People'S Democratic Republic
452 Latvia
453 Lebanon
454 Lesotho
455 Liberia
456 Libyan Arab Jamahiriya
457 Liechtenstein
458 Lithuania
459 Luxembourg
460 Macao
461 Macedonia, The Former Yugoslav Republic Of
462 Madagascar
463 Malawi
464 Malaysia
465 Maldives
466 Mali
467 Malta
468 Marshall Islands
469 Martinique
470 Mauritania
471 Mauritius
472 Mayotte
473 Mexico
474 Micronesia, Federated States Of
475 Moldova, Republic Of
476 Monaco
477 Mongolia
478 Montenegro
479 Montserrat
480 Morocco
481 Mozambique
482 Myanmar
483 Namibia
484 Nauru
485 Nepal
486 Netherlands
487 Netherlands Antilles
488 New Caledonia
489 New Zealand
490 Nicaragua
491 Niger
492 Nigeria
493 Niue
494 Norfolk Island
495 Northern Mariana Islands
496 Norway
497 Oman
498 Pakistan
499 Palau
500 Palestinian Territory, Occupied
501 Panama
502 Papua New Guinea
503 Paraguay
504 Peru
505 Philippines
506 Pitcairn
507 Poland
508 Portugal
509 Puerto Rico
510 Qatar
511 Réunion
512 Romania
513 Russian Federation
514 Rwanda
515 Saint Barthélemy
516 Saint Helena
517 Saint Kitts And Nevis
518 Saint Lucia
519 Saint Martin
520 Saint Pierre And Miquelon
521 Saint Vincent And The Grenadines
522 Samoa
523 San Marino
524 Sao Tome And Principe
525 Saudi Arabia
526 Senegal
527 Serbia
528 Seychelles
529 Sierra Leone
530 Singapore
531 Slovakia
532 Slovenia
533 Solomon Islands
534 Somalia
535 South Africa
536 South Georgia And The South Sandwich Islands
537 Spain
538 Sri Lanka
539 Sudan
540 Suriname
541 Svalbard And Jan Mayen
542 Swaziland
543 Sweden
544 Switzerland
545 Syrian Arab Republic
546 Taiwan, Province Of China
547 Tajikistan
548 Tanzania, United Republic Of
549 Thailand
550 Timor-Leste
551 Togo
552 Tokelau
553 Tonga
554 Trinidad And Tobago
555 Tunisia
556 Turkey
557 Turkmenistan
558 Turks And Caicos Islands
559 Tuvalu
560 Uganda
561 Ukraine
562 United Arab Emirates
563 United Kingdom
564 United States
565 United States Minor Outlying Islands
566 Uruguay
567 Uzbekistan
568 Vanuatu
569 Venezuela, Bolivarian Republic Of
570 Viet Nam
571 Virgin Islands, British
572 Virgin Islands, U.S.
573 Wallis And Futuna
574 Western Sahara
575 Yemen
576 Zambia
577 Zimbabwe",
578 ),
579 'message' => array(
580 'id' => 'message',
581 'name' => 'Message',
582 'type' => 'textarea',
583 'description' => '',
584 'default_value' => '',
585 'allowed_values' => '',
586 ),
587 'captcha' => array(
588 'id' => 'captcha',
589 'name' => 'Captcha',
590 'type' => 'captcha',
591 'description' => '',
592 'default_value' => '',
593 'allowed_values' => '',
594 ),
595 );
596 update_option('accua_forms_avail_fields', $avail_fields);
597
598
599 $form_data = get_option('accua_forms_default_form_data',array());
600 if (!is_array($form_data)) {
601 $form_data = array();
602 }
603 $form_data += array(
604 'success_message' => '<div style="padding: 10px; background-color: #fbf8b2; border: 1px solid #f7c84b;">
605 <h2>Thank you {first_name} {last_name},</h2>
606 We have received your contact request. Check your inbox for the confirmation message.
607
608 <strong>Can\'t find the email?</strong>
609
610 It doesn\'t happen often but your mailbox could apply strict spam rules that block our email from reaching your inbox. Try checking your spam folder.
611
612 Also check that the email you entered in the form (<strong>{email}</strong>) is correct. If it is not exact you can submit the form again.
613
614 For other possible problems you may have encountered do not hesitate to contact us
615
616 </div>',
617 'error_message' => '<div style="padding: 10px; background-color: #fbf8b2; border: 1px solid #f7c84b;">
618 <h2>Oops! Something went wrong.</h2>
619 Internet is an awfully complex place and even though we take every precaution to make sure things run smoothly every once in a while things can go wrong that are not under our control.
620
621 Please try filling in the form again.
622
623 For other possible problems you may have encountered do not hesitate to contact us
624
625 </div>',
626 'emails_from' => '',
627 'admin_emails_to' => get_option('admin_email', ''),
628 'emails_bcc' => '',
629 'admin_emails_subject' => 'A contact from your site',
630 'admin_emails_message' => '<table style="font-family: \'Lucida Sans\',\'Lucida Grande\', Verdana, Arial, Sans-Serif !important; background: #fff; margin-top: 10px; border: 1px solid #DDDDDD; max-width: 700px;" cellspacing="0" cellpadding="0" align="center">
631 <tbody>
632 <tr>
633 <td>
634 <table style="max-width:700px;" border="0" cellspacing="0" cellpadding="0" align="center">
635 <tbody>
636 <tr>
637 <td>
638 <table style="padding: 10px; background-color: #fbf8b2; border: 1px solid #f7c84b; max-width:700px;" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
639 <tbody>
640 <tr valign="top">
641 <td style="max-width:22px;"></td>
642 <td style="font-family: \'Lucida Sans\',\'Lucida Grande\', Verdana, Arial, Sans-Serif !important; padding: 15px 0px; max-width: 645px;">
643 <table>
644 <tbody>
645 <tr>
646 <td>On {__submitted_day_month_year} at {__submitted_hour} the following form was filled in.
647
648 <hr />
649
650 <strong>Page where the form was filled in</strong>
651 <a href="{__url}">{__url}</a></td>
652 </tr>
653 <tr>
654 <td id="submitted_html">{__submitted_html}</td>
655 </tr>
656 <tr>
657 <td>[form_if {__referrer} [<strong>Referrer</strong> - where did the contact come from <em>before reaching the page</em>: {__referrer}]]</td>
658 </tr>
659 <tr>
660 <td><strong>Contact IP</strong> {__ip}
661 <hr />
662 </td>
663 </tr>
664 <tr>
665 <td>[form_if {__autoreply} [The contact received in his email <a href="mailto:{email}">{email}</a> the following confirmation message:
666 <table>
667 <tbody>
668 <tr>
669 <td>{__confirmation_emails_message}</td>
670 </tr>
671 </tbody>
672 </table> ]]
673 </td>
674 </tr>
675 </tbody>
676 </table>
677 </td>
678 <td style="max-width:23px"></td>
679 </tr>
680 </tbody>
681 </table>
682 </td>
683 </tr>
684 </tbody>
685 </table>
686 </td>
687 </tr>
688 </tbody>
689 </table>',
690 'confirmation_emails_subject' => 'Your message',
691 'confirmation_emails_message' => '<h2>Thank you {first_name} {last_name},</h2>
692 Thank Your for your contact request.
693
694 We will contact you as soon as possible.
695
696 Sincerely,
697
698 The Website Team
699
700 <hr />',
701
702 'layout' => 'sidebyside',
703 'style_margin' => '',
704 'style_border_color' => '',
705 'style_border_width' => '',
706 'style_border_radius' => '',
707 'style_background_color' => '',
708 'style_padding' => '',
709 'style_color' => '',
710 'style_font_size' => '',
711 'style_field_spacing' => '',
712 'style_field_border_color' => '',
713 'style_field_border_width' => '',
714 'style_field_border_radius' => '',
715 'style_field_background_color' => '',
716 'style_field_padding' => '',
717 'style_field_color' => '',
718 'style_submit_border_color' => '',
719 'style_submit_border_width' => '',
720 'style_submit_border_radius' => '',
721 'style_submit_background_color' => '',
722 'style_submit_padding' => '',
723 'style_submit_color' => '',
724 'style_submit_font_size' => '',
725 );
726 update_option('accua_forms_default_form_data', $form_data);
727 update_option('accua_forms_db_version', ACCUA_FORMS_DB_VERSION);
728 }
729
730 add_action('admin_init', 'accua_forms_check_db_version_and_update');
731 function accua_forms_check_db_version_and_update() {
732 $db_version = get_option('accua_forms_db_version', '');
733 if (ACCUA_FORMS_DB_VERSION != $db_version) {
734 accua_forms_install();
735 }
736 }
737