• Resolved 3y5hx9cxwkvam5h5

    (@3y5hx9cxwkvam5h5)


    Hi,

    After upgrading to the latest 7.x, it seems something wrong with the plugin. Please refer to the following log, thank you.

    Is it possible to disable PDF entirely since we do not attach PDF for customers (if that is the reason)?

    PHP Fatal error:  Uncaught TypeError: ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection, null given in /var/www/sampledomain.com/html/wp-admin/includes/class-wp-filesystem-ftpext.php:438
    Stack trace:
    #0 /var/www/sampledomain.com/html/wp-admin/includes/class-wp-filesystem-ftpext.php(438): ftp_nlist()
    #1 /var/www/sampledomain.com/html/wp-content/plugins/woocommerce-delivery-notes/includes/services/class-pdf.php(70): WP_Filesystem_FTPext->exists()
    #2 /var/www/sampledomain.com/html/wp-includes/class-wp-hook.php(341): Tyche\WCDN\Services\Pdf->init()
    #3 /var/www/sampledomain.com/html/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters()
    #4 /var/www/sampledomain.com/html/wp-includes/plugin.php(522): WP_Hook->do_action()
    #5 /var/www/sampledomain.com/html/wp-settings.php(771): do_action()
    #6 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1374): require('...')
    #7 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1293): WP_CLI\Runner->load_wordpress()
    #8 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
    #9 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(84): WP_CLI\Bootstrap\LaunchRunner->process()
    #10 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(35): WP_CLI\bootstrap()
    #11 phar:///usr/local/bin/wp/php/boot-phar.php(20): include('...')
    #12 /usr/local/bin/wp(4): include('...')
    #13 {main}
    thrown in /var/www/sampledomain.com/html/wp-admin/includes/class-wp-filesystem-ftpext.php on line 438
    Fatal error: Uncaught TypeError: ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection, null given in /var/www/sampledomain.com/html/wp-admin/includes/class-wp-filesystem-ftpext.php:438
    Stack trace:
    #0 /var/www/sampledomain.com/html/wp-admin/includes/class-wp-filesystem-ftpext.php(438): ftp_nlist()
    #1 /var/www/sampledomain.com/html/wp-content/plugins/woocommerce-delivery-notes/includes/services/class-pdf.php(70): WP_Filesystem_FTPext->exists()
    #2 /var/www/sampledomain.com/html/wp-includes/class-wp-hook.php(341): Tyche\WCDN\Services\Pdf->init()
    #3 /var/www/sampledomain.com/html/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters()
    #4 /var/www/sampledomain.com/html/wp-includes/plugin.php(522): WP_Hook->do_action()
    #5 /var/www/sampledomain.com/html/wp-settings.php(771): do_action()
    #6 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1374): require('...')
    #7 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1293): WP_CLI\Runner->load_wordpress()
    #8 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
    #9 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(84): WP_CLI\Bootstrap\LaunchRunner->process()
    #10 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(35): WP_CLI\bootstrap()
    #11 phar:///usr/local/bin/wp/php/boot-phar.php(20): include('...')
    #12 /usr/local/bin/wp(4): include('...')
    #13 {main}
    thrown in /var/www/sampledomain.com/html/wp-admin/includes/class-wp-filesystem-ftpext.php on line 438
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support anjitha21

    (@anjitha21)

    Hi @3y5hx9cxwkvam5h5

    Thank you for reporting this issue.

    Our developer has investigated the problem, fixed it, and provided a patch.

    Patch file: https://www.dropbox.com/scl/fi/p3zbobbd8es22ui5rbiti/class-pdf.php?rlkey=oncdlkfzojxb1yehtof7qvvt5&st=370701by&dl=0

    Please download the patch and replace the following file: /plugins/woocommerce-delivery-notes/includes/services/class-pdf.php

    This patch includes two improvements:

    1. It adds a safety check to prevent the fatal error from occurring when the filesystem is unavailable in the WP-CLI context.
    2. It introduces a new filter, wcdn_enable_pdf, which allows PDF generation to be disabled entirely if it is not required.

    To disable PDF generation, add the following code to your theme’s functions.php file:

    add_filter( 'wcdn_enable_pdf', '__return_false' );

    Please apply the patch and let us know if you encounter any further issues.

    Thread Starter 3y5hx9cxwkvam5h5

    (@3y5hx9cxwkvam5h5)

    Hi @anjitha21,

    Thanks for your code to disable making PDF and the patched file (class-pdf.php). I have disabled PDF and replaced class-pdf.php, now the plugin is working fine as usual. Thank you so much.

    By the way, will I need to replace this file for future versions manually or your will update this new class-pdf.php? Thanks.

    Any chance that filter can be turned into an option in the admin panel?

    Plugin Support anjitha21

    (@anjitha21)

    Hi @3y5hx9cxwkvam5h5,

    You’re welcome! I’m glad to hear that disabling the PDF generation and replacing the class-pdf.php file resolved the issue and that the plugin is now working as expected.

    The changes made in the patched class-pdf.php file will be included in a future plugin release, so once you update to that version, you will not need to manually replace the file again.

    If you are happy with the support provided, we would greatly appreciate it if you could leave us a review here

    Your feedback helps us improve our products and support services.

    Thank you.

    Plugin Support anjitha21

    (@anjitha21)

    Hi @ll09 ,

    Regarding the filter, that’s a good suggestion.

    At the moment, disabling PDF generation requires using the filter provided by our developer.

    However, we have created an enhancement request to add a dedicated option in the plugin settings so that users can enable or disable PDF generation directly from the admin panel without using custom code.

    Thank you for the suggestion.

    We’ll consider it for a future update.

    Thread Starter 3y5hx9cxwkvam5h5

    (@3y5hx9cxwkvam5h5)

    Hi @anjitha21,

    Thanks for all your great help and support. You and your team definitely deserve a 5-star rating!

    I found I already left a review a few year ago and cannot add more, so I revised the review with following updates:

    After upgrading to version 7.x, I had several questions and encountered a few issues.

    The support team was fantastic and always provided helpful sample code and solutions. Releasing a new major version is a bold move, and their support has been excellent throughout the transition.

    Highly recommended!
Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.