Author Archives: Nicolas Rabier

Woocommerce – remove tabs on the single product page

This snippet allows to quickly remove the tabs area that contains the description, review, attributes and potentially custom tabs. This area is shown by default under the “add to cart” button on the single product page in a WooCommerce shop.

Insert the code in functions.php of your child theme.

add_filter( 'woocommerce_product_tabs', 'remove_tabs_in_single_product', 11 );
 
function remove_tabs_in_single_product( $tabs ) {
	unset( $tabs );
	return $tabs;
}

If you want to remove only the description tab then use this snippet:

add_filter( 'woocommerce_product_tabs', 'remove_description_tab', 12 );
 
function remove_description_tab( $tabs ) {
	unset( $tabs['description'] );
	return $tabs;
}

If you want to remove only the review tab then use this snippet:

add_filter( 'woocommerce_product_tabs', 'remove_review_tab', 13 );
 
function remove_review_tab( $tabs ) {
	unset( $tabs['reviews'] );
	return $tabs;
}

XRPL Ledger Overview

XRP Ledger – Summary

The XRP Ledger is a decentralised cryptographic ledger powered by a network of peer-to-peer servers.

Blockchain technology has been initially created to enable trust in an untrustworthy system. When the consensus is reached, trust is established.

Blockchains are trivial to create. The complicated part is the consensus mechanism that allows the blockchain to progress. Keeping in mind that the consensus is the most important property of any decentralized payment system.

The XRP Ledger (XRPL) leverages a distributed ledger technology, which is slightly different from common blockchain in terms of the way the consensus is gained across the system. Blockchains such as Bitcoin or Ethereum 1.0 are reaching consensus with a proof of work algorithm, which is only one example of consensus algorithms. Proof of stake, proof of capacity, proof of spacetime, etc are other examples.

The XRPL defines a set of rules all participants follow. It is called the consensus protocol, which is quite unique as it was never implemented before. The primary role of the consensus protocol is to resolve the double-spend problem and to do so the protocol has been designed to have the following important properties, in order of priority: Correctness, Agreement, Forward Progress.

This protocol is still evolving, as is our knowledge of its limits and possible failure cases. For academic research on the protocol itself, see Consensus Research.

Distributed ledger technology is a hybrid form of the strict definition of blockchain technology as it chains ledgers, not blocks.

Roughly every 4-6 seconds the ledger closes and the next starts based on the last closing ledger totals. The full ledger history is kept on node servers, while validator servers work to reach consensus to validate transactions. For the XRPL, the consensus algorithm and Unique Node Lists (UNL) are important as they are the custodians of the cryptographic ‘truth’.

UNL are the lists of trusted validator servers a given participant believes will no conspire to defraud them. The UNL on validator servers can be modified at any time. Currently, Ripple provides a default, and recommended list which is evolving with the network expansion. Eventually, Ripple intends to remove its validator servers from the UNL with the goal to make a fully decentralised system.

Sources:

w3 total cache w3tc

File Usage issue caused by WordPress W3 Total Cache

Context

TDLR

  • Website returns Http Error 503 the service is unavailable. Can’t access the WordPress Administration.
  • From CPanel, File Usage reached its hard limit (250,000 files)
  • From File Manager, removed directory “wp-content/cache”
  • File Usage is now way below the threshold
  • Able to access WordPress Administration and configure Total Cache, disabled Database Cache and Object Cache

Explanations

On shared hosting service, it is common to have a limitation on the number of files that can be stored on the hard drive. Even though the Disk Usage is far below the limit (disk 15% full), the File Usage limitation can generate serious issues.

On my hosting provider Zuver, the File Usage soft threshold is 200,000 files which will only give warnings. However, if it hits the 250,000 files hard limit, it will run into issues with the website (Http Error 503 the service is unavailable) and the cPanel account.

Basically, the server separates the entire hard drive into nodes, which are used to store files or parts of files. As you can imagine, a node will be a certain size, and there can only be so many nodes that take up all the space on the hard drive.

Because this is a shared hosting service with more than one user on the server, the number of INodes (files) that can be stored per user must be limited, to avoid hitting the server’s INode limit.

Usually, there is no way to increase the File Usage threshold with the hosting provider. Therefore, an investigation is required.

If WordPress uses W3 Total Cache with Database Cache and Object Cache enabled on disk, chances are that this is causing the issue. Also, you can check the tmp folder and the hidden directories.

