all seems to be correct, trying to import articles of a Joomla installation (latest version) to a new WordPress Installation in a subfolder.
But the plugin creates only the subfolders in the WordPress media folder, e.g. “/newWPinstance/wp-content/uploads/2022/09/”. But it copies not the files and therefore does not create the different file sizes of an image.
Log entry for one image:
[ERROR] Can’t copy https://my-homepage.de/joomla-images/image.jpg to /www/htdocs/abc/my-homepage/newWPinstance/wp-content/uploads/2022/09/image.jpg: file_get_contents(./joomla-images/image.jpg): Failed to open stream: No such file or directory
But the paths are correct. Do the media folders of the Joomla instance and/or the WordPress instance need specific permissions to execute “file_get_contents()”?
Thanks a lot!
mtemp
]]>file_get_contents(/home/account/site/wp-content/cache/phast.c6a4e2b3b04e6e8595f33c8dcb5fd647.1002/service-config-cekOHWrq7QkHPvQL): Failed to open stream: No such file or directory
– Query Monitor caught this error on frontend.
Env details:
PHP: 8.0
Web server: nginx/1.22.1
WordPress: 6.2.2
Error level: Warning
Location: wp-content/plugins/phastpress/sdk/phast.php:9799
[26-Jun-2023 11:00:41 UTC] Burst Statistics: Endpoint error, does not respond with 200. Response given:
Tracked it down a bit with own additional error log output with error_get_last()
if file_get_contents()
returns false
.
[26-Jun-2023 11:00:41 UTC] file_get_contents() url: https://www.example.com/blog/burst-statistics-endpoint.php
[26-Jun-2023 11:00:41 UTC] Array
(
[type] => 2
[message] => file_get_contents(https://www.example.com/blog/burst-statistics-endpoint.php): Failed to open stream: no suitable wrapper could be found
[file] => /is/htdocs/www/blog/wp-content/plugins/burst-statistics/class-endpoint.php
[line] => 166
)
Not sure what “no suitable wrapper could be found” means in this context.
Additional information: WordPress is installed in /blog/
folder, URL https://www.example.com/blog/burst-statistics-endpoint.php
is reachable in normal browser and returns status 200 with no content.
Thanks for this wonderful plugin! I do not have a support request but a suggestion for improvement.
On one of my client’s sites we were unable to use the plugin because it gave connection-failed
and hostname-mismatch
errors. A bit of debugging then provided the answer. By default, the plugin uses the file_get_contents
function to retrieve the appropriate ReCaptcha URL and then validate it. Unfortunately, sometimes the PHP flag allow_url_fopen
is set to false, causing file_get_contents()
to fail.
It would be great if you could add a checkbox in the settings to allow the user to switch to CURL. All you would have to do is change line 206
in inc/core.php
from
$captcha_obj = new \ReCaptcha\ReCaptcha( $secret_key );
to
$captcha_obj = new \ReCaptcha\ReCaptcha( $secret_key, new \ReCaptcha\RequestMethod\CurlPost() );
Thank you!
]]>[12-Feb-2023 20:28:40 UTC] PHP Warning: file_get_contents(): data:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /../wp-content/plugins/mailpoet/lib/NewsletterTemplates/ThumbnailSaver.php on line 126
[12-Feb-2023 20:28:40 UTC] PHP Warning: file_get_contents(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQAB...
Problem is this code in /lib/NewsletterTemplates/ThumbnailSaver.php
where file_get_contents()
is used with a base 64 encoded data URI.
private function saveBase64AsImageFile(string $file, string $data): bool {
return file_put_contents($file, file_get_contents($data)) !== false;
}
This fails on servers where data://
is disabled via allow_url_fopen
setting in server configuration which seems to be the case in quite many hosting companies.
when used wp_remote_get getting following error – WP_Error Object ( [errors] => Array ( [http_request_failed] => Array ( [0] => cURL error 7: ) )
When using CURL, curl info is coming as follows without any errors :- Array ( [url] => feedurl?token [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.002587 [namelookup_time] => 0.002671 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [redirect_url] => [primary_ip] => [certinfo] => Array ( ) [primary_port] => 0 [local_ip] => [local_port] => 0 )
Can someone please help me to fix these issues and make it working.
]]>1 button
<a onclick="location.href='https://site.com/download-file/?id=5672'">Download</a>
2 download-file.php (short php with the full URL)
$image_url = 'https://site.com/image.png'. '?key_e=93585676651';
ob_clean();
header('Content-type: png');
header("Content-Disposition: attachment; filename=\"image.png\"");
header('Content-Transfer-Encoding: binary');
echo file_get_contents($image_url);
images and files are returned damaged
3 loading pages added to exceptions (checked page code)
"(*.)download-file(*.)"
"*download-file*"
"{any}download-file{any}"
Download starts working fine if you turn off the plugin
]]>Line 151 of DspExportImportModel.php has this line of code that uses the URL instead of the local filepath:
$uploadedfile = ! empty( $movefile['url'] )
? $movefile['url']
: $requested_vars["fileurl"];
Later on at line 170
you attempt to open that URL with file_get_contents()
, which may have worked on the system where you wrote it [but will not work in a lot of hosted environments.](https://www.google.com/search?q=php+file_get_contents+not+working). It does not work at WPEngine nor does it work in our local WPLib Box local development solution.
By changing your code to use the local filepath I was able to get your plugin to import menus:
$uploadedfile = ! empty( $movefile['file'] )
? $movefile['file']
: $requested_vars[ 'fileurl' ];
Any chance you could update your plugin to use this fix so I could use your official plugin and not have to use a forked version?
Thanks in advance.
]]>Warning: file_get_contents(CC_API_URL/coinlist/): failed to open stream: No such file or directory in /home/user/public_html/wp-content/plugins/cryptocurrency-rocket-tools/cryptocurrency-rocket-tools.php on line 76
]]>