Monday, April 21, 2014

Wordpress "Stable Tag" not updating

PROBLEM:

Was updating one of my Wordpress plugin, and find it weird that the Wordpress Plugin Directory does not reflect the changes correctly although I've changed the "Stable tag" in readme.txt.

According to Wordpress Plugin "Task 3: "Tagging" a new version" guide, you'll need to edit the trunk/readme.txt beforehand.

SOLUTION:

That is not enough!

In the end, I found out that you will need to update BOTH:

  1. trunk/readme.txt
  2. trunk/{your-plugin-name}.php



Hope this helps!

Thursday, January 16, 2014

Facebook Sharer.php "The message could not be posted to this Wall." Error

UPDATE: As of 2014-01-16 10:17 (GMT+8), this issue has been fixed. View the bug report.



Facebook Sharer Error.

Got this error message after updating Wordpress plugin for one of the site that I help maintain.




Debugging



When inspecting the network tab for the ajax request, I saw this error description in the response.
for (;;);{"__ar":1,"error":1367001,"errorSummary":"Could not post to Wall","errorDescription":"The message could not be posted to this Wall.","payload":null,"bootloadable":{},"ixData":[]}
After searching in Google, most people suggest that error 1367001 is due to incomplete URL format. But for my case, the URL is in complete form.

So I did a comparison with the sharer on Techcrunch page.


I noticed the difference is mainly on the attachment section.
attachment[params][images][0]


Conclusion


Its Facebook sharer permission issue. Seems like Facebook sharer will include og:image tags images as attachment when you have multiple og:image meta tags, and there seems to be permission issue with posting the attachment to user's wall.

This only happen recently. So until Facebook fixes this... nothing much we can do other than limit to only 1 og:image tag on our sites.





Solution


Limit to just 1 of og:image.  Simple solution that works.



You can try with these sample:

1 image:
https://www.facebook.com/sharer/sharer.php?u=http://vulcanpost.com/statics/html/2014/facebook-sharer-with-1-image.html

3 image:
https://www.facebook.com/sharer/sharer.php?u=http://vulcanpost.com/statics/html/2014/facebook-sharer-with-3-images.html



Solution (For Facebook Wordpress Plugins)



  1. Open /wp-content/plugins/facebook/open-graph-protocol.php,
  2. Find "get_og_images" function and add in the following code

if (count( $og_images ) === 1) {
return $og_images; // Force only 1 image.
}

Your function should be like this:







References:
http://stackoverflow.com/questions/3944268/facebook-sharer-php-how-to-have-multiple-ogimage-tags

Tuesday, January 7, 2014

Facebook hellocdn.html?v=1 browser popup. Not a virus.

tl;dr Not a virus. Its popup from Facebook Messenger application to ping the CDN.

-----

I noticed that from time to time, especially when my left comp is idle overnight, I'll have these blank pages opened in my browser window the next day.

https://fbcdn-creative-a.akamaihd.net/hads-ak-prn1/hellocdn.html?v=1

My first thought was like... gosh, is there's malware on my comp? Then I started to inspect my comp.

First Question. Is the CDN address valid?

Did a search on the list of CDN addresses and found this stackoverflow page. Seems like its "fbcdn-creative-a.akamaihd.net" is one of the Facebook CDN. Furthermore, akamaihd.net is a reliable CDN provider.

Next Question. If the CDN address is valid, could it be that Facebook CDN got compromised?

So I inspect the page elements, and resources (js files).


Seems like pretty OK, the URL that the script call is actually defined in the "result_endpoint " variable.
// hardcode the return url var result_endpoint = "https://www.facebook.com/hellocdn/results";

More Google Searches

According to nerdanswer and reddit, seems like there are others who faced this issue as well. As few of them confirmed that its caused by Facebook Messenger application.

I've also found a couple of suspicious post that tells visitors that this is caused by virus, and suggest them to install some other "antivirus" to remove the "virus".
Well, you shouldn't trust any antivirus other than Microsoft Security Essentials (MSE). Any maybe AVG, and Norton. But I would recommend MSE, for various reasons.


Conclusion

So all good!

Hope this helps!


Wednesday, January 1, 2014

2014 Fireworks around the World

Singapore Fireworks. Image source: highdefinitionwallpapers1080p.


Compiled a list of the 2014 New Year Fireworks videos around the world.


1. Japan




2. Dubai




3. Australia




4. Brazil




5. UK




6. Paris (July 14th fireworks)




7. Singapore




8. Taipei




9. Hong Kong




10. Malaysia




11. Korea






Leave a comment if you know videos for countries that is not listed above. Or a better quality video to replace any of the videos above.



Updates:

20140101 - Replaced Singapore video. The original video was 2013 video. Thanks for Dann Khoo for pointing out.
20140103 - There's no fireworks for on new year. The video was July 14th National Day fireworks. Thanks Floris for pointing out.




Bonus:
Source: Facebook.

Saturday, December 28, 2013

Convert Font Suitcase to TTF

TLDR; Use Fondu to convert fonts to .ttf


Sometimes clients send me fonts in Font Suitcase format, and  I'm suppose to include the fonts in their websites.

To convert the fonts to TTF, I use Fondu.
A set of programs to interconvert between mac font formats and pfb, ttf, otf and bdf files on unix. Fondu will read a series of mac files, check their resource forks and extract all font related items into seperate files.

Install Fondu (OSX)
  1. Download Fondu
  2. Open terminal
  3. Change directory to the dir that you extracted fondu in
  4. terminal: ./configure
  5. terminal: make
  6. terminal: sudo make install

Convert Fonts to TTF
  1. Change directory to the dir where your font is.
  2. terminal: fondu <font filename> 
    e.g. fondu Futura.dfont
  3. Done.

Convert to Webfonts
  1. Upload the converted .ttf file to http://convertfonts.com/






Related:
http://apple.stackexchange.com/questions/8455/how-do-i-convert-a-suitcase-font