File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -160,9 +160,15 @@ function enable_post_email_notifications() {
160160 $ post_mime_type = isset ( $ allowed_mime_types [ $ file_extension ] ) ? $ allowed_mime_types [ $ file_extension ] : 'image/jpeg ' ;
161161 $ filename = $ product ->id . '. ' . $ file_extension ;
162162
163- //$image_response = wp_remote_get( $product->product_image );
164- //$image_data = wp_remote_retrieve_body( $image_response );
165-
163+ // This code results in '429: Too Many Requests"
164+ /*
165+ $image_response = wp_remote_get( $product->product_image );
166+ if ( ! $image_data = wp_remote_retrieve_body( $image_response ) ) {
167+ echo 'Error: ' . json_encode( $image_response );
168+ exit;
169+ }
170+ */
171+
166172 $ image_data = @file_get_contents ( $ product ->product_image );
167173
168174 if ( filter_var ($ product ->product_image , FILTER_VALIDATE_URL ) && $ image_data )
You can’t perform that action at this time.
0 commit comments