Posted: November 4, 2014 at 8:48 am
|
Hi, There seems to be an issue with your PDF invoice. The formatting is quite unprofessional and unpolished. All text is flushed against the left border of the page rather than having a normal margin as one would expect. The logo does not display, despite it being properly set in the Invoice payment method options screen (and it shows on that screen so we know it took it fine). Totals are not flush right as they are on every invoice I’ve ever seen. Changing the CSS style sheet to any of the 7 options provided has absolutely no effect. They all come out plain with the unpolished formatting as outlined above. So my question is: Is there a bug in my install that is causing this or is this really the way it’s supposed to look? Because if this is the way it’s supposed to look, that isn’t cool at all. |
Hi Greg, Could you let us know the version of Event Espresso that you are using so we can share some feedback? — |
|
|
4.4.4 |
The default Invoice template should look something like this – http://take.ms/BSSoM I notice the site is using SSL, how are you securing the pages? If using a plugin can you tell me which one and also if you are securing all pages? |
|
|
OK yeah – our invoice looks nothing like that. Could very well be an SSL issue – thought this would be our first incompatibility with the plugin we use: It’s called WordPress HTTPS (https://wordpress.org/plugins/wordpress-https/). It’s the most popular one for the task. |
Hi, Could you share some screenshots of your WP HTTPS settings? We’ve tested the current version of Event Espresso 4.4.4 along with the current version of WP HTTPS and it works: http://cl.ly/image/2T2V1z161C0P I’ve also tested with the force SSL settings (only changes made to WP HTTPS) for the registration checkout page and the thank you page. You can upload these screenshots to a free service like Getcloudapp.com or Tinygrab.com and then link to them here. Thanks — |
|
|
I can’t share screenshots of the website on a public forum because of NDA but the WP HTTPS settings are at default. SSL Host is set to the pre-filled domain name of the site. Force SSL Exclusively is checked. Everything else is unchecked and at default. The Order confirmation page is formatted correctly and looks fine. But clicking ‘Download PDF’ produces the train wreck I described. Not sure that should even be related to HTTPS since the system is creating the file before it transmits it, thus rendering https/http irrelevant. |
|
There could be a problem with the CSS files not being included due to a problem with the ssl connection. It could also be a permissions issue with the css files, or a php security setting. Do you have any apache, php, or WP logging enabled that you can view? |
|
Absolutely. We’re on an nginx server, for what it’s worth. Here is the PHP log when we attempt an invoice download: 11/5/2014 10:04:07 AM – www: PHP Warning: getimagesize(http://www.[redacted].com/wp-content/uploads/Black-on-white-field-logo.png): failed to open stream: no suitable wrapper could be found in /var/www/[redacted].com/wp-content/plugins/event-espresso-core-reg/modules/gateways/Invoice/lib/Invoice.class.php on line 237 11/5/2014 10:04:07 AM – www: PHP Warning: getimagesize(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /var/www/[redacted].com/wp-content/plugins/event-espresso-core-reg/modules/gateways/Invoice/lib/Invoice.class.php on line 237 11/5/2014 10:04:07 AM – www: PHP Warning: getimagesize(http://www.[redacted].com/wp-content/uploads/Black-on-white-field-logo.png): failed to open stream: no suitable wrapper could be found in /var/www/[redacted].com/wp-content/plugins/event-espresso-core-reg/modules/gateways/Invoice/lib/Invoice.class.php on line 237 11/5/2014 10:04:07 AM – www: PHP Warning: getimagesize(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /var/www/[redacted].com/wp-content/plugins/event-espresso-core-reg/modules/gateways/Invoice/lib/Invoice.class.php on line 237 11/5/2014 10:04:07 AM – www: PHP Warning: getimagesize(http://www.[redacted].com/wp-content/uploads/Black-on-white-field-logo.png): failed to open stream: no suitable wrapper could be found in /var/www/[redacted].com/wp-content/plugins/event-espresso-core-reg/modules/gateways/Invoice/lib/Invoice.class.php on line 237 11/5/2014 10:04:07 AM – www: PHP Warning: getimagesize(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /var/www/[redacted].com/wp-content/plugins/event-espresso-core-reg/modules/gateways/Invoice/lib/Invoice.class.php on line 237 —- I hope that helps your diagnosis. |
Hi Greg, Is fopen enabled on the server? http://php.net/manual/en/function.fopen.php — |
|
|
We use a managed hosting service so they do everything for us. Is that exactly what I should ask them, “Is fopen enabled? And if not can you enable it?” If so I’ll get it done. |
|
I spoke to my web hosting company, and they responded: You will want to verify with the plugin author that it does not require the exec() / exec.php or url_fopen functions, as both of those have been disabled on Synthesis hosting for security reasons. We do support CURL as an alternative to url_fopen. Your plugin author should know if they are using these functions or not. |
The DOMPDF library (which Event Espresso uses to generate the PDF’s) uses url_fopen functions and needs allow_url_fopen set to on in order to function correctly. I tested disabling fopen on a live server and see exactly the same issue with invoices as you do in that no styles are applied. |
|
|
OK – so I guess we have two options then: 1) Is there alternate way to make it work? If so, let’s do that. Our host is very well-known and one of the best at WP managed hosting. If they have it disabled for security, there’s probably a good reason why. |
Hi, I have a proof of concept for a workaround that shifts the PDF generation to another service. Do you have a staging site available for this host? I don’t need to see the live site, rather I need temporary access to a WP site on your host that has fopen disabled to confirm. If this is available, then please share a temporary SFTP and temporary WP-admin login via this link: https://eventespresso.com/send-login-details/ — |
|
Hi, There are two options available: 1) The link can be hidden from the thank you page but this is wrapped in a div which will also remove surrounding information such as the instructions for the invoice (e.g. please mail payment to this address). 2) You can try the Event Espresso 4.5 pre-release and follow these steps: https://gist.github.com/lorenzocaum/96f47b234b5e40fb30c4 It launches the invoice in a browser window instead of downloading it immediately. Additionally, it uses a third-party service called PrintFriendly instead of DOMPDF which needs fopen. — |
|
|
Lorenzo, I take it that your proof of concept from your prior message is bundled into 4.5? If so, I’d be happy to try it…here’s the thing: the last time I tried installing a pre-release onto a site that already had a regular release and installed them as two distinct plugins and caused all sorts of license issues culminating with Garth having to reset my license. So if there’s a way to install this pre-release where it simply replaces the existing version, I’m all for it. Let me know. Otherwise if there is code I can modify or file(s) I can replace to engage the new PDF methodology, I can do that too. Greg |
Hi, You’ll need the 4.5 pre-release as that has a template for the invoice that is managed through the WordPress dashboard. Also, you should not update by overwriting files, rather remove the prior version or relocate it one step above the wp-content/plugins folder and then install the pre-release. Other option for 4.4.4 The other option is to hide the div that holds the invoice link by linking its class to display:none. However, this will also remove the invoice payment instructions. — |
|
|
Lorenzo, OK – I followed your instructions, migrated my 4.4 data to 4.5. At first glance, everything seems to have migrated fine. I went through the registration process, downloaded the PDF – and unfortunately, it looks exactly the same. Is the PDF download supposed to work correctly now or does the pre-release simply give an option to remove the PDF Download button by editing the invoice? |
The Pre-release gives you the ability to remove the PDF download button by editing the invoice. In 4.5, you can edit the invoices and receipts in the same manner as Email message templates, right from the WordPress admin. |
|
|
I see and was able to do that. Perfect! Thanks. |
The support post ‘PDF Invoice by default is poorly formatted’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.