_setup_freemius();
$this->ui = new AAL_Admin_Ui();
$this->hooks = new AAL_Hooks();
$this->settings = new AAL_Settings();
$this->api = new AAL_API();
$this->notifications = new AAL_Notifications();
$this->help = new AAL_Help();
// set up our DB name
$wpdb->activity_log = $wpdb->prefix . 'aryo_activity_log';
add_action( 'plugins_loaded', array( &$this, 'load_textdomain' ) );
}
/**
* Throw error on object clone
*
* The whole idea of the singleton design pattern is that there is a single
* object therefore, we don't want the object to be cloned.
*
* @since 2.0.7
* @return void
*/
public function __clone() {
// Cloning instances of the class is forbidden
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'aryo-activity-log' ), '2.0.7' );
}
/**
* Disable unserializing of the class
*
* @since 2.0.7
* @return void
*/
public function __wakeup() {
// Unserializing instances of the class is forbidden
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'aryo-activity-log' ), '2.0.7' );
}
/**
* @return AAL_Main
*/
public static function instance() {
if ( is_null( self::$_instance ) )
self::$_instance = new AAL_Main();
return self::$_instance;
}
private function _setup_freemius() {
// Include Freemius SDK.
require_once 'classes/freemius/start.php';
$this->freemius = fs_dynamic_init(
array(
'id' => '111',
'slug' => 'aryo-activity-log',
'public_key' => 'pk_939ce05ca99db10045c0094c6e953',
'is_premium' => false,
'has_paid_plans' => false,
'menu' => array(
'slug' => 'activity_log_page',
'account' => false,
'contact' => false,
'support' => false,
),
)
);
if ( $this->freemius->is_plugin_update() ) {
$this->freemius->add_filter( 'connect_message', array( &$this, '_freemius_custom_connect_message' ), WP_FS__DEFAULT_PRIORITY, 6 );
}
}
public function _freemius_custom_connect_message( $message, $user_first_name, $plugin_title, $user_login, $site_link, $freemius_link ) {
return sprintf(
__(
'Please help us improve %1$s!
If you opt-in, some data about your usage of %1$s will be sent to %2$s.
If you skip this, that\'s okay! %1$s will still work just fine.',
'aryo-activity-log'
),
$this->freemius->get_plugin_name(),
$freemius_link
);
}
}
AAL_Main::instance();