Category Archives: WordPress Plugin

How To Translate a WordPress Plugin Into your Local Language

How To Translate a WordPress Plugin Into your Local Language

As you already know that WordPress is an open-source platform and it is translated into many languages by different contributors. Most plugins are already translated into different languages. But if you find a plugin that is not already translated into your local language, you can translate that plugin yourself. You don’t need to be technical in order to translate a WordPress plugin into your own language.

Continue reading
what is plugin in wordpress, What is a WordPress Plugin and How to Develop it, WordPress Plugin

What is a WordPress Plugin and How to Develop it?

WordPress is a flexible platform which provides developer to add extra functionality without changing the core of WordPress. To enhance the functionality of WordPress we need to write custom plugins. WordPress Plugins are just like add-ons, which uses the core functionality of WordPress and add custom functionality into it.

In this article, we will look at what are WordPress plugins and how we can create one.

What is a Plugin in WordPress?

A plugin is a piece of custom code that extends the functionality of WordPress which already exists. It could be a single line of code or a bunch of lines.

What is a Plugin in WordPress

Why use a WordPress plugin?

Whenever you get a burger from a fast-food restaurant, you will be asked ” Sir, do you want extra cheese in your burger?

Why extra cheese in a burger? Of course, it will enhance the taste of your burger but it is not necessary. You can have your burger without adding cheese to it.

WordPress is your burger, and a plugin is your cheese that will add new functionality or enhance the basic functionality of your WordPress.

Plugin Behavior

There are two types of basic plugin behaviors

  1. add_action()
  2. add_filter()

add_action() and add_filter() both are WordPress hooks, to know more about hooks there is a complete tutorial for you on Some useful hooks in WordPress.

You want to perform some specific action using “add_action()” when:

  • A post is made

  • A post of a specific category is made

  • If a specific word occurs in the title of a post

  • If a new user added to a  particular group of users, like admins group, editors group

And the list goes on, depending on your requirements.

Let’s come to the presentation side. You want to perform some action using “add_filter()” when:

  • A post is presented(rendered) on the page

  • A post of a specific category is presented(rendered) on the page

  • If a specific word occurs in the title of a post

Practical example for add_action().

We will make a plugin that will fetch a list of email addresses of the subscribers from the database and send a notification email to each user having a link to that newly published post whenever a new post will be published

Open a text editor and put this code snippet in the file and save it with any name in the ‘wordpress\wp-content\plugins’ directory.

<?php

add_action(‘publish_post’, ‘notify’);

function notify(){

echo ‘Notified';

}

?>

Job has been done.  You have successfully created your new plugin. Go to the admin dashboard move the mouse over the plugins option and click on ‘installed plugin’ and see your plugin is coming in the list. What? It is not coming. Ok, no problem. Let’s tell WordPress about our plugin so that WordPress can know about it.

Open your plugin file and put these commented lines at the start of the file

/*

Plugin Name: My Notify Plugin
Description: With this plugin, you can notify a group of users about the publishing of a new post
Author: WpBrigade
Email: [email protected]
Version: 1.0

*/

So now your plugin file should look like this.

<?php

/*

Plugin Name: My Notify Plugin
Description: With this plugin, you can notify a group of users about the publishing of a new post
Author: WpBrigade
Email: [email protected]
Version: 1.0

*/

 add_action(‘publish_post’, ‘notify’);

function notify(){

echo 'Notified';

}

?>

 “publish_post” is a WordPress built-in function(hook) which is called when a post is to be published and what we are doing, we are telling the WordPress that when you call the “publish_post” function call our function also inside you “publish_post” function. This is called a hook. Like you don’t go and touch the core function and enhance that function in your own way.

Example for “add_filter()”.

Open your text editor again and put this code snippet into it.

<?php

/*

Plugin Name: Change Post Title
Description: With this plugin, you can change the titles of the post
Author: WpBrigade
Email: [email protected]
Version: 1.0

*/

 add_filter(‘the_title’, ‘add_text_to_post_title’);

 function add_text_to_post_title($title){

return $title. ‘ “Added when rendered”‘;

}

?>

“the_title” is also a WordPress hook and we are doing the same thing with it what we have done with the “publish_post” hook.

