搭建wordpress
1,先搭建好wordpress,基本设置好
2,开启Log 和 debug功能,准备好开发了。
config.php 设置:
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WPS_DEBUG', true );
php.ini 设置:
ini_set("log_errors", 1);
ini_set("error_log", "/tmp/php-error.log");
参考A Complete Guide to WordPress Debugging (Enable WP_DEBUG + Other Tools) (kinsta.com)
查看log,debug的地方:
1,管理后台:/wp-admin/admin.php?page=wc-status
2,宝塔的服务器错误日志
3,/wp-content->debug.log
3,ssl证书和https,必须的。
阿里云ssl证书
4,基本wordpress功能学习,最基础的知识推荐看《阿树》,深入浅出了解,建议看wordpress大学
//备注: 安装woocommerce手把手教程:http://www.chenfei.cn/wordpress/#%E9%85%8D%E7%BD%AEWooCommerce%E7%94%B5%E5%95%86%E6%8F%92%E4%BB%B6
4.1, WooCommerce 基本类
Classes in WooCommerce – WooCommerce
WC_Product
WC_Customer
WC_Cart
4.2, rest-api
WooCommerce REST API – WooCommerce
5,程序员需要基本了解客户基本需求,看看《 60分及格的独立站 》
6,安装在服务器的情况下可能的问题:解决线上不能操作文件权限问题
安装woocommerce插件:
1,直接从后台插件市场安装woocommerce,或者上传插件文件到plugin
注意:可能出现Google Listings and Ads插件不能安装问题,先跳过它。
2,选择模板 storefront 安装
3,创建一个商品作为测试一下功能
4,导入商品数据方便测试,参考 ,路径在 wordpress\wp-content\plugins\woocommerce\sample-data
5,观察和熟悉各种商品类型,都是很重要
- Simple – covers the vast majority of any products you may sell. Simple products are shipped and have no options. For example, a book.
- Grouped – a collection of related products that can be purchased individually and only consist of simple products. For example, a set of six drinking glasses.
- External or Affiliate – one that you list and describe on your website but is sold elsewhere.
- Variable – a product with variations, each of which may have a different SKU, price, stock option, etc. For example, a t-shirt available in different colors and/or sizes.
开发环境的注意:
1,关闭卡慢资源(Gravatar, google font 等),wordpress是国际化的开源软件,所以国内环境需要适应一下。参考:wordpress页面访问太慢?教你3招优化性能 – 简书 (jianshu.com)
2,运行起来看看有没有问题,支付方式可以选择银行转账,或者checkout测试,完成整个支付购买流程。 注意要配置好SMTP发邮件,不然会报错。
- I noticed some other similar 504 errors on forums relating to mail, which I thought would make sense based on the login and ordering with emails firing.
I disabled woocommerce email notifcations, the orders now complete and show client side.
3,SMTP:
推荐插件 https://wordpress.org/plugins/easy-wp-smtp/
邮件日志记录插件:
WP Mail Logging – WordPress plugin | WordPress.org
4,(选)性能监控插件,query-monitor 插件,教程
5,(选) https://tideways.com/ 性能监控服务
6, New relic ,最著名的性能监控。