'; $message .= ''; $message .= esc_html__( 'Important', 'groups' ); $message .= ''; $message .= ' '; $message .= esc_html__( 'It seems that you have updated from Groups 1.x where access restrictions were based on capabilities.', 'groups' ); $message .= '

'; $message .= '

'; $message .= sprintf( /* translators: 1: opening tag 2: closing tag */ esc_html__( 'Please make sure to read the %1$sMigration Guide%2$s.', 'groups' ), '', '' ); $message .= '

'; wp_admin_notice( $message, array( 'type' => 'info', 'dismissible' => true, 'additional_classes' => array( 'inline', 'notice-alt' ), 'attributes' => array( 'data-slug' => 'plugin-slug' ) ) ); } } /** * Checks if the welcome screen should be shown and redirected to. */ public static function admin_init() { global $groups_version; if ( Groups_User::current_user_can( GROUPS_ACCESS_GROUPS ) && isset( $_GET['groups-welcome-dismiss'] ) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended isset( $_GET['_groups_welcome_nonce'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended ) { if ( groups_verify_get_nonce( '_groups_welcome_nonce', 'groups_welcome_dismiss' ) ) { Groups_Options::update_user_option( 'groups-welcome-dismiss', $groups_version ); } } $groups_welcome_dismiss = Groups_Options::get_user_option( 'groups-welcome-dismiss', '' ); if ( version_compare( $groups_version, $groups_welcome_dismiss ) > 0 ) { // @see Groups_Controller::activate() if ( get_transient( 'groups_plugin_activated' ) ) { $doing_ajax = wp_doing_ajax(); $doing_cron = wp_doing_cron(); // we'll delete the transients in the welcome screen handler if ( !$doing_ajax && !$doing_cron && ( empty( $_GET['page'] ) || groups_sanitize_get( 'page' ) !== 'groups-welcome' ) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended !is_network_admin() && Groups_User::current_user_can( GROUPS_ACCESS_GROUPS ) && apply_filters( 'groups_welcome_show', true ) ) { wp_safe_redirect( admin_url( 'index.php?page=groups-welcome' ) ); exit; } else { // @since 3.3.1 remove the transient as we don't want to trigger a redirect in any other case than direct activation of the Groups plugin delete_transient( 'groups_plugin_activated' ); } } } } /** * Adds an entry leading to the welcome screen. * * @param array $links * @param string $file plugin file basename * @return array */ public static function plugin_row_meta( $links, $file ) { if ( $file == plugin_basename( GROUPS_FILE ) ) { $row_meta = array( 'welcome' => sprintf( '%s', esc_url( admin_url( 'index.php?page=groups-welcome' ) ), esc_attr__( 'View the Welcome screen for this version of Groups', 'groups' ), esc_html__( 'Welcome', 'groups' ) ) ); return array_merge( $links, $row_meta ); } return (array) $links; } /** * Renders the welcome screen. */ public static function groups_welcome() { global $groups_version; wp_enqueue_style( 'groups_admin' ); delete_transient( 'groups_plugin_activated' ); // As of Groups 3.3.1 this transient does not trigger a redirect to the welcome screen. // Instead, an admin notice pointing to the migration guide is displayed for as long as the transient has not expired. // We still delete the transient here as we are displaying the welcome screen, and the notice will be visible on top of it. delete_transient( 'groups_plugin_updated_legacy' ); echo '
'; echo '
'; echo '
'; printf( '', esc_attr( GROUPS_PLUGIN_URL . 'images/groups-256x256.png' ) ); echo '

'; /* translators: version number */ printf( esc_html__( 'Welcome to Groups %s', 'groups' ), esc_html( $groups_version ) ); echo '

'; printf( '', esc_url( wp_nonce_url( add_query_arg( 'groups-welcome-dismiss', '1', admin_url() ), 'groups_welcome_dismiss', '_groups_welcome_nonce' ) ), esc_attr__( 'Dismiss', 'groups' ), esc_html__( 'Dismiss', 'groups' ) ); echo '

'; esc_html_e( 'Thanks for using Groups! We have made it even easier to protect your content and hope you like it :)', 'groups' ); echo '

'; echo '

'; esc_html_e( "What's New?", 'groups' ); echo '

'; echo '

'; esc_html_e( 'Protect Content Easily', 'groups' ); echo '

'; echo '

'; esc_html_e( 'We have made it even easier to protect your content!', 'groups' ); echo ' '; esc_html_e( 'Now you can protect your posts, pages and any other custom post type like products or events by simply assigning them to one or more groups.', 'groups' ); echo '

'; echo '

'; esc_html_e( 'Efficient User Interface', 'groups' ); echo '

'; echo '

'; esc_html_e( 'Manage groups and users with a minimal footprint on the administrative screens.', 'groups' ); echo '

'; echo '

'; esc_html_e( 'Documentation', 'groups' ); echo '

'; echo '

'; printf( /* translators: 1: opening tag, 2: closing tag */ esc_html__( 'Whether you are new to Groups or have been using it before, please make sure to visit the %1$sDocumentation%2$s pages to know more about how to use it.', 'groups' ), '', '' ); echo '

'; echo '
'; // .groups-welcome-panel-description echo '

'; esc_html_e( 'Add-Ons', 'groups' ); echo '

'; echo '

'; esc_html_e( 'Perfect complements to memberships and access control with Groups.', 'groups' ); echo '

'; echo '
'; groups_admin_add_ons_content( array( 'offset' => 1 ) ); echo '
'; // .groups-admin-add-ons echo '
'; // .groups-welcome-panel-content echo '
'; // .groups-welcome-panel } } Groups_Admin_Welcome::init();