Posted on Leave a comment

Fix Invalid value in field “priceSpecification” (in “offers”)

With recent Google changes in rich snippets, you may find your WooCommerce sites hit with this error.

Fix Invalid value in field "priceSpecification" (in "offers") 1

Investigate further, you see this error highlighted:

Invalid value in field "priceSpecification" (in "offers")

For someone who don’t know much about code, this looks like Greek.

However, the fix is quite simple, you need to remove that part.

Remove priceSpecification

Before doing this, make sure you created a child theme or have a plugin available that you can paste custom code to.

If you have a child theme, put the following code in the functions.php of that theme:

function wc_remove_some_structured_data( $markup ) {
unset($markup['offers'][0]['priceSpecification']); // price removed without stock info
return $markup; }
add_filter( 'woocommerce_structured_data_product', 'wc_remove_some_structured_data' );

This need to be in a <?php block. If you are not sure, hire somebody to do that for you. Doing it wrong may break your site:

Pasting code to remove priceSpecification snippet
Pasting code to remove priceSpecification snippet

Save the file and you are done. Time to request Google to validate the fix.

Credit of this fix goes to paddydoran on this post https://wordpress.org/support/topic/invalid-value-in-field-pricespecification-in-offers/

Posted on Leave a comment

13 Best marketing plugins for WooCommerce

As you know, competition is much more intense now. Not every online store finds its way into the market. Even websites with decent products struggle to make a profit. So how can we be better than our competitors? That’s the question that has led to various marketing techniques over the past decade. 

The good news is that you don’t need to be a marketing specialist to benefit from them. There are standard and well-tested techniques that can give you great results with little cost.

In this article, we review seven WooCommerce marketing plugins. 

These plugins can differentiate between a profitable online business and a boring website that doesn’t sell very well. With these plugins, you can integrate various marketing techniques right into your WooCommerce store. No coding or technical knowledge is required. 

Follow-Ups

13 Best marketing plugins for WooCommerce 2

Have you noticed how eCommerce websites send you emails regularly based on your actions and preferences? They are called Follow-Up emails. If used correctly, follow up-emails are a great way to prevent your customers from forgetting about you.

Follow-Up is a premium WooCommerce extension plugin developed by the same team behind WooCommerce. It allows you to define and create customized emails and send them automatically to customers at specific intervals after an action. You can design your fully customized follow-up email templates from the default WordPress post editor and automate them based on different customers’ actions.

It gives you almost everything you need to run your unique Follow-Ups campaigns.

Price:$99 (Billed annually)

Features:

  • send automated email based on actions like making a purchase, taking a quiz, signing up for an account, and at specific intervals after the action
  • Various responsive email templates to choose from
  • Integration with Google Analytics and WooCommerce Subscriptions 
  • It allows you to use the WordPress Editor to design custom templates.
  • Full-fledged reporting system

Smart coupons

13 Best marketing plugins for WooCommerce 3

Everyone loves coupons, and while WooCommerce supports coupons out of the box, there is much more to achieve. Smart coupons allow you to easily implement discounts, credits, vouchers, product giveaways, offers, and promotions right into your Woocommerce store. It allows you to automatically generate and email coupons based on customer actions like registration or purchase.

Price:$99 (Billed annually)

Features:

  • Fixed Amount & Percentage Coupons
  • Bulk coupon Generation, import / Export
  • Shareable / Social Media / URL Coupons
  • Free Gift Coupons / Product Giveaway
  • Location-based Coupons

Smart WooCommerce Wishlist For Morconveret

13 Best marketing plugins for WooCommerce 4

The Smart Wishlist For More Convert allows you to add complete wishlist functionality to your WooCommerce website. With this plugin, you can let your users save their favorite products to their wishlist. They then can find their saved products or share them with their friends. This plugin will increase customers’ loyalty and sales. 

Price: free 

Free features

  • Automate promotional emails to users with a specific product on their wishlist or other conditions.
  • The ability to disable the wishlist features for unlogged users
  • Allow users to buy products with dedicated coupon
  • Allow users to move an element from one wishlist to another.
  • Increase sales by offering favorite products to potential customers.

PW WooCommerce Gift Cards

