WordPress1900x1068

How to enable WordPress Debug Mode in 60 seconds

If you are a WordPress developer or if you just installed a misbehaving plugin you will need to enable WordPress’s debug mode in order to figure out what made your site get into the dreaded blank white page (unlike Windows WordPress has a White-Screen-Of-Death). So here’s the quick step-by-step guide to get you going:

Step by Step

  1. Connect via FTP to your site (use FileZilla which is free, if you don’t have an FTP client already installed) or just open your text editor if you are running local.  (15 seconds)
  2. Browse to WordPress home directory, and open wp-config.php for editing. (10 seconds)
  3. Hit Ctrl-Endor scroll to the bottom of the document, locate the line that says define(‘WP_DEBUG’, false);  - you can find it a few lines before the end of the file. (15 seconds)
  4. Change false to true and Save. (15 seconds)
  5. Refresh the page and you should be able to see the errors.  (5 seconds)

 

Total: 60 seconds.

 

Its recommended you don’t run this option on a live production site but if you really must, make sure you turn if back off when you are done. Alternatively you can enable the debug log to be sent to a file instead of the browser by also adding the following line in your config file:

define(‘WP_DEBUG_LOG’, true);

This will cause the error messages to be saved in a file called debug.log in the wp-content sub-folder of your installation. Again make sure this file is protected because by default anyone from the web can access it in the particular folder.

 

And if my instructions are not detailed enough you can look at the long version on the WordPress codex.

Read More

PDF Product Catalog for WooCommerce Plugin

WooCommerce PDF Product Catalog Plugin v1.0.8

Has only been one and a half months since I published the PDF Catalog for WooCommerce plugin on CodeCanyon and since then I released 5 versions. Most feature additions came after requests from users who purchased the plugin.

The latest release 1.0.8 which went online this week and includes:

  • Support for high-res JPEG image embedding (the site’s admin can choose the resolution of images used based on a predefined list). Also added a slider to choose the JPEG compression quality coefficient.
  • User role restrictions – a highly requested feature which allows the admin to choose which WordPress User Roles have access to download the store catalog.
  • Enabled PDF Subsetting in TCPDF. The admin can still pick to disable it. Essentially this only embeds the required ligatures from the font in the PDF file. For UTF8 encoded catalogs cuts down the file size by about 300k depending on language and amount of text.
  • Ability to Hide ‘HIDDEN’ products. As weird as this might sound some users wanted to be able to see products in PDF for which they set their visibility to Hidden in the Product editor.

The plugin can still be downloaded from here.

Read More

Typescript

Typescript compiler got a re-write and is now 5 times faster

According to Typescript’s blog on MSDN, they’ve rewritten its compiler from scratch and surprisingly also moved the compiler’s repository to GitHub. The new version which from a feature point of view identical to the previous version, generates Javascript code 5 times faster. For those who don’t know what Typescript is, its an attempt by Microsoft to make Javascript better, especially for large scale projects. Technically you can write pure Javascript and the compiler will just let is pass through but it will enforce variable types and declarations. So if you are already familiar with Javascript, it just ads a safety net layer for data types and some utility syntax for writing human-readable object oriented Javascript.

I still haven’t tested the new version but I can assure you the original one is noticeably slow. Running the compiler automatically through PHPStorm I found myself many times saving the .ts file then switching to the browser to test only to realize that compilation is still not done and had to switch back to confirm its done before re-refreshing the page. Hopefully this is now a thing of the past.

The announcement can be found here.

Read More

Screenshot_1

Recent Good CSS / Javascript Videos (July 2014)

More JSConf 2014 US edition were posted online a few hours ago. I didn’t have the time to watch them all yet but I’ll keep this post updated as I watch them.

 

Mark DiMarco: User Interface Algorithms

 

A very good talk about two algorithms and how they can be used in Web UI (he also makes some pretty funny Game of Thrones jokes). The talk focuses on two cases, one is how to increase the hit-state of elements on the page using Voronoi (quite complicated algorithm, but thankfully its already implemented in Javascript in D3, find out about it here). The other case is about menus with sub-menus, explains how to solve the problem we all faced in the past, having to move the mouse precisely horizontally on the popup sub-menu in order for the sub-menu to remain open. The solution is not that complicated and according to the video is used by Amazon’s mega menu. You can find a good explanation by Ben Kamens here.

Angelina Fabbro: CSS In Your Pocket – Mobile CSS Tips From The Trenches

 

