Simple OpenCart API

I was once tasked to create, cutomize and manage an online shop using opencart. The company later decided that they want to create a blog site(wordpress) to promote their online shop and they wanted to have links on that blog site to the opencart online shop.

though this could be achieved creating the links to the opencart category pages and/or latest products manually, it is just too much work and ineffective.

I tried searching for an off-the-shelf code that I could use, most of them uses techniques I do not agree to be the better way of approaching this scenario(and I am way to lazy to search and test other samples). so I ended up creating my own OpenCart Extension to serve cart data to wordpress and a corresponding wordpress plugin to work with it.
Continue reading

Custom Post Type’s Single Page Template on your plugin folder

There are several uses of Custom Post types(CPT) in wordpress, thus there are discussions around whether to put the cpt on a theme or have it as a plugin. basically, if your CPT is specific for that theme then it should very well be in the theme files. e.g. CPT for sliders. but if your CPT is intended to be used on purposes other than the theme then that should be as a plugin. e.g. if you have a CPT for businesses that would be used by the site no matter what the site is using as a theme then clearly that should be as a plugin. Continue reading

PHP Malware scanner

A couple of months back, one of the sites I was working on had a malware code in it. At first, we noticed there was something wrong with the site cause when I click the site’s link from a google page we are being directed to another website. This was evident on our statistics monitoring as our visits from google searches significantly went down.
Continue reading

MySQL Commands

In most cases, using the phpmyadmin to create and manipulate your MySQL database is more than sufficient. It is also inevitable that you would need to use the Command Line Interface(CLI) of MySQL for some of the tasks that you need to do. One thing that crosses my mind right away is importing large SQL File into the database. PhpMyadmin has a limit that corresponds to the php settings that you have. You could modify your php settings to cater for the import but I think it would be better of to learn the basic MySQL Commands and import your large database than changing your php settings.
Continue reading