26 Mayıs 2012 Cumartesi

Wordpress Database Temizliği


Being a database-driven software, the performance of your WordPress blog is closely related to how efficient your database is. The bigger and messier your database is, the slower is the performance of your blog.

If you have not been doing regular housekeeping and database maintenance, either because you don’t know how to do or you are just plain lazy, here are 8 useful tricks that you can use to clean up your WordPress database easily and quickly.

1) Turn off/delete post revision

While the post revision is a good way to make sure that any changes to a post is documented, it can be a waste of database and server resources if you are the only user of the blog and does not collaborate with other authors for article writing.

To prevent the post revision from cluttering your database, it is best to turn it off once and for all.

You can easily turn off post-revision by adding the following line to the wp_config.php file

define(‘WP_POST_REVISIONS’, false);

If you want to keep the post revision for record purpose, you can limit the number of revisions saved per post. In your wp_config.php file, add the following line instead:

define(‘WP_POST_REVISIONS’, no_of_revision);

and replace the no_of_revision by the number of revision copy you want to keep.

Removing existing post revisions

Turning off the post revision feature only restrict WordPress not to keep any revision for future posts. It does not delete the existing post revisions in your database. To delete all instances of post revision and all its related entries), we will make use of the delete-revision plugin with some simple modification (the plugin only delete the post revision. It does not delete all other unused entries that are related to the post revision).

Download the plugin delete-revision to your desktop.

Extract the zip file. Open up the delete-revision folder and load the delete-revision.php file in a text editor. Scroll down to the line 140 where you see

$sql = “DELETE FROM $wpdb->posts WHERE post_type = ‘revision’”;

replace it with

$sql = “DELETE a,b,c FROM $wpdb->posts a LEFT JOIN $wpdb->term_relationships b ON (a.ID = b.object_id) LEFT JOIN $wpdb->postmeta c ON (a.ID = c.post_id) WHERE a.post_type = ‘revision’”;

(Code adapted from Lester Chan)

Save the file. Upload the whole delete-revision folder to your blog plugins folder.

Activate the plugin. Go to the Delete-Revision page under the Setting section. Run the application to scan your database for all instances of post revisions and delete them from your database.

If you are keeping copies of post revision in your database, you should run the Delete-Revision manager once every few months to clean up your database.

2) Delete unused images

Everytime you upload an image, WordPress automatically create duplicate copies of that image and resize them to thumbnail and medium size. Most of the time, these images are not used. In addition, there could also be some images that you have uploaded, but did not use them in the post. These unused images could easily add up to a massive size and cause unnecessarily burden to the server and database.

The DUI (Delete Unused Images) plugin scans your WordPress blog and find those images that are not used or referenced to by any of the posts/pages. It then proceeds to delete them from the database/server.

To use the plugin, you have use a FTP program to chmod the Uploads folder (the folder where images are stored) to 777. Once you have deleted the unused images, chmod the folder back to 755 again to prevent access from other people.

Similarly, you should run this plugin every few months to clear up your database.

3) Optimize database

As you add or remove entries into the database, pocket of spaces are created. These are useless space and could cause your database to swell quickly. You can easily free up these spaces by running a SQL optimize table query in myphpadmin.

If you are not technically inclined or find it troublesome to log into your myphpadmin, the best way is to use the plugin WP-DBManager to manage your database.

Install and activate the plugin. Under the Database -> Optimize Database options, select the table that you want to optimize and click the Optimize buttonto start the optimization. It should take less than a minute.

You can also schedule it to optimize the database every few days/weeks/months

Go to Database -> Database option. Scroll down till you see the Automatic Optimizing of DB. Set the frequency for it to auto-optimize your database.

4) Delete unwanted plugin

If you have decided that you have no use for a particular plugin, deactivated them and delete them from your server. The more (unused) plugins you keep in your server, the longer it takes for WordPress to generate the plugin list and the higher tendency that it will slow down the loading time of your blog.

