If you want a frontend page you’ll have to create one with your plugin’s shortcode as the content. Then you display your plugin’s output in-place of that shortcode:
/*
Plugin Name: WPSE67438 Page plugin
*/
class wpse67438_plugin {
const PAGE_TITLE = 'WPSE67438'; //set the page title here.
const SHORTCODE = 'WPSE67438'; //set custom shortcode here.
function __construct() {
register_activation_hook( __FILE__, array( $this, 'install' ) );
add_shortcode( self::SHORTCODE, array( $this, 'display' ) );
}
public function install() {
if( ! get_option( 'wpse67438_install' ) ) {
wp_insert_post( array(
'post_type' => 'page',
'post_title' => self::PAGE_TITLE,
'post_content' => '[' . self::SHORTCODE . ']',
'post_status' => 'publish',
'post_author' => 1
)
);
update_option( 'wpse67438_install', 1 );
}
}
public function display( $content ) {
$my_plugin_output = "Hello World!"; //replace with plugin's output
return $content . $my_plugin_output;
}
}
new wpse67438_plugin();