Wp Ninja Form Addon for email modification.

Ninja Forms is a free WordPress plugin or easy tool for creating forms. It is a powerful tool through which you can create forms via drag and drop feature. In this article we are creating a short code for “All Fields” without showing colon “:” in email.

Basically ninja form fixed the colon “:” in their mail template for “All Fields” short code.

Copy below code and paste in theme’s function.php file.

function my_nf_all_fields_shortcode( $atts, $content = '' ) {
global $ninja_forms_fields, $ninja_forms_processing;

if ( ! isset ( $ninja_forms_processing ) )
return false;

$html = isset ( $atts['html'] ) ? $atts['html'] : 1;

if ( 1 == $html ) {
// Generate our "all fields" table for use as a JS var.
$field_list = '<table><tbody>';
} else {
$field_list = '';
}
foreach ( $ninja_forms_processing->get_all_fields() as $field_id => $user_value ) {
if ( ! $user_value )
continue;

$field = $ninja_forms_processing->get_field_settings( $field_id );
$type = $field['type'];
if ( ! isset ( $ninja_forms_fields[ $type ] ) || ! $ninja_forms_fields[ $type ]['process_field'] )
continue;

$value = apply_filters( 'nf_all_fields_field_value', ninja_forms_field_shortcode( array( 'id' => $field_id ) ), $field_id );

if( isset( $field[ 'data' ][ 'admin_label' ] ) && $field[ 'data' ][ 'admin_label' ] ){
$label = $field[ 'data' ][ 'admin_label' ];
} else {
$label = $field['data']['label'];
}
$label = strip_tags( apply_filters( 'nf_all_fields_field_label', $label, $field_id ) );

if ( 1 == $html ) {
$field_list .= '<tr id="ninja_forms_field_' . $field_id . '"><td>' . $label .'</td><td>' . $value . '</td></tr>';

 

} else {
$field_list .= $label . ' - ' . $value . "\r\n";
}
}

if ( 1 == $html )
$field_list .= '</tbody></table>';

return apply_filters( 'nf_all_fields_table', $field_list, $ninja_forms_processing->get_form_ID() );

}

add_shortcode( 'ninjaformsallfields', 'my_nf_all_fields_shortcode' );

Code Where we have have made changes.


$field_list .= '<tr id="ninja_forms_field_' . $field_id . '"><td>' . $label .'</td><td>' . $value . '</td></tr>';


Shortcode

[ninjaformsallfields]

Use above short code in “Email & Action” tab of Ninja Forms.

Flamingo Address Book WordPress Plugin

Flamingo is a free WordPress plugin created to be a total CRM package. With this version, you can manage your contact list and messages submitted via contact form plugins. It has not yet matured, but we are enhancing it rapidly. I have recently used it in our website. It store complete information submitted by the visitor as well as additional information like ip address, browser, url etc. Important thing it also support Contact Form 7.

Woocommerce Free Gift Coupons Plugin

Give away a free item to any customer with the coupon code

With WooCommerce Free Gift Coupons, you can give away a free item(s) to any customer with the correct code. This can be to reward a specific customer or to encourage customers to spend more in order to be eligble for the bonus item.

Start rewarding customers

WooCommerce Free Gift Coupons works very similarly to the other coupon types. Free Gift Coupons allow all the same Usage Restriction and Usage Limits as other coupon types, such as by email address, minimum cart total, etc. However, instead of a discount, the customer is rewarded with a free gift item.

The coupon is redeemed exactly like other coupons. When a coupon is applied successfully, the free gift is automatically added to the cart and the customer may continue shopping or checkout normally.

=== WooCommerce Free Gift Coupons ===

2015.12.08 – version 1.0.9
* Fix: class $version variable
* Tweak: Update WordPress tested against 4.4
* Add: GPL3 license

2015.11.09 – version 1.0.8
* Fix: don’t squash other free shipping coupons

2015.10.13 – version 1.0.7
* Fix: make free shipping specific to free gift only. To use: Free Shipping must be enabled and set to “requires a valid free shipping coupon” if you don’t wish to make the entire order’s shipping free
* New: Add compatibility for adding Subscription as free gift

2015.09.25 – version 1.0.6
* Fix: allow free shipping with free gift

