@@ -1,14 +1,15 @@
< ? php
< ? php
/**
/**
* Plugin Name: Door Status Indicato r
* Plugin Name: WordPress SpaceAPI Consume r
* Plugin URI: https://example.com/
* Plugin Slug: wp-spaceapi-consumer
* Description: Lightweight, dependency‑ free 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 real‑ time 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-indicato r
* Text Domain: wp-spaceapi-consume r
*/
*/
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
/*
/*