-
Notifications
You must be signed in to change notification settings - Fork 271
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
Site not exporting properly - maybe not compatible with "bedrock" framework? #179
Comments
Hi @FredericoC, Thanks for reporting this. I haven't tested with Bedrock yet, but if any issues, will definitely want them resolved. Could you please try this latest build zip here: https://github.com/leonstafford/wordpress-static-html-plugin/releases/tag/latest_snapshot And do the usual of disabling all plugins/switching themes to isolate the cause. It could be a different environmental issue, too. Anything in the PHP error logs? Cheers, Leon |
edit: Redacted links Thanks for the fast response. The issue is the same with the new build;
This was working before I started using the bedrock boilerplate, so I'm assuming it is some incompatibility with the crawler... Clicking "Preview initial crawl List" returns:
Those links don't exist on my website, and I have about 60 more links which are not listed. Nginx Log:
This is also strange, returning 404 on https://example.test/ which definitely works.. |
Ok, rather interesting, no obvious things jumping out at me from that info.
Although, it hints at package managed WP, which Bedrock may be using and is
a known issue.
Earlier versions basically crawled from the outside, like SiteSucker or
httrack might. Recent versions infer things from WP, which gives some
advantages, but is likely what needs to handle “non-standard” WP dirs.
Bedrock and roots things are commom enough that I really need to fix this.
Will start debugging/working on a solution.
Thanks again for reporting.
Not sure, but possibly you could create some symlinks to trick it in the
meantime...
…On Wed, Nov 28, 2018 at 12:08 Frederico Carvalho ***@***.***> wrote:
Hi Leon,
Thanks for the fast response.
The issue is the same with the new build;
- Deactivated all plugins
- Used a default theme
It was working before I started using the bedrock boilerplate, so I'm
assuming it is some incompatibility with the crawler...
Clicking "Preview initial crawl List" returns:
https://example.test/electrical-takeoff-estimating-software/https://example.test/plumbing-takeoff-estimating-software/https://example.test/audio-visual-takeoff-estimating-software/https://example.test/security-takeoff-estimating-software/https://example.test/fire-takeoff-estimating-software/https://example.test/hvac-takeoff-estimating-software/https://example.test/roofing-takeoff-estimating-software/https://example.test/landscaping-takeoff-estimating-software/https://example.test/category/uncategorized/``` <https://example.test/category/uncategorized/>
Those links don't exist on my website, and I have about 60 more links which are not listed.
Nginx Log:
```2018/11/28 05:01:06 [error] 12027#12027: *5111 FastCGI sent in stderr: "PHP message: STARTING EXPORT: 2018-11-28 05:01:06
PHP message: STARTING EXPORT: PHP VERSION 7.2.12-1+ubuntu16.04.1+deb.sury.org+1
PHP message: STARTING EXPORT: PHP MAX EXECUTION TIME 120
PHP message: STARTING EXPORT: OS VERSION Linux groundplan 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64
PHP message: STARTING EXPORT: WP VERSION 4.9.8
PHP message: STARTING EXPORT: WP URL https://example.test
PHP message: STARTING EXPORT: WP SITEURL https://example.test/wp
PHP message: STARTING EXPORT: WP HOME https://example.test
PHP message: STARTING EXPORT: WP ADDRESS https://example.test/wp
PHP message: STARTING EXPORT: PLUGIN VERSION 5.9
PHP message: STARTING EXPORT: VIA CLI?
PHP message: STARTING EXPORT: STATIC EXPORT URL https://example.test/wp/mystaticsite/" while reading upstream, client: 192.168.50.1, server: example.test, request: "POST /wp/wp-admin/admin-ajax.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "https://example.test/wp/wp-admin/admin.php?page=wp2static"
2018/11/28 05:01:06 [error] 12027#12027: *5111 FastCGI sent in stderr: "PHP message: BAD RESPONSE STATUS (404): https://example.test/" while reading response header from upstream, client: 192.168.50.1, server: example.test, request: "POST /wp/wp-admin/admin-ajax.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "https://example.test/wp/wp-admin/admin.php?page=wp2static"
2018/11/28 05:01:07 [error] 12027#12027: *5111 FastCGI sent in stderr: "PHP message: BAD RESPONSE STATUS (404): https://example.test/electrical-takeoff-estimating-software/" while reading response header from upstream, client: 192.168.50.1, server: example.test, request: "POST /wp/wp-admin/admin-ajax.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "https://example.test/wp/wp-admin/admin.php?page=wp2static"
2018/11/28 05:01:07 [error] 12027#12027: *5111 FastCGI sent in stderr: "PHP message: BAD RESPONSE STATUS (404): https://example.test/plumbing-takeoff-estimating-software/" while reading response header from upstream, client: 192.168.50.1, server: example.test, request: "POST /wp/wp-admin/admin-ajax.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "https://example.test/wp/wp-admin/admin.php?page=wp2static"
2018/11/28 05:01:07 [error] 12027#12027: *5111 FastCGI sent in stderr: "PHP message: BAD RESPONSE STATUS (404): https://example.test/audio-visual-takeoff-estimating-software/" while reading response header from upstream, client: 192.168.50.1, server: example.test, request: "POST /wp/wp-admin/admin-ajax.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "https://example.test/wp/wp-admin/admin.php?page=wp2static"
2018/11/28 05:01:08 [error] 12027#12027: *5111 FastCGI sent in stderr: "PHP message: BAD RESPONSE STATUS (404): https://example.test/security-takeoff-estimating-software/" while reading response header from upstream, client: 192.168.50.1, server: example.test, request: "POST /wp/wp-admin/admin-ajax.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "https://example.test/wp/wp-admin/admin.php?page=wp2static"
2018/11/28 05:01:08 [error] 12027#12027: *5111 FastCGI sent in stderr: "PHP message: BAD RESPONSE STATUS (404): https://example.test/fire-takeoff-estimating-software/" while reading response header from upstream, client: 192.168.50.1, server: example.test, request: "POST /wp/wp-admin/admin-ajax.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "https://example.test/wp/wp-admin/admin.php?page=wp2static"
2018/11/28 05:01:09 [error] 12027#12027: *5111 FastCGI sent in stderr: "PHP message: BAD RESPONSE STATUS (404): https://example.test/hvac-takeoff-estimating-software/" while reading response header from upstream, client: 192.168.50.1, server: example.test, request: "POST /wp/wp-admin/admin-ajax.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "https://example.test/wp/wp-admin/admin.php?page=wp2static"
2018/11/28 05:01:09 [error] 12027#12027: *5111 FastCGI sent in stderr: "PHP message: BAD RESPONSE STATUS (404): https://example.test/roofing-takeoff-estimating-software/" while reading response header from upstream, client: 192.168.50.1, server: example.test, request: "POST /wp/wp-admin/admin-ajax.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "https://example.test/wp/wp-admin/admin.php?page=wp2static"
2018/11/28 05:01:09 [error] 12027#12027: *5111 FastCGI sent in stderr: "PHP message: BAD RESPONSE STATUS (404): https://example.test/landscaping-takeoff-estimating-software/" while reading response header from upstream, client: 192.168.50.1, server: example.test, request: "POST /wp/wp-admin/admin-ajax.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "https://example.test/wp/wp-admin/admin.php?page=wp2static"
2018/11/28 05:01:10 [error] 12027#12027: *5111 FastCGI sent in stderr: "PHP message: BAD RESPONSE STATUS (404): https://example.test/category/uncategorized/" while reading response header from upstream, client: 192.168.50.1, server: example.test, request: "POST /wp/wp-admin/admin-ajax.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "https://example.test/wp/wp-admin/admin.php?page=wp2static"
This is also strange, returning 404 on https://example.test/ which
definitely works on the browser.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#179 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB-JkS8M8SL4M50zHK-3f3WV-FdZevfXks5uzhoygaJpZM4Y2yCj>
.
|
Created a very simple example with Trellis (roots.io provisioning and deployment system) and Bedrock; https://github.com/3stack-software/bedrock-wpstatic-dev Instructions in the readme, if you're using linux it's very easy to get going. I just tested that example and the latest wp static dev is not working properly. This is based on their own example, but I've done a couple of small changes to the Let me know if you need any assistance |
As for the folder structure found this; I'll try to play around with symlinks... |
@leonstafford PROBLEM 1 - Not generating the list of page URL's properly;It seems that using the This caused WP2Static to POST a "subdirectory", which in turn ran the code below, removing links from the list in the process; POSSIBLE SOLUTION FOR 1Use get_home_url on WPSite.php instead of PROBLEM 2 - Not generating the list of assets (stylesheets, scripts, uploads, images etc);I was sure this was a path issue, so I had a look at the FilesHelper.php file. The POSSIBLE SOLUTION FOR 2I didn't get far with a solution for this one... But I hope my findings will steer you in the right direction.
Adding this code to FilesHelper.php (replace OTHER SUGGESTIONJust a suggestion, but using the Sage templating framework, there are other system folders/files that could be added to the default "exclusion list", like;
I hope this helps! |
Hi @FredericoC, FYI, I've got a Trellis + Bedrock install running now and will start debugging this tonight. It should solve it for Debian package-managed WP installs and anyone with custom paths. Fingers crossed! |
Debugging log: WPSite injected into plugin's JS for admin screen:
Default export with TwentySeventeen theme results in the following in the export folder:
|
A working site's reference:
|
We can also see the |
We also see the theme root and actual theme dirs differ, when seeing the themes set by default WP install vs any loaded by Bedrock
|
As there is nothing else in a Bedrock's /web/wp/ dir besides these, we may be OK to deduce the /wp/ dir based on the current theme's parent's parent's path, ie from we can go 2 levels up But at this point, do we even need the if we are rewiring the full path the the plugins dir and the full path to the themes, uploads, etc. What links would be left pointing to wp-contents? Also, |
proposed change is:
Summary
example rules for renaming directories: In order to move
At each iteration, it will be checking for existence of the source dir and throw an error if not found. |
Update: went with the former option. Less code, less potential for errors. noting another issue during implementation: When plugin is trying to just copy a file that doesn't need parsing, it's assuming the standard WP directory structure. We can either make this optimization an option or put in some better detection to find where the files are... (latter preferred)
|
@FredericoC this part is now working - w00t! Quite a bit of (needed) refactoring came out of this task, so still a bit more work/tidying up, but I'm really excited about this stuff coming out! |
@FredericoC happy to close this now 😸 I've put an example guide here: https://forum.wp2static.com/-42/how-to-export-when-using-bedrock-by-rootsio And this is in the latest build zips here: https://forum.wp2static.com/-30/how-to-install-the-latest-preview-of-version-59-of-wp2static Please re-open with any issues you find |
Great work Leon! Just a question, I haven't tried it yet but it seems you were focusing on the I'll have a look anyway and get back to you. Cheers! |
Hi @FredericoC, I think that's the case, my dir structure is here: https://forum.wp2static.com/-42/how-to-export-when-using-bedrock-by-rootsio Just whatever defaults they give out of the box. Wasn't completely sure where to put the other static stuff, like a static export test, it's under /wp in my example, but could just as easily be in /app, with the plugins and uploads, etc I'll make another task for those default excludes, good thinking! |
Hi @leonstafford your link does not exist anymore, and the export still doesn't work with bedrock, do you plan to look on this ? |
Hi @FredericoC, thanks for your effort in reporting. Sorry that no progress has been made with the Bedrock setup here. As the issue is open, I mean to address it (or someone may send a patch in the meantime if we're lucky!). I remember spending time to resolve Bedrock paths years ago, so you may find it works in this project vs WP2Static: https://github.com/leonstafford/static-html-output Else, we can try Simply Static (on wp.org, getting some updates recently) or I can provide a few other alternatives which may place nicer with the roots path setup until I get this fixed here. |
Hi @leonstafford thanks for your answer, but static-html-output does not work too. I've opened an issue with more information at Do you have some times to look at it ? Thanks ! |
Hi Leon,
I have used your plugin before with no issue, but it seems after I started using the "Bedrock" framework from roots.io the export doesn't work at all. The crawler doesn't discover links properly and the Wordpress assets don't come across;
Bedrock - https://roots.io/bedrock/
Maybe something to do with the way they handle paths?
I would love to use your plugin with S3 as it is perfect for our website. Let me know if you have any insight into this issue.
The text was updated successfully, but these errors were encountered: