Changeset 2701411
- Timestamp:
- 03/29/2022 04:33:27 PM (4 years ago)
- Location:
- simpleform-contact-form-submissions
- Files:
-
- 31 added
- 13 edited
-
tags/2.0.1 (added)
-
tags/2.0.1/LICENSE.txt (added)
-
tags/2.0.1/README.txt (added)
-
tags/2.0.1/admin (added)
-
tags/2.0.1/admin/class-admin.php (added)
-
tags/2.0.1/admin/class-utilities.php (added)
-
tags/2.0.1/admin/css (added)
-
tags/2.0.1/admin/css/admin.css (added)
-
tags/2.0.1/admin/index.php (added)
-
tags/2.0.1/admin/js (added)
-
tags/2.0.1/admin/js/admin.js (added)
-
tags/2.0.1/admin/partials (added)
-
tags/2.0.1/admin/partials/entry.php (added)
-
tags/2.0.1/admin/partials/index.php (added)
-
tags/2.0.1/changelog.txt (added)
-
tags/2.0.1/includes (added)
-
tags/2.0.1/includes/class-activator.php (added)
-
tags/2.0.1/includes/class-core.php (added)
-
tags/2.0.1/includes/class-deactivator.php (added)
-
tags/2.0.1/includes/class-list-table.php (added)
-
tags/2.0.1/includes/class-loader.php (added)
-
tags/2.0.1/includes/index.php (added)
-
tags/2.0.1/index.php (added)
-
tags/2.0.1/languages (added)
-
tags/2.0.1/languages/readme.txt (added)
-
tags/2.0.1/public (added)
-
tags/2.0.1/public/class-public.php (added)
-
tags/2.0.1/public/index.php (added)
-
tags/2.0.1/simpleform-submissions.php (added)
-
tags/2.0.1/uninstall.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/class-admin.php (modified) (12 diffs)
-
trunk/admin/class-utilities.php (added)
-
trunk/admin/css/admin.css (modified) (8 diffs)
-
trunk/admin/js/admin.js (modified) (6 diffs)
-
trunk/admin/partials/entry.php (modified) (15 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/includes/class-activator.php (modified) (6 diffs)
-
trunk/includes/class-core.php (modified) (2 diffs)
-
trunk/includes/class-deactivator.php (modified) (3 diffs)
-
trunk/includes/class-list-table.php (modified) (21 diffs)
-
trunk/public/class-public.php (modified) (2 diffs)
-
trunk/simpleform-submissions.php (modified) (2 diffs)
-
trunk/uninstall.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simpleform-contact-form-submissions/trunk/README.txt
r2664815 r2701411 6 6 Tested up to: 5.9 7 7 Requires PHP: 5.6 8 Stable tag: 2.0 8 Stable tag: 2.0.1 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 86 86 87 87 == Changelog == 88 89 = 2.0.1 (29 March 2022) = 90 * Fixed: the line breaks are preserved in the message 91 * Fixed: backslashes removed in the message 92 * Fixed: incorrect display of the number of entries when entries have been moved 93 * Fixed: incorrect displaying of form status 94 * Fixed: deprecated jQuery functions warning 95 * Changed: restyling of entry data page 96 * Changed: last entries data are recovered upon the plugin activation 88 97 89 98 = 2.0 (25 January 2022) = -
simpleform-contact-form-submissions/trunk/admin/class-admin.php
r2664815 r2701411 333 333 334 334 if ( $last_message ) { 335 echo '<div id="last-submission"><h3><span class="dashicons dashicons-buddicons-pm"></span>'.__('Last Message Received', 'simpleform-contact-form-submissions' ).'</h3>' .$last_message. '</div>'; echo '<div id="submissions-notice" class="unseen"><h3><span class="dashicons dashicons-editor-help"></span>'.__('Before you go crazy looking for the received messages', 'simpleform-contact-form-submissions' ).'</h3>'.__('Submissions data is not stored in the WordPress database. Open the General Tab in the Settings page, and check the Data Storing option for enabling the display of messages in the dashboard. By default, only last message is temporarily stored. Therefore, it is recommended that you verify the correct SMTP server configuration in case of use, and always keep the notification email enabled if you want to be sure to receive the messages.', 'simpleform-contact-form-submissions' ).'</div>';335 echo '<div id="last-submission"><h3><span class="dashicons dashicons-buddicons-pm"></span>'.__('Last Message Received', 'simpleform-contact-form-submissions' ).'</h3>' . wpautop($last_message) . '</div>'; echo '<div id="submissions-notice" class="unseen"><h3><span class="dashicons dashicons-editor-help"></span>'.__('Before you go crazy looking for the received messages', 'simpleform-contact-form-submissions' ).'</h3>'.__('Submissions data is not stored in the WordPress database. Open the General Tab in the Settings page, and check the Data Storing option for enabling the display of messages in the dashboard. By default, only last message is temporarily stored. Therefore, it is recommended that you verify the correct SMTP server configuration in case of use, and always keep the notification email enabled if you want to be sure to receive the messages.', 'simpleform-contact-form-submissions' ).'</div>'; 336 336 } 337 337 else { … … 491 491 else { 492 492 global $wpdb; 493 $table = $wpdb->prefix . 'sform_submissions';494 493 $id = isset($_POST['entry']) ? intval($_POST['entry']) : '0'; 494 $selected_form = isset($_POST['selected-form']) ? intval($_POST['selected-form']) : ''; 495 495 $entries_counter = isset($_POST['entries-counter']) ? intval($_POST['entries-counter']) : '1'; 496 $entry_data = $wpdb->get_row( "SELECT form, moved_from, status, previous_status, trash_date, movable FROM {$wpdb->prefix}sform_submissions WHERE id = '{$id}'", 'ARRAY_A' );496 $entry_data = $wpdb->get_row( "SELECT form, moved_from, date, status, previous_status, trash_date, movable FROM {$wpdb->prefix}sform_submissions WHERE id = '{$id}'", 'ARRAY_A' ); 497 497 $current_status = $entry_data['status']; 498 498 $status = isset($_POST['message-status']) ? sanitize_text_field($_POST['message-status']) : 'read'; … … 500 500 $entries_view = isset($_POST['entries-view']) ? sanitize_text_field($_POST['entries-view']) : ''; 501 501 $previous_status = $status == $current_status ? $entry_data['previous_status'] : $current_status; 502 $entry_timestamp = strtotime($entry_data['date']); 502 503 $form_id = $entry_data['form']; 503 504 $entry_moved_from = $entry_data['moved_from']; … … 514 515 if ( empty($entries_view) ) { 515 516 if ( ( $current_status != 'spam' && $current_status != 'trash' && ( $status == 'spam' || $status == 'trash' ) ) ) { $newcounter = $entries_counter - 1; } 516 // elseif ( ( $current_status == 'spam' || $current_status == 'trash' ) && $status != 'spam' && $status != 'trash' ) { $newcounter = $entries_counter + 1; }517 517 elseif ( ( $current_status == 'spam' || $current_status == 'trash' ) && ( $status == 'spam' || $status == 'trash' ) ) { $newcounter = $entries_counter - 1; } 518 518 else { $newcounter = $entries_counter; } … … 538 538 else { $newcounter = $entries_counter; } 539 539 } 540 541 if ( $selected_form && $entries_form != $moveto ) { 542 $newcounter = $entries_counter - 1; 543 } 540 544 541 545 if ( !$entry_data) { … … 556 560 if ( in_array($status, array('new','read','answered','spam','trash')) ) { 557 561 558 $update_data = $wpdb->update($ table, array( 'form' => $moveto, 'moved_from' => $moved_from, 'status' => $status, 'previous_status' => $previous_status, 'trash_date' => $trash_date, 'movable' => $movable ), array('id' => $id));562 $update_data = $wpdb->update($wpdb->prefix . 'sform_submissions', array( 'form' => $moveto, 'moved_from' => $moved_from, 'status' => $status, 'previous_status' => $previous_status, 'trash_date' => $trash_date, 'movable' => $movable ), array('id' => $id)); 559 563 560 564 if ( $update_data ) { 565 566 $forms = $wpdb->get_col( "SELECT id FROM {$wpdb->prefix}sform_shortcodes" ); 567 foreach($forms as $form) { 568 $count_moved = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->prefix}sform_submissions WHERE moved_from = '$form' AND object != '' AND object != 'not stored'"); 569 $count_entries = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->prefix}sform_submissions WHERE form = '$form' AND object != '' AND object != 'not stored'"); 570 $wpdb->update($wpdb->prefix . 'sform_shortcodes', array('entries' => $count_entries, 'moved_entries' => $count_moved ), array('id' => $form ) ); 571 } 561 572 573 $util = new SimpleForm_Submissions_Util(); 574 $util->update_last_messages( $entry_timestamp, $moved_from, $moveto ); 575 562 576 $msg = ''; 563 577 … … 585 599 586 600 $message = __('Entry data has been updated', 'simpleform-contact-form-submissions' ) . $msg; 587 601 588 602 if ( $status == 'new' ) { 589 603 echo json_encode(array('error' => false, 'update' => true, 'newstatus' => $status, 'prevstatus' => $current_status, 'bubble' => true, 'entries' => $newcounter, 'formname' => $form_name, 'view' => $view, 'moving' => $moving, 'options' => $options, 'message' => $message )); … … 594 608 echo json_encode(array('error' => false, 'update' => true, 'newstatus' => $status, 'prevstatus' => $current_status, 'bubble' => false, 'entries' => $newcounter, 'formname' => $form_name, 'view' => $view, 'moving' => $moving, 'options' => $options, 'message' => $message )); 595 609 exit; 596 } 597 610 } 611 598 612 } 599 613 … … 635 649 require_once SIMPLEFORM_SUBMISSIONS_PATH . 'includes/class-activator.php'; 636 650 SimpleForm_Submissions_Activator::change_db(); 651 SimpleForm_Submissions_Activator::entries_data_recovery(); 637 652 } 638 653 … … 656 671 $count_entries = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->prefix}sform_submissions WHERE form = '$form' AND object != '' AND object != 'not stored'"); 657 672 $count_moved = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->prefix}sform_submissions WHERE moved_from = '$form' AND object != '' AND object != 'not stored'"); 658 // $status = $count_entries == '0' ? 'unused' : 'used';659 673 $form_status = $wpdb->get_var("SELECT status FROM {$wpdb->prefix}sform_shortcodes WHERE id = '$form'"); 660 if ( $form_status != 'trash' ) { $status = $count_entries == '0' ? ' unused' : 'used'; }674 if ( $form_status != 'trash' ) { $status = $count_entries == '0' ? 'draft' : 'published'; } 661 675 else { $status = 'trash'; } 662 676 $wpdb->update($table_shortcodes, array('status' => $status, 'entries' => $count_entries, 'moved_entries' => $count_moved ), array('id' => $form ) ); … … 893 907 } 894 908 895 $referer_view = explode('&view=', $referer_url)[1]; 896 $view = isset($referer_view) ? explode('&', $referer_view)[0] : 'inbox'; 909 $view = isset(explode('&view=', $referer_url)[1]) ? explode('&', explode('&view=', $referer_url)[1])[0] : 'inbox'; 897 910 $sform_list_table->prepare_items(); 898 911 if ( $view == 'inbox' ) { $filter_by_view = "status != 'trash' AND status != 'spam'"; } … … 926 939 } 927 940 928 $view_arg = explode('&view=', $referer_url)[1]; 929 $referer_view = isset($view_arg) ? explode('&', $view_arg)[0] : 'inbox'; 941 $referer_view = isset(explode('&view=', $referer_url)[1]) ? explode('&', explode('&view=', $referer_url)[1])[0] : 'inbox'; 930 942 $view = $referer_view != 'inbox' ? '&view='.$referer_view : ''; 931 943 $removed_args = array( 'action', 'action2', '_wp_http_referer', '_wpnonce' ); -
simpleform-contact-form-submissions/trunk/admin/css/admin.css
r2664815 r2701411 59 59 #navigation-buttons { position: relative; margin-bottom: 10px; padding: 0 4px; } 60 60 #messages-nav { text-align: center; padding-top: 10px; height: 20px; position: relative; } 61 #messages-nav a { color: #c0c0c0; } 62 #messages-nav a:hover { color: #0096dd; } 63 #messages-info { margin-top: -20px; color: #c0c0c0; text-align: center; } 61 #messages-info { margin-top: -20px; text-align: center; } 62 #navigation-buttons.default, #navigation-buttons.default #messages-nav a { color: rgba(34, 113, 177, .6); } 63 #navigation-buttons.light, #navigation-buttons.light #messages-nav a { color: rgba(4, 164, 204, .6); } 64 #navigation-buttons.modern, #navigation-buttons.modern #messages-nav a { color: rgba(70, 100, 235, .6); } 65 #navigation-buttons.blue, #navigation-buttons.blue #messages-nav a { color: rgba(227, 175, 85, .6); } 66 #navigation-buttons.coffee, #navigation-buttons.coffee #messages-nav a { color: rgba(199, 165, 137, .6); } 67 #navigation-buttons.ectoplasm, #navigation-buttons.ectoplasm #messages-nav a { color: rgba(169, 189, 79, .6); } 68 #navigation-buttons.midnight, #navigation-buttons.midnight #messages-nav a { color: rgba(227, 89, 80, .6); } 69 #navigation-buttons.ocean, #navigation-buttons.ocean #messages-nav a { color: rgba(158, 186, 160, .6); } 70 #navigation-buttons.sunrise, #navigation-buttons.sunrise #messages-nav a { color: rgba(221, 130, 59, .6); } 71 #navigation-buttons.foggy, #navigation-buttons.foggy #messages-nav a { color: rgba(137, 147, 171, .6); } 72 #navigation-buttons.polar, #navigation-buttons.polar #messages-nav a { color: #bbb; } 73 #navigation-buttons.default #messages-nav a:hover { color: #2271b1; } 74 #navigation-buttons.light #messages-nav a:hover { color: #04a4cc; } 75 #navigation-buttons.modern #messages-nav a:hover { color: #3858e9; } 76 #navigation-buttons.blue #messages-nav a:hover { color: #e3af55; } 77 #navigation-buttons.coffee #messages-nav a:hover { color: #c7a589; } 78 #navigation-buttons.ectoplasm #messages-nav a:hover { color: #a9bd4f; } 79 #navigation-buttons.midnight #messages-nav a:hover { color: #e35950; } 80 #navigation-buttons.ocean #messages-nav a:hover { color: #9ebaa0; } 81 #navigation-buttons.sunrise #messages-nav a:hover { color: #dd823b; } 82 #navigation-buttons.foggy #messages-nav a:hover { color: #8993ab; } 83 #navigation-buttons.polar #messages-nav a:hover { color: #53a0de; } 84 85 86 87 88 89 64 90 .paginated span { font-weight: 600; transition: none !important; } 65 91 #prev { position: absolute; left: 0; } … … 84 110 .plaintext.toggle { position: relative; } 85 111 .dashicons.contact-info { float: right; } 86 #toggle-info { cursor: pointer; } 87 #toggle-info:after { display: block; opacity: 0; pointer-events: none; position: absolute; line-height: 21px; content: attr(data-title); font-weight: 300; font-size: 13px; transform: scale3d(.2,.2,1); transition: all .2s ease-in-out; /* width .2s linear; */ } 88 #toggle-info:hover:after { opacity: 1; transform: scale3d(1,1,1); } 89 #toggle-info:hover:after { transition: all .2s .1s ease-in-out; } 112 113 114 115 116 #toggle-info, #toggle-message { cursor: pointer; } 117 #toggle-info:after, #toggle-message:after { display: block; opacity: 0; pointer-events: none; position: absolute; line-height: 21px; content: attr(data-title); font-weight: 300; font-size: 13px; transform: scale3d(.2,.2,1); transition: all .2s ease-in-out; } 118 #toggle-info:hover:after, #toggle-message:hover:after { opacity: 1; transform: scale3d(1,1,1); transition: all .2s .1s ease-in-out; font-family: sans-serif; } 90 119 select.sform { -webkit-appearance: none; -moz-appearance: none; appearance: none; padding: 2px 20px 2px 8px!important; padding-right: 30px!important; height: 42px!important; padding: 10px 15px; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; background-color: #fff!important; border: 2px solid #dcdfe6 !important; font-size: 14px!important; line-height: 24px!important; } 91 120 select.default { border-color: rgb(34 113 177 / 25%); } … … 206 235 form.polar .submit-button:hover { background: #77b4e5; color: #fff; } 207 236 form.polar .submit-button:active { background: #318dd7; color: #fff; } 237 th.request { vertical-align: top; } 238 td.request p { margin-top: 0 !important; } 208 239 209 240 @media screen and (max-width: 782px) { … … 217 248 #messages-nav { margin: 0; } 218 249 #submission-tab { margin: 0 -10px; border: none; } 219 #toggle-info { margin-top: -46px; margin-right: -5px; }220 #toggle-info:after { top: -36px; right: 35px; }250 #toggle-info, #toggle-message { margin-top: -46px; margin-right: -5px; } 251 #toggle-info:after, #toggle-message:after { top: -36px; right: 35px; } 221 252 th.option.first { padding: 45px 20px 15px; } 222 253 th.option, th.option.last { padding: 15px 20px; } … … 241 272 .dashicons-external.foggy:hover { color: #72aee6; } 242 273 .dashicons-external.polar:hover { color: #53a0de; } 243 .reply-message.button { display: none; } 274 /*.reply-message.button { display: none; } */ 275 276 .reply-message.button { 277 margin-left: 2px; 278 margin-top: 12px !important; 279 } 280 .icon-button { 281 display: none; 282 } 283 284 244 285 #submit-wrap { padding: 0 20px 100px; } 245 286 /* Entries page */ … … 277 318 #submitter-data .form-table th { padding: 60px 20px 30px 40px; } 278 319 #submitter-data .form-table td { padding-right: 30px; } 279 #toggle-info:after { right: 60px; top: 62px; }320 #toggle-info:after, #toggle-message:after { right: 60px; top: 64px; } 280 321 th.option.first { padding: 65px 20px 35px 30px; } 281 322 th.option { padding: 35px 20px 35px 30px; width: 150px; } … … 289 330 td.checkbox-switch { padding: 37px 50px 32px 0; } 290 331 td.checkbox-switch.last { padding: 37px 50px 62px 0; } 332 th.topaligned { padding-top: 15px; padding-bottom: 15px; } 333 td.topaligned { padding-bottom: 15px; } 291 334 } 292 335 … … 316 359 #admin-notice > a { text-decoration: none; } 317 360 */ 361 362 @media screen and (max-width: 782px) { 363 .reply-message.button { margin-left: 2px; margin-top: 12px !important; } 364 #h2-editing { padding-left: 20px; } 365 } 366 367 @media screen and (min-width: 783px) { 368 #h2-editing { padding-left: 30px; } 369 } 370 371 #h2-editing.closed { 372 padding-bottom: 60px; 373 } 374 375 376 @media screen and (min-width: 783px) 377 .options-heading { 378 padding: 0 30px; 379 } 380 @media screen and (min-width: 783px) 381 .options-heading, .options-heading span span { 382 line-height: 60px; 383 } 384 385 .options-heading span { 386 cursor: pointer; 387 } 388 389 @media screen and (min-width: 783px) 390 .options-heading, .options-heading span span { 391 line-height: 60px; 392 } 393 394 .toggle.dashicons { 395 color: #dcdfe6; 396 } 397 @media screen and (min-width: 783px) 398 .options-heading, .options-heading span span { 399 line-height: 60px; 400 } 401 .options-heading span span { 402 padding-left: 10px; 403 } 404 .options-heading span { 405 cursor: pointer; 406 } 407 408 .section.editing { 409 max-height: 1500px; 410 transition: max-height 1.25s linear,opacity 1.5s,font-size 1.5s,margin 1.5s,padding 1.5s; 411 } 412 413 .dashicons-arrow-up-alt2:hover { 414 color: #f6866f; 415 } 416 417 .dashicons-arrow-down-alt2:hover { 418 color: #9bcc79; 419 } 420 421 422 .section.editing.collapsed { font-size: 0; margin: 0; opacity: 0; padding: 0; max-height: 0; overflow: hidden; transition: max-height 0.3s linear, opacity 0.15s, font-size 0.15s, margin .15s, padding .15s; -webkit-transition: max-height 0.3s linear, opacity 0.15s, font-size .15s, margin .15s, padding .15s; -moz-transition: max-height 0.3s linear, opacity 0.15s, font-size .15s, margin .15s, padding .15s; -o-transition: max-height 0.3s linear, opacity 0.15s, font-size .15s, margin .15s, padding .15s; } 423 .section.editing { max-height: 800px; transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s; -webkit-transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s; -moz-transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s; -o-transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s; } -
simpleform-contact-form-submissions/trunk/admin/js/admin.js
r2664815 r2701411 2 2 'use strict'; 3 3 4 $( window ). load(function() {4 $( window ).on('load', function() { 5 5 6 6 var toggle = document.getElementsByClassName("contact-info"); … … 10 10 var info = document.getElementById("submitter-data"); 11 11 info.classList.toggle("unseen"); 12 document.getElementById("thdate").classList.toggle("first"); 13 document.getElementById("tddate").classList.toggle("first"); 14 document.getElementById("submission-id").classList.toggle("unseen"); 15 document.getElementById("entry-form").classList.toggle("unseen"); 12 document.getElementById("toggle-message").classList.toggle("unseen"); 16 13 document.getElementById("message-data-column").classList.toggle("fullwidth"); 17 14 var prev_link = document.getElementById("prev-link"); … … 55 52 }); 56 53 } 57 58 $('#message-status').change(function(e){54 55 $('#message-status').on("change", function(e) { 59 56 var option = $(this).val(); 60 57 if ( option != 'spam' && option != 'trash' ) { … … 99 96 }); 100 97 101 $('#edit-entry'). click(function(e){98 $('#edit-entry').on( 'click', function(e) { 102 99 $('.message').removeClass('error success unchanged'); 103 100 $('#message-wrap').addClass('seen'); … … 131 128 } 132 129 else { 133 if ( newstatus !== prevstatus ) { 134 135 // if() { 136 $('#view-counter').text(entries); 137 // } 138 130 $('#view-counter').text(entries); 131 if ( newstatus !== prevstatus ) { 139 132 if ( newstatus == 'new' ) { 140 133 var unread = parseInt($('#unread-messages').text(), 10); … … 208 201 }); 209 202 210 /////////////////////////////////////////////////////////////////////////////////////// 203 // Prevent duplicate queries by appending the selector to move entries in the bottom bulk actions 204 if ( document.getElementById("moveto") != null && document.getElementById("bulk-action-selector-bottom") != null ) { 205 const node = document.getElementById("moveto"); 206 const clone = node.cloneNode(true); 207 var bottomSelector = document.getElementById("bulk-action-selector-bottom"); 208 bottomSelector.parentNode.insertBefore( clone, bottomSelector.nextSibling ); 209 } 211 210 212 211 $('#bulk-action-selector-top, #bulk-action-selector-bottom').on("change", function() { 213 212 var selectbulk = $(this).val(); 214 213 if ( selectbulk === 'bulk-move' ) { 215 $(' #moveto').removeClass('unseen');214 $('.moveto').removeClass('unseen'); 216 215 } 217 216 else { 218 $('#moveto').addClass('unseen'); 217 $('.moveto').addClass('unseen'); 218 $('.moveto').val(''); 219 $('#move2').val(''); 219 220 } 220 221 }); 221 222 222 $(' #moveto').on("change", function() {223 $('.moveto').on("change", function() { 223 224 var form = $(this).val(); 224 225 $('#move2').val(form); 225 }); 226 227 /////////////////////////////////////////////////////////////////////////////////////// 226 $('.moveto').val(form); 227 }); 228 229 $("span.heading").on("click", function() { 230 var section = $(this).attr('section'); 231 var prev_link = document.getElementById("prev-link"); 232 var next_link = document.getElementById("next-link"); 233 $('.section.' + section).toggleClass('collapsed'); 234 if ( ! $('.section.' + section).hasClass('collapsed') ) { 235 $('span.toggle.' + section).removeClass('dashicons-arrow-down-alt2'); 236 $('span.toggle.' + section).addClass('dashicons-arrow-up-alt2'); 237 $('#h2-' + section).removeClass('closed'); 238 if ( prev_link ) { 239 var href_prev = prev_link.getAttribute("href"); 240 let prevParams = new URLSearchParams(href_prev); 241 if ( prevParams.has('editing') === true ) { 242 var new_href_prev = href_prev.replace('&editing=hidden', ''); 243 prev_link.setAttribute('href', new_href_prev); 244 } 245 } 246 if ( next_link ) { 247 var href_next = next_link.getAttribute("href"); 248 let nextParams = new URLSearchParams(href_next); 249 if ( nextParams.has('editing') === true ) { 250 var new_href_next = href_next.replace('&editing=hidden', ''); 251 next_link.setAttribute('href', new_href_next); 252 } 253 } 254 } 255 else{ 256 $('span.toggle.' + section).removeClass('dashicons-arrow-up-alt2'); 257 $('span.toggle.' + section).addClass('dashicons-arrow-down-alt2'); 258 $('#h2-' + section).addClass('closed'); 259 if ( prev_link ) { 260 var href_prev = prev_link.getAttribute("href"); 261 let prevParams = new URLSearchParams(href_prev); 262 if ( prevParams.has('editing') === false ) { 263 var new_href_prev = href_prev + '&editing=hidden'; 264 prev_link.setAttribute('href', new_href_prev); 265 } 266 } 267 if ( next_link ) { 268 var href_next = next_link.getAttribute("href"); 269 let nextParams = new URLSearchParams(href_next); 270 if ( nextParams.has('editing') === false ) { 271 var new_href_next = href_next + '&editing=hidden'; 272 next_link.setAttribute('href', new_href_next); 273 } 274 } 275 } 276 }); 228 277 229 278 }); -
simpleform-contact-form-submissions/trunk/admin/partials/entry.php
r2664815 r2701411 9 9 $color = ! empty( $settings['admin_color'] ) ? esc_attr($settings['admin_color']) : 'default'; 10 10 $form = isset( $_REQUEST['form'] ) && !empty( $_REQUEST['form'] ) ? '&form=' . absint($_REQUEST['form']) : ''; 11 // $view = isset( $_REQUEST['view'] ) && !empty( $_REQUEST['view'] ) ? '&view=' . sanitize_text_field($_REQUEST['view']) : '&view=inbox';12 11 $view = isset( $_REQUEST['view'] ) && !empty( $_REQUEST['view'] ) ? '&view=' . sanitize_text_field($_REQUEST['view']) : ''; 13 12 $date = isset ( $_REQUEST['date'] ) && !empty( $_REQUEST['date'] ) ? '&date=' . sanitize_text_field($_REQUEST['date']) : ''; … … 28 27 if ( $item['status'] == 'trash' ) { $description .= ' ' . $restoring_desc . ' ' . __( 'For permanently deleting the entry, back to entries list and use the specific action.','simpleform-contact-form-submissions'); } 29 28 $where_form = !empty($form_id) ? "AND form = '$form_id'" : " AND form != '0' AND listable = '1'"; 30 // $view_arg = isset( $_REQUEST['view'] ) && !empty( $_REQUEST['view'] ) ? sanitize_text_field($_REQUEST['view']) : 'inbox';31 29 $view_arg = isset( $_REQUEST['view'] ) && !empty( $_REQUEST['view'] ) ? sanitize_text_field($_REQUEST['view']) : ''; 32 // if ($view_arg == 'inbox') { $where_status = " AND status != 'trash' AND status != 'spam'"; $message_type = 'inbox'; }33 30 if ($view_arg == '') { $where_status = " AND status != 'trash' AND status != 'spam'"; $message_type = 'inbox'; } 34 31 if ($view_arg == 'new') { $where_status = " AND status = 'new'"; $message_type = 'unread'; } … … 36 33 if ($view_arg == 'spam') { $where_status = " AND status = 'spam'"; $message_type = 'junk'; } 37 34 if ($view_arg == 'trash') { $where_status = " AND status = 'trash'"; $message_type = 'trashed'; } 38 // if ($view_arg == '') { $where_status = ''; }39 35 $ip_storing = ! empty( $settings['ip_storing'] ) ? esc_attr($settings['ip_storing']) : 'true'; 40 36 $keyword = ( isset( $_REQUEST['s'] ) ) ? sanitize_text_field($_REQUEST['s']) : ''; … … 68 64 if ( !empty($form_id) ) { $counter = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}sform_submissions WHERE form = {$form_id} $where_status $where_keyword $where_date"); } 69 65 else { $counter = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}sform_submissions WHERE form != '0' AND listable = '1' $where_status $where_keyword $where_date"); } 70 if ( !empty($form_id) ) { $form_name = $wpdb->get_var("SELECT name FROM {$wpdb->prefix}sform_shortcodes WHERE id = '$form_id'"); }66 if ( !empty($form_id) ) { /* $form_name = $wpdb->get_var("SELECT name FROM {$wpdb->prefix}sform_shortcodes WHERE id = '$form_id'"); */ $form_name = $entry_form_name; } 71 67 else { $form_name = 'all forms'; } 72 68 if ( esc_attr($item['status']) == 'new' ) { $counter = $counter - 1; } … … 74 70 $counter_span = '<span id="view-counter">' . $counter . '</span>'; 75 71 $count_messages = sprintf( _n( '%1$s %2$s entry in %3$s', '%1$s %2$s entries in %3$s', $counter ), $counter_span, $message_type, $form_name ) . ' '; 76 $messages_nav = $counter > 1 ? '<div id="navigation-buttons"><div id="messages-nav">' . $prev_button . $next_button . '</div><div id="messages-info">' . $count_messages . '</div></div>' : ''; 72 $messages_nav_class = $counter > 1 ? $color : 'invisible'; 73 $messages_nav = '<div id="navigation-buttons" class="' . $messages_nav_class . '"><div id="messages-nav">' . $prev_button . $next_button . '</div><div id="messages-info">' . $count_messages . '</div></div>'; 77 74 $contact_info = isset( $_REQUEST['info'] ) && $_REQUEST['info'] == 'hidden' ? ' unseen' : ''; 78 $user_type = esc_attr($item['requester_type']) == 'registered' && esc_attr($item['requester_id']) != '0' ? __('Registered', 'simpleform-contact-form-submissions') : __('Anonymous', 'simpleform-contact-form-submissions') ; 79 $user_class = esc_attr($item['requester_type']) != 'registered' && empty($name) && empty($lastname) && empty($phone) && empty($ip) && empty($email) ? 'last' : ''; 80 $name = $item['name'] != '' && $item['name'] != 'not stored' ? esc_attr($item['name']) : ''; 75 $editing = isset( $_REQUEST['editing'] ) && $_REQUEST['editing'] == 'hidden' ? ' collapsed' : ''; 76 $editing_class = $editing ? 'closed' : ''; 77 $toggle_message_class = isset( $_REQUEST['info'] ) && $_REQUEST['info'] == 'hidden' ? '' : ' unseen'; 78 $dashicons_arrow = $editing ? 'dashicons-arrow-down-alt2' : 'dashicons-arrow-up-alt2'; 79 $user_type = esc_attr($item['requester_type']) == 'registered' && esc_attr($item['requester_id']) != '0' ? __('Registered', 'simpleform-contact-form-submissions') : __('Unregistered', 'simpleform-contact-form-submissions'); 80 $name = $item['name'] != '' && $item['name'] != 'not stored' && $item['name'] != 'Anonymous' ? trim(esc_attr($item['name'])) : ''; 81 81 $lastname = $item['lastname'] != '' && $item['lastname'] != 'not stored' ? esc_attr($item['lastname']) : ''; 82 $lastname_separator = ! empty($name) ? '<br>' : ''; 83 $fullname = ! empty($name) || ! empty($lastname) ? $name . $lastname_separator . $lastname : __( 'Anonymous', 'simpleform' ); 82 84 $phone = $item['phone'] != '' && $item['phone'] != 'not stored' ? esc_attr($item['phone']) : ''; 83 85 $ip = $item['ip'] != '' && $item['ip'] != 'not stored' ? esc_attr($item['ip']) : ''; 84 86 $email = $item['email'] != '' && $item['email'] != 'not stored' ? esc_attr($item['email']) : ''; 87 // $user_class = esc_attr($item['requester_type']) != 'registered' && empty($name) && empty($lastname) && empty($phone) && empty($ip) && empty($email) ? 'last' : ''; 85 88 $user_data = false; 86 89 if ( esc_attr($item['requester_type']) == 'registered' && esc_attr($item['requester_id']) != '0' ) { … … 93 96 $role_name = translate_user_role($wp_roles->roles[$role]['name']); 94 97 } 95 $role_class = empty($ name) && empty($lastname) && empty($phone) && empty($ip) && empty($email) ? 'last' : '';96 $name_ class = empty($lastname) && empty($phone) && empty($ip) && empty($email) ? 'last' : '';97 $ lastname_class = empty($phone) && empty($ip) && empty($email) ? 'last' : '';98 $role_class = empty($phone) && empty($ip) && empty($email) ? 'last' : ''; 99 $name_line = empty($name) || empty($lastname) ? '' : 'topaligned'; 100 $name_class = empty($phone) && empty($ip) && empty($email) ? 'last ' . $name_line : $name_line; 98 101 $phone_class = empty($ip) && empty($email) ? 'last' : ''; 99 $ ip_class = empty($email) ? 'last' : '';102 $email_class = empty($ip) ? 'last' : ''; 100 103 $data_column_class = isset( $_REQUEST['info'] ) && $_REQUEST['info'] == 'hidden' ? 'fullwidth' : 'first'; 101 104 $submission_id_class = isset( $_REQUEST['info'] ) && $_REQUEST['info'] == 'hidden' ? '' : 'unseen'; … … 144 147 <form id="submission-tab" method="post" class="<?php echo $color ?>"> 145 148 149 <input type="hidden" id="selected-form" name="selected-form" value="<?php echo $form_id ?>"> 146 150 <input type="hidden" id="entry" name="entry" value="<?php echo $item['id'] ?>"> 147 151 <input type="hidden" id="entries-counter" name="entries-counter" value="<?php echo $counter ?>"> 148 152 <input type="hidden" id="entries-form" name="entries-form" value="<?php echo $form_id ?>"> 149 153 <input type="hidden" id="entries-view" name="entries-view" value="<?php echo $view_arg ?>"> 154 <?php 155 $email= esc_attr($item['email']); 156 $gravemail = md5( strtolower( trim( $email ) ) ); 157 $gravsrc = "http://www.gravatar.com/avatar/".$gravemail; 158 $gravcheck = "http://www.gravatar.com/avatar/".$gravemail."?d=404"; 159 $response = get_headers($gravcheck); 160 $avatar = strpos( $response[0], '404 Not Found' ) === false ? true : ''; 161 ?> 150 162 151 163 <div class="submission-data"> … … 155 167 <table class="entrie-table"><tbody> 156 168 157 <tr><th class="option first"><span><?php _e(' EntryID','simpleform-contact-form-submissions') ?></span></th><td class="plaintext first toggle"># <?php echo $id; ?><span id="toggle-info" data-title="<?php esc_attr_e('Hide','simpleform-contact-form-submissions') ?>" class="dashicons dashicons-arrow-left-alt2 contact-info left"></span></td></tr>169 <tr><th class="option first"><span><?php _e('ID','simpleform-contact-form-submissions') ?></span></th><td class="plaintext first toggle"># <?php echo $id; ?><span id="toggle-info" data-title="<?php esc_attr_e('Hide','simpleform-contact-form-submissions') ?>" class="dashicons dashicons-arrow-left-alt2 contact-info left"></span></td></tr> 158 170 159 171 <tr class="<?php if ( $count_forms < 2 ) { echo 'unseen'; } ?>"><th class="option"><span><?php _e('Form','simpleform') ?></span></th><td class="plaintext"><span class="form-name"><?php echo $entry_form_name ?></span></td></tr> 160 172 161 <tr><th class="option"><span><?php _e('Profile Picture','simpleform-contact-form-submissions') ?></span></th><td class="plaintext profile"><?php echo get_avatar( esc_attr($item['email']), 100, 'mystery' ); ?></td></tr> 162 163 <tr><th class="option <?php echo $user_class ?>"><span><?php _e('User Type','simpleform-contact-form-submissions') ?></span></th><td class="plaintext <?php echo $user_class ?>"><?php echo $user_type ?></td></tr> 173 <tr><th class="option <?php // echo $user_class ?>"><span><?php _e('User','simpleform-contact-form-submissions') ?></span></th><td class="plaintext <?php // echo $user_class ?>"><?php echo $user_type ?></td></tr> 164 174 165 175 <?php if ( $user_data == true ) { ?> … … 171 181 <?php } ?> 172 182 173 <?php if ( ! empty($name) ) { ?> 174 175 <tr><th class="option <?php echo $name_class ?>"><span><?php _e('Name','simpleform-contact-form-submissions') ?></span></th><td class="plaintext <?php echo $name_class ?>"><?php echo $name ?></td></tr> 183 <?php if ( get_option( 'show_avatars' ) && is_email($item['email']) && $avatar ) { ?> 184 185 <tr><th class="option"><span><?php _e('Profile Picture','simpleform-contact-form-submissions') ?></span></th><td class="plaintext profile"><?php echo get_avatar( esc_attr($item['email']), 'mystery' ); ?></td></tr> 186 187 <?php } ?> 188 189 <tr><th class="option <?php echo $name_class ?>"><span><?php _e('Name','simpleform-contact-form-submissions') ?></span></th><td class="plaintext <?php echo $name_class ?>"><?php echo $fullname ?></td></tr> 176 190 177 <?php } ?>178 179 <?php if ( ! empty($lastname) ) { ?>180 181 <tr><th class="option <?php echo $lastname_class ?>"><span><?php _e('Last Name','simpleform-contact-form-submissions') ?></span></th><td class="plaintext <?php echo $lastname_class ?>"><?php echo $lastname ?></td></tr>182 183 <?php } ?>184 185 191 <?php if ( ! empty($phone ) ) { ?> 186 192 … … 188 194 189 195 <?php } ?> 190 191 <?php if ( ! empty($ip) ) { ?>192 193 <tr><th class="option <?php echo $ip_class ?>"><span><?php _e('IP','simpleform-contact-form-submissions') ?></span></th><td class="plaintext <?php echo $ip_class ?>"><?php echo $ip ?></td></tr>194 195 <?php } ?>196 196 197 197 <?php if ( ! empty($email) ) { ?> 198 198 199 <tr><th class="option last"><span><?php _e('Email','simpleform-contact-form-submissions') ?></span></th><td class="plaintext email last"><?php echo $email ?></td></tr>199 <tr><th class="option <?php echo $email_class ?>"><span><?php _e('Email','simpleform-contact-form-submissions') ?></span></th><td class="plaintext email <?php echo $email_class ?>"><?php echo $email ?></td></tr> 200 200 201 201 <?php } ?> 202 202 203 <?php if ( ! empty($ip) ) { ?> 204 205 <tr><th class="option last"><span><?php _e('IP','simpleform-contact-form-submissions') ?></span></th><td class="plaintext last"><?php echo $ip ?></td></tr> 206 207 <?php } ?> 208 203 209 </tbody></table> 204 210 … … 208 214 209 215 <table class="entrie-table"><tbody> 210 211 <tr id="submission-id" class="<?php echo $submission_id_class ?>"><th class="option first"><span><?php _e('Entry ID','simpleform-contact-form-submissions') ?></span></th><td class="plaintext first toggle"># <?php echo $id; ?><span id="toggle-info" data-title="<?php esc_attr_e('Show contact info','simpleform-contact-form-submissions') ?>" class="dashicons dashicons-arrow-right-alt2 contact-info right"></span></td></tr> 212 213 <tr id="entry-form" class="<?php echo $submission_id_class; if ( $count_forms < 2 ) { echo ' unseen'; } ?>"><th class="option"><span><?php _e('Form','simpleform') ?></span></th><td class="plaintext"><span class="form-name"><?php echo $entry_form_name ?></span></td></tr> 214 215 <tr class="<?php echo $date_class ?>"><th id="thdate" class="option <?php echo $date_class ?>"><span><?php _e('Date','simpleform-contact-form-submissions') ?></span></th><td id="tddate" class="plaintext <?php echo $date_class ?>"><?php echo $entry_date ?></td></tr> 216 217 <tr id="submission-id" class="first"><th id="thdate" class="option first"><span><?php _e('Date','simpleform-contact-form-submissions') ?></span></th><td id="tddate" class="plaintext first toggle"><?php echo $entry_date ?><span id="toggle-message" data-title="<?php esc_attr_e('Show contact info','simpleform-contact-form-submissions') ?>" class="dashicons dashicons-arrow-right-alt2 contact-info right <?php echo $toggle_message_class ?>"></span></td></tr> 216 218 217 219 <?php if ( ! empty($subject) ) { ?> … … 221 223 <?php } ?> 222 224 223 <tr><th class="option"><span><?php _e('Message','simpleform-contact-form-submissions') ?></span></th><td class="plaintext"><?php echo esc_attr($item['object']) ?></td></tr> 225 <tr><th class="option request"><span><?php _e('Message','simpleform-contact-form-submissions') ?></span></th><td class="plaintext request"><?php echo stripslashes(wpautop(esc_attr($item['object']))) ?></td></tr> 226 227 </tbody></table> 228 <h2 id="h2-editing" class="options-heading <?php echo $editing_class ?>"><span class="heading" section="editing"><?php _e( 'Editing', 'simpleform' ); ?><span class="toggle dashicons <?php echo $dashicons_arrow ?> editing"></span></span></h2> 229 230 <div class="section editing <?php echo $editing ?>"> 231 <table class="form-table editing"><tbody> 224 232 225 233 <tr><th id="thstatus" class="option <?php echo $status_class ?>"><span><?php _e('Status','simpleform') ?></span></th><td id="tdstatus" class="select <?php echo $status_class ?>"><select name="message-status" id="message-status" class="sform <?php echo $color ?>"><option value="" disabled><?php _e('Mark as', 'simpleform-contact-form-submissions' ) ?></option><option value="new"><?php _e('unread', 'simpleform-contact-form-submissions' ) ?></option><option value="read" <?php if ( $item['status'] == 'read' || $item['status'] == 'new' ) echo 'selected="selected"'; ?>><?php _e('read', 'simpleform-contact-form-submissions' ) ?></option><option value="answered" <?php selected( $item['status'], 'answered'); ?>><?php _e('answered', 'simpleform-contact-form-submissions' ) ?></option><option value="spam" <?php selected( $item['status'], 'spam'); ?>><?php _e('junk', 'simpleform-contact-form-submissions' ) ?></option><option value="trash" <?php selected( $item['status'], 'trash'); ?>><?php _e('trashed', 'simpleform-contact-form-submissions' ) ?></option></select><?php echo $mailtolink ?></td></tr> … … 228 236 229 237 <tr class="trmoving <?php if ( $count_forms < 2 || $item['status'] == 'trash' || $item['status'] == 'spam' || $movable != true ) { echo 'unseen'; } ?>"><th id="thmoveto" class="option last"><span><?php _e('Move To','simpleform') ?></span></th><td id="tdmoveto" class="select last"><select name="moveto" id="moveto" class="sform <?php echo $color ?>"><option value=""><?php _e('Select a form to move entry to', 'simpleform-contact-form-submissions' ) ?></option><?php echo $options ?></select></td></tr> 230 238 231 239 </tbody></table> 232 240 … … 238 246 <input type="submit" name="edit-entry" id="edit-entry" class="submit-button" value="<?php esc_attr_e( 'Save Changes', 'simpleform-contact-form-submissions' ) ?>"><?php wp_nonce_field( 'ajax-verification-nonce', 'verification_nonce'); ?> 239 247 </div> 240 241 </div> 242 248 </div> 249 </div> 243 250 </div> 244 251 … … 247 254 </div> 248 255 249 <div class="sform-clear"></div> 256 <div class="sform-clear"></div> -
simpleform-contact-form-submissions/trunk/changelog.txt
r2664815 r2701411 1 1 == Changelog == 2 3 = 2.0.1 (29 March 2022) = 4 * Fixed: the line breaks are preserved in the message 5 * Fixed: backslashes removed in the message 6 * Fixed: incorrect display of the number of entries when entries have been moved 7 * Fixed: incorrect displaying of form status 8 * Fixed: deprecated jQuery functions warning 9 * Changed: restyling of entry data page 10 * Changed: last entries data are recovered upon the plugin activation 2 11 3 12 = 2.0 (25 January 2022) = -
simpleform-contact-form-submissions/trunk/includes/class-activator.php
r2664815 r2701411 24 24 switch_to_blog( $blog_id ); 25 25 self::change_db(); 26 self::entries_data_recovery(); 26 27 self::sform_submissions_settings(); 27 28 restore_current_blog(); … … 29 30 } else { 30 31 self::change_db(); 32 self::entries_data_recovery(); 31 33 self::sform_submissions_settings(); 32 34 } 33 35 } else { 34 36 self::change_db(); 37 self::entries_data_recovery(); 35 38 self::sform_submissions_settings(); 36 39 } … … 104 107 $prefix = $wpdb->prefix; 105 108 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 106 107 109 $submissions_table = $prefix . 'sform_submissions'; 108 $sql = "CREATE TABLE " . $submissions_table . "(110 $sql = "CREATE TABLE {$submissions_table} ( 109 111 id int(11) NOT NULL AUTO_INCREMENT, 110 112 form int(7) NOT NULL DEFAULT '1', … … 123 125 previous_status varchar(32) NOT NULL default '', 124 126 trash_date datetime NULL, 125 notes text N OT NULL,127 notes text NULL, 126 128 listable tinyint(1) NOT NULL DEFAULT 1, 127 129 hidden tinyint(1) NOT NULL DEFAULT '0', … … 136 138 137 139 /** 140 * Edit entries recovering data from last received messages. 141 * 142 * @since 1.0 143 */ 144 145 public static function entries_data_recovery() { 146 147 global $wpdb; 148 $submissions_table = $wpdb->prefix . 'sform_submissions'; 149 if ( $result = $wpdb->get_results("SHOW TABLES LIKE '{$wpdb->prefix}sform_submissions'") ) { 150 $forms = $wpdb->get_col("SELECT DISTINCT form FROM {$wpdb->prefix}sform_submissions"); 151 if ( $forms ) { 152 foreach ( $forms as $form ) { 153 $last_entry = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}sform_submissions WHERE form = %d ORDER BY date DESC LIMIT 1", $form) ); 154 $before_last_entry = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}sform_submissions WHERE form = %d ORDER BY date DESC LIMIT 1 OFFSET 1", $form) ); 155 $last_message = get_option("sform_last_{$form}_message") != false ? explode('#', get_option("sform_last_{$form}_message") ) : ''; 156 $before_last_message = get_option("sform_before_last_{$form}_message") != false ? explode('#', get_option("sform_before_last_{$form}_message") ) : ''; 157 $forwarded_last_message = get_option("sform_forwarded_last_{$form}_message") != false ? explode('#', get_option("sform_forwarded_last_{$form}_message") ) : ''; 158 $forwarded_before_last_message = get_option("sform_forwarded_before_last_{$form}_message") != false ? explode('#', get_option("sform_forwarded_before_last_{$form}_message") ) : ''; 159 $direct_last_message = get_option("sform_direct_last_{$form}_message") != false ? explode('#', get_option("sform_direct_last_{$form}_message") ) : ''; 160 $direct_before_last_message = get_option("sform_direct_before_last_{$form}_message") != false ? explode('#', get_option("sform_direct_before_last_{$form}_message") ) : ''; 161 $moved_last_message = get_option("sform_moved_last_{$form}_message") != false ? explode('#', get_option("sform_moved_last_{$form}_message") ) : ''; 162 $moved_before_last_message = get_option("sform_moved_before_last_{$form}_message") != false ? explode('#', get_option("sform_moved_before_last_{$form}_message") ) : ''; 163 $last_message_timestamp = $last_message && is_numeric($last_message[0]) ? $last_message[0] : ''; 164 $before_last_message_timestamp = $before_last_message && is_numeric($before_last_message[0]) ? $before_last_message[0] : ''; 165 $forwarded_last_message_timestamp = $forwarded_last_message && is_numeric($forwarded_last_message[0]) ? $forwarded_last_message[0] : ''; 166 $forwarded_before_last_message_timestamp = $forwarded_before_last_message && is_numeric($forwarded_before_last_message[0]) ? $forwarded_before_last_message[0] : ''; 167 $direct_last_message_timestamp = $direct_last_message && is_numeric($direct_last_message[0]) ? $direct_last_message[0] : ''; 168 $direct_before_last_message_timestamp = $direct_before_last_message && is_numeric($direct_before_last_message[0]) ? $direct_before_last_message[0] : ''; 169 $moved_last_message_timestamp = $moved_last_message && is_numeric($moved_last_message[0]) ? $moved_last_message[0] : ''; 170 $moved_before_last_message_timestamp = $moved_before_last_message && is_numeric($moved_before_last_message[0]) ? $moved_before_last_message[0] : ''; 171 $dates = array(); 172 $dates[$last_message_timestamp] = $last_message_timestamp && isset($last_message[1]) ? $last_message[1] : ''; 173 $dates[$before_last_message_timestamp] = $before_last_message_timestamp && isset($before_last_message[1]) ? $before_last_message[1] : ''; 174 $dates[$forwarded_last_message_timestamp] = $forwarded_last_message_timestamp && isset($forwarded_last_message[1]) ? $forwarded_last_message[1] : ''; 175 $dates[$forwarded_before_last_message_timestamp] = $forwarded_before_last_message_timestamp && isset($forwarded_before_last_message[1]) ? $forwarded_before_last_message[1] : ''; 176 $dates[$direct_last_message_timestamp] = $direct_last_message_timestamp && isset($direct_last_message[1]) ? $direct_last_message[1] : ''; 177 $dates[$direct_before_last_message_timestamp] = $direct_before_last_message_timestamp && isset($direct_before_last_message[1]) ? $direct_before_last_message[1] : ''; 178 $dates[$moved_last_message_timestamp] = $moved_last_message_timestamp && isset($moved_last_message[1]) ? $moved_last_message[1] : ''; 179 $dates[$moved_before_last_message_timestamp] = $moved_before_last_message_timestamp && isset($moved_before_last_message[1]) ? $moved_before_last_message[1] : ''; 180 // Remove empty array elements 181 $dates = array_filter($dates); 182 if ( $last_entry && esc_attr($last_entry->object) == '' ) { 183 $last_date = esc_attr($last_entry->date); 184 $entry_id = esc_attr($last_entry->id); 185 if ( array_key_exists(strtotime($last_date), $dates) ) { 186 $message = $dates[strtotime($last_date)]; 187 $split_mail = explode(' < ', $message); 188 $email = isset($split_mail[1]) ? explode(' >', $split_mail[1])[0] : ''; 189 $name_separator = strpos($message, ':</td><td>') !== false ? __('From', 'simpleform') . ':</td><td>' : __('From', 'simpleform') . ':</b> '; 190 $separator = strpos($message, ':</td><td>') !== false ? '</td>' : '<br>'; 191 $split_name = explode($name_separator, $message); 192 $email_separator = ! empty($email) ? ' < ' : $separator; 193 $name = isset($split_name[1]) ? explode($email_separator, $split_name[1])[0] : ''; 194 $phone_separator = strpos($message, ':</td><td>') !== false ? __('Phone', 'simpleform') . ':</td><td>' : __('Phone', 'simpleform') . ':</b> '; 195 $split_phone = explode($phone_separator, $message); 196 $phone = isset($split_phone[1]) ? explode($separator, $split_phone[1])[0] : ''; 197 $subject_separator = strpos($message, ':</td><td>') !== false ? __('Subject', 'simpleform') . ':</td><td>' : __('Subject', 'simpleform') . ':</b> '; 198 $split_subject = explode($subject_separator, $message); 199 $subject = isset($split_subject[1]) ? explode($separator, $split_subject[1])[0] : ''; 200 $object_separator = strpos($message, ':</td><td>') !== false ? __('Message', 'simpleform') . ':</td><td>' : __('Message', 'simpleform') . ':</b> '; 201 $split_object = explode($object_separator, $message); 202 $closing_separator = strpos($message, ':</td><td>') !== false ? '</td>' : '</div>'; 203 $object = isset($split_object[1]) ? explode($closing_separator, $split_object[1])[0] : ''; 204 $wpdb->update( $wpdb->prefix . 'sform_submissions', array( 'name' => strip_tags($name), 'email' => strip_tags($email), 'phone' => $phone, 'subject' => $subject, 'object' => $object, 'status' => 'read' ), array('id' => $entry_id ) ); 205 } 206 } 207 if ( $before_last_entry && esc_attr($before_last_entry->object) == '' ) { 208 $before_last_date = esc_attr($before_last_entry->date); 209 $before_entry_id = esc_attr($before_last_entry->id); 210 if ( array_key_exists(strtotime($before_last_date), $dates) ) { 211 $message = $dates[strtotime($before_last_date)]; 212 $split_mail = explode(' < ', $message); 213 $email = isset($split_mail[1]) ? explode(' >', $split_mail[1])[0] : ''; 214 $name_separator = strpos($message, ':</td><td>') !== false ? __('From', 'simpleform') . ':</td><td>' : __('From', 'simpleform') . ':</b> '; 215 $separator = strpos($message, ':</td><td>') !== false ? '</td>' : '<br>'; 216 $split_name = explode($name_separator, $message); 217 $email_separator = ! empty($email) ? ' < ' : $separator; 218 $name = isset($split_name[1]) ? explode($email_separator, $split_name[1])[0] : ''; 219 $phone_separator = strpos($message, ':</td><td>') !== false ? __('Phone', 'simpleform') . ':</td><td>' : __('Phone', 'simpleform') . ':</b> '; 220 $split_phone = explode($phone_separator, $message); 221 $phone = isset($split_phone[1]) ? explode($separator, $split_phone[1])[0] : ''; 222 $subject_separator = strpos($message, ':</td><td>') !== false ? __('Subject', 'simpleform') . ':</td><td>' : __('Subject', 'simpleform') . ':</b> '; 223 $split_subject = explode($subject_separator, $message); 224 $subject = isset($split_subject[1]) ? explode($separator, $split_subject[1])[0] : ''; 225 $object_separator = strpos($message, ':</td><td>') !== false ? __('Message', 'simpleform') . ':</td><td>' : __('Message', 'simpleform') . ':</b> '; 226 $split_object = explode($object_separator, $message); 227 $closing_separator = strpos($message, ':</td><td>') !== false ? '</td>' : '</div>'; 228 $object = isset($split_object[1]) ? explode($closing_separator, $split_object[1])[0] : ''; 229 $wpdb->update( $wpdb->prefix . 'sform_submissions', array( 'name' => strip_tags($name), 'email' => strip_tags($email), 'phone' => $phone, 'subject' => $subject, 'object' => $object, 'status' => 'read' ), array('id' => $before_entry_id ) ); 230 } 231 } 232 } 233 } 234 } 235 236 } 237 238 239 /** 138 240 * Create a table whenever a new blog is created in a WordPress Multisite installation. 139 241 * … … 145 247 if ( is_plugin_active_for_network( 'simpleform-submissions/simpleform-submissions.php' ) ) { 146 248 switch_to_blog( $params->blog_id ); 249 self::change_db(); 250 self::entries_data_recovery(); 147 251 self::sform_submissions_settings(); 148 self::change_db();149 252 restore_current_blog(); 150 253 } -
simpleform-contact-form-submissions/trunk/includes/class-core.php
r2664815 r2701411 133 133 // The class responsible for defining all actions that occur in the admin area. 134 134 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-admin.php'; 135 136 // The class responsible for defining utilities 137 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-utilities.php'; 135 138 136 139 // The class responsible for defining all actions that occur in the public-facing side of the site. … … 195 198 // Admin footer text 196 199 $this->loader->add_action( 'admin_footer_text', $plugin_admin, 'admin_footer', 1, 2 ); 197 // Register ajax callback for message status editing198 // $this->loader->add_action( 'wp_ajax_edit_message_status', $plugin_admin, 'edit_message_status');199 200 // Register ajax callback for entry data editing 200 201 $this->loader->add_action('wp_ajax_edit_entry', $plugin_admin, 'edit_entry'); -
simpleform-contact-form-submissions/trunk/includes/class-deactivator.php
r2664815 r2701411 27 27 // Check if other forms have been activated 28 28 global $wpdb; 29 $table = "{$wpdb->prefix}sform_shortcodes"; 30 if ( $result = $wpdb->get_results("SHOW TABLES LIKE '".$table."'") ) { 31 $ids = $wpdb->get_col("SELECT id FROM `$table` WHERE id != '1'"); 29 if ( $result = $wpdb->get_results("SHOW TABLES LIKE '{$wpdb->prefix}sform_shortcodes'") ) { 30 $ids = $wpdb->get_col("SELECT id FROM {$wpdb->prefix}sform_shortcodes WHERE id != '1'"); 32 31 if ( $ids ) { 33 32 foreach($ids as $id) { … … 45 44 46 45 if ( $messages > 0 ) { 47 $forms = $wpdb->get_col( "SELECT id FROM $table" );46 $forms = $wpdb->get_col( "SELECT id FROM {$wpdb->prefix}sform_shortcodes" ); 48 47 foreach($forms as $form) { 49 48 $count_entries = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->prefix}sform_submissions WHERE form = '$form'"); 50 49 $count_moved = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->prefix}sform_submissions WHERE moved_from = '$form'"); 51 $form_status = $wpdb->get_var("SELECT status FROM {$wpdb->prefix}sform_shortcodes WHERE id = '$form'"); 52 // if ( $form_status != 'trash' ) { $status = $count_entries == '0' ? 'unused' : 'used'; } 53 // else { $status = 'trash'; } 54 // $update = $wpdb->update($table, array( 'status' => $status, 'entries' => $count_entries, 'moved_entries' => $count_moved, 'storing' => '1' ), array('id' => $form ) ); 55 $update = $wpdb->update($table, array( 'entries' => $count_entries, 'moved_entries' => $count_moved, 'storing' => '1' ), array('id' => $form ) ); 50 $update = $wpdb->update($wpdb->prefix . 'sform_shortcodes', array( 'entries' => $count_entries, 'moved_entries' => $count_moved, 'storing' => '1' ), array('id' => $form ) ); 56 51 } 57 52 $entries = $wpdb->get_var("SELECT SUM(entries) as total_entries FROM {$wpdb->prefix}sform_shortcodes"); … … 61 56 } 62 57 else { 63 $forms = $wpdb->get_col( "SELECT id FROM $table" );58 $forms = $wpdb->get_col( "SELECT id FROM {$wpdb->prefix}sform_shortcodes" ); 64 59 foreach($forms as $form) { 65 $update = $wpdb->update($ table, array( 'storing' => '1' ), array('id' => $form ) );60 $update = $wpdb->update($wpdb->prefix . 'sform_shortcodes', array( 'storing' => '1' ), array('id' => $form ) ); 66 61 } 67 62 delete_option( 'sform_entries_view' ); -
simpleform-contact-form-submissions/trunk/includes/class-list-table.php
r2664815 r2701411 219 219 function column_firstname($item) { 220 220 $sender = $item['name'] != '' ? esc_attr($item['name']) : __('Anonymous', 'simpleform-contact-form-submissions' ); 221 return $sender;221 return stripslashes($sender); 222 222 } 223 223 … … 230 230 function column_family($item) { 231 231 $sender = $item['lastname'] != '' ? esc_attr($item['lastname']) : '-'; 232 return $sender;232 return stripslashes($sender); 233 233 } 234 234 … … 241 241 function column_from($item) { 242 242 $from = $item['name'] != '' || $item['lastname'] != '' ? trim(esc_attr($item['name']) . ' ' . esc_attr($item['lastname'])) : __('Anonymous', 'simpleform-contact-form-submissions' ); 243 return $from;243 return stripslashes($from); 244 244 } 245 245 … … 441 441 ); 442 442 } 443 $subject = $item['subject'] != '' && $item['subject'] != 'not stored' ? esc_attr($item['subject']) : esc_attr__( 'No Subject', 'simpleform-contact-form-submissions' );443 $subject = $item['subject'] != '' && $item['subject'] != 'not stored' ? stripslashes(esc_attr($item['subject'])) : esc_attr__( 'No Subject', 'simpleform-contact-form-submissions' ); 444 444 if ( $form_id == '' ) { 445 445 $settings = get_option('sform_settings'); … … 460 460 461 461 function column_object($item) { 462 return esc_attr($item['object']);462 return stripslashes(esc_attr($item['object'])); 463 463 } 464 464 … … 535 535 */ 536 536 537 function process_bulk_action() { 537 function process_bulk_action() { 538 538 539 global $wpdb; 539 540 $msg = ''; 540 $form_id = isset($_REQUEST['form']) ? absint($_REQUEST['form']) : '';541 $moveto = isset($_REQUEST['moveto']) ? absint($_REQUEST['moveto']) : $form_id;542 541 543 542 if ('delete' === $this->current_action()) { … … 554 553 } 555 554 } 555 556 556 if ('trash' === $this->current_action() ) { 557 557 $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : ''; … … 568 568 } 569 569 } 570 570 571 if ('spam' === $this->current_action() ) { 571 572 $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : ''; … … 584 585 } 585 586 } 587 586 588 if ('untrash' === $this->current_action()) { 587 589 $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : ''; … … 597 599 } 598 600 } 601 599 602 if ('unspam' === $this->current_action()) { 600 603 $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : ''; … … 613 616 } 614 617 } 618 615 619 if ( 'bulk-delete' === $this->current_action() || ( isset( $_REQUEST['action2'] ) && $_REQUEST['action2'] === 'bulk-delete' ) ) { 616 620 … … 638 642 } 639 643 } 644 640 645 if ( 'bulk-trash' === $this->current_action() || ( isset( $_REQUEST['action2'] ) && $_REQUEST['action2'] === 'bulk-trash' ) ) { 641 646 $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : ''; … … 658 663 } 659 664 } 665 660 666 if ( 'bulk-spam' === $this->current_action() || ( isset( $_REQUEST['action2'] ) && $_REQUEST['action2'] === 'bulk-spam' ) ) { 661 667 $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : ''; … … 680 686 } 681 687 } 688 682 689 if ( 'bulk-untrash' === $this->current_action() || ( isset( $_REQUEST['action2'] ) && $_REQUEST['action2'] === 'bulk-untrash' ) ) { 683 690 $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : ''; … … 699 706 } 700 707 } 708 701 709 if ( 'bulk-unspam' === $this->current_action() || ( isset( $_REQUEST['action2'] ) && $_REQUEST['action2'] === 'bulk-unspam' ) ) { 702 710 $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : ''; … … 723 731 724 732 if ( 'bulk-move' === $this->current_action() || ( isset( $_REQUEST['action2'] ) && $_REQUEST['action2'] === 'bulk-move' ) ) { 725 $moveto = isset($_REQUEST['move2']) ? absint($_REQUEST['move2']) : ''; 733 $movefrom = isset($_REQUEST['form']) ? absint($_REQUEST['form']) : ''; 734 $moveto = isset($_REQUEST['move2']) ? absint($_REQUEST['move2']) : ''; 726 735 $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : ''; 727 736 if ( ! wp_verify_nonce( $nonce, 'bulk-sform-entries' ) ) { $this->invalid_nonce_redirect(); } 728 else { 737 else { 729 738 $ids = isset($_REQUEST['id']) && is_array($_REQUEST['id']) ? $_REQUEST['id'] : array($_REQUEST['id']); 730 739 $ids = array_map('absint', $ids); … … 735 744 $form_name = $wpdb->get_var( "SELECT name FROM {$wpdb->prefix}sform_shortcodes WHERE id = '{$moveto}'"); 736 745 $name = ! empty($form_name) ? $form_name : __( 'selected form', 'simpleform-contact-form-submissions' ); 737 $success = $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->prefix}sform_submissions SET form = '{$moveto}' WHERE id IN($placeholders)", $ids) ); 738 if ( $success ): 746 $success = $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->prefix}sform_submissions SET moved_from = form, form = '{$moveto}' WHERE id IN($placeholders)", $ids) ); 747 if ( $success ): 748 $util = new SimpleForm_Submissions_Util(); 749 $util->update_last_messages( $ids, $movefrom, $moveto ); 739 750 $messages = implode(',', $ids); 740 751 $action_notice = '<div class="notice notice-success is-dismissible"><p>' . sprintf( _n( 'Submission with ID: %1$s successfully moved to %2$s', 'Submissions with ID: %1$s successfully moved to %2$s', $ids_count, 'simpleform-contact-form-submissions' ), $messages, $name ) .'</p></div>'; … … 870 881 871 882 /** 872 * Edit bulk actions.883 * Append the selector to move entries in the bulk actions menu. 873 884 * 874 885 * @since 2.0 … … 876 887 877 888 function bulk_actions( $which = '' ) { 878 if ( is_null( $this->_actions ) ) { 889 890 $id = isset( $_REQUEST['form'] ) ? absint($_REQUEST['form']) : ''; 891 $moving_option = ''; 892 893 // Prevent duplicate queries in bottom bulk actions 894 if ( !empty($id) && 'top' === $which ) { 895 global $wpdb; 896 $forms = $wpdb->get_results( "SELECT id, name FROM {$wpdb->prefix}sform_shortcodes WHERE id != '{$id}' ORDER BY name ASC", 'ARRAY_A' ); 897 if ( count($forms) > 1 ) { 898 $moving_option .= '<select name="moveto" id="moveto" class="moveto unseen"><option value="">' . __( 'Select Form', 'simpleform-contact-form-submissions' ) . '</option>'; 899 foreach($forms as $form) { $moving_option .= '<option value="'.$form['id'].'">'. $form['name'].'</option>'; } 900 $moving_option .= '</select>'; 901 } 902 } 903 904 if ( is_null( $this->_actions ) ) { 879 905 $this->_actions = $this->get_bulk_actions(); 906 $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions ); 907 $two = ''; 908 } else { 909 $two = '2'; 910 } 880 911 881 /** 882 * Filters the items in the bulk actions menu of the list table............ 883 * 884 * @since 1.7 885 */ 886 $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores 912 if ( empty( $this->_actions ) ) { 913 return; 914 } 887 915 888 $two = ''; 889 } else { 890 $two = '2'; 891 } 916 echo '<label for="bulk-action-selector-' . esc_attr( $which ) . '" class="screen-reader-text">' . __( 'Select bulk action' ) . '</label>'; 917 echo '<select name="action' . $two . '" id="bulk-action-selector-' . esc_attr( $which ) . "\">\n"; 918 echo '<option value="-1">' . __( 'Bulk actions' ) . "</option>\n"; 892 919 893 if ( empty( $this->_actions ) ) { 894 return; 895 } 896 897 echo '<label for="bulk-action-selector-' . esc_attr( $which ) . '" class="screen-reader-text">' . __( 'Select bulk action' ) . '</label>'; 898 echo '<select name="action' . $two . '" id="bulk-action-selector-' . esc_attr( $which ) . "\">\n"; 899 echo '<option value="-1">' . __( 'Bulk actions' ) . "</option>\n"; 900 901 foreach ( $this->_actions as $key => $value ) { 920 foreach ( $this->_actions as $key => $value ) { 902 921 if ( is_array( $value ) ) { 903 922 echo "\t" . '<optgroup label="' . esc_attr( $key ) . '">' . "\n"; … … 914 933 echo "\t" . '<option value="' . esc_attr( $key ) . '"' . $class . '>' . $value . "</option>\n"; 915 934 } 916 }935 } 917 936 918 echo "</select>\n"; 937 echo "</select>\n"; 938 939 echo $moving_option; 940 941 submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) ); 942 echo "\n"; 919 943 920 $id = isset( $_REQUEST['form'] ) ? absint($_REQUEST['form']) : '';921 if ( !empty($id) ) {922 global $wpdb;923 $table_name = "{$wpdb->prefix}sform_shortcodes";924 $forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE id != '{$id}' ORDER BY name ASC", 'ARRAY_A' );925 $forms_counter = count($forms);926 if ( $forms_counter > 1 ) {927 echo '<select name="moveto" id="moveto" class="unseen"><option value="">' . __( 'Select Form', 'simpleform-contact-form-submissions' ) . '</option>';928 foreach($forms as $form) { $form_id = $form['id']; $form_name = $form['name']; echo '<option value="'.$form_id.'">'.$form_name.'</option>'; }929 echo '</select>';930 }931 }932 933 submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );934 echo "\n";935 944 } 936 945 937 946 /** 938 947 * Add a date filter. … … 1049 1058 } 1050 1059 1051 echo '<input type="hidden" id="move2" name="move2" value="XX">'; 1060 $form_id = isset($_REQUEST['form']) ? absint($_REQUEST['form']) : ''; 1061 1062 echo '<input type="hidden" id="form" name="form" value="'.$form_id.'">'; 1063 echo '<input type="hidden" id="move2" name="move2" value="">'; 1052 1064 echo '<input id="my-post-query-submit" class="button" type="submit" value="'. __("Filter", "simpleform-contact-form-submissions") .'" name="" style="margin-right: 10px;">'; 1053 1065 } -
simpleform-contact-form-submissions/trunk/public/class-public.php
r2664815 r2701411 113 113 } 114 114 115 $submitter = $requester_name != '' ? $requester_name : __( 'Anonymous', 'simpleform ' );115 $submitter = $requester_name != '' ? $requester_name : __( 'Anonymous', 'simpleform-contact-form-submissions' ); 116 116 117 117 if ( ! empty($email) ) { $requester_email = $email; } … … 128 128 $listable = $data_storing == 'true' ? '1' : '0'; 129 129 130 // Add filter for moving 131 // (listable refers to move to form NOT to move from form) 132 133 // NEEDS TO FIX IF MOVING NEXT ENABLED 134 // FORM FROM storing disabled and FORM TO storing enabled, or vice versa 135 // Solution => show error message ad display option for save/unsave message data 130 // NEEDS TO FIX IF MOVING ENABLED ? 136 131 137 132 if ( $data_storing == 'true' ) { -
simpleform-contact-form-submissions/trunk/simpleform-submissions.php
r2664815 r2701411 5 5 * Plugin Name: SimpleForm Contact Form Submissions 6 6 * Description: You are afraid of losing important messages? This addon for SimpleForm saves data into the WordPress database, and allows you to easily manage the messages from the dashboard. 7 * Version: 2.0 7 * Version: 2.0.1 8 8 * Requires at least: 5.2 9 9 * Requires PHP: 5.6 … … 26 26 27 27 define( 'SIMPLEFORM_SUBMISSIONS_NAME', 'SimpleForm Contact Form Submissions' ); 28 define( 'SIMPLEFORM_SUBMISSIONS_VERSION', '2.0 ' );29 define( 'SIMPLEFORM_SUBMISSIONS_DB_VERSION', '2.0 ' );28 define( 'SIMPLEFORM_SUBMISSIONS_VERSION', '2.0.1' ); 29 define( 'SIMPLEFORM_SUBMISSIONS_DB_VERSION', '2.0.1' ); 30 30 define( 'SIMPLEFORM_SUBMISSIONS_BASENAME', plugin_basename( __FILE__ ) ); 31 31 define( 'SIMPLEFORM_SUBMISSIONS_PATH', plugin_dir_path( __FILE__ ) ); 32 define( 'SIMPLEFORM_VERSION_REQUIRED', '2.1. 1' );32 define( 'SIMPLEFORM_VERSION_REQUIRED', '2.1.5' ); 33 33 34 34 /** -
simpleform-contact-form-submissions/trunk/uninstall.php
r2664815 r2701411 23 23 $prefix = $wpdb->prefix; 24 24 $submissions_table = $prefix . 'sform_submissions'; 25 $wpdb->query("ALTER TABLE $submissions_table DROP COLUMN name, DROP COLUMN lastname, DROP COLUMN email, DROP COLUMN phone, DROP COLUMN subject, DROP COLUMN object, DROP COLUMN ip, DROP COLUMN status, DROP COLUMN trash_date, DROP COLUMN listable");25 $wpdb->query("ALTER TABLE $submissions_table DROP COLUMN name, DROP COLUMN lastname, DROP COLUMN email, DROP COLUMN phone, DROP COLUMN subject, DROP COLUMN object, DROP COLUMN ip, DROP COLUMN listable, DROP COLUMN movable"); 26 26 } 27 27 $addon_settings = array( 'data_storing' => $settings['data_storing'], 'ip_storing' => $settings['ip_storing'], 'data_columns' => $settings['data_columns'], 'counter' => $settings['counter'], 'deleting_messages' => $settings['deleting_messages'] ); … … 68 68 $prefix = $wpdb->prefix; 69 69 $submissions_table = $prefix . 'sform_submissions'; 70 $wpdb->query("ALTER TABLE $submissions_table DROP COLUMN name, DROP COLUMN lastname, DROP COLUMN email, DROP COLUMN phone, DROP COLUMN subject, DROP COLUMN object, DROP COLUMN ip, DROP COLUMN status, DROP COLUMN trash_date, DROP COLUMN listable");70 $wpdb->query("ALTER TABLE $submissions_table DROP COLUMN name, DROP COLUMN lastname, DROP COLUMN email, DROP COLUMN phone, DROP COLUMN subject, DROP COLUMN object, DROP COLUMN ip, DROP COLUMN listable, DROP COLUMN movable"); 71 71 } 72 72 $addon_settings = array( 'data_storing' => $settings['data_storing'], 'ip_storing' => $settings['ip_storing'], 'data_columns' => $settings['data_columns'], 'counter' => $settings['counter'], 'deleting_messages' => $settings['deleting_messages'] );
Note: See TracChangeset
for help on using the changeset viewer.