13 Best marketing plugins for WooCommerce 5

Who doesn’t like to receive gift cards? Based on the National Retail Federation survey, nearly six in 10 (58.8%) consumers say they would like to receive gift cards as holiday gifts [1]. While there are different gift card plugins for WooCommerce, PW WooCommerce Gift Cards stands out and is our go-to plugin for gift cards. It allows you to easily create gift cards with different prices and let your users gift them to their friends and families. This plugin is an awesome way to increase your sales without any advertisement cost.

This plugin comes in free and pro versions. You can add a complete gift card mechanism to your WordPress store, including gift card purchasing, customization, and Redeeming with the free version. The pro version extends that even further. It provides you with different customization options for the coupon amount, expiration date, and more. 

Price: free and paid ($59/ year)

Premium features

  •  Allow customers to specify the amount. You can set a minimum and a maximum amount.
  • Allow customers to schedule when a gift card will be delivered.
  • Choose an amount that will be pre-selected when purchasing a gift card.
  •  A shortcode to let customers check their gift card balances.
  • Automatically set an expiration date based on the purchase date.
  • Specify the amount and quantity for the cards to create multiple cards in one step.
  • REST API 

SUMO Reward Points

13 Best marketing plugins for WooCommerce 6

Rewarding and loyalty programs can boost Customer retention and increase sales over time. If you aren’t leveraging that, then it’s time to do so. SUMO Reward Points is a Complete Loyalty Reward Points System for WooCommerce. It outsells any other plugin Rewarding plugin on Codecanyon and has a 4.60 out of 5 ratings. It allows you to reward your customers not only for their purchases but also for Signup, Writing Reviews, Referrals, Coupon Codes, Blog Post, Social network shares, and more. This plugin has tons of customization options that you should try yourself.

Price: ($49)

Premium features

  • WPML, WPML String Translation, and WooCommerce Multilingual Compatible
  • Reward Points for Product Purchase, Signup, Writing Reviews, Referrals, Coupon Codes, Blog Post, etc.
  • Import/Export Users and Reward Points in CSV
  • Gift Vouchers with Reward Points
  • Member Level Feature

WooCommerce Cart Abandonment Recovery

13 Best marketing plugins for WooCommerce 7

Various studies have shown that roughly  3/4 of shoppers leave their cards [2]. That’s why many big brands are using different card abandonment techniques to bring customers back to their cards. WooCommerce Cart Abandonment Recovery by CartFlows Inc captures the email address of users on the checkout page. If a customer doesn’t complete a purchase within 15 minutes, it starts sending a series of emails to bring them back. You can customize the timing and the email templates to match your brand. This plugin is free.

Price: (free)

 features

  • Email a unique checkout link to each shopper that takes them exactly where they left off.
  • GDPR Compliant
  • ready templates for follow up emails:
  • generate limited-time unique discount coupons to entice your shoppers and send them automatically via email.
  • complete Reports

Customer Reviews for WooCommerce

13 Best marketing plugins for WooCommerce 8

Do you remind your customers to write reviews? If not, then you definitely should. Customer reviews can boost sales by 18% [3]. Customer Reviews for WooCommerce allows you to Send automated, personalized email reminders to each customer after a transaction, reminding them to review the product they have purchased. The free version is already very useful and gives you all the common features you need. You can get some more features plus support in the premium version.

Price: free and paid ($49.99 + VAT billed annually)

 features

  • automated or manual review reminder emails
  • Aggregated review forms to allow quick and easy reviewing
  • Enhanced reviews, including ratings, images, voting, and filtering options
  • Offer discounts in exchange for reviews
  • Question and Answer feature, allowing customers to ask and answer FAQ
  • Import and export reviews

AutomateWoo

13 Best marketing plugins for WooCommerce 9

AutomateWoo is a powerful marketing automation tool for WooCommerce. It allows you to create marketing workflows that are automatically started by a trigger, like a customer making a purchase or when a specified date like a customer’s birthday arrives. You can customize each workflow using triggers, rules, and actions. A trigger is an event that starts the workflow. Rules let you specify when the workflow should run. Finally, actions are automatically done when the specified rules are met. While you can achieve almost everything this plugin does by combining smaller single usage plugins, this plugin saves you from the headache of working with 10 or 15 different marketing plugins. It also gives you different metrics of your automation status, all in one place. 

