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

765 lines 20.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.4.0
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-2016 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', '4');
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__ ), array(), '1');
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, JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP); ?> ;
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 $old_db_version = (int) get_option('accua_forms_db_version', 0);
243
244 if ($old_db_version < 3) {
245 @ $wpdb->query("ALTER TABLE `{$wpdb->prefix}accua_forms_submissions` DROP INDEX uri");
246 @ $wpdb->query("ALTER TABLE `{$wpdb->prefix}accua_forms_submissions` DROP INDEX referrer");
247 }
248
249 $sql = "CREATE TABLE `{$wpdb->prefix}accua_forms_submissions` (
250 afs_id BIGINT(20) NOT NULL AUTO_INCREMENT,
251 afs_form_id VARCHAR(77) NOT NULL DEFAULT '',
252 afs_post_id BIGINT(20) NOT NULL DEFAULT 0,
253 afs_ip VARCHAR(255) NOT NULL DEFAULT '',
254 afs_uri TEXT NOT NULL DEFAULT '',
255 afs_referrer TEXT NOT NULL DEFAULT '',
256 afs_lang VARCHAR(60) NOT NULL DEFAULT '',
257 afs_created TIMESTAMP NOT NULL DEFAULT 0,
258 afs_submitted TIMESTAMP NOT NULL DEFAULT 0,
259 afs_status TINYINT(1) NOT NULL DEFAULT 0,
260 afs_stats TEXT NOT NULL DEFAULT '',
261 PRIMARY KEY (afs_id),
262 KEY form (afs_form_id, afs_status),
263 KEY uri (afs_uri(250)),
264 KEY pid (afs_post_id),
265 KEY referrer (afs_referrer(250)),
266 KEY status (afs_status, afs_id)
267 KEY submitted (afs_submitted)
268 ) $charset_collate;";
269 dbDelta($sql);
270
271 $sql = "CREATE TABLE `{$wpdb->prefix}accua_forms_submissions_values` (
272 afsv_sub_id BIGINT(20) NOT NULL,
273 afsv_field_id VARCHAR(77) NOT NULL,
274 afsv_type varchar(255) NOT NULL DEFAULT '',
275 afsv_value TEXT NOT NULL DEFAULT '',
276 PRIMARY KEY (afsv_sub_id, afsv_field_id),
277 KEY value_index (afsv_field_id(77), afsv_value(256))
278 ) $charset_collate;";
279 dbDelta($sql);
280
281 $avail_fields = get_option('accua_forms_avail_fields', array());
282
283 if (!is_array($avail_fields)) {
284 $avail_fields = array();
285 }
286
287 if (empty($avail_fields) || ($old_db_version === 0)) {
288 $avail_fields += array(
289 'first_name' => array(
290 'id' => 'first_name',
291 'name' => 'First Name',
292 'type' => 'textfield',
293 'description' => '',
294 'default_value' => '',
295 'allowed_values' => '',
296 ),
297 'last_name' => array(
298 'id' => 'last_name',
299 'name' => 'Last Name',
300 'type' => 'textfield',
301 'description' => '',
302 'default_value' => '',
303 'allowed_values' => '',
304 ),
305 'email' => array(
306 'id' => 'email',
307 'name' => 'Email',
308 'type' => 'autoreply_email',
309 'description' => '',
310 'default_value' => '',
311 'allowed_values' => '',
312 ),
313 'address' => array(
314 'id' => 'address',
315 'name' => 'Address',
316 'type' => 'textfield',
317 'description' => '',
318 'default_value' => '',
319 'allowed_values' => '',
320 ),
321 'city' => array(
322 'id' => 'city',
323 'name' => 'City',
324 'type' => 'textfield',
325 'description' => '',
326 'default_value' => '',
327 'allowed_values' => '',
328 ),
329 'state_province' => array(
330 'id' => 'state_province',
331 'name' => 'State/Province',
332 'type' => 'textfield',
333 'description' => '',
334 'default_value' => '',
335 'allowed_values' => '',
336 ),
337 'country' => array(
338 'id' => 'country',
339 'name' => 'Country',
340 'type' => 'select',
341 'description' => '',
342 'default_value' => '-',
343 'allowed_values' => "-|Select...
344 Afghanistan
345 �
346 land Islands
347 Albania
348 Algeria
349 American Samoa
350 Andorra
351 Angola
352 Anguilla
353 Antarctica
354 Antigua And Barbuda
355 Argentina
356 Armenia
357 Aruba
358 Australia
359 Austria
360 Azerbaijan
361 Bahamas
362 Bahrain
363 Bangladesh
364 Barbados
365 Belarus
366 Belgium
367 Belize
368 Benin
369 Bermuda
370 Bhutan
371 Bolivia
372 Bosnia And Herzegovina
373 Botswana
374 Bouvet Island
375 Brazil
376 British Indian Ocean Territory
377 Brunei Darussalam
378 Bulgaria
379 Burkina Faso
380 Burundi
381 Cambodia
382 Cameroon
383 Canada
384 Cape Verde
385 Cayman Islands
386 Central African Republic
387 Chad
388 Chile
389 China
390 Christmas Island
391 Cocos (Keeling) Islands
392 Colombia
393 Comoros
394 Congo
395 Congo, The Democratic Republic Of The
396 Cook Islands
397 Costa Rica
398 Côte D'Ivoire
399 Croatia
400 Cuba
401 Cyprus
402 Czech Republic
403 Denmark
404 Djibouti
405 Dominica
406 Dominican Republic
407 Ecuador
408 Egypt
409 El Salvador
410 Equatorial Guinea
411 Eritrea
412 Estonia
413 Ethiopia
414 Falkland Islands (Malvinas)
415 Faroe Islands
416 Fiji
417 Finland
418 France
419 French Guiana
420 French Polynesia
421 French Southern Territories
422 Gabon
423 Gambia
424 Georgia
425 Germany
426 Ghana
427 Gibraltar
428 Greece
429 Greenland
430 Grenada
431 Guadeloupe
432 Guam
433 Guatemala
434 Guernsey
435 Guinea
436 Guinea-Bissau
437 Guyana
438 Haiti
439 Heard Island And Mcdonald Islands
440 Holy See (Vatican City State)
441 Honduras
442 Hong Kong
443 Hungary
444 Iceland
445 India
446 Indonesia
447 Iran, Islamic Republic Of
448 Iraq
449 Ireland
450 Isle Of Man
451 Israel
452 Italy
453 Jamaica
454 Japan
455 Jersey
456 Jordan
457 Kazakhstan
458 Kenya
459 Kiribati
460 Korea, Democratic People'S Republic Of
461 Korea, Republic Of
462 Kuwait
463 Kyrgyzstan
464 Lao People'S Democratic Republic
465 Latvia
466 Lebanon
467 Lesotho
468 Liberia
469 Libyan Arab Jamahiriya
470 Liechtenstein
471 Lithuania
472 Luxembourg
473 Macao
474 Macedonia, The Former Yugoslav Republic Of
475 Madagascar
476 Malawi
477 Malaysia
478 Maldives
479 Mali
480 Malta
481 Marshall Islands
482 Martinique
483 Mauritania
484 Mauritius
485 Mayotte
486 Mexico
487 Micronesia, Federated States Of
488 Moldova, Republic Of
489 Monaco
490 Mongolia
491 Montenegro
492 Montserrat
493 Morocco
494 Mozambique
495 Myanmar
496 Namibia
497 Nauru
498 Nepal
499 Netherlands
500 Netherlands Antilles
501 New Caledonia
502 New Zealand
503 Nicaragua
504 Niger
505 Nigeria
506 Niue
507 Norfolk Island
508 Northern Mariana Islands
509 Norway
510 Oman
511 Pakistan
512 Palau
513 Palestinian Territory, Occupied
514 Panama
515 Papua New Guinea
516 Paraguay
517 Peru
518 Philippines
519 Pitcairn
520 Poland
521 Portugal
522 Puerto Rico
523 Qatar
524 Réunion
525 Romania
526 Russian Federation
527 Rwanda
528 Saint Barthélemy
529 Saint Helena
530 Saint Kitts And Nevis
531 Saint Lucia
532 Saint Martin
533 Saint Pierre And Miquelon
534 Saint Vincent And The Grenadines
535 Samoa
536 San Marino
537 Sao Tome And Principe
538 Saudi Arabia
539 Senegal
540 Serbia
541 Seychelles
542 Sierra Leone
543 Singapore
544 Slovakia
545 Slovenia
546 Solomon Islands
547 Somalia
548 South Africa
549 South Georgia And The South Sandwich Islands
550 Spain
551 Sri Lanka
552 Sudan
553 Suriname
554 Svalbard And Jan Mayen
555 Swaziland
556 Sweden
557 Switzerland
558 Syrian Arab Republic
559 Taiwan, Province Of China
560 Tajikistan
561 Tanzania, United Republic Of
562 Thailand
563 Timor-Leste
564 Togo
565 Tokelau
566 Tonga
567 Trinidad And Tobago
568 Tunisia
569 Turkey
570 Turkmenistan
571 Turks And Caicos Islands
572 Tuvalu
573 Uganda
574 Ukraine
575 United Arab Emirates
576 United Kingdom
577 United States
578 United States Minor Outlying Islands
579 Uruguay
580 Uzbekistan
581 Vanuatu
582 Venezuela, Bolivarian Republic Of
583 Viet Nam
584 Virgin Islands, British
585 Virgin Islands, U.S.
586 Wallis And Futuna
587 Western Sahara
588 Yemen
589 Zambia
590 Zimbabwe",
591 ),
592 'message' => array(
593 'id' => 'message',
594 'name' => 'Message',
595 'type' => 'textarea',
596 'description' => '',
597 'default_value' => '',
598 'allowed_values' => '',
599 ),
600 'captcha' => array(
601 'id' => 'captcha',
602 'name' => 'Captcha',
603 'type' => 'captcha',
604 'description' => '',
605 'default_value' => '',
606 'allowed_values' => '',
607 ),
608 );
609 update_option('accua_forms_avail_fields', $avail_fields);
610 }
611
612 $form_data = get_option('accua_forms_default_form_data',array());
613 if (!is_array($form_data)) {
614 $form_data = array();
615 }
616
617 $form_data += array(
618 'success_message' => '<div style="padding: 10px; background-color: #fbf8b2; border: 1px solid #f7c84b;">
619 <h2>Thank you {first_name} {last_name},</h2>
620 We have received your contact request. Check your inbox for the confirmation message.
621
622 <strong>Can\'t find the email?</strong>
623
624 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.
625
626 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.
627
628 For other possible problems you may have encountered do not hesitate to contact us
629
630 </div>',
631 'error_message' => '<div style="padding: 10px; background-color: #fbf8b2; border: 1px solid #f7c84b;">
632 <h2>Oops! Something went wrong.</h2>
633 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.
634
635 Please try filling in the form again.
636
637 For other possible problems you may have encountered do not hesitate to contact us
638
639 </div>',
640 'emails_from_name' => '',
641 'emails_from' => '',
642 'admin_emails_to' => get_option('admin_email', ''),
643 'emails_bcc' => '',
644 'admin_emails_subject' => 'A contact from your site',
645 '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">
646 <tbody>
647 <tr>
648 <td>
649 <table style="max-width:700px;" border="0" cellspacing="0" cellpadding="0" align="center">
650 <tbody>
651 <tr>
652 <td>
653 <table style="padding: 10px; background-color: #fbf8b2; border: 1px solid #f7c84b; max-width:700px;" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
654 <tbody>
655 <tr valign="top">
656 <td style="max-width:22px;"></td>
657 <td style="font-family: \'Lucida Sans\',\'Lucida Grande\', Verdana, Arial, Sans-Serif !important; padding: 15px 0px; max-width: 645px;">
658 <table>
659 <tbody>
660 <tr>
661 <td>On {__submitted_day_month_year} at {__submitted_hour} the following form was filled in.
662
663 <hr />
664
665 <strong>Page where the form was filled in</strong>
666 <a href="{__url}">{__url}</a></td>
667 </tr>
668 <tr>
669 <td id="submitted_html">{__submitted_html}</td>
670 </tr>
671 <tr>
672 <td>[form_if {__referrer} [<strong>Referrer</strong> - where did the contact come from <em>before reaching the page</em>: {__referrer}]]</td>
673 </tr>
674 <tr>
675 <td><strong>Contact IP</strong> {__ip}
676 <hr />
677 </td>
678 </tr>
679 <tr>
680 <td>[form_if {__autoreply} [The contact received in his email <a href="mailto:{email}">{email}</a> the following confirmation message:
681 <table>
682 <tbody>
683 <tr>
684 <td>{__confirmation_emails_message}</td>
685 </tr>
686 </tbody>
687 </table> ]]
688 </td>
689 </tr>
690 </tbody>
691 </table>
692 </td>
693 <td style="max-width:23px"></td>
694 </tr>
695 </tbody>
696 </table>
697 </td>
698 </tr>
699 </tbody>
700 </table>
701 </td>
702 </tr>
703 </tbody>
704 </table>',
705 'confirmation_emails_subject' => 'Your message',
706 'confirmation_emails_message' => '<h2>Thank you {first_name} {last_name},</h2>
707 Thank Your for your contact request.
708
709 We will contact you as soon as possible.
710
711 Sincerely,
712
713 The Website Team
714
715 <hr />',
716
717 'layout' => 'sidebyside',
718 'style_margin' => '',
719 'style_border_color' => '',
720 'style_border_width' => '',
721 'style_border_radius' => '',
722 'style_background_color' => '',
723 'style_padding' => '',
724 'style_color' => '',
725 'style_font_size' => '',
726 'style_field_spacing' => '',
727 'style_field_border_color' => '',
728 'style_field_border_width' => '',
729 'style_field_border_radius' => '',
730 'style_field_background_color' => '',
731 'style_field_padding' => '',
732 'style_field_color' => '',
733 'style_submit_border_color' => '',
734 'style_submit_border_width' => '',
735 'style_submit_border_radius' => '',
736 'style_submit_background_color' => '',
737 'style_submit_padding' => '',
738 'style_submit_color' => '',
739 'style_submit_font_size' => '',
740 );
741
742 update_option('accua_forms_default_form_data', $form_data);
743 update_option('accua_forms_db_version', ACCUA_FORMS_DB_VERSION);
744 }
745
746 add_action('admin_init', 'accua_forms_check_db_version_and_update');
747 function accua_forms_check_db_version_and_update() {
748 $db_version = get_option('accua_forms_db_version', '');
749 if (ACCUA_FORMS_DB_VERSION != $db_version) {
750 accua_forms_install();
751 }
752 }
753
754 add_filter( 'robots_txt', 'accua_forms_robots_txt', 10, 2);
755 function accua_forms_robots_txt($output, $public) {
756 if ($public) {
757 $site_url = parse_url( site_url() );
758 $path = ( !empty( $site_url['path'] ) ) ? $site_url['path'] : '';
759 $output .= "\nUser-agent: *\n";
760 $output .= "Allow: $path/wp-admin/js/\n";
761 $output .= "Allow: $path/wp-admin/css/\n";
762 }
763 return $output;
764 }
765