a8c_data = $this->fetch_a8c_data(); } /** * Enqueues scripts and styles for the admin page. */ public function page_admin_scripts() { wp_enqueue_style( 'plugin-install' ); wp_enqueue_script( 'plugin-install' ); // required for plugin modal action button functionality. wp_enqueue_script( 'updates' ); // required for modal popup JS and styling. wp_enqueue_style( 'thickbox' ); wp_enqueue_script( 'thickbox' ); } /** * Load styles for static page. */ public function additional_styles() { Jetpack_Admin_Page::load_wrapper_styles(); } /** * Render the page with a common top and bottom part, and page specific content */ public function render() { Jetpack_Admin_Page::wrap_ui( array( $this, 'page_render' ), array( 'show-nav' => false ) ); } /** * Render the page content */ public function page_render() { ?>
    display_gravatars(); ?>

a8c_data['a12s'], $this->a8c_data['countries'], $this->a8c_data['languages'] ) ); ?>

Automattic Creed.', 'jetpack' ), array( 'a' => array( 'href' => array(), 'class' => array(), 'target' => array(), 'rel' => array(), 'data-jptracks-name' => array(), ), ) ); ?>

take a look at our WordPress.org profile.', 'jetpack' ), array( 'a' => array( 'href' => array(), 'target' => array(), 'rel' => array(), 'class' => array(), 'data-jptracks-name' => array(), ), ) ); ?>

array( 'href' => array(), 'title' => array(), 'target' => array(), ), 'abbr' => array( 'title' => array() ), 'acronym' => array( 'title' => array() ), 'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(), 'ul' => array(), 'ol' => array(), 'li' => array(), 'p' => array(), 'br' => array(), ); // slugs for plugins we want to display. $a8c_plugins = $this->a8c_data['featured_plugins']; // need this to access the plugins_api() function. include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; $plugins = array(); foreach ( $a8c_plugins as $slug ) { $args = array( 'slug' => $slug, 'fields' => array( 'added' => false, 'author' => false, 'author_profile' => false, 'banners' => false, 'contributors' => false, 'donate_link' => false, 'homepage' => false, 'reviews' => false, 'screenshots' => false, 'support_threads' => false, 'support_threads_resolved' => false, 'sections' => false, 'tags' => false, 'versions' => false, 'compatibility' => true, 'downloaded' => true, 'downloadlink' => true, 'icons' => true, 'last_updated' => true, 'num_ratings' => true, 'rating' => true, 'requires' => true, 'requires_php' => true, 'short_description' => true, 'tested' => true, ), ); // should probably add some error checking here too. $api = plugins_api( 'plugin_information', $args ); $plugins[] = $api; } foreach ( $plugins as $plugin ) { if ( is_object( $plugin ) ) { $plugin = (array) $plugin; } $title = wp_kses( $plugin['name'], $plugins_allowedtags ); $version = wp_kses( $plugin['version'], $plugins_allowedtags ); $name = wp_strip_all_tags( $title . ' ' . $version ); // Remove any HTML from the description. $description = wp_strip_all_tags( $plugin['short_description'] ); $wp_version = get_bloginfo( 'version' ); $compatible_php = ( empty( $plugin['requires_php'] ) || version_compare( phpversion(), $plugin['requires_php'], '>=' ) ); $compatible_wp = ( empty( $plugin['requires'] ) || version_compare( $wp_version, $plugin['requires'], '>=' ) ); $action_links = array(); // install button. if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) { $status = install_plugin_install_status( $plugin ); switch ( $status['status'] ) { case 'install': if ( $status['url'] ) { if ( $compatible_php && $compatible_wp ) { $action_links[] = sprintf( '%5$s', esc_attr( $plugin['slug'] ), esc_url( $status['url'] ), /* translators: %s: plugin name and version */ esc_attr( sprintf( __( 'Install %s now', 'jetpack' ), $name ) ), esc_attr( $name ), esc_html__( 'Install Now', 'jetpack' ) ); } else { $action_links[] = sprintf( '', _x( 'Cannot Install', 'plugin', 'jetpack' ) ); } } break; case 'update_available': if ( $status['url'] ) { $action_links[] = sprintf( '%6$s', esc_attr( $status['file'] ), esc_attr( $plugin['slug'] ), esc_url( $status['url'] ), /* translators: %s: plugin name and version */ esc_attr( sprintf( __( 'Update %s now', 'jetpack' ), $name ) ), esc_attr( $name ), __( 'Update Now', 'jetpack' ) ); } break; case 'latest_installed': case 'newer_installed': if ( is_plugin_active( $status['file'] ) ) { $action_links[] = sprintf( '', _x( 'Active', 'plugin', 'jetpack' ) ); } elseif ( current_user_can( 'activate_plugin', $status['file'] ) ) { $button_text = __( 'Activate', 'jetpack' ); /* translators: %s: plugin name */ $button_label = _x( 'Activate %s', 'plugin', 'jetpack' ); $activate_url = add_query_arg( array( '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $status['file'] ), 'action' => 'activate', 'plugin' => $status['file'], ), network_admin_url( 'plugins.php' ) ); if ( is_network_admin() ) { $button_text = __( 'Network Activate', 'jetpack' ); /* translators: %s: plugin name */ $button_label = _x( 'Network Activate %s', 'plugin', 'jetpack' ); $activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url ); } $action_links[] = sprintf( '%4$s', esc_url( $activate_url ), esc_attr( sprintf( $button_label, $plugin['name'] ) ), esc_attr( $plugin['name'] ), $button_text ); } else { $action_links[] = sprintf( '', _x( 'Installed', 'plugin', 'jetpack' ) ); } break; } } $plugin_install = "plugin-install.php?tab=plugin-information&plugin={$plugin['slug']}&TB_iframe=true&width=600&height=550"; $details_link = is_multisite() ? network_admin_url( $plugin_install ) : admin_url( $plugin_install ); if ( ! empty( $plugin['icons']['svg'] ) ) { $plugin_icon_url = $plugin['icons']['svg']; } elseif ( ! empty( $plugin['icons']['2x'] ) ) { $plugin_icon_url = $plugin['icons']['2x']; } elseif ( ! empty( $plugin['icons']['1x'] ) ) { $plugin_icon_url = $plugin['icons']['1x']; } else { $plugin_icon_url = $plugin['icons']['default']; } ?>
  • '; if ( ! $compatible_php && ! $compatible_wp ) { esc_html_e( 'This plugin doesn’t work with your versions of WordPress and PHP.', 'jetpack' ); if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { printf( /* translators: 1: "Update WordPress" screen URL, 2: "Update PHP" page URL */ ' ' . wp_kses( __( 'Please update WordPress, and then learn more about updating PHP.', 'jetpack' ), array( 'a' => array( 'href' => true ) ) ), esc_url( self_admin_url( 'update-core.php' ) ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation(); } elseif ( current_user_can( 'update_core' ) ) { printf( /* translators: %s: "Update WordPress" screen URL */ ' ' . wp_kses( __( 'Please update WordPress.', 'jetpack' ), array( 'a' => array( 'href' => true ) ) ), esc_url( self_admin_url( 'update-core.php' ) ) ); } elseif ( current_user_can( 'update_php' ) ) { printf( /* translators: %s: "Update PHP" page URL */ ' ' . wp_kses( __( 'Learn more about updating PHP.', 'jetpack' ), array( 'a' => array( 'href' => true ) ) ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation(); } } elseif ( ! $compatible_wp ) { esc_html_e( 'This plugin doesn’t work with your version of WordPress.', 'jetpack' ); if ( current_user_can( 'update_core' ) ) { printf( /* translators: %s: "Update WordPress" screen URL */ ' ' . wp_kses( __( 'Please update WordPress.', 'jetpack' ), array( 'a' => array( 'href' => true ) ) ), esc_url( self_admin_url( 'update-core.php' ) ) ); } } elseif ( ! $compatible_php ) { esc_html_e( 'This plugin doesn’t work with your version of PHP.', 'jetpack' ); if ( current_user_can( 'update_php' ) ) { printf( /* translators: %s: "Update PHP" page URL */ ' ' . wp_kses( __( 'Learn more about updating PHP.', 'jetpack' ), array( 'a' => array( 'href' => true ) ) ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation(); } } echo '

    '; } ?>

    $plugin['rating'], 'type' => 'percent', 'number' => $plugin['num_ratings'], ) ); ?>
    = 1000000 ) { $active_installs_millions = floor( $plugin['active_installs'] / 1000000 ); $active_installs_text = sprintf( /* translators: number of millions of installs. */ _nx( '%s+ Million', '%s+ Million', $active_installs_millions, 'Active plugin installations', 'jetpack' ), number_format_i18n( $active_installs_millions ) ); } elseif ( 0 === $plugin['active_installs'] ) { $active_installs_text = _x( 'Less Than 10', 'Active plugin installations', 'jetpack' ); } else { $active_installs_text = number_format_i18n( $plugin['active_installs'] ) . '+'; } /* translators: number of active installs */ printf( esc_html__( '%s Active Installations', 'jetpack' ), esc_html( $active_installs_text ) ); ?>
  • ' . implode( '
  • ', $action_links ) . '
  • '; } ?> 888, 'countries' => 69, 'languages' => 83, 'featured_plugins' => array( 'woocommerce', 'wp-super-cache', 'wp-job-manager', 'co-authors-plus', ), ); } } return $data; } /** * Compile and display a list of avatars for A12s that gave their permission. * * @since 7.3 */ public function display_gravatars() { $hashes = array( 'https://1.gravatar.com/avatar/d2ab03dbab0c97740be75f290a2e3190', 'https://2.gravatar.com/avatar/b0b357b291ac72bc7da81b4d74430fe6', 'https://2.gravatar.com/avatar/9e149207a0e0818abed0edbb1fb2d0bf', 'https://2.gravatar.com/avatar/9f376366854d750124dffe057dda99c9', 'https://1.gravatar.com/avatar/1c75d26ad0d38624f02b15accc1f20cd', 'https://1.gravatar.com/avatar/c510e69d83c7d10be4df64feeff4e46a', 'https://0.gravatar.com/avatar/88ec0dcadea38adf5f30a17e54e9b248', 'https://1.gravatar.com/avatar/bc45834430c5b0936d76e3f468f9ca57', 'https://0.gravatar.com/avatar/0619d4de8aef78c81b2194ff1d164d85', 'https://0.gravatar.com/avatar/72a638c2520ea177976e8eafb201a82f', 'https://0.gravatar.com/avatar/b3618d70c63bbc5cc7caee0beded5ff0', 'https://1.gravatar.com/avatar/4d346581a3340e32cf93703c9ce46bd4', 'https://2.gravatar.com/avatar/9c2f6b95a00dfccfadc6a912a2b859ba', 'https://1.gravatar.com/avatar/1a33e7a69df4f675fcd799edca088ac2', 'https://2.gravatar.com/avatar/d5dc443845c134f365519568d5d80e62', 'https://0.gravatar.com/avatar/c0ccdd53794779bcc07fcae7b79c4d80', ); $output = ''; foreach ( $hashes as $hash ) { $output .= '
  • ' . "\n"; } echo wp_kses( $output, array( 'li' => true, 'img' => array( 'src' => true, ), ) ); } }