5) Uninstall plugin completely

When you deactivated/uninstall a plugin, the options or the tables that the plugin created are not removed. As you install and uninstall a lot of plugin, there will be more and more orphaned options and tables that are taking up precious space in your database.

For plugins that have created table entries in the database, you can use the abovementioned WP-DBManager to drop the respective table from your database.

For those plugins that have created options, you have to use the Clean Option plugin to hunt down the orphaned options and delete them from the database.

6) Remove unused themes

Similarly, if you have plenty of unused themes in the server, delete those that you don’t use.

7) Check your site for deadlinks

While it is an usual practise to link to other posts/blogs/domains in your articles, you should check frequently that the linked post/domain still exist and you are not left with a dead link. It can be very frustrating for your reader to follow your link only to find that the destination page is no longer around. In addition, too many dead links can also affect your search engine ranking. I am sure this is not something that you want to see.

The broken link checker plugin checks your new article for broken links as soon as it is published. It also scans your old posts when you are logged into the Admin page. Any broken links found are reported to you and you can choose to edit or unlink them from the posts.

8) Delete spam comment

It is common to receive tons of spam comments, sometime as soon as you post the article. Even though these spam comments are not shown in your blog, they are still gathered in your database to educate “intelligent” anti-spam plugins. If you received plenty of spam every day (or every hour), this could be taking up a lot of valuable database space. To erase the spam, either go to the Comment -> Spam page, check all the spam comments and select Delete from the dropdown box.

Alternatively, you can use the WP-Optimize plugin to clean up all spam and unapprove comments

The WP-Optimize plugin also comes with other features such as delete revision, optimize database table and change your username. Personally I would prefer to use the WP-DBManager to optimize my database table as it allows me to schedule the optimization task on a regular basis. In addition, the WP-Optimize is only tested for WP2.7, so if you are still using a WP version less than 2.7, you have to use it at your own risk.

Wordpress Login Security


1. Google Authenticator

It is a plugin that uses the Google Authenticator mobile app to give a two-factor authentication login to your WordPress site.

Note: Make a point that before you activate Google Authenticator, you have enabled two-factor authentication in your Google account and installed the Google Authenticator app in your Android, iPhone or Blackberry phone.

When the installation and activation process of the plugin is finished, open ‘Users -> Your profile’ and then you will be able to see the Google Authenticator settings.

There you will see ‘Active’ and a checkbox by its side. Check the box. Then when you will login the next time, it will ask you to enter the confidential key. And if If you fail to enter the correct key, it will not let you login.

2. One Time Password

The name says it all. This is an amazing tool that provides high security to your WordPress site. One Time Password lets you login to your site without putting in your real password. It makes a list of passwords that can be used to login ti the site, but the great past is that those passwords can only be used one time, so even if someone gets to know this password, it will be of no use to him [one time password, remember?]. This toll is very useful is you travel alot and login to your site using a cybercafe.

When its installation and activation process is finished, go to the One Time Password section to create your password list. Then enter a passphrase and click the “Generate” button.

It depends on you if you want to get a print of all the passwords and carry them with you.

When you want to login, it will show you a sequence number and all you need to do is to match the sequence number with the password list and enter the password

When you need to login, it will show a sequence number. You just have to match the sequence number with your password list and enter the password accordingly.

3. WP Login Security

This amazing tool works through the IP address. It demands admins to register or whitelist their IP address. Now when the admin logins, it will its IP address. And if the IP doesn’t matches the one in the list, then it will send an email to the admin with a link that has a one-time key.

The plus point of this plugin is that very little or almost no configuration is needed. All you are required to do is to just activate it and Voila!

4. Login Lockdown

Login Lockdown is a very useful plugin that records the IP address and timestamp of every unsuccessful login attempt. If the failed attempts continue within a short period of time from the same IP range, and the number of maximum attempts is reached then the login function would be disabled for all login attempts from that range.

5. WP Firewall 2

This plugin has nothing to do with login field, but it secures your site by looking into web requests to detect any malicious attack. It has the ability to halt the attack before it harms to your database.

After it has been activated, its configuration options can be found under the Firewall section. The default options give good results and anyone rarely needs to make any alterations.

6 Mayıs 2012 Pazar

Siri Komutları

To save you having to navigate away from MacTalk I have copied and pasted them below

.
new linemove to the next line (like pressing “Return” on a keyboard)
new paragraphto start a new paragraph
all capsto make the next word all uppercaseFor example, saying:
I am hungry feed me all caps now please
produces the text:
I am hungry feed me NOW please
all caps on … all caps offto make part of what you say uppercaseFor example, saying:
I am hungry all caps on feed me now all caps off please
produces the text:
I am hungry FEED ME NOW please
no capsto make the next word lowercaseFor example, saying:
I like no caps Mike
produces the text:
I like mike
no caps on … no caps offto make sure part of what you say is all lowercaseFor example, saying:
Our friends no caps on Steve and Tina no caps off live in California
produces the text:
Our friends steve and tina live in California
space barto prevent a hyphen from appearing in a normally hyphenated wordFor example, saying:
This restaurant is first space bar class
prevents first-class from being hyphenated, and produces the text:
This restaurant is first class
period.
comma,
apostrophe‘(although in many cases, apostrophes are automatically inserted, like when saying Sam’s new iPhone)
exclamation point!
question mark?
ampersand&
asterisk*
open parenthesis(
close parenthesis)
open bracket[
close bracket]
open brace{
close brace}
dash-For example, saying:
This dash is dash my dash cheese
produces the text:
This – is – my – cheese
(note the difference in spacing between this and when saying hyphen)
hyphen-For example, saying:
This hyphen is hyphen my hyphen cheese
produces the text:
This-is-my-cheese
(note the difference in spacing between this and when saying dash)
em dash
percent sign%
copyright sign©
registered sign®
section sign§
dollar sign$
cent sign¢
degree sign°
caret^
at sign@
pound sterling sign£
pound sign#
greater than sign>
less than sign<
forward slash/
back slash\
vertical bar|
smiley (or smiley face, or smile face):-)
frowny (or frowny face, or frown face):-(
winky (or winky face, or wink face);-)



Calendars
Adding Events
  • Set up a meeting at 9
  • Set up a meeting with Michael at 9
  • Meet with Lisa at noon
  • Set up a meeting about hiring tomorrow at 9am
  • New appointment with Susan Park Friday at 3
  • Schedule a planning meeting at 8:30 today in the boardroom
Changing events
  • Move my 3pm meeting to 4:30
  • Reschedule my appointment with Dr. Manning to next Monday at 9am
  • Add Lisa to my meeting with Jason
  • Cancel the budget review meeting
Asking about events
  • What does the rest of my day look like?
  • What’s on my calendar for Friday?
  • When is my next appointment?
  • When am I meeting with Michael?
  • Where is my next meeting?
Alarms
Setting Alarms
  • Wake me up tomorrow at 7am
  • Set an alarm for 6:30am
  • Wake me up in 8 hours
  • Change my 6:30 alarm to 6:45
  • Turn off my 6:30 alarm
  • Delete my 7:30 alarm
Checking the Clock
  • What time is it?
  • What time is it in Berlin?
  • What is today’s date?
  • What’s the date this Saturday?
Using a Timer
  • Set the timer for ten minutes
  • Show the timer
  • Pause the timer
  • Resume
  • Reset the timer
  • Stop it
Email
Sending Messages
  • Email Lisa about the trip
  • Email Jennifer about the change in plans
  • New email to Susan Park
  • Mail Dad about the rent check
  • Email Dr. Manning and say I got the forms, thanks
  • Mail Lisa and Jason about the party and say I had a great time
Checking Messages
  • Check email
  • Any new email from Michael today?
  • Show new mail about the lease
  • Show the email from Lisa yesterday
Responding to Messages
  • Reply Dear Susan sorry about the late payment
  • Call him at work
Friends
Checking Up on Friends
  • Where’s Jason?
  • Where is my sister?
  • Is my wife at home?
  • Where are all my friends?
  • Who is here?
  • Who is near me?
Maps
Directions
  • How do I get home?
  • Show 1 Infinite Loop Cupertino California
  • Directions to my dad’s work
Local Businesses
  • Find coffee near me
  • Where is Starbucks?
  • Find some burger joints in Baltimore
  • Find a gas station within walking distance
  • Good Mexican restaurants around here
Messages
Sending Texts
  • Tell Susan I’ll be right there
  • Send a message to Jason Russell
  • Send a message to Lisa saying how about tomorrow
  • Tell Jennifer the show was great
  • Send a message to Susan on her mobile saying I’ll be late
  • Send a message to 408 555 1212
  • Text Jason and Lisa where are you?
Reading Texts
  • Read my new messages
  • Read it again
Replying to Texts
  • Reply that’s great news
  • Tell him I’ll be there in 10 minutes
  • Call her
Music
Playback
  • Play The Light of the Sun
  • Play Trouble
  • Play Taking Back Sunday shuffled
  • Play Alicia Keys
  • Play some blues
  • Play my party mix
  • Shuffle my roadtrip playlist
  • Play
  • Pause
  • Skip
Notes
Creating and finding notes
  • Note that I spent $12 on lunch
  • Note: check out that new Alicia Keys album
  • Find my restaurant note
  • Create a reading list note
  • Add Tom Sawyer to my reading list note
Phone
Phone calls
  • Call Jason
  • Call Jennifer Wright mobile
  • Call Susan on her work phone
  • Call 408 555 1212
  • Call home
  • FaceTime Lisa
Reminders
Requesting reminders
  • Remind me to call mom
  • Remind me to call my mom when I get home
  • Remember to take an umbrella
  • Remind me take my medicine at 6am tomorrow
  • Remind me to pick up flowers when I leave here
  • Remind me when I leave to call Jason
  • Remind me to finish the report by 6
Stocks
Checking Stocks
  • What’s Apple’s stock price?
  • What is Apple’s PE ratio?
  • What did Yahoo close at today?
  • How is the Nikkei doing?
  • How are the markets doing?
  • What is the Dow at?
Weather
Checking the Forecast
  • What’s the weather for today?
  • What’s the weather for tomorrow?
  • Will it rain in Cupertino this week?
  • Check next week’s forecast for Burlington
  • What’s the forecast for this evening?
  • How’s the weather in Tampa right now?
  • How hot will it be in Palm Springs this weekend?
  • What’s the high for Anchorage on Thursday?
  • What’s the temperature outside?
  • How windy is it out there?
  • When is sunrise in Paris?
Websearch
Looking up information
  • Search the web for Bora Bora
  • Search for vegetarian pasta recipes
  • Search the web for best cable plans
  • Google the war of 1812
  • Search Wikipedia for Abraham Lincoln
  • Search for news about the World Cup
  • Bing Alicia Keys
Using Wolfram Alpha
  • How many calories in a bagel?
  • What is an 18% tip on $86.74 for four people?
  • Who’s buried in Grant’s tomb?
  • How long do dogs live?
  • What is the Gossamer Condor?
  • What’s the square root of 128?
  • How many dollars is €45?
  • What was the Best Picture of 1983?
  • How many days until Christmas?
  • How far away is the Sun?
  • When is the next solar eclipse?
  • Show me the Orion constellation
  • What’s the population of Jamaica?
  • How high is Mt. Everest?
  • How deep is the Atlantic ocean?
  • What’s the price of gasoline in Chicago?..