Changeset 2307785
- Timestamp:
- 05/19/2020 08:53:27 AM (6 years ago)
- Location:
- ws-contact-form
- Files:
-
- 8 added
- 7 edited
- 5 copied
-
assets/banner-1544x500.png (modified) (previous)
-
assets/banner-772x250.png (modified) (previous)
-
assets/icon-128x128.png (modified) (previous)
-
assets/icon-256x256.png (modified) (previous)
-
tags/1.3.6 (added)
-
tags/1.3.6/README.md (copied) (copied from ws-contact-form/trunk/README.md)
-
tags/1.3.6/admin (added)
-
tags/1.3.6/admin/index.php (added)
-
tags/1.3.6/admin/ws-contact-form-admin.php (added)
-
tags/1.3.6/css (added)
-
tags/1.3.6/css/style.css (added)
-
tags/1.3.6/index.php (copied) (copied from ws-contact-form/trunk/index.php)
-
tags/1.3.6/js (added)
-
tags/1.3.6/js/scripts.js (added)
-
tags/1.3.6/readme.txt (copied) (copied from ws-contact-form/trunk/readme.txt) (3 diffs)
-
tags/1.3.6/uninstall.php (copied) (copied from ws-contact-form/trunk/uninstall.php)
-
tags/1.3.6/ws-contact-form.php (copied) (copied from ws-contact-form/trunk/ws-contact-form.php) (8 diffs)
-
trunk/js/scripts.js (modified) (4 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/ws-contact-form.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ws-contact-form/tags/1.3.6/readme.txt
r2050592 r2307785 3 3 Tags: contact, contact form, contact form plugin, contact forms, contact us, email, feedback form, feedback forms, form, forms 4 4 Requires at least: 4.4 5 Tested up to: 5. 16 Stable tag: 1.3. 55 Tested up to: 5.4.1 6 Stable tag: 1.3.6 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 25 25 2. Activate the plugin through the 'Plugins' screen in WordPress 26 26 3. Fill settings fields on Wordpress Admin Settings > WS Contact Form page 27 4. Paste plugin shortcode to your post/page in Text view activated or in text widget27 4. Paste plugin shortcode to your post/page in Text view activated or into text widget 28 28 29 29 == Frequently Asked Questions == … … 38 38 39 39 == Changelog == 40 41 = 1.3.6 = 42 43 * Tested with Wordpress 5.4.1 44 * Updated version number 45 * Now possible to put to page/post multiple contact forms 40 46 41 47 = 1.3.5 = -
ws-contact-form/tags/1.3.6/ws-contact-form.php
r2050592 r2307785 1 1 <?php 2 2 /** 3 * Plugin Name: WS Contact Form4 * Plugin URI: https://www.silvermuru.ee/en/wordpress/plugins/ws-contact-form/5 * Description: Simple contact form for Wordpress6 * Version: 1.3.5 7 * Author: WebShark 8 * Author URI: https://www.webshark.ee/9 * Text Domain: ws-contact-form10 **/3 * Plugin Name: WS Contact Form 4 * Plugin URI: https://www.silvermuru.ee/en/wordpress/plugins/ws-contact-form/ 5 * Description: Simple contact form for Wordpress 6 * Version: 1.3.6 7 * Author: UusWeb.ee 8 * Author URI: https://www.wordpressi-kodulehe-tegemine.ee/ 9 * Text Domain: ws-contact-form 10 **/ 11 11 12 12 if ( !defined( 'ABSPATH' ) ) { … … 14 14 } 15 15 16 class WS_Contact_Form { 17 public function __construct(){18 add_action( 'plugins_loaded', array( $this, 'ws_contact_form_load_textdomain' ) );16 class WS_Contact_Form { 17 public function __construct(){ 18 add_action( 'plugins_loaded', array( $this, 'ws_contact_form_load_textdomain' ) ); 19 19 add_action( 'wp_footer', array( $this, 'ws_contact_form_sript' ) ); 20 20 add_action( 'wp_enqueue_scripts', array( $this, 'ws_contact_form_style' ) ); … … 24 24 add_filter( 'widget_text', 'do_shortcode' ); 25 25 } 26 26 27 27 public function ws_contact_form_load_textdomain() { 28 load_plugin_textdomain( 'ws-contact-form', false, plugin_basename( dirname( __FILE__ ) ) . '/languages/' ); 29 }30 28 load_plugin_textdomain( 'ws-contact-form', false, plugin_basename( dirname( __FILE__ ) ) . '/languages/' ); 29 } 30 31 31 public function ws_contact_form_shortcode( $atts, $content = null ){ 32 32 ob_start(); … … 34 34 echo '<h3> ' . get_option('wscontact-form-title-option') . '</h3>'; 35 35 } 36 37 $random_form_id = wp_rand(1, 1000); 36 38 ?> 37 <form id="ws_contact_form" class="ws-form-group" >39 <form id="ws_contact_form" class="ws-form-group" data-id="<?php echo $random_form_id; ?>"> 38 40 <div class="ws-hidden ws-message-response ws-message-successful" id="ws_contact_success"><?php _e( 'Message is sent successfully!', 'ws-contact-form' ); ?></div> 39 41 <div class="ws-hidden ws-message-response ws-message-error" id="ws_contact_error"><?php _e( 'There is problem with form', 'ws-contact-form' ); ?></div> … … 46 48 return ob_get_clean(); 47 49 } 48 50 49 51 public function ws_contact_form_sript() { 50 52 wp_register_script( 'ws-contact-form-script', plugin_dir_url(__FILE__) . 'js/scripts.js', array( 'jquery' ), false ); 51 53 wp_enqueue_script( 'ws-contact-form-script' ); 52 54 } 53 55 54 56 public function ws_contact_form_style() { 55 wp_register_style( 'ws-contact-form-style', plugin_dir_url(__FILE__) . 'css/style.css', true );57 wp_register_style( 'ws-contact-form-style', plugin_dir_url(__FILE__) . 'css/style.css', true ); 56 58 wp_enqueue_style( 'ws-contact-form-style' ); 57 }59 } 58 60 59 61 public function ws_contact_form_sendmail() … … 61 63 $ws_cf_sender_name = get_option('wscontact-form-sender-name-option'); 62 64 $ws_cf_sender_email = get_option('wscontact-form-sender-email-option'); 63 65 64 66 $email = $_POST['ws_contact_email']; 65 67 $headers = "From: " . $ws_cf_sender_name . " <" . get_option('wscontact-form-sender-email-option') . "> \r\n Reply-To: " . $email; 66 68 $message = $_POST['ws_contact_comment']; 67 69 $name = $_POST['ws_contact_name']; 68 70 69 71 function ws_email_valid($email) { 70 72 $email_pattern = "/^[a-z\d](\.?[a-z\d_\-]+)*@([a-z\d](\.?[a-z\d\-]+)*\.[a-z]{2,4})$/i"; … … 91 93 die(); 92 94 } 93 94 95 96 95 97 } 96 98 … … 99 101 $wpse_ws_contact_form_plugin_admin = new WS_Contact_Form_admin(); 100 102 } 101 103 102 104 $wpse_ws_contact_form_plugin = new WS_Contact_Form(); 103 105 ?> -
ws-contact-form/trunk/js/scripts.js
r1418779 r2307785 1 1 jQuery(function() { 2 jQuery(' #ws_send_form').click(function(){3 jQuery('.ws-message-response').slideUp();2 jQuery('.ws-form-group button').click(function(){ 3 var form = jQuery(this).parent('form').data('id'); 4 4 5 var name = jQuery('#ws_contact_name').val(); 6 var email = jQuery('#ws_contact_email').val(); 7 var comment = jQuery('#ws_contact_comment').val(); 8 9 var hasError_name = true; 10 if (name.length < 3) { 11 jQuery('#ws_contact_name').addClass('ws-warning-input'); 5 jQuery(this).closest('form.ws-form-group').children('.ws-message-response').slideUp(); 6 7 var name = jQuery('[data-id="' + form + '"]').children('input[name="ws_contact_name"]').val(); 8 var email = jQuery('[data-id="' + form + '"]').children('input[name="ws_contact_email"]').val(); 9 var comment = jQuery('[data-id="' + form + '"]').children('textarea[name="ws_contact_comment"]').val(); 10 11 var hasError_name = true; 12 if (name.length < 3) { 13 jQuery('[data-id="' + form + '"]').children('input[name="ws_contact_name"]').addClass('ws-warning-input'); 12 14 hasError_name = true; 13 15 } 14 16 else { 15 jQuery(' #ws_contact_name').removeClass('ws-warning-input');17 jQuery('[data-id="' + form + '"]').children('input[name="ws_contact_name"]').removeClass('ws-warning-input'); 16 18 hasError_name = false; 17 19 } 18 19 var hasError_email = true;20 if (!ws_validateEmail(email) || email.length < 3) {21 jQuery(' #ws_contact_email').addClass('ws-warning-input');20 21 var hasError_email = true; 22 if (!ws_validateEmail(email) || email.length < 3) { 23 jQuery('[data-id="' + form + '"]').children('input[name="ws_contact_email"]').addClass('ws-warning-input'); 22 24 hasError_email = true; 23 25 } 24 26 else { 25 jQuery(' #ws_contact_email').removeClass('ws-warning-input');27 jQuery('[data-id="' + form + '"]').children('input[name="ws_contact_email"]').removeClass('ws-warning-input'); 26 28 hasError_email = false; 27 29 } 28 29 var hasError_comment = true;30 31 var hasError_comment = true; 30 32 if (comment.length < 3) { 31 jQuery(' #ws_contact_comment').addClass('ws-warning-textarea');33 jQuery('[data-id="' + form + '"]').children('textarea[name="ws_contact_comment"]').addClass('ws-warning-textarea'); 32 34 hasError_comment = true; 33 35 } 34 36 else { 35 jQuery(' #ws_contact_comment').removeClass('ws-warning-textarea');37 jQuery('[data-id="' + form + '"]').children('textarea[name="ws_contact_comment"]').removeClass('ws-warning-textarea'); 36 38 hasError_comment = false; 37 39 } … … 41 43 jQuery.post('/wp-admin/admin-ajax.php', 42 44 { 43 action: 'contacthomepage', 44 ws_contact_name: name, 45 ws_contact_email: email, 45 action: 'contacthomepage', 46 ws_contact_name: name, 47 ws_contact_email: email, 46 48 ws_contact_comment: comment, 47 ws_ajax_send_form: 1, 49 ws_ajax_send_form: 1, 48 50 ws_chack: 'fg' + 'yu' 49 51 }, 50 52 function(data){ 51 53 if(data == 'OK'){ 52 jQuery(' input, textarea').val('');53 jQuery(' #ws_contact_success').slideDown();54 jQuery('[data-id="' + form + '"]').children('input, textarea').val(''); 55 jQuery('[data-id="' + form + '"]').children('.ws-message-successful').slideDown(); 54 56 } else { 55 jQuery(' #ws_contact_error').slideDown();57 jQuery('[data-id="' + form + '"]').children('.ws-message-error').slideDown(); 56 58 } 57 59 } … … 60 62 else 61 63 { 62 jQuery(' #ws_contact_error').slideDown();64 jQuery('[data-id="' + form + '"]').children('.ws-message-error').slideDown(); 63 65 } 64 66 return false; … … 70 72 var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; 71 73 if ( !emailReg.test($email) ) { 72 return false;74 return false; 73 75 } else { 74 return true;76 return true; 75 77 } 76 78 } -
ws-contact-form/trunk/readme.txt
r2050592 r2307785 3 3 Tags: contact, contact form, contact form plugin, contact forms, contact us, email, feedback form, feedback forms, form, forms 4 4 Requires at least: 4.4 5 Tested up to: 5. 16 Stable tag: 1.3. 55 Tested up to: 5.4.1 6 Stable tag: 1.3.6 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 25 25 2. Activate the plugin through the 'Plugins' screen in WordPress 26 26 3. Fill settings fields on Wordpress Admin Settings > WS Contact Form page 27 4. Paste plugin shortcode to your post/page in Text view activated or in text widget27 4. Paste plugin shortcode to your post/page in Text view activated or into text widget 28 28 29 29 == Frequently Asked Questions == … … 38 38 39 39 == Changelog == 40 41 = 1.3.6 = 42 43 * Tested with Wordpress 5.4.1 44 * Updated version number 45 * Now possible to put to page/post multiple contact forms 40 46 41 47 = 1.3.5 = -
ws-contact-form/trunk/ws-contact-form.php
r2050592 r2307785 1 1 <?php 2 2 /** 3 * Plugin Name: WS Contact Form4 * Plugin URI: https://www.silvermuru.ee/en/wordpress/plugins/ws-contact-form/5 * Description: Simple contact form for Wordpress6 * Version: 1.3.5 7 * Author: WebShark 8 * Author URI: https://www.webshark.ee/9 * Text Domain: ws-contact-form10 **/3 * Plugin Name: WS Contact Form 4 * Plugin URI: https://www.silvermuru.ee/en/wordpress/plugins/ws-contact-form/ 5 * Description: Simple contact form for Wordpress 6 * Version: 1.3.6 7 * Author: UusWeb.ee 8 * Author URI: https://www.wordpressi-kodulehe-tegemine.ee/ 9 * Text Domain: ws-contact-form 10 **/ 11 11 12 12 if ( !defined( 'ABSPATH' ) ) { … … 14 14 } 15 15 16 class WS_Contact_Form { 17 public function __construct(){18 add_action( 'plugins_loaded', array( $this, 'ws_contact_form_load_textdomain' ) );16 class WS_Contact_Form { 17 public function __construct(){ 18 add_action( 'plugins_loaded', array( $this, 'ws_contact_form_load_textdomain' ) ); 19 19 add_action( 'wp_footer', array( $this, 'ws_contact_form_sript' ) ); 20 20 add_action( 'wp_enqueue_scripts', array( $this, 'ws_contact_form_style' ) ); … … 24 24 add_filter( 'widget_text', 'do_shortcode' ); 25 25 } 26 26 27 27 public function ws_contact_form_load_textdomain() { 28 load_plugin_textdomain( 'ws-contact-form', false, plugin_basename( dirname( __FILE__ ) ) . '/languages/' ); 29 }30 28 load_plugin_textdomain( 'ws-contact-form', false, plugin_basename( dirname( __FILE__ ) ) . '/languages/' ); 29 } 30 31 31 public function ws_contact_form_shortcode( $atts, $content = null ){ 32 32 ob_start(); … … 34 34 echo '<h3> ' . get_option('wscontact-form-title-option') . '</h3>'; 35 35 } 36 37 $random_form_id = wp_rand(1, 1000); 36 38 ?> 37 <form id="ws_contact_form" class="ws-form-group" >39 <form id="ws_contact_form" class="ws-form-group" data-id="<?php echo $random_form_id; ?>"> 38 40 <div class="ws-hidden ws-message-response ws-message-successful" id="ws_contact_success"><?php _e( 'Message is sent successfully!', 'ws-contact-form' ); ?></div> 39 41 <div class="ws-hidden ws-message-response ws-message-error" id="ws_contact_error"><?php _e( 'There is problem with form', 'ws-contact-form' ); ?></div> … … 46 48 return ob_get_clean(); 47 49 } 48 50 49 51 public function ws_contact_form_sript() { 50 52 wp_register_script( 'ws-contact-form-script', plugin_dir_url(__FILE__) . 'js/scripts.js', array( 'jquery' ), false ); 51 53 wp_enqueue_script( 'ws-contact-form-script' ); 52 54 } 53 55 54 56 public function ws_contact_form_style() { 55 wp_register_style( 'ws-contact-form-style', plugin_dir_url(__FILE__) . 'css/style.css', true );57 wp_register_style( 'ws-contact-form-style', plugin_dir_url(__FILE__) . 'css/style.css', true ); 56 58 wp_enqueue_style( 'ws-contact-form-style' ); 57 }59 } 58 60 59 61 public function ws_contact_form_sendmail() … … 61 63 $ws_cf_sender_name = get_option('wscontact-form-sender-name-option'); 62 64 $ws_cf_sender_email = get_option('wscontact-form-sender-email-option'); 63 65 64 66 $email = $_POST['ws_contact_email']; 65 67 $headers = "From: " . $ws_cf_sender_name . " <" . get_option('wscontact-form-sender-email-option') . "> \r\n Reply-To: " . $email; 66 68 $message = $_POST['ws_contact_comment']; 67 69 $name = $_POST['ws_contact_name']; 68 70 69 71 function ws_email_valid($email) { 70 72 $email_pattern = "/^[a-z\d](\.?[a-z\d_\-]+)*@([a-z\d](\.?[a-z\d\-]+)*\.[a-z]{2,4})$/i"; … … 91 93 die(); 92 94 } 93 94 95 96 95 97 } 96 98 … … 99 101 $wpse_ws_contact_form_plugin_admin = new WS_Contact_Form_admin(); 100 102 } 101 103 102 104 $wpse_ws_contact_form_plugin = new WS_Contact_Form(); 103 105 ?>
Note: See TracChangeset
for help on using the changeset viewer.