Skip to content

Create Tools page #32

@mehulkaklotar

Description

@mehulkaklotar

Description

The plugin should introduce a new page under Tools to allow users to run checks of plugins.

Acceptance Criteria

  • Class Admin_Page should exist at includes/Admin
  • Admin_Page class should have the __construct() method.
  • add_hooks() method should exists and have the add_action( 'admin_menu', array( $this, 'add_page' ) ); hook registering. (NOTE: add_hooks() method will be called from wherever the class is instantiated).
  • The add_page() will have add_management_page() with below params.
    • $page_title should be "Plugin Check"
    • $menu_title should be "Plugin Check"
    • $capability should be "activate_plugins"
    • $menu_slug should be "plugin-check"
    • Define callback method in class Admin_Page for render_page
    • $position should be anything or default
  • The plugin check admin page should be available as below:

Screenshot 2022-11-21 at 7 56 24 PM

  • Admin_Page class will have the render_page(), and it should print the dropdown with the list of plugins and the check it! button.
  • Use the get_plugins() method to get a list of all the activated plugins, exclude plugin check from it and show it in the dropdown, like below:

Screenshot 2022-11-21 at 7 58 21 PM

Tests Coverage

Automated Tests:

  • Create an Admin_Page_Test class that checks whether the admin_menu filter is registering properly.
  • Checks that the Plugin Check page is registered or not in the global $submenu
  • Checks the output of the render_page() by comparing the output of the plugin's dropdown list.

Manual Tests:

  • Login to the admin area, and find the Plugin Check page available under the Tools menu.
  • Check whether the dropdown with the list of plugins and check it! button is available.
  • Check on the check it button and check if that is clickable or doing any process.

Metadata

Metadata

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