Posted in: php,seo | April 8, 2013 | ( 1 ) Comment
Piwik is a Open source web analytics application that has a huge number of valuable functions related to SEO and other analytics stuff built-in. One such module is RankChecker. This module provides page rank information for Google, Dmoz and Alexa. With some modification to the original RankChecker.php we can use it in our own application (with appropriate license). The following is a example code for the same using RankChecker.
Read More
Posted in: interface,php,security | April 6, 2013 | ( 4 ) Comments
Image plagiarism is one of the common issues faced by websites, specially by designers and photographers. Besides the technique of attaching a copyright text or a hidden watermark, the other most common method of preventing casual copying of images from websites is by disabling right-click using JavaScript. Another scheme I recently found uses a method wherein the image is split into three parts and then displayed on the page. So whenever the user tries to save the image he gets three different parts of the image rather than a single image. This prevents casual copying of images from web pages. Of course, this is not a fool-proof method, and with some workaround one is able to create the original image but with some extra effort. This method can also be useful to prevent automated bots from easily downloading your images.
Read More
Posted in: wordpress | February 21, 2013 | ( 1 ) Comment
WordPress upgrades is a task most users do on a frequent basis,and most of the time it works flawlessly. But once in a while something goes wrong and WordPress doesn’t behave the way we expect. The most common complaint I see is the following error being thrown during wp-admin login after a WordPress database upgrade.
“You do not have sufficient permissions to access this page”
This innocuous message however is the source of many a wasted hours. Although there could be many reasons for the above message, the one I most often see cited is the inconsistency between WordPress prefix for the following values:
Read More
Posted in: database,mysql | February 21, 2013 | ( 6 ) Comments
As with many other databases, MySQL provide a BLOB type that allows you to store binary data – images, wav files, videos etc. A frequent question developers have is regarding to storing images in the database. There is much discussion and argument with no final say on the issue. In one of my recent project the same issue was raised; the client and myself discussing the benefits and drawback of storing the images into a database. The project needed storing around 50,000 images, so it was important to get the question resolved satisfactorily.
After much deliberation we settled on using the file system. The major factor in the decision was that we needed the database and images decoupled as we would be having multiple databases using the same set of images. Also in the future it was possible that we would require some processing done on the images (cropping, resizing), which would be tedious and taxing if the images where stored in the database. So in light of these factors we found using a filesystem a suitable solution.
Read More
Posted in: mysql | February 11, 2013 |
One frequently needs to export some MySQL tables along with certain queries that will work with that table for testing. Usually one only needs a subset of records from the table which will work with the selected queries, rather then the complete table. This can be required when the table contains thousands or millions of records and we do not want to export the complete data set, as this can be time consuming during import, or maybe we only want to provide the other user with some selected records for security reasons.
Say we have a simple WordPress database with a SELECT statement like the following:
SELECT * FROM wp_posts WHERE post_status = 'draft' |
If you want to only export records that will match the corresponding query above, then we can use the ‘mysqldump’ command-line utility with the ‘–where’ option.
Read More
Posted in: mysql | January 29, 2013 | ( 4 ) Comments
The first SQL query most people learn is the SELECT statement with a query some thing like the following.
SELECT * FROM users WHERE id > 100 |
Nothing wrong with the syntax itself; but more often than not, what the user really wants is just a few columns from the table as shown in the PHP code below. Here we are only using three columns from the table. The usual practice of developers is to use the * modifier to get all the columns from the table as it is easier then specifying individual column names. It is quicker to select all columns from a table and worry later which to actually use in the code.
Read More