Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wp_content_dir error when migrating website #1064

Open
irinelenache opened this issue Dec 12, 2023 · 0 comments
Open

wp_content_dir error when migrating website #1064

irinelenache opened this issue Dec 12, 2023 · 0 comments
Labels
bug This label could be used to identify issues that are caused by a defect in the product. customer report Indicates the request came from a customer.

Comments

@irinelenache
Copy link

Description

A user reported he encountered some errors while migrating his website to nginx:

NOTICE: PHP message: PHP Fatal error:  Uncaught TypeError: ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection, null given in /usr/share/nginx/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php:438
Stack trace:
#0 /usr/share/nginx/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php(438): ftp_nlist()
#1 /usr/share/nginx/wordpress/wp-admin/includes/class-wp-filesystem-base.php(231): WP_Filesystem_FTPext->exists()
#2 /usr/share/nginx/wordpress/wp-admin/includes/class-wp-filesystem-base.php(79): WP_Filesystem_Base->find_folder()
#3 /usr/share/nginx/wordpress/wp-content/plugins/visualizer/classes/Visualizer/Module.php(532): WP_Filesystem_Base->wp_content_dir()
#4 /usr/share/nginx/wordpress/wp-content/plugins/visualizer/classes/Visualizer/Module/Frontend.php(274): Visualizer_Module->get_user_customization_js()
#5 /usr/share/nginx/wordpress/wp-includes/class-wp-hook.php(324): Visualizer_Module_Frontend->enqueueScripts()
#6 /usr/share/nginx/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#7 /usr/share/nginx/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
#8 /usr/share/nginx/wordpress/wp-includes/script-loader.php(2262): do_action()
#9 /usr/share/nginx/wordpress/wp-includes/class-wp-hook.php(324): wp_enqueue_scripts()
#10 /usr/share/nginx/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#11 /usr/share/nginx/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
#12 /usr/share/nginx/wordpress/wp-includes/general-template.php(3052): do_action()
#13 /usr/share/nginx/wordpress/wp-content/themes/graphy/header.php(15): wp_head()
#14 /usr/share/nginx/wordpress/wp-includes/template.php(790): require_once('/usr/share/nginx/wordpress/wp-content/themes/graphy/header.php')
#15 /usr/share/nginx/wordpress/wp-includes/template.php(725): load_template()
#16 /usr/share/nginx/wordpress/wp-includes/general-template.php(48): locate_template()
#17 /usr/share/nginx/wordpress/wp-content/themes/graphy/home.php(10): get_header()
#18 /usr/share/nginx/wordpress/wp-includes/template-loader.php(106): include('/usr/share/nginx/wordpress/wp-content/themes/graphy/home.php')
#19 /usr/share/nginx/wordpress/wp-blog-header.php(19): require_once('/usr/share/nginx/wordpress/wp-includes/template-loader.php')
#20 /usr/share/nginx/wordpress/index.php(17): require('/usr/share/nginx/wordpress/wp-blog-header.php')
#21 {main}
  thrown in /usr/share/nginx/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php on line 438

He also provided a fix for this:

In going through the plugin’s code with the stack trace above, I believe the issue is your call to this method: WP_Filesystem_Base::wp_content_dir(). This method is called on lines 532 and 533 of classes/Visualizer/Module.php. Changing these lines to use WP_CONTENT_DIR alleviated the error.

Ticket here - https://wordpress.org/support/topic/wp_content_dir-creating-error/

Step-by-step reproduction instructions

I couldn't replicate it

Screenshots, screen recording, code snippet or Help Scout ticket

https://wordpress.org/support/topic/wp_content_dir-creating-error/

Environment info

No response

Is the issue you are reporting a regression

No

@irinelenache irinelenache added bug This label could be used to identify issues that are caused by a defect in the product. customer report Indicates the request came from a customer. labels Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This label could be used to identify issues that are caused by a defect in the product. customer report Indicates the request came from a customer.
Projects
None yet
Development

No branches or pull requests

1 participant