Thursday, 31 October 2013

Stop WordPress From Compressing JPEG Images

According to some blogs, WordPress automatically compress your JPEG images to 90% quality, but this information is false.

This only happens on the resized images WordPress creates. The original uploaded image is saved unaltered, as the "full" size.

Anyways, you can stop compressing of JPEG images by putting following code into your functions.php file:

add_filter('jpeg_quality', function($arg){return 100;});
add_filter( 'wp_editor_set_quality', function($arg){return 100;} );

Google: How Fast Is Our Hummingbird


15 years have past since Google Search first appeared on the stage. Back in 1998 the searching process was far from perfection:  the huge machine called computer is on, the user type in keywords into the search system and the system manages to find several websites with the required information. Now it sounds funny, but at that time it was a miracle!

The whole process and the devices have changed since 1998. It is so easy to find billions of websites with one click on a tiny device in your pocket. Search systems are powerful, quick and very convenient. You can even ask the question in a loud voice and your inquiry will be satisfied. What else can be done here? Are there possible improvements? Google proves that there is always space for making changes and striving for better result.

New search algorithm from Google has got a beautiful name of a small but smart bird – the Hummingbird. It was presented on the press-conference dedicated to the 15th anniversary of Google.   The name for the new offspring was chosen in order to emphasize the accuracy and high speed of its work. The company said that changes in the search engine had been made a month ago and covered 90% of search queries, but the notification on the transition to the new search algorithm Hummingbird was decided to give on the 15th anniversary of Google. The press conference took place in the garage, where 15 years ago Sergey Brin and Larry Page had started a glorious history of  the search giant.

Amit Singhal, the head of Google's core ranking team, says that the current updated search algorithm is perhaps the most radical since 2001, the year he began to work in the company. Last major update search engine Caffeine was aimed primarily at increasing the speed of information indexing rather than the processing of the collected information. Hummingbird handles requests not only for keywords, but also according to their meaning. Thanks to this function, the inquiries made by users can be longer and more complex.

As the nature of inquiries has changed recently, the need to improve search algorithm appears. Earlier search inquiries were made in the form of short phrases with a large number of keywords. Today a user can make up search inquiries with the help of colloquial phrases, sometimes quite long and complex. The second reason, which made ​​it necessary to use a new search algorithm is the development of voice search. The time offers new standards, gadgets and approaches for search systems, that is why now is the right time for changes.

Tamar Yehoshua, vice president of the research department, demonstrated the abilities of new search algorithm to understand the associated inquiries. She offers Google to open photos of the Eiffel Tower, and immediately afterwards, without specifying what exactly she is talking about, asks questions: "What is its height?", "When was it built?", "Show me the photos of the building process". Next she presented the way voice search Google works offering to find information about the Impressionist painters.

Unfortunately, there is no way to compare the results of search system efficiency "before" and "after" the introduction of the new search algorithm. However, Google gives a few examples. For instance, request «acid reflux prescription» (acid reflux recipe) used to offer a list of medications that may be useless for users who sought for general information on the treatment and general information about the necessity to take medicine. The new algorithm offers the article containing this exact information.

Is it possible that the new search algorithm from Google made the search system worse? Hummingbird creators are sure that is unlikely, saying that they can’t approve that search system is better now, still, there are no evidences of dissatisfaction on the part of users. As everybody knows, people complain when they notice errors but they rarely see improvements.

Time will show how fast and smart Hummingbird is. A month after its start new algorithm justifies our hopes.

Author Author - Melisa Marzett is an experienced writer, she mainly works on such topics as internet innovations, web press and social media. Her articles are also available on best college paper writing service. It is easy to contact with Melisa on Google+
Join Us On:

Tuesday, 29 October 2013

Remove Author Prefix From Slug In WordPress


Earlier this month I shared an article about changing WordPress Author URL Slug. That code will change the default yoursite.com/author/name to yoursite.com/profile/name.

Now this trick will remove the author prefix from the author slug. To clarify, this snippet will help you turn: yoursite.com/author/name/ into: yoursite.com/name/.

Just add following snippet to your functions.php file:

// The first part //
add_filter('author_rewrite_rules', 'no_author_base_rewrite_rules');
function no_author_base_rewrite_rules($author_rewrite) {
    global $wpdb;
    $author_rewrite = array();
    $authors = $wpdb->get_results("SELECT user_nicename AS nicename from $wpdb->users");   
    foreach($authors as $author) {
        $author_rewrite["({$author->nicename})/page/?([0-9]+)/?$"] = 'index.php?author_name=$matches[1]&paged=$matches[2]';
        $author_rewrite["({$author->nicename})/?$"] = 'index.php?author_name=$matches[1]';
    }  
    return $author_rewrite;
}

// The second part //
add_filter('author_link', 'no_author_base', 1000, 2);
function no_author_base($link, $author_id) {
    $link_base = trailingslashit(get_option('home'));
    $link = preg_replace("|^{$link_base}author/|", '', $link);
    return $link_base . $link;
}

Props to WP-Snippet for this amazing tricks.

Detect And Redirect Android Users With .htaccess

Last night I shared a trick to redirect Android users to your Android/mobile website with a simple PHP snippet. It's time to do the same with .htaccess file. Android is the most used smart phone platform right now, and is a hot topic for developers.

Add this following code to your .htaccess file to redirect users with Android User Agent to a specific address:

RewriteCond %{HTTP_USER_AGENT} ^.*Android.*$
RewriteRule ^(.*)$ http://android.yourwebsite.com [R=301]

Monday, 28 October 2013

Detect And Redirect Android Users With PHP

Here is a simple trick to redirect Android users with some simple PHP script. It's a useful snippet if you have an Android version of your website.

Add following PHP to your document to search and redirect Android user agents:

$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
if(stripos($ua,'android') !== false) { // && stripos($ua,'mobile') !== false) {
    header('Location: http://android.yourwebsite.com');
    exit();
}

More tricks like this are on their way...

Allow Contributors To Upload Images In WordPress

Are you running a WordPress website with bunch of contributors who are willing to post on your website? If yes then this article contains a great tip for you.

As I mention on previous articles, every post on your blog must contain at least one image related to the article. It's really great for SEO and other things.

This code will help us to allow users with contributor role to upload images on your WordPress site.

Add this code to your functions.php file:

if ( current_user_can('contributor') && !current_user_can('upload_files') )
     add_action('admin_init', 'allow_contributor_uploads');
    
     function allow_contributor_uploads() {
          $contributor = get_role('contributor');
          $contributor->add_cap('upload_files');
     }

Thursday, 24 October 2013

How To Disable Smart/Curly Quotes In WordPress

There are lot of word processor programs which itself converts all yours simple quotes to curly quotes (aka s mart quotes). It looks like small figures six and nine raised above the baseline (like 6...9 and 66...99).

It's a huge problem if you're writing codes in your posts as WordPress automatically converts all quote symbols to smart quotes. So if anyone is copying a snippet from your blog post would have problems with running to code in their own text file.

You can easily disable this feature with a small snippet. Just add following snippet to your functions.php file:

<?php
remove_filter('the_content', 'wptexturize');
remove_filter('comment_text', 'wptexturize');
remove_filter('the_excerpt', 'wptexturize');
?>

That's it!

Wednesday, 16 October 2013

Send Email Notifications When User Submit A Post In WordPress

Are you running a multi-author WordPress blog or a blog with guest posters with contributor role to submit the post directly from the WordPress dashboard? Then you must be looking for a way to get email notification when someone submit a post or when you publish or reject their post.

We previously shares some great scripts to get email notifications for a couple of events, but this time it's a plugin.

WP Status Notifier is all you're looking for!

The plugin sends an email to the admin (or selected user) when ever some one submit a post for review and when you publish or reject their post, author will get instant emails. After installing the plugin, you can access it’s setting under Settings > Post Status Change Notifications.

WP Status Notifier's interface is not much complicated, as you can check it below:


It's a great plugin, but if you want some advance options, then you can also use Post Status Notifier Lite.

Personal Note: First of all, Eid-Mubharakh to all my Muslim readers. I'm going out on a small seven day trip tomorrow, so don't expect me to post any articles here on BWidgets. Thanks for all your support!

Sunday, 13 October 2013

Prevent Directory Browsing With .htaccess

I recently shared several articles about .htaccess file, and as you may know by now, it's a great file if you're working on the security of your site. Today we'll disable the directory browsing in our website with some editing in .htaccess file.

You know how you can change a few characters in a URL and continue browsing the website. Sometimes, it could be very dangerous for our website, so it's time to prevent directory browsing.

Add following snippet to your .htaccess file:

# directory browsing
Options All -Indexes

Save the file, and that's it!

How To Remove Footer Credits From Jetpack Mobile Theme In WordPress


Jetpack is a great plugin for WordPress to connect your blog to WordPress.com. It also gives us dozens of crappy great plugins for our blog, such as mobile module, social share, wp.me short links, and more.

Jetpack's Mobile module is great plugin to create a mobile version of your website for mobile users, but it comes with a footer credit: Proudly powered by WordPress.

Giving WordPress their credit for their hard work is not bad, but if you're interested then you can easily remove the Jetpack.

In your file manager, edit footer.php file which can be found inside public_html/wp-content/plugins/jetpack/modules/minileven/theme/pub/minileven

Just remove this code from line #27:

<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'jetpack' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'minileven' , 'jetpack'); ?>" rel="generator"><?php printf( __( 'Proudly powered by %s', 'minileven' , 'jetpack'), 'WordPress' ); ?></a>

That's it.

Popular Posts

 
Powered by Blogger.