Skip the first 4-5 (mostly introductory) minutes to get to the juicy stuff. Some good points about mobile web performance and compatibility are raised but the most interesting parts are about the cutting edge updates in Firefox DevTools including the CSS Coverage Report (which works for multiple pages showing you what entries in your stylesheets are unused). There is more information about it on https://developer.mozilla.org/en-US/docs/Tools/CSS_Coverage”>MDN here. Currently only works on Nightly builds of Firefox but hopefully will make it to Aurora soon (the channel I use).

 

G C Marty: Play DVDs in JavaScript for the sake of interoperability

 

G C Marty explains his quest to play his huge collection of DVDs on his mobile phone directly in the browser. His aim was to replicate the full DVD experience including menus, chapters, multiple angles, audio tracks and subtitles. He tried several methods, including using a proxy server to decode the video in real time and send it to the mobile browser via WebRTC which failed with sync issues and high hardware requirements and pre-converting DVDs into WebM using a Raspberry Pi running nginx to do the streaming. He released his project in open source on github.

Read More

VuTalk Uninstall on LG G2

If suddenly your LG G2 phone started un-installing VuTalk don’t panic its not malware. LG decided to discontinue the VuTalk app and with it made sure that no one uses it anymore by automatically removing it from every phone that had it installed. The app that your phone downloaded automatically was used to delete all data that was kept on the phone by VuTalk and then removed itself.

The reasons they did that remain unknown, probably not a lot of users were using it and it turns out it wasn’t worth their trouble updating it. Unfortunately they didn’t warn users or given them the option to keep the app even if no longer supported. So if you were a fan of sending drawings to your contacts, LG just said ‘Tough Luck’ to you. If you know the exact reason, please post a comment to enlighten us too!

Read More

cloud storage

In search for the best Cloud Storage

The past couple of months I started receiving warnings from Dropbox that my ‘gift’ 50GB space that came with the purchase of a Samsung Galaxy S3 2 years ago is coming to an end. I am left with around 20 days so I started looking at the alternatives because Dropbox is pricey. I already have accounts with Google Drive and Microsoft’s OneDrive and I also checked out Box at some point but never really used it. For Google Drive I have an 80GB plan which I signed up for years ago when Picasa Web Albums was still alive (it still is but I have the impression Google will pull the plug soon).

Just today OneDrive announced some big price reductions making it more competitive to Google Drive.
Here’s a table of the current pricing of the storage providers I am considering:

Annual cost for 100GB

Dropbox GoogleDrive Box OneDrive
$99.00 $23.88 $120.00 $23.88

Since Box is more expensive while not offering anything better than Dropbox I am no longer be considering it. Since I am currently using Dropbox I won’t need to do anything other than just buy more space. A great feature of Dropbox which I would miss if I was to move to DropBox is its automatic photo uploads for mobile devices. Any photos taken on mobile are automatically saved on my Dropbox and then automatically downloaded to my PC, keeping them both safe and available without having to do any manual transfers. Google Drive has a similar feature but with a catch; instead of saving photos to Drive it sends them to Google+ which means you don’t have direct file access to photo folders. If you want to download them you have to browse your Google+ profile and download them one by one, a very painful process. There is a third-party Android app which does automatic photo upload to Google Drive but I haven’t tested it yet – the fact that I will need to run another app in the background which could drain more battery worries me. OneDrive is supposed to have an automatic photo upload feature more in the lines of Dropbox than Google but I haven’t tested its Android app yet. It comes built-in Windows 8.1 and all Save Dialog default to OneDrive which is convenient for a Windows user like myself. Microsoft was  wise enough to release apps for all platforms so Android is covered. Another great feature of OneDrive is that unlike Dropbox, files stored in the cloud do not necessarily require to have a local copy. The OneDrive app ties in with Windows and creates place=holder files for large files and only downloads them when they need to be opened. This is especially useful for users on SSD drives which tend to have limited capacity.

Until today I was leaning towards GoogleDrive but I am reconsidering and might give OneDrive a go. I’ll install OneDrive app for Android and see how it goes. In the meantime I believe prices will continue to fall because of competition between Google and Microsoft.

Read More

PDF Product Catalog for WooCommerce Plugin

PDF Product Catalog for WooCommerce – my new plugin

The idea for this plugin came to me after a request from a client for whom I developed a WordPress / WooCommerce based online store. The client wanted to have downloadable price lists in PDF format for each product category. His original plan was to generate the PDFs manually offline and upload them to the site but obviously there was a better way. So after doing some research and tests on some PHP classes for generating PDF files I made a polished WordPress plugin and published to CodeCanyon.

