anttiviljami / wp-pdf-templates

Add PDF templates to your WordPress theme
https://wordpress.org/plugins/wp-pdf-templates
GNU General Public License v3.0
42 stars 18 forks source link

Localhost misconfigured leading to blank PDFs #17

Open e3betht opened 8 years ago

e3betht commented 8 years ago

On shared hosting, localhost is often not configured correctly so it does not actually allow the writing of the PDF, leading to blank PDFs. The fix in this PR: https://github.com/anttiviljami/wp-pdf-templates/commit/3a3c126132221791cd2619c69935be01e1c2546b

is not sufficient because $html is not empty, but localhost is not writable, so the PDF will not work.

e3betht commented 8 years ago

@anttiviljami - What's the reasoning behind using localhost instead of WordPress's call to get the permalink? This question is in regards to your comment "Really, what we should be checking is whether localhost points to the local Wordpress installation. That can't be done via the file:// URLs."

anttiviljami commented 8 years ago

This is due to development / staging environments that might not have a public http address. Usually a for example a local vagrant environment won't point correctly to itself if using the public address for the website, which will cause problems for development.

One way to fix issue that I've thought of, would be just a configuration option to disable using localhost vs. the public address.

e3betht commented 8 years ago

I think a configuration option for development versus live environment would be great. Is that something you would like me to look at adding? Or is this a bigger issue that needs more discussion before being implemented? Beth

On 5/4/16 12:01 PM, Antti Kuosmanen wrote:

This is due to development / staging environments that might not have a public http address. Usually a for example a local vagrant environment won't point correctly to itself if using the public address for the website, which will cause problems for development.

One way to fix issue that I've thought of, would be just a configuration option to disable using localhost vs. the public address.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/anttiviljami/wp-pdf-templates/issues/17#issuecomment-216932339

Beth Tucker Long Treeline Design, LLC 807 Arbor Vitae Place Verona, WI 53593 608-770-6677 http://www.TreelineDesign.com

anttiviljami commented 8 years ago

It's not quite that simple. It's not really a matter of development vs. live environment, but a matter of server configuration. Some live environments don't have public addresses either e.g. when they're inside a firewall or in an enterprise local network.

e3betht commented 8 years ago

I understand. Let me know if there is something I can do to help get this fixed for the next release of the plugin as our live environment does not work with your current version.

Beth Tucker Long Treeline Design, LLC 807 Arbor Vitae Place Verona, WI 53593 608-770-6677 http://www.TreelineDesign.com

On May 5, 2016, at 00:42, Antti Kuosmanen notifications@github.com wrote:

It's not quite that simple. It's not really a matter of development vs. live environment, but a matter of server configuration. Some live environments don't have public addresses either e.g. when they're inside a firewall or in an enterprise local network.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

BeaTTuner commented 8 years ago

Put it in a config file?