Published: 2 November 2024 | Last Updated 7 days ago
Overview
The Rust Server Plugin provides a detailed view of Rust server information, including player counts, server status, map previews, and server environment details. The plugin supports both BattleMetrics and RustMaps APIs to provide accurate, real-time data.
Whether you’re a server administrator or a Rust enthusiast, this plugin helps you keep your community informed with up-to-date server details, player stats, and more.
How It Works
- API Integration: The plugin integrates with the BattleMetrics and RustMaps APIs to fetch server data.
- BattleMetrics provides server status, player counts, map information, and more.
- RustMaps provides map previews based on map size and world seed for procedural maps. (Coming Soon in Next Update)
- Data Storage and Display:
- Server details are stored in custom fields (such as
_rustservers_battlemetrics_server_id
and_rustservers_rust_maps_api_key
) for each Rust server post. - The plugin includes several shortcodes to render data in different formats: tables, cards, lists, and interactive displays.
- Server details are stored in custom fields (such as
Plugin Setup
- Install and Activate the Plugin:
- Upload the plugin to your WordPress
/wp-content/plugins
directory. - Go to your WordPress Admin Dashboard, navigate to Plugins, and activate the plugin.
- Upload the plugin to your WordPress
- Configure Server Settings:
- Go to Add New under Rust Servers in your WordPress Admin Dashboard.
- Enter the server’s BattleMetrics ID and API key in the custom fields.
- If you want map previews, enter your RustMaps API key.
Available Shortcodes
The plugin offers several shortcodes to display server information in different layouts. Below are details on each shortcode, including parameters, examples, and styling recommendations.
1. [ rust_servers_table ]
Displays server information in a table format with the server image as a background, offering a clean and organized view.
- Usage:
[ rust_servers_table ]
- Details:
- Displays server name, player count, status, and additional information in a structured table.
- Each table row includes a black overlay on the background image for text readability.
2. [ rust_servers_battlemetrics_grid_shortcode ]
Displays servers in a grid format using BattleMetrics data. Each server appears as a card with quick details and icons.
- Usage:
[ rust_servers_battlemetrics_grid_shortcode ]
- Details:
- Fetches data directly from BattleMetrics to show server name, map, player count, and status.
- Cards are arranged in a responsive grid layout.
3. [ rust_servers_expandable_list ]
Displays server information in an expandable list format, where each server item can be clicked to reveal more details.
- Usage:
[ rust_servers_expandable_list ]
- Details:
- Ideal for compact displays on mobile or sidebar areas.
- Each server list item expands on click, revealing server details such as map, last wipe, and player statistics.
4. [ rust_servers_table ] with Map Preview
Adds a detailed map preview section to the table format. If RustMaps API data is available, it displays the procedural map preview below the server information.
- Usage:
[ rust_servers_table show_map_preview="true" ]
- Details:
- Automatically fetches the map preview from RustMaps if procedural map data is available.
- Displays map preview as an interactive image, clickable to view in full size.
5. [ rust_servers_horizontal_scroll ]
Creates a horizontally scrollable list of server cards, ideal for embedding in full-width sections or pages.
- Usage:
[ rust_servers_horizontal_scroll ]
- Details:
- Displays each server as a card with scrollable navigation.
- Each card includes server details, player stats, and action buttons (e.g., Connect).
Advanced Configuration
Customizing Appearance
For advanced users, each shortcode can be customized further with CSS. Some CSS classes are:
.server-info
: Styles the main server information section..table-bordered
: Adds borders and padding to table elements..overlay
: Adds the overlay to make text readable on background images..status-banner
: Customizes the status banner’s color and style.
You can add custom CSS in your theme’s stylesheet or in Appearance > Customize > Additional CSS.
Examples
Example 1: Displaying All Servers in a Table with Map Preview
Use [ rust_servers_table show_map_preview="true" ]
on a page or post to display all configured Rust servers in a structured table with map previews.
Example 2: Adding an Expandable List in Sidebar
Use [ rust_servers_expandable_list ]
in a sidebar widget to keep it compact. The expandable format lets users view more details by clicking on each server name.
Frequently Asked Questions (FAQs)
1. How do I get the BattleMetrics API key?
- Sign up at BattleMetrics to get your API key.
2. How do I get a RustMaps API key?
- Visit RustMaps and follow their API documentation to obtain an API key.
3. Can I customize the display of individual servers?
- Yes, each shortcode offers unique layouts. Additionally, you can use custom CSS to further adjust the appearance.
Preview
[ rust_servers_info ]
Server Name | Server Address | Players | Status | Connect |
---|---|---|---|---|
UKN.GG - US Training Grounds - Main | 64.40.8.152:28014 | 85 / 250 | ● Online | View Connect |
UKN.GG - EU Training Grounds - Main | 64.40.9.56:28014 | 97 / 250 | ● Online | View Connect |
RustReborn.gg EU - Bedwars | AimTrain | Creative | Arena | FFA | 64.40.9.156:28017 | 430 / 450 | ● Online | View Connect |
[ rust_servers_cards ]
[ rust_servers_fullwidth_layout ]
UKN.GG - US Training Grounds - Main
UKN Map · 85/250 players
UKN.GG - EU Training Grounds - Main
UKN Map · 97/250 players
RustReborn.gg EU - Bedwars | AimTrain | Creative | Arena | FFA
RR|Bedwars|Arenas|FFA|Creative · 430/450 players
[ rust_servers_halfwidth_layout ]
RustReborn.gg EU - Bedwars | AimTrain | Creative | Arena | FFA
RR|Bedwars|Arenas|FFA|Creative · 430 / 450
[ rust_servers_table ]
Server | Players | Status | Actions |
---|---|---|---|
Upcoming Changes
- Enhanced Server & Player Stats
Get the same in-depth server and player statistics found on this page. This update includes expanded metrics, making it easier than ever to monitor your favorite servers and track player activity. - Steam Login for Personal Stats
Players will soon be able to log in via Steam to access personalized stats. This feature will allow you to track your own game performance and view exclusive stats for logged-in users. - Database-Backed Data Storage
We’ll be storing server data directly in our database to reduce API requests to BattleMetrics. This will improve website speed and allow us to introduce new features, including:- Player History Graphs: View historical data trends for server and player stats, accessible in easy-to-read graphs.
There are no reviews yet.