插件如何获取我的网站的目录网址

When we download a plugin , it auto added some files to our footer For-Example

<script type='text/javascript' 
src='example.com/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=5.0.1' >
</script>

as I talk contact form 7 Plugin . What I want to know in which file its pick my site directory path 'example.com/wp-content/' this thing

Please Help if you got my point!

It is probably pulling from the wp_options table of the database: look for the value siteurl in the option_name column

It could also come from the wp_config.php file or even the functions file.

Suppose your plugin name is 'my-plugin'.

So, inside your main file of your plugin write following code -

plugin_dir_path( __FILE__ )

This will give you whole path, till your plugin folder. Here as per example -

example.com/wp-content/plugins/my-plugin/