Not sure if I’ve done something wrong - I can generate the static HTML (and can do everything through the web interface). Hopefully I’ve done something wrong that’s simple
But if I try to use wp-cli I get the following traceback;
bdr@ruby:~/httpdocs$ wp statichtmloutput deploy
Deploying static site
PHP Fatal error: Uncaught Error: Call to a member function request() on null in /var/www/vhosts/beardeddragonsrock.com/httpdocs/wp-content/plugins/static-html-output-plugin/src/BunnyCDN.php:191
Stack trace: #0 /var/www/vhosts/beardeddragonsrock.com/httpdocs/wp-content/plugins/static-html-output-plugin/src/BunnyCDN.php(100): StaticHTMLOutput\BunnyCDN->createFileInBunnyCDN() #1 /var/www/vhosts/beardeddragonsrock.com/httpdocs/wp-content/plugins/static-html-output-plugin/src/Deployer.php(64): StaticHTMLOutput\BunnyCDN->upload_files() #2 /var/www/vhosts/beardeddragonsrock.com/httpdocs/wp-content/plugins/static-html-output-plugin/src/CLI.php(153): StaticHTMLOutput\Deployer->deploy(false) #3 [internal function]: StaticHTMLOutput\CLI->deploy(Array, Array) #4 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(98): call_user_func(Array, Array, Array) #5 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher{closure}(Array, Array) #6 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php in /var/www/vhosts/beardeddragonsrock.com/httpdocs/wp-content/plugins/static-html-output-plugin/src/BunnyCDN.php on line 191
Fatal error: Uncaught Error: Call to a member function request() on null in /var/www/vhosts/beardeddragonsrock.com/httpdocs/wp-content/plugins/static-html-output-plugin/src/BunnyCDN.php:191
Stack trace: #0 /var/www/vhosts/beardeddragonsrock.com/httpdocs/wp-content/plugins/static-html-output-plugin/src/BunnyCDN.php(100): StaticHTMLOutput\BunnyCDN->createFileInBunnyCDN() #1 /var/www/vhosts/beardeddragonsrock.com/httpdocs/wp-content/plugins/static-html-output-plugin/src/Deployer.php(64): StaticHTMLOutput\BunnyCDN->upload_files() #2 /var/www/vhosts/beardeddragonsrock.com/httpdocs/wp-content/plugins/static-html-output-plugin/src/CLI.php(153): StaticHTMLOutput\Deployer->deploy(false) #3 [internal function]: StaticHTMLOutput\CLI->deploy(Array, Array) #4 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(98): call_user_func(Array, Array, Array) #5 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher{closure}(Array, Array) #6 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php in /var/www/vhosts/beardeddragonsrock.com/httpdocs/wp-content/plugins/static-html-output-plugin/src/BunnyCDN.php on line 191
Error: There has been a critical error on your website.Learn more about debugging in WordPress. There has been a critical error on your website.
Hmm, do you recall how far into the deployment it progressed? It may be hitting rate limit or some other issue with the API connectivity.
Looking at the code, that error looks likely only if settings aren’t there.
When you run from the UI, I believe you can run with the fields input, but not saved, so is it possible that the settings aren’t saved, thereby not available to the CLI?
To test, you can run the WP-CLI command to print out the settings, something like statichtmloutput options list
It may well be a bug, though I thought I’d tested all CLI deployers in that build. May need to wait a while for me to test myself unless @gulshan can confirm Bunny is deploying via CLI for him?
Your workaround for now is to run via UI, I guess, sorry!
I’m in habit of plugging this project that’s got some big improvements this week you may like to checkout: Lokl very early stages, but looks promising in being a great local dev environment for WP (maybe other things later).
Looking for feedback on people’s workflows, ie what’s missing. I don’t build anything with WordPress these days, so keen to add in a few user personas, ie someone like you may want to schedule CRON deployments or trigger the build and deploys simultaneously across 50 sites, whatever it may be.
What I like about it, is that once the minimal requirements are installed on Mac/Win/Linux, then it’s a consistent, optimized environment for all users vs the great unknown of 10,000’s of users running WP2Static in all kinds of environments today!