The quick fix is to delete the folder /wp-content/cache and then access to the WordPress Administration panel to disable Database Cache and Object Cache.

That’s it.

Port 8080 Already In Use Spring Java Mac

Find out what application uses the port 8080 on Mac

If you develop web applications on your local environment, you will notice that the port 8080 is often set as default. Most likely one day you will face a situation where 2 running web servers want to bind the same port: 8080. Obviously, this is not allowed and you will get an error “Address already in use”. In Java environment, you will get this:

[console]java.net.BindException: Address already in use[/console]

The best way to sort this conflict is to follow these simple steps.

Step 1: find if a process listen on the port 8080

Open a terminal and enter this command:

sudo lsof -i :8080 | grep LISTEN

If you have already a running server on 8080, then the command will show the application running on this port. Note that the second value column is the Process Identification Number which is automatically assigned to each process when it is created on a Unix-like operating system.

[terminal]$ lsof -i :8080 | grep LISTEN
java 28045 nicolas 125u IPv6 0x609c3697d21f8a2d 0t0 TCP *:http-alt (LISTEN)[/terminal]

Step 2: obtain more information about the process

Enter this command in the terminal.

ps -e {pid} | less

Note that you have to replace the {pid} by the value found in the result of the lsof command. In my case scenario, it’s 28045 and it’s Eclipse.

[terminal]$ ps -e 28045 | more -w
PID TTY TIME CMD
28045 ?? 0:13.70 /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=64979 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Djava.security.egd=file:/dev/./urandom -noverify -XX:TieredStopAtLevel=1 -Dfile.encoding=UTF-8 -classpath /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/resources.jar:{more libraries…}:/Users/nicolas/.m2/repository/org/springframework/spring-jcl/5.1.4.RELEASE/spring-jcl-5.1.4.RELEASE.jar com.nicolasrabier.whatever.ServerApplication –spring.output.ansi.enabled=always
[/terminal]

Step 3: kill the process

If you can no longer quit safely the web server process, there is still a way to kill the process with a command line in the terminal.

Note in the command you have to replace the {pid} by the value found in the result of the lsof command. In my case scenario, it’s still 28045.

sudo kill -9 {pid}

After running this command, no process listens on the port 8080 which means that you can start safely the other web server.

Replace Storefront Footer Credit

In your child theme functions.php file, paste the below:

add_action( 'init', 'remove_storefront_credit', 10 );

function remove_storefront_credit() {
	remove_action('storefront_footer','storefront_credit',20);
	add_action('storefront_footer','my_credit',20);
}

function my_credit() {
	echo '<div class="site-info">';
	echo '© [My Company Name] '.get_the_date('Y');
	echo '</div>';
}

Then replace [My Company Name] by the name of your company or whatever you want.

Photo by KAL VISUALS on Unsplash

Free Software / Tool / Service to run a Small and Medium-sized Business

It can be overwhelming to jump into the endeavour of creating a starting a new business and without knowing if your ideas will work. A critical role is to manage your cash flow and make sure the money is spent wisely. Nowadays, thanks to the internet and the open-source community, there is a plethora of great tools for your business and it won’t cost you any money.

Email Service

First of all, you will need an email address. Create an account on Gmail – https://mail.google.com

This Google account will allow you to access many useful collaborative services such as:

  • Calendar Service: Free Organise meetings & events – https://calendar.google.com
  • Contact Service: Free Directory of your contacts – https://contacts.google.com
  • Google Docs: Free alternative to Microsoft Word. Many users can work simultaneously on the same document. Versioning control. Large choice of templates and different look & feel. – https://docs.google.com
  • Google Sheets: Free alternative to Microsoft Excel. Same as Google Docs, many users can work simultaneously on the same document. Versioning control. And more… – https://docs.google.com/spreadsheets/
  • Google Slides: Free alternative to Microsoft PowerPoint. Same as the other Google tools, many users can work simultaneously on the same document. Versioning control. And more… – https://docs.google.com/presentation
  • Google Drive: Free 15 GB cloud storage space – https://drive.google.com
  • And more…

Operating System

Install the free operating system on to your server to replace Windows or other Linux paid OS: Ubuntu Server

Remote Access

Install Chrome Remote Desktop which is a free remote control software, a good alternative to Teamviewer: How to install Chrome Remote Desktop on Ubuntu 18.04 – (pretty much same config for Ubuntu 16.04)

