[WordPress Plugin] Attachments allows you to simply append any number of items from your WordPress Media Library to Posts, Pages, and Custom Post Types
I found, what I believe to be, a bug within a plugin. Don't think it's a biggie, but here it is:
I am hosting a website with WP Engine. The website was non-SSL for a while, but I purchased SSL certificate at some point. When you request SSL certificate with them, they don't do search & replace on database for http:// and replace it with https://. They seem to force it (somehow) during the processing, so options in database keep using "http://".
Keeping this in mind, when your plugin tries to perform the following lines
it fails to generate an absolute path for the desired file. This is because the wp_upload_dir() works off database options, which is non-ssl, and the $url variable holds SSL permalink. Therefore the str_replace fails to find "http://" in the $url variable and replace it with an absolute path.
I patched it with a simple line
$url = str_replace( "https://", http://", $url );
but ideally it would be good to have any kind of a versatile fix released (or at least a hook / filter added, so I can modify it on-fly).
I hope this all makes sense. If not, feel free to ask for further details.
Hi,
I found, what I believe to be, a bug within a plugin. Don't think it's a biggie, but here it is:
I am hosting a website with WP Engine. The website was non-SSL for a while, but I purchased SSL certificate at some point. When you request SSL certificate with them, they don't do search & replace on database for http:// and replace it with https://. They seem to force it (somehow) during the processing, so options in database keep using "http://".
Keeping this in mind, when your plugin tries to perform the following lines
classes/class.attachments.php:496-498
it fails to generate an absolute path for the desired file. This is because the wp_upload_dir() works off database options, which is non-ssl, and the $url variable holds SSL permalink. Therefore the str_replace fails to find "http://" in the $url variable and replace it with an absolute path.
I patched it with a simple line
$url = str_replace( "https://", http://", $url );
but ideally it would be good to have any kind of a versatile fix released (or at least a hook / filter added, so I can modify it on-fly).I hope this all makes sense. If not, feel free to ask for further details.
Thanks a lot!