A good starting point for developing a wordpress plugin is the WordPress Developer Handbook.
You are able to develop a new Plugin in just a few steps:
Step 1: Create one php file (e.g. my-hello-world.php)
Step 2: Create a header. Minimum Fields and all possible Fields are described on Header Requirements.
<?php
/*
Plugin Name: My Hello World
Description: This is a simple "hello world" Plugin for WordPress
Author: Patrick Neumann
Version: 1.0.0
Author URI: http://www.patrick-neumann.eu/
*/
?>
Step 3: Add a Hook
With Hooks you are able to add functionality to a plugin. There exists two types of hooks.
Actions: Allow you to add or change WordPress functionality.
Filters: Allow you to alter content as it is loaded and displayed to the website user.
In our example I add some code to display some “hello world” in the footer.
add_action( 'wp_footer', 'my_hello_world_function' );
function my_hello_world_function() {
echo 'hello world';
}
Step 4: Installing the new plugin
It is easy to install the plugin. You have to create a zip file including the directory “my-hello-world” and the “my-hello-world.php”. So you have a my-hello world.zip file. Now go to “Plugin->Add New->Upload Plugin” and choose your zip file, upload the file and activate the plugin.
After installing you see the text like bellow:
This is the complete pugin code:
<?php
/*
Plugin Name: My Hello World
Description: This is a simple "hello world" Plugin for WordPress
Author: Patrick Neumann
Version: 1.0.0
Author URI: http://www.patrick-neumann.eu/
*/
add_action( 'wp_footer', 'my_hello_world_function' );
function my_hello_world_function() {
echo 'hello world';
}
?>