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

FTP credentials required on every pageload bug #1774

Closed
michaeltorbert opened this issue Jul 12, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@michaeltorbert
Copy link
Member

commented Jul 12, 2018

This happens with some sites that have whatever filesystem issues (no suexec, incorrect permissions, not having FS_METHOD as direct, or whatever). (Reported by Eric in email)

For testing, we can force the issue by changing FS_Method to ftpsockets in wp-config.php

screen shot 2018-07-12 at 12 02 04 am

The problem is has_physical_file() may be getting called on every pageload, ultimately meaning request_filesystem_credentials() is getting called on every pageload.

6b15775#diff-afdd82b6421840c82e93c85bac49b713R82

Offhand I'd recommend something like this to move it out of the construct:

$dirname = AIOSEOP_PLUGIN_DIRNAME;
$robots_admin_page = "all-in-one-seo_page_$dirname/modules/aioseop_robots";
add_action('load-'.$my_admin_page, array( $this, function_to_wrap_has_physical_file_call_in ) );
}

		function function_to_wrap_has_physical_file_call_in

		if ( $this->has_physical_file() ) {
			if ( ( is_multisite() && is_network_admin() ) || ( ! is_multisite() && current_user_can( 'manage_options') ) ) {

This will at least restrict it to the robots.txt options page... then we need to figure out where to go from there to not have it request filesystem credentials every time we want to access the filesystem. If we can't access it, we should fail gracefully.

In the sitemap module, it uses add_action( $this->prefix . 'settings_header'...
in add_page_hooks()

@michaeltorbert

This comment has been minimized.

Copy link
Member Author

commented Jul 12, 2018

While this code still needs to be improved (doesn't need to happen on every pageload, and at a minimum on just the robots.txt module options page), we may want to start with just 1777 as a quick fix in the meantime.

michaeltorbert added a commit that referenced this issue Jul 13, 2018

@wpsmort

This comment has been minimized.

Copy link
Member

commented Jul 13, 2018

Reported again by Krystian Hamerlik-Konopka via email

michaeltorbert added a commit that referenced this issue Jul 13, 2018

Merge pull request #1780 from semperfiwebdesign/issue-1774
restrict physical file check to robots.txt options page #1774
@wpsmort

This comment has been minimized.

Copy link
Member

commented Jul 13, 2018

Testing identified a bug and issue #1785 was opened to fix this in v2.7.2. Leaving this open until everything has been resolved and users have been notified.

@michaeltorbert michaeltorbert modified the milestones: 2.7.1, 2.7.3, 2.8 Aug 7, 2018

@wpsmort wpsmort removed the Needs Testing label Aug 13, 2018

@wpsmort wpsmort removed their assignment Aug 13, 2018

@wpsmort

This comment has been minimized.

Copy link
Member

commented Aug 13, 2018

@michaeltorbert I tested this and it's much improved but the code looks to still be loaded on the Plugins page.

@michaeltorbert

This comment has been minimized.

Copy link
Member Author

commented Aug 14, 2018

@wpsmort That's from WP core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.