• Resolved houtai

    (@houtai)


    I’ve recently updated this plugin and am getting a blank screen when trying to view the packing or invoice pdfs.

    I turned on the debugger and it’s showing me this error.

    Fatal error: Class 'Dompdf\Options' not found in /var/www/vhosts/{my_website}/httpdocs/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/class-wcpdf-pdf-maker.php on line 35

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! This may be a plugin conflict. The Dompdf\Options Class is present in the plugin and should normally autoload.

    Do you use any other plugins that create PDF output?

    Can you check that this file is present?
    woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Options.php

    If not, it means that the plugin was not installed completely.

    Which PHP version do you use?

    Let me know what you find!

    Thread Starter houtai

    (@houtai)

    So i’ve tried uninstalling and delete all the plugin files and re-uploading them. Still doesn’t work. :/ I don’t use any other pdf creation plugins.

    The file is there so it definitely is not trouble with the install.

    The PHP version we use is 5.6.31

    I’m not sure what else to do..

    Plugin Contributor Ewout

    (@pomegranate)

    Hello,
    Instead of installing by uploading, can you try installing from the WordPress interface to rule out any issues there? Just go to Plugins > Add New > search for “WooCommerce PDF Invoices & Packing Slips” and click install.

    I haven’t had any other reports of this yet, so if installing from WordPress doesn’t work either I think it’s down to the specifics of your server configuration. I’m not sure where else to look either. The autoloader is generated by Composer (which is very widely used and reliable), the file is there and there should be no issue with PHP 5.6 compatibility… (plugin is tested on 5.6, 7.0 & 7.1)

    Thread Starter houtai

    (@houtai)

    Hi,
    So we figured out the issue. The autoload_classmap file was not being generated correctly.

    I went into the plugins folder through ssh and ran:
    composer dump-autoload -o

    That generated the correct autoload_classmap file and now I can see the pdf being generated

    Plugin Contributor Ewout

    (@pomegranate)

    Thanks! It’s strange that I haven’t had any other reports for this issue and no issues with the autoload myself. Did you upload the plugin as is or did you only upload the base plugin and then imported the vendor libraries with composer?
    Are you on HHMV?

    Plugin Contributor Ewout

    (@pomegranate)

    I just ran a few tests and using the classmap (using composer dump-autoload -o as you did) significantly increases memory consumption of the plugin, to a level that is not acceptable for most sites.
    This is not really my field of expertise though, any suggestions? Do you know why it didn’t use PSR on your install in the first place?

    Scratch that… may have had a different cause

    • This reply was modified 7 years, 4 months ago by Ewout.
    • This reply was modified 7 years, 4 months ago by Ewout.
    Thread Starter houtai

    (@houtai)

    Yea it was very strange. We downloaded the plugin files straight from the wordpress sites which included the vendor libraries. We are not on HHMV.

    It’s a mystery to me as well, we checked the error logs when install the plugin but nothing popped up.

    I’m no expert either, just asked my senior dev. But it shouldn’t increase the memory consumption that much. composer dump-autoload -o just outputs an array of strings. He linked me these articles about composer that might help you.

    https://moquet.net/blog/5-features-about-composer-php/

    https://getcomposer.org/doc/articles/autoloader-optimization.md

    Plugin Contributor Ewout

    (@pomegranate)

    Thank you so much for sharing that! I have updated the autoloader classmap in and will include this in the next release.

    Hi,
    Not sure if I have a similar problem, I get the following error:
    Fatal error: Call to undefined function Dompdf\mb_internal_encoding() in /home/jessica/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Dompdf.php on line 274

    Have tried testing with simple template, can view in html and have reinstalled plugins, no obvious pdf conflicts.

    I’m not an expert so not sure how test the fix above, are you able to assist?

    Thanks!

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! I have just pushed an update (2.0.3) that should resolve the initial issue in this thread.

    @judderbug I think your issue is unrelated. Can you check the Status tab of the PDF Invoice settings and see if ‘MBString extension’ is flagged red or orange? If so, this means your PHP installation is missing an important library. Your host should be able to help with this, it’s a very common library that is enabled on most hosts.

    Let me know if MBString was actually enabled already, in that case I will further investigate the issue for you. Can you please open a new thread called “Call to undefined function mb_internal_encoding”?

    Thanks!

    Ewout

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Upgrade Fatal Error: Class’ is closed to new replies.