4 Plugin Name: Sample Plugin
6 Plugin URI: https://yoast.com/
7 Description: A sample plugin to test the License Manager
8 Author: Yoast, DvanKooten
9 Author URI: http://yoast.com/
10 Text Domain: sample-plugin
19 public function __construct() {
21 // we only need license stuff inside the admin area
25 add_action( 'admin_menu', array( $this, 'add_license_menu' ) );
28 $this->load_license_manager();
35 * Loads the License_Plugin_Manager class
37 * The class will take care of the rest: notices, license (de)activations, updates, etc..
39 public function load_license_manager() {
41 // Instantiate license class
42 $license_manager = new Yoast_Plugin_License_Manager( new Sample_Product() );
44 // Setup the required hooks
45 $license_manager->setup_hooks();
50 * Add license page and add it to Themes menu
52 public function add_license_menu() {
53 $theme_page = add_options_page( sprintf( __( '%s License', $this->text_domain ), $this->item_name ), sprintf( __( '%s License', $this->text_domain ), $this->item_name ), 'manage_options', $this->text_domain . '-license', array( $this, 'show_license_page' ) );
59 public function show_license_page() {
61 // Instantiate license class
62 $license_manager = new Yoast_Plugin_License_Manager( new Sample_Product() );
66 <?php //settings_errors(); ?>
68 <?php $license_manager->show_license_form( false ); ?>