WP CLI in WP 5.3 with PHP 7.4
WP CLI in WP 5.3 with PHP 7.4
WP CLI in WP 5.3 with PHP 7.4
wp cli search and replace on –network Error reconnecting to the database
I don’t know whether there is a better WP-CLI way or not, but you could write a simple script that recursively crawls your uploads directory (or it’s subdirectories) and than check the absolute paths (URLs) of those files and compare them against guid column in wp_posts table. If your file is not there, WordPress doesn’t … Read more
WP-CLI can evaluate a PHP file. See wp eval-file {PHP file name} for details, but essentially you: Write a PHP file containing the commands you want executed in WordPress’s context (let’s say you call it myfile.php) Run it using WP-CLI: wp eval-file myfile.php If you need it scheduled, you could use cron, the Windows Scheduler, … Read more
How to add an array to a command “wp config set”?
@kero the init hook proved to be way to early, thanks for the bright mind! The template_redirect hook works just fine as you mentioned.
Though, curl appeared to be properly working from https://localhost.sitedomain.com/phpinfo.php , the true cause of the error was that curl was in fact disabled within the global php.ini file located at /etc/php/<php version #>/php.ini , which is different from local active php.ini located at /etc/php/7.3/apache2/php.ini . Now everything works properly.
Yes, I will accept the “newbie” embarrassment and answer my basic questions . 😉 1.) www-data 2.) For fellow wp-cli newbies, follow this excellent tutorial to get wp-cli working in local dev, and remember NOT to forget the last step. 🙂 3.) One should never put the html directory in /home/ for the reason malicious … Read more
So I am using PEST as my testing framework, and if I just define my mocks in the helpers, they won’t be called correctly, because the WPCLI will probably be autoloaded after that on each test. So I added beforeEach(function () { $wpCliMock = \Mockery::mock(‘alias:WP_CLI’); $wpCliMock ->shouldReceive(‘success’) ->andReturnArg(0); $wpCliMock ->shouldReceive(‘error’) ->andReturnArg(0); }); Inside my tests, … Read more
WP-Cli Autoloads Non-existant Framework