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

Directory path is missing slashes, causing uncaught exception and scan failure. #201

Open
johnalarcon opened this issue Sep 16, 2018 · 3 comments

Comments

@johnalarcon
Copy link

Works on live HTTP, but not on my localhost; missing slashes are causing an uncaught exception. The plugin skipped everything as too large to be scanned, even a 10 line dummy plugin. WP-cron is working fine. PHP ini values are more than generous. Error log shows the following (et al) for each plugin scanned. Never got around to doing the themes; killed the process after about a half hour and getting through less than 10 plugins. See the error at the end below... all the slashes are missing from the plugin path. I'm on Windows 10, XAMPP, PHP 7.2.3, Compatibility Checker 1.4.6.

[php7:notice] WPE PHP Compatibility: startScan: , referer: https://localhost/wp/wp-admin/admin-ajax.php?action=wpephpcompat_start_test
[php7:notice] WPE PHP Compatibility: timeout: 60, referer: https://localhost/wp/wp-admin/admin-ajax.php?action=wpephpcompat_start_test
[php7:notice] WPE PHP Compatibility: lock: 1, referer: https://localhost/wp/wp-admin/admin-ajax.php?action=wpephpcompat_start_test
[php7:notice] WPE PHP Compatibility: scan status: , referer: https://localhost/wp/wp-admin/admin-ajax.php?action=wpephpcompat_start_test
[php7:notice] WPE PHP Compatibility: Generating directory list., referer: https://localhost/wp/wp-admin/admin-ajax.php?action=wpephpcompat_start_test
[php7:notice] WPE PHP Compatibility: 15 plugins left to process., referer: https://localhost/wp/wp-admin/admin-ajax.php?action=wpephpcompat_start_test
[php7:notice] WPE PHP Compatibility: Processing: AAA Master, referer: https://localhost/wp/wp-admin/admin-ajax.php?action=wpephpcompat_start_test
[php7:notice] WPE PHP Compatibility: Attempted scan count: 1, referer: https://localhost/wp/wp-admin/admin-ajax.php?action=wpephpcompat_start_test
[php7:error] Uncaught PHP_CodeSniffer_Exception: Source file C:xampphtdocswpwp-contentpluginsaaa-master/ does not exist in.....

@nuessgens
Copy link

Having exact the same issue.
Ironically I created a local WAMP installation because of the following recommendation (from the Plugin-Site)

The best way around this timeout issue is to run this plugin on a local copy of your site

Is this still the same issue as #128 reported over one and a half years ago?

@nuessgens
Copy link

Almost forgot:
I fixed it locally by modifiying the method that inserts the plugin-paths (that will be analyzed) into the database.
I simply replaced the windows path-seperator (backslashes) with unix (slash)

If anyone is interested
Replace this block:

private function add_directory( $name, $path ) {
$dir = array(
'post_title' => $name,
'post_content' => $path,
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'wpephpcompat_jobs',
);
return wp_insert_post( $dir );
}

by

	private function add_directory( $name, $path ) {
		$tpath = str_replace("\\","/", $path);
		$dir = array(
			'post_title'   => $name,
			'post_content' => $tpath,
			'post_status'  => 'publish',
			'post_author'  => 1,
			'post_type'    => 'wpephpcompat_jobs',
		);

		return wp_insert_post( $dir );
	}

The file is located ${wp_dir}\wp-content\plugins\php-compatibility-checker\src\wpephpcompat.php

@bobbingwide
Copy link

Same problem. Will try the recommended fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants