How to Get Users Email Address via Twitter REST API

Twitter REST API hitherto did not include users email address by default when the /verify_credentials endpoint is requested, unless your application had been explicitly whitelisted after filling the special permissions part of this form.

Now you can get user’s email addresses included in the API response by ensuring you have links to your privacy policy and terms of service saved in your application settings.…

How to Replace BuddyPress Avatar with a Custom One

So i received a question from a customer over at ProfilePress if it was possible for avatars or profile pictures uploaded by users of his website via ProfilePress powered front-end registration and edit profile forms to automatically replace that of BuddyPress.

You know, BuddyPress has its own mechanism for uploading and managing users avatar. Having his website users editing their avatars in two places didn’t quite go down well with him.…

Getting Good with Git & GitHub

I was recently involved in building an email marketing service (think MailChimp) where we needed to automatically send alongside HTML campaigns, their plain text version.

I was assigned to get this feature built out. To accomplish this, I tested a lot of HTML to text libraries and finally, settled for this by Jevon Wright.

Using soundasleep/html2text repository, we will be learning how to fork a Git repository on GitHub, make improvement on a fork, submit pull request, fetching, pulling and merging in changes from remote.…

SmartSVN – A Perfect TortoiseSVN Alternative

I have never fully grokked the use of Subversion (SVN) as a version control system on the command-line like Git and as such, relies on GUI applications such as TortoiseSVN. The only time i use SVN is when i want to deploy a new or updated version of my WordPress plugins.

In the past when i was a PC (windows OS) user, TortoiseSVN served me well.…

Solution to “Font from origin ‘http://cdn.domain.com’ has been blocked from loading by Cross-Origin Resource Sharing policy”

I recently discovered icon fonts on the website of my ProfilePress WordPress plugin weren’t displaying. On viewing my browser console, i saw the following error notice logged.

Font from origin ‘http://d2hkd6cwxvu8h1.cloudfront.net’ has been blocked from loading by Cross-Origin Resource Sharing policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://profilepress.net’ is therefore not allowed access.

Apparently, the browser was blocking connection from profilepress.net to its cloudfront CDN because of the restriction of browser’s same origin policy whereby siteA cannot fetch content from siteB unless via Cross-Origin Resource Sharing (CORS) in which response from siteB include a Access-Control-Allow-Origin header granting permission to siteA.…

How to Make WordPress Admin Notices Actually Dismissible

WordPress 4.2 introduced a feature where admin notices can now be dismissed / removed from the admin page currently being viewed.

One caveat I discovered was, the dismissal do not persist across pages. That is, when you reload or navigate away from the current admin page to another, you will still see the notice.

I wrote a small library / plugin that elegantly solves this problem which i will be sharing to us.…