FatObject Casino
FatObject Casino Plugin
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/andrew-narolsky/fatobject-casino/archive/refs/heads/main.zipFatObject Casino Plugin
Description
FatObject Casino is a WordPress plugin for integrating with a casino API.
It allows you to fetch casino brands, options for select fields, and details for a specific brand.
Installation
- Copy the plugin folder to
wp-content/plugins/. - Install Composer dependencies and generate the autoloader:
cd wp-content/plugins/fatobject-casino
composer install
- Activate the plugin via WordPress Admin → Plugins.
- Go to Settings → FOC API to configure the Base URL and API Token.
Settings
- Base URL – the API base URL.
- API Token – the authentication token for the API.
Template Overrides
FatObject Casino provides default templates for its custom post types.
- Example: Overriding single-brand.php
- In your theme folder, create a fatobject-casino directory:
theme/
└─ fatobject-casino/
- Add your custom template for the Brand post type:
theme/
└─ fatobject-casino/
├─ single-brand.php
└─ single-slot.php
- WordPress will use your theme’s template if it exists. Otherwise, it will fallback to the plugin’s default template:
plugins/fatobject-casino/templates/single-brand.php
plugins/fatobject-casino/templates/single-slot.php
Setting up Nginx Proxy for Image Uploads
Follow these steps to add proxy rules for image directories in your main Nginx configuration and reload Nginx:
- Add proxy rules to Nginx
# Proxy for casino brand images
location /uploads/casino_brand/ {
proxy_pass https://EXAMPLE.com/uploads/casino_brand/;
proxy_set_header Host fatobject.studio;
}
# Proxy for payment system images
location /uploads/payment_system/ {
proxy_pass https://EXAMPLE.com/uploads/payment_system/;
proxy_set_header Host fatobject.studio;
}
# Proxy for software provider images
location /uploads/software-provider/ {
proxy_pass https://EXAMPLE.com/uploads/software-provider/;
proxy_set_header Host fatobject.studio;
}
# Proxy for license images
location /uploads/license/ {
proxy_pass https://EXAMPLE.com/uploads/license/;
proxy_set_header Host fatobject.studio;
}
# Proxy for slot images
location /uploads/slot/ {
proxy_pass https://EXAMPLE.com/uploads/slot/;
proxy_set_header Host fatobject.studio;
}
# Proxy for game images
location /uploads/game/ {
proxy_pass https://EXAMPLE.com/uploads/game/;
proxy_set_header Host fatobject.studio;
}
- Reload Nginx
API Strategy Pattern Diagram
The FOC API integration uses a Strategy Pattern to handle multiple API modules in a consistent and flexible way.
FocApiInterface
│
├─ Defines methods: getPaginated(), getOptions(), getById()
│
FocApi (base class)
│
├─ Implements shared API logic (request sending, parsing, common query params)
│
├─ Concrete modules extend FocApi and implement FocApiInterface
│ ├─ FocApiBrand
│ ├─ FocApiSlot
│ └─ ... other API modules
│
└─ FocApiProxyTrait
└─ Provides convenient public methods that wrap protected FocApi methods
FocApiService
│
├─ Holds a "strategy" property of type FocApiInterface
├─ setStrategy() → dynamically assign a module (Brand, Bonus, Slot)
└─ getPaginated(), getOptions(), getById() → delegates to current strategy
Usage Example:
───────────────
$service = new FocApiService();
$service->setStrategy(new FocApiBrand($baseUrl, $token));
$brands = $service->getPaginated();
$service->setStrategy(new FocApiBonus($baseUrl, $token));
$bonuses = $service->getPaginated();
$service->setStrategy(new FocApiSlot($baseUrl, $token));
$slots = $service->getPaginated();
Shortcodes
The plugin provides several shortcodes for displaying casino-related content. All shortcodes can be used in posts, pages, Gutenberg blocks, or widgets.
-
Brand bonuses (displays all available bonuses for the current brand).
[foc_brand_bonuses] -
Brand payment systems (displays all available bonuses for the current brand).
[foc_brand_payment_systems] -
Brand software providers (displays all available bonuses for the current brand).
[foc_brand_software_providers] -
Brand games (displays all available bonuses for the current brand).
[foc_brand_games] -
Slot list.
Basic usage
Display a list of slots with default settings:
[foc_slot_list]
By default, the shortcode:
- Shows 9 items per page
- Uses standard WordPress ordering
- Supports Load More via AJAX
Parameters
The shortcode supports the following parameters:
| Parameter | Type | Description |
| ---------- | ------ | ---------------------------------------------------------------------- |
| `per_page` | int | Number of items displayed per page |
| `ids` | string | Comma-separated list of post IDs to display |
| `orderby` | string | Sorting method (`date`, `title`, `meta_value`, `meta_value_num`, etc.) |
| `order` | string | Sort direction (`ASC` or `DESC`) |
| `meta_key` | string | Meta field key used for meta-based sorting |
Examples
Limit the number of items per page
[foc_slot_list per_page="6"]
Display specific slots by ID
[foc_slot_list ids="12,45,78,103"]
Sort by post-title
[foc_slot_list orderby="title" order="ASC"]
Sort by a numeric meta-field (e.g., rating)
[foc_slot_list orderby="meta_value_num" meta_key="rating" order="DESC"]
Notes
- All parameters are optional.
- Parameters are automatically passed to the Load More functionality, so pagination remains consistent.
- When using orderby="meta_value" or orderby="meta_value_num", the meta_key parameter is required.
- The shortcode is designed to be reusable and extendable for future filtering and sorting features.
- Brand list.
Basic usage (more see Slot list shortcode)
Display a list of brands with default settings:
[foc_brand_list]
By default, the shortcode:
- Shows 10 items per page
- Uses standard WordPress ordering
- Supports Load More via AJAX