At the time of writing it has the following features:

  • Widget for PDF Download Buttons
  • 5 PDF Catalog Templates included.
  • Create your own PDF templates in HTML.
  • Generate per Category PDF and/or Complete Store catalog.
  • 4 pages of admin options to fine tune your catalog content and design.
  • Tested with stores with more than 1000 products.
  • Pure PHP Solution (no need to install any plugins / does not use external services).
  • Hide / Show catalog elements (e.g. SKU, descriptions, prices).
  • Upload your own logo.
  • Support for UTF8 catalogs (non-latin characters in PDF)
  • Customize catalog text.
  • Include product images in catalog.
  • Support for product variations.
  • Customize colors from Admin Panel.
  • Hyperlinks in PDF for each product
  • Caching for increased performance (catalogs are only generated once)
  • Automatic page numbering.
  • Header / Footer on each page.
  • Send PDF to browser or force download option.
  • Customise which categories appear in catalogs.
  • Full Documentation included.
  • Tested with WordPress 3.8, 3.8, 3.9 and WooCommerce 2.1.x

Thanks to comments I received on CodeCanyon I got ideas for other features, especially integration with other WooCommerce plugins which hopefully I’ll manage to implement soon.

The plugin can be purchased here for 15USD.

Read More

OCR in browser

Optical Character Recognition (OCR) in Javascript in your browser

Like everything else becoming available in the browser, now there’s OCR for Javascript. The demo which you can try our here captures documents from the user’s webcam, then applies image processing to convert the image to machine readable black and white bitmap and then uses the Javascript implementation of Orcad (an GNU licensed open source OCR program), called Orcad.js to convert the processed image into text.

Even though I called it implementation before, Orcad.js was created using Emscripten, a trans-compiler which turns C or C++ code into web browser compatible Javascript (not the most accurate description of the process but that’s the general idea). Looks like an awesome tool, which I hope to have the time to play with some day. You can check it out here.

If you missed the link, demo here. Read/download Orcad.js here. The image processing is applied using glfx.js which used WebGL to accelerate image processing on the client.

There’s also a video demonstration:

Read More

Apache-Error-Log-Contents

Unix-like Tail function in Windows without installing new software

Windows Powershell has a powerful command that lets you view the last lines of a text file or even monitor it for new lines, similar to tail -f command in Linux. Here’s some examples:

 

The following will view the last 10 lines of Apache’s log file:

PS c:\apache\logs> gc access.log -last 10

The following will view the whole apache log file and when done, will continue waiting for new entries:

PS c:\apache\logs> gc access.log -wait

Of course the previous example is not very useful if your log file is already large, so you can combine the two commands and skip to the last lines like this:

PS c:\apache\logs> gc access.log -wait -last 10

Until I discovered the above command I used Tail Win32 to monitor log files, so this makes life easier.

Read More

Javascript x86 Emulator

x86 Emulator in your Browser

For me, this one-man project is like magic. A fully-blown x86 emulator which runs a real-world BIOS (SeaBIOS). This means it can run regular x86 16bit OS’s as long as the browser allows it enough resources. It goes a long way to show what’s possible in the browser these days (well to be honest, this could have been done 3-4 years ago if Javascript was taken as seriously as it is today). It obviously runs slower than native performance but it is quite usable, especially with command line interface. There is no real practical use at the moment but maybe with further development something similar can be used to emulate x86 on ARM based devices in the future.

Take a look for yourself at http://copy.sh/v24/. There’s 4 OS images you can load directly from the page, including FreeBSD, Linux, FreeDOS and KolibriOS which is GUI based. You can also load your own ISO images to boot in the emulator. KolibriOS works fine so does FreeDOS, which even has some playable DOS games like Tetris and Snake which brought back memories of my MS-DOS days.

For experimental purposes only I also downloaded a Windows 3.1 ISO CD image off piratebay and tried to run it but it didn’t really work (I think the problem was with the image not being properly bootable rather than the emulator – after all Windows prior XP was first booting MS-DOS and then running Windows). I also attempted to load TinyCore Linux but I didn’t get far with that one either. TinyCore’s ISO is just under 15MB with GUI included. It took around 10 minutes to boot on an i7 laptop but never made it into the GUI.

Anyway if you don’t have the time to fiddle around you can view the following 5 min video I made running the emulator in Chrome:

Read More