Skip to content

Show check results on the page #35

@mehulkaklotar

Description

@mehulkaklotar

Results/errors returned from each check should be shown in the tables in the Admin area on the Dashboard >> Tools >> Plugin Check page.

This issue is dependent on the following:

Acceptance Criteria

NOTE: Read description of #34 before checking below steps.

  • render_result_row() should available in the Admin_Page class (this class is introduced in Create Tools page #32)
  • Add constructor() method in the Admin_AJAX class which will take the$render_callback variable as a constructor parameter. (Admin_AJAX class is introduced in Create AJAX function and triggers and handling of progress indicator for the user #34)
  • Admin_Page class may/should have the open_result_table() and close_result_table() methods to format the result into the table format.
  • template-table-open.php file template should exist at includes/Admin/Templates and should have the table opening tags.
  • template-table-close.php file template should exist at includes/Admin/Templates and should have the table closing tags.
  • template-result-row.php file template should exist at includes/Admin/Templates - this file will handle the formatting of the error/warning message into the table's row (<tr>) format using the script[type="text/template"] tags. The row format's columns can be as below:
    • Error/warning message
    • Error Type (error/warning)
    • Error/Warning Standard name (e.g., WordPress.XSS.EscapeOutput.OutputNotEscaped, and so on. )
    • File name and path - on which error/warning occurs
    • Line and Column numbers - on which error/warning occurs
  • open_result_table() method should includes the template-table-open.php template in it.
  • render_result_row() method should includes the template-result-row.php template in it.
  • close_result_table() method should includes the template-table-close.php template in it.
  • Admin_Page class will use the initialize_page() method(see Create Tools page #32). This method should call all three template functions to create the template markup in the admin footer with the admin_footer action.
    1. open_result_table()
    2. render_result_row()
    3. close_result_table()

NOTE: On the fresh admin screen, the table not exist on the page, and once results are returned, the table will be created and rendered, but that will be handled in #84.

Tests Coverage

Automated Tests:

  • Write a test case for the Admin_Page::render_result_row().
  • Write a test case for the Admin_Page::open_result_table() and Admin_Page::close_result_table().
  • Write a test case to test the row template markup.

Manual Tests:

  • Once the user clicks the Check it! button, check if the proper HTML table and table row are showing up and appending on the screen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    WP AdminIssues for the WP Admin screen[Type] EnhancementA suggestion for improvement of an existing feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions