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

Failing latest Theme Check #355

Closed
vapvarun opened this issue Jun 21, 2021 · 4 comments · Fixed by #361
Closed

Failing latest Theme Check #355

vapvarun opened this issue Jun 21, 2021 · 4 comments · Fixed by #361

Comments

@vapvarun
Copy link

The TGM class can't pass the latest Theme Check when submitting on wordpress.org.
Here is the message:

WARNING: WP_Filesystem was found in the file class-tgm-plugin-activation.php WP_Filesystem should only be used for theme upgrade operations, not for all file operations. Consider using file_get_contents(), scandir(), or glob()

<li><span class="tc-lead tc-warning">WARNING</span>: <strong>WP_Filesystem</strong> was found in the file <strong>external/class-tgm-plugin-activation.php</strong> WP_Filesystem should only be used for theme upgrade operations, not for all file operations. Consider using file_get_contents(), scandir(), or glob() Line 690: * Uses <span class="tc-grep">WP_Filesystem</span> to process and handle the plugin installationLine 695: * @uses <span class="tc-grep">WP_Filesystem</span>Line 726: // Pass necessary information via URL if <span class="tc-grep">WP_Filesystem</span> is needed.Line 739: $method = ''; // Leave blank so <span class="tc-grep">WP_Filesystem</span> can populate it as necessary.Line 745: if ( ! <span class="tc-grep">WP_Filesystem</span>( $creds ) ) {Line 746: request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup <span class="tc-grep">WP_Filesystem</span>.Line 895: wp_filesystem'] ) ) {Line 900: wp_filesystem']-&gt;dirlist( $remote_source ) );Line 901: wp_filesystem']-&gt;is_dir( $source ) ) {Line 929: wp_filesystem']-&gt;move( $from_path, $to_path ) ) {Line 2755: * through if a user has to use <span class="tc-grep">WP_Filesystem</span> to enter their credentials.Line 2828: // Pass all necessary information if <span class="tc-grep">WP_Filesystem</span> is needed.Line 2837: $method = ''; // Leave blank so <span class="tc-grep">WP_Filesystem</span> can populate it as necessary.Line 2838: $fields = array_keys( $_POST ); // Extra fields to pass to <span class="tc-grep">WP_Filesystem</span>.Line 2844: // Now we have some credentials, setup <span class="tc-grep">WP_Filesystem</span>.Line 2845: if ( ! <span class="tc-grep">WP_Filesystem</span>( $creds ) ) {</li>

@carolinan
Copy link
Collaborator

Hi
The checks can not exclude TGM files, that would be a security risk.
And if there are issues with TGM, they should be fixed in TGM.

@carolinan
Copy link
Collaborator

This warning does not block upload when submitting to .org. If the theme was blocked, was there any errors reported?

@vapvarun
Copy link
Author

Hi Carolina,
It was uploaded and approved successfully
https://themes.trac.wordpress.org/ticket/101267
I was just willing to know if we have to use any alternative for WP_Filesystem calls in the future. After the theme check errors, I was not sure theme update will be approved or not

@carolinan
Copy link
Collaborator

There is a difference between required and warning, recommended and info.
A warning is something that both the author and reviewer should be aware of, but not required.

I don't recommend making your own changes to TGMPA.

I found this issue, and replied to it:
TGMPA/TGM-Plugin-Activation#808

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants