Contact Form 7 Database Addon – CFDB7 - Version 1.1.2

Version Description

Download this release

Release Info

Developer arshidkv12
Plugin Icon 128x128 Contact Form 7 Database Addon – CFDB7
Version 1.1.2
Comparing to
See all releases

Code changes from version 1.0.8 to 1.1.2

contact-form-cfdb-7.php CHANGED
@@ -5,13 +5,13 @@ Plugin URI: http://ciphercoin.com/
5
  Description: Save and manage Contact Form 7 messages. Never lose important data. Contact Form CFDB7 plugin is an add-on for the Contact Form 7 plugin.
6
  Author: Arshid
7
  Author URI: http://ciphercoin.com/
8
- Text Domain: contact-form-cfdb7
9
- Version: 1.0.8
10
  */
11
 
12
 
13
  register_activation_hook( __FILE__, 'cfdb7_pugin_activation' );
14
- function cfdb7_pugin_activation(){
15
 
16
  global $wpdb;
17
  $table_name = $wpdb->prefix.'db7_forms';
@@ -54,7 +54,7 @@ function cfdb7_before_send_mail( $form_tag ) {
54
  if ( $form ) {
55
 
56
  $black_list = array('_wpcf7', '_wpcf7_version', '_wpcf7_locale', '_wpcf7_unit_tag',
57
- '_wpcf7_is_ajax_call','cfdb7_name');
58
 
59
  $data = $form->get_posted_data();
60
  $files = $form->uploaded_files();
@@ -75,7 +75,6 @@ function cfdb7_before_send_mail( $form_tag ) {
75
 
76
  if ( ! is_array($d) ){
77
 
78
- //$tmpD = stripslashes($d);
79
  $bl = array('\"',"\'",'/','\\');
80
  $wl = array('"',''','/', '\');
81
 
@@ -89,12 +88,12 @@ function cfdb7_before_send_mail( $form_tag ) {
89
  }
90
  }
91
 
92
- /* cfdb7 before save data */
93
  do_action( 'cfdb7_before_save_data', $form_data );
94
 
95
  $form_post_id = $form_tag->id();
96
  $form_value = serialize( $form_data );
97
- $form_date = date('Y-m-d H:i:s');
98
 
99
  $wpdb->insert( $table_name, array(
100
  'form_post_id' => $form_post_id,
@@ -112,10 +111,15 @@ function cfdb7_before_send_mail( $form_tag ) {
112
  add_action( 'wpcf7_before_send_mail', 'cfdb7_before_send_mail' );
113
 
114
 
115
- add_action( 'init', 'cfdb7_admin_settings');
116
 
117
- function cfdb7_admin_settings(){
 
 
 
 
118
 
 
119
 
120
  if( is_admin() ){
121
 
@@ -124,6 +128,8 @@ function cfdb7_admin_settings(){
124
  require_once 'inc/admin-form-details.php';
125
  require_once 'inc/export-csv.php';
126
 
 
 
127
  $csv = new Expoert_CSV();
128
  if( isset($_REQUEST['csv']) && ( $_REQUEST['csv'] == true ) && isset( $_REQUEST['nonce'] ) ) {
129
 
@@ -138,7 +144,6 @@ function cfdb7_admin_settings(){
138
  }
139
 
140
 
141
-
142
  add_action( 'admin_notices', 'cfdb7_admin_notice' );
143
  add_action('admin_init', 'cfdb7_view_ignore_notice' );
144
 
5
  Description: Save and manage Contact Form 7 messages. Never lose important data. Contact Form CFDB7 plugin is an add-on for the Contact Form 7 plugin.
6
  Author: Arshid
7
  Author URI: http://ciphercoin.com/
8
+ Text Domain: contact-form-cfdb7
9
+ Version: 1.1.2
10
  */
11
 
12
 
13
  register_activation_hook( __FILE__, 'cfdb7_pugin_activation' );
14
+ function cfdb7_pugin_activation(){
15
 
16
  global $wpdb;
17
  $table_name = $wpdb->prefix.'db7_forms';
54
  if ( $form ) {
55
 
56
  $black_list = array('_wpcf7', '_wpcf7_version', '_wpcf7_locale', '_wpcf7_unit_tag',
57
+ '_wpcf7_is_ajax_call','cfdb7_name', '_wpcf7_container_post');
58
 
59
  $data = $form->get_posted_data();
60
  $files = $form->uploaded_files();
75
 
76
  if ( ! is_array($d) ){
77
 
 
78
  $bl = array('\"',"\'",'/','\\');
79
  $wl = array('"',''','/', '\');
80
 
88
  }
89
  }
90
 
91
+ /* cfdb7 before save data. */
92
  do_action( 'cfdb7_before_save_data', $form_data );
93
 
94
  $form_post_id = $form_tag->id();
95
  $form_value = serialize( $form_data );
96
+ $form_date = current_time('Y-m-d H:i:s');
97
 
98
  $wpdb->insert( $table_name, array(
99
  'form_post_id' => $form_post_id,
111
  add_action( 'wpcf7_before_send_mail', 'cfdb7_before_send_mail' );
112
 
113
 
114
+ add_action( 'init', 'cfdb7_init');
115
 
116
+ /**
117
+ * CFDB7 cfdb7_init and cfdb7_admin_init
118
+ * Admin setting
119
+ */
120
+ function cfdb7_init(){
121
 
122
+ do_action( 'cfdb7_init' );
123
 
124
  if( is_admin() ){
125
 
128
  require_once 'inc/admin-form-details.php';
129
  require_once 'inc/export-csv.php';
130
 
131
+ do_action( 'cfdb7_admin_init' );
132
+
133
  $csv = new Expoert_CSV();
134
  if( isset($_REQUEST['csv']) && ( $_REQUEST['csv'] == true ) && isset( $_REQUEST['nonce'] ) ) {
135
 
144
  }
145
 
146
 
 
147
  add_action( 'admin_notices', 'cfdb7_admin_notice' );
148
  add_action('admin_init', 'cfdb7_view_ignore_notice' );
149
 
css/admin-style.css ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cfdb7 .extension {
2
+ width: 30%;
3
+ border: 1px #888 solid;
4
+ padding: 7px;
5
+ margin: 5px;
6
+ float: left;
7
+ text-align: center;
8
+ }
9
+ .cfdb7 h3{
10
+ text-align: center;
11
+ }
12
+ .cfdb7 .button{
13
+ text-align: center;
14
+ }
inc/add-ons.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_submenu_page('cfdb7-list.php', 'Extensions', 'Extensions', 'manage_options', 'extensions', 'cfdb7_extensions' );
4
+
5
+ /**
6
+ * Extensions page
7
+ */
8
+ function cfdb7_extensions(){
9
+ ?>
10
+ <div class="wrap">
11
+ <h2>Extensions for CFDB7
12
+ <span>
13
+ <a class="button-primary" href="https://ciphercoin.com/contact-form-7-database-cfdb7-add-ons/">Browse All Extensions</a>
14
+ </span>
15
+ </h2>
16
+ <p>These extensions <strong>add functionality</strong> to CFDB7</p>
17
+ <?php echo cfdb7_add_ons_get_feed(); ?>
18
+ </div>
19
+ <?php
20
+ }
21
+
22
+ /**
23
+ * Add-ons Get Feed
24
+ *
25
+ * Gets the add-ons page feed.
26
+ *
27
+ * @since 1.0
28
+ * @return void
29
+ */
30
+ function cfdb7_add_ons_get_feed(){
31
+ $cache = get_transient( 'cfdb7_add_ons_feed' );
32
+ if ( false === $cache ) {
33
+ $url = 'https://ciphercoin.com/cfdb7/?feed=true';
34
+ $feed = wp_remote_get( esc_url_raw( $url ), array( 'sslverify' => false ) );
35
+ if ( ! is_wp_error( $feed ) ) {
36
+ if ( isset( $feed['body'] ) && strlen( $feed['body'] ) > 0 ) {
37
+ $cache = wp_remote_retrieve_body( $feed );
38
+ set_transient( 'cfdb7_add_ons_feed', $cache, 3600 );
39
+ }
40
+ } else {
41
+ $cache = '<div class="error"><p>' . __( 'There was an error retrieving the extensions list from the server. Please try again later.', 'cfdb7' ) . '</div>';
42
+ }
43
+ }
44
+ return $cache;
45
+ }
46
+ //delete_transient('cfdb7_add_ons_feed');
inc/admin-form-details.php CHANGED
@@ -38,7 +38,9 @@ class CFdb7_Form_Details
38
  <div id="welcome-panel" class="welcome-panel">
39
  <div class="welcome-panel-content">
40
  <div class="welcome-panel-column-container">
 
41
  <h3><?php echo get_the_title( $this->form_post_id ); ?></h3>
 
42
  <p></span><?php echo $results[0]->form_date; ?></p>
43
  <?php $form_data = unserialize( $results[0]->form_value );
44
 
@@ -85,7 +87,8 @@ class CFdb7_Form_Details
85
  </div>
86
  </div>
87
  </div>
88
- <?php
89
- }
 
90
 
91
  }
38
  <div id="welcome-panel" class="welcome-panel">
39
  <div class="welcome-panel-content">
40
  <div class="welcome-panel-column-container">
41
+ <?php do_action('cfdb7_before_formdetails_title',$this->form_post_id ); ?>
42
  <h3><?php echo get_the_title( $this->form_post_id ); ?></h3>
43
+ <?php do_action('cfdb7_after_formdetails_title', $this->form_post_id ); ?>
44
  <p></span><?php echo $results[0]->form_date; ?></p>
45
  <?php $form_data = unserialize( $results[0]->form_value );
46
 
87
  </div>
88
  </div>
89
  </div>
90
+ <?php
91
+ do_action('cfdb7_after_formdetails', $this->form_post_id );
92
+ }
93
 
94
  }
inc/admin-mainpage.php CHANGED
@@ -14,16 +14,21 @@ class Cfdb7_Wp_Main_Page
14
  * Constructor will create the menu item
15
  */
16
  public function __construct()
17
- {
18
- add_action( 'admin_menu', array($this, 'admin_list_table_page' ));
19
  }
 
 
20
  /**
21
  * Menu item will allow us to load the page to display the table
22
  */
23
  public function admin_list_table_page()
24
- {
25
-
 
26
  add_menu_page( 'Contact Forms', 'Contact Forms', 'manage_options', 'cfdb7-list.php', array($this, 'list_table_page'), 'dashicons-list-view' );
 
 
27
 
28
  }
29
  /**
@@ -64,6 +69,7 @@ class Cfdb7_Wp_Main_Page
64
  </div>
65
  <?php
66
  }
 
67
  }
68
  // WP_List_Table is not loaded automatically so we need to load it in our application
69
  if( ! class_exists( 'WP_List_Table' ) ) {
14
  * Constructor will create the menu item
15
  */
16
  public function __construct()
17
+ {
18
+ add_action( 'admin_menu', array($this, 'admin_list_table_page' ) );
19
  }
20
+
21
+
22
  /**
23
  * Menu item will allow us to load the page to display the table
24
  */
25
  public function admin_list_table_page()
26
+ {
27
+ wp_enqueue_style( 'cfdb7-admin-style', plugin_dir_url(dirname(__FILE__)).'css/admin-style.css' );
28
+
29
  add_menu_page( 'Contact Forms', 'Contact Forms', 'manage_options', 'cfdb7-list.php', array($this, 'list_table_page'), 'dashicons-list-view' );
30
+
31
+ require_once 'add-ons.php';
32
 
33
  }
34
  /**
69
  </div>
70
  <?php
71
  }
72
+
73
  }
74
  // WP_List_Table is not loaded automatically so we need to load it in our application
75
  if( ! class_exists( 'WP_List_Table' ) ) {
inc/admin-subpage.php CHANGED
@@ -431,5 +431,6 @@ class CFDB7_List_Table extends WP_List_Table
431
  echo "<a href='".$_SERVER['REQUEST_URI']."&csv=true&nonce=".$nonce."' style='float:right; margin:0;' class='button'>";
432
  echo 'Export CSV';
433
  echo '</a>';
 
434
  }
435
  }
431
  echo "<a href='".$_SERVER['REQUEST_URI']."&csv=true&nonce=".$nonce."' style='float:right; margin:0;' class='button'>";
432
  echo 'Export CSV';
433
  echo '</a>';
434
+ do_action('cfdb7_after_export_button');
435
  }
436
  }
readme.txt CHANGED
@@ -3,11 +3,11 @@ Contributors: arshidkv12
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=H5F3Z6S3MNTXA&lc=IN&item_name=wp%2dlogin%2dlimit&amount=5%2e00&currency_code=USD&button_subtype=services&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted
4
  Tags: cf7, contact form 7, contact form 7 db, contact form db, contact form seven, contact form storage, export contact form, save contact form, wpcf7
5
  Requires at least: 3.5
6
- Tested up to: 4.7.3
7
- Stable tag: 1.0.8
8
- License: GPLv2
9
 
10
- Save and manage Contact Form 7 messages. Never lose important data. It is lightweight contact form 7 db plugin.
11
 
12
 
13
  == Description ==
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=H5F3Z6S3MNTXA&lc=IN&item_name=wp%2dlogin%2dlimit&amount=5%2e00&currency_code=USD&button_subtype=services&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted
4
  Tags: cf7, contact form 7, contact form 7 db, contact form db, contact form seven, contact form storage, export contact form, save contact form, wpcf7
5
  Requires at least: 3.5
6
+ Tested up to: 4.8
7
+ Stable tag: 1.1.2
8
+ License: GPLv2
9
 
10
+ Save and manage Contact Form 7 messages. Never lose important data. It is lightweight contact form 7 db plugin
11
 
12
 
13
  == Description ==