Overriding Wordpress mail function wp_mail()

Submitted by morf on Thu, 10/20/2011 - 9:13pm

In one of my previous projects i was instructed to override Wordpress function wp_mail() with custom API. I was surprised how easy it is in Wordpress. I was looking for simple solution in Wordpress, and i found it in file wp-includes/pluggable.php (where is function wp_mail() defined). Obviously Wordpress developers thinking a lot about usability for other developers, and they simply allow override the function by defining your own function before wp-includes/pluggable.php is included. So you can simply write your own plug-in overriding the function wm_mail().

Querying Google safe browsing API with PHP

Submitted by morf on Sat, 10/01/2011 - 5:50pm
php

Recently after some time i had opportunity to work on interesting project which included querying Google safe browsing API with PHP. It was simple and interesting project, so i would like to share my knowledge about it here.

Requirements:

  • Curl extension for PHP
  • Google account and safe browsing API key

php get_browser() without browsecap directive

Submitted by morf on Wed, 09/28/2011 - 10:42pm

I'm probably not the only one who tried to use php function get_browser() on shared hostings and ran into serious troubles, because the directive wasn't set. I tried first parse browscap.ini file with parse_ini_file() function, however the file format isn't compatible with this function.

Zend Framework Custom Dojo (Dijit) Helpers

Submitted by morf on Sat, 12/26/2009 - 12:00am

Implementing custom Dojo or Dijit into the Zend Framework View Helper is pretty simple. Lately i need this feature for Menu and MenuItem Dijits. I will provide you an example how to do it yourself for another Dijits. This example should work with other Dijits as well (i tried Dialog, DropDownButton, Menu, MenuBar, MenuItem, TitlePane, ToolBar, Tooltip Dialog, and Tree so far).

Magento Performance Enhancement

Submitted by morf on Wed, 12/09/2009 - 12:00am

Magento Commerce is very robust system which make me happy with its complexness, but on the other hand this robustness implied bad performance. There are few but reliable tips for Magento Performance Enhancements before you should upgrade your server. You can tune Apache web server, PHP engine configuration and modules, MySQL server configuration, and at last you have to setup Magneto to use this tunes.

How to install Magento Commerce

Submitted by morf on Fri, 11/27/2009 - 12:00am

This Post is step by step generic tutorial how to install Magento Commerce.

First of all you should setup your Environment, but if you are installing Magento first time you should check if you fit Magento Commerce System Requirements. In short you need: any os running Apache, PHP, and MySQL. Required PHP modules are: PDO_MySQL, Simplexml, mcrypt, hash, GD, DOM, iconv, SOAP (optional).

How to migrate Magento database

Submitted by morf on Sun, 09/27/2009 - 1:00am

If you have to migrate Magento database from one server to another, or from your local working station to server (etc.), you sure noticed that Magento store informations about base urls in database, so you have to change this data. To fix this you need migrate the database to new server, and then through PHPMyAdmin, or mysql console submit this commands to change new base url and base secure url.

How to import images into Magento Commerce

Submitted by morf on Sun, 09/27/2009 - 1:00am

If somebody told you, you can't import images to Magento, he was definitively liar. Magento Dataflow can import images, but the trick is you have to upload or copy images you want to import into [installation_directory]/media/import/* . Then export (System -> Profiles -> Export All Products -> Start profile) your products if you have any, download (copy) and edit the file. Now you can fill columns small_image, image, thumbnail with absolute path from media/import directory - for example /my_image.jpg (note the / on the start).

Pages

Subscribe to Front page feed