Every WordPress plugin, no matter how complex, starts from the same tiny skeleton — a single PHP file with a comment header that WordPress’s plugin loader recognizes.
<?php
/**
* Plugin Name: My First Plugin
* Description: Adds a simple shortcode.
* Version: 1.0.0
*/
if (!defined('ABSPATH')) exit; // block direct access
function mfp_hello_shortcode($atts) {
$atts = shortcode_atts(['name' => 'World'], $atts);
return '<p>Hello, ' . esc_html($atts['name']) . '!</p>';
}
add_shortcode('mfp_hello', 'mfp_hello_shortcode');
Where This Goes
Drop this file into wp-content/plugins/my-first-plugin/my-first-plugin.php, activate it under Plugins, and [mfp_hello name="Alice"] works anywhere in your content. Real plugins build on exactly this pattern — hooks, shortcodes, and settings pages, just more of them.