includes(); $instance->setup_actions(); } return $instance; } /** * Constructor method. * * @since 1.0.0 * @access public * @return void */ private function __construct() {} /** * Loads settings files. * * @since 2.0.0 * @access private * @return void */ private function includes() { // Include the settings functions. require_once( members_plugin()->dir . 'admin/functions-settings.php' ); // Load settings view classes. require_once( members_plugin()->dir . 'admin/views/class-view.php' ); require_once( members_plugin()->dir . 'admin/views/class-view-general.php' ); require_once( members_plugin()->dir . 'admin/views/class-view-addons.php' ); } /** * Sets up initial actions. * * @since 2.0.0 * @access private * @return void */ private function setup_actions() { add_action( 'admin_menu', array( $this, 'admin_menu' ), 25 ); add_action( 'wp_ajax_mbrs_toggle_addon', array( $this, 'toggle_addon' ) ); } /** * AJAX call to toggle an addon off and on * * @return void */ public function toggle_addon() { if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'mbrs_toggle_addon' ) ) { die(); } if ( ! current_user_can( 'manage_options' ) ) { wp_send_json_error( array( 'msg' => esc_html__( 'You are not allowed to make these changes.', 'members' ) ) ); } $addon = ! empty( $_POST['addon'] ) ? sanitize_text_field( $_POST['addon'] ) : false; if ( false === $addon ) { wp_send_json_error( array( 'msg' => esc_html__( 'No add-on provided.', 'members' ) ) ); } // Grab the currently active add-ons $active_addons = get_option( 'members_active_addons', array() ); if ( ! in_array( $addon, $active_addons ) ) { // Activate the addon $active_addons[] = $addon; $response = array( 'status' => 'active', 'action_label' => esc_html__( 'Active', 'members' ), 'msg' => esc_html__( 'Add-on activated', 'members' ) ); // Run the add-on's activation hook members_plugin()->run_addon_activator( $addon ); } else { // Deactivate the addon $key = array_search( $addon, $active_addons ); unset( $active_addons[$key] ); $response = array( 'status' => 'inactive', 'action_label' => esc_html__( 'Activate', 'members' ), 'msg' => esc_html__( 'Add-on deactivated', 'members' ) ); } update_option( 'members_active_addons', $active_addons ); wp_send_json_success( $response ); } /** * Register a view. * * @since 2.0.0 * @access public * @param object $view * @return void */ public function register_view( $view ) { if ( ! $this->view_exists( $view->name ) ) $this->views[ $view->name ] = $view; } /** * Unregister a view. * * @since 2.0.0 * @access public * @param string $name * @return void */ public function unregister_view( $name ) { if ( $this->view_exists( $name ) ) unset( $this->views[ $name ] ); } /** * Get a view object * * @since 2.0.0 * @access public * @param string $name * @return object */ public function get_view( $name ) { return $this->view_exists( $name ) ? $this->views[ $name ] : false; } /** * Check if a view exists. * * @since 2.0.0 * @access public * @param string $name * @return bool */ public function view_exists( $name ) { return isset( $this->views[ $name ] ); } /** * Sets up custom admin menus. * * @since 1.0.0 * @access public * @return void */ public function admin_menu() { // Create the settings pages. $this->admin_pages = array( 'toplevel_page_members', 'members_page_roles' ); $this->settings_page = add_submenu_page( 'members', esc_html_x( 'Settings', 'admin screen', 'members' ), esc_html_x( 'Settings', 'admin screen', 'members' ), apply_filters( 'members_settings_capability', 'manage_options' ), 'members-settings', array( $this, 'settings_page' ) ); $this->admin_pages[] = $this->settings_page; $this->addons_page = add_submenu_page( 'members', esc_html_x( 'Add-Ons', 'admin screen', 'members' ), _x( 'Add-Ons', 'admin screen', 'members' ), apply_filters( 'members_settings_capability', 'manage_options' ), 'members-settings&view=add-ons', array( $this, 'settings_page' ) ); $this->admin_pages[] = $this->addons_page; if ( ! members_is_memberpress_active() ) { // MemberPress not active $this->payments_page = add_submenu_page( 'members', esc_html_x( 'Payments', 'admin screen', 'members' ), esc_html_x( 'Payments', 'admin screen', 'members' ), apply_filters( 'members_settings_capability', 'manage_options' ), 'members-payments', array( $this, 'payments_page' ) ); $this->admin_pages[] = $this->payments_page; } $this->about_page = add_submenu_page( 'members', esc_html_x( 'About Us', 'admin screen', 'members' ), esc_html_x( 'About Us', 'admin screen', 'members' ), apply_filters( 'members_settings_capability', 'manage_options' ), 'members-about', array( $this, 'about_page' ) ); $this->admin_pages[] = $this->about_page; if ( $this->settings_page ) { do_action( 'members_register_settings_views', $this ); uasort( $this->views, 'members_priority_sort' ); // Register setings. add_action( 'admin_init', array( $this, 'register_settings' ) ); // Page load callback. add_action( "load-{$this->settings_page}", array( $this, 'load' ) ); // Enqueue scripts/styles. add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) ); } } /** * Runs on page load. * * @since 2.0.0 * @access public * @return void */ public function load() { // Print custom styles. add_action( 'admin_head', array( $this, 'print_styles' ) ); // Add help tabs for the current view. $view = $this->get_view( members_get_current_settings_view() ); if ( $view ) { $view->load(); $view->add_help_tabs(); } } /** * Print styles to the header. * * @since 2.0.0 * @access public * @return void */ public function print_styles() { ?> get_view( members_get_current_settings_view() ); wp_enqueue_style( 'members-admin' ); if ( $view ) $view->enqueue(); } /** * Registers the plugin settings. * * @since 1.0.0 * @access public * @return void */ function register_settings() { foreach ( $this->views as $view ) $view->register_settings(); } /** * Renders the settings page. * * @since 1.0.0 * @access public * @return void */ public function settings_page() { ?>

filter_links(); ?>
get_view( members_get_current_settings_view() )->template(); ?>

Id Transaction Subscription Status Membership Net Tax Total Name User Gateway Created On Expires On
1 1 None Your Membership $20.00 $0.00 $20.00 Your Customer Payment Method January 27, 2020 Never
2 2 None Your Membership $20.00 $0.00 $20.00 Your Customer Payment Method January 27, 2020 Never
3 3 None Your Membership $20.00 $0.00 $20.00 Your Customer Payment Method January 27, 2020 Never
4 4 None Your Membership $20.00 $0.00 $20.00 Your Customer Payment Method January 27, 2020 Never
5 5 None Your Membership $20.00 $0.00 $20.00 Your Customer Payment Method January 27, 2020 Never
6 6 None Your Membership $20.00 $0.00 $20.00 Your Customer Payment Method January 27, 2020 Never
7 7 None Your Membership $20.00 $0.00 $20.00 Your Customer Payment Method January 27, 2020 Never
8 8 None Your Membership $20.00 $0.00 $20.00 Your Customer Payment Method January 27, 2020 Never
9 9 None Your Membership $20.00 $0.00 $20.00 Your Customer Payment Method January 27, 2020 Never
10 10 None Your Membership $20.00 $0.00 $20.00 Your Customer Payment Method January 27, 2020 Never
'memberpress', 'name' => 'MemberPress', 'icon' => 'mp-icon-RGB.jpg', 'description' => 'Build astounding WordPress membership sites, accept payments securely, and control who sees your content — without the difficult setup.', 'plugin_file' => 'memberpress/memberpress.php', 'is_active' => members_is_memberpress_active(), 'url_title' => 'https://memberpress.com/?utm_source=members_plugin&utm_medium=link&utm_campaign=about_us&utm_content=memberpress_icon_title', 'url_learn' => 'https://memberpress.com/?utm_source=members_plugin&utm_medium=link&utm_campaign=about_us&utm_content=memberpress_learn_more', 'url_install' => 'https://memberpress.com/?utm_source=members_plugin&utm_medium=link&utm_campaign=about_us&utm_content=memberpress_install', ), array( 'slug' => 'pretty-links', 'name' => 'Pretty Links', 'icon' => 'pl-icon-RGB.jpg', 'description' => 'Monetize your content effortlessly. Pretty Links helps you unlock more affiliate revenue from the content you already have.', 'plugin_file' => 'pretty-link/pretty-link.php', 'is_active' => is_plugin_active( 'pretty-link/pretty-link.php' ), 'url_title' => 'https://prettylinks.com/?utm_source=members_plugin&utm_medium=link&utm_campaign=about_us&utm_content=prettylinks_icon_title', 'url_learn' => 'https://prettylinks.com/?utm_source=members_plugin&utm_medium=link&utm_campaign=about_us&utm_content=prettylinks_learn_more', 'url_install' => 'https://prettylinks.com/?utm_source=members_plugin&utm_medium=link&utm_campaign=about_us&utm_content=prettylinks_install', ), array( 'slug' => 'easy-affiliate', 'name' => 'Easy Affiliate', 'icon' => 'bee.png', 'description' => 'A full-featured affiliate program plugin for WordPress. Launch your own program to drive traffic, attention, and sales.', 'plugin_file' => 'affiliate-royale/affiliate-royale.php', 'is_active' => is_plugin_active( 'affiliate-royale/affiliate-royale.php' ), 'url_title' => 'https://easyaffiliate.com/?utm_source=members_plugin&utm_medium=link&utm_campaign=about_us&utm_content=easyaffiliate_icon_title', 'url_learn' => 'https://easyaffiliate.com/?utm_source=members_plugin&utm_medium=link&utm_campaign=about_us&utm_content=easyaffiliate_learn_more', 'url_install' => 'https://easyaffiliate.com/?utm_source=members_plugin&utm_medium=link&utm_campaign=about_us&utm_content=easyaffiliate_install', ), ); $plugin_uri = members_plugin()->uri; ?>

About ·

Hello & welcome
to Members.

The simplest WordPress membership and role editor plugin — built by the team at MemberPress.

Over the years we found that most WordPress membership plugins were bloated, buggy, slow, hard to use — and expensive. So we started with a simple goal: build a plugin that's both easy and powerful.

Our goal is to take the pain out of creating membership sites and make it easy.

Members is brought to you by the same team behind MemberPress, Easy Affiliate, and Pretty Links.

So — you can see we know a thing or two about building products that customers love.

From our team