Cloning production site down to local?

It can absolutely be done using WP-Cli. Do you have SSH access to the remote server/site? If so, I am happy to show you a process I’ve cooked up using rsync as well as just some standard SQL for the database. That’s my preferred way to do it at the moment.

Clone WordPress for testing on localhost (with Fiddler)

I added this to Fiddler’s script in %USER%\Documents\Fiddler2\Scripts\CustomRules.js under OnBeforeResponse and the response rewrite started working static function OnBeforeResponse(oSession: Session) { if (m_Hide304s && oSession.responseCode == 304) { oSession[“ui-hide”] = “true”; } if (oSession.oResponse.headers.ExistsAndContains(“Content-Type”,”text/html”)){ oSession.utilDecodeResponse(); oSession.utilReplaceInResponse(‘127.0.0.3′,’my.domain.name’); oSession.utilReplaceInResponse(‘http:’,’https:’); } } and needed to set // define(‘WP_HOME’,’http://127.0.0.3/blog’); // define(‘WP_SITEURL’,’http://127.0.0.3/blog’); define(‘FORCE_SSL_LOGIN’,false); define(‘FORCE_SSL_ADMIN’,false); in wp-config.php In order to be … Read more

Mocking WP_CLI static methods in unit tests

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

pingbacks testing

Q: Are pingbacks sent immediately when a post is published, or are they scheduled as a cron job? If the later is correct, how often does the job run and can I trigger it manually? A: You can install core control (wordpress plugin) to find out more. Q: Are there any other terms for PBs … Read more

Testing performance of WordPress files

No. And even if there was, it would be probably useless anyway. You would get incorrect results, because a .php file might call slow functions from WordPress core files, and there are a lot of situations like this. You could try using the xdebug extension, it’s pretty close to what you’re looking for

Available methods for a/b testing the content

I don’t think it is common enough task for there to be generic recommendations in WordPress area. Taking the more specific part of your question — manipulating template is certainly possible and quite common. Any template (being loaded in native fashion) will have to go through template_include filter Results of single template specifically will go … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)