Move social link detection from js to php.