Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More common files for whitelist #104

Conversation

rinkuyadav999
Copy link

No description provided.

@pattonwebz
Copy link
Member

Define list of other common whitelist items, decide how common init.php is within themes

@jrfnl
Copy link

jrfnl commented May 31, 2018

For now, I will add unit tests to this PR and remove init.php so this PR can be merged.

Once @pattonwebz has run a check on the Theme repo, a new PR can be opened to add more files to be whitelisted if needed.

@jrfnl
Copy link

jrfnl commented May 31, 2018

Hmm... I've just had a closer look at the sniff and this PR in particular.

The $file_whitelist property whitelists files from which it is expected that include/require calls are made.
It does not whitelist the names of files which are expected to be included/required.

In other words, this PR will need more work than expected.
In my opinion, a separate property will need to be introduced for files which are expected to be included/required and logic will need to be added to the sniff to handle this.
This logic would also need to take into account that these files can be placed in subdirectories.

@rinkuyadav999 Would you like to update the sniff for this ?
If not - and as the PR which is needed will be considerably different from the original PR -, I would suggest closing this ticket in favour of a new PR which introduces the concept of "files which are allowed to be included".

@justintadlock
Copy link

functions.php is already loaded by WP. class-tgm-plugin-activation.php is pretty common.

I can't think of any common files in particular to whitelist. Themes are so vastly different in which file names that they include/require that I'm not sure it'd be worthwhile.

If you could do partial matches, it might work. For example, any file that begins with class- would likely be a class file, for example.

@justintadlock
Copy link

There doesn't seem to be much interest in this ticket based on the team meeting. We don't think it's worth pursuing.

Meeting: https://wordpress.slack.com/archives/C02RP4Y3K/p1528822802001090

@jrfnl jrfnl closed this Sep 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants