fkrauthan / wp-mpdf

Print WordPress posts as PDF. Optional with Geshi highlighting.
55 stars 23 forks source link

Update mpdf #21

Closed timurc closed 2 years ago

timurc commented 2 years ago

Hey,

I just added it to one of the pages I manage and it worked great, thanks a lot!

When I pushed it to production, I got server errors and the PDF did not render:

PHP Fatal error:  Array and string offset access syntax with curly braces is no longer supported in [...]/wp-content/plugins/wp-mpdf/mpdf/mpdf.php on line 2349

I got this because I use PHP 8. I am now using 7.3 to circumvent this.

I assume this would be fixed if mpdf would be updated, because the currently used version of mpdf (6.1) is pretty old.

I don't know how actively maintained this is and if it's too much to ask. I would look into it myself, but I am currently very short in time and also I don't have very deep php knowledge. I looked into it briefly, but not very deeply but I would love to be able to use a newer PHP version again.

fkrauthan commented 2 years ago

Hi yeah, I do have already a branch ready for a much newer mpdf version. If you want you could give that branch a try as I am not actively using this plugin anymore. I will try todo some more testing before the new year and release that new branch.

timurc commented 2 years ago

Hey Florian, Thanks! Sure, I would take a look at it and see if it works! I would guess it's mpdf-8-upgrade? I'll try to carve out some time for it in the upcoming week.

fkrauthan commented 2 years ago

Yeah exactly. You can download the plugin folder from my gdrive for testing (https://drive.google.com/file/d/1-NTmZE6KajBANMlJQ3QCy3Meg9fPsjDB/view?usp=sharing). If you want to test it from the the source you would have to install composer and run composer install first before adding it to your wordpress.

Please let me know how your testing goes. If all goes well I can release it as early as next weekend.

timurc commented 2 years ago

Very good! I wasn't hoping for such a quick update.

I testet it and the PDF rendering went just fine.

One problem I found: when using PHP 8 the "need login" option in the admin panel is not persistent, can't turn it off. Sometimes it just re-checks itself on save, sometimes it stays off but will be on again after re-load. I did not see errors for this. It does not happen with PHP 7.3

Can I supply with anything else to debug, or are there specific things to look for while testing?

fkrauthan commented 2 years ago

Just in general if you have any complex posts or something like that to ensure it still prints as expected

fkrauthan commented 2 years ago

Ok new version 3.7 is now published.

timurc commented 2 years ago

yay, thanks!