Showing posts with label WP. Show all posts
Showing posts with label WP. Show all posts

Aug 14, 2013

Top 10 Inane Mistakes which WordPress Users Make

Wordpress
WordPress has touched our lives and how?! This uber simple blogging and content management platform is an apple of eye for anyone looking to mark an online presence. However, often we let ourselves go blind by the simplicity and SEO benefits of this platform, and do not consider various mistakes which we might actually by doing that are affecting the performance of the site. In this write up we aim to discuss 10 top inane mistakes which bloggers make, which may actually be lethal to the holistic health of their website or blog.

Please read ahead to discover these mistakes, and we hope you are not the one making them. But if you are, please try to nullify the same – either on your own, with our help being right in place or by consulting a professional.

Top 10 Inane Mistakes which WordPress Users Make

Still running the older version of WP?
We ask this with a tone of shocking incredibility. And if the answer is an affirmative, please tell us what exactly is wrong with you? Why do you hate your blog so much? There is an entire living, breathing, thriving community of WP developers who are working tirelessly to improve the CMS for you, so that you get to enjoy far superior and much improved features. Why would you decide against it? So please, just stop doing whatever you are doing and update your WP backend to the latest version. But wait, you might want to complete reading this post before you leave.


Painfully slow loading time
One of the biggest mistakes that every WordPress user is prone to committing is not paying due attention to the loading speed of the blog or site. Whether you are using too much of plugins, or you have just not optimized the page for better performance, please stop doing it and pay heed to the loading speed. This is more important now because Google has included the loading speed into its search engine algorithms, and you are more than certain to lose your Google rankings of you do not fix the loading speed NOW!


Please, no more “Just another WordPress blog”
Do yourself and all of us a favor and please use a theme which overrides the tagline that we have all grown so sick of. And if your blog does have this tagline, you should know you are just one amongst the ocean full of other users. You definitely would not want yourself or your blog to be remembered that way.


Bloating up deactivated plugins in the content folder of WP
You deactivat ed a plugin? Kick it out of your systems. As simple as that! Because not only do these plugins not serve any purpose to you, they also is bad for the performance of your blog or site. Hence, get over it already!

wp-plugins

A messed up Wp-Admin Section
If the admin section of your blog isn’t fine tuned, with no deactivated plugins and an updated version of each and everything, you are obviously doing the job as an admin wrong. Take a moment off and cleanse it, would you?


Blog posts of the length of the entire home page
So the home page of your blog looks longer than the Eiffel Tower, simply because it contains your recent blog updates in entirety? You know how backward that sounds? Unless of course if you have a specific reason behind doing it. If not, then please use the inbuilt ‘Read More’ section of WordPress to span the posts on the homepage accordingly. Besides, certain themes have the excerpts section to assist you with the same.


The white screen of death
As WordPress users, we all have experienced the white screen of death. Whether you have messed up your wp-config.php or there is some other complication with it, please do fix the issue ASAP. Trust us, no user will be interested in staring at your URL and a blank screen.

screen-of-death

Problems with database connections and gateways
Talking about what users are not so warmly going to react to, we come to another aspect, which surely does not rank high on the user’s popularity list anyway. It is getting a server down or installation error each time they visit your page. Thus, ensure that the database connections are right in place and there are no installation errors.


Indexing your site to private
It’s lethal! – One of the perks of WordPress is that it allows the users to own a site and blog simultaneously. And how users misuse this privilege is by indexing the site to private after owning a blog, thinking that blog will take care of all the SEO and site would rather enjoy an elite attention – or whatever the thought process is, we are not really discussing that. What we are pointing out at is that don’t! Don’t do this to your site and to your blog as by opting for this option, you would put the noindex tag on each of your web pages. You don’t really want the traffic to fall to a zero, do you?


Making your server information visible
You were wondering why your WP blog or website gets hacked ever so often? The hackers with their wonderful notorious minds obviously are going to target you, if you provide them with all the PHP information or the info about the current version of WP that you are running. To check the same, visit yoursite.com/phpinfor.php or yoursite.com/readme.html. Got the point, right? Instead opt for professional WordPress development services, and get a secured and well optimized WP blog or site.
This brings us to an end of this post. We hope that we were helpful in letting you fix some of the major performance and security blunders that may have previously existed in your blog. Also, please do consider opting for professional services, should you feel stuck up with the same at any moment.





