Compare commits

...

2 Commits

2 changed files with 13 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
<?php <?php
define( 'DSI_API_URL', 'https://nodered.jfig.net/api/v1/door-open' ); define( 'DSI_API_URL', 'https://lcdporto.org/api/spaceapi' );
define( 'DSI_CACHE_KEY', 'dsi_door_open_status' ); define( 'DSI_CACHE_KEY', 'dsi_space_api_status' );
define( 'DSI_CACHE_TTL', 10 ); define( 'DSI_CACHE_TTL', 10 );

View File

@@ -1,14 +1,15 @@
<?php <?php
/** /**
* Plugin Name: Door Status Indicator * Plugin Name: WordPress SpaceAPI Consumer
* Plugin URI: https://example.com/ * Plugin Slug: wp-spaceapi-consumer
* Description: Lightweight, dependencyfree plugin that polls a JSON endpoint (default: https://nodered.jfig.net/api/v1/door-open), caches the value for a few seconds, and shows a realtime door open/closed indicator (🟢/🔴) via the [door_status] shortcode and the Admin Bar. * Plugin URI: https://gitea.alluna.pt/jfig/wp-spaceapi-consumer
* Description: Small WordPress plugin to consume an SpaceAPI endpoint and indicate on the WordPress website if the Space is Open or Closed
* Version: 1.1.1 * Version: 1.1.1
* Author: J (ChatGPT helper) * Author: Joao Figueiredo, LCD Porto Team, ChatGPT o3
* Author URI: https://example.com/ * Author URI: https://lcdporto.org
* License: GPL v2 or later * License: MIT
* License URI: https://www.gnu.org/licenses/gpl-2.0.html * License URI: https://gitea.alluna.pt/jfig/wp-spaceapi-consumer/src/branch/dev/LICENSE
* Text Domain: door-status-indicator * Text Domain: wp-spaceapi-consumer
*/ */
if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {
@@ -30,8 +31,8 @@ if ( file_exists( $config_file ) ) {
} }
// Fallback defaults (only if not already defined by the config file). // Fallback defaults (only if not already defined by the config file).
! defined( 'DSI_API_URL' ) && define( 'DSI_API_URL', 'https://nodered.jfig.net/api/v1/door-open' ); ! defined( 'DSI_API_URL' ) && define( 'DSI_API_URL', 'https://lcdporto.org/api/spaceapi' );
! defined( 'DSI_CACHE_KEY' ) && define( 'DSI_CACHE_KEY', 'dsi_door_open_status' ); ! defined( 'DSI_CACHE_KEY' ) && define( 'DSI_CACHE_KEY', 'dsi_space_api_status' );
! defined( 'DSI_CACHE_TTL' ) && define( 'DSI_CACHE_TTL', 10 ); // seconds ! defined( 'DSI_CACHE_TTL' ) && define( 'DSI_CACHE_TTL', 10 ); // seconds
/* /*