|
|
|
|
|
by jstanley
2021 days ago
|
|
I'm seeing an error on the homepage: > Warning: file_get_contents(https://vimeo.com/api/v2/video/466939644.php): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /home/customer/www/cognifirm.com/public_html/wp-content/plugins/Ultimate_VC_Addons/modules/ultimate_videos.php on line 208 That the site is trying to fetch the contents of a Vimeo page at runtime is quite the code smell! |
|
1. Not using the built-in WP_Http class or related helper methods (wp_remote_get) that provide headers, timeouts, useragent, auth, etc.
2. Unserialising remote, untrusted PHP objects (!) (Why does Vimeo provide/encourage this?)
3. Not handling HTTP error response codes.
4. PHP errors are not hidden from users.