About Auhtor

John Pitt is a blogging junkie and also a developer working with an
Offshore WordPress Development
company. You can often find him either thinking about his next blog posts or ganging up with his fellow WordPress Developers. For your project you may
hire WordPress developers
and avail the expert services provided by them.

Nov 8, 2011

Ten Wordpress Useful Functions And Snippets

Some useful Wordpress PHP funtions.

Just copy and paste these functions in your themes functions.php file

Change the WP Login Logo & URL Link

[php]
// CUSTOM ADMIN LOGIN HEADER LOGO
function my_custom_login_logo() {
echo '';
}
add_action('login_head', 'my_custom_login_logo');

// CUSTOM ADMIN LOGIN HEADER LINK & ALT TEXT
function change_wp_login_url() {
echo bloginfo('url'); // OR ECHO YOUR OWN URL
}
function change_wp_login_title() {
echo get_option('blogname'); // OR ECHO YOUR OWN ALT TEXT
}
add_filter('login_headerurl', 'change_wp_login_url');
add_filter('login_headertitle', 'change_wp_login_title');

[/php]

Load JQuery From Google CDN

[php]
// even more smart jquery inclusion :)
add_action( 'init', 'jquery_register' );

// register from google and for footer
function jquery_register() {

if ( !is_admin() ) {

wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', ( 'https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js' ), false, null, true );
wp_enqueue_script( 'jquery' );
}
}
[/php]

How to remove the WordPress Version Information

[php]
// remove version info from head and feeds
function complete_version_removal() {
return '';
}
add_filter('the_generator', 'complete_version_removal');

[/php]

Remove Default Wordpress Meta Boxes

[php]
// REMOVE META BOXES FROM DEFAULT POSTS SCREEN
function remove_default_post_screen_metaboxes() {
remove_meta_box( 'postcustom','post','normal' ); // Custom Fields Metabox
remove_meta_box( 'postexcerpt','post','normal' ); // Excerpt Metabox
remove_meta_box( 'commentstatusdiv','post','normal' ); // Comments Metabox
remove_meta_box( 'trackbacksdiv','post','normal' ); // Talkback Metabox
remove_meta_box( 'slugdiv','post','normal' ); // Slug Metabox
remove_meta_box( 'authordiv','post','normal' ); // Author Metabox
}
add_action('admin_menu','remove_default_post_screen_metaboxes');

// REMOVE META BOXES FROM DEFAULT PAGES SCREEN
function remove_default_page_screen_metaboxes() {
remove_meta_box( 'postcustom','post','normal' ); // Custom Fields Metabox
remove_meta_box( 'postexcerpt','post','normal' ); // Excerpt Metabox
remove_meta_box( 'commentstatusdiv','post','normal' ); // Comments Metabox
remove_meta_box( 'trackbacksdiv','post','normal' ); // Talkback Metabox
remove_meta_box( 'slugdiv','post','normal' ); // Slug Metabox
remove_meta_box( 'authordiv','post','normal' ); // Author Metabox
}
add_action('admin_menu','remove_default_page_screen_metaboxes');

[/php]

Include custom post types in the search results of WP

[php]
// MAKE CUSTOM POST TYPES SEARCHABLE
function searchAll( $query ) {
if ( $query->is_search ) { $query->set( 'post_type', array( 'site','plugin', 'theme','person' )); }
return $query;
}
add_filter( 'the_search_query', 'searchAll' );

[/php]

Add Excerpt to pages

[php]
if ( function_exists('add_post_type_support') )
{
add_action('init', 'add_page_excerpts');
function add_page_excerpts()
{
add_post_type_support( 'page', 'excerpt' );
}
}

[/php]

Change the order of Admin Menu

[php]
// CUSTOMIZE ADMIN MENU ORDER
function custom_menu_order($menu_ord) {
if (!$menu_ord) return true;
return array(
'index.php', // this represents the dashboard link
'edit.php?post_type=events', // this is a custom post type menu
'edit.php?post_type=news',
'edit.php?post_type=articles',
'edit.php?post_type=faqs',
'edit.php?post_type=mentors',
'edit.php?post_type=testimonials',
'edit.php?post_type=services',
'edit.php?post_type=page', // this is the default page menu
'edit.php', // this is the default POST admin menu
);
}
add_filter('custom_menu_order', 'custom_menu_order');
add_filter('menu_order', 'custom_menu_order');

