=== Gaming-Plus Game Server Status ===
Contributors: nilsdberlin
Tags: minecraft, fivem, game server, server status, discord
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Live status for Minecraft, FiveM, Rust, ARK, Palworld & 50+ games: players, map, ping, history, Discord. No external API, no rate limits.

== Description ==

Game Server Status shows your community a clean, modern status card telling them whether your server is up right now – including player count, how full it is, map, version, MOTD and ping. No external services: the query runs directly over the game protocol – Minecraft Java & Bedrock, Steam/Source A2S, the Quake 3 engine used by Call of Duty, and the own interfaces of FiveM, RedM, Satisfactory, Eco, Palworld, Terraria (TShock), Hytale and Farming Simulator.

Easy to use: add your server under the "Game Server" menu (name, address, port) – you instantly get a ready-to-use shortcode, or let it create a finished page with one click.

`[gpgss_server_status id="1"]`

With live updates (every 30 seconds, without reloading):

`[gpgss_server_status id="1" refresh="30"]`

Or directly by address, without saving:

`[gpgss_server_status host="mc.yourserver.com" port="25565"]`

Your whole network at a glance – "4 of 5 servers online · 87 players":

`[gpgss_network list="1"]`

How many people are on your Discord right now, with an invite button:

`[gpgss_discord]`

Results are cached for 60 seconds to keep your site fast.

= What's on board =

* Minecraft Java & Bedrock
* FiveM & RedM roleplay servers – with server icon and "Join" button (fivem://connect)
* Steam/Source: CS2, Rust, ARK, Valheim, DayZ, SCUM, V Rising, Enshrouded, Conan Exiles, Soulmask, Arma 3, Project Zomboid, Space Engineers, Sons of the Forest, Euro Truck Simulator 2, American Truck Simulator, Unturned, 7 Days to Die, GMod, TF2, Left 4 Dead 2 and many more
* Satisfactory, Eco, Palworld, Terraria (TShock) and Hytale (Nitrado Query plugin)
* Call of Duty 1, 2 and 4, plus the rest of the Quake 3 family: Return to Castle Wolfenstein, Enemy Territory, Urban Terror, Quake III Arena …
* Farming Simulator 25, 22 and 19 – read from the web interface of the dedicated server
* Many games are queried over plain HTTP – they work even on web hosting that blocks UDP
* Server icon, "Copy address" & "Join" (steam://, fivem://, redm://)
* Banner image, own accent color and an extra button (Discord, vote page, rules …) per server
* How-full bar, map/world display, player list, live auto-refresh, server grid
* Network overview of all your servers and a Discord online counter
* Player history (24h) & uptime display
* Gutenberg block, design options: 7 card styles, theme, color, width, corner radius, show/hide every element
* Downtime alerts via email & Discord

= Planned =

* Rank/perk sales with in-game delivery

The plugin is fully translatable. Every string is ready for community translation on translate.wordpress.org, and a POT template ships in the `languages` folder for anyone who would rather translate with Poedit or Loco Translate.

== Installation ==

1. Upload the plugin folder to `wp-content/plugins/` (or install the ZIP via "Plugins > Add New > Upload Plugin").
2. Activate the plugin.
3. Add a server under the "Game Server" menu and insert the shortcode shown – or click "Create page" right away.
4. Alternatively, insert the "Game Server Status" block in the editor and pick your server.

== Frequently Asked Questions ==

= Which servers are supported? =

Minecraft Java and Bedrock. FiveM and RedM. Steam/Source games via A2S: Counter-Strike 2, Rust, ARK: Survival Evolved, Valheim, DayZ, SCUM, V Rising, Enshrouded, Conan Exiles, Soulmask, Arma 3, Project Zomboid, Space Engineers, Sons of the Forest, The Forest, Euro Truck Simulator 2, American Truck Simulator, Unturned, Avorion, Foundry, Barotrauma, Abiotic Factor, Insurgency: Sandstorm, Mordhau, Killing Floor 2, Left 4 Dead 2, Counter-Strike: Source, Garry's Mod, 7 Days to Die, Team Fortress 2, Icarus – and any other Steam game through "Other Steam/Source game". Games on the Quake 3 engine: Call of Duty 1, 2 and 4, Return to Castle Wolfenstein, Wolfenstein: Enemy Territory, Urban Terror, Quake III Arena and more. Through their own interfaces: Satisfactory, Eco, Palworld, Terraria (with TShock), Hytale (with the Nitrado Query plugin) and Farming Simulator 25, 22 and 19.

Not possible, because the games offer no query at all: ARK: Survival Ascended, Factorio, Astroneer and Among Us.

Mind the port: Source games are asked on their **query port**, which is not always the game port. Quake 3 games are asked on the **game port** itself – 28960 for Call of Duty, 27960 for the others.

Farming Simulator is the odd one out: a dedicated server answers no query protocol at all. The plugin reads the XML feed of the server's own web interface instead, so it needs that port (**8080** by default, reachable from the internet) and the access code shown there. A field for the code appears as soon as you pick the game.

= My FiveM server shows "–" instead of a player count =

Many large FiveM servers switch off the endpoints that report players (`sv_requestParanoia`). The plugin then still knows the server is online and how many slots it has, but not how many are taken – and says so instead of claiming 0 players.

= How do I connect Palworld? =

Palworld does not answer a Steam query. Enable its REST API in PalWorldSettings.ini (`RESTAPIEnabled=True`), enter the REST API port (8212 by default) in the plugin and the AdminPassword in the password field that appears. The port must be reachable from your website.

= My Call of Duty server shows up as offline =

Check two things first. Pick the right entry in the game list – a Call of Duty server does not answer a Steam query, so choosing "Other Steam/Source game" will always show it as offline. And use the game port (28960 by default), not a separate query port.

If it still fails, the Diagnostics page under "Game Server" tells you whether your hosting allows outgoing connections at all. Should that look fine, please open a topic in the support forum with the game and port – some heavily modified servers answer differently, and I am happy to look into it.

= Does the plugin need an external API? =

No. The query runs directly over sockets (Minecraft Server List Ping, and UDP for Bedrock, Steam/Source and Satisfactory), and for FiveM, RedM, Eco, Palworld, Terraria, Hytale and Farming Simulator straight to the interface of the game server itself.

= Can it show whether a whitelist is active? =

No. The whitelist status is not part of the server response and cannot be reliably read from the outside.

= Will I be notified when my server goes down? =

Yes. Under "Game Server > Alerts" you can enable email and/or a Discord webhook. The plugin checks every 5 minutes and reports downtime as well as recovery.

= Something is broken, or I am missing a feature =

Please tell me. Open a topic in the support forum – it is just me behind this plugin and I read every single one. For problems, the "Game Server > Help & Feedback" page in your admin points you to the Diagnostics tool first, which finds the cause in most cases. For wishes: say which game or which detail you need. That is how the list of supported games grew in the first place.

= Can I translate the plugin into my language? =

Yes, and both ways work. The easiest one is translate.wordpress.org: translate there and WordPress delivers the language pack to every site automatically, no files to copy. If you prefer to do it yourself, take `languages/gaming-plus-game-server-status.pot` from the plugin folder, translate it in Poedit or Loco Translate, and save the result as `gaming-plus-game-server-status-de_DE.mo` (with your own locale) in `wp-content/languages/plugins/`. Placed there it also survives plugin updates.

= Is any data sent to third parties? =

No visitor data, ever. The plugin only contacts the game servers YOU enter (to query their status), and – only if you use these features – your own Discord webhook for downtime notifications and the Discord widget API.

The `[gpgss_discord]` shortcode loads the public server widget of the Discord server whose ID you enter (`https://discord.com/api/guilds/<ID>/widget.json`). The request is made by your web server, cached for five minutes, and contains no data about your visitors; their browsers never talk to Discord and no avatars are loaded. Discord's terms: https://discord.com/terms – privacy policy: https://discord.com/privacy

There is no tracking and no sharing of visitor data.

== Screenshots ==

1. Status cards on a community website – banner image, how-full bar, map, player list, and a FiveM server with its own accent color and a Discord button.
2. Seven card styles: Standard, Aurora, Neon, Retro, Glass, Minimal and Compact.
3. Network overview of all servers, the live Discord counter and the server grid.
4. Design settings with instant live preview: style, theme, accent color, width, corner radius, effects and which elements are shown.

== Changelog ==

= 1.1.0 =
* New games: FiveM and RedM, Satisfactory, Eco, Palworld, Terraria (TShock) and Hytale (Nitrado Query plugin). Except Satisfactory they are all queried over HTTP, so they also work on web hosting that blocks UDP or fsockopen.
* 22 more Steam games with checked default query ports: SCUM, DayZ, V Rising, Enshrouded, Soulmask, Conan Exiles, Arma 3, Unturned, Sons of the Forest, The Forest, Project Zomboid, Space Engineers, Avorion, Euro Truck Simulator 2, American Truck Simulator, Insurgency: Sandstorm, Mordhau, Barotrauma, Abiotic Factor, Killing Floor 2, Left 4 Dead 2 and Counter-Strike: Source. The game list is now sorted alphabetically.
* New: the card shows the map or world, and a bar for how full the server is.
* New per server: banner image, own accent color and an extra button – for your Discord, a vote page or your rules.
* New: `[gpgss_network]` sums up all your servers ("4 of 5 servers online · 87 players"), optionally with one line per server.
* New: `[gpgss_discord]` shows how many people are online on your Discord, with an invite button.
* Design: two new card styles (Retro and Aurora), adjustable corner radius, a pulsing online dot, and every element of the card can be shown or hidden.
* "Join" now also works for FiveM and RedM.
* Servers that hide their player count are shown as "–/128" instead of "0/128". Games without a fixed player limit show the count alone.

= 1.0.9 =
* New game: Farming Simulator 25, 22 and 19. A dedicated server does not answer any of the usual query protocols, so the plugin reads the XML feed of the server's own web interface. That needs the access code from there - a new field appears once you pick the game. The code is stored encrypted and never leaves the admin area. Side effect: this query runs over HTTP, so it also works on hosting that blocks fsockopen or outgoing UDP.
* Translators: the plugin now ships a POT template in the `languages` folder, so it can be translated with Poedit or Loco Translate without any extra tooling.

= 1.0.8 =
* Diagnostics is more honest now: "outgoing connections" only ever meant that PHP has the function, not that connections actually get through. And if not a single server can be reached although UDP works, the page now says what that usually means - hosting that only allows the usual ports. Game servers listen elsewhere.

= 1.0.7 =
* Fixed: the UDP check was too easy to pass. It asked a DNS server on port 53 - the one UDP port almost every firewall leaves open. Hosts that allow DNS but block UDP everywhere else were reported as fine, while no game server could ever answer. The check now also tries a high port and tells the two cases apart.
* For developers: new filter `gpgss_query_fallback`. It fires when a query fails and lets an extension take over - for example to have the lookup done elsewhere when the web host blocks UDP.
* New: an address like "yourserver.com:27015" pasted into the address field now works. Servers are passed around in that form, so that is how people enter them - the port is taken from the address, and a stray colon no longer breaks the lookup.
* Fixed: after entering a wrong port, the connection test could suggest a completely different server that happened to run on the same machine - a real risk at game hosters, where many customers share one IP. It now only tries the standard ports of the protocol you selected.

= 1.0.6 =
* Fixed: the connection test gave up too early. If you entered a game port for a game that is queried over UDP, the test stopped after the first round and wrongly blamed a firewall - the standard query ports were never tried. It now always searches to the end.
* Port 27015, the standard Steam query port, is now tried right away. Entering the game port (Icarus 17777, Rust 28015) is the most common mistake there is.
* Clearer wording when nothing answers: a refused plain connection proves nothing for games queried over UDP, so the test no longer claims a firewall over it.

= 1.0.5 =
* New: the connection test and the diagnostics page now check whether this website may send UDP at all. Many hosts allow outgoing TCP but block UDP completely - Steam games, Minecraft Bedrock and the Call of Duty family are queried over UDP and can then never work, no matter which port you enter. The plugin now says so plainly instead of blaming the port.
* Clearer wording when no protocol answers: a reply on TCP does not prove the game is listening, because hosting panels map every port for TCP and UDP alike.

= 1.0.4 =
* New: "Test connection" button when adding or editing a server. It tries the protocols and the usual ports by itself and fills in what actually answered - so games that are not in the list can be set up without guesswork.
* New: when a query fails, administrators now see the reason on the card and in the server list, instead of a bare "offline". Visitors still only see the status.
* The test tells apart two cases that used to look identical: a server that does not answer, and a port that is blocked by a firewall - in which case players cannot connect either.
* Fixed: Minecraft addresses that rely on an SRV record now work. Most hosters hand out a short address without a port and redirect to the real host behind it - those servers were shown as offline although players could join fine.
* New game: Icarus (query port 27015, not the game port 17777).
* Fixed: server names on Quake 3 engine games (Call of Duty, Enemy Territory and friends) showed leftover colour codes such as ^z. Only digits were removed, but the engine treats any character after the caret as a colour.

= 1.0.3 =
* New: support for the Quake 3 engine – Call of Duty 1, 2 and 4, Return to Castle Wolfenstein, Wolfenstein: Enemy Territory, Urban Terror and Quake III Arena. Thanks to the user who asked for Call of Duty 2 in the support forum.
* Player names on these servers are shown with their colour codes removed, and names in older encodings no longer disappear.
* Servers that only answer the shorter "getinfo" query are now recognised as well.
* Internal: tidied up the uninstall routine and the autoload migration; no change in behaviour.

= 1.0.2 =
* New: "Help & Feedback" page under "Game Server" – the quickest way to reach me if something is broken or you are missing a feature.
* New: "Support" and "Rate this plugin" links on the Plugins screen.
* Occasional, dismissible reminder that a review helps – shown only on this plugin's own pages, only after two weeks of actual use, and never again once you say so.
* Added a page describing the optional Pro add-on. The free plugin contains no locked functionality: everything you already use stays free and keeps working unchanged.

= 1.0.1 =
* Performance: player history and alert state are no longer autoloaded on every page request.
* Performance: server grids now use a shared time budget – a page with unreachable servers no longer waits for every timeout in turn. Remaining cards load in the background.
* Performance: front-end CSS is only loaded on pages that actually show a status card.
* New: "Diagnostics" page under "Game Server" – shows whether your hosting allows outgoing connections and tests every saved server directly.
* The player history is only recorded for servers that actually display it.
* Clearer message when the hosting blocks outgoing connections (instead of just "offline").
* Accessibility: the history graph has a proper label, and the "Copy address" button reports back to screen readers.
* The "Copy address" button no longer uses inline JavaScript (works with strict Content-Security-Policy setups).
* Hardening: limits on the size of server responses and server icons.
* Uninstalling the plugin now removes all its options, scheduled tasks and cached data.

= 1.0.0 =
* First public release. Includes: Minecraft (Java & Bedrock) and Steam/Source games (CS2, Rust, ARK, Valheim, GMod, 7DTD, TF2), server icon, copy/join button, player list, live auto-refresh, server grid, player history (24h) & uptime, Gutenberg block, 5 card styles with design options, and downtime alerts (email/Discord).
