__PHP_Incomplete_Class_Name
-
Hi, we are having the following error in the REST API response meta_data array:
“__PHP_Incomplete_Class_Name”: “WC_Meta_Data”
This error is in all of the meta_data entries. I checked the products and orders and both have this issue.
Any help will be greatly appreciated!
Thanks!
-
Thank you for using our plugin!
Without more information it is hard for us to determine the cause of your issue. Am I correct to understand you are caching a WooCommerce API endpoint? If so which one?
Or are you caching a custom endpoint? If so, could it be your endpoint isn’t correctly json encoded?Hi,
Actually we are caching both woocommerce API endpoints and custom endpoints. And all of them have this issue.
After clearing cache, the response is good only for the first time. And then it gets cached and then show the “__PHP_Incomplete_Class_Name”: “WC_Meta_Data” error.
It would be really great if this can be resolved.
Thanks!
I just did some test with a clean WP installation with WooCommerce and if I cache the endpoint (like
/wp-json/wc/v3/products
) I don’t get the__PHP_Incomplete_Class_Name
error. So it appears there is some code on you installation that is adding something to the REST response which is causing this issue.Could you share a REST response you are getting this issue with? Or even better share the URL of an endpoint that is having this issue? If you don’t want to share it on a public forum like this, you could email it to plugins [at] acato [dot] nl
Hi, I have emailed the details.It has the endpoint URL and the response that I am getting.
Thanks!
Did you ever figure this out? I’m having the same issue with my WooCommerce installation & caching the products endpoint.
Actually, in my case, there was some custom code in the functions.php that was caching the woocommerce endpoints(for products, orders, users). I had to remove that to make it work.
And what I understood was that these woocommerce endpoints were already cached by default by the plugin(after reading the FAQ section on the plugin page). So the custom code in functions.php was extra and causing issues and I just removed that custom code.
Hope this helps.
Thanks for the reply! In my case the WooCommerce endpoints are NOT cached and I have implemented this method in my functions.php:
function wprc_add_wc_endpoints( $allowed_endpoints ) { if ( ! isset( $allowed_endpoints[ 'wc/v3' ] ) || ! in_array( 'products', $allowed_endpoints[ 'wc/v3' ] ) ) { $allowed_endpoints[ 'wc/v3' ][] = 'products'; } return $allowed_endpoints; } add_filter( 'wp_rest_cache/allowed_endpoints', 'wprc_add_wc_endpoints', 10, 1); function wprc_add_cacheable_request_headers( $cacheable_headers ) { $cacheable_headers['wc/v3/products'] = 'authorization'; return $cacheable_headers; } add_filter('wp_rest_cache/cacheable_request_headers', 'wprc_add_cacheable_request_headers', 10, 1);
hey everyone,
I am facing same issue with WooCommerce WC_Meta_object class. Unless I force encode/decode the result being passed, it returns as incomplete class error:
public function save_cache( $result, \WP_REST_Server $server, \WP_REST_Request $request ) { // Only Avoid cache if not 200. if ( ! empty( $result ) && is_array( $result ) && isset( $result['data']['status'] ) && 200 !== (int) $result['data']['status'] ) { return $result; } // Do not cache if empty result set. if ( empty( $result ) ) { return $result; } // force evaluate the result $result = json_decode(wp_json_encode($result)); $data = array( 'data' => $result, 'headers' => $this->response_headers, ); \WP_Rest_Cache_Plugin\Includes\Caching\Caching::get_instance()->set_cache( $this->cache_key, $data, 'endpoint', $this->request_uri, '', $this->request_headers ); return $result; }
The issue seems to be that WC_meta_object class i not available to wp-rest-cache plugin, Do you have a better idea on how to fix?
We never continued on this ticket because hassantahir176 never responded to our question we send him after emailing us.
To be clear: our plugin does not cache any WooCommerce endpoints by default.
As said: I have investigated this issue before, but was unable to reproduce it. I am willing to look into it, but need additional info to be able to do so. Could you share a REST response (non-cached, so the original before it is cached) you are getting this issue with? Or even better share the URL of an endpoint that is having this issue? If you don’t want to share it on a public forum like this, you could email it to plugins [at] acato [dot] nl
Here’s an example of non-cached request:
{ "id": 27917, "name": "Estradilla Musiikkiopiston Solistit, ilmaiskonsertti (Livestream 12.11.2020)", "slug": "estradilla-musiikkiopiston-solistit-livestream-12-11-2020", "permalink": "https://www.semilive.fi/fi/product/keikat-ja-konsertit/estradilla-musiikkiopiston-solistit-livestream-12-11-2020/", "date_created": "2020-09-01T12:56:46", "date_created_gmt": "2020-09-01T09:56:46", "date_modified": "2020-11-01T18:05:24", "date_modified_gmt": "2020-11-01T16:05:24", "type": "simple", "status": "publish", "featured": true, "catalog_visibility": "visible", "description": "<p>[vc_row css=\".vc_custom_1588488238190{margin: 0px !important;padding: 0px !important;}\"][vc_column css=\".vc_custom_1588488243756{margin: 0px !important;padding: 0px !important;}\"][vc_raw_html css=\".vc_custom_1598952821282{margin-top: 0px !important;margin-right: 0px !important;margin-bottom: 0px !important;margin-left: 0px !important;padding-top: 0px !important;padding-right: 0px !important;padding-bottom: 0px !important;padding-left: 0px !important;}\"]JTNDJTIxLS1wbGF5ZXIlMjBjb2RlJTIwYmVnaW4tLSUzRSUwQSUzQ2RpdiUyMGlkJTNEJTIyc3ZwX3BsYXllcmJudjl2NXZzMDJnYyUyMiUyMHN0eWxlJTNEJTIyd2lkdGglM0E3MjBweCUzQmhlaWdodCUzQTQwNXB4JTNCcG9zaXRpb24lM0FyZWxhdGl2ZSUzQiUyMiUzRSUwQSUwOSUwQSUzQyUyRmRpdiUzRSUwQSUzQ3NjcmlwdCUyMGxhbmd1YWdlJTNEJTIyamF2YXNjcmlwdCUyMiUyMHR5cGUlM0QlMjJ0ZXh0JTJGamF2YXNjcmlwdCUyMiUyMHNyYyUzRCUyMiUyRiUyRnBsYXkud2VidmlkZW9jb3JlLm5ldCUyRmpzJTJGZHBsYXllci5qcyUyMiUzRSUzQyUyRnNjcmlwdCUzRSUwQSUzQ3NjcmlwdCUyMGxhbmd1YWdlJTNEJTIyamF2YXNjcmlwdCUyMiUzRSUwQSUzQyUyMS0tJTBBdmFyJTIwdmFycyUyMCUzRCUyMCU3QmNsaXBfaWQlM0ElMjJibnY5djV2czAyZ2MlMjIlMkN0cmFuc3BhcmVudCUzQSUyMnRydWUlMjIlMkNwYXVzZSUzQSUyMjElMjIlMkNyZXBlYXQlM0ElMjIlMjIlMkNiZ19jb2xvciUzQSUyMiUyM2ZmZmZmZiUyMiUyQ2ZzX21vZGUlM0ElMjIyJTIyJTJDbm9fY29udHJvbHMlM0ElMjIlMjIlMkNzdGFydF9pbWclM0ElMjIwJTIyJTJDc3RhcnRfdm9sdW1lJTNBJTIyMTAwJTIyJTJDY2xvc2VfYnV0dG9uJTNBJTIyJTIyJTJDYnJhbmRfbmV3X3dpbmRvdyUzQSUyMjElMjIlMkNhdXRvX2hpZGUlM0ElMjIxJTIyJTJDc3RyZXRjaF92aWRlbyUzQSUyMiUyMiUyQ3BsYXllcl9hbGlnbiUzQSUyMk5PTkUlMjIlMkNvZmZzZXRfeCUzQSUyMjAlMjIlMkNvZmZzZXRfeSUzQSUyMjAlMjIlMkNwbGF5ZXJfY29sb3JfcmF0aW8lM0EwLjYlMkNza2luQWxwaGElM0ElMjI2MyUyMiUyQ2NvbG9yQmFzZSUzQSUyMiUyMzAwMDAwMCUyMiUyQ2NvbG9ySWNvbiUzQSUyMiUyM2ZmZmZmZiUyMiUyQ2NvbG9ySGlnaGxpZ2h0JTNBJTIyJTIzZGQ5OTMzJTIyJTJDZGlyZWN0JTNBJTIyZmFsc2UlMjIlMkNpc19yZXNwb25zaXZlJTNBJTIydHJ1ZSUyMiUyQ3ZpZXdlcnNfbGltaXQlM0ExJTJDY2NfcG9zaXRpb24lM0ElMjJib3R0b20lMjIlMkNjY19wb3NpdGlvbk9mZnNldCUzQTcwJTJDY2NfbXVsdGlwbGllciUzQTAuMDMlMkNjY190ZXh0Q29sb3IlM0ElMjIlMjNmZmZmZmYlMjIlMkNjY190ZXh0T3V0bGluZUNvbG9yJTNBJTIyJTIzZmZmZmZmJTIyJTJDY2NfYmtnQ29sb3IlM0ElMjIlMjMwMDAwMDAlMjIlMkNjY19ia2dBbHBoYSUzQTAuMSUyQ2FzcGVjdF9yYXRpbyUzQSUyMjE2JTNBOSUyMiUyQ3BsYXlfYnV0dG9uJTNBJTIyMSUyMiUyQ3BsYXlfYnV0dG9uX3N0eWxlJTNBJTIyc3RhdGljJTIyJTJDc2xlZWtfcGxheWVyJTNBJTIyMCUyMiU3RCUzQiUwQXZhciUyMHN2cF9wbGF5ZXIlMjAlM0QlMjBuZXclMjBTVlBEeW5hbWljUGxheWVyJTI4JTIyc3ZwX3BsYXllcmJudjl2NXZzMDJnYyUyMiUyQyUyMCUyMiUyMiUyQyUyMCUyMjEwMCUyNSUyMiUyQyUyMCUyMjEwMCUyNSUyMiUyQyUyMCU3QnVzZV9kaXYlM0ElMjJzdnBfcGxheWVyYm52OXY1dnMwMmdjJTIyJTJDc2tpbiUzQSUyMjMlMjIlN0QlMkMlMjB2YXJzJTI5JTNCJTBBc3ZwX3BsYXllci5leGVjdXRlJTI4JTI5JTNCJTBBJTJGJTJGLS0lM0UlMEElM0MlMkZzY3JpcHQlM0UlMEElM0Nub3NjcmlwdCUzRVlvdXIlMjBicm93c2VyJTIwZG9lcyUyMG5vdCUyMHN1cHBvcnQlMjBKYXZhU2NyaXB0JTIxJTIwSmF2YVNjcmlwdCUyMGlzJTIwbmVlZGVkJTIwdG8lMjBkaXNwbGF5JTIwdGhpcyUyMHZpZGVvJTIwcGxheWVyLiUzQyUyRm5vc2NyaXB0JTNFJTBBJTNDJTIxLS1wbGF5ZXIlMjBjb2RlJTIwZW5kLS0lM0U=[/vc_raw_html][/vc_column][/vc_row]</p>\n", "short_description": "<p>ILMAISKONSERTTI, LIPPUKOODI OSTOSKORIN KAUTTA.</p>\n<h5>Estradilla Musiikkiopiston Solistit</h5>\n<p>Jyrki Lasonpalo, Kapellimestari<br />\nMikkelin Musiikkiopiston Solistit<br />\nVilhonkadun Kamariorkesteri</p>\n<p>Perinteik?s Musiikkiopiston Solistien Konsertti Kuullaan Marraskuun Puoliv?liss?. Mikaelin Lavalla Mikkelin 60-Vuotiaan Musiikkiopiston Opiskelijat P??sev?t N?ytt?m??n Yleis?lle Parhaat Taitonsa. Tiedossa On J?nnitt?vi? Hetki?, Kun Nuoret Taitajat P??sev?t Solisteiksi Ammattiorkesterin Eteen – Usein Ensimm?ist? Kertaa! Musiikkiopistot Ovat Merkitt?v? Osa Suomalaista Musiikkikoulutusta Ja Antavat Monelle Lapselle Ja Nuorelle Ev??t Elinik?iseen Musiikkiharrastukseen Ja Parhaimmillaan Viitoittavat Tien Ammattimuusikoksi. Mikkelin Kaupunginorkesteri Tekee Ylpe?n? Yhteisty?t? Oman Paikkakunnan Musiikkiopiston Kanssa. Konsertissa Mikkelin Kaupunginorkesteria T?ydent?? Vilhonkadun Kamariorkesteri, Jossa Soittavat Musiikkiopiston Pisimm?lle Ehtineet Jousisoittajat. Konsertin Johtaa Tuttuun Tapaan Konserttimestari Jyrki Lasonpalo.</p>\n<h5>MIKKELIN KAUPUNGINORKESTERI SEMILIVESS?</h5>\n<style>\n\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.wpcp-carousel-section.sp-wpcp-27925 .slick-prev,\n\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.wpcp-carousel-section.sp-wpcp-27925 .slick-next {\n\t\t\tcolor: #ffffff;\n\t\t\tbackground-color: #6c7779;\n\t\t\tborder-color: transparent;\n\t\t\tborder-radius: 0%;\n\t\t}\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.wpcp-carousel-section.sp-wpcp-27925 .slick-prev:hover,\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.wpcp-carousel-section.sp-wpcp-27925 .slick-next:hover {\n\t\t\tcolor: #ffffff;\n\t\t\tbackground-color: rgba(224,138,79,0.85);\n\t\t\tborder-color: transparent;\n\t\t}\n#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.wpcp-carousel-section.sp-wpcp-27925 ul.slick-dots {\n\t\tmargin: 0px 0px 0px 0px;\n\t}\n\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.wpcp-carousel-section.sp-wpcp-27925 ul.slick-dots li button {\n\t\tbackground-color: #6c7779;\n\t}\n\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.wpcp-carousel-section.sp-wpcp-27925 ul.slick-dots li.slick-active button {\n\t\tbackground-color: #e08a4f;\n\t}\n\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.wpcp-carousel-section.sp-wpcp-27925:not(.wpcp-product-carousel) .wpcp-single-item {\n\t\tborder: 1px solid #dddddd;\n\t\tpadding: 0px;\n\t}\n\n\t\t.wpcp-carousel-wrapper.wpcp-wrapper-27925{\n\t\t\tposition: relative;\n\t\t}\n\t\t#wpcp-preloader-27925{\n\t\t\tbackground: #fff;\n\t\t\tposition: absolute;\n\t\t\tleft: 0;\n\t\t\ttop: 0;\n\t\t\theight: 100%;\n\t\t\twidth: 100%;\n\t\t\ttext-align: center;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tz-index: 999;\n\t\t}\n\t\t\n\t\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.wpcp-carousel-section.sp-wpcp-27925 .slick-list {\n\t\t\tmargin-right: -10px;\n\t\t}\n\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.wpcp-carousel-section.sp-wpcp-27925 .slick-slide {\n\t\t\tmargin-right: 10px;\n\t\t}\n\t@media screen and (min-width: 981px) {\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.wpcp-carousel-section.sp-wpcp-27925:not(.wpcp-content-carousel) .wpcp-single-item img { max-height:840px; }\n\t}\n\t@media screen and (min-width: 737px) and (max-width: 980px) {\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.wpcp-carousel-section.sp-wpcp-27925:not(.wpcp-content-carousel) .wpcp-single-item img { max-height:840px; }\n\t}\n\t@media screen and (min-width: 481px) and (max-width: 736px) {\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.wpcp-carousel-section.sp-wpcp-27925:not(.wpcp-content-carousel) .wpcp-single-item img { max-height:840px; }\n\t}\n\t@media screen and (max-width: 480px) {\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.wpcp-carousel-section.sp-wpcp-27925:not(.wpcp-content-carousel) .wpcp-single-item img { max-height:840px; }\n\t}\n\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925 .wpcp-slide-image img,\n\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .wpcp-slide-image a {\n\t\tborder-radius: 6px;\n\t}\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925:not(.wpcp-product-carousel):not(.wpcp-content-carousel) .wpcp-single-item {\n\t\t\tbackground: #f9f9f9;\n\t\t}\n\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .wpcp-product-image{\n\t\t\tborder: 0px solid #dddddd;\n\t\t}\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .wpcp-product-title a{\n\t\t\tcolor: #444;\n\t\t}\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .wpcp-product-title {\n\t\t\ttext-align: center;\n\t\t\tfont-size: 15px;\n\t\t\tline-height: 23px;\n\t\t\tletter-spacing: 0px;\n\t\t\ttext-transform: none;}\n\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .wpcp-product-title a:hover {\n\t\t\tcolor: #555;\n\t\t}\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .wpcp-all-captions {\n\t\t\tcolor: #333;\n\t\t\tfont-size: 14px;\n\t\t\tline-height: 22px;\n\t\t\tletter-spacing: 0px;\n\t\t\ttext-transform: none;\n\t\t\ttext-align: center;}\n\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .wpcp-product-price del,\n\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .wpcp-product-price ins,\n\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .wpcp-product-price span {\n\t\t\tcolor: #222;\n\t\t\tfont-size: 14px;\n\t\t\tline-height: 26px;\n\t\t\tletter-spacing: 0px;\n\t\t\ttext-transform: none;\n\t\t\ttext-align: center;}\n\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .star-rating span::before {\n\t\t\tcolor: #e74c3c;\n\t\t}\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .star-rating::before {\n\t\t\tcolor: #e74c3c;\n\t\t}\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .woocommerce-product-rating .star-rating {\n\t\t\tfloat: none; margin: 8px auto;;\n\t\t}\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925 .wpcp-all-captions .wpcp-product-more-content a {\n\t\t\tcolor: #e74c3c;\n\t\t\tfont-size: 14px;\n\t\t\tline-height: 24px;\n\t\t\tletter-spacing: 0px;\n\t\t\ttext-transform: none;\n\t\t\ttext-align: center;}\n\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925 .wpcp-all-captions .wpcp-product-more-content a:hover {\n\t\t\tcolor: #e74c3c;\n\t\t}\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .wpcp-all-captions .wpcp-cart-button a.button {\n\t\t\tbackground: #ebebeb;\n\t\t\tborder-color: #d1d1d1;\n\t\t\tcolor: #545454;\n\t\t}\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .wpcp-all-captions .wpcp-cart-button a.added_to_cart,\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .wpcp-all-captions .wpcp-cart-button a.added_to_cart:hover,\n\t\t#wpcpro-wrapper #sp-wp-carousel-pro-id-27925.sp-wpcp-27925.wpcp-product-carousel .wpcp-all-captions .wpcp-cart-button a.button:hover {\n\t\t\tbackground: #3f3f3f;\n\t\t\tborder-color: #d1d1d1;\n\t\t\tcolor: #fff;\n\t\t}\n\t\t</style>\n<div id=\"wpcpro-wrapper\" class=\"wpcp-carousel-wrapper wpcp-wrapper-27925\"><div id=\"wpcp-preloader-27925\" class=\"wpcp-carousel-preloader\"><img src=\" https://www.semilive.fi/wp-content/plugins/wp-carousel-pro/public/css/bx_loader.gif \"/></div><div id=\"sp-wp-carousel-pro-id-27925\" class=\"wpcp-carousel-section sp-wpcp-27925 wpcp-product-carousel wpcp-preloader nav-vertical-center-inner wpcp-standard\" data-slick='{ \"accessibility\":true, \"centerMode\":false, \"centerPadding\": \"0px\", \"swipeToSlide\":true, \"adaptiveHeight\":false, \"arrows\":true, \"autoplay\":false, \"autoplaySpeed\":3000, \"dots\":true, \"infinite\":true, \"speed\":600, \"pauseOnHover\":true, \"slidesToScroll\":2, \"slidesToShow\":4, \"responsive\":[ { \"breakpoint\":1200, \"settings\": { \"slidesToShow\":4, \"slidesToScroll\":2, \"centerPadding\": \"0px\"} }, { \"breakpoint\":980, \"settings\":{ \"slidesToShow\":4, \"slidesToScroll\":2, \"centerPadding\": \"0px\" } }, { \"breakpoint\":736, \"settings\": { \"slidesToShow\":3, \"slidesToScroll\":2, \"centerPadding\": \"0px\" } }, {\"breakpoint\":480, \"settings\":{ \"slidesToShow\":2, \"slidesToScroll\":2, \"arrows\": true, \"dots\": true, \"centerPadding\": \"0px\" } } ], \"rows\":1, \"rtl\":false, \"variableWidth\":false, \"fade\":false, \"lazyLoad\": \"false\", \"swipe\": true, \"draggable\": true }' data-arrowtype=\"chevron\" dir=\"ltr\" dir=\"ltr\"><div class=\"wpcp-single-item\"><div class=\"wpcp-slide-image\"><a href=\"https://www.semilive.fi/fi/product/keikat-ja-konsertit/estradilla-musiikkiopiston-solistit-livestream-12-11-2020/\"><img class=\"wpcp-product-image\" src=\"https://www.semilive.fi/wp-content/uploads/2020/09/musiikkiopisto.jpg\" alt=\"\" width=\"600\" height=\"814\"></a></div></div><div class=\"wpcp-single-item\"><div class=\"wpcp-slide-image\"><a href=\"https://www.semilive.fi/fi/product/keikat-ja-konsertit/saimaa-sinfonietta-unohdettu-ja-loydetty-livestream-20-11-2020/\"><img class=\"wpcp-product-image\" src=\"https://www.semilive.fi/wp-content/uploads/2020/09/unonhdettu-ja-loydetty.jpg\" alt=\"\" width=\"600\" height=\"814\"></a></div></div><div class=\"wpcp-single-item\"><div class=\"wpcp-slide-image\"><a href=\"https://www.semilive.fi/fi/product/keikat-ja-konsertit/puccini-italialaisen-oopperan-mestari-livestream-3-12-2020/\"><img class=\"wpcp-product-image\" src=\"https://www.semilive.fi/wp-content/uploads/2020/09/puccini.jpg\" alt=\"\" width=\"600\" height=\"814\"></a></div></div><div class=\"wpcp-single-item\"><div class=\"wpcp-slide-image\"><a href=\"https://www.semilive.fi/fi/product/keikat-ja-konsertit/ida-elina-valkoinen-maa-livestream-10-12-2020/\"><img class=\"wpcp-product-image\" src=\"https://www.semilive.fi/wp-content/uploads/2020/09/ida-elina-valkoinen-maa.jpg\" alt=\"\" width=\"600\" height=\"814\"></a></div></div><div class=\"wpcp-single-item\"><div class=\"wpcp-slide-image\"><a href=\"https://www.semilive.fi/fi/product/menneet-tapahtumat/pyhainpaivan-requiem-livestream-31-10-2020/\"><img class=\"wpcp-product-image\" src=\"https://www.semilive.fi/wp-content/uploads/2020/09/img-2585.jpg\" alt=\"\" width=\"600\" height=\"814\"></a></div></div><div class=\"wpcp-single-item\"><div class=\"wpcp-slide-image\"><a href=\"https://www.semilive.fi/fi/product/menneet-tapahtumat/saimaa-sinfonietta-beethovenin-juhlissa-livestream/\"><img class=\"wpcp-product-image\" src=\"https://www.semilive.fi/wp-content/uploads/2020/09/tallenne-beethoven.jpg\" alt=\"\" width=\"600\" height=\"814\"></a></div></div><div class=\"wpcp-single-item\"><div class=\"wpcp-slide-image\"><a href=\"https://www.semilive.fi/fi/product/menneet-tapahtumat/sinfonia-concertante-livestream/\"><img class=\"wpcp-product-image\" src=\"https://www.semilive.fi/wp-content/uploads/2020/09/tallenne-sinfonia.jpg\" alt=\"\" width=\"600\" height=\"814\"></a></div></div></div>\n</div>\n", "sku": "19642|2020-11-12|3", "price": "0", "regular_price": "0", "sale_price": "", "date_on_sale_from": null, "date_on_sale_from_gmt": null, "date_on_sale_to": null, "date_on_sale_to_gmt": null, "price_html": "Tickets: ", "on_sale": false, "purchasable": true, "total_sales": 299, "virtual": true, "downloadable": false, "downloads": [], "download_limit": -1, "download_expiry": -1, "external_url": "", "button_text": "", "tax_status": "taxable", "tax_class": "reduced-rate", "manage_stock": false, "stock_quantity": null, "stock_status": "instock", "backorders": "no", "backorders_allowed": false, "backordered": false, "sold_individually": false, "weight": "", "dimensions": { "length": "", "width": "", "height": "" }, "shipping_required": false, "shipping_taxable": false, "shipping_class": "", "shipping_class_id": 0, "reviews_allowed": false, "average_rating": "0.00", "rating_count": 0, "related_ids": [ 2235, 1676, 1570, 3550, 1400 ], "upsell_ids": [], "cross_sell_ids": [], "parent_id": 0, "purchase_note": "", "categories": [ { "id": 93, "name": "Tulevat livestream-keikat", "slug": "keikat-ja-konsertit" }, { "id": 337, "name": "#spessuhinta", "slug": "spessuhinta" }, { "id": 284, "name": "Mikkelin kaupunginorkesteri", "slug": "mikkelin-kaupunginorkesteri" } ], "tags": [ { "id": 282, "name": "Klassinen", "slug": "klassinen" }, { "id": 220, "name": "Tuleva live", "slug": "tuleva-live" } ], "images": [ { "id": 27918, "date_created": "2020-09-01T15:32:22", "date_created_gmt": "2020-09-01T09:32:22", "date_modified": "2020-09-01T15:32:22", "date_modified_gmt": "2020-09-01T09:32:22", "src": "https://www.semilive.fi/wp-content/uploads/2020/09/musiikkiopisto.jpg", "name": "Musiikkiopisto", "alt": "" } ], "attributes": [], "default_attributes": [], "variations": [], "grouped_products": [], "menu_order": 82, "meta_data": [ { "id": 556496, "key": "_wpb_shortcodes_custom_css", "value": ".vc_custom_1588488238190{margin: 0px !important;padding: 0px !important;}.vc_custom_1588488243756{margin: 0px !important;padding: 0px !important;}.vc_custom_1598952821282{margin-top: 0px !important;margin-right: 0px !important;margin-bottom: 0px !important;margin-left: 0px !important;padding-top: 0px !important;padding-right: 0px !important;padding-bottom: 0px !important;padding-left: 0px !important;}" }, { "id": 556497, "key": "_aioseop_opengraph_settings", "value": { "aioseop_opengraph_settings_title": "", "aioseop_opengraph_settings_desc": "", "aioseop_opengraph_settings_customimg": "", "aioseop_opengraph_settings_imagewidth": "0", "aioseop_opengraph_settings_imageheight": "0", "aioseop_opengraph_settings_video": "", "aioseop_opengraph_settings_videowidth": "0", "aioseop_opengraph_settings_videoheight": "0", "aioseop_opengraph_settings_category": "article", "aioseop_opengraph_settings_section": "", "aioseop_opengraph_settings_tag": "", "aioseop_opengraph_settings_setcard": "summary", "aioseop_opengraph_settings_customimg_twitter": "", "aioseop_opengraph_settings_customimg_checker": "0" } }, { "id": 556498, "key": "_wpb_shortcodes_custom_css", "value": ".vc_custom_1588488238190{margin: 0px !important;padding: 0px !important;}.vc_custom_1588488243756{margin: 0px !important;padding: 0px !important;}.vc_custom_1598952821282{margin-top: 0px !important;margin-right: 0px !important;margin-bottom: 0px !important;margin-left: 0px !important;padding-top: 0px !important;padding-right: 0px !important;padding-bottom: 0px !important;padding-left: 0px !important;}" }, { "id": 556499, "key": "_wpb_shortcodes_custom_css", "value": ".vc_custom_1588488238190{margin: 0px !important;padding: 0px !important;}.vc_custom_1588488243756{margin: 0px !important;padding: 0px !important;}.vc_custom_1598952821282{margin-top: 0px !important;margin-right: 0px !important;margin-bottom: 0px !important;margin-left: 0px !important;padding-top: 0px !important;padding-right: 0px !important;padding-bottom: 0px !important;padding-left: 0px !important;}" }, { "id": 556500, "key": "_wpb_shortcodes_custom_css", "value": ".vc_custom_1588488238190{margin: 0px !important;padding: 0px !important;}.vc_custom_1588488243756{margin: 0px !important;padding: 0px !important;}.vc_custom_1598952821282{margin-top: 0px !important;margin-right: 0px !important;margin-bottom: 0px !important;margin-left: 0px !important;padding-top: 0px !important;padding-right: 0px !important;padding-bottom: 0px !important;padding-left: 0px !important;}" }, { "id": 556501, "key": "_wpb_shortcodes_custom_css", "value": ".vc_custom_1588488238190{margin: 0px !important;padding: 0px !important;}.vc_custom_1588488243756{margin: 0px !important;padding: 0px !important;}.vc_custom_1598952821282{margin-top: 0px !important;margin-right: 0px !important;margin-bottom: 0px !important;margin-left: 0px !important;padding-top: 0px !important;padding-right: 0px !important;padding-bottom: 0px !important;padding-left: 0px !important;}" }, { "id": 556502, "key": "_aioseop_opengraph_settings", "value": { "aioseop_opengraph_settings_title": "", "aioseop_opengraph_settings_desc": "", "aioseop_opengraph_settings_customimg": "", "aioseop_opengraph_settings_imagewidth": "0", "aioseop_opengraph_settings_imageheight": "0", "aioseop_opengraph_settings_video": "", "aioseop_opengraph_settings_videowidth": "0", "aioseop_opengraph_settings_videoheight": "0", "aioseop_opengraph_settings_category": "article", "aioseop_opengraph_settings_section": "", "aioseop_opengraph_settings_tag": "", "aioseop_opengraph_settings_setcard": "summary", "aioseop_opengraph_settings_customimg_twitter": "", "aioseop_opengraph_settings_customimg_checker": "0" } }, { "id": 556503, "key": "_aioseop_opengraph_settings", "value": { "aioseop_opengraph_settings_title": "", "aioseop_opengraph_settings_desc": "", "aioseop_opengraph_settings_customimg": "", "aioseop_opengraph_settings_imagewidth": "0", "aioseop_opengraph_settings_imageheight": "0", "aioseop_opengraph_settings_video": "", "aioseop_opengraph_settings_videowidth": "0", "aioseop_opengraph_settings_videoheight": "0", "aioseop_opengraph_settings_category": "article", "aioseop_opengraph_settings_section": "", "aioseop_opengraph_settings_tag": "", "aioseop_opengraph_settings_setcard": "summary", "aioseop_opengraph_settings_customimg_twitter": "", "aioseop_opengraph_settings_customimg_checker": "0" } }, { "id": 556504, "key": "_aioseop_opengraph_settings", "value": { "aioseop_opengraph_settings_title": "", "aioseop_opengraph_settings_desc": "", "aioseop_opengraph_settings_customimg": "", "aioseop_opengraph_settings_imagewidth": "0", "aioseop_opengraph_settings_imageheight": "0", "aioseop_opengraph_settings_video": "", "aioseop_opengraph_settings_videowidth": "0", "aioseop_opengraph_settings_videoheight": "0", "aioseop_opengraph_settings_category": "article", "aioseop_opengraph_settings_section": "", "aioseop_opengraph_settings_tag": "", "aioseop_opengraph_settings_setcard": "summary", "aioseop_opengraph_settings_customimg_twitter": "", "aioseop_opengraph_settings_customimg_checker": "0" } }, { "id": 556505, "key": "_aioseop_opengraph_settings", "value": { "aioseop_opengraph_settings_title": "", "aioseop_opengraph_settings_desc": "", "aioseop_opengraph_settings_customimg": "", "aioseop_opengraph_settings_imagewidth": "0", "aioseop_opengraph_settings_imageheight": "0", "aioseop_opengraph_settings_video": "", "aioseop_opengraph_settings_videowidth": "0", "aioseop_opengraph_settings_videoheight": "0", "aioseop_opengraph_settings_category": "article", "aioseop_opengraph_settings_section": "", "aioseop_opengraph_settings_tag": "", "aioseop_opengraph_settings_setcard": "summary", "aioseop_opengraph_settings_customimg_twitter": "", "aioseop_opengraph_settings_customimg_checker": "0" } }, { "id": 556507, "key": "site-sidebar-layout", "value": "right-sidebar" }, { "id": 556508, "key": "site-content-layout", "value": "plain-container" }, { "id": 556509, "key": "theme-transparent-header-meta", "value": "disabled" }, { "id": 556510, "key": "stick-header-meta", "value": "default" }, { "id": 556511, "key": "min_quantity", "value": "2" }, { "id": 556512, "key": "max_quantity", "value": "50" }, { "id": 556513, "key": "dpsp_networks_shares", "value": { "pinterest": 0 } }, { "id": 556514, "key": "wcemessage_id_onhold", "value": "" }, { "id": 556515, "key": "location_onhold", "value": "woocommerce_email_before_order_table" }, { "id": 556516, "key": "wcemessage_id_processing", "value": "877" }, { "id": 556517, "key": "location_processing", "value": "woocommerce_email_before_order_table" }, { "id": 556518, "key": "wcemessage_id_completed", "value": "" }, { "id": 556519, "key": "location_completed", "value": "woocommerce_email_before_order_table" }, { "id": 556520, "key": "Showtime", "value": "18.4.2020, 19.00 (UTC +3)" }, { "id": 556521, "key": "dpsp_networks_shares_total", "value": "0" }, { "id": 556522, "key": "dpsp_networks_shares_last_updated", "value": "1604826933" }, { "id": 556523, "key": "showdatetime", "value": "12.11.2020, klo 18.00" }, { "id": 556524, "key": "site-post-title", "value": "disabled" }, { "id": 556525, "key": "ast-title-bar-display", "value": "disabled" }, { "id": 556526, "key": "ast-featured-img", "value": "disabled" }, { "id": 556531, "key": "woopt_actions", "value": [ "|100%|" ] }, { "id": 556552, "key": "_showdatetime", "value": "field_5e9210c9aafcc" }, { "id": 556553, "key": "_eos_deactive_plugins_key", "value": ",freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php,freesoul-deactivate-plugins/freesoul-deactivate-plugins.php" }, { "id": 556554, "key": "_single_add_custom_css", "value": "" }, { "id": 556555, "key": "_rocket_exclude_minify_js", "value": "1" }, { "id": 556556, "key": "_rocket_exclude_defer_all_js", "value": "1" }, { "id": 556557, "key": "_wpb_vc_js_status", "value": "true" }, { "id": 556558, "key": "_astra_content_layout_flag", "value": "disabled" }, { "id": 556559, "key": "_rocket_exclude_minify_css", "value": "1" }, { "id": 556560, "key": "_aioseop_keywords", "value": "" }, { "id": 556561, "key": "_aioseop_description", "value": "" }, { "id": 556562, "key": "_aioseop_title", "value": "" }, { "id": 556563, "key": "_aioseop_custom_link", "value": "" }, { "id": 556564, "key": "_aioseop_sitemap_exclude", "value": "" }, { "id": 556565, "key": "_aioseop_disable", "value": "" }, { "id": 556566, "key": "_aioseop_disable_analytics", "value": "" }, { "id": 556567, "key": "_aioseop_noindex", "value": "" }, { "id": 556568, "key": "_aioseop_nofollow", "value": "" }, { "id": 556569, "key": "iump_woo_product_level_relation", "value": "28" }, { "id": 556570, "key": "ihc_mb_type", "value": "show" }, { "id": 556571, "key": "ihc_mb_who", "value": "" }, { "id": 556572, "key": "ihc_mb_block_type", "value": "redirect" }, { "id": 556573, "key": "ihc_mb_redirect_to", "value": "27860" }, { "id": 556574, "key": "ihc_replace_content", "value": "" }, { "id": 556575, "key": "ihc_drip_content", "value": "0" }, { "id": 556576, "key": "ihc_drip_start_type", "value": "1" }, { "id": 556577, "key": "ihc_drip_end_type", "value": "1" }, { "id": 556578, "key": "ihc_drip_start_numeric_type", "value": "days" }, { "id": 556579, "key": "ihc_drip_start_numeric_value", "value": "" }, { "id": 556580, "key": "ihc_drip_end_numeric_type", "value": "days" }, { "id": 556581, "key": "ihc_drip_end_numeric_value", "value": "" }, { "id": 556582, "key": "ihc_drip_start_certain_date", "value": "" }, { "id": 556583, "key": "ihc_drip_end_certain_date", "value": "" }, { "id": 556585, "key": "_dp_original", "value": "27915" }, { "id": 572005, "key": "clip_id", "value": "bnv9v5vs02gc" }, { "id": 572008, "key": "clip_ref", "value": "2864854" }, { "id": 572010, "key": "_clip_ref", "value": "field_5f772ec10f2c4" }, { "id": 573967, "key": "_clip_id", "value": "field_5f772e920f2c3" }, { "id": 573968, "key": "show_product_in_mobile_app", "value": "1" }, { "id": 573970, "key": "_show_product_in_mobile_app", "value": "field_5f7db2a153473" }, { "id": 586324, "key": "_product_meta_id", "value": "None" } ], "lang": "fi", "translations": { "en": 28065, "fi": 27917 }, "pll_sync_post": [], "_links": { "self": [ { "href": "https://www.semilive.fi/wp-json/wc/v3/products/27917" } ], "collection": [ { "href": "https://www.semilive.fi/wp-json/wc/v3/products" } ] } }
Me too, it seems like what @gzingh suggested fixed the issue.
For those of you having the same issue, changed from /includes/api/class-endpoint-api.php line from 242 to this seems fixed the issue.
// force evaluate the result
$result = json_decode(wp_json_encode($result));$data = array(
‘data’ => $result,
‘headers’ => $this->response_headers,
);
\WP_Rest_Cache_Plugin\Includes\Caching\Caching::get_instance()->set_cache( $this->cache_key, $data, ‘endpoint’, $this->request_uri, ”, $this->request_headers );return $result;
}Suggest the developer look at this.
The fix above works. Any thoughts about implementing this into the offical release? I hate to do this after every update ??
Sorry for the late reply, somehow this topic didn’t pop-up for us.
I have studied the non-cached request as provided by @rikuksf, but it doesn’t contain the WC_Meta_Data class so I can not debug the issue using that.
But the fix provided by @henmaker tells me a lot. This means (as I already expected, but wanted to make sure) that the actual REST response isn’t valid JSON. So the code that is adding the WC_Meta_Data class is actually the one doing something wrong. JSON can not contain PHP classes, because that is invalid JSON.I will implement the fix as provided by @henmaker since that prevents any errors like this, but do keep in mind that if any of your code (or the WooCommerce code) relies on the class being present in the JSON (which I may hope it doesn’t) that code will break. However I think it is better to break code that relies on invalid JSON, than have invalid JSON break valid code ??
- The topic ‘__PHP_Incomplete_Class_Name’ is closed to new replies.