Contact Form Submissions - Version 1.2

Version Description

  • Added screenshots
  • Added support for large mail text
  • Added more support for Internationalization
Download this release

Release Info

Developer jasongreen
Plugin Icon 128x128 Contact Form Submissions
Version 1.2
Comparing to
See all releases

Code changes from version 1.1 to 1.2

Admin.php CHANGED
@@ -2,8 +2,6 @@
2
  class WPCF7SAdmin {
3
 
4
  function __construct() {
5
- add_action('admin_menu', array($this, 'menu') );
6
-
7
  add_filter('manage_wpcf7s_posts_columns', array($this, 'set_columns'), 999 );
8
  add_action('manage_wpcf7s_posts_custom_column' , array($this, 'column'), 10, 2 );
9
  add_action('restrict_manage_posts',array($this, 'filters'));
@@ -23,7 +21,7 @@ class WPCF7SAdmin {
23
 
24
  function custom_status($translations, $text, $domain){
25
  if('Published' === $text){
26
- $translations = __('Submitted', WPCF7S_TEXT_DOMAIN);
27
  }
28
  return $translations;
29
  }
@@ -38,7 +36,7 @@ class WPCF7SAdmin {
38
 
39
  function views($views){
40
  if(isset( $views['publish'] ) ){
41
- $views['publish'] = str_replace( 'Published', __('Submitted', WPCF7S_TEXT_DOMAIN), $views['publish'] );
42
  }
43
  $keep_views = array('all', 'publish', 'trash');
44
  // remove others
@@ -62,7 +60,7 @@ class WPCF7SAdmin {
62
  $forms = get_posts($args);
63
  ?>
64
  <select name="wpcf7_contact_form">
65
- <option value="0"><?php _e('Contact Form', WPCF7S_TEXT_DOMAIN); ?></option>
66
  <?php foreach($forms as $post){ ?>
67
  <?php $selected = ($post->ID == $_GET['wpcf7_contact_form']) ? 'selected' : ''; ?>
68
  <option value="<?php echo $post->ID; ?>" <?php echo $selected; ?>><?php echo $post->post_title; ?></option>
@@ -85,7 +83,7 @@ class WPCF7SAdmin {
85
  unset($actions['edit']);
86
  unset($actions['inline hide-if-no-js']);
87
 
88
- $actions = array_merge(array('aview' => '<a href="' . get_edit_post_link( $post->ID ) . '">View</a>'), $actions);
89
  }
90
  return $actions;
91
  }
@@ -109,9 +107,9 @@ class WPCF7SAdmin {
109
  function set_columns($columns) {
110
  $columns = array(
111
  'cb' => '<input type="checkbox">',
112
- 'submission' => __('Submission', WPCF7S_TEXT_DOMAIN),
113
- 'form' => __('Contact Form', WPCF7S_TEXT_DOMAIN),
114
- 'date' => __('Date', WPCF7S_TEXT_DOMAIN)
115
  );
116
 
117
  return $columns;
@@ -143,8 +141,8 @@ class WPCF7SAdmin {
143
  }
144
 
145
  function meta_boxes(){
146
- add_meta_box( 'wpcf7s_mail', __('Mail', WPCF7S_TEXT_DOMAIN), array($this, 'mail_meta_box'), 'wpcf7s', 'normal');
147
- add_meta_box( 'wpcf7s_actions', __('Overview', WPCF7S_TEXT_DOMAIN), array($this, 'actions_meta_box'), 'wpcf7s', 'side');
148
  remove_meta_box( 'submitdiv', 'wpcf7s', 'side' );
149
  }
150
 
@@ -157,31 +155,31 @@ class WPCF7SAdmin {
157
 
158
  $additional_headers = get_post_meta($post->ID, 'additional_headers', true);
159
  ?>
160
- <table class="form-table wpcf7s" style="width: 100%;">
161
  <tbody>
162
  <tr>
163
- <th scope="row">Contact Form</th>
164
  <td><a href="<?php echo add_query_arg(array('page'=>'wpcf7', 'post'=>$form_id, 'action'=>'edit'), admin_url('admin.php')); ?>"><?php echo get_the_title($form_id); ?></a></td>
165
  </tr>
166
  <tr>
167
- <th scope="row">Sender</th>
168
  <td><?php echo $sender_mailto; ?></td>
169
  </tr>
170
  <tr>
171
- <th scope="row">Recipient</th>
172
  <td><?php echo $recipient_mailto; ?></td>
173
  </tr>
174
  <tr>
175
- <th scope="row">Subject</th>
176
  <td><?php echo get_post_meta($post->ID, 'subject', true); ?></td>
177
  </tr>
178
  <tr>
179
- <th scope="row">Body</th>
180
  <td><?php echo apply_filters('the_content', $post->post_content); ?></td>
181
  </tr>
182
  <?php if(!empty($additional_headers)){ ?>
183
  <tr>
184
- <th scope="row">Additional Headers</th>
185
  <td><?php echo get_post_meta($post->ID, 'additional_headers', true); ?></td>
186
  </tr>
187
  <?php } ?>
@@ -198,7 +196,7 @@ class WPCF7SAdmin {
198
 
199
  <div id="misc-publishing-actions">
200
  <div class="misc-pub-section curtime misc-pub-curtime">
201
- <span id="timestamp"><?php _e('Submitted', WPCF7S_TEXT_DOMAIN); ?> : <b><?php echo $date; ?></b></span>
202
  </div>
203
  </div>
204
  <div class="clear"></div>
2
  class WPCF7SAdmin {
3
 
4
  function __construct() {
 
 
5
  add_filter('manage_wpcf7s_posts_columns', array($this, 'set_columns'), 999 );
6
  add_action('manage_wpcf7s_posts_custom_column' , array($this, 'column'), 10, 2 );
7
  add_action('restrict_manage_posts',array($this, 'filters'));
21
 
22
  function custom_status($translations, $text, $domain){
23
  if('Published' === $text){
24
+ $translations = __('Submitted', 'contact-form-submissions');
25
  }
26
  return $translations;
27
  }
36
 
37
  function views($views){
38
  if(isset( $views['publish'] ) ){
39
+ $views['publish'] = str_replace( __('Published', 'contact-form-submissions'), __('Submitted', 'contact-form-submissions'), $views['publish'] );
40
  }
41
  $keep_views = array('all', 'publish', 'trash');
42
  // remove others
60
  $forms = get_posts($args);
61
  ?>
62
  <select name="wpcf7_contact_form">
63
+ <option value="0"><?php _e('Contact Form', 'contact-form-submissions'); ?></option>
64
  <?php foreach($forms as $post){ ?>
65
  <?php $selected = ($post->ID == $_GET['wpcf7_contact_form']) ? 'selected' : ''; ?>
66
  <option value="<?php echo $post->ID; ?>" <?php echo $selected; ?>><?php echo $post->post_title; ?></option>
83
  unset($actions['edit']);
84
  unset($actions['inline hide-if-no-js']);
85
 
86
+ $actions = array_merge(array('aview' => '<a href="' . get_edit_post_link( $post->ID ) . '">'.__('View', 'contact-form-submissions').'</a>'), $actions);
87
  }
88
  return $actions;
89
  }
107
  function set_columns($columns) {
108
  $columns = array(
109
  'cb' => '<input type="checkbox">',
110
+ 'submission' => __('Submission', 'contact-form-submissions'),
111
+ 'form' => __('Contact Form', 'contact-form-submissions'),
112
+ 'date' => __('Date', 'contact-form-submissions')
113
  );
114
 
115
  return $columns;
141
  }
142
 
143
  function meta_boxes(){
144
+ add_meta_box( 'wpcf7s_mail', __('Mail', 'contact-form-submissions'), array($this, 'mail_meta_box'), 'wpcf7s', 'normal');
145
+ add_meta_box( 'wpcf7s_actions', __('Overview', 'contact-form-submissions'), array($this, 'actions_meta_box'), 'wpcf7s', 'side');
146
  remove_meta_box( 'submitdiv', 'wpcf7s', 'side' );
147
  }
148
 
155
 
156
  $additional_headers = get_post_meta($post->ID, 'additional_headers', true);
157
  ?>
158
+ <table class="form-table contact-form-submission">
159
  <tbody>
160
  <tr>
161
+ <th scope="row"><?php _e('Contact Form', 'contact-form-submissions'); ?></th>
162
  <td><a href="<?php echo add_query_arg(array('page'=>'wpcf7', 'post'=>$form_id, 'action'=>'edit'), admin_url('admin.php')); ?>"><?php echo get_the_title($form_id); ?></a></td>
163
  </tr>
164
  <tr>
165
+ <th scope="row"><?php _e('Sender', 'contact-form-submissions'); ?></th>
166
  <td><?php echo $sender_mailto; ?></td>
167
  </tr>
168
  <tr>
169
+ <th scope="row"><?php _e('Recipient', 'contact-form-submissions'); ?></th>
170
  <td><?php echo $recipient_mailto; ?></td>
171
  </tr>
172
  <tr>
173
+ <th scope="row"><?php _e('Subject', 'contact-form-submissions'); ?></th>
174
  <td><?php echo get_post_meta($post->ID, 'subject', true); ?></td>
175
  </tr>
176
  <tr>
177
+ <th scope="row"><?php _e('Body', 'contact-form-submissions'); ?></th>
178
  <td><?php echo apply_filters('the_content', $post->post_content); ?></td>
179
  </tr>
180
  <?php if(!empty($additional_headers)){ ?>
181
  <tr>
182
+ <th scope="row"><?php _e('Additional Headers', 'contact-form-submissions'); ?></th>
183
  <td><?php echo get_post_meta($post->ID, 'additional_headers', true); ?></td>
184
  </tr>
185
  <?php } ?>
196
 
197
  <div id="misc-publishing-actions">
198
  <div class="misc-pub-section curtime misc-pub-curtime">
199
+ <span id="timestamp"><?php _e('Submitted', 'contact-form-submissions'); ?> : <b><?php echo $date; ?></b></span>
200
  </div>
201
  </div>
202
  <div class="clear"></div>
Submissions.php CHANGED
@@ -5,24 +5,23 @@ class WPCF7Submissions {
5
  add_action('init', array($this, 'post_type') );
6
 
7
  add_filter('wpcf7_mail_components', array($this, 'submission'), 999, 3);
8
-
9
  }
10
 
11
  function post_type() {
12
  $labels = array(
13
- 'name' => _x( 'Contact Form Submissions', 'Post Type General Name', WPCF7S_TEXT_DOMAIN ),
14
- 'singular_name' => _x( 'Submission', 'Post Type Singular Name', WPCF7S_TEXT_DOMAIN ),
15
- 'menu_name' => __( 'Submission', WPCF7S_TEXT_DOMAIN ),
16
- 'all_items' => __( 'Submissions', WPCF7S_TEXT_DOMAIN ),
17
- 'view_item' => __( 'Submission', WPCF7S_TEXT_DOMAIN ),
18
- 'edit_item' => __( 'Submission', WPCF7S_TEXT_DOMAIN ),
19
- 'search_items' => __( 'Search', WPCF7S_TEXT_DOMAIN ),
20
- 'not_found' => __( 'Not found', WPCF7S_TEXT_DOMAIN ),
21
- 'not_found_in_trash' => __( 'Not found in Trash', WPCF7S_TEXT_DOMAIN ),
22
  );
23
  $args = array(
24
- 'label' => __( 'Submission', WPCF7S_TEXT_DOMAIN ),
25
- 'description' => __( 'Post Type Description', WPCF7S_TEXT_DOMAIN ),
26
  'labels' => $labels,
27
  'supports' => false,
28
  'hierarchical' => true,
5
  add_action('init', array($this, 'post_type') );
6
 
7
  add_filter('wpcf7_mail_components', array($this, 'submission'), 999, 3);
 
8
  }
9
 
10
  function post_type() {
11
  $labels = array(
12
+ 'name' => __( 'Contact Form Submissions', 'contact-form-submissions' ),
13
+ 'singular_name' => __( 'Submission', 'contact-form-submissions' ),
14
+ 'menu_name' => __( 'Submission', 'contact-form-submissions' ),
15
+ 'all_items' => __( 'Submissions', 'contact-form-submissions' ),
16
+ 'view_item' => __( 'Submission', 'contact-form-submissions' ),
17
+ 'edit_item' => __( 'Submission', 'contact-form-submissions' ),
18
+ 'search_items' => __( 'Search', 'contact-form-submissions' ),
19
+ 'not_found' => __( 'Not found', 'contact-form-submissions' ),
20
+ 'not_found_in_trash' => __( 'Not found in Trash', 'contact-form-submissions' ),
21
  );
22
  $args = array(
23
+ 'label' => __( 'Submission', 'contact-form-submissions' ),
24
+ 'description' => __( 'Post Type Description', 'contact-form-submissions' ),
25
  'labels' => $labels,
26
  'supports' => false,
27
  'hierarchical' => true,
contact-form-submissions.php CHANGED
@@ -1,27 +1,33 @@
1
  <?php
2
  /*
3
  Plugin Name: Contact Form Submissions
4
- Description: Save all Contact Form 7 submissions in the database.
5
- Version: 1.1
6
  Author: Jason Green
7
  License: GPLv3
 
 
8
  */
9
 
10
- define('WPCF7S_TEXT_DOMAIN', 'wpcf7-submissions');
11
  define('WPCF7S_DIR', realpath(dirname(__FILE__)));
12
- define('WPCF7S_FILE', 'contact-form-7-submissions/contact-form-7-submissions.php');
13
 
14
  require_once WPCF7S_DIR . '/Submissions.php';
15
  require_once WPCF7S_DIR . '/Admin.php';
16
 
17
- function contact_form_7_submissions_init() {
18
- global $contact_form_7_submissions;
19
- $contact_form_7_submissions = new WPCF7Submissions();
20
  }
21
- add_action( 'init', 'contact_form_7_submissions_init', 9 );
22
 
23
- function contact_form_7_submissions_admin_init() {
24
- global $contact_form_7_submissions_admin;
25
- $contact_form_7_submissions_admin = new WPCF7SAdmin();
26
  }
27
- add_action( 'admin_init', 'contact_form_7_submissions_admin_init' );
 
 
 
 
 
1
  <?php
2
  /*
3
  Plugin Name: Contact Form Submissions
4
+ Description: Never miss an enquiry again! Save all Contact Form 7 submissions in your database.
5
+ Version: 1.2
6
  Author: Jason Green
7
  License: GPLv3
8
+ Domain Path: /languages
9
+ Text Domain: contact-form-submissions
10
  */
11
 
 
12
  define('WPCF7S_DIR', realpath(dirname(__FILE__)));
13
+ define('WPCF7S_FILE', 'contact-form-submissions/contact-form-submissions.php');
14
 
15
  require_once WPCF7S_DIR . '/Submissions.php';
16
  require_once WPCF7S_DIR . '/Admin.php';
17
 
18
+ function contact_form_submissions_init() {
19
+ global $contact_form_submissions;
20
+ $contact_form_submissions = new WPCF7Submissions();
21
  }
22
+ add_action( 'init', 'contact_form_submissions_init', 9 );
23
 
24
+ function contact_form_submissions_admin_init() {
25
+ global $contact_form_submissions_admin;
26
+ $contact_form_submissions_admin = new WPCF7SAdmin();
27
  }
28
+ add_action( 'admin_init', 'contact_form_submissions_admin_init' );
29
+
30
+ function contact_form_submissions_textdomain() {
31
+ load_plugin_textdomain( 'contact-form-submissions', false, WPCF7S_DIR . '/languages/');
32
+ }
33
+ add_action( 'plugins_loaded', 'contact_form_submissions_textdomain' );
css/admin.css CHANGED
@@ -1,3 +1,10 @@
 
 
 
 
 
 
 
1
  #post-body-content {
2
  display: none;
3
  }
1
+ .form-table.contact-form-submission {
2
+ width: 100%;
3
+ }
4
+ .form-table.contact-form-submission td {
5
+ word-break: break-word;
6
+ }
7
+
8
  #post-body-content {
9
  display: none;
10
  }
languages/contact-form-submissions.pot ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2015 Contact Form Submissions
2
+ # This file is distributed under the same license as the Contact Form Submissions package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Contact Form Submissions 1.1\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/contact-form-"
7
+ "submissions\n"
8
+ "POT-Creation-Date: 2015-11-22 15:34:14+00:00\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+
16
+ #: Admin.php:24 Admin.php:39 Admin.php:199
17
+ msgid "Submitted"
18
+ msgstr ""
19
+
20
+ #: Admin.php:39
21
+ msgid "Published"
22
+ msgstr ""
23
+
24
+ #: Admin.php:63 Admin.php:111 Admin.php:161
25
+ msgid "Contact Form"
26
+ msgstr ""
27
+
28
+ #: Admin.php:86
29
+ msgid "View"
30
+ msgstr ""
31
+
32
+ #: Admin.php:110 Submissions.php:13 Submissions.php:14 Submissions.php:16
33
+ #: Submissions.php:17 Submissions.php:23
34
+ msgid "Submission"
35
+ msgstr ""
36
+
37
+ #: Admin.php:112
38
+ msgid "Date"
39
+ msgstr ""
40
+
41
+ #: Admin.php:144
42
+ msgid "Mail"
43
+ msgstr ""
44
+
45
+ #: Admin.php:145
46
+ msgid "Overview"
47
+ msgstr ""
48
+
49
+ #: Admin.php:165
50
+ msgid "Sender"
51
+ msgstr ""
52
+
53
+ #: Admin.php:169
54
+ msgid "Recipient"
55
+ msgstr ""
56
+
57
+ #: Admin.php:173
58
+ msgid "Subject"
59
+ msgstr ""
60
+
61
+ #: Admin.php:177
62
+ msgid "Body"
63
+ msgstr ""
64
+
65
+ #: Admin.php:182
66
+ msgid "Additional Headers"
67
+ msgstr ""
68
+
69
+ #: Admin.php:192
70
+ msgid "M j, Y @ H:i"
71
+ msgstr ""
72
+
73
+ #. #-#-#-#-# plugin.pot (Contact Form Submissions 1.1) #-#-#-#-#
74
+ #. Plugin Name of the plugin/theme
75
+ #: Submissions.php:12
76
+ msgid "Contact Form Submissions"
77
+ msgstr ""
78
+
79
+ #: Submissions.php:15
80
+ msgid "Submissions"
81
+ msgstr ""
82
+
83
+ #: Submissions.php:18
84
+ msgid "Search"
85
+ msgstr ""
86
+
87
+ #: Submissions.php:19
88
+ msgid "Not found"
89
+ msgstr ""
90
+
91
+ #: Submissions.php:20
92
+ msgid "Not found in Trash"
93
+ msgstr ""
94
+
95
+ #: Submissions.php:24
96
+ msgid "Post Type Description"
97
+ msgstr ""
98
+
99
+ #. Description of the plugin/theme
100
+ msgid ""
101
+ "Never miss an enquiry again! Save all Contact Form 7 submissions in your "
102
+ "database."
103
+ msgstr ""
104
+
105
+ #. Author of the plugin/theme
106
+ msgid "Jason Green"
107
+ msgstr ""
readme.txt CHANGED
@@ -1,19 +1,21 @@
1
  === Plugin Name ===
2
  Contributors: jasongreen
3
- Tags: contact form 7, save contact form, submissions, contact form db, cf7, wpcf7
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SNHXWSXSPYATE
5
  Requires at least: 3.0.1
6
  Tested up to: 4.3.1
7
- Stable tag: 1.1
8
  License: GPLv3
9
 
10
- Save all Contact Form 7 submissions in the database.
11
 
12
  == Description ==
13
 
14
- No configuration necessary. Once activated all contact form submissions will be saved into the database. Each submission is stored as a post so they can easily be managed using the default WordPress interface.
15
 
16
- This plugin is completely debranded with absolutely no donation links.
 
 
17
 
18
  == Installation ==
19
 
@@ -28,8 +30,16 @@ None yet
28
 
29
  == Screenshots ==
30
 
 
 
 
31
  == Changelog ==
32
 
 
 
 
 
 
33
  = 1.1 =
34
  * Added checks for older versions of cf7
35
 
1
  === Plugin Name ===
2
  Contributors: jasongreen
3
+ Tags: contact form 7, save contact form, submissions, contact form db, cf7, wpcf7, contact form storage
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SNHXWSXSPYATE
5
  Requires at least: 3.0.1
6
  Tested up to: 4.3.1
7
+ Stable tag: 1.2
8
  License: GPLv3
9
 
10
+ Never miss an enquiry again! Save all Contact Form 7 submissions in your database.
11
 
12
  == Description ==
13
 
14
+ No configuration necessary. Once activated all contact form submissions will be saved in your database.
15
 
16
+ Submissions are stored as posts so they can easily be managed using the default WordPress interface. You can filter subsmissions by searching, selecting individual contact forms or picking a date range.
17
+
18
+ All submissions can easily be exported using the default WordPress exporter.
19
 
20
  == Installation ==
21
 
30
 
31
  == Screenshots ==
32
 
33
+ 1. Submissions overview screen
34
+ 2. Submission detailed screen
35
+
36
  == Changelog ==
37
 
38
+ = 1.2 =
39
+ * Added screenshots
40
+ * Added support for large mail text
41
+ * Added more support for Internationalization
42
+
43
  = 1.1 =
44
  * Added checks for older versions of cf7
45