=== Advanced Steam Widget ===
Contributors: snakebytestudios
Donate link: http://www.SnakeByteStudios.com/contribute
Tags: widget, Steam, gaming, template, block
Requires at least: 4.4
Tested up to: 7.1
Stable tag: 2.0
Requires PHP: 7.0
License: GPLv2 or later

Displays Steam gaming profile status and recent history in a widget.


== Description ==

This plugin will add a widget that displays a Steam user's status and recent gaming history. It employs caching to keep your site's performance up and make it less susceptible to Steam outages or errors. No Steam API key is required, and it supports both classic widgets and block widgets.

The widget comes with the following templates (see screenshots) that you can easily switch between to customize what information is displayed:

* Profile Only
* Profile Small
* Profile + Games
* Games Only
* Games Grid
* Full-page Profile

You can also add custom steam widget templates to your theme, which support the following attributes pulled from a Steam profile:

* Recently Played Games
	- Game Name
	- Steam URL
	- Player Stats URL
	- Icon URL (32)
	- Logo URL (184 x 69)
	- Time Played Last Two Weeks
	- Time Played Total
	- In-game Status
* Player Profile
	- Steam Username
	- 64-bit Steam ID
	- Status
	- Profile URL
	- Avatar Icon URL (32)
	- Avatar Medium URL (64)
	- Avatar Large URL (184)
	- Time Played Last Two Weeks


== Installation ==

1. Copy the contents of this archive to the `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress
1. For Classic Widgets: 
	1. Go to the 'Appearance > Widgets' menu and add 'Steam Widget' to a sidebar.
	1. Copy a Steam Profile URL, expand the widget's options, paste the URL into the options, and save.
1. For Block Widgets:
	1. Add a 'Steam Widget' to anywhere in your theme templates or post/page contents.
	1. Copy a Steam Profile URL, expand the widget's options, paste the URL into the options, and the widget should refresh data and render automatically.


== Frequently Asked Questions ==

= I put the widget into my site but nothing is displayed on the frontend. =

1. First, make sure you put your Steam Profile URL in the widget's settings.
1. Check that your Steam profile privacy is set to public. 'Game Detail' privacy also needs to be public if you want game history.
1. Try forcing a cache update by using the 'Refresh Data' button (classic widget) or temporarily lowering the 'Update Interval' and reloading the page.

= How do I find my Steam Profile URL? =

In either Steam itself or on the Steam website, go to your 'Profile' and copy the URL. The URL on the page will either be in the format https://steamcommunity.com/id/XXX or https://steamcommunity.com/profiles/XXX. For the latter, it will be a unique 17-digit number. If you want to use the former, which has a prettier URL, go to "Edit Profile" and enter a "Custom URL".

= How do I customize the look of my widget? =

Add a directory called 'advanced-steam-widget' to your theme's directory. Create a PHP file here and add 'Template Name: XXX' to a header comment to name your template. If you wish to use a separate CSS file, define it in the header comment as 'Template Style: XXX' with a path relative to your template. See the included templates for available Steam data variables and CSS enqueuing.

= How do I get support for this plugin? =

You'll need to go to the SnakeByte Studios website to get help or report issues. You can either post a comment on the [plugin page](https://www.snakebytestudios.com/projects/apps/advanced-steam-widget/) or use the contact form to send an email. This is because of Wordpress.org's policy around 'brand' usernames interacting on their support forums.

= What is the shortcode for? =

When you save a classic widget's settings, it will show you a shortcode that you can use to display that widget in pages or posts. Just copy and paste the code where you want the widget. It's recommended to use the 'Full-page Profile' template with the shortcode. You can move the widget into the "Inactive Widgets" area when only using the shortcode.

= Why is this plugin 'Advanced'? =

When the plugin was originally created, 'Advanced' was added to the name to distinguish it from other Steam widgets available at the time. The plugin was more advanced because it cached Steam data instead of requesting it on every page load.


== Screenshots ==

1. Profile Only template
2. Profile Small template
3. Profile + Games template
4. Games Only template
5. Games Grid template
6. Full-page Profile template
7. Classic Widget options
8. Block Widget options


== Upgrade Notice ==

= 2.0 =
The plugin will require re-activation (due to a filename change). If you're using a custom preset, you might want to save the template contents before updating as that data will be deleted.


== Changelog ==

= 2.0 =
* Full rewrite to support latest PHP and WP versions
* Added Block support
* Presets are now file-based templates
* Added custom template support to replace custom presets
* Added migration code for existing users to have a seamless upgrade
* Replaced CURL and SimpleXML with built-in wp_remote_get() for fetching Steam data
* Added a 'Refresh Data' function for the classic widget
* Cache data is stored in WP transients now instead of with widget settings
* Added support for adding profiles from URLs
* Stylesheets are modernized and have basic color scheme and theme color preset support
* Updated to support current Steam profile data (i.e. 'add friends' URLs removed and in-game status was fixed)
* Plugin code organized into separate files

= 1.7 =
* Steam data update is done using cron now instead of at intervals on widget display. should remove any possible data propagation delays for visitors
* added timer displays for last and next update in widget options
* added additional error checking and reporting
* added cleanup on plugin deactivation and uninstall
* added profile URL and box-sizing CSS to all presets
* fixed CURL redirect issue involving PHP-deprecated safe mode
* fixed WP-deprecated widget constructor error
* fixed a PHP notice
* various optimizations

= 1.6.1 =
* workaround for Steam bug where hours played last two weeks is reported as 0.0
* fixed case where stats conditional was true when there were no stats

= 1.6 =
* added two new presets
* added basic shortcode support
* added ability to not have a widget title
* added profile URL pattern
* added conversion for Steam IDs to Profile IDs
* various template tweaks

= 1.5 =
* added four preset templates
* added conditional patterns for stats and user status
* added stats URL pattern for games
* simplified widget options
* fixed minor bug with curl (thanks Andrewsk1)

= 1.0.1 =
* a few default template fixes
* more error checking for the Steam API output

= 1.0 =
* First public release
