Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some wordpress and Wocommerce docs #259

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
myst:
html_meta:
description: Learn how to configure the "Converter for Media – Optimize images
| Convert WebP & AVIF" plugin on your Hypernode server. Follow step-by-step
instructions to verify your VHOST type, update NGINX configuration, and test
the plugin for optimal performance and compatibility with WordPress/WooCommerce.
title: How to Configure "Converter for Media – Optimize images | Convert WebP
& AVIF" Plugin on Hypernode
---

<!-- source: https://support.hypernode.com/en/ecommerce/woocommerce/how-to-configure-converter-for-media-plugin-for-wordpress-woocommerce/ -->
hpowernl marked this conversation as resolved.
Show resolved Hide resolved

# How to Configure Converter for Media – Optimize images Convert WebP & AVIF Plugin on Hypernode

For the WordPress/WooCommerce plugin [Converter for Media – Optimize images | Convert WebP & AVIF](https://nl.wordpress.org/plugins/webp-converter-for-media/), an adjustment is required in your Hypernode NGINX configuration. To make it easier for you, follow the instructions below to get the plugin working correctly on Hypernode.

## Verify your VHOST type

First, check if your VHOSTS has the correct type by running the following command:

```bash
hmv --list

```

Running this command will give you an output like this:

```console
hpowernl marked this conversation as resolved.
Show resolved Hide resolved
+-------------------+----------+----------------+-------+-------------+---------+--------------+
| servername | type | default_server | https | force_https | varnish | ssl_config |
+-------------------+----------+----------------+-------+-------------+---------+--------------+
| test.hypernode.io | magento2 | True | True | True | False | intermediate |
+-------------------+----------+----------------+-------+-------------+---------+--------------+
```

As you can see, the type is incorrect because it needs to be set to WordPress. To change this, use the following command:

```bash
hmv --type wordpress --https test.hypernode.io
```

After running this command, your VHOSTS will be set to WordPress. Make sure to replace `test.hypernode.io` with your actual domain name.

## Update NGINX configuration for the plugin

To ensure that "Converter for Media – Optimize images | Convert WebP & AVIF" works correctly, apply the following configuration:

```nginx
# BEGIN Converter for Media
set $ext_avif ".avif";
if ($http_accept !~* "image/avif") {
set $ext_avif "";
}

set $ext_webp ".webp";
if ($http_accept !~* "image/webp") {
set $ext_webp "";
}

location ~ /wp-content/(?<path>.+)\.(?<ext>jpe?g|png|gif|webp)$ {
add_header Vary Accept;
add_header Cache-Control "private";
expires 365d;
try_files
/wp-content/uploads-webpc/$path.$ext$ext_avif
/wp-content/uploads-webpc/$path.$ext$ext_webp
$uri =404;
}
# END Converter for Media
```

Place the above configuration in `/data/web/server.media.conf.` Once you save the file, NGINX will automatically reload, and if something goes wrong, you will be notified.

## Test the Configuration

To test the configuration, you can use the following command:

```bash
➜ ~ curl -IL -H "Accept: image/webp" https://test.hypernode.io/wp-content/upload/test.jpg
hpowernl marked this conversation as resolved.
Show resolved Hide resolved

HTTP/2 200
server: nginx
date: Mon, 13 May 2024 08:49:44 GMT
content-type: image/webp
content-length: 53624
last-modified: Wed, 08 May 2024 13:34:25 GMT
etag: "663b7f61-d178"
expires: Tue, 13 May 2025 08:49:44 GMT
cache-control: max-age=31536000
vary: Accept
cache-control: private
accept-ranges: bytes
```

By following these instructions, you should be able to configure and test the "Converter for Media – Optimize images | Convert WebP & AVIF" plugin to work correctly on your Hypernode server.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
myst:
html_meta:
description: Learn how to replace the default WordPress cron with a cron job on
Hypernode to improve performance, schedule tasks precisely, and mitigate DDoS
attacks.
title: How to Set Up a Real Cron Job for WordPress/WooCommerce on Hypernode
---

<!-- source: https://support.hypernode.com/en/ecommerce/woocommerce/how-to-set-up-a-cron-job-for-wordpress-woocommerce-on-hypernode/ -->
hpowernl marked this conversation as resolved.
Show resolved Hide resolved

# How to set up a cron job for WordPress/WooCommerce on Hypernode

In this guide, we'll explain how to replace the default WordPress cron job with a cron job on your Hypernode server. This can be useful for low traffic sites, important tasks that need to be run at specific times, mitigating excessive DDoS attacks, or improving high page load times.

## Disable WordPress cron

To begin, disable the default WordPress cron by editing the wp-config.php file.

Connect to your server using an FTP client like FileZilla or an SSH client such as PuTTY. Navigate to the root directory of your WordPress installation and locate the `wp-config.php` file. Open the file for editing and add the following line of code before `/* That’s all. Stop editing! Happy blogging. */`:

```php
define('DISABLE_WP_CRON', true);
```

This code disables the default WordPress cron functionality, allowing you to set up a cron job.

## Adding a new cron job to your server

Next, set up a cron job on your Hypernode server. Log in to your server via SSH and open your crontab file with the following command:

```bash
crontab -e
hpowernl marked this conversation as resolved.
Show resolved Hide resolved
```

Add the following line to your crontab file to set up a cron job that runs every minute:

```console
hpowernl marked this conversation as resolved.
Show resolved Hide resolved
* * * * * wget -q -O - 'https://yourdomain.hypernode.io/wp-cron.php?doing_wp_cron' >/dev/null 2>&1
```

Replace `https://yourdomain.hypernode.io` with the actual URL of your WordPress site.

Explanation of the Cron Job Command

- `* * * * *`: Specifies the interval for the cron job. In this case, it is set to run every minute. You can adjust this based on your needs.
- `wget -q -O - 'https://yourdomain.hypernode.io/wp-cron.php?doing_wp_cron'`: Uses wget to make a web request to the WordPress cron URL, triggering any scheduled tasks.
- `>/dev/null 2>&1`: Discards any output from the command, preventing it from filling up your server logs.

After setting up your cron job, monitor your WordPress site to ensure that scheduled tasks are being executed as expected. This setup ensures that your WordPress or WooCommerce site on Hypernode handles scheduled tasks more reliably, especially under conditions where the default cron system may not suffice.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
myst:
html_meta:
description: How to enhance your WordPress/WooCommerce site's performance using
Redis. Discover the benefits of Redis, recommended plugins, and step-by-step
installation instructions.
title: How to Use Redis with WooCommerce and WordPress on Hypernode
---

<!-- source: https://support.hypernode.com/en/ecommerce/woocommerce/how-to-use-redis-with-woocommerce-and-wordpress-on-hypernode/ -->
hpowernl marked this conversation as resolved.
Show resolved Hide resolved

# How to Use Redis with WooCommerce and WordPress on Hypernode

Remote Dictionary Server (Redis) is an in-memory, persistent, key-value database known as a data structure server. Unlike similar servers, Redis can store and manipulate high-level data types such as lists, maps, sets, and sorted sets.

By storing important data in its memory, Redis ensures fast data retrieval, significantly boosting performance and reducing response times.

## Which Plugins Can We Use for Redis in WordPress/WooCommerce?

There are several plugins available for Redis. The two most commonly used are [Redis Object Cache](https://wordpress.org/plugins/redis-cache/) and [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/).

Due to the complexity of the cache module in "W3 Total Cache" and the possibility that you may already be using other cache plugins, we recommend the "Redis Object Cache" plugin.

## How to Install Redis Object Cache

Redis is already active on the server on port 6379.
hpowernl marked this conversation as resolved.
Show resolved Hide resolved

Next, install the Redis Object Cache plugin via the WordPress Dashboard or using Composer. For detailed installation instructions, please refer to the standard installation procedure for WordPress plugins.

After installing and activating the plugin, navigate to `WordPress` -> `Settings` -> `Redis` or `Network Admin` -> `Settings` -> `Redis on Multisite networks`. Enable the cache and check if the plugin can connect automatically.
Loading