• Can’t access php files (of plugins) directly in browser. Why?

    I get a 404 error.

    For example, if I try to navigate to my domain / wp-content / plugins / then the plugin folder / then the php file name … it display s a 404 error.

    I’m just curious if this normal? Or is it a block on my server?

    I created a simple php file and added it to one of my plugin folders. Then I tried to simply navigate to that php file in the browser. But it displays a 404 error.

    There’s no .htaccess in my plugins folder or in my wp-content folder.

    The .htaccess file in the root of my site is:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    So .. I’m just curious if this is the way things “should” behave, or if something needs to be changed to allow php files (in my plugin folders) to be accessible from the browser (or is this a security issue).

    I’d appreciate any input or comments.

    Thanks,
    Gary

Viewing 9 replies - 1 through 9 (of 9 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You can’t view any php file directly in the browser, why are you accessing them in the browser?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    If you want you could make a copy of the file and change the extension of the files to phps, http://filext.com/file-extension/PHPS

    Thread Starter Gary Gordon

    (@garymgordon)

    Well, I was using a new plugin, (which also was encrypted) called Simple Video Pro, and it wasn’t working. They told me that my web host server is not allowing read access to the files that load the Javascript. The two files were php files in their plugin folder. They provided me a URL to these files .. as an example.

    Plus, these files (of theirs) are encrypted so I can’t see the actual file contents.

    Any thoughts?
    Gary

    Thread Starter Gary Gordon

    (@garymgordon)

    Andrew,

    Also .. is it considered acceptable for a Plugin to have “encrypted” code?

    It just made me feel odd to see this.

    Can you give me your thoughts about “premium” plugins that encrypt code???

    Gary

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Gary, do you know which license the plugin is released under? It doesn’t sound like it is open-source if it’s disguising its code.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    By the way your hosting providers should be able to confirm whether they can access the file that has the issue.

    Thread Starter Gary Gordon

    (@garymgordon)

    Well, I contacted my host and they said that for some reason wp-content folder was set to 777. When they changed this to 755 .. everything worked and the php file is accessible now. The php code doesn’t display in the browser, which is understandable, but the file can be accessed as needed now.

    The license info I can find, says:
    All rights reserved. Some code in immobiled.php licensed via MIT.

    Is this a concern at all?

    Gary

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I don’t think we can help you out with it, sorry. So that we don’t get into trouble, or risk it, we can only help out with things released under the GPL license and even then we limit to those plugins/ themes that are distributed on WordPress.org.

    Thread Starter Gary Gordon

    (@garymgordon)

    Andrew,
    Ok. I understand. Thanks! You’ve actually been a big help.
    Gary

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Can't access php files (of plugins) directly in browser. Why?’ is closed to new replies.