Support » Plugin: Theme Check » Doubtful warnings in the ‘20210617’ version

  • Hello!

    We have overrides for search forms from bbPress and BuddyPress plugins in our theme.

    New version gives following warnings:

    WARNING: role="search" was found in buddypress/common/search/search-form.php. Use get_search_form() instead of hard coding forms. Otherwise, the form can not be filtered.
    WARNING: role="search" was found in bbpress/form-topic-search.php. Use get_search_form() instead of hard coding forms. Otherwise, the form can not be filtered.

    Also we’re using the TGMPA for recommending plugins and there is a warning in this file:

    WARNING: WP_Filesystem was found in the file inc/tgm-plugin-activation/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() Line 692: * Uses WP_Filesystem to process and handle the plugin installationLine 697: * @uses WP_FilesystemLine 728: // Pass necessary information via URL if WP_Filesystem is needed.Line 741: $method = ''; // Leave blank so WP_Filesystem can populate it as necessary.Line 747: if ( ! WP_Filesystem( $creds ) ) {Line 748: request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem.Line 897: wp_filesystem'] ) ) {Line 902: wp_filesystem']->dirlist( $remote_source ) );Line 903: wp_filesystem']->is_dir( $source ) ) {Line 931: wp_filesystem']->move( $from_path, $to_path ) ) {Line 2737: * through if a user has to use WP_Filesystem to enter their credentials.Line 2810: // Pass all necessary information if WP_Filesystem is needed.Line 2819: $method = ''; // Leave blank so WP_Filesystem can populate it as necessary.Line 2820: $fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem.Line 2826: // Now we have some credentials, setup WP_Filesystem.Line 2827: if ( ! WP_Filesystem( $creds ) ) {

    Do we need to fix these warnings? Because we really confused with them.

    Thank you.
    Best regards!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Sattajit

    (@sattajit)

    Same here. I’m also confused with them. Would you please anybody help about this issue?

    • This reply was modified 1 month ago by Sattajit.
    Plugin Contributor Carolina Nymark

    (@poena)

    Hi!

    These are warnings, you need to be aware of them and then it is up to you to decide if you need to make changes to the code.

    If you hard code a search form then it can’t be filtered, which means that child themes can’t use it to make changes, and plugins that uses the filter to add features will not work with your theme.
    This is a common problem, which is why we added a warning about it to inform theme authors.

    But Theme Check can not determine what the search form is used for, it mostly uses regex and reads one line at the time, so you need to review the code manually and make a decision.

    For questions about if there is a similar function for bbpress and buddypress, you would need to look through their documentation.


    It is not recommended to make changes to TGMPA.
    In the development version of Theme Check on GitHub, the error messages for WP_Filesystem have been improved, but I am not sure when that update will be released.

    Thank you very much.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.