title: file_get_contents() desont't return all products from a WooCommerce API
body: <p>I have the following API url on a WordPress website with WooCommerce:</p>
  
  <pre><code>/wp-json/wp/v2/product?filter[posts_per_page]=-1
  </code></pre>
  
  <p>when I visit it in the browser it returns all the products that I need; however
  when I try to get the response with file_get_contents it only returns products from a specific category which is extremely strange. </p>
  
  <p>The problem appeared when WooCommerce was updated to the latest version.</p>
  
  <p>Here is the code I use to get the response from the API:</p>
  
  <pre><code>ini_set('display_errors', 1);
  ini_set('display_startup_errors', 1);
  
  $url = 'http://'.$_SERVER['HTTP_HOST'].'/wp-json/wp/v2/product?filter[posts_per_page]=-1';
  
  $data = file_get_contents($url);
  
  die($data);
  </code></pre>
  
  <p>I've been googling and trying different stuff but nothing helped.</p>
  
  <p>I've identified now that the problem is caused by upgrading WordPress to the latest version and not WooCommerce.</p>