• Resolved gocara 3742

    (@sergejack)


    As far as I know, in a plugin’s root directory, only the file named according to the plugin gets automatically executed by wordpress.

    So if my plugin’s name is “abcd1234” only “./wp-content/plugins/abcd1234/abcd1234.php” should get executed.

    if in the same directory there’s a file named “execute me.php” (./wp-content/plugins/abcd1234/executeme.php) it shouldn’t get automatically executed by wordpress… right?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Actually, the filename doesn’t matter at all. You can name it index.php, abcd1234.php or nothing.php. It’s the same.

    WordPress will scan the files (without executing them) for plugin headers, and will list each plugin header it finds as a separate plugin.
    In a sense, a plugin is any file with a plugin header.

    When you activate a plugin, you essentially register that specific filename to run when WordPress loads.

    To answer your question, if “execute me.php” doesn’t have an appropriate header and isn’t activated, then it won’t get executed. (unless you include/require it from some other part of your code of course).

    Thread Starter gocara 3742

    (@sergejack)

    This makes things much more clear for me.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Are all those files executed?’ is closed to new replies.