woocommerce / wc-api-ruby

A Ruby wrapper for the WooCommerce API.
MIT License
69 stars 73 forks source link

JSON Parse error #37

Closed ayalaalex closed 7 years ago

ayalaalex commented 7 years ago

I'm getting error when issuing a get product p = woocommerce.get("products", sku: barcode)

logs:

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WPCACHE KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob ject-cache.php on line 1294

Warning: Cannot modify header information - headers already sent by (out put started at /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/obj ect-cache.php:1294) in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp- includes/rest-api/class-wp-rest-server.php on line 1244

Warning: Cannot modify header information - headers already sent by (out put started at /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/obj ect-cache.php:1294) in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp- includes/rest-api/class-wp-rest-server.php on line 1244

Warning: Cannot modify header information - headers already sent by (out put started at /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/obj ect-cache.php:1294) in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp- includes/rest-api/class-wp-rest-server.php on line 1244

    from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/json-2.0.3/lib

/json/common.rb:156:in parse' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/json-2.0.3/lib /json/common.rb:156:inparse' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14. 0/lib/httparty/parser.rb:118:in json' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14. 0/lib/httparty/parser.rb:138:inparse_supported_format' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14. 0/lib/httparty/parser.rb:105:in parse' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14. 0/lib/httparty/parser.rb:67:incall' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14. 0/lib/httparty/request.rb:345:in parse_response' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14. 0/lib/httparty/request.rb:297:inblock in handle_response' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14. 0/lib/httparty/response.rb:25:in call' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14. 0/lib/httparty/response.rb:25:inparsed_response' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14. 0/lib/httparty/response.rb:80:in method_missing' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14. 0/lib/httparty/response.rb:48:ininspect' from C:/RailsInstaller/Ruby2.2.0/bin/irb:11:in `

' irb(main):012:0>

claudiosanches commented 7 years ago

Very easy to debug, since you need to fix the file /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/object-cache.php

Not to mention that this file is not from WooCommerce or this REST API lib...

ayalaalex commented 7 years ago

Thanks Claudio. Not sure how wordpress got messed up, anyhow I define WP_CACHE_KEY_SALT if it wasn't defined and that fixed the problem. weird.

claudiosanches commented 7 years ago

@ayalaalex this comes from your cache plugin, that suppose to define it for you.