wp2static: PHP Fatal Error
Hi, I’ve set up a blank WP installation with download wp2static plugin. When running generator I’ve got 500 error (Changed maximum execution time - still no success). Later, I’ve checked PHP logs.
[05-Oct-2020 23:00:41 UTC] PHP Fatal error: Uncaught TypeError: Argument 1 passed to WP2Static\Request::getResponseCode() must be of the type string, array given, called in C:\laragon\www\wp2static\wp-content\plugins\wp2static-master\src\DetectSitemapsURLs.php on line 44 and defined in C:\laragon\www\wp2static\wp-content\plugins\wp2static-master\src\Request.php:366 Stack trace: #0 C:\laragon\www\wp2static\wp-content\plugins\wp2static-master\src\DetectSitemapsURLs.php(44): WP2Static\Request->getResponseCode(Array) #1 C:\laragon\www\wp2static\wp-content\plugins\wp2static-master\src\URLDetector.php(70): WP2Static\DetectSitemapsURLs::detect('http://wp2stati...') #2 C:\laragon\www\wp2static\wp-content\plugins\wp2static-master\src\Controller.php(620): WP2Static\URLDetector::detectURLs() #3 C:\laragon\www\wp2static\wp-content\plugins\wp2static-master\src\Controller.php(724): WP2Static\Controller::wp2staticHeadless() #4 C:\laragon\www\wp2static\wp-includes\class-wp-hook.php(285): WP2Static\Controller::wp2staticRun() #5 C:\laragon\www\wp2static\wp-includes\clas in C:\laragon\www\wp2static\wp-content\plugins\wp2static-master\src\Request.php on line 366
What is wrong? My PHP version is 7.4
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (7 by maintainers)
Commits related to this issue
- Trying solve bug #685 — committed to ebavs/wp2static by fromcouch 4 years ago
I was uploaded fix. I can’t test deeply because my two test environments (I have one with docker and other in one of my servers) and my production site don’t read robots.txt property and return empty array. In your environment is obvious that robots.txt is detected and return sitemaps.
Please, test changes and report.
@adrianratajczak thanks for reporting. 2nd instance of this I’ve heard of and looks like a state not predicted properly in the plugin’s code.
@fromcouch - recent changes to the response code parsing related?
Hi @samuel20miglia and @adrianratajczak i need to know array content here: #0 /home/samuelve/public_html/heveloon.co.uk/wp-content/plugins/wp2static-master/src/DetectSitemapsURLs.php(44): WP2Static\Request->getResponseCode(Array)
I’m preparing a debug version in another repository. Seems something related to PHP 7.4 but, unfortunately, i can’t reproduce.
@adrianratajczak in the meantime, you may try this other plugin if it’s blocking