Force CSS and JS loading of plugin only where needed

is_admin() is useful for the front end.

The load-$pagenow hook and a few others are useful on the backend. wp-admin/admin-header.php, for instance, contains:

do_action('admin_enqueue_scripts', $hook_suffix);
do_action("admin_print_styles-$hook_suffix");
do_action('admin_print_styles');
do_action("admin_print_scripts-$hook_suffix");
do_action('admin_print_scripts');
do_action("admin_head-$hook_suffix");
do_action('admin_head');

Note the $hook_suffix variable, which you can var_dump() then and there to know what its value is when your plugin’s page is being loaded.

tech