woocommerce / woocommerce-rest-api

This is the WooCommerce core REST API Package. It runs standalone as a feature plugin too.
70 stars 46 forks source link

Getting empty responses on getProducts (but result varies when tweaking per_page parameter) #103

Closed sethsnel closed 4 years ago

sethsnel commented 4 years ago

Bug description When setting per_page to 100 or 99 on the GET products api call, we are retrieving an empty body response on the last page. However when per_page is set to 50 or 75 it works as expected. Because of this issue we cannot reliable retrieve the largest amounts of products per page.

Also interesting to note, in both instances the second to last page gives a "prev" and "next" link in their response header. And on the last page only a "prev" link. (like expected)

To Reproduce Here are sample requests we make: Succesfull with per_page=50: https://pastebin.com/4NWc3UJV Unsuccesfull with per_page=100: https://pastebin.com/yWVfazTv

Expected behavior Retrieve the remaining 93 products on the last page when per_page count is set to 100 (and page= 3)

Isolating the problem:

WordPress Environment

``` { "environment":{ "home_url":"https:\/\/www.loftdeur.nl", "site_url":"https:\/\/www.loftdeur.nl", "version":"3.8.1", "log_directory":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/uploads\/wc-logs\/", "log_directory_writable":true, "wp_version":"5.3.2", "wp_multisite":false, "wp_memory_limit":536870912, "wp_debug_mode":false, "wp_cron":true, "language":"nl_NL", "external_object_cache":null, "server_info":"Apache\/2", "php_version":"7.2.21", "php_post_max_size":67108864, "php_max_execution_time":60, "php_max_input_vars":1000, "curl_version":"7.29.0, NSS\/3.44", "suhosin_installed":false, "max_upload_size":67108864, "mysql_version":"5.5.5", "mysql_version_string":"5.5.5-10.1.41-MariaDB", "default_timezone":"UTC", "fsockopen_or_curl_enabled":true, "soapclient_enabled":true, "domdocument_enabled":true, "gzip_enabled":true, "mbstring_enabled":true, "remote_post_successful":true, "remote_post_response":"200", "remote_get_successful":true, "remote_get_response":"200" }, "database":{ "wc_database_version":"3.8.1", "database_prefix":"wp_", "maxmind_geoip_database":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/uploads\/GeoLite2-Country.mmdb", "database_tables":{ "woocommerce":{ "wp_woocommerce_sessions":{ "data":"5.02", "index":"0.09", "engine":"InnoDB" }, "wp_woocommerce_api_keys":{ "data":"0.02", "index":"0.03", "engine":"InnoDB" }, "wp_woocommerce_attribute_taxonomies":{ "data":"0.02", "index":"0.02", "engine":"InnoDB" }, "wp_woocommerce_downloadable_product_permissions":{ "data":"0.16", "index":"0.28", "engine":"InnoDB" }, "wp_woocommerce_order_items":{ "data":"8.52", "index":"3.52", "engine":"InnoDB" }, "wp_woocommerce_order_itemmeta":{ "data":"68.61", "index":"49.16", "engine":"InnoDB" }, "wp_woocommerce_tax_rates":{ "data":"0.02", "index":"0.06", "engine":"InnoDB" }, "wp_woocommerce_tax_rate_locations":{ "data":"0.02", "index":"0.05", "engine":"InnoDB" }, "wp_woocommerce_shipping_zones":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_woocommerce_shipping_zone_locations":{ "data":"0.02", "index":"0.05", "engine":"InnoDB" }, "wp_woocommerce_shipping_zone_methods":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_woocommerce_payment_tokens":{ "data":"0.02", "index":"0.02", "engine":"InnoDB" }, "wp_woocommerce_payment_tokenmeta":{ "data":"0.02", "index":"0.03", "engine":"InnoDB" }, "wp_woocommerce_log":{ "data":"0.02", "index":"0.02", "engine":"InnoDB" } }, "other":{ "wp_adtribes_my_conversions":{ "data":"0.02", "index":"0.02", "engine":"InnoDB" }, "wp_commentmeta":{ "data":"0.28", "index":"0.31", "engine":"InnoDB" }, "wp_comments":{ "data":"45.58", "index":"29.09", "engine":"InnoDB" }, "wp_EWD_OTP_Customers":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_EWD_OTP_Custom_Fields":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_EWD_OTP_Fields_Meta":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_EWD_OTP_Orders":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_EWD_OTP_Order_Statuses":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_EWD_OTP_Sales_Reps":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_idealcheckout":{ "data":"1.52", "index":"0.00", "engine":"InnoDB" }, "wp_links":{ "data":"0.02", "index":"0.02", "engine":"InnoDB" }, "wp_ms_snippets":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_mts_wp_reviews":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_options":{ "data":"7.50", "index":"0.61", "engine":"InnoDB" }, "wp_pay_options":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_pay_option_subs":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_pay_transactions":{ "data":"8.52", "index":"0.31", "engine":"InnoDB" }, "wp_postmeta":{ "data":"280.80", "index":"139.34", "engine":"InnoDB" }, "wp_posts":{ "data":"24.55", "index":"8.06", "engine":"InnoDB" }, "wp_redirection_404":{ "data":"2.02", "index":"0.86", "engine":"InnoDB" }, "wp_redirection_groups":{ "data":"0.02", "index":"0.03", "engine":"InnoDB" }, "wp_redirection_items":{ "data":"0.06", "index":"0.09", "engine":"InnoDB" }, "wp_redirection_logs":{ "data":"1.02", "index":"0.36", "engine":"InnoDB" }, "wp_sl_setting":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_sl_tag":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_smush_dir_images":{ "data":"0.02", "index":"0.03", "engine":"InnoDB" }, "wp_snippets":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_termmeta":{ "data":"0.06", "index":"0.03", "engine":"InnoDB" }, "wp_terms":{ "data":"0.02", "index":"0.03", "engine":"InnoDB" }, "wp_term_relationships":{ "data":"0.11", "index":"0.08", "engine":"InnoDB" }, "wp_term_taxonomy":{ "data":"0.08", "index":"0.03", "engine":"InnoDB" }, "wp_tm_taskmeta":{ "data":"0.06", "index":"0.03", "engine":"InnoDB" }, "wp_tm_tasks":{ "data":"0.02", "index":"0.02", "engine":"InnoDB" }, "wp_usermeta":{ "data":"15.55", "index":"11.03", "engine":"InnoDB" }, "wp_users":{ "data":"1.52", "index":"0.48", "engine":"InnoDB" }, "wp_wcpdf_credit_note_number":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wcpdf_invoice_number":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wcpdf_packing_slip_number":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wc_download_log":{ "data":"0.02", "index":"0.03", "engine":"InnoDB" }, "wp_wc_product_meta_lookup":{ "data":"0.33", "index":"0.72", "engine":"InnoDB" }, "wp_wc_tax_rate_classes":{ "data":"0.02", "index":"0.02", "engine":"InnoDB" }, "wp_wc_webhooks":{ "data":"0.02", "index":"0.02", "engine":"InnoDB" }, "wp_wfBlockedIPLog":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wfBlocks7":{ "data":"0.02", "index":"0.05", "engine":"InnoDB" }, "wp_wfConfig":{ "data":"1.44", "index":"0.00", "engine":"InnoDB" }, "wp_wfCrawlers":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wfFileChanges":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wfFileMods":{ "data":"10.52", "index":"0.00", "engine":"InnoDB" }, "wp_wfHits":{ "data":"1.02", "index":"2.14", "engine":"InnoDB" }, "wp_wfHoover":{ "data":"0.02", "index":"0.02", "engine":"InnoDB" }, "wp_wfIssues":{ "data":"0.02", "index":"0.06", "engine":"InnoDB" }, "wp_wfKnownFileList":{ "data":"4.52", "index":"0.00", "engine":"InnoDB" }, "wp_wfLiveTrafficHuman":{ "data":"0.19", "index":"0.13", "engine":"InnoDB" }, "wp_wfLocs":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wfLogins":{ "data":"0.20", "index":"0.06", "engine":"InnoDB" }, "wp_wfls_2fa_secrets":{ "data":"0.02", "index":"0.02", "engine":"InnoDB" }, "wp_wfls_settings":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wfNotifications":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wfPendingIssues":{ "data":"0.02", "index":"0.06", "engine":"InnoDB" }, "wp_wfReverseCache":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wfSNIPCache":{ "data":"0.02", "index":"0.05", "engine":"InnoDB" }, "wp_wfStatus":{ "data":"0.13", "index":"0.09", "engine":"InnoDB" }, "wp_wfTrafficRates":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_woocommerce_gpf_google_taxonomy":{ "data":"1.52", "index":"0.00", "engine":"InnoDB" }, "wp_woocommerce_multisafepay":{ "data":"0.11", "index":"0.00", "engine":"InnoDB" }, "wp_wpgmza":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wpgmza_categories":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wpgmza_category_maps":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wpgmza_circles":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wpgmza_maps":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wpgmza_polygon":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wpgmza_polylines":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_wpgmza_rectangles":{ "data":"0.02", "index":"0.00", "engine":"InnoDB" }, "wp_yoast_seo_links":{ "data":"0.14", "index":"0.06", "engine":"InnoDB" }, "wp_yoast_seo_meta":{ "data":"4.52", "index":"0.00", "engine":"InnoDB" } } }, "database_size":{ "data":497.3199999999991, "index":247.72000000000017 } }, "active_plugins":[ { "plugin":"woocommerce-nl\/woocommerce-nl.php", "name":"WooCommerce (nl)", "version":"1.1.7", "version_latest":"1.1.7", "url":"http:\/\/www.pronamic.eu\/plugins\/woocommerce-nl\/", "author_name":"Pronamic", "author_url":"http:\/\/www.pronamic.nl\/", "network_activated":false }, { "plugin":"WooCommerce-3.2.0\/multisafepay.php", "name":"Multisafepay", "version":"3.2.0", "version_latest":"3.2.0", "url":"http:\/\/www.multisafepay.com", "author_name":"Multisafepay", "author_url":"http:\/\/www.multisafepay.com", "network_activated":false }, { "plugin":"ac-addon-acf\/ac-addon-acf.php", "name":"Admin Columns Pro - Advanced Custom Fi 2000 elds (ACF)", "version":"2.5.5", "version_latest":"2.5.5", "url":"https:\/\/www.admincolumns.com", "author_name":"Admin Columns", "author_url":"https:\/\/www.admincolumns.com", "network_activated":false }, { "plugin":"ac-addon-woocommerce\/ac-addon-woocommerce.php", "name":"Admin Columns Pro - WooCommerce", "version":"3.3.8", "version_latest":"3.3.8", "url":"https:\/\/www.admincolumns.com", "author_name":"Admin Columns", "author_url":"https:\/\/www.admincolumns.com", "network_activated":false }, { "plugin":"admin-columns-pro\/admin-columns-pro.php", "name":"Admin Columns Pro", "version":"4.7.3", "version_latest":"4.7.3", "url":"https:\/\/www.admincolumns.com", "author_name":"AdminColumns.com", "author_url":"https:\/\/www.admincolumns.com", "network_activated":false }, { "plugin":"antispam-bee\/antispam_bee.php", "name":"Antispam Bee", "version":"2.9.1", "version_latest":"2.9.1", "url":"https:\/\/nl.wordpress.org\/plugins\/antispam-bee\/", "author_name":"pluginkollektiv", "author_url":"https:\/\/pluginkollektiv.org", "network_activated":false }, { "plugin":"code-snippets\/code-snippets.php", "name":"Codefragmenten", "version":"2.13.3", "version_latest":"2.13.3", "url":"https:\/\/github.com\/sheabunge\/code-snippets", "author_name":"Shea Bunge", "author_url":"https:\/\/sheabunge.com", "network_activated":false }, { "plugin":"contact-form-7\/wp-contact-form-7.php", "name":"Contact Form 7", "version":"5.1.6", "version_latest":"5.1.6", "url":"https:\/\/contactform7.com\/", "author_name":"Takayuki Miyoshi", "author_url":"https:\/\/ideasilo.wordpress.com\/", "network_activated":false }, { "plugin":"custom-css-js\/custom-css-js.php", "name":"Simple Custom CSS and JS", "version":"3.28", "version_latest":"3.28", "url":"https:\/\/wordpress.org\/plugins\/custom-css-js\/", "author_name":"SilkyPress.com", "author_url":"https:\/\/www.silkypress.com", "network_activated":false }, { "plugin":"custom-favicon\/custom-favicon.php", "name":"Custom Favicon", "version":"1.0.3", "version_latest":"1.0.3", "url":"http:\/\/www.dreamsonline.net\/wordpress-plugins\/custom-favicon\/", "author_name":"Harish Chouhan", "author_url":"http:\/\/www.dreamsonline.net\/wordpress-themes\/", "network_activated":false }, { "plugin":"easyads\/easyads.php", "name":"EasyAds for WooCommerce", "version":"0.2.1", "version_latest":"0.2.1", "url":"https:\/\/www.easyads.eu\/", "author_name":"EasyAds", "author_url":"https:\/\/www.easyads.eu\/", "network_activated":false }, { "plugin":"email-address-encoder\/email-address-encoder.php", "name":"Email Address Encoder", "version":"1.0.19", "version_latest":"1.0.19", "url":"https:\/\/encoder.till.im\/", "author_name":"Till Kr\u00fcss", "author_url":"https:\/\/till.im\/", "network_activated":false }, { "plugin":"enhanced-e-commerce-for-woocommerce-store\/enhanced-ecommerce-google-analytics.php", "name":"Enhanced E-commerce for Woocommerce store", "version":"2.3.0", "version_latest":"2.3.0", "url":"https:\/\/www.tatvic.com\/tatvic-labs\/woocommerce-extension\/", "author_name":"Tatvic", "author_url":"http:\/\/www.tatvic.com", "network_activated":false }, { "plugin":"envira-gallery\/envira-gallery.php", "name":"Envira Gallery", "version":"1.8.8", "version_latest":"1.8.8", "url":"http:\/\/enviragallery.com", "author_name":"Envira Gallery Team", "author_url":"http:\/\/enviragallery.com", "network_activated":false }, { "plugin":"facebook-for-woocommerce\/facebook-for-woocommerce.php", "name":"Facebook for WooCommerce", "version":"1.9.15", "version_latest":"1.9.15", "url":"https:\/\/github.com\/facebookincubator\/facebook-for-woocommerce\/", "author_name":"Facebook", "author_url":"https:\/\/www.facebook.com\/", "network_activated":false }, { "plugin":"header-and-footer-scripts\/shfs.php", "name":"Header and Footer Scripts", "version":"2.1.1", "version_latest":"2.1.1", "url":"http:\/\/digitalliberation.org\/plugins\/header-and-footer-scripts\/?utm_source=wphfs_plugin_uri", "author_name":"Digital Liberation", "author_url":"http:\/\/digitalliberation.org\/?utm_source=wphfs_author_uri", "network_activated":false }, { "plugin":"loco-translate\/loco.php", "name":"Loco Translate", "version":"2.3.1", "version_latest":"2.3.1", "url":"https:\/\/nl.wordpress.org\/plugins\/loco-translate\/", "author_name":"Tim Whitlock", "author_url":"https:\/\/localise.biz\/wordpress\/plugin", "network_activated":false }, { "plugin":"pctags-pinterest-conversion-tag-premium\/pinterest-conversion-tag.php", "name":"Pctags - Pinterest Conversion Tags (Premium)", "version":"1.0.5", "version_latest":"1.0.5", "url":"", "author_name":"Pagup", "author_url":"https:\/\/pagup.com\/", "network_activated":false }, { "plugin":"poeditor\/poeditor.php", "name":"POEditor", "version":"0.9.10", "version_latest":"0.9.10", "url":"https:\/\/poeditor.com\/", "author_name":"POEditor", "author_url":"https:\/\/poeditor.com\/", "network_activated":false }, { "plugin":"postman-smtp\/postman-smtp.php", "name":"Postman SMTP", "version":"1.7.2", "version_latest":"1.7.2", "url":"https:\/\/wordpress.org\/plugins\/postman-smtp\/", "author_name":"Jason Hendriks", "author_url":"http:\/\/www.codingmonkey.ca", "network_activated":false }, { "plugin":"postmark-approved-wordpress-plugin\/postmark.php", "name":"Postmark (Official)", "version":"1.11.6", "version_latest":"1.11.6", "url":"https:\/\/postmarkapp.com\/", "author_name":"Andrew Yates & Matt Gibbs", "author_url":"", "network_activated":false }, { "plugin":"product-gtin-ean-upc-isbn-for-woocommerce\/product-gtin-ean-upc-isbn-for-woocommerce.php", "name":"Product GTIN (EAN, UPC, ISBN) for WooCommerce", "version":"1.0.8", "version_latest":"1.0.8", "url":"", "author_name":"Emanuela Castorina", "author_url":"https:\/\/emanuelacastorina.com\/", "network_activated":false }, { "plugin":"redirection\/redirection.php", "name":"Redirection", "version":"4.6.2", "version_latest":"4.6.2", "url":"https:\/\/redirection.me\/", "author_name":"John Godley", "author_url":"https:\/\/johngodley.com", "network_activated":false }, { "plugin":"remove-query-strings-from-static-resources\/remove-query-strings.php", "name":"Remove Query Strings From Static Resources", "version":"1.4", "version_latest":"1.4", "url":"https:\/\/www.speedupmywebsite.com\/", "author_name":"Speed Up My Website, Your WP Expert", "author_url":"https:\/\/www.speedupmywebsite.com\/", "network_activated":false }, { "plugin":"sendcloud-shipping\/sendcloud-shipping.php", "name":"SendCloud | Smart Shipping Service", "version":"1.1.1", "version_latest":"1.1.1", "url":"http:\/\/sendcloud.sc", "author_name":"SendCloud B.V.", "author_url":"http:\/\/sendcloud.sc", "network_activated":false }, { "plugin":"simple-custom-css\/simple-custom-css.php", "name":"Simple Custom CSS", "version":"4.0.3", "version_latest":"4.0.3", "url":"http:\/\/johnregan3.github.io\/simple-custom-css", "author_name":"John Regan, Danny Van Kooten", "author_url":"http:\/\/johnregan3.me", "network_activated":false }, { "plugin":"uni-woo-custom-product-options\/uni-cpo.php", "name":"Uni CPO - WooCommerce Options and Price Calculation Formulas", "version":"3.1.7", "version_latest":"4.6.11", "url":"http:\/\/moomoo.agency\/demo\/cpo\/", "author_name":"MooMoo Studio Team", "author_url":"http:\/\/moomoo.agency", "network_activated":false }, { "plugin":"wc-multiple-email-recipients\/wc-multiple-email-recipients.php", "name":"WC Multiple Email Recipients", "version":"1.2.5", "version_latest":"1.2.5", "url":"http:\/\/conschneider.de\/plugin-woocommerce-multiple-email-recipients\/", "author_name":"Con Schneider", "author_url":"http:\/\/conschneider.de\/", "network_activated":false }, { "plugin":"woo-product-feed-pro\/woocommerce-sea.php", "name":"Product Feed PRO for WooCommerce", "version":"7.1.7", "version_latest":"7.1.7", "url":"https:\/\/www.adtribes.io\/support\/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=woosea_product_feed_pro", "author_name":"AdTribes.io", "author_url":"https:\/\/www.adtribes.io", "network_activated":false }, { "plugin":"woocommerce-checkout-field-editor-pro\/woocommerce-checkout-field-editor-pro.php", "name":"WooCommerce Checkout Field Editor Pro", "version":"2.7.7", "version_latest":"2.7.7", "url":"http:\/\/www.themehigh.com\/product\/woocommerce-checkout-field-editor-pro\/", "author_name":"ThemeHiGH", "author_url":"http:\/\/www.themehigh.com", "network_activated":false }, { "plugin":"woocommerce-custom-tabs-pro\/woocommerce-custom-tabs-pro.php", "name":"Woocommerce Custom Tabs PRO", "version" 2000:"1.0.26", "version_latest":"1.0.26", "url":"http:\/\/webshoplogic.com\/custom-tabs-for-woocommerce\/", "author_name":"WebshopLogic", "author_url":"http:\/\/webshoplogic.com\/", "network_activated":false }, { "plugin":"woocommerce-customer-order-csv-export\/woocommerce-customer-order-csv-export.php", "name":"WooCommerce Customer\/Order CSV Export", "version":"4.3.5", "version_latest":"4.3.5", "url":"http:\/\/www.woocommerce.com\/products\/ordercustomer-csv-export\/", "author_name":"SkyVerge", "author_url":"http:\/\/www.woocommerce.com", "network_activated":false }, { "plugin":"woocommerce-dynamic-pricing\/woocommerce-dynamic-pricing.php", "name":"WooCommerce Dynamic Pricing", "version":"3.1.4", "version_latest":"3.1.4", "url":"https:\/\/woocommerce.com\/products\/dynamic-pricing\/", "author_name":"Lucas Stark", "author_url":"http:\/\/lucasstark.com", "network_activated":false }, { "plugin":"woocommerce-google-adwords-conversion-tracking\/wc-adwords-conversion-tracking.php", "name":"Woocommerce Adwords Conversion Tracking", "version":"1.0.1", "version_latest":"1.0.1", "url":"http:\/\/victorfalcon.es\/wc-adwords-conversion-tracking", "author_name":"V\u00edctor Falc\u00f3n", "author_url":"http:\/\/victorfalcon.es", "network_activated":false }, { "plugin":"woocommerce-google-dynamic-retargeting-tag\/wgdr.php", "name":"WooCommerce Google Ads Dynamic Remarketing", "version":"1.7.14", "version_latest":"1.7.14", "url":"https:\/\/wordpress.org\/plugins\/woocommerce-google-dynamic-retargeting-tag\/", "author_name":"Wolf+B\u00e4r Agency", "author_url":"https:\/\/wolfundbaer.ch", "network_activated":false }, { "plugin":"woocommerce-name-your-price\/woocommerce-name-your-price.php", "name":"WooCommerce Name Your Price", "version":"2.7.1", "version_latest":"2.7.1", "url":"http:\/\/www.woocommerce.com\/products\/name-your-price\/", "author_name":"Kathy Darling", "author_url":"http:\/\/kathyisawesome.com", "network_activated":false }, { "plugin":"woocommerce-order-status-manager\/woocommerce-order-status-manager.php", "name":"WooCommerce Order Status Manager", "version":"1.9.1", "version_latest":"1.9.1", "url":"http:\/\/www.woocommerce.com\/products\/woocommerce-order-status-manager\/", "author_name":"SkyVerge", "author_url":"http:\/\/www.woocommerce.com", "network_activated":false }, { "plugin":"woocommerce-pdf-invoices-packing-slips\/woocommerce-pdf-invoices-packingslips.php", "name":"WooCommerce PDF Invoices & Packing Slips", "version":"2.4.3", "version_latest":"2.4.3", "url":"http:\/\/www.wpovernight.com", "author_name":"Ewout Fernhout", "author_url":"http:\/\/www.wpovernight.com", "network_activated":false }, { "plugin":"woocommerce-pdf-ips-pro\/woocommerce-pdf-ips-pro.php", "name":"WooCommerce PDF Invoices & Packing Slips Professional", "version":"2.4.0", "version_latest":"2.4.0", "url":"http:\/\/www.wpovernight.com", "author_name":"Ewout Fernhout", "author_url":"http:\/\/www.wpovernight.com", "network_activated":false }, { "plugin":"woocommerce-pdf-ips-templates\/woocommerce-pdf-ips-templates.php", "name":"WooCommerce PDF Invoices & Packing Slips Premium Templates", "version":"2.4.1", "version_latest":"2.4.1", "url":"http:\/\/www.wpovernight.com", "author_name":"Ewout Fernhout", "author_url":"http:\/\/www.wpovernight.com", "network_activated":false }, { "plugin":"woocommerce-pre-orders\/woocommerce-pre-orders.php", "name":"WooCommerce Pre-Orders", "version":"1.5.20", "version_latest":"1.5.20", "url":"https:\/\/woocommerce.com\/products\/woocommerce-pre-orders\/", "author_name":"WooCommerce", "author_url":"https:\/\/woocommerce.com", "network_activated":false }, { "plugin":"woocommerce-pretty-emails\/emailplus.php", "name":"WooCommerce Pretty Emails", "version":"1.8.6", "version_latest":"1.8.6", "url":"", "author_name":"MB Cr\u00e9ation", "author_url":"http:\/\/www.mbcreation.net", "network_activated":false }, { "plugin":"woocommerce-radio-buttons\/functions.php", "name":"Woo Radio Buttons", "version":"3.0.0", "version_latest":"3.0.0", "url":"http:\/\/designloud.com\/downloads\/woo-radio-buttons-3.0.zip", "author_name":"DesignLoud", "author_url":"http:\/\/designloud.com", "network_activated":false }, { "plugin":"woocommerce-sequential-order-numbers-pro\/woocommerce-sequential-order-numbers.php", "name":"WooCommerce Sequential Order Numbers Pro", "version":"1.12.0", "version_latest":"1.12.0", "url":"http:\/\/www.woocommerce.com\/products\/sequential-order-numbers-pro\/", "author_name":"SkyVerge", "author_url":"http:\/\/www.woocommerce.com", "network_activated":false }, { "plugin":"woocommerce\/woocommerce.php", "name":"WooCommerce", "version":"3.8.1", "version_latest":"3.8.1", "url":"https:\/\/woocommerce.com\/", "author_name":"Automattic", "author_url":"https:\/\/woocommerce.com", "network_activated":false }, { "plugin":"wordfence\/wordfence.php", "name":"Wordfence Security", "version":"7.4.3", "version_latest":"7.4.3", "url":"http:\/\/www.wordfence.com\/", "author_name":"Wordfence", "author_url":"http:\/\/www.wordfence.com\/", "network_activated":true }, { "plugin":"wordpress-https\/wordpress-https.php", "name":"WordPress HTTPS", "version":"3.4.0", "version_latest":"3.4.0", "url":"http:\/\/mvied.com\/projects\/wordpress-https\/", "author_name":"Mike Ems", "author_url":"http:\/\/mvied.com\/", "network_activated":false }, { "plugin":"wordpress-seo\/wp-seo.php", "name":"Yoast SEO", "version":"12.8", "version_latest":"12.8", "url":"https:\/\/yoa.st\/1uj", "author_name":"Team Yoast", "author_url":"https:\/\/yoa.st\/1uk", "network_activated":false }, { "plugin":"wp-asset-clean-up-pro\/wpacu.php", "name":"Asset CleanUp Pro: Page Speed Booster", "version":"1.1.5.7", "version_latest":"1.1.5.7", "url":"https:\/\/gabelivan.com\/items\/wp-asset-cleanup-pro\/", "author_name":"Gabriel Livan", "author_url":"http:\/\/gabelivan.com\/", "network_activated":false }, { "plugin":"wp-awesome-faq\/index.php", "name":"WP Awesome FAQ", "version":"4.1.4", "version_latest":"4.1.4", "url":"https:\/\/jeweltheme.com\/product\/wordpress-faq-plugin\/", "author_name":"Liton Arefin", "author_url":"https:\/\/jeweltheme.com\/shop\/easy-gutenberg-blocks\/", "network_activated":false }, { "plugin":"wp-google-maps\/wpGoogleMaps.php", "name":"WP Google Maps", "version":"8.0.14", "version_latest":"8.0.14", "url":"https:\/\/www.wpgmaps.com", "author_name":"WP Google Maps", "author_url":"https:\/\/www.wpgmaps.com", "network_activated":false }, { "plugin":"wp-optimize-premium\/wp-optimize.php", "name":"WP-Optimize Premium - Clean, Compress, Cache", "version":"3.0.15", "version_latest":"3.0.15", "url":"https:\/\/getwpo.com", "author_name":"David Anderson, Ruhani Rabin, Team Updraft", "author_url":"https:\/\/updraftplus.com", "network_activated":false }, { "plugin":"wp-smush-pro\/wp-smush.php", "name":"Smush Pro", "version":"3.4.1", "version_latest":"3.4.1", "url":"http:\/\/premium.wpmudev.org\/projects\/wp-smush-pro\/", "author_name":"WPMU DEV", "author_url":"https:\/\/premium.wpmudev.org\/", "network_activated":false }, { "plugin":"wpmudev-updates\/update-notifications.php", "name":"WPMU DEV Dashboard", "version":"4.7.5", "version_latest":"4.7.5", "url":"https:\/\/premium.wpmudev.org\/project\/wpmu-dev-dashboard\/", "author_name":"WPMU DEV", "author_url":"https:\/\/premium.wpmudev.org\/", "network_activated":true }, { "plugin":"wpovernight-sidekick\/wpovernight-sidekick.php", "name":"WP Overnight Sidekick", "version":"2.2.0", "version_latest":"2.2.0", "url":"http:\/\/wpovernight.com\/", "author_name":"Jeremiah Prummer, Ewout Fernhout, Michael Kluver", "author_url":"http:\/\/wpovernight.com\/", "network_activated":false } ], "inactive_plugins":[ { "plugin":"customer-reviews-woocommerce\/ivole.php", "name":"Customer Reviews for WooCommerce", "version":"3.93", "version_latest":"3.93", "url":"https:\/\/wordpress.org\/plugins\/customer-reviews-woocommerce\/", "author_name":"ivole", "author_url":"https:\/\/profiles.wordpress.org\/ivole", "network_activated":false }, { "plugin":"fullwidth-templates\/fullwidth-page-template.php", "name":"Fullwidth Page Templates", "version":"1.0.3", "version_latest":"1.0.3", "url":"https:\/\/www.brainstormforce.com", "author_name":"Brainstorm Force", "author_url":"https:\/\/www.brainstormforce.com", "network_activated":false }, { "plugin":"pagination-styler-for-woocommerce\/pagination-styler.php", "name":"Pagination Styler for WooCommerce", "version":"3.5.1.1", "version_latest":"3.5.1.1", "url":"https:\/\/wordpress.org\ 19a0 /plugins\/pagination-styler-for-woocommerce\/?utm_source=free_plugin&utm_medium=plugins&utm_campaign=pagination", "author_name":"BeRocket", "author_url":"https:\/\/berocket.com?utm_source=free_plugin&utm_medium=plugins&utm_campaign=pagination", "network_activated":false }, { "plugin":"query-monitor\/query-monitor.php", "name":"Query Monitor", "version":"3.5.2", "version_latest":"3.5.2", "url":"https:\/\/querymonitor.com\/", "author_name":"John Blackbourn", "author_url":"https:\/\/querymonitor.com\/", "network_activated":false }, { "plugin":"woocommerce-paynl-payment-methods\/woocommerce-payment-paynl.php", "name":"Woocommerce Pay.nl Payment Methods", "version":"3.4", "version_latest":"3.4", "url":"https:\/\/wordpress.org\/plugins\/woocommerce-paynl-payment-methods\/", "author_name":"Pay.nl", "author_url":"http:\/\/www.pay.nl", "network_activated":false }, { "plugin":"wc-reminder-emails\/wc-reminder-emails.php", "name":"WooCommerce Smart Reminder Emails", "version":"1.2.0", "version_latest":"1.2.0", "url":"http:\/\/www.wpovernight.com", "author_name":"Ewout Fernhout", "author_url":"http:\/\/www.wpovernight.com", "network_activated":false }, { "plugin":"js_composer\/js_composer.php", "name":"WPBakery Page Builder", "version":"6.1", "version_latest":"6.1", "url":"http:\/\/wpbakery.com", "author_name":"Michael M - WPBakery.com", "author_url":"http:\/\/wpbakery.com", "network_activated":false } ], "dropins_mu_plugins":{ "dropins":[ { "plugin":"advanced-cache.php", "name":"advanced-cache.php" } ], "mu_plugins":[ { "plugin":"wpacu-plugins-filter.php", "name":"Asset CleanUp Pro: Plugin Filtering", "version":"1.0", "url":"https:\/\/gabelivan.com\/items\/wp-asset-cleanup-pro\/", "author_name":"Gabriel Livan", "author_url":"https:\/\/codeable.io\/developers\/gabriel-livan\/?ref=d3TOr" } ] }, "theme":{ "name":"Maximize", "version":"1.3.12", "version_latest":"1.3.12", "author_url":"http:\/\/www.woothemes.com", "is_child_theme":false, "has_woocommerce_support":true, "has_woocommerce_file":false, "has_outdated_templates":true, "overrides":[ { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/admin-cancelled-order.php", "version":"2.3.0", "core_version":"3.7.0" }, { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/admin-failed-order.php", "version":"2.5.0", "core_version":"3.7.0" }, { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/admin-new-order.php", "version":"2.0.0", "core_version":"3.7.0" }, { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/customer-completed-order.php", "version":"1.6.4", "core_version":"3.7.0" }, { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/customer-invoice.php", "version":"2.2.0", "core_version":"3.7.0" }, { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/customer-new-account.php", "version":"1.6.4", "core_version":"3.7.0" }, { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/customer-note.php", "version":"1.6.4", "core_version":"3.7.0" }, { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/customer-on-hold-order.php", "version":"", "core_version":"3.7.0" }, { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/customer-processing-order.php", "version":"1.6.4", "core_version":"3.7.0" }, { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/customer-refunded-order.php", "version":"2.4.0", "core_version":"3.7.0" }, { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/customer-reset-password.php", "version":"2.0.0", "core_version":"3.7.0" }, { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/email-addresses.php", "version":"2.2.0", "core_version":"3.5.4" }, { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/email-customer-details.php", "version":"2.5.0", "core_version":"2.5.0" }, { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/email-footer.php", "version":"2.0.0", "core_version":"3.7.0" }, { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/email-header.php", "version":"1.0", "core_version":"2.4.0" }, { "file":"\/home\/admin\/domains\/loftdeur.nl\/public_html\/wp-content\/plugins\/woocommerce-pretty-emails\/emails\/email-order-items.php", "version":"2.1.2", "core_version":"3.7.0" } ], "parent_name":"", "parent_version":"", "parent_version_latest":"", "parent_author_url":"" }, "settings":{ "api_enabled":true, "force_ssl":false, "currency":"EUR", "currency_symbol":"€", "currency_position":"left", "thousand_separator":".", "decimal_separator":",", "number_of_decimals":2, "geolocation_enabled":false, "taxonomies":{ "external":"external", "grouped":"grouped", "simple":"simple", "variable":"variable" }, "product_visibility_terms":{ "exclude-from-catalog":"exclude-from-catalog", "exclude-from-search":"exclude-from-search", "featured":"featured", "outofstock":"outofstock", "rated-1":"rated-1", "rated-2":"rated-2", "rated-3":"rated-3", "rated-4":"rated-4", "rated-5":"rated-5" }, "woocommerce_com_connected":"no" }, "security":{ "secure_connection":true, "hide_errors":true }, "pages":[ { "page_name":"Winkelbasis", "page_id":"3041", "page_set":true, "page_exists":true, "page_visible":true, "shortcode":"", "shortcode_required":false, "shortcode_present":false }, { "page_name":"Winkelmand", "page_id":"3043", "page_set":true, "page_exists":true, "page_visible":true, "shortcode":"[woocommerce_cart]", "shortcode_required":true, "shortcode_present":true }, { "page_name":"Afrekenen", "page_id":"3045", "page_set":true, "page_exists":true, "page_visible":true, "shortcode":"[woocommerce_checkout]", "shortcode_required":true, "shortcode_present":true }, { "page_name":"Mijn account", "page_id":"3047", "page_set":true, "page_exists":true, "page_visible":true, "shortcode":"[woocommerce_my_account]", "shortcode_required":true, "shortcode_present":true }, { "page_name":"Algemene voorwaarden", "page_id":"4215", "page_set":true, "page_exists":true, "page_visible":true, "shortcode":"", "shortcode_required":false, "shortcode_present":fa 6 lse } ] }```
juliaamosova commented 4 years ago

Hi @sethsnel,

Thank you for reporting the issue!

I am moving it to the WC REST API repository so it could be properly looked at there.

sethsnel commented 4 years ago

Thanks for the response and moving the ticket to the appropriate section. I wasn't aware ;)

juliaamosova commented 4 years ago

@sethsnel,

I have 228 products on my test site where I tried to replicate the issue you are having. I managed to successfully retrieve the last 28 products using https://mysite.mystagingwebsite.com/wp-json/wc/v3/products?page=3&per_page=100 GET request:

100_1

100_2

I recommend trying the same with all plugins deactivated but WooCommerce to see if it makes any difference.

I don't have control over the woocommerce installation and therefore cannot easily disable plugins.

You can create a staging site (which is a copy of the live site) using a free plugin called WP Staging and test there without worrying to break the live site.

juliaamosova commented 4 years ago

Hi @sethsnel,

As a part of this repository’s maintenance, I am closing this issue due to inactivity. Please feel free to comment on it in case we missed something. We’d be happy to take another look.

sethsnel commented 4 years ago

@juliaamosova thanks for testing to reproduce the error using my steps. My apologies for not responding. I totally agree with you that there's likely a problem with the server this Woocommerce installation is installed on and/or plugins that are installed along.

However, unfortunately I don't have acces to the our clients server and/or Woocommerce installation. We just have access to read data from their API. I have retried fetching products with per_page count of 100 and it still failing. We solved this with a hardcoded exception for this domain, were we set per_page = 75 for this specific domain/client.

So this solves the issue for our use case (fetching all product information), but might still prove to be a vulnerability to the Woocommerce API. Perhaps other people experiencing the same might find this issue and reply with their environment.

Thanks again for your assistance.