Price: paid ($99/ year)

 features

  • various triggers to choose from
  • detailed statistics of automation workflows
  • easily modify your triggers with different rules
  • integration with WooCommerce subscription, WooCommerce points and rewards, and WooCommerce wishlists plugins

Funnel Builder by CartFlows 

13 Best marketing plugins for WooCommerce 10

A sales funnel. A marketing term to describe the potential journey customers go through on their purchases. Optimizing your sales funnels is an inexpensive organic way to increase your conversion rate and sell more even with the same number of visitors. Funnel Builder by CartFlows lets you change default funnels used by WooCommerce to get more leads and increase conversion. It also includes various templates to choose from. You can also use page builders like Elementor and Beaver Builder to customize your templates to match your brand. While the free is a good starting point for optimizing your sales funnels, the paid version gives you .more features and support.

Price: free and paid ($239/ year)

 features

  • integration with popular page builders
  • premade templates to choose from
  • WooCommerce Checkout Page Replacement

Affiliate For WooCommerce

13 Best marketing plugins for WooCommerce 11

 An affiliate program is an agreement in which a business pays another business or influencer a commission for sending traffic to their product.

Affiliate For WooCommerce is a premium plugin specifically made for WooCommerce. It allows you to run your affiliate program by allowing anyone to participate. The nice thing is that everything is done automatically. You can then easily track your affiliate programs with detailed statistics.

Price: paid ($129/ year)

 features

  • easy setup
  • Allow people to sign up as your affiliates. Approve them and set them up to receive commissions
  • Track affiliate progress and adjustments
  • Easy payouts via PayPal

A/B Testing for WooCommerce (paid)

13 Best marketing plugins for WooCommerce 12

Should I offer free shipping for cards above $100 or not? Will I get more orders if I discount all of my products by 10%? These are website-specific questions that are best answered by using a marketing technique known as A/B testing. A/B testing is a marketing method where we set up two different versions of a webpage live and compare the results to choose the best version. A/B testing is a standard and reliable marketing technique. All big brands use it. A/B Testing for WooCommerce makes it a breeze to run server-side WooCommerce A/B tests, like product and shipping price tests. It tracks users by cookies, so each unique visitor will only receive one consistent experience.

Price: paid ($129/ year)

 features

  • easy setup
  • run Shipping and Price Tests
  • Track and analyze test results using Google Optimize and Google Analytics services.

Discount Rules for WooCommerce

13 Best marketing plugins for WooCommerce 13

WooCommerce supports discounts out of the box. But it has limited options for creating and managing discounts. Discount Rules for WooCommerce lets you create many kinds of discounts that WooCommerce doesn’t offer. You can create Buy One and Get one free (BOGO) deals, discounts based on categories and products, order total-based discounts, and many more. While the free version gives you a few different discount rules to start with, the pro version has almost any type of discount you can imagine. 

Price: free and paid ($49/ year)

 pro features

  • various discount rules to choose from
  • Discount based on the number of orders placed earlier
  • Bundle / package deals
  • discount for customers with specific email domains

Scratch Coupon for WooCommerce

13 Best marketing plugins for WooCommerce 14

Last-minute offers are an intelligent way to increase sales without reducing the price for everyone. Scratch Coupon for WooCommerce is a premium plugin just to do that.

It creates Scratch cards, which need to be scratched by users before activating/revealing the offers. Users can drag their mouse or finger across the screen to y see the coupon. You can customize texts, colors, and images to match your brand.

Price: paid ($29/ year)

  features

  • Easy customization options
  • manage when and on which page the popup should appear
  • Mobile responsive
Posted on Leave a comment

Java EE Starter Project (Java 7 JAX-RS EJB)

When learning JavaEE the first time, it’s hard to find a project that you can click the triangle and see the code run like in Java SE. I’ve been finding projects like that and after countless hours, I’ve found one from Okta.

With some modifications, I could get it up and running and also configure debug options for the application.

You can clone the application here:

https://github.com/datmt/javaee-ejb-starter

