Focus on cloud service provider activities
Notes on website operation and maintenance

WPCOS plug-in enables WordPress to upload pictures to Tencent Cloud COS object storage separately

In the process of selecting and using the WordPress program as a website, many of us feel that the opening speed of the website is getting slower and slower as the content of the website is rich, but many personal websites are rich in content but the opening speed is still quite fast, even though the configuration is not much different. In fact, it's not just the WordPress program. If possible, as the website content becomes more, especially the image and attachment media resources, it will take up more bandwidth resources.

We can consider storing static resources separately, such as Qiniu Cloud, Youpai Cloud, Tencent Cloud COS, Alibaba Cloud OSS and other third-party storage. In this article, Lao Zuo shared that static resources that can be uploaded based on WordPress programs can be stored separately in COS after uploading, or can be synchronously backed up to local and COS, Then call the resources in the COS object storage in the website to improve the website opening speed.

First, apply for Tencent Cloud COS object storage

Here, before using Tencent Cloud COS object storage, we recommend purchasing storage packages, which saves costs compared with charging traffic separately. Of course, if we need to bind a domain name to use CDN in the future, we also need to buy a CDN traffic package. Purchase Tencent Cloud COS storage package here

 Apply for Tencent Cloud COS object storage

Not all regions have resource packs. Some regions do not have resource packs.

Second, open COS bucket extraction parameters

 WPCOS plug-in enables WordPress to upload pictures to Tencent Cloud COS object storage separately - 2nd

Here we select the desired region and create a bucket. Pay attention to the read/write permissions. You can select public read/private write, or public read/write, so that the pictures or resources you upload later can be displayed on the website. I don't care about the parameters here. They will be obtained together.

 WPCOS plug-in enables WordPress to upload pictures to Tencent Cloud COS object storage separately - Page 3

Here, you can see several parameters marked on the left in the figure above in the [Basic Configuration] corresponding to the COS bucket, which will be used later.

Third, get Tencent Cloud API

After the above parameters are obtained, we also need to obtain Tencent Cloud API key information, or we cannot upload it.

 WPCOS plug-in enables WordPress to upload pictures to Tencent Cloud COS object storage separately - 4th

Some netizens can't find the Tencent cloud password anywhere, as shown in the above figure [Key Management].

 WPCOS plug-in enables WordPress to upload pictures to Tencent Cloud COS object storage separately - Page 5

Then we can create a new key in the key management, or obtain the existing password directly. Three parameters are required: APPID SecretId、SecretKey。 The WPCOS plug-in needs to be configured later.

IV. WPCOS plug-in download, installation and configuration

1. Plug in download

WPCOS plug-in: https://github.com/laobuluo/wpcos/

It should not be difficult to download and install plug-ins into your current WP. In view of the compatibility of plug-ins, Laozuo suggested backing up the website first.

2. Plug in activation configuration

 WPCOS plug-in enables WordPress to upload pictures to Tencent Cloud COS object storage separately - Page 6

Fill in according to the parameters we know. In particular, we need to pay attention to two things: local folders. Generally, we fill in "wp content/uploads". The COS remote address is the [access domain name] on our bucket, and we also need to add a tail, such as“ https://laozuo-1252202521.cos.ap-shanghai.myqcloud.com/ wp-content/uploads ", the tail needs to correspond to the local folder above.

Whether to save locally depends on us. If you want to save a copy locally, do not check it. If you just want to transfer it to COS, check it. After the configuration is completed, we upload an image to try. If the image can be stored in Tencent Cloud COS object storage and can be seen on the website, it shows that there is no problem. If not, we need to adjust to see what the problem is.

Fifth, problems needing attention

If we are an old website ready to start the WPCOS plug-in, after switching plug-ins, we need to manually upload all the image attachments in the local website to the corresponding bucket folder of Tencent Cloud COS, and need to batch replace the static file addresses in the database.

This plug-in currently has a small bug. If the default upload path is not restored after uninstalling the plug-in, you need to manually adjust it. See whether to fix this problem later.

Vote for you
Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » WPCOS plug-in enables WordPress to upload pictures to Tencent Cloud COS object storage separately


Scan the code to follow the official account

Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge