render_navigation(); ?>

%4$s ', esc_attr( $class ), isset( $link ) ? 'href="' . esc_url( $link ) . '"' : '', $data, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped esc_html( $button_text ) ); ?>

<?php echo esc_html( 'Customize' ); ?>

render_navigation(); $plugins = bloglo_plugin_utilities()->get_recommended_plugins(); ?>

is_activated( $plugin['slug'] ) ) { $btn_class = 'hester-btn secondary'; $btn_text = esc_html__( 'Deactivate', 'bloglo' ); $action = 'deactivate'; $notice = '' . esc_html__( 'Plugin activated', 'bloglo' ) . ''; } elseif ( bloglo_plugin_utilities()->is_installed( $plugin['slug'] ) ) { $btn_class = 'hester-btn primary'; $btn_text = esc_html__( 'Activate', 'bloglo' ); $action = 'activate'; $notice = ''; } else { $btn_class = 'hester-btn primary'; $btn_text = esc_html__( 'Install & Activate', 'bloglo' ); $action = 'install'; $notice = ''; } ?>
<?php echo esc_html( $plugin['name'] ); ?>

render_navigation(); $changelog = BLOGLO_THEME_PATH . '/changelog.txt'; if ( ! file_exists( $changelog ) ) { $changelog = esc_html__( 'Changelog file not found.', 'bloglo' ); } elseif ( ! is_readable( $changelog ) ) { $changelog = esc_html__( 'Changelog file not readable.', 'bloglo' ); } else { global $wp_filesystem; // Check if the the global filesystem isn't setup yet. if ( is_null( $wp_filesystem ) ) { WP_Filesystem(); } $changelog = $wp_filesystem->get_contents( $changelog ); } ?>

get_navigation_items(); ?>
array( 'id' => 'dashboard', 'name' => esc_html__( 'About', 'bloglo' ), 'icon' => '', 'url' => menu_page_url( 'bloglo-dashboard', false ), ), 'plugins' => array( 'id' => 'plugins', 'name' => esc_html__( 'Recommended Plugins', 'bloglo' ), 'icon' => '', 'url' => menu_page_url( 'bloglo-plugins', false ), ), 'changelog' => array( 'id' => 'changelog', 'name' => esc_html__( 'Changelog', 'bloglo' ), 'icon' => '', 'url' => menu_page_url( 'bloglo-changelog', false ), ), ); return apply_filters( 'bloglo_dashboard_navigation_items', $items ); } /** * Activate plugin. * * @since 1.0.0 */ public function activate_plugin() { // Security check. check_ajax_referer( 'bloglo_nonce' ); // Plugin data. $plugin = isset( $_POST['plugin'] ) ? sanitize_text_field( wp_unslash( $_POST['plugin'] ) ) : ''; if ( empty( $plugin ) ) { wp_send_json_error( esc_html__( 'Missing plugin data', 'bloglo' ) ); } if ( $plugin ) { $response = bloglo_plugin_utilities()->activate_plugin( $plugin ); if ( is_wp_error( $response ) ) { wp_send_json_error( $response->get_error_message(), $response->get_error_code() ); } wp_send_json_success(); } wp_send_json_error( esc_html__( 'Failed to activate plugin. Missing plugin data.', 'bloglo' ) ); } /** * Deactivate plugin. * * @since 1.0.0 */ public function deactivate_plugin() { // Security check. check_ajax_referer( 'bloglo_nonce' ); // Plugin data. $plugin = isset( $_POST['plugin'] ) ? sanitize_text_field( wp_unslash( $_POST['plugin'] ) ) : ''; if ( empty( $plugin ) ) { wp_send_json_error( esc_html__( 'Missing plugin data', 'bloglo' ) ); } if ( $plugin ) { $response = bloglo_plugin_utilities()->deactivate_plugin( $plugin ); if ( is_wp_error( $response ) ) { wp_send_json_error( $response->get_error_message(), $response->get_error_code() ); } wp_send_json_success(); } wp_send_json_error( esc_html__( 'Failed to deactivate plugin. Missing plugin data.', 'bloglo' ) ); } /** * Highlight dashboard page for plugins page. * * @since 1.0.0 * @param string $submenu_file The submenu file. */ public function highlight_submenu( $submenu_file ) { global $pagenow; // Check if we're on bloglo plugins or changelog page. if ( 'themes.php' === $pagenow ) { if ( isset( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( 'bloglo-plugins' === $_GET['page'] || 'bloglo-changelog' === $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended $submenu_file = 'bloglo-dashboard'; } } } return $submenu_file; } } endif; /** * The function which returns the one Bloglo_Dashboard instance. * * Use this function like you would a global variable, except without needing * to declare the global. * * Example: * * @since 1.0.0 * @return object */ function bloglo_dashboard() { return Bloglo_Dashboard::instance(); } bloglo_dashboard();