Create a folder with the name of your plugin and inside it place a php
file with the same name as plugin name, like my-first-plugin.php. First compulsory
content will be -
/*Plugin Name: my first pluginPlugin
URI: http://extensions.programminghelp24.com/
Description: descriptionAuthor: mitsol  ÂÂ
Version: 1.0Author
URI: http://extensions.programminghelp24.com/
License: GPLv2 or later */ ÂÂ
Code details - It describes your plugin name and description.without it
plugin will not work
Step-2:
Add more content as follows -
function my-first-plugin-activation() {}Code details - here my-first-plugin-activation() function codes will
register_activation_hook(__FILE__, 'my-first-plugin-activation');
function my-first-plugin_deactivation() {}
register_deactivation_hook(__FILE__, 'my-first-plugin-deactivation');
add_action('wp_enqueue_scripts', 'my-first-plugin-scripts');
function my-first-plugin-scripts() {  ÂÂ
 wp_enqueue_script('jquery');   ÂÂ
wp_register_script('mitsol_feed_javascript', plugins_url('js/my_js.js', __FILE__), array("jquery"));ÂÂ
wp_enqueue_script('mitsol_feed_javascript');
}
run when plugin is activated, likewise my-first-plugin-deactivation()
will run when plugin is deactivated
here - add_action('wp_enqueue_scripts', 'my-first-plugin-scripts');
defines a action for script registering so "my-first-plugin-scripts" function
will register scripts as shown above -
"wp_enqueue_script" will register jquery in that function
"wp_register_script" will register custom javascript file inside your plugin
as shown in the way above
Step-3:
Also add codes as follows -
add_shortcode("my-first-plugin-short-code", 'my-first-plugin-replace-scode');
function my-first-plugin-replace-scode(){ echo "<h2>first output</h2>";}
Code details - here "add_shortcode" will register a short code
"my-first-plugin-short-code", which when placed in any page or post code,
will be replaced by the content of the function "my-first-plugin-replace-scode()"
Step-4:
It's done.
Zip the content of your folder along with any js or css folder and install
the zipped plugin from wordpress dashboard and then activate plugin.
Place the above short code in any page or post to display your plugin content.