Posts Tagged ‘wordpress’
WordPress StatPress plugin with empty table option
Written by Uthfull on September 21, 2008 – 4:32 pmI use the StatPress plugin on this blog installation to gather some basic and live statistics of the visitors to my blog. I also use the WassUp plugin to capture some similar statistics. While both plugins have their own pros and cons, there is one thing that used to bother me about the StatPress plugin.
While there is an option to delete the older records from the table after a certain time, there is no option to empty the entire table of the stats. Why is this option required? Well, certain people like me host their blogs on servers which give a limited amount of database storage. Statistics plugins like WassUp and StatPress tend to accumulate a large amount of data and thereby take up a lot of database space.
WassUp has an option to empty the table whereas StatPress misses this functionality. I had to manually go into phpMyAdmin and empty the table. So, I decided to look into the plugin and try to add this functionality within it so that I could save myself from the hassle of going to a another software to manage the mess. I am no coder. I read through the entire code in statpress.php and made modifications as required.
I present to you, StatPress with empty table option.
As the above screenshot clearly shows, when you click on StatPress tab within your WordPress Dashboard, you will see an extra option called “Empty”. Clicking on it will delete all your stats from within the database and makes StatPress start afresh. However, please note that this action is permanent unless you have a previous backup. Once you click on Empty, it will empty your database without any further prompts or warnings.
DOWNLOAD : StatPress v 1.2.9.2 with Empty table option (79KB).
Those of you not wanting to undergo the exercise of downloading a new ZIP file of a plugin, deactivating the original StatPress 1.2.9.2 and reactivating this plugin may simply copy the entire code from the text file linked below.
DOWNLOAD : statpress.txt
Open the statpress.txt file. Either save it as statpress.php and overwrite the wp-content/plugins/wp-statpress/statpress.php file. Otherwise, from within your WordPress Dashboard, click on Plugins. Navigate to StatPress and click on Edit. Replace the entire text in the textbox on the next page with the text from the statpress.txt file you just downloaded.
Please note that I am in no way responsible to any damage or loss whatsoever the use of this modified plugin may cause to your installation. I am Jack of all trades, master of none. I don’t claim the code and modification is perfect. It is just a basic implementation. Take all precautions before you activate this plugin.
Finally, the development of StatPress seems to have stalled. There is another plugin StatPress Reloaded. Check it out.
Tags: database, empty, hack, mysql, plugin, statpress, table, wordpress
Posted in Technology | 1 Comment »
Migrate/move your WordPress blog to a new domain/server
Written by Uthfull on May 26, 2008 – 1:37 amWell since I just finished migrating this blog over to this new domain, I thought I’d just describe how I actually did it. Firstly, login to your existing blog, Goto Settings, Permalinks and activate the default permalink structure. I recommend doing this because I’ve been locked out a dozen times while updating my blog because of a misplaced .htaccess file. If that happens, whenever you try and login to the WordPress dashboard, it fails. Save your custom permalink structure, if any, for use later. Goto Plugins and de-activate all your plugins. Open up the Akismet page and delete all SPAM that you have in queue (to keep out the junk from getting imported to the new server). The next step is to disallow all robots from your new server. For this, create a file robots.txt with the following content :
User-agent: *
Disallow: /
Now, since I changed servers also, I copied over all my WordPress files from my old server to the new location i.e., from www.uthfull.org/blog to rahulsarin.com. This must include all the content that you might have uploaded, your plugins & themes, the .htaccess and the wp-config.php file.
Use whatever database administration tool you like (I used PhpMyAdmin) and export your database in the form of SQL queries (.SQL) and save it to your PC. Now, use a text editor, such as Notepad++ to open the databse and find all instances of your old domain name and replace it with the new domain. For example, what I did was :
Find : http://www.uthfull.org/blog Replace with : http://www.rahulsarin.com
Find : http://uthfull.org/blog Replace with : http://www.rahulsarin.com
Find : http://blog.uthfull.org Replace with : http://www.rahulsarin.com
Now you might ask why one shouldn’t just change the blog URL in the WordPress admin panel. Well, changing there changes your blog URL but it will not fix the links within your posts, the links on your comments, the link in your user profile and trackbacks & pingbacks (remember, if you link a post on your blog within another post, it sends the post a pingback). You can either go over each change one-by-one or just press the Replace-all button like I did!
Save the edited database file. Now, head over to your new server and create a new empty database. Create a new user and grant it all priviledges to operate upon the database. Now, simply use the import feature to import the database you just edited into the empty database. Wait patiently for it to complete the import.
Once you’ve setup your database, its time to head into your WordPress directory and edit the wp-config.php file. Change the database name to the database you have just created. Change the username and password to that of the new user you have created.
Fire up your browser and type in your new blog address. Hit enter. If you did everything right, then your blog will appear as it normally would on your previous domain. Open up the WordPress dashboard. Re-activate the plugins you had disabled in the first step. If you have any problems with any of the plugins, I recommend deleting all the plugins and simply installing them all over again. I ran into a few errors and they were sorted out this way. Now, head over to Settings, Permalinks and change the permalink structure to your custom structure, if any. Enable your themes, check your blog settings once again and make sure you give your blog a thorough run.
Remove the robots.txt file that you had created to let the spiders come rolling in!!
The final step is to head over to your previous domain. Open up the .htaccess file and type in the following :
Redirect 301 /blog/ http://www.rahulsarin.com/
Change the above according to your own domains. This will help set up a permanent redirect which will point your readers and the search engines automatically to the new domain. It will even work for all pages and posts. So, no readers lost and you get to keep that SEO juice!!
That’s it! Your blog should be up and running on the new domain with all the hits from your previous domain being automatically redirected to the new address. Hope this article helps. I got help from these websites :
Tags: migrate, move, procedure, tip, trick, tutorial, wordpress
Posted in Technology | 1 Comment »
Domain change
Written by Uthfull on May 26, 2008 – 12:34 amThis is gonna be short and sweet. It was long overdue… I’ve migrated this blog over from http://www.uthfull.org/blog to http://www.rahulsarin.com.
So, if you notice any bugs, such as broken links, errors etc., kindly gimme a buzz and let me know.
Tags: domain, migrate, wordpress
Posted in Journal | No Comments »
Fighting Spam
Written by Uthfull on May 7, 2006 – 8:02 pmThe spam bots have waged a war on my poor blog.
Everyday, at least 50 comments are held for moderation and all of them advertise viagra or similar drugs.
So now I’m using three tools to protect my blog
I had installed Spam Karma 2 also but it didn’t let any comment through.
50 useless comments is still small but I don’t wanna take chances.
The Melting Pot faced it first attack from a spam bot. So, even it has all the three plugins installed.
Out of them, I find Did You Pass Math? to be the coolest. It asks the commentor to give the answer to a simple math addition problem before they can post. Sorta like captcha.
Tags: wordpress
Posted in Internet, Technology | No Comments »
I Like Wordpress!!
Written by Uthfull on January 25, 2006 – 3:24 pmWell its been a breeze installing and configuring this software (wordpress)
Its just too good. The themes are nice, the plugins are available!!
Best of all, its free!!
If you wanna host your blog… go register on some free blogging sites which offer Wordpress like blogsome.com.
I’m falling in love with blog stuff!!
Tags: wordpress
Posted in Misc | No Comments »