Again, keep the file and folder name the same, and put the plugin folder into the plugins directory.

So this was a little about how to enhance WordPress functionality, and plugins don’t stop here, you can create plugins to add new functionality to WordPress.

Related Posts Plugins for WordPress

The Importance of Having Related Posts in WordPress

Often you visit a website and at the end of the article there is a list of related posts or sometimes you can already see it right on top of the page & also the bottom too. Its purpose is to help you explore more contents on that website instead of leaving after reading just the first post. See! that could be a great strategy everyone should use right now if you haven’t done so. But that’s not it, we still have more for you. And if you are all set to boom the traffic at your website, without having headaches while putting codes for WordPress related posts, then you are at perfect place to know about WordPress related posts plugins. Whose sole part is to keep visitors engaged in reading the stuff at your website.

Continue reading

WordPress Plugins slowing down your website

Which WordPress Plugins are Slowing Down your Website?

Have you ever heard of the term “Less is More”? This is one of my favorite terms that I always applied to web designing and my own blog, especially when it’s running on the WordPress platform. The reason behind that is having only one or two main plugins will help my website run way faster without doing optimization.

Before building a website, it must be a priority that it has to be fast loading and not cracking up on different devices. In order to do this, it must be noted that the major reason slowing down a WordPress website are always the two: the Web Hosting and the bad plugins. It is because the when your web hosting server is not properly configured it will damage the loading speed of the pages of your WordPress website and then comes the few plugins which are poorly coded resulting in hurting the speed of WordPress websites to give you pain! I am sure the question of a lot people is answered here that do plugins slow down WordPress site? Yes,  they can down the WordPress site for you despite of making them happening.

However, not a lot of people understand that and they just keep on installing as many plugins as they can without knowing that it will slow down their site and also takes up too many resources from the hosting provider.

So what type of WordPress plugins are there and are really slow WordPress plugins? Should we use them or not?

You’re about to find out the answers really quickly by reading the rest of this article.

What kind of plugins uses the most server resources?

This is the type of plugin everyone must use to increase internal links/pageviews and reduce bounce rate. But they didn’t know about the fact that it wasted a lot of their hosting resources. Let’s use “Yet Another Related Post” as an example, before this plugin can display relevant posts, it must go through a bunch of queries sent to the database. What could be a good solution? I suggest that you have custom related posts without plugin or use one like OutBrain or nRelated because it doesn’t consume your data.

Backup Plugins

You must be surprised to see this kind of plugin appeared under the list, I’m pretty sad too. These WordPress backup plugins usually have only one important task, compressed all website data into a .zip file and send it to the host. As far as I know, the size could easily go up to hundreds of megabytes (MB).

What should you do? The current best solution to back up a WordPress site is to use VaultPress.

Hit Counters Plugin

I don’t get how nowadays people are still using those classic hit counters on their site. I’m not talking about the “Who’s Among Us” but plugins that count post views and online visitors. Don’t they know about Google Analytics? Just imagine you have 10k visits a day –  it will execute code counter 10,000 times. That’s crazy, right?

Other

Even must-have plugins such as Broken Link Checker, Google XML Sitemaps, SEO Auto Links, etc are the ones that eats most of your database.

Solution?

Above are a few types of plugins that I know will directly impact your site. To manually find out which plugins are affecting your site, please use P3 (Plugin Performance Profiler) to receive a detailed report of each plugin load time.

This plugin creates a profile of your WordPress site’s plugins’ performance by measuring their impact on your site’s load time.  Often times, WordPress sites load slowly because of poorly configured plugins or because there are so many of them. By using the P3 plugin, you can narrow down anything causing slowness on your site.

WP ROcket Plugin, WP rocket is a must have WordPress cache plugin

WP Rocket is a must-have WordPress cache plugin

I recently changed the default theme of my Personal Site, leaving the Genesis Framework behind and put on a new minimal WordPress theme called SORBET. I fell in love with it while browsing through the demo version. The idea of it being super fast got to me and I immediately customize a few things and apply it live right away. The loading result didn’t disappointed me at all, however, it couldn’t beat the speed of my previous Genesis child theme, which means there are room for improvement.

Continue reading