woocommerce / wc-api-php

WooCommerce REST API PHP Library
https://packagist.org/packages/automattic/woocommerce
MIT License
528 stars 160 forks source link

Rename this package to be more generic #311

Closed klodoma closed 2 years ago

klodoma commented 2 years ago

Hi,

Consider this more as a feedback and/or suggestions.

I see this package as a "generic" API package. It is simple from concept and for wordpress/woocomerce it works for both.

I just tried it out for WP API and looks good, I tried it only with Basic Auth for Wordpress. For the WP REST API authentication, I had to install the WordPress REST API Authentication plugin.

Example:

        $woocommerce = new \Automattic\WooCommerce\Client(
            env('WP_URL'),
            env('WP_USER'),
            env('WP_PASSWORD'),
            [
                'version' => 'wp/v2',
            ]
        );

        $result = $woocommerce->put('post/8998', [
            'title' => 'My Title',
            'content' => 'My Content'
        ]);        

Maybe we could add this in the documentation?

claudiosanches commented 2 years ago

Hello @klodoma,

For sure this library can be used for more things, but for now I only plan to support WooCommerce to make things easy.