VPN

How to set up an OpenVPN Server on Ubuntu 16.04

Cloud Printing

Google Cloud Print on Ubuntu 16.04, in 10 minutes!

Dynamic Domain Name Service

How to set up Free DDNS Service on Ubuntu

Backup

How to install and configure ownCloud on Ubuntu 16.06

Usually, I couple ownCloud with a Dropbox account (not free) for redundancy.

ERP / E-commerce website

Install Odoo on an Amazon Lightsail server for $20 / month.

Open Source ERP – Odoo 11 – installation guide on Ubuntu 16.04

Open Source ERP & CRM – Dolibarr (PHP)

Best Wordpress Plugins

[WIP] The Best WordPress Plugins & Themes (No Affiliation)

As a WordPress developer, I thought keeping an organized list of the best and worst plugins. Here is simply my feedback based on my experience with those plugins. This post hasn’t been affiliated by any of the plugin brands.

Here is my Testing Environment for WooCommerce: https://shop.nicolasrabier.com

Color code:

  • ✅ Approved
  • ⚠ Some Warnings
  • ❌ Don’t Waste Your Time

✅ WooCommerce By Automattic

This is a great eCommerce tool. I love it even though it’s far from being perfect.

Pros

  • free
  • works with physical or digital products
  • compatible with many Themes such as StoreFront By WooThemes (same team as Automattic)
  • awesome partnership with Stripe & Paypal plugins
  • you can have a simple shop up and running fairly quickly

Cons

  • require good knowledge of the tool to set it up properly
  • the marketing strategy of Automattic is to use WooCommerce as an entry point to sell the most interesting plugins.
  • You would believe for compatibility reason it is better to use only Automattic plugins but this is not necessary true. e.g.
  • General knowledge in PHP and specifically in WordPress framework can help you a lot and save you money.

✅ Storefront Theme

Pros

  • Front page of the store looks very professional and legit. In order to properly visualize the front page the store needs products and categories in the catalog. Therefore I suggest to import the Dummy Data provided in WooCommerce to have a clear idea of the shop style. Check out this video tutorial that explains how to import the dummy data – https://www.youtube.com/watch?v=LpWZ8jr4Nvw

Cons

  • Many extensions aren’t free

Not sure

  • Compatibility with CDN. When you develop a website for global market you need to make sure the website is quickly reachable from anywhere in the world and nowadays this is achieved via a Content Delivery Network. I personally use CloudFlare coupled with MaxCDN which are integrated via W3TotalCache plugin.

✅ Storefront Sticky Add to Cart By WooThemes 

Love it

✅ Shortcodes Ultimate By Vladimir Anokhin

Best plugin to display information (sliders, box, columns, animations, etc.)

I systematically download it on all my instances of WordPress.

 Child Theme Configurator By Lilaea Media 

Nothing exciting here but it simply makes the creation of a child theme effortless.

Pros

  • Simple and fast

 W3TotalCache By Frederick Townes

This plugin speeds up the loading time of websites from anywhere in the world. This is critical to deliver the best experience to your impatient audience.

Cons

Pros

❌ WooThemes

Cons

  • Poor documentation
  • Support is unreliable
  • Expensive

Note reviews on Theme Grade – http://www.themegrade.com/woothemes-rating/.

 All-In-One WP Migration By ServMask

WooCommerce – Change “Related Products” text

This snippet allows to quickly change the “Related products” text which is shown by default at the bottom of a single product page in a WooCommerce shop.

Check out on my test environment: https://shop.nicolasrabier.com/product/woo-album-4/

Insert the code in functions.php of your child theme.

/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function custom_related_products_text( $translated_text, $text, $domain ) {
  switch ( $translated_text ) {
    case 'Related products' :
      $translated_text = __( 'Other items you might like', 'woocommerce' );
      break;
  }
  return $translated_text;
}
add_filter( 'gettext', 'custom_related_products_text', 20, 3 );

Post context:

  • WordPress
  • WooCommerce

Photo by Fikret tozak on Unsplash

Blockchain Rush: The Essentials

List of most of the cryptocurrencies and assets

Live charts

ICOs

Trading Exchange Platforms

Follow the development teams on their slacks to have more insights on the maturity, momentum and potential in short term/long term of the cryptocurrencies. It will provide relevant indicators in order to make a financial move.

Wallets (to be completed)

News:

Youtube Channels:

Personal Trading Interests