Skip to content

Instantly share code, notes, and snippets.

View nawawi's full-sized avatar

Nawawi Jamili nawawi

View GitHub Profile
The HTTP requests made by the premium plugins are really a huge pain. While I understand the purpose, I still don't get why they need to happen so often.
I have been struggling during a long time with this issue. Woo plugins, affiliate, etc. they all send requests even on page, post or custom posts pages. When their server is loaded, sit can easily take between 500ms to 2s.
Puneet, the only way to fix this has been to block all http request on specific pages by adding a filter 'pre_http_request'.
Here is a sample code: http://pastebin.com/5bji3rQG
This is not pretty but this should give you a starting point.
Before experimenting with this, you can always test by adding
define( 'WP_HTTP_BLOCK_EXTERNAL', TRUE );
@bainternet
bainternet / php-server-with-wordpress.md
Created January 8, 2020 20:11 — forked from edheltzel/php-server-with-wordpress.md
Using PHP's built in server for WordPress development.

Preface

So in the past, I've used MAMP/MAMP Pro apps and others alike. I've also, setup my own local MAMP stack with homebrew, that used dnsmasq to dynamically add vhosts anytime I added a new folder to the Sites folder which made it very convenient. But, then I started running into other environment issues with PHP versions on remote machines/servers not being updated or some other crazy thingamabob breaking. I researched and invested time in Vagrant, but that seem to break more often than my homebrew setup. So I researched again investing time into Docker via Docker for Mac (which is BAMF), which I'm sold on and use daily, but it still seems a little bleeding edge and not so simple to wrap your head around the concept. Not to mention I don't have a real use case to play with and take advantage of all the features that come packed with Docker.

This is the beginning of trying to find something more simple, and slightly quicker to setup.