Rename About tab to Read Me and display README.md content

This commit is contained in:
Marcus Quinn
2025-03-24 21:37:09 +00:00
parent e83dbcfff7
commit a2b7ba6d72
6 changed files with 69 additions and 69 deletions

View File

@ -897,20 +897,20 @@ input:checked + .wp-toggle-slider:before {
margin: 1em 0;
}
/* About Tab Panel */
#about .wpa-pro-plugins {
/* Read Me Tab Panel */
#readme .wpa-pro-plugins {
display: block;
padding: 20px;
}
#about .wpa-pro-plugin {
#readme .wpa-pro-plugin {
max-width: 50%;
margin: 0 auto;
box-sizing: border-box;
}
@media screen and (max-width: 960px) {
#about .wpa-pro-plugin {
#readme .wpa-pro-plugin {
max-width: 100%;
margin: 0 auto;
padding: 20px;

View File

@ -1,47 +0,0 @@
<?php
/**
* About page data for WP ALLSTARS plugin
* Content supports markdown formatting
*/
if (!defined('ABSPATH')) {
exit;
}
// Define about page content
function wp_allstars_get_about_content() {
return [
'title' => 'About WP ALLSTARS',
'content' => <<<MARKDOWN
## Welcome to WP ALLSTARS
WP ALLSTARS is a powerful all-in-one WordPress toolkit designed to help you build, manage, and optimize your WordPress websites more efficiently.
### Our Mission
Our mission is to simplify WordPress development and management by providing a comprehensive suite of tools that work seamlessly together.
### Key Features
* **Theme Management**: Easily install and manage professional WordPress themes
* **Plugin Recommendations**: Curated lists of the best free and premium plugins
* **Workflow Optimization**: Tools to streamline your development process
* **Hosting Recommendations**: Find the perfect hosting provider for your needs
* **Advanced Settings**: Fine-tune your WordPress installation
### Get in Touch
Have questions or suggestions? We'd love to hear from you!
* **Website**: [wpallstars.com](https://wpallstars.com)
* **Documentation**: [docs.wpallstars.com](https://docs.wpallstars.com)
* **Support**: [support@wpallstars.com](mailto:support@wpallstars.com)
### Credits
WP ALLSTARS is developed and maintained by a team of WordPress enthusiasts dedicated to creating the best possible WordPress experience.
Version: {WP_ALLSTARS_VERSION}
MARKDOWN
];
}

46
admin/data/readme.php Normal file
View File

@ -0,0 +1,46 @@
<?php
/**
* Read Me data for WP ALLSTARS plugin
* Content is pulled from the README.md file
*/
if (!defined('ABSPATH')) {
exit;
}
// Define readme content
function wp_allstars_get_readme_content() {
// Get README.md content
$readme_path = WP_PLUGIN_DIR . '/wpa-superstar-plugin/README.md';
$readme_content = '';
if (file_exists($readme_path)) {
$readme_content = file_get_contents($readme_path);
} else {
// Fallback content if README.md is not found
$readme_content = <<<MARKDOWN
# WP Allstars
A WordPress plugin that enhances your WordPress experience with curated plugins, themes, and optimization tools.
## Description
WP Allstars is a powerful WordPress plugin designed to help site owners and developers optimize their WordPress installations. It provides a curated collection of recommended plugins, themes, and optimization tools all in one place.
## Features
- **Curated Plugin Recommendations**: Browse and install recommended free plugins organized by category.
- **Pro Plugin Showcase**: Discover premium plugins with direct links to purchase.
- **Theme Integration**: Easily install and activate the Kadence theme.
- **Workflow Optimization**: Tools to streamline your WordPress workflow.
- **Advanced Settings**: Fine-tune your WordPress installation with advanced configuration options.
Version: {WP_ALLSTARS_VERSION}
MARKDOWN;
}
return [
'title' => 'Read Me',
'content' => $readme_content
];
}

View File

@ -250,8 +250,8 @@ class WP_Allstars_Admin_Manager {
<a href="?page=wp-allstars&tab=tools" class="nav-tab <?php echo $active_tab === 'tools' ? 'nav-tab-active' : ''; ?>">
<?php esc_html_e('Tools', 'wp-allstars'); ?>
</a>
<a href="?page=wp-allstars&tab=about" class="nav-tab <?php echo $active_tab === 'about' ? 'nav-tab-active' : ''; ?>">
<?php esc_html_e('About', 'wp-allstars'); ?>
<a href="?page=wp-allstars&tab=readme" class="nav-tab <?php echo $active_tab === 'readme' ? 'nav-tab-active' : ''; ?>">
<?php esc_html_e('Read Me', 'wp-allstars'); ?>
</a>
</h2>
@ -291,8 +291,8 @@ class WP_Allstars_Admin_Manager {
WP_Allstars_Tools_Manager::display_tab_content();
break;
case 'about':
WP_Allstars_About_Manager::display_tab_content();
case 'readme':
WP_Allstars_Readme_Manager::display_tab_content();
break;
}
?>

View File

@ -1,6 +1,6 @@
<?php
/**
* About Page Manager Class
* Read Me Manager Class
*
* @package WP_ALLSTARS
* @since 0.2.0
@ -10,7 +10,7 @@ if (!defined('ABSPATH')) {
exit;
}
class WP_Allstars_About_Manager {
class WP_Allstars_Readme_Manager {
/**
* Initialize the class
@ -20,7 +20,7 @@ class WP_Allstars_About_Manager {
}
/**
* Enqueue styles for the about tab
* Enqueue styles for the readme tab
*
* @param string $hook Current admin page hook
*/
@ -38,28 +38,28 @@ class WP_Allstars_About_Manager {
}
/**
* Get the about page content
* Get the readme content
*
* @return array
*/
public static function get_about_content() {
return wp_allstars_get_about_content();
public static function get_readme_content() {
return wp_allstars_get_readme_content();
}
/**
* Display the about tab content
* Display the readme tab content
*/
public static function display_tab_content() {
$about = self::get_about_content();
$readme = self::get_readme_content();
?>
<div class="wp-allstars-settings-content tab-content" id="about">
<div class="wp-allstars-settings-content tab-content" id="readme">
<div class="wpa-pro-plugins">
<div class="wpa-pro-plugin">
<h3><?php echo esc_html($about['title']); ?></h3>
<h3><?php echo esc_html($readme['title']); ?></h3>
<div class="wp-allstars-markdown-content">
<?php echo self::parse_markdown($about['content']); ?>
<?php echo self::parse_markdown($readme['content']); ?>
</div>
</div>
</div>
@ -89,6 +89,7 @@ class WP_Allstars_About_Manager {
$markdown = preg_replace('/\*(.*?)\*/s', '<em>$1</em>', $markdown);
// Lists
$markdown = preg_replace('/^- (.*?)$/m', '<li>$1</li>', $markdown);
$markdown = preg_replace('/^\* (.*?)$/m', '<li>$1</li>', $markdown);
$markdown = preg_replace('/(<li>.*?<\/li>\n)+/s', '<ul>$0</ul>', $markdown);
@ -111,4 +112,4 @@ class WP_Allstars_About_Manager {
}
// Initialize the class
WP_Allstars_About_Manager::init();
WP_Allstars_Readme_Manager::init();

View File

@ -59,14 +59,14 @@ if (is_admin()) {
require_once plugin_dir_path(__FILE__) . 'admin/includes/class-pro-plugins-manager.php';
require_once plugin_dir_path(__FILE__) . 'admin/includes/class-plugin-manager.php';
require_once plugin_dir_path(__FILE__) . 'admin/includes/class-free-plugins-manager.php';
require_once plugin_dir_path(__FILE__) . 'admin/includes/class-about-manager.php';
require_once plugin_dir_path(__FILE__) . 'admin/includes/class-readme-manager.php';
// Initialize the admin manager
add_action('plugins_loaded', array('WP_Allstars_Admin_Manager', 'init'));
// Data files
require_once plugin_dir_path(__FILE__) . 'admin/data/pro-plugins.php';
require_once plugin_dir_path(__FILE__) . 'admin/data/about.php';
require_once plugin_dir_path(__FILE__) . 'admin/data/readme.php';
// Legacy files (for backward compatibility)
require_once plugin_dir_path(__FILE__) . 'admin/settings.php';