DevOps

“ This app is processed through CI/CD pipeline “

WordPress Vulnerability Scanner: Protect Your Website from Malware

WordPress is one of the most popular content management systems, powering millions of websites worldwide. However, its popularity also makes it a prime target for hackers and malware attacks. To ensure the security of your #WordPress site, it’s crucial to regularly scan it for vulnerabilities and malware. In this article, we will discuss the importance of using a WordPress vulnerability scanner and provide guidance on running malware scans effectively.

Custom Add to Cart Button and Ajax Request in WooCommerce and WordPress Store

Creating a Custom Add to Cart Button using Ajax Request for a Seamless Checkout Experience in WooCommerce and WordPress

Simple HTML and JS Approach

Here’s the solution below:

HTML Code

<button id="hi-add-button" class="hi-add-button" data-button-add="true">ADD TO CART</button>

JQuery Code

jQuery(document).ready(function($) {
  // Ajax Starts

  // Manually replace using your actual product ID
  const hi_products_group = [
    { product_id: 242, quantity: 2 }, // Product 1
    { product_id: 265, quantity: 1 }, // Product 2
    // You can add more here..
  ];

  let index = 0;

  function addProductToCart() {
    const getData = $('#hi-data-store').val();
    const product = hi_products_group[index];

    if (index >= hi_products_group.length) {
      // Redirect to cart or update cart widget
      window.location.href = wc_add_to_cart_params.cart_url;
      return;
    }

    // increment
    index++;

    // Send the AJAX request to add the product to the cart.
    $.ajax({
      type: 'POST',
      dataType: 'json',
      url: wc_add_to_cart_params.ajax_url,
      data: {
        action: 'woocommerce_add_to_cart',
        product_id: product.product_id,
        quantity: product.quantity,
      },
      beforeSend: function(xhr) {
        // Show loading spinner or disable button
        xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
        $('#hi-add-button').text('PROCEED TO CART..');
      },
      success: function(response) {
        if (index < hi_products_group.length) {
          // pause for 600ms
          setTimeout(addProductToCart, 600);
          // Add the next product to the cart
          addProductToCart();
        } else {
          // all products have been added, change button text
          $('#hi-add-button').text('ADD TO CART');
        }
      },
      error: function(xhr, status, error) {
        // Handle error
        console.log(error);
      },
    });
  }

  // '#hi-add-button' with the selector for the cart button.
  $('#hi-add-button').click(function(e) {
    e.preventDefault();
    addProductToCart();
  });
});

The above code has the following features

Auto Generating Backup Files for your Linux Server

source image: pexel.com

When doing computer work, clicking “save” is necessary to either literally or not literally save your job. This content is helpful when you are working on the Linux Operating System (OS), especially running a server. Automatically backing up your server can cost you money on a monthly basis and, of course, can save your business.

Just imagine how much of your time and effort goes to waste when you forget or have the tardiness to just press ctrl + s on your office application. Without further ado, let’s get started.

Breach Threat! Someone Can Reveal Your Saved Password from the Browser

Data can be Breach

We may be unaware of what’s really going on when we use our devices to access the internet. Well, this content will make you aware of what you should do when you use your favorite browser to access the internet. Hackers are eagerly pestering us to get our sensitive information, such as user credentials, passwords, credit card information, and the like.

Specifically, this information is limited to Mozilla Firefox and Google Chrome browsers, yet it may be similar to your favorite browser too.