[/php]

Change the length of excerpts

[php]
function new_excerpt_length($length) {
return 100;
}

add_filter('excerpt_length', 'new_excerpt_length');

[/php]

Enable GZIP output compression

[php]
if(extension_loaded("zlib") && (ini_get("output_handler") != "ob_gzhandler"))
add_action('wp', create_function('', '@ob_end_clean();@ini_set("zlib.output_compression", 1);'));

[/php]

Get the First Image from the Post Content

[php]
// AUTOMATICALLY EXTRACT THE FIRST IMAGE FROM THE POST
function getImage($num) {
global $more;
$more = 1;
$link = get_permalink();
$content = get_the_content();
$count = substr_count($content, ' $start = 0;
for($i=1;$i $imgBeg = strpos($content, ' $postOutput = substr($post, 0, $imgEnd+1);
$postOutput = preg_replace('/width="([0-9]*)" height="([0-9]*)"/', '',$postOutput);;
$image[$i] = $postOutput;
$start=$imgEnd+1;
}
if(stristr($image[$num],' $more = 0;
}

[/php]

Credit: Users Of wordpress.stackexchange.com

Jul 10, 2011

How to show a message in the WordPress Admin

If you are working on a plugin or a theme, and you want to display some message to the user like "Settings have been saved" or "Plugin installed, Please goto settings page to configure it", then just follow the below snippet.

[php]
/**
* Generic function to show a message to the user using WP's
* standard CSS classes to make use of the already-defined
* message colour scheme.
*
* @param $message The message you want to tell the user.
* @param $errormsg If true, the message is an error, so use
* the red message style. If false, the message is a status
* message, so use the yellow information message style.
*/
function showMessage($message, $errormsg = false)
{
if ($errormsg) {
echo '<div id="message" class="error">';
}
else {
echo '<div id="message" class="updated fade">';
}

echo "<p><strong>$message</strong></p></div>";
}
[/php]
Now we just add a hook to the admin notices function to show our custom message.

[php]
/**
* Just show our message (with possible checking if we only want
* to show message to certain users.
*/
function showAdminMessages()
{
// Shows as an error message. You could add a link to the right page if you wanted.
showMessage("You need to upgrade your database as soon as possible...", true);

// Only show to admins
if (user_can('manage_options') {
showMessage("Hello admins!");
}
}

/**
* Call showAdminMessages() when showing other admin
* messages. The message only gets shown in the admin
* area, but not on the frontend of your WordPress site.
*/
add_action('admin_notices', 'showAdminMessages');[/php]

Done.....

Jul 7, 2011

Wordpress plugin directory problem

Some of you may not be aware of this, but there was a small security breach in the WordPress.org plugin directory this week. Someone managed to commit malicious changes to some popular plugins by hacking into the SVN repository. The WP crew discovered the changes and managed to revert the affected plugins back to the last legitimate release. They have also shut down access to the repo to make sure no other plugins were affected.

You can read more about in the WP blog: http://wordpress.org/news/2011/06/passwords-reset/

Strange enough, the plugin we were going to review this week, BackWPup has been removed completely from the repo. After doing a bit of research it seems like there was a little issue with the plugin causing excessively long processes while backing up WP and the author is aware and working on a fix.

You can read more about that in the support forum: http://wordpress.org/support/topic/plugin-backwpup-run-away-backup-process

If the plugin is updated and works well enough, we will do another review and post about it, but for now, this weeks plugin review will be replaced with this article about the few plugins that were affected by the repo hack.

So if you are using WP Touch, W3 Total Cache or Add This make sure to update again to the most recent release which is the clean one. Also, if you are a member of WP.org, you will have to reset your password as a “prophylactic measure” to help heighten security.

Jul 6, 2011

Add Sidebar to TwentyEleven Theme

This Monday WordPress released its new version, WP 3.2, with a brand new HTML5 default theme, Twenty Eleven.
But after activating this theme, you will find that the sidebar from pages and posts pages .i.e. single.php is missing,

This theme by default doesn't has sidebar in pages and posts.

To add them install Twenty Eleven Child Theme.
With this you will be able to add widgets on sinle.php or Posts page.

Download Twenty Ten Child Theme

[download id="2"]

 

Please Download the new Child Theme, which Activates Sidebar on Posts and also on Pages