Dimas Maulana

Dimas Maulana

Developer

Welcome to my website! I am a developer with a current focus on React and Go. My experience encompasses both front-end and back-end development, enabling me to design and develop seamless and efficient applications.

Fix Wordpress OceanWP Focus Border Visible After Click

One common issue that users encounter when using the OceanWP theme in Wordpress is the visibility of the focus border after clicking on a link. This focus border can be distracting and interfere with the overall design of the website. Fortunately, this problem can be easily resolved with a simple CSS tweak.

The Problem

By default, when you click on a link in the OceanWP theme, a focus border is applied to indicate that the link is currently active. However, this focus border can remain visible even after the click, which is not desired for most websites.

Using Fail2ban Inside Docker With NET_ADMIN Capability

Fail2ban is a popular intrusion prevention tool designed to protect servers from brute-force attacks and other malicious activities by monitoring log files and taking proactive measures to block suspicious IP addresses. When running Fail2ban inside a Docker container, there are some additional considerations to ensure proper functionality. In this article, we will explore how to configure and run Fail2ban inside a Docker container, including the need for the NET_ADMIN capability.

Fixing Too Many Open Files in System Error in Apache Docker Container

If you encounter the “Too many open files in system” error in your Apache Docker container, it means that the system has reached the limit on the number of files it can open, and this is causing issues with Apache’s configuration. Here’s a step-by-step guide on how to resolve this problem.

1. Check the Current File Limit

First, you need to check the current file limit on your system to understand the magnitude of the issue. To do this, run the following command:

Adding OneClick Chat to Order and WhatsApp Checkout in WordPress With Shipping Method

To add a One-Click Chat to Order feature and send checkout details via WhatsApp, including the shipping method, you can make modifications to the “wa_button.php” file in your WordPress theme or plugin. Here’s a step-by-step guide on how to achieve this:

  1. Open the “wa_button.php” file and locate the function where the WhatsApp message is being constructed. It might look something like this:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
function create_whatsapp_message($order) {
    // Existing code for creating the WhatsApp message
    $message = "Hello, thank you for your order!\r\n";
    // ...
    // More existing code
    // ...
    $date = $order->get_date_created()->format ('F j, Y - g:i A');
    // Add the shipping method information
    $shipping_method = "*Metode Pengiriman:*\r\n".$order->get_shipping_method()." ".$order->get_shipping_total()."\r\n";
    
    // Final output of the message
    $message .= "\r\n".$total_price."\r\n".$shipping_method."\r\n".$payment."\r\n*".$customer."* ".$address."\r\n\r\n".$thanks_label."\r\n\r\n(".$date.")";
    // Return the message
    return $message;
}
  1. Modify the existing code as shown above to include the shipping method information.

MAC OS Bash Path Location

In macOS, the system-wide PATH variable is defined by the contents of the /etc/paths file and the files within the /etc/path.d/ directory. These files determine the order and locations where the system looks for executable files when you run a command in the Terminal.

Here’s a breakdown of each of these components:

  1. /etc/paths:

    • This file contains a list of directories, one per line. These directories are automatically included in the system-wide PATH variable.

Restricting WooCommerce Cart to Only Allow One Item

If you’re running a WooCommerce store and want to ensure that customers can only have one item in their cart at a time, you can achieve this by adding a filter to your functions.php file. This will empty the cart whenever a new item is added, allowing only one product to be present in the cart at any given time.

Step 1: Adding the Filter

Open your theme’s functions.php file and add the following code:

0%