First read the wordpress plugin handbook
https://developer.wordpress.org/plugins/ , All development guides and specifications are here.

Use template creation tool: https://wppb.me/

Need to fill in 6 items
plugin name: no need to explain
plugin slug: is the string following your WP URL, ,same as plugin name is ok
plugin URI: the location of the plugin
Author Name, Author Email, Author URI: Author information
Reference: https://developer.wordpress.org/plugins/plugin-basics/header-requirements/


[Build Plugin] Download the template and unzip it to see template structure of a plugin

Now copy (upload) the entire plugin directory to wordpress / wp-content / plugins

Now, go to your wordpress website, log in with admin, check Plugins, you will find that your plugin has appeared

Add action links to the plugin as shown below

To use add_filter plugin_action_links to add an action link, add the following code to plugin-name.php
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'catp_plugin_settings_link' );
function catp_plugin_settings_link( $links )
{
echo "<script> alert('123');</script>" ;
$url = 'https://www.google.com';
$_link = '<a href="'.$url.'" target="_blank">' . __( 'Setting', 'domain' ) . '</a>';
$links[] = $_link;
return $links;
}
Active your plugin will see an additional Setting action link(Appears only when the plugin is activated)

To add a new item to admin_bar:
add_action('admin_menu', 'catp_plugin_setup_menu');
function catp_plugin_setup_menu(){
add_menu_page( 'Test Plugin Page', 'CATP', 'manage_options', 'test-plugin', 'test_init' );
}
function test_init(){
echo "<h1>888</h1>";
}

To add content to the end of the post itself, use ‘the_content’
function to_footer($content)
{
return $content . 'I am in the footer';
}
if (is_admin()) {
add_action('the_content', 'to_footer');
}
Note: if (is_admin ()) we only allow admin to take action ,So this content only appears when admin is logged in

Regarding actions, links, hooks, etc. developing WordPress plugins & themes, for those who are new to it, may really don’t know where to start. It takes time to get familiar with the usage of WordPress API. After some google and testing, I finally completed the first wordpress plugin:
clone-and-translate-post
At present, it is only possible to work, and the translation function is also possible after preliminary testing. There should be a little distance from reaching the product standard. If you are interested, you can participate together: https://github.com/jj449/clone-and-translate-post/
note:
Where does the menu appear?
- add_options_page
function myplugin_register_options_page() {
add_options_page('catp options', 'catp options', 'manage_options', 'myplugin', 'myplugin_options_page');
}
add_action('admin_menu', 'myplugin_register_options_page');

2. add_menu_page
function catp_plugin_setup_menu(){
add_menu_page( 'Test Plugin Page', 'CATP', 'manage_options', 'test-plugin', 'test_init' );
}
add_action('admin_menu', 'catp_plugin_setup_menu');

3. add_submenu_page