2015.05.06 – version 1.0.5
* Tweak: code improvements in coupon options output

2015.02.03 – version 1.0.4
* WooCommerce 2.3-compatible: switch to Select2

2014.11.12 – version 1.0.3
* Fix “non-static method WC_Free_Gift_Coupons::add_order_item_meta() should not be called statically”

2014.09.11 – version 1.0.2
* Fix “Sorry, this product cannot be purchased.” bug when adding points discount with Points and Rewards extension

2014.07.05 – version 1.0.1
* Fix: wc_add_error() to wc_add_notice()
* Fix: add variation attributes to cart/order if free gift is variation

2014.05.27 – version 1.0
* Initial release

2013.10.31 version 1.0 beta
* Beta release

Sales Page:

http://www.woothemes.com/products/free-gift-coupons/

Download:

Download Now

Run a function before sending email in contact form 7

Contact Form 7 is one of the most popular form management plugins available on WordPress repository. Which provide user friendly interface for managing form and email body. We can also manage addition settings like success or failure message form redirection etc in plugin settings.

We have on_sent_ok and wpcf7_before_send_mail which allow us to run our own custom commands before and after form submission. on_sent_ok is a JavaScript action hook. By using this hook, you can specify a JavaScript code that you wish to run after the form is successfully submitted. You will find the Additional Settings field at the bottom of the contact form page. Simply insert the following line into it

on_sent_ok: "location = 'http://example.com/';" 

I recently needed to create a function that needed to send sms to website owner for calling their executive to the visitor using Contact Form 7.

The code below creates a similar custom function before a Contact form 7 form is submitted. We need to add this code in theme’s functions.php file, adding the wpcf7_before_send_mail hook as an add_action call.

add_action('wpcf7_before_send_mail', 'my_custom_function');
 
function my_custom_function($cf7) {
    //Put PHP here
}

One thing to remember if you try and use echo to try and show any output, this will not be displayed because Contact Form 7 is designed to work using AJAX commands that execute PHP.

If you want to use form field data, we can grab this using regular $_POST variables as below:

	
add_action( 'wpcf7_before_send_mail', 'my_custom_function' );
 
function my_custom_function($cf7) {
   $output = "";
   $output .= "Name: " . $_POST['name'];
   $output .= "Email: " . $_POST['email'];
   $output .= "Message: " . $_POST['message'];
 
 file_put_contents("putoutput.txt", $output);
}

In this example, I have used file_put_contents php function which save form submitted data as a regular text in text file. The file is saved in the WordPress site root directory.

WordPress Plugin for Page Redirection

Hi guys some time you need WordPress plugin for pages redirection or direction custom url to any url in your wordpress project. In this article I am suggesting you a a best wordpress plugin.”Safe Redirect Manager” is a free plugin available on wordpress repository. Safe Redirect Manager is a HTTP redirect manager for WordPress. An easy-to-use UI allows you to redirect locations to new URL’s with the HTTP status codes of your choosing. The plugin uses the wp_safe_redirect function which only allows redirects to whitelisted hosts for security purposes. The plugin automatically handles whitelisting hosts for you. This plugin works great with Multisite.

Here you can download it. Click Here

How to increase maximum upload and PHP Memory limit in wordpress

WordPress has a modest limit for uploading images, videos, and other files. It is a similar story for your PHP memory limit. PHP memory limit helps you run plugins and scripts. If you run a website full of content sometime this could be a big problem when php limits exhausted. You may receive “Fatal error: Allowed memory size of 12345678 bytes exhausted” error.

In this article, we will show you how to increase the maximum file upload size in wordPress and increase php memory limit.

Theme Functions File:

There are cases where we have seen that just by adding the following code in the theme function file, you can increase the upload size in wordpress:

@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );
@ini_set( 'WP_MEMORY_LIMIT', '96M' );

PHP.ini File:
In case of shared host you will not see php.ini file. Create php.ini file and add following code. Upload it in the root folder of the website

upload_max_filesize = 100M
post_max_size = 200M
memory_limit = 300M
file_uploads = On
max_execution_time = 180

htaccess File:
You have another option for increasing uploading size and increasing memory limit through htaccess file. Add following code in your htaccess file and upload root folder of the website.

php_value upload_max_filesize 64M
php_value post_max_size 200M
php_value memory_limit 300M
php_value max_execution_time 180
php_value max_input_time 180

wp-config.php File:
Try to editing wp-config file of the wordpress add the following to the very top of the file and save the file.

define( 'upload_max_size' , '64M' );
define( 'post_max_size', '64M');
define( 'max_execution_time', '300' );
define( 'WP_MEMORY_LIMIT', '96M' );

Add google reCaptacha to contact form 7

Hi friends, Google has an improved, user-friendly Captcha system. In Which it asked for checked a checkbox  for confirming “I’m not robot”. In WordPress, Contact Form 7 is the most popular plugin for creating contact form. Latest version of Contact Form 7 provide best way for antispam protection.

In this tutorial, I’m going show you how to integrate reCaptcha to Contact Form 7 in your WordPress Website.

Step 1. Install the Contact Form 7 plugin

  • Login to your WordPress site.
  • Go to Plugins > Add new and search for “Contact Form 7”.
  • Click “Install Now” and activate the plugin.

Step 2. Create reCaptcha public and secret keys

google-recaptcha

Step 3. Integrate reCaptcha with Contact Form 7

  • Go to the admin menu Contact > Integration.
  • Find reCAPTCHA panel and click Configure Keys.
  • Copy the site key and secret key into the fields and save them.

Step 4. Embed the reCaptcha shortcode into contact form

  • Go to Contact > Contact forms > Your form.
  • Paste below shortcode into form box to render the reCaptcha field.
[recaptcha]

End Result

contact-form-7

Creating Custom Database Tables in WordPress

I was working on a project where I need to create a database table for my WordPress plugin. Generally we use mysql_query($sqlquery) for executing query in our PHP project. But in case of wordpress it’s bit different. WordPress provide different method for it.
Suppose I am using following query:

CREATE TABLE Emp (Empid BIGINT(20) NOT NULL AUTO_INCREMENT, Name VARCHAR(255) NOT NULL,Email VARCHAR(255) NOT NULL,Phone VARCHAR(255) NOT NULL, PRIMARY KEY  (Empid) ) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

In above query I am creating a table named “Emp” with “Empid”,”Name”,”Email”,”Phone” fields.
Now we want some PHP method for creating table in database. See below:

$field_sql="CREATE TABLE Emp (Empid BIGINT(20) NOT NULL AUTO_INCREMENT, Name VARCHAR(255) NOT NULL,Email VARCHAR(255) NOT NULL,Phone VARCHAR(255) NOT NULL, PRIMARY KEY  (Empid) ) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci";

require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta($field_sql);

dbDelta()

dbDelta ( string|array $queries = '', bool $execute = true )

dbDelta is a wordpress function which Modifies the database based on specified SQL statements. It is used for creating new tables and updating existing tables to a new structure.

For using database prefix and charset you need to add some changes in your mysql query.

For Table prefix

 global $wpdb;
 $table_name = $wpdb->prefix . 'EMP';

For Charset

global $wpdb;
$charset_collate = $wpdb->get_charset_collate();

Now final query is

 global $wpdb;
 $table_name = $wpdb->prefix . 'EMP';
 $charset_collate = $wpdb->get_charset_collate();

 $field_sql="CREATE TABLE $table_name (Empid BIGINT(20) NOT NULL AUTO_INCREMENT, Name VARCHAR(255) NOT NULL,Email VARCHAR(255) NOT NULL,Phone VARCHAR(255) NOT NULL, PRIMARY KEY  (Empid) ) $charset_collate;";

require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta($field_sql);

EMI Calculator with monthly breakup free wp plugin

Some time you need wordpress plugin for calculating EMI  with chart emi-breakups for your website.”EMI Calculator”  Plugin allow you to add EMI (Equated Monthly Installment) Calculator at your website. This plugin is free and available on wordpress repository.

Uses:

This plugin have two option first Option show EMI calculator in side bar with graphical representation. Second option show EMI calculator in post along with Monthly EMI breakup and Detailed description of you EMI paid.

Short code:

[emicalc format=”full”][/emicalc] OR [emicalc format=”sidebar”][/emicalc]

to place calculator in post.

You can download it from below Url.

Download Now

 

Source: WordPress.org