WordPress with NUXT ( VueJS )

NUXT

Nuxt is a framework for creating Universal Vue.js Applications and in many ways it feels like working on a WordPress theme. It has a folder for your pages/templates, a hook API, support for plugins and components (or template parts if your thinking WordPress). Nuxt follows a philosophy of convention over configuration, drop Vue components in their respective folders and Nuxt will bind everything together.

Create an empty directory

> mkdir [project-name]
> cd [project-name]

The project needs a package.json file to specify how to start nuxt:

{
  "name": "my-app",
  "scripts": {
    "dev": "nuxt"
  }
}

scripts will launch Nuxt.js via npm run dev

 

Once the package.json has been created, add nuxt to the project via npm:

 

npm install --save nuxt

 

WP-API

To use all features of node-wpapi we need to add wp-nuxt dependency using npm to your project.

npm install wp-nuxt

 

You can use the API of WP-API using the injected ‘app.$wp’. (s. example)

 

<script>
export default {
  async asyncData ({ app, store, params }) {
    return { articles: await app.$wp.posts().perPage(10) }
  }
}
</script>

Digital Marketing Techniques

1. SEO

As we talk about Digital Marketing techniques, SEO always comes first. Let us just shift ourselves back in 2010, when aggressive off page SEO was all we need to rank high. But with the strict algorithms updated by search engines now and then, the whole methodology has been changed in SEO.

  • CONTENT of the website has become a major factor to upgrade your SEO methodology. The higher the content quality, higher the ranking we can predict.
  • BLOGS has been ranking way higher than other pages showing how much the major search engines like Google and Bing loves providing knowledge sharing content with the users.
  • KEYWORD DENSITY still works in your favor but the stuffing of keywords don’t. You see, the robots that crawl our website are smarter now and completely understands when the sentence is making sense just to rank the quality of the content.
  • INTERNAL AND EXTERNAL LINKS never dimmed its shine. It’s just that we shall be more cautious when providing any link because the robots as mentioned are smarter and wants 100% relevancy to the page and link provided.
  • MOBILE USABILITY Almost everyone has a mobile-friendly website but is it working fine?? For this, we will update in our next blog about the new update by Google “Mobile First Index”

 

2. SOCIAL MEDIA (SMO-SMM)

It is now hard to reach more on Facebook organically. Not only Facebook, almost all the social media channels have been restricting the organic reach leaving no other option than to go for a Paid Marketing. In paid ads, specifically, Video Ads are most engaging. Also, new types of video ads like, In-stream ads is a clear sign of how effective these ads are on Social Media.

 

3. PPC- Google AdWords

Well, PPC (Pay per click ads) does include more than AdWords but let us restrict it for now because if its popularity. AdWords was really easy back in 2010, all thanks to less competition. But now almost everyone is using AdWords.

According to Google, “99% of our top 1,000 clients are now running campaigns on the Google Display Network and YouTube.”

With this, even paid results are also having competition as shown below:

Tip: Only right choice of keywords, perfectly optimized campaign and wisely chosen daily budget will help you run a successful AdWords Campaign.

 

4. Email Marketing:

The usage of Email Marketing has shown small decline but the conversion rate is still undeniably high. Where the strategies are bit modified when compared with earlier.

Those are as follows:

  • Artificial Intelligence in emails is driving everyone’s attention and Adobe has invested billions of dollars in it.
  • Just like mobile-friendly websites, mobile-friendly emails are high in focus
  • The text mails are given equal importance with HTML
  • Interactive emails including gifs and timer are more engaging
  • Transparency in promotional emails are most recommended now

 

5. Marketing Automation:

Every work is being done in an automatic manner. So, even the digital marketing work is greatly assisted by automatic back support and more enhanced form of CRM software with artificial intelligence called as Marketing Automation. This is booming the Digital Marketing industry to great extent.

It covers right from where the lead is captured, following up the leads based on their behavior, analyzing their wants and offering them a deal they can’t refuse, and then closing the deal. The workflow of marketing automation is something that will be regarded as the major skill in Digital Marketing.

Integrating WooCommerce with an Order Management System

If a system has a ready API, you could integrate it with the WooCommerce plugin. In this article, we’ll explore how to integrate an external order management system with WooCommerce

/* after an order has been processed, we will use the ‘woocommerce_thankyou’ hook, to add our function, to send the data */
add_action('woocommerce_thankyou', 'wdm_send_order_to_ext');
function wdm_send_order_to_ext( $order_id ){
// get order object and order details
$order = new WC_Order( $order_id );
$email = $order->billing_email;
$phone = $order->billing_phone;
$shipping_type = $order->get_shipping_method();
$shipping_cost = $order->get_total_shipping();

// set the address fields
$user_id = $order->user_id;
$address_fields = array('country',
'title',
'first_name',
'last_name',
'company',
'address_1',
'address_2',
'address_3',
'address_4',
'city',
'state',
'postcode');

$address = array();
if(is_array($address_fields)){
foreach($address_fields as $field){
$address['billing_'.$field] = get_user_meta( $user_id, 'billing_'.$field, true );
$address['shipping_'.$field] = get_user_meta( $user_id, 'shipping_'.$field, true );
}
}

// get coupon information (if applicable)
$cps = array();
$cps = $order->get_items( 'coupon' );

$coupon = array();
foreach($cps as $cp){
// get coupon titles (and additional details if accepted by the API)
$coupon[] = $cp['name'];
}

// get product details
$items = $order->get_items();

$item_name = array();
$item_qty = array();
$item_price = array();
$item_sku = array();

foreach( $items as $key => $item){
$item_name[] = $item['name'];
$item_qty[] = $item['qty'];
$item_price[] = $item['line_total'];

$item_id = $item['product_id'];
$product = new WC_Product($item_id);
$item_sku[] = $product->get_sku();
}

/* for online payments, send across the transaction ID/key. If the payment is handled offline, you could send across the order key instead */
$transaction_key = get_post_meta( $order_id, '_transaction_id', true );
$transaction_key = empty($transaction_key) ? $_GET['key'] : $transaction_key;

// set the username and password
$api_username = 'testuser';
$api_password = 'testpass';

// to test out the API, set $api_mode as ‘sandbox’
$api_mode = 'sandbox';
if($api_mode == 'sandbox'){
// sandbox URL example
$endpoint = "http://sandbox.example.com/";
}
else{
// production URL example
$endpoint = "http://example.com/";
}

// setup the data which has to be sent
$data = array(
'apiuser' => $api_username,
'apipass' => $api_password,
'customer_email' => $email,
'customer_phone' => $phone,
'bill_firstname' => $address['billing_first_name'],
'bill_surname' => $address['billing_last_name'],
'bill_address1' => $address['billing_address_1'],
'bill_address2' => $address['billing_address_2'],
'bill_city' => $address['billing_city'],
'bill_state' => $address['billing_state'],
'bill_zip' => $address['billing_postcode'],
'ship_firstname' => $address['shipping_first_name'],
'ship_surname' => $address['shipping_last_name'],
'ship_address1' => $address['shipping_address_1'],
'ship_address2' => $address['shipping_address_2'],
'ship_city' => $address['shipping_city'],
'ship_state' => $address['shipping_state'],
'ship_zip' => $address['shipping_postcode'],
'shipping_type' => $shipping_type,
'shipping_cost' => $shipping_cost,
'item_sku' => implode(',', $item_sku),
'item_price' => implode(',', $item_price),
'quantity' => implode(',', $item_qty),
'transaction_key' => $transaction_key,
'coupon_code' => implode( ",", $coupon )
);

// send API request via cURL
$ch = curl_init();

/* set the complete URL, to process the order on the external system. Let’s consider is the URL, which invokes the API */
curl_setopt($ch, CURLOPT_URL, $endpoint."buyitem.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec ($ch);

curl_close ($ch);

// the handle response
if (strpos($response,'ERROR') !== false) {
print_r($response);
} else {

// success
}
}

How to Install PHP 7.2 on Ubuntu 16.04, 18.04…

How to Install PHP 7.2 on Ubuntu 16.04, 18.04…

PHP 7.2 is the latest stable version of PHP and has many new features, improvements, and bug fixes. You should definitely use it if you want a better, faster website/application.

 

Update Ubuntu

sudo apt-get update && apt-get upgrade

Add the PHP repository

You can use a third-party repository to install the latest version of PHP. We’ll use the repository by Ondřej Surý.

First, make sure you have the following package installed so you can add repositories:

sudo apt-get install python-software-properties

Next, add the PHP repository from Ondřej:

sudo add-apt-repository ppa:ondrej/php

And finally, update your package list:

sudo apt-get update

 

Install PHP 7.2

After you’ve added the repository, you can install PHP 7.2 with the following command:

sudo apt-get install php7.2

This command will install additional packages:

  • libapache2-mod-php7.2
  • libargon2-0
  • libsodium23
  • libssl1.1
  • php7.2-cli
  • php7.2-common
  • php7.2-json
  • php7.2-opcache
  • php7.2-readline

And that’s it. To check if PHP 7.2 is installed on your server, run the following command:

php -v

php-v

7 rules for successful WhatsApp newsletters

Using WhatsApp properly for companies: What needs to be taken into account when sending WhatsApp messages to customers or readers – with respect to the law and to the content? How you as a company can use WhatsApp properly without infringing the usage policies and without scaring away your subscribers is explained in this article.

 

WhatsApp for companies: a world of possibilities

 

Worldwide over 1 billion people use WhatsApp. More than every second smartphone user in Austria and Germany is registered with the popular instant messenger. WhatsApp is now even preferred to Facebook for communication. This naturally makes WhatsApp an attractive platform for companies to reach customers in person and above all to address a mobile and young target group.

So it’s no surprise that the app has recently been utilized increasingly in the business sector. Pioneers here are newspapers and online media which use the messenger service to extend their regular range, to inform readers quickly and thus to establish a stronger tie between the readers and the publication. But the potential of WhatsApp is by no means limited to the media sector. Depending on the communication behavior of the customers, practically every company or organization can become a WhatsApp user.

WhatsApp can be employed in several ways as an information channel:

  • As a newsletter
    Regularly or occasionally (e.g. discounts, events)
  • As a service and support channel
    For questions, complaints or other problems
  • As a group chat platform
    For prize competitions (e.g. chat with a celebrity)

 

 

Using a WhatsApp newsletter correctly

The biggest benefit of WhatsApp for companies is that they can reach their target group within a few minutes. That is not always possible with other communication systems. Almost all WhatsApp messages are opened, generally, just seconds after they have been received. Recipients who are interested are immediately made aware of current topics, and the tie to the user is strengthened significantly. At the same time, the user senses a human being behind the message, which makes the application considerably more personal and can lead to a dialogue.

However, as WhatsApp still remains a very private medium, a few rules must be observed when sending WhatsApp newsletters, otherwise, the hard-won users will quickly be lost again!

 

7 useful tips for companies on WhatsApp

To avoid overtaxing or scaring away customers, it is essential that they are addressed sensitively and above all in a personal manner for WhatsApp newsletters to succeed. These eight tips ensure that nothing can really go wrong for companies on WhatsApp:

 

1. Obtain the recipient’s consent

A WhatsApp newsletter, just like an email newsletter, is electronic mail. It is subject to the same European legislation: the recipient must consent to the dispatch of messages. This is generally done by the subscriber saving a company’s number in his or her own contacts and by sending an opt-in message to the company (e.g. “Start”) by means of a WhatsApp message or an online form. It is best to save these registrations as screenshots.

The right of withdrawal must also be pointed out: the user must be informed, at least when registering and ideally with every WhatsApp newsletter, that they can cancel their subscription at any time – by means of an unsubscribe message (e.g. “Stop”) and by deleting a company’s number from their own contacts.

 

2. Short and sweet

It is important to keep the content of your WhatsApp messages as short and simple as possible. The subscribers don’t want to read through texts on the smartphone which are many lines long – WhatsApp is the wrong medium for that. It’s best to package the information to be transferred in a concise format with a couple of web links, e.g.:

  • Introductory sentence
  • Headlines and associated links
  • Concluding sentence

Offer the users titbits, and only serve the “main meal” via the links you send. Feel free to use emojis as well.

 

3. Ensure optimum frequency

Customers respond particularly sensitively on WhatsApp to the number of messages they are sent. The following therefore applies: don’t overdo things! It’s important that your customers aren’t flooded with countless messages because too many messages will soon get on their nerves and become bothersome. There is a high probability that this will lead to your customers canceling their subscription to your service.

Providers who send two to three messages a day have the lowest subscription cancellation rates, largely below 10% with this ideal number of messages. As the frequency increases so too do the number of canceled subscriptions. Once the ideal rhythm is found, the click rate also increases. Here, too, the following applies: the lower the number of messages, the higher the click rates. In tests, the highest number of clicks was achieved when two to three messages were sent per day. Naturally, you must ascertain the optimal frequency for your company and your target group yourself.

 

4. Package advertising on WhatsApp skilfully

Basically, every provider of a WhatsApp service must bear the responsibility for the content of their messages themselves. The usage guidelines of WhatsApp allow commercial use by companies. In the original wording“We will allow you and third parties, like businesses, to communicate with each other using WhatsApp, such as through order, transaction, and appointment information, delivery and shipping notifications, product and service updates, and marketing.”

Now it is no secret that the consumers of pure advertising messages feel increasingly annoyed. A “STOP” message on WhatsApp is enough – and the user has already been removed from your service. We, therefore, recommend using WhatsApp primarily as an information and service channel rather than as an advertising channel! For example, do not just link to new products, but instead, for example, to a blog article about these products or to use additional information.

 

5. Select the right topics

When using WhatsApp services, you should always only send relevant messages to which the recipient has really subscribed. Here it is particularly important that the topic of the message also corresponds to the topic which the user expects. If, for example, a customer subscribes to the ticker of a sporting event, you should definitely not pester them with messages from the field of politics.

Otherwise, your customer will soon cancel their subscription to the WhatsApp service and possibly obtain an unfavorable impression of your company. It’s best if you show users what messages they can expect by providing examples before they begin their subscription. A useful way of doing this is a brief FAQ on the subscription page.

 

6. Use topic channels

Tip: Companies which offer a number of topics, sectors or products should definitely specify a separate channel for each one which can also be subscribed to separately. This enables each user to decide for themselves whether and which news channel they want to obtain from you (e.g. sport, politics, business, weather, etc.).

 

7. Is your WhatsApp newsletter really helpful?

Bear in mind what the benefits of using WhatsApp are for your company. Is it helpful? Will my company profit from it? Will my customers profit from it? Is it at all worthwhile, and do we have the necessary resources for another information and service channel?

After all, using WhatsApp services is not appropriate for every industry and every company. The motive for using them is also important: Are you using WhatsApp because it makes sense or because you are following a new trend? These are questions which every company must answer for itself.