Confirm buffer is not empty before erasing

Confirm file_exists before opening. For PHP 5.3 or earlier, check if
safe_mode is active to avoid errors.
Use wp_send_json() WordPress function for AJAX

The header(), json_encode(), and die(), functions are all executed with
a better logical routine that should provide consistent results.
Allow downloadable products URL to be relative
Introduce 'woocommerce_get_order_item_totals_excl_free_fees' filter

The new filter will allow plugins that add order item meta to choose to
display the free fee items on order details pages and emails.
Field show/hide options for stock fields and variations
Product admin/saving
Simplify get_children and use stock status rather than stock level
Conditional is no longer required
Add sanity check to stock status change
Only call the method to update stock when it changes
Hide status box for variables and handle save event
Only use a value for changes - allows automatic changes to stock status to take over
Static is required
Handle stock for self and children, as well as syncing status with the children
Variation class modifications (see details)

- Made it load data on the fly, rather than loading it all at once
- Pull some data from variation, some from parent
- Updated stock methods to use variation or parent depending on
manage_stock
- Ensure parent stays in sync on stock status change event
Data update
created the wc_get_product_types() function
initial create product API method
fixed a error when get the thumbnail by API

Fixed the error:

PHP Notice: Trying to get property of non-object in wp-includes/post-template.php on line 29
created methods to save product images by API