Home Experience & Tips Sharing Standard Post

Standard Post

Solution for Failed WordPress Theme Demo Data Import on Domestic Servers

Today, when Naiba was importing demo data of the Astra theme on a domestic server, due to network issues, the import failed many times. Normally, after installing a domestic server, using plugins like kill 429 or wp china yes can speed up access to wordpress.org websites, allowing installation and updates of plugins...

Posted on April 19, 2020 About 8 minutes read
国内服务器WordPress导入主题Demo数据失败的解决方法

Today, Naiba was importingAstra ThemeWhen importing demo data, due to network issues, the import failed many times. Normally, after installing a domestic server, using plugins like kill 429 or wp china yes can speed up access to wordpress.org websites, allowing installation and updates of plugins.

However, for the data of these specific plugins and themes, the requests are not made to the WordPress official website, but to the plugin and theme's own websites. Domestic servers are prone to poor network conditions, leading to installation and import failures.

There are two solutions:

  1. Debug the website data on a foreign server, then back up and restore the data to the domestic server;
  2. Set up a proxy server for WordPress on the domestic server to accelerate requests to foreign websites.

Naiba uses the second method here, employing v2raψ as a proxy for access.

The specific steps are as follows:

1. Purchase a foreign server with decent access speed from the domestic server.Foreign Server

You can ping foreign servers from your own server to check the ping value. Generally, if the line exceeds 250ms, it may be laggy to use.

2. Install v2ray on the server

bash <(curl -L -s https://install.direct/go.sh)

After installation, open the configuration file at /etc/v2raψ/config.json and note the following:

  • port value
  • uuid value

3. Install v2ray on the domestic server

The method is the same as the code above, but the download may be slow. Refer to this article.Accelerating Github

4. Modify the configuration file /etc/v2ray/config.json

Delete the default content of the configuration file, paste the content below, and then modify the parts explained in Chinese.

{
    "log": {
        "loglevel": "warning"
    },
    "inbound": {
        "listen": "127.0.0.1",
        "port": 8080,
        "protocol": "http",
        "settings": {
            "allowTransparent": false,
            "userLevel": 1
        }
    },
    "outbound": {
        "protocol": "vmess",
        "settings": {
            "vnext": [
                {
                    "address": "168.168.168.168这里改成代理网站IP",
                    "port": 8888这里改成代理网站端口,
                    "users": [
                        {
                            "id": "c503b067-e78f-b037-1ac7-7b369103ec9f这里改成代理网站的uuid",
                            "level": 1,
                            "alterId": 64
                        }
                    ]
                }
            ]
        }
    },
    "outboundDetour": [
        {
            "protocol": "freedom",
            "settings": {},
            "tag": "direct"
        }
    ],
    "routing": {
        "strategy": "rules",
        "settings": {
            "rules": [
                {
                    "type": "field",
                    "port": "54-79",
                    "outboundTag": "direct"
                },
                {
                    "type": "field",
                    "port": "81-442",
                    "outboundTag": "direct"
                },
                {
                    "type": "field",
                    "port": "444-65535",
                    "outboundTag": "direct"
                },
                {
                    "type": "field",
                    "domain": [
                        "gc.kis.scr.kaspersky-labs.com"
                    ],
                    "outboundTag": "direct"
                },
                {
                    "type": "chinasites",
                    "outboundTag": "direct"
                },
                {
                    "type": "field",
                    "ip": [
                        "0.0.0.0/8",
                        "10.0.0.0/8",
                        "100.64.0.0/10",
                        "127.0.0.0/8",
                        "169.254.0.0/16",
                        "172.16.0.0/12",
                        "192.0.0.0/24",
                        "192.0.2.0/24",
                        "192.168.0.0/16",
                        "198.18.0.0/15",
                        "198.51.100.0/24",
                        "203.0.113.0/24",
                        "::1/128",
                        "fc00::/7",
                        "fe80::/10"
                    ],
                    "outboundTag": "direct"
                },
                {
                    "type": "chinaip",
                    "outboundTag": "direct"
                }
            ]
        }
    }
}

After configuration, restart the v2ray service with systemctl restart. If you don't know how, just restart the server directly.

5. Edit the WordPress configuration file and add proxy configuration information.

/** 代理 */
define('WP_PROXY_HOST', '127.0.0.1');
define('WP_PROXY_PORT', '8080');
define('WP_PROXY_BYPASS_HOSTS', 'localhost, *.wordpress.org');

Add the foreign URLs that WordPress needs to access to the third line above, save, and upload to overwrite.

Then go to the WordPress backend to test the effect. Previously, plugin resources that could not be loaded normally can now be accessed normally.

Reference: https://s5s5.me/3721

2.2/5 - (17 votes)
Previous Solutions for Slow GitHub Download Speeds on Domestic Servers Continue reading content around the same timeline. Next Case Study: How to Do SEO Optimization and Promotion for a Foreign Trade Independent Website? View the next related tutorial or experience.

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: