/** * register_addon */ public static function register_addon() { // register addon via Plugin API EE_Register_Addon::register('Promotions', array('version' => EE_PROMOTIONS_VERSION, 'min_core_version' => EE_PROMOTIONS_CORE_VERSION_REQUIRED, 'main_file_path' => EE_PROMOTIONS_PLUGIN_FILE, 'admin_path' => EE_PROMOTIONS_ADMIN, 'plugin_slug' => 'espresso_promotions', 'config_class' => 'EE_Promotions_Config', 'config_name' => 'promotions', 'dms_paths' => array(EE_PROMOTIONS_CORE . 'data_migration_scripts' . DS), 'module_paths' => array(EE_PROMOTIONS_PATH . 'EED_Promotions.module.php'), 'shortcode_paths' => array(EE_PROMOTIONS_PATH . 'EES_Espresso_Promotions.shortcode.php'), 'widget_paths' => array(EE_PROMOTIONS_PATH . 'EEW_Promotions.widget.php'), 'autoloader_paths' => array('EE_Promotions_Config' => EE_PROMOTIONS_PATH . 'EE_Promotions_Config.php', 'Promotions_Admin_Page_Init' => EE_PROMOTIONS_ADMIN . 'Promotions_Admin_Page_Init.core.php', 'Promotions_Admin_Page' => EE_PROMOTIONS_ADMIN . 'Promotions_Admin_Page.core.php', 'Promotions_Admin_List_Table' => EE_PROMOTIONS_ADMIN . 'Promotions_Admin_List_Table.class.php', 'EE_Promotion_Scope' => EE_PROMOTIONS_PATH . 'lib' . DS . 'scopes' . DS . 'EE_Promotion_Scope.lib.php'), 'autoloader_folders' => array('Promotions_Plugin_API' => EE_PROMOTIONS_PATH . 'lib' . DS . 'plugin_api'), 'pue_options' => array('pue_plugin_slug' => 'eea-promotions', 'checkPeriod' => '24', 'use_wp_update' => FALSE), 'model_paths' => array(EE_PROMOTIONS_CORE . 'db_models'), 'class_paths' => array(EE_PROMOTIONS_CORE . 'db_classes'), 'model_extension_paths' => array(EE_PROMOTIONS_CORE . 'db_model_extensions' . DS), 'class_extension_paths' => array(EE_PROMOTIONS_CORE . 'db_class_extensions' . DS), 'capabilities' => array('administrator' => array('ee_read_promotion', 'ee_read_promotions', 'ee_read_others_promotions', 'ee_edit_promotion', 'ee_edit_promotions', 'ee_edit_others_promotions', 'ee_delete_promotion', 'ee_delete_promotions', 'ee_delete_others_promotions')), 'capability_maps' => array(0 => array('EE_Meta_Capability_Map_Read' => array('ee_read_promotion', array('Promotion', '', 'ee_read_others_promotions', ''))), 1 => array('EE_Meta_Capability_Map_Edit' => array('ee_edit_promotion', array('Promotion', '', 'ee_edit_others_promotions', ''))), 2 => array('EE_Meta_Capability_Map_Delete' => array('ee_delete_promotion', array('Promotion', '', 'ee_delete_others_promotions', '')))))); //register promotion specific statuses add_filter('FHEE__EEM_Status__localized_status__translation_array', array('EE_Promotions', 'promotion_stati'), 10); }
public static function register_addon() { // register addon via Plugin API EE_Register_Addon::register('New_Addon', array('version' => EE_NEW_ADDON_VERSION, 'plugin_slug' => 'new_addon', 'min_core_version' => EE_NEW_ADDON_CORE_VERSION_REQUIRED, 'main_file_path' => EE_NEW_ADDON_PLUGIN_FILE, 'admin_path' => EE_NEW_ADDON_ADMIN, 'admin_callback' => '', 'config_class' => 'EE_New_Addon_Config', 'config_name' => 'EE_New_Addon', 'autoloader_paths' => array('EE_New_Addon' => EE_NEW_ADDON_PATH . 'EE_New_Addon.class.php', 'EE_New_Addon_Config' => EE_NEW_ADDON_PATH . 'EE_New_Addon_Config.php', 'New_Addon_Admin_Page' => EE_NEW_ADDON_ADMIN . 'New_Addon_Admin_Page.core.php', 'New_Addon_Admin_Page_Init' => EE_NEW_ADDON_ADMIN . 'New_Addon_Admin_Page_Init.core.php'), 'dms_paths' => array(EE_NEW_ADDON_PATH . 'core' . DS . 'data_migration_scripts' . DS), 'module_paths' => array(EE_NEW_ADDON_PATH . 'EED_New_Addon.module.php'), 'shortcode_paths' => array(EE_NEW_ADDON_PATH . 'EES_New_Addon.shortcode.php'), 'widget_paths' => array(EE_NEW_ADDON_PATH . 'EEW_New_Addon.widget.php'), 'pue_options' => array('pue_plugin_slug' => 'eea-new-addon', 'plugin_basename' => EE_NEW_ADDON_BASENAME, 'checkPeriod' => '24', 'use_wp_update' => FALSE), 'capabilities' => array('administrator' => array('edit_thing', 'edit_things', 'edit_others_things', 'edit_private_things')), 'capability_maps' => array('EE_Meta_Capability_Map_Edit' => array('edit_thing', array('New_Addon_Thing', 'edit_things', 'edit_others_things', 'edit_private_things'))), 'class_paths' => EE_NEW_ADDON_PATH . 'core' . DS . 'db_classes', 'model_paths' => EE_NEW_ADDON_PATH . 'core' . DS . 'db_models', 'class_extension_paths' => EE_NEW_ADDON_PATH . 'core' . DS . 'db_class_extensions', 'model_extension_paths' => EE_NEW_ADDON_PATH . 'core' . DS . 'db_model_extensions', 'custom_post_types' => array(), 'custom_taxonomies' => array(), 'default_terms' => array())); }
public function tearDown() { if (isset($this->_addon_name) && isset(EE_Registry::instance()->addons->EE_New_Addon)) { $main_file_path_before_deregistration = EE_Registry::instance()->addons->EE_New_Addon->get_main_plugin_file_basename(); EE_Register_Addon::deregister($this->_addon_name); try { EE_Registry::instance()->addons->EE_New_Addon; $this->fail('EE_New_Addon is still registered. Deregister failed'); } catch (PHPUnit_Framework_Error_Notice $e) { $this->assertEquals(EE_UnitTestCase::error_code_undefined_property, $e->getCode()); } //verify the deactvation hook was removed $this->assertFalse(has_action('deactivate_' . $main_file_path_before_deregistration)); //verify the models were deregistered EE_System::instance()->load_core_configuration(); $this->assertArrayDoesNotContain('EEM_New_Addon_Thing', EE_Registry::instance()->non_abstract_db_models); $this->assertArrayDoesNotContain('EEM_New_Addon_Thing', EE_Registry::instance()->models); EE_Registry::instance()->reset_model('Attendee'); //verify that the model and class extensions have been removed $this->assertFalse($this->_class_has_been_extended()); $this->assertFalse($this->_model_has_been_extended()); } //verify DMSs deregistered $DMSs_available = EE_Data_Migration_Manager::reset()->get_all_data_migration_scripts_available(); $this->assertArrayNotHasKey('EE_DMS_New_Addon_1_0_0', $DMSs_available); $this->_stop_pretending_addon_hook_time(); $this->_stop_pretending_after_plugin_activation(); remove_all_filters('AHEE__EE_System__load_espresso_addons'); parent::tearDown(); }
public static function register_addon() { // register addon via Plugin API EE_Register_Addon::register('People', array('version' => EEA_PEOPLE_ADDON_VERSION, 'min_core_version' => '4.5.0.dev.000', 'main_file_path' => EEA_PEOPLE_ADDON_PLUGIN_FILE, 'admin_path' => EEA_PEOPLE_ADDON_ADMIN, 'admin_callback' => 'additional_admin_hooks', 'config_class' => 'EE_People_Config', 'config_name' => 'EE_People', 'autoloader_paths' => array('EE_People' => EEA_PEOPLE_ADDON_PATH . 'EE_People.class.php', 'EE_People_Config' => EEA_PEOPLE_ADDON_PATH . 'EE_People_Config.php', 'People_Admin_Page' => EEA_PEOPLE_ADDON_ADMIN . 'People_Admin_Page.core.php', 'People_Admin_Page_Init' => EEA_PEOPLE_ADDON_ADMIN . 'People_Admin_Page_Init.core.php'), 'dms_paths' => array(EEA_PEOPLE_ADDON_PATH . 'core' . DS . 'data_migration_scripts' . DS), 'module_paths' => array(EEA_PEOPLE_ADDON_PATH . 'EED_People_Single.module.php', EEA_PEOPLE_ADDON_PATH . 'EED_People_Event_Template_Parts.module.php'), 'pue_options' => array('pue_plugin_slug' => 'eea-people-addon', 'plugin_basename' => EEA_PEOPLE_ADDON_BASENAME, 'checkPeriod' => '24', 'use_wp_update' => FALSE), 'capabilities' => array('administrator' => array('ee_edit_people', 'ee_read_people', 'ee_read_peoples', 'ee_read_others_peoples', 'ee_delete_people', 'ee_edit_peoples', 'ee_edit_others_peoples', 'ee_publish_peoples', 'ee_read_private_peoples', 'ee_delete_peoples', 'ee_delete_private_peoples', 'ee_delete_published_peoples', 'ee_delete_others_peoples', 'ee_edit_private_peoples', 'ee_edit_published_peoples', 'ee_manage_people_types', 'ee_edit_people_type', 'ee_delete_people_type', 'ee_assign_people_type', 'ee_manage_people_categories', 'ee_edit_people_category', 'ee_delete_people_category', 'ee_assign_people_category')), 'capability_maps' => array('EE_Meta_Capability_Map_Edit' => array('ee_edit_people', array('Person', 'ee_edit_published_peoples', 'ee_edit_others_peoples', 'ee_edit_private_peoples')), 'EE_Meta_Capability_Map_Read' => array('ee_read_people', array('Person', '', 'ee_read_others_peoples', 'ee_read_private_peoples')), 'EE_Meta_Capability_Map_Delete' => array('ee_delete_people', array('Person', 'ee_delete_published_peoples', 'ee_delete_others_peoples', 'ee_delete_private_peoples'))), 'class_paths' => EEA_PEOPLE_ADDON_PATH . 'core' . DS . 'db_classes', 'model_paths' => EEA_PEOPLE_ADDON_PATH . 'core' . DS . 'db_models', 'model_extension_paths' => EEA_PEOPLE_ADDON_PATH . 'core' . DS . 'db_model_extensions', 'custom_post_types' => array('espresso_people' => array('singular_name' => __('Person', 'event_espresso'), 'plural_name' => __('People', 'event_espresso'), 'singular_slug' => __('person', 'event_espresso'), 'plural_slug' => __('people', 'event_espresso'), 'class_name' => 'EE_Person', 'args' => array('public' => true, 'show_in_nav_menus' => true, 'capability_type' => 'people', 'capabilities' => array('edit_post' => 'ee_edit_people', 'read_post' => 'ee_read_people', 'delete_post' => 'ee_delete_people', 'edit_posts' => 'ee_edit_peoples', 'edit_others_posts' => 'ee_edit_others_peoples', 'publish_posts' => 'ee_publish_peoples', 'read_private_posts' => 'ee_read_private_peoples', 'delete_posts' => 'ee_delete_peoples', 'delete_private_posts' => 'ee_delete_private_peoples', 'delete_published_posts' => 'ee_delete_published_peoples', 'delete_others_posts' => 'ee_delete_others_peoples', 'edit_private_posts' => 'ee_edit_private_peoples', 'edit_published_posts' => 'ee_edit_published_peoples'), 'taxonomies' => array('espresso_people_type', 'espresso_people_categories'), 'supports' => array('title', 'editor', 'thumbnail', 'excerpt', 'custom-fields', 'comments')))), 'custom_taxonomies' => array('espresso_people_type' => array('singular_name' => __('People Type', 'event_espresso'), 'plural_name' => __('People Types', 'event_espresso'), 'args' => array('public' => true, 'show_in_nav_menus' => true, 'labels' => array('name' => __('People Types', 'event_espresso'), 'singular_name' => __('People Type', 'event_espresso'), 'add_new_item' => __('Add New People Type', 'event_espresso'), 'new_item_name' => __('New People Type Name', 'event_espresso'), 'parent_item' => __('Parent People Type', 'event_espresso'), 'parent_item_colon' => __('Parent People Type:', 'event_espresso')), 'capabilities' => array('manage_terms' => 'ee_manage_people_types', 'edit_terms' => 'ee_edit_people_type', 'delete_terms' => 'ee_delete_people_type', 'assign_terms' => 'ee_assign_people_type'), 'meta_box_cb' => array(__CLASS__, 'people_type_metabox_content'), 'rewrite' => array('slug' => __('people-type', 'event_espresso')))), 'espresso_people_categories' => array('singular_name' => __('People Category', 'event_espresso'), 'plural_name' => __('People Categories', 'event_espresso'), 'args' => array('public' => true, 'show_in_nav_menus' => true, 'capabilities' => array('manage_terms' => 'ee_manage_people_categories', 'edit_terms' => 'ee_edit_people_category', 'delete_terms' => 'ee_delete_people_category', 'assign_terms' => 'ee_assign_people_category'), 'rewrite' => array('slug' => __('people-category', 'event_espresso'))))))); }
public function deactivation() { $classname = get_class($this); // echo "Deactivating $classname";die; do_action("AHEE__{$classname}__deactivation"); do_action("AHEE__EE_Addon__deactivation", $this); //check if the site no longer needs to be in maintenance mode EE_Register_Addon::deregister($this->name()); EE_Maintenance_Mode::instance()->set_maintenance_mode_if_db_old(); }
/** * register_addon */ public static function register_addon() { // register addon via Plugin API EE_Register_Addon::register('Multi_Event_Registration', array('version' => EE_MER_VERSION, 'min_core_version' => EE_MER_CORE_VERSION_REQUIRED, 'main_file_path' => EE_MER_PLUGIN_FILE, 'plugin_slug' => 'espresso_multi_event_registration', 'config_class' => 'EE_Multi_Event_Registration_Config', 'config_name' => 'multi_event_registration', 'module_paths' => array(EE_MER_PATH . 'EED_Multi_Event_Registration.module.php'), 'widget_paths' => array(EE_MER_PATH . 'EEW_Mini_Cart.widget.php'), 'autoloader_paths' => array('EE_Multi_Event_Registration_Config' => EE_MER_PATH . 'EE_Multi_Event_Registration_Config.php', 'EE_Event_Cart_Line_Item_Display_Strategy' => EE_MER_PATH . 'EE_Event_Cart_Line_Item_Display_Strategy.php', 'EE_Mini_Cart_Table_Line_Item_Display_Strategy' => EE_MER_PATH . 'EE_Mini_Cart_Table_Line_Item_Display_Strategy.php', 'EE_MER_Transactions_Admin' => EE_MER_PATH . 'EE_MER_Transactions_Admin.class.php', 'EE_MER_Events_Admin' => EE_MER_PATH . 'EE_MER_Events_Admin.class.php'), 'pue_options' => array('pue_plugin_slug' => 'eea-multi-event-registration', 'checkPeriod' => '24', 'use_wp_update' => FALSE))); }
/** * Register addon * * @see https://github.com/eventespresso/event-espresso-core/blob/4.6.16.p/tests/mocks/addons/new-payment-method/espresso-new-payment-method.php#L45 * @see https://github.com/eventespresso/event-espresso-core/blob/4.6.16.p/tests/mocks/addons/new-payment-method/EE_New_Payment_Method.class.php#L26-L46 */ public static function register_addon() { EE_Register_Addon::register('pronamic_pay', array('version' => '1.0.0', 'min_core_version' => '4.6.0', 'main_file_path' => dirname(__FILE__) . '/ee/EE_Pronamic_WP_Pay_AddOn.php', 'class_name' => 'EE_Pronamic_WP_Pay_AddOn', 'payment_method_paths' => array(dirname(__FILE__) . '/ee/payment-methods/Pronamic'))); }
public function tearDown() { //if somehow $this->_addon isn't set, we don't need to worry about deregistering it right? if ($this->_addon instanceof EE_Addon) { update_option($this->_addon->get_activation_history_option_name(), $this->_addon_activation_history); update_option(EE_Data_Migration_Manager::current_database_state, $this->_current_db_state); EE_Register_Addon::deregister($this->_addon_name); try { EE_Registry::instance()->addons->EE_New_Addon; $this->fail('EE_New_Addon is still registered. Deregister failed'); } catch (PHPUnit_Framework_Error_Notice $e) { $this->assertEquals(EE_UnitTestCase::error_code_undefined_property, $e->getCode()); } //verify DMSs deregistered $DMSs_available = EE_Data_Migration_Manager::reset()->get_all_data_migration_scripts_available(); $this->assertArrayNotHasKey('EE_DMS_New_Addon_1_0_0', $DMSs_available); $this->_stop_pretending_addon_hook_time(); } parent::tearDown(); }
public static function register_addon() { // register addon via Plugin API EE_Register_Addon::register('New_Payment_Method', array('version' => EE_NEW_PAYMENT_METHOD_VERSION, 'min_core_version' => '4.6.0.dev.000', 'main_file_path' => EE_NEW_PAYMENT_METHOD_PLUGIN_FILE, 'pue_options' => array('pue_plugin_slug' => 'espresso_new_payment_method', 'plugin_basename' => EE_NEW_PAYMENT_METHOD_BASENAME, 'checkPeriod' => '24', 'use_wp_update' => FALSE), 'payment_method_paths' => array(EE_NEW_PAYMENT_METHOD_PATH . 'payment_methods' . DS . 'New_Payment_Method_Onsite', EE_NEW_PAYMENT_METHOD_PATH . 'payment_methods' . DS . 'New_Payment_Method_Offsite'))); }
public static function register_addon() { // register addon via Plugin API EE_Register_Addon::register('Grid_Template', array('version' => EE_GRID_TEMPLATE_VERSION, 'min_core_version' => '4.4.9.rc.034', 'base_path' => EE_GRID_TEMPLATE_PATH, 'main_file_path' => EE_GRID_TEMPLATE_PATH . 'espresso-grid-template.php', 'autoloader_paths' => array('EE_Grid_Template' => EE_GRID_TEMPLATE_PATH . 'EE_Grid_Template.class.php'), 'shortcode_paths' => array(EE_GRID_TEMPLATE_PATH . 'EES_Espresso_Grid_Template.shortcode.php'), 'pue_options' => array('pue_plugin_slug' => 'eea-events-grid-view-template', 'plugin_basename' => EE_GRID_TEMPLATE_PLUGIN_FILE, 'checkPeriod' => '24', 'use_wp_update' => FALSE))); }
public static function register_addon() { // register addon via Plugin API EE_Register_Addon::register('Chase_Orbital', array('version' => EE_CHASE_ORBITAL_VERSION, 'min_core_version' => '4.6.0.dev.000', 'main_file_path' => EE_CHASE_ORBITAL_PLUGIN_FILE, 'pue_options' => array('pue_plugin_slug' => 'espresso_chase_orbital', 'plugin_basename' => EE_CHASE_ORBITAL_BASENAME, 'checkPeriod' => '24', 'use_wp_update' => FALSE), 'payment_method_paths' => array(EE_CHASE_ORBITAL_PATH . 'payment_methods' . DS . 'Chase_Orbital'))); }
/** * Register this add-on with EE. * * @return void */ public static function register_addon() { // Register addon via EE Plugin API. EE_Register_Addon::register('Payflow_Pro_Gateway', array('version' => EEA_PAYFLOW_PRO_VERSION, 'min_core_version' => '4.6.0.p', 'main_file_path' => EEA_PAYFLOW_PRO_PLUGIN_FILE, 'admin_callback' => 'additional_payflow_pro_admin_hooks', 'autoloader_paths' => array('EE_PMT_Base' => EE_LIBRARIES . 'payment_methods' . DS . 'EE_PMT_Base.lib.php', 'EE_PMT_PayFlow_Pro_Onsite' => EEA_PAYFLOW_PRO_PLUGIN_PATH . 'payment_methods' . DS . 'Payflow_Pro_Onsite' . DS . 'EE_PMT_Payflow_Pro_Onsite.pm.php'), 'pue_options' => array('pue_plugin_slug' => 'eea-payflow-pro-gateway', 'plugin_basename' => EEA_PAYFLOW_PRO_PLUGIN_BASENAME, 'checkPeriod' => '24', 'use_wp_update' => FALSE), 'payment_method_paths' => array(EEA_PAYFLOW_PRO_PLUGIN_PATH . 'payment_methods' . DS . 'Payflow_Pro_Onsite'))); }
/** * register_addon */ public static function register_addon() { // define the plugin directory path and URL // register addon via Plugin API EE_Register_Addon::register('Calendar', array('version' => EE_CALENDAR_VERSION, 'min_core_version' => '4.3.0', 'main_file_path' => EE_CALENDAR_PLUGIN_FILE, 'admin_path' => EE_CALENDAR_ADMIN . 'calendar' . DS, 'admin_callback' => 'additional_admin_hooks', 'config_class' => 'EE_Calendar_Config', 'config_name' => 'EE_Calendar', 'autoloader_paths' => array('EE_Calendar' => EE_CALENDAR_PATH . 'EE_Calendar.class.php', 'EE_Calendar_Config' => EE_CALENDAR_PATH . 'EE_Calendar_Config.php', 'EE_Datetime_In_Calendar' => EE_CALENDAR_PATH . 'EE_Datetime_In_Calendar.class.php', 'Calendar_Admin_Page' => EE_CALENDAR_ADMIN . 'calendar' . DS . 'Calendar_Admin_Page.core.php', 'Calendar_Admin_Page_Init' => EE_CALENDAR_ADMIN . 'calendar' . DS . 'Calendar_Admin_Page_Init.core.php'), 'dms_paths' => array(EE_CALENDAR_DMS_PATH), 'module_paths' => array(EE_CALENDAR_PATH . 'EED_Espresso_Calendar.module.php'), 'shortcode_paths' => array(EE_CALENDAR_PATH . 'EES_Espresso_Calendar.shortcode.php'), 'widget_paths' => array(EE_CALENDAR_PATH . 'EEW_Espresso_Calendar.widget.php'), 'pue_options' => array('pue_plugin_slug' => 'ee4-events-calendar', 'checkPeriod' => '24', 'use_wp_update' => FALSE))); }