Viljami Kuosmanen
Forum Replies Created
-
Forum: Plugins
In reply to: [WordPress PDF Templates] Speed up pdf generation?Marking this topic as resolved.
Forum: Plugins
In reply to: [WordPress PDF Templates] Fatal error strangeMarking topic as resolved due to inactivity from original poster.
Forum: Plugins
In reply to: [WordPress PDF Templates] Speed up pdf generation?This is a DOMPDF issue. Nothing that I can do about the speed really. :/
One thing I’ve noticed helps with the performance, is getting rid table layouts as much as possible. Especially with tables spanning more than 1 page, DOMPDF seems to take forever to figure out the layout.
You could try with PHP7 or HHVM perhaps? 🙂
Forum: Plugins
In reply to: [WordPress PDF Templates] Change the language of the PDFThe plugin is proven to work nicely with multilingual plugins like Polylang since it’s just another page template.
If you wish, you could tweak your pdf template in sucha a manner that it would understand the ?language= get parameter. 🙂
Forum: Plugins
In reply to: [WordPress PDF Templates] Warning: file_get_contentsIt just occured to me that you may have
display_errorsturned on, which might cause output to start prematurely due to warnings.Can you add these lines to your wp-config.php and see if it makes any difference?
define('WP_DEBUG', false); define('WP_DEBUG_DISPLAY', false); define('SCRIPT_DEBUG', false); ini_set('display_errors', 0); ini_set('log_errors', 'On');I’ve also just pushed version 1.4.2, which contains the fix for the localhost issue. You should upgrade asap.
Forum: Plugins
In reply to: [WordPress PDF Templates] PDF blank pageI’ve just pushed version 1.4.2, which should fix these issues. This seems to happen when localhost doesn’t point to to the wordpress installation.
Can you try upgrading to 1.4.2 and report back if this fixes your issue?
Cheers!
Forum: Plugins
In reply to: [WordPress PDF Templates] Warning: file_get_contentsHave you got wp cli enabled?
Do you get any whitespace when running
wp-cli eval exit?Forum: Plugins
In reply to: [WordPress PDF Templates] Warning: file_get_contents$link = $url['scheme'] .'://'. $_SERVER['SERVER_NAME'] . $url['path'];This is not a very good fix. We can’t assume that the current wordpress installation is in the same domain. Did you try the branch i sent you? It automatically detects if http://localhost doesn’t work and falls back to what’s essentially your solution.
Notice: Use of undefined constant DOMPDF_DEFAULT_PAPER_SIZE - assumed 'DOMPDF_DEFAULT_PAPER_SIZE' in xxxxxxx/dev/wp-content/plugins/wp-pdf-templates/wp-pdf-templates.php on line 350 Unable to stream pdf: headers already sentThis is because your site has started output before the
template_redirectaction. Maybe a rogue?>somewhere in your code.Forum: Plugins
In reply to: [WordPress PDF Templates] Warning: file_get_contentsCan you try cloning this branch from github and see if the issue still persists?
https://github.com/anttiviljami/wp-pdf-templates/tree/bugfix-localhost
The current stable version doesn’t work on hosts, where localhost doesn’t point to the wordpress server. I have no idea why on some servers that’s not the case but it seems like there are some hosts that misconfigure theirs servers like that.
If enough people say the bugfix works fine, i’ll just push a new version upstream.
Cheers!
Hi! I’ve recently run into the same issue on a couple of websites.
For some reason, WooCommerce will sometimes leave orphaned variations in the database after deleting the parent product. This really should not happen and is for the moment unclear what causes it to happen.
This causes lots of issues in the admin side, like not being able to add products to Coupons, or not being able to add products to orders; both due to PHP Fatal errors like you mentioned.
I’ve created a tool which will let you delete all of the orphaned variation products from the database. They really shouldn’t exist. Have a go:
https://github.com/anttiviljami/woocommerce-clean-orphaned-variations
Forum: Plugins
In reply to: [WordPress PDF Templates] SVG tags are not renderedOf course! Thanks for your input. Feel free to post any tips and tricks below
Forum: Plugins
In reply to: [WordPress PDF Templates] SVG tags are not renderedJavascript won’t work. You would need to pre-render the svg to a png file on the server side.
Feel free to implement it as a filter to this plugin and give me a PR on GitHub. 🙂
Hope we’ll get a better DomPDF soon
Forum: Plugins
In reply to: [WordPress PDF Templates] SVG tags are not renderedDOMPDF doesn’t support SVG as far as i know. Sorry. Nothing we can do here 🙁
Forum: Plugins
In reply to: [WordPress PDF Templates] Landscape orientation on specific template?Sure! You can define the orientation in an action hook somewhere else, just before the pdf run.
For example in your functions.php:
add_filter( 'template_include', '_choose_orientation'); function _choose_orientation( $template ) { if ( basename( $template ) === 'portrait-template-pdf.php' ) { define('DOMPDF_PAPER_ORIENTATION', 'portrait'); } else { define('DOMPDF_PAPER_ORIENTATION', 'landscape'); } return $template; }Code above is not actually tested, but should in theory work.
Forum: Plugins
In reply to: [WordPress PDF Templates] Fatal error strangeYou have to build the plugin with composer if cloned straight from github. See README from the repo. The WordPress.org version is lagging a few commits behind due to some changes still being tested.