PluginProbe
Contact Forms by Cimatti / 1.3.2
Contact Forms by Cimatti v1.3.2
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.2, at contact-forms.php

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