This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Plugin Name: WooCommerce Registration Custom Fields | |
* Plugin URI: https://vndeveloper.com | |
* Description: Add Fist Name, Last Name, Phone, Company, Role fields as well as Privacy Policy and Terms of Use links into WooCommerce Registration form. | |
* Version: 1.0.0 | |
* Author: VNDeveloper | |
* Author URI: https://vndeveloper.com | |
* Requires at least: 4.1 | |
* Tested up to: 4.7 | |
* Text Domain: vndev-wooc-signup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* wooc_reCAPTCHA */ | |
// Add reCAPTCHA to WooCommerce Signup Form | |
function wooc_reCAPTCHA(){ | |
?> | |
<script src='https://www.google.com/recaptcha/api.js' defer'></script> | |
<label>ARE YOU HUMAN?</label> | |
<div class="g-recaptcha" data-sitekey="[reCAPTCHA Site Key]"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name vndeveloper.com www.vndeveloper.com; | |
root /var/www/vndeveloper.com/html; | |
index index.html index.htm index.php; | |
location / { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// outputs the username that owns the running php/httpd process | |
// (on a system with the "whoami" executable in the path) | |
echo exec('whoami'); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Keep your OS up to date | |
yum update -y | |
# Install basic CentOS packages | |
yum install wget curl unzip gcc-c++ pcre-devel zlib-devel | |
# Never use ROOT user, just create another user with ROOT privileges | |
adduser www-user | |
passwd www-user | |
gpasswd -a www-user wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List available options | |
timedatectl list-timezones | |
# Set appropriate timezone | |
sudo timedatectl set-timezone America/Los_Angeles | |
sudo timedatectl | |
sudo yum install ntp -y | |
sudo systemctl start ntpd | |
sudo systemctl enable ntpd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo systemctl start firewalld | |
sudo firewall-cmd --permanent --add-service=ssh | |
sudo firewall-cmd --permanent --add-service=http | |
sudo firewall-cmd --permanent --add-service=https | |
sudo firewall-cmd --reload | |
sudo systemctl enable firewalld | |
#To see any additional services that you can enable by name, type: | |
sudo firewall-cmd --get-services |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Save the extra register fields. */ | |
function wooc_save_extra_register_fields( $customer_id ) { | |
if ( isset( $_POST['billing_first_name'] ) ) { | |
// WordPress default first name field. | |
update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) ); | |
// WooCommerce billing first name. | |
update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST['billing_first_name'] ) ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wooc_extra_register_fields() { | |
?> | |
<p class="form-row form-row-first"> | |
<label for="reg_billing_first_name"><?php _e( 'First name', 'woocommerce' ); ?> <span class="required">*</span></label> | |
<input type="text" class="input-text" name="billing_first_name" id="reg_billing_first_name" value="<?php if ( ! empty( $_POST['billing_first_name'] ) ) esc_attr_e( $_POST['billing_first_name'] ); ?>" /> | |
</p> | |
<p class="form-row form-row-last"> | |
<label for="reg_billing_last_name"><?php _e( 'Last name', 'woocommerce' ); ?> <span class="required">*</span></label> |
NewerOlder