ensky的跨境笔记

WP REST API上传图片返回500错误码

使用Wordpress REST API上传图片遇到错误码500,尝试在PHP配置中增大memory_limit,以及在wp-config.php中增大memory size,都无法解决问题。 最后发现是PHP Fatal error: gd-webp cannot allocate temporary buffer 。当上传图片时,WordPress的GD库尝试处理WebP格式图片时内存不足。 解决方法:PHP安装扩展imagick. 若可视化安装失败,可通过源码编译,步骤如下(以 PHP 7.4 为例,替换为你的 PHP 版本): 下载对应版本的 Imagick 扩展源码(推荐从 PECL 官方下载,匹配 PHP 版本): # 下载Imagick扩展(版本可根据PHP版本调整,如3.7.0兼容PHP 7.0+,4.0.0兼容PHP 8.0+) wget https://pecl.php.net/get/imagick-3.7.0.tgz # 解压源码包 tar zxvf imagick-3.7.0.tgz cd imagick-3.7.0… Continue Reading →

Shoptimizer Speed up

Shoptimizer主题速度优化,需要安装如下插件: AutoptimizeBreezeJetpack (just the CDN modules)Flying ScriptsAsset CleanUpCode Snippets 1.安装Autoptimize https://wordpress.org/plugins/autoptimize 按照下述图片设置 在Images中设置Lazy-Load的图片,可以把Logo的图片放到这里,或者不设置也可以。 设置Extra The Preload specific requests should be the full URL of your logo path 2. 安装Breeze https://wordpress.org/plugins/breeze 安装后,默认配置即可,如下: 3.安装Jetpack启用CDN Jetpack->Settings->Performance 在设置界面的最下方,有一个“Module”的链接,点击它。如果不需要其余功能,那么其余的全部关闭,只保留Asset CDN和Image CDN。如下: 4.安装Flying Scripts 插入如下JS 如下: 5.安装Asset CleanUp… Continue Reading →

通过RSET API上传图片到WordPress Media

通过REST API上传图片或者其余媒体文件。 第二种方式,可以设置图片的Title、ALT等 WordPress上传图片以后,会自动生成不同尺寸的图片,比如上传的是dog.jpg, 可能会生成dog-600*600.jpg, dog-300*300.jpg, 本来一张图片只有100KB,但是自动生成了好几张,存储空间可能就翻倍了。如果不需要自动生成,可以使用如下代码,放到theme->function.php文件中

下单后只有Billing地址,没有Shipping地址

下单后没有shipping address,只有Billing address,可能的原因:可能是没有配置shipping zone。 如何配置shipping zone? wooocommerce->setting->shipping

宝塔通过反向代理建设网站

假设我们有两台VPS,一台作为反向代理服务器(前台),一台作为后台服务器。 步骤01: 后台服务器安装宝塔,安装一个默认网站 比如默认网站名字为 defaultwebsite.sky, 名字随意,网站为静态,安装一个加的SSL证书(https://myssl.com/create_test_cert.html)。随后在宝塔面板中将其设置为默认网站。 步骤02:在后台正常创建网站 比如创建网站01: www.houduan01.com 创建网站02: www.houduan02.com 正常安装Wordpress,网站申请SSL,其余操作先不要做,先不要开启伪静态 步骤03:前台创建反向代理服务器 创建两个反向代理服务器 www.qianduan01.com, www.qianduan02.com,只需要创建为纯静态的网站。网站申请SSL证书,以支持https。 然后创建反向代理服务器,详细流程可以参考宝塔官方教程:https://www.bt.cn/bbs/thread-43588-1-1.html 具体配置如下:(上图生成的默认配置) 对于第二个反向代理服务器 www.qianduan02.com也是安装上述方式创建。 这个时候当我们访问 https://www.qianduan01.com的时候应该会出现www.houduan01.com的首页。如果访问失败,或者显示重定向次数过多,说明配置有错误。 在访问正常的前提下,继续配置。在www.houduan01.com的wp.config.php中添加如下代码: define(‘WP_HOME’,’https://www.qianduan01.com’); define(‘WP_SITEURL’,’https://www.qianduan01.com’); 配置成功以后,访问www.qianduan01.com/about/应该可以正常显示,不会跳转到www.houduan01.com/about/ 现在可以配置伪静态了。 问题01:访问www.qianduan01.com/blog/,内容或者媒体资源暴露了houduan01.com的路径。 在反代配置中添加如下代码: 问题02: 访问www.houduan02.com的时候会跳转到www.houduan01.com 先创建一个default网站,并且创建一个假的SSL证书,设置为默认网站。 注意不要一直使用同一个浏览器,或者每次访问网站后把浏览器缓存全部清空一次。或者换几个浏览器用,比如Chrome多个标签,或者Safari,IE等换着用,还可以用手机的。 如果上述措施都不起作用,系统重装,然后先创建一个Default网站,再创建正常网站。 注意事项01: 注意https与http不要混淆,每个步骤使用的都是https

点击产品页面报Great things are on the horizon

点击产品页面报如下错误: Great things are on the horizonSomething big is brewing! Our store is in the works and will be launching soon! 看看是不是这个地方没有设置好: WordPress Dashboard-> Woocommerce->Setting->Site visibility->Live, 不要设置为coming soon

aaPanel to BT

宝塔英文版本如何切换到中文宝塔? 输入命令BT,会看到stop,将英文版本暂停以后。 直接安装中文版本的BT 英文宝塔脚本是否已经删除,没去检查,中文BT可以正常用。

Rankmath Automate Insertion of Focus Keyword

How to Automate the Insertion of Focus Keyword If your website consists of numerous posts without focus keywords, then adding them one by one could be tedious. So in this knowledgebase article, we’ll show you how you can automate the… Continue Reading →

How does SiteGround protect my website?

使用siteground共享主机,是否提供安全防护? 首先看一下官方的解释:https://www.siteground.com/kb/how_does_siteground_protect_my_website/ 安全措施如下: 1. We have sophisticated IDS/IPS systems which block malicious bots and attackers (Intrusion detection/prevention systems). We are constantly monitoring for vulnerabilities in the most popular applications and modules and whenever possible we develop virtual patches in the… Continue Reading →

Cloudflare WAF Rate Limiting

使用Cloudflare对网站访问速率进行限制,可以过滤高频率的爬虫。 URL路径包含“/”,表示包含域名下的所有资源,访问任意网址都会走这条规则。 上述表示在10秒钟内请求50次则返回429,会阻止用户访问。这个数值50需要根据自己的网站情况来设置。并不是一个固定的数据。

« Older posts

© 2026 ensky的跨境笔记 — Powered by WordPress

Theme by Anders NorenUp ↑