How to run the application

Running this JAX-RS application is super easy. The first thing is to make sure you have maven and JDK installed. Next, make sure you add maven bin folder to path and create environment variable for JDK home as JAVA_HOME.

Here is what it’s like on my Windows machine:

JAVA_HOME environment variable on windows

I also added maven bin to path:

Java EE Starter Project (Java 7 JAX-RS EJB) 15

After that, you can simply run the following command in the project’s root:

mvn clean package tomee:run

How to debug the application

Debugging the application is also quite simple. First, stop the application if it’s running. Then run the following command in the project’s root:

mvn clean package tomee:debug

The console should output something like this:

Java EE Starter Project (Java 7 JAX-RS EJB) 16

As you can see, the debug process is listening on port 5005.

Then, create a debugging profile like this:

Create JVM debugging profile

By default, the debugging port is 5005. My IDE (IntelliJ) is smart enough to guess the port and all left is clicking on OK:

Create debug options for JAX-RS app

Then you can click on the Bug icon to start debugging:

Start debugging on JAX-RS EJB application

Conclusion

With this starter project, I hope you can start working on Java EE concepts that are new to you (for example, interceptors, JPA…).

Posted on Leave a comment

Step by Step To Improve Google PageSpeed Insights Score

With Google place more weight on Core Web Vitals as a ranking factor, site owners have rushed to optimize servers, install various plugins to improve Google PageSpeed Insights Score. However, not many achieved success.

To give an example, when you search for the keyword “how to improve google page speed score”, the result, as of 18 February 2021 is this:

Step by Step To Improve Google PageSpeed Insights Score 17

At the number 2, you can see the page on neilpatel.com. When I ran the check for its pagespeed insight score, this is the result.

Step by Step To Improve Google PageSpeed Insights Score 18

Not quite convincing, right?

I’m not an expert like Neil Patel. However, by tried and true practices, I managed to improve my website page speed insight from 70 to 90+ (Some pages 97+) score.

Let me walk you through the steps I did to achieve that result. Surprisingly, I didn’t buy expensive plugins to get here. I only spent money on one thing, which is:

Step 1: Get a decent hosting provider

I cannot stress this enough. A low quality host can do a lot of damage to your site. Even if you have a perfectly optimized site but if your hosting sucks, your page speed insight score will not be improved.

As a software developer, I prefer VPS hosting since it gives me a lot of room to customize. The site you are on now is running on a Digital Ocean droplet with 4GB of RAM, 80GB SSD and 2 vCPU. It currently handle ~ 10k traffic monthly quite nicely.

I think with these specs, my site can handle up to 30k visits/month.

If you plan to have a lot more traffic, you will need to upgrade your server accordingly.

If you are starting out, a droplet that cost $5/month should be enough. You can upgrade as your site grow.

Remember, get decent hosting provider. From my experience, I would recommend DigitalOcean for developers and Flywheel for people who need an easier interface.

Step 2: Get rid of bloat plugins, themes

Plugins and themes are the main reason why so many people use WordPress. If you need to do anything, there is a plugin for that. If you need to change your site looks and feels, there is a theme for that. However, this flexibility comes with a cost: speed.

Beside adding more static assets (js, css, images), plugins and poorly coded themes can slow your server down by abusing hooks. If you place a timer inside do_action and apply_filters in wp-includes/plugins.php, you can find a lot of plugins’ code that cost your server extra time to prepare for the content.

Here is the result I got from inspecting these functions on my site:

Placing log to find out which filter cost time in WordPress

As you can see, the highest cost from the image above is 47 seconds. Each time a plugin calls add_filter or add_action, there will be time added to the total load time of your site.

So, consider using less plugins. Only keep the ones you can’t live without.

As of themes, I know that many people don’t have the luxury that I have. I built my own theme so I can get rid a lot not needed code. If you can, build one or high some good developer to build a custom theme for you.

The different will be night and day, I’m sure.

Currently, I have only 17 active plugins on mys site.

List of plugins on my site
Step by Step To Improve Google PageSpeed Insights Score 19

Step 3: Install and configure Autoptimize

This plugin single handedly improved my Google page speed insights score from 70 to 85. The good thing is it is free and there are not much options to configure. You can download the plugin here.

If you need some instructions, here are my settings:

my autoptimize settings
my autoptimize settings part 2
my autoptimize settings part 3
Step by Step To Improve Google PageSpeed Insights Score 20
Enable imaeg lazy loading can improve Google pagespeed insights score a great deal
my autoptimize settings Extra
Combine google fonts, remove WordPress emoji is also useful to improve your page speed

Step 4: Enable MySQL caching

The result

Here is the result after alll the optimization I did above. As you can see, I was able get this result without spending too much money (I spent only on hosting and domain!)

How I improve google pagespeed insights score to 98 with free tools

Conclusion

Without using CDN, paid plugins, I was able to improve my site Google pagespeed insight score dramatically. However, if the site get more traffic, I may need to upgrade server or using CDN or both. If you are starting out, following the steps above can improve your page speed insight a great deal.

Posted on Leave a comment

2 Easy Steps To Configure Docker logging with rsyslog

If you have problem configure Docker logging with rsyslog, this post may provide a quick solution. I, by no mean, say that this is the ultimate guide for docker & rsyslog configuration. However, the following configurations helped me achieve my goal.

The desired goal

Based on a requirement from a client, they want to store all docker logging to a custom file location. That includes dockerd logging and containers’ logging.

So, after reading this tutorial, you can:

  • Configure docker to log to a custom location using rsyslog

If that’s your goal, read on.

Step 1: Configure docker logging

By default, docker containers’ log is written to a .json file inside the containers folder (default at /var/lib/docker/containers/<container_id>). We are going to change this default behavior by specifying a different log driver for docker, which is rsyslog.

So, create/edit your /etc/docker/daemon.json file and paste the following content:

{
    "log-driver": "syslog",
    "log-opts": {
        "tag" : "docker-container- {{.ImageName}} - {{.ID}}"
    }
}

Now, save the file and restart your docker service using systemctl restart docker.

What have we done?

As you can see in the log file, we specify the log driver to “syslog”. We also specify tag in “log-opts”. The tag option allows us to pass in custom data to the log message. The “docker-container” part is used to filter the log message in rsyslog settings so we can write it to a different file (other that /var/log/syslog).

{{.ImageName}} is the name of the Docker image. {{.ID}} is the ID of the container (short ID, 12 chars). These info are optional. You can see the list of parameters you can passed in here.

Now, let’s run a docker container and check the log message:

Configure Docker logging with rsyslog - log message in rsyslog

As you can see, we ran an nginx container and view the content of /var/log/syslog and sure enough, the new log format is there with image name and container’s ID.

The next step is to tell rsyslog to store messages like this at a different location.

Step 2: Configure rsyslog to filter docker log messages

In this step, we are going to create a dedicate log config for docker. Let’s say I want to store all docker-related messages in /var/log/docker/.

Create /etc/rsyslog.d/docker.conf with the following content:

$FileCreateMode 0644
template(name="DockerLogFileName" type="list") {
   constant(value="/var/log/docker/")
   property(name="syslogtag" securepath="replace" \
            regex.expression="docker/\\(.*\\)\\[" regex.submatch="1")
   constant(value="/docker.log")
}
if $programname == 'dockerd' then \
  /var/log/docker/combined.log

if $syslogtag contains 'docker-container' then \
  /var/log/docker/containers/docker.log
  &stop

$FileCreateMode 0644

Most of the code in this file I got from this answer on stackoverflow.

Here are the important parts:

We check if the log message has ‘docker-container’ (which we inserted when configuring /etc/docker/daemon.json), if it does, we save the log to /var/log/docker/containers/docker.log.

You can specify a different location that suits your preferences.

This file contains all logging message for your containers.

Next, if you don’t want to store the log message in /var/log/syslog file, include the ‘&stop’ line.

If you comment out the ‘&stop’ line (with #), log messages from docker containers will also be save to /var/log/syslog and /var/log/daemon.log

Now, restart syslog service with systemctl restart rsyslog.

Conclusion

There you have the working solution for storing docker containers’ log message at a specific location on disk with rsyslog. Make sure to use logrotate to split the file since it could be very large after some time, depends on your system.