How to use live images on local install?

Try to filter the output URLs temporarily to replace them with online images, using the following code: add_filter( ‘wp_get_attachment_image_src’, function ( $image, $attachment_id, $size ) { // For thumbnails if ( $size ) { switch ( $size ) { case ‘thumbnail’: case ‘medium’: case ‘medium-large’: case ‘large’: $image[0] = str_replace( ‘localhost/’, ‘EXAMPLE.COM/’, $image[0] ); break; … Read more

Getting trackback spam, even with trackbacks disabled

If you are using a twentyten/eleven theme, they hardcode the pingback meta tag into the head.php file. Remove that line or use your own theme. Also, and maybe it’s only in multisite, but the X-Pingback header is sent along with the xmlrpc endpoint url as well. Removed with the following: /** * Remove the X-Pingback … Read more

Improve wordpress security by hiding non public resources

Using remove_action() can be remove unnecessary links for example: remove_action(‘wp_head’, ‘rsd_link’); //removes EditURI/RSD (Really Simple Discovery) link. remove_action(‘wp_head’, ‘wlwmanifest_link’); //removes wlwmanifest (Windows Live Writer) link. remove_action(‘wp_head’, ‘wp_generator’); //removes meta name generator. remove_action(‘wp_head’, ‘wp_shortlink_wp_head’); //removes shortlink. remove_action( ‘wp_head’, ‘feed_links’, 2 ); //removes feed links. remove_action(‘wp_head’, ‘feed_links_extra’, 3 ); //removes comments feed.

Multisite Network Port Num Issues?

Warning: This is just a test for dev installs and not production sites I was curious to see if there was a workaround, for those who want to develope multisites on their dev installs but on different ports than :80 and :443, e.g. :8080. I only found this blog post by Henri Benoit. There he … Read more

How can I debug the TTFB in WP?

Meanwhile, I found some plugins and tools that can help with this: Query Monitor Laps Debug Bar with some add-ons(Slow Actions, Rewrite Rules, etc.) If you really wanna go deep, try using Webgrind. Not the most friendly tool, but it’ll do the job. Be aware that some of this tools will also have an impact … Read more

Control verbosity level of WP DEBUG?

When WP_DEBUG is set, WordPress sets (via wp_debug_mode() call early in core load process) the error reporting level to E_ALL & ~E_DEPRECATED & ~E_STRICT. This means all warnings and errors except strict errors and PHP deprecated functions (not WordPress ones). You can define your own level in a custom mu-plugin (the override needs to be … Read more

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