woocommerce/wc-api-php là một trong những repo mã nguồn mở mà TopGit theo dõi, hiện có 547 sao, viết chủ yếu bằng PHP. WooCommerce REST API PHP Library
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
A PHP wrapper for the WooCommerce REST API. Easily interact with the WooCommerce REST API securely using this library. If using a HTTPS connection this library uses BasicAuth, else it uses Oauth to provide a secure connection to WooCommerce.
Installation
composer require automattic/woocommerce
Getting started
Generate API credentials (Consumer Key & Consumer Secret) following this instructions http://docs.woocommerce.com/document/woocommerce-rest-api/
.
Check out the WooCommerce API endpoints and data that can be manipulated in https://woocommerce.github.io/woocommerce-rest-api-docs/.
Setup
Setup for the new WP REST API integration (WooCommerce 2.6 or later):
require __DIR__ . '/vendor/autoload.php';
use Automattic\WooCommerce\Client;
$woocommerce = new Client(
'http://example.com',
'ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
[
'version' => 'wc/v3',
]
);
Client class
$woocommerce = new Client($url, $consumer_key, $consumer_secret, $options);
Options
Option
Type
Required
Description
url
string
yes
Your Store URL, example: http://woo.dev/
consumer_key
string
yes
Your API consumer key
consumer_secret
string
yes
Your API consumer secret
options
array
no
Extra arguments (see client options table)
Client options
Option
Type
Required
Description
version
string
no
API version, default is wc/v3
timeout
int
no
Request timeout, default is 15
verify_ssl
bool
no
Verify SSL when connect, use this option as false when need to test with self-signed certificates, default is true
follow_redirects
bool
no
Allow the API call to follow redirects
query_string_auth
bool
no
Force Basic Authentication as query string when true and using under HTTPS, default is false
oauth_timestamp
string
no
Custom oAuth timestamp, default is time()
oauth_only
bool
no
Only use oauth for requests, it will disable Basic Auth, default is false
user_agent
string
no
Custom user-agent, default is WooCommerce API Client-PHP
wp_api_prefix
string
no
Custom WP REST API URL prefix, used to support custom prefixes created with the rest_url_prefix filter
wp_api
bool
no
Set to false in order to use the legacy WooCommerce REST API (deprecated and not recommended)
method_override_query
bool
no
If true will mask all non-GET/POST methods by using POST method with added query parameter ?_method=METHOD into URL
method_override_header
bool
no
If true will mask all non-GET/POST methods (PUT/DELETE/etc.) by using POST method with added X-HTTP-Method-Override: METHOD HTTP header into request
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/woocommerce/wc-api-php là nguồn chính thức.
woocommerce/wc-api-php có bao nhiêu sao?
woocommerce/wc-api-php có 547 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/woocommerce/wc-api-php. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
woocommerce/wc-api-php có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho woocommerce/wc-api-php. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
woocommerce/wc-api-php có trang demo không?
Dự án có trang chủ ở https://packagist.org/packages/automattic/woocommerce. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
woocommerce/wc-api-php còn đang phát triển không?
Commit gần nhất trên woocommerce/wc-api-php là 2 tháng trước (theo timestamp GitHub). Repo có 157 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
woocommerce/wc-api-php dùng license gì?
woocommerce/wc-api-php phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
woocommerce/wc-api-php viết bằng ngôn ngữ gì?
woocommerce/wc-api-php chủ yếu viết bằng PHP. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc wc-api-php có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về wc-api-php.