Plugin Directory

Changeset 3042738


Ignore:
Timestamp:
02/28/2024 05:16:14 PM (23 months ago)
Author:
markcbain
Message:

Fix database error

Location:
air-quality-data-from-foobot/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • air-quality-data-from-foobot/trunk/admin/admin.php

    r2228648 r3042738  
    4343    register_setting(
    4444        'baindesignFoobot',                             // New options group
    45         'baindesign_foobot_api_settings'            // Entry in options table
     45        BD0019__API_OPTIONS_NAME
    4646    );
    4747
     
    5656    // API Key
    5757    add_settings_field(
    58         'baindesign_foobot_api_key',                        // ID
     58        BD0019__API_KEY_FIELD,                      // ID
    5959        __('API Key', 'aq-data-foobot'),                    // Label
    60         'baindesign_foobot_api_key_field_render',       // Function to display
     60        BD0019__API_KEY_FIELD . '_field_render',        // Function to display
    6161        // inputs
    6262        'baindesignFoobot',                                 // Page to display on
     
    6666    // API username
    6767    add_settings_field(
    68         'baindesign_foobot_api_user',                       // ID
     68        BD0019__API_USER_FIELD,                     // ID
    6969        __('API User', 'aq-data-foobot'),               // Label
    70         'baindesign_foobot_api_user_field_render',  // Function to
     70        BD0019__API_USER_FIELD . '_field_render',   // Function to
    7171        // display inputs
    7272        'baindesignFoobot',                                 // Page to display on
     
    7777function baindesign_foobot_api_user_field_render()
    7878{
    79     $options = get_option('baindesign_foobot_api_settings');
    8079?>
    81     <input type='email' name='baindesign_foobot_api_settings[baindesign_foobot_api_user]' placeholder='<?php _e("Your API email", 'aq-data-foobot'); ?>' value='<?php echo esc_html($options['baindesign_foobot_api_user']); ?>'>
     80    <input type='email' name='baindesign_foobot_api_settings[baindesign_foobot_api_user]' placeholder='<?php _e("Your API email", 'aq-data-foobot'); ?>' value='<?php echo esc_html(BD0019__API_USER); ?>'>
    8281<?php
    8382}
     
    8584function baindesign_foobot_api_key_field_render()
    8685{
    87     $options = get_option('baindesign_foobot_api_settings');
    8886?>
    89     <textarea rows="7" cols="50" name='baindesign_foobot_api_settings[baindesign_foobot_api_key]' placeholder='<?php _e("Your API key", 'aq-data-foobot'); ?>'><?php echo esc_textarea($options['baindesign_foobot_api_key']); ?></textarea>
     87    <textarea rows="7" cols="50" name='baindesign_foobot_api_settings[baindesign_foobot_api_key]' placeholder='<?php _e("Your API key", 'aq-data-foobot'); ?>'><?php echo esc_textarea(BD0019__API_KEY); ?></textarea>
    9088<?php
    9189}
  • air-quality-data-from-foobot/trunk/aq-data-foobot.php

    r3042147 r3042738  
    66 * Description: Call your air quality data via the Foobot API.
    77 * Author: Bain Design
    8  * Version: 1.2.0
     8 * Version: 1.2.1
    99 * Author URI: http://bain.design
    1010 * License: GNU General Public License v2.0
     
    1313 * Plugin Slug: aq-data-foobot
    1414 */
     15
     16if (!defined('ABSPATH')) {
     17   die('Invalid request.');
     18}
     19
     20global $wpdb;
     21
     22define('BD0019__DEVICE_DB_VERSION', '1.2');
     23define('BD0019__SENSOR_DB_VERSION', '1.4');
     24define('BD0019__API_OPTIONS_NAME', 'baindesign_foobot_api_settings');
     25define('BD0019__API_OPTIONS', get_option(BD0019__API_OPTIONS_NAME));
     26define('BD0019__API_KEY_FIELD', 'baindesign_foobot_api_key');
     27define('BD0019__API_KEY', BD0019__API_OPTIONS[BD0019__API_KEY_FIELD]);
     28define('BD0019__API_USER_FIELD', 'baindesign_foobot_api_user');
     29define('BD0019__API_USER', BD0019__API_OPTIONS[BD0019__API_USER_FIELD]);
     30define('BD0019__SENSOR_DB_TABLE', $wpdb->prefix . 'bd_foobot_sensor_data');
     31define('BD0019__DEVICE_DB_TABLE', $wpdb->prefix . 'bd_foobot_device_data');
    1532
    1633// Includes
     
    2643    // Misc
    2744    include( $path . 'includes/helpers.php');
     45
     46
    2847
    2948/**
  • air-quality-data-from-foobot/trunk/includes/api.php

    r3042147 r3042738  
    2929
    3030   if (is_wp_error($request)) {
     31      // DEBUG
     32      if (BD0019__DEBUG === 1){
     33         error_log($request->get_error_message(), true);
     34      }
    3135      return false; // Bail early
    3236   }
     
    3539
    3640   $api_data = json_decode( $body, true);
     41
     42   // DEBUG
     43   if (BD0019__DEBUG === 1) {
     44      error_log(print_r($api_data, TRUE));
     45   }
    3746
    3847   return $api_data;
     
    5867function bd_foobot_call_api_sensors( $uuid )
    5968{
     69      // DEBUG
     70   if (BD0019__DEBUG === 1) {
     71      error_log(sprintf("New API call made for %s.", $uuid));
     72   }
     73   
    6074   $key = bd_foobot_get_api_key();
    6175
     
    7084
    7185   if (is_wp_error($request)) {
     86      // DEBUG
     87      if (BD0019__DEBUG === 1){
     88         error_log(print_r($request->get_error_message(), true));
     89      }
    7290      return false; // Bail early
    7391   }
     
    7795   $api_data = json_decode( $body, true); // Output array
    7896
     97   // DEBUG
     98   if (BD0019__DEBUG === 1) {
     99      error_log(print_r($api_data, true));
     100   }
     101
    79102   return $api_data;
    80103}
    81104
    82105/**
    83  *
    84  * These functions use transients to avoid hitting the API
    85  * limit.
    86  */
    87 
    88 // Update device data
     106 * Get device names and UUIDs
     107 *
     108 * Use this function to request device data.
     109 * Uses transients to avoid repeated requests
     110 * hitting API limit.
     111 *
     112 * @return  array    $output           Device data (name, UUID)
     113 */
    89114function bd_foobot_call_api_trans_devices()
    90115{
    91    global $wpdb;
    92 
    93    // If an API call has been made within the last 24 hours,
    94    // return.
    95    if (1 == get_transient('foobot-api-device-updated')) {
     116   // Vars
     117   $output = '';
     118   $transient_id = 'foobot-api-device-updated';
     119   $transient = get_transient($transient_id);
     120   $expiry = 86400; // 24 hours
     121
     122   // Check if transient already set / not expired
     123   // If set, return.
     124   if (1 === $transient) { // Transient set.
     125      // DEBUG
     126      if (BD0019__DEBUG === 1) {
     127         error_log(sprintf("Transient %s set. No API call made.", $transient_id));
     128      }
    96129      return;
    97    }
    98 
    99    // Get the device data
    100    $device_data = bd_foobot_call_api_devices();
    101 
    102    // Transient is set for 24 hours
    103    set_transient('foobot-api-device-updated', 1, (60 * 60 * 24));
    104 
    105    return $device_data;
    106 }
    107 
    108 // Update sensor data
    109 function bd_foobot_call_api_trans_sensors( $uuid )
    110 {
    111    global $wpdb;
    112 
    113    // If an API call has been made within the last 5 mins,
    114    // return.
    115    if (1 == get_transient('foobot-api-data-updated-' . $uuid )) {
    116 
     130   } else {
     131      // Get the device data via new API call
     132      // DEBUG
     133      if (BD0019__DEBUG === 1) {
     134         error_log(sprintf("New API call made for devices."));
     135      }
     136      $data = bd_foobot_call_api_devices();
     137
     138      if (is_wp_error($data)) {
     139         return; // Bail early
     140      } else {
     141         $output = $data;
     142      }
     143
     144      // Set a transient
     145      // DEBUG
     146      if (BD0019__DEBUG === 1) {
     147         error_log(sprintf("Setting transient %s.", $transient_id));
     148      }
     149      set_transient($transient_id, 1, $expiry);
     150   }
     151   return $output;
     152}
     153
     154/**
     155 * Get sensor data
     156 *
     157 * Use this function to request sensor data from a specified device.
     158 * Uses transients to avoid repeated requests
     159 * hitting API limit.
     160 *
     161 * @param   string   $uuid             UUID of device
     162 * @return  array    $output           Sensor data
     163 */
     164function bd_foobot_call_api_trans_sensors($uuid)
     165{
     166   // Vars
     167   $output = '';
     168   $transient_id = 'foobot-api-data-updated-' . $uuid;
     169   $transient = get_transient($transient_id);
     170   $expiry = 600; // 10 mins
     171
     172   // Check if transient already set / not expired
     173   // If set, return.
     174   if (1 === $transient) { // Transient set.
     175      // DEBUG
     176      if (BD0019__DEBUG === 1) {
     177         error_log(sprintf("Transient %s set for UUID %s. No API call made.", $transient_id, $uuid));
     178      }
    117179      return;
    118    }
    119 
    120    // Get the device data
    121    $data = bd_foobot_call_api_sensors( $uuid );
    122    if (is_wp_error($data)) {
    123       return false; // Bail early
    124    }
    125 
    126    // Transient is set for 10 mins
    127    set_transient('foobot-api-data-updated-' . $uuid, 1, (60 * 10));
    128 
    129    return $data;
    130 }
     180   } else {
     181      // Get the device data via new API call
     182      $data = bd_foobot_call_api_sensors($uuid);
     183
     184      // DEBUG
     185      if (BD0019__DEBUG === 1) {
     186         error_log(print_r($data, TRUE));
     187      }
     188
     189      if (is_wp_error($data)) {
     190         return; // Bail early
     191      } else {
     192         $output = $data;
     193      }
     194
     195      // Set a transient
     196      // DEBUG
     197      if (BD0019__DEBUG === 1) {
     198         error_log(sprintf("Setting transient %s.", $transient_id));
     199      }
     200      set_transient($transient_id, 1, $expiry);
     201   }
     202   return $output;
     203}
  • air-quality-data-from-foobot/trunk/includes/database.php

    r3042147 r3042738  
    11<?php
    22
    3 /**
    4  * Set database versions
    5  */
    6 
    7 // Device
    8 global $bd_foobot_device_db_version;
    9 $bd_foobot_device_db_version = '1.2';
    10 
    11 // Sensors
    12 global $bd_foobot_sensor_db_version;
    13 $bd_foobot_sensor_db_version = '1.4';
    14 
    15 /** Get Options
    16  * ============
    17  *
    18  * Retrieve values stored in WordPress database
    19  * options table.
    20  */
    21 
    22 // Get API key from the database
     3if (!defined('ABSPATH')) {
     4   die('Invalid request.');
     5}
     6
     7// Get API key
    238function bd_foobot_get_api_key()
    249{
    25    $options = get_option('baindesign_foobot_api_settings');
    26    return $options['baindesign_foobot_api_key'];
     10   $key = BD0019__API_KEY;
     11   if ($key){
     12      return $key;
     13   } else {
     14      return "API key not found";
     15      // DEBUG
     16      if (BD0019__DEBUG === 1){
     17         error_log(print_r("API key not found", true));
     18      }
     19   }
    2720}
    2821
     
    3023function bd_foobot_get_api_user()
    3124{
    32    $options = get_option('baindesign_foobot_api_settings');
    33    return $options['baindesign_foobot_api_user'];
     25   $user = BD0019__API_USER;
     26   if ($user){
     27      return $user;
     28   } else {
     29      return "API username not found";
     30      // DEBUG
     31      if (BD0019__DEBUG === 1){
     32         error_log(print_r("API user not found", true));
     33      }
     34   }
    3435}
    3536
     
    5051{
    5152   global $wpdb;
    52    global $bd_foobot_sensor_db_version;
    5353
    5454   $table_name = $wpdb->prefix . 'bd_foobot_sensor_data';
    5555
    5656   $charset_collate = $wpdb->get_charset_collate();
     57
     58   // DEBUG
     59   if (BD0019__DEBUG === 1){
     60      error_log(print_r("Creating table " . $table_name, true));
     61   }
    5762
    5863   $sql = "CREATE TABLE $table_name (
     
    8085   dbDelta($sql);
    8186
    82    add_option('bd_foobot_sensor_db_version', $bd_foobot_sensor_db_version);
     87   add_option('bd_foobot_sensor_db_version', BD0019__SENSOR_DB_VERSION);
    8388}
    8489
     
    8792{
    8893   global $wpdb;
    89    global $bd_foobot_device_db_version;
    9094
    9195   $table_name = $wpdb->prefix . 'bd_foobot_device_data';
    9296
    9397   $charset_collate = $wpdb->get_charset_collate();
     98
     99   // DEBUG
     100   if (BD0019__DEBUG === 1){
     101      error_log(print_r("Creating table " . $table_name, true));
     102   }
    94103
    95104   $sql = "CREATE TABLE $table_name (
     
    104113   dbDelta($sql);
    105114
    106    add_option('bd_foobot_device_db_version', $bd_foobot_device_db_version);
     115   add_option('bd_foobot_device_db_version', BD0019__DEVICE_DB_VERSION);
    107116}
    108117
     
    122131   // Vars
    123132   global $wpdb;
    124    $table_name = $wpdb->prefix . 'bd_foobot_sensor_data';
    125 
    126    // $data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM `{$table_name}` ORDER BY `id` DESC LIMIT 1", $sensor) );
    127    $data = $wpdb->get_row("SELECT * FROM `{$table_name}` ORDER BY `id` DESC LIMIT 1", ARRAY_A);
     133   $data          = array();
     134   $table_name    = BD0019__SENSOR_DB_TABLE;
     135
     136   // Build query
     137   $query = $wpdb->prepare("
     138      SELECT *
     139      FROM %i
     140         ORDER BY 'id'
     141         DESC LIMIT 1
     142      ", $table_name,
     143   );
     144
     145   // Now we query the db.
     146   $data = $wpdb->get_row( $query, ARRAY_A );
     147
     148   // DEBUG
     149   if (BD0019__DEBUG === 1){
     150      error_log(print_r("Fetching data from table " . $table_name, true));
     151      $wpdb->print_error();
     152      error_log(print_r($data, true));
     153   }
    128154
    129155   return $data;
     
    136162
    137163   global $wpdb;
    138    $wpdb->show_errors();
     164
     165   // DEBUG
     166   if (BD0019__DEBUG === 1){$wpdb->show_errors();}
    139167
    140168   // Vars
    141    $table_name = $wpdb->prefix . 'bd_foobot_sensor_data';
     169   $table_name = BD0019__SENSOR_DB_TABLE;
    142170
    143171   // Update the device table if required
    144172   bd_foobot_update_sensor_data($uuid);
    145173
     174   // Build query
     175   $query = $wpdb->prepare("
     176      SELECT *
     177      FROM {$table_name}
     178         WHERE `uuid` = %s
     179         ORDER BY `id` DESC
     180         LIMIT 1
     181   ", $uuid);
     182
    146183   // Now we query the db.
    147    $data = $wpdb->get_results("SELECT * FROM `{$table_name}` WHERE `uuid`='$uuid' ORDER BY `id` DESC LIMIT 1", ARRAY_A);
     184   $data = $wpdb->get_results( $query, ARRAY_A );
     185
     186   // DEBUG
     187   if (BD0019__DEBUG === 1){
     188      error_log(print_r("Fetching data from " . DB_NAME . " > " . BD0019__SENSOR_DB_TABLE, true));
     189      $wpdb->print_error();
     190      error_log(print_r($data, true));
     191   }
    148192
    149193   return $data;
    150194
    151    // Show error if any
    152    $wpdb->print_error();
    153 }
    154 
    155 // Fetch device data
     195}
     196
     197/**
     198 * Fetch device data from the database
     199 *
     200 *    Devices on the user account are stored in a custom table.
     201 *    This is used to prevent hitting API limits.
     202 *
     203 *    If the API has been called recently, we use this function
     204 *    instead to get the device data.
     205 *
     206 *    NOTE: This table is updates with devices each time the
     207 *    API call is made. Devices are never removed. In order to
     208 *    get current devices, we need to check only the most recent.
     209 *
     210 * @return array $latest_devices  Array of last devices returned by API.
     211 */
    156212function bd_foobot_fetch_db_devices()
    157213{
    158214
    159215   global $wpdb;
    160    $wpdb->show_errors();
     216   
     217   // DEBUG
     218   if (BD0019__DEBUG === 1){$wpdb->show_errors();}
    161219
    162220   // Vars
    163    $table_name = $wpdb->prefix . 'bd_foobot_device_data';
     221   $table_name = BD0019__DEVICE_DB_TABLE;
    164222
    165223   // Update the device table if required
    166224   bd_foobot_update_device_data();
    167225
     226   // DEBUG
     227   if (BD0019__DEBUG === 1){
     228      error_log(sprintf("Fetching device data from database (%s)", $table_name, true));
     229   }
     230
    168231   // Get all the results
    169232   // TO DO: Only return results from the last 24 hours?
     
    175238
    176239   //$data = $wpdb->get_row( "SELECT * FROM `{$table_name}` WHERE timestamp >= DATE_SUB(NOW(), INTERVAL 1 DAY)", ARRAY_A );
     240
    177241   $data = array();
    178    $data = $wpdb->get_row("SELECT * FROM `{$table_name}` ORDER BY `id` DESC LIMIT 1", ARRAY_A);
    179 
     242
     243   // Build query
     244   $query = $wpdb->prepare("
     245      SELECT *
     246      FROM %i
     247         ORDER BY 'id'
     248         DESC LIMIT 1
     249      ", $table_name,
     250   );
     251
     252   // Now we query the db.
     253   $data = $wpdb->get_row( $query, ARRAY_A );
     254
     255   error_log(print_r("Most recent device found:", true));
     256   error_log(print_r($data, true));
     257   
     258   // Get timestamp of most recent API call.
     259   // We will use this to find all devices returned
     260   // in the last API call.
    180261   $timestamp = $data["timestamp"];
    181262
    182    //$latest = array();
    183    $latest = $wpdb->get_results("SELECT * FROM `{$table_name}` WHERE `timestamp`= $timestamp ORDER BY `id` DESC", ARRAY_A);
    184    if (count($latest) > 0) {
    185       return $latest;   // returns an array with the latest devices
     263   /**
     264    * Build new query to return rows that match timestamp
     265    */
     266   $query2 = $wpdb->prepare("
     267      SELECT *
     268      FROM %i
     269         WHERE `timestamp` = %d
     270         ORDER BY `id`
     271         DESC
     272      ", $table_name, $timestamp
     273   );
     274
     275   // Run query
     276   $latest_devices = $wpdb->get_results( $query2, ARRAY_A );
     277
     278   // Return results
     279   // DEBUG
     280   if (BD0019__DEBUG === 1){
     281      error_log(sprintf("All devices found that match timestamp %d: ", $timestamp, true));
     282      error_log(print_r($latest_devices, true));
     283   }
     284   if (count($latest_devices) > 0) {
     285      return $latest_devices; // returns an array with the latest devices
    186286   } else {
     287      if (BD0019__DEBUG === 1){
     288         error_log(print_r("No devices found for timestamp %d.", $timestamp, true));
     289      }
    187290      return;
    188291   }
    189292
    190    //echo '<h3>Latest</h3>';
    191    //echo '<pre><code>';
    192    //var_dump( $latest );
    193    //echo '</code></pre>';
    194 
    195    // Show error if any
    196    // $wpdb->print_error();
     293
    197294}
    198295
     
    216313
    217314   global $wpdb;
    218    // Turn on errors display
    219    //$wpdb->show_errors();
     315
     316   // DEBUG
     317   if (BD0019__DEBUG === 1){$wpdb->show_errors();}
    220318
    221319   $table_name = $wpdb->prefix . 'bd_foobot_device_data';
     
    225323   foreach ($device_api_data as $data) {
    226324      $device_data = array();
    227       //echo '<pre><code>';
    228       //var_dump( $data );
    229       //echo '</code></pre>';
    230325
    231326      // Loop the device data
    232327      foreach ($data as $key => $value) {
    233328         $device_data[] = array($key => $value);
    234          //echo '<pre><code>';
    235          //var_dump( $key. ' ' .$value );
    236          //echo '</code></pre>';
    237 
    238          //echo '<h5>Device data in loop</h5>';
    239          //echo '<pre><code>';
    240          //var_dump( $device_data );
    241          //echo '</code></pre>';
    242329      }
    243       //echo '<h5>Device data after loop</h5>';
    244       //echo '<pre><code>';
    245       //var_dump( $device_data );
    246       //echo '</code></pre>';
    247330
    248331      // vars
     
    252335      $name    = $device_data[3]['name'];
    253336
    254       //echo '<pre><code>';
    255       //var_dump( $uuid );
    256       //echo '</code></pre>';
    257337
    258338      // Insert data into db table
     
    281361
    282362   // DEBUG
    283    // $wpdb->show_errors(); // Turn on errors display
    284 
    285    $table_name = $wpdb->prefix . 'bd_foobot_sensor_data';
     363   if (BD0019__DEBUG === 1){
     364      $wpdb->show_errors();
     365      error_log(print_r($data, true));
     366   };
    286367
    287368   // Vars
     
    307388   // Insert data into db table
    308389   $wpdb->insert(
    309       $table_name,
     390      BD0019__SENSOR_DB_TABLE,
    310391      array(
    311392         'timestamp'          => $time,
     
    344425}
    345426
     427/**
     428 * Update device data
     429 */
    346430function bd_foobot_update_device_data()
    347431{
  • air-quality-data-from-foobot/trunk/includes/helpers.php

    r3042147 r3042738  
    1111function bd_get_foobot_device_uuid( $device_name )
    1212{
     13   // DEBUG
     14   if (BD0019__DEBUG === 1){
     15      error_log(sprintf("Getting the UUID for %s", $device_name, true));
     16   }
     17
    1318   $devices = bd_foobot_fetch_db_devices();
     19   
    1420   // Get array columns
    1521   $col = array_column( $devices, 'name' );
     
    6369   }
    6470endif;
     71
     72/**
     73 * Get Device name from UUID
     74 *
     75 * Looks up the given UUID in the Device database table,
     76 * and returns the Device Name if found.
     77 *
     78 * @param   string $uuid            Device UUID
     79 * @return  string $output          Device name
     80 */
     81if(!function_exists('bd324_get_device_name_from_uuid')):
     82   function bd324_get_device_name_from_uuid($uuid)
     83   {
     84      global $wpdb;
     85
     86      /* Vars */
     87      $output        = '';
     88      $table_name    = BD0019__DEVICE_DB_TABLE;
     89   
     90      // Build query
     91      $query = $wpdb->prepare("
     92         SELECT *
     93         FROM %i
     94            WHERE `uuid` = %s
     95            LIMIT 1
     96         ", $table_name, $uuid
     97      );
     98   
     99      // Now we query the db.
     100      $device_data = $wpdb->get_row( $query, ARRAY_A );
     101      $device_name = $device_data['name'];
     102
     103      // DEBUG
     104      if (BD0019__DEBUG === 1){
     105         error_log(sprintf("Fetching device name for %s from %s", $uuid, $table_name));
     106      }
     107
     108      if ($device_name){
     109         // DEBUG
     110         if (BD0019__DEBUG === 1){
     111            error_log(print_r($device_name, true));
     112         }
     113         $output = $device_name;
     114      } else {
     115         // DEBUG
     116         if (BD0019__DEBUG === 1){
     117            error_log(sprintf("Device name not found for %s", $uuid, true));
     118            error_log(print_r($device_name, true));
     119            $wpdb->print_error();
     120         }
     121         return;
     122      }
     123
     124      return $output;
     125   }
     126endif;
     127
  • air-quality-data-from-foobot/trunk/includes/sensors.php

    r3042147 r3042738  
    1313  // Get the target device UUID
    1414  $uuid = bd_get_foobot_device_uuid( $device_name );
    15   if($uuid==='error_device_not_found'){
     15
     16  // No device found
     17  if($uuid ==='error_device_not_found' || $uuid ==='' || $uuid ===NULL){
    1618    $content = '<div class="foobot-data foobot-data__error">';
    1719    $content.= sprintf(
     
    6567    // Error message
    6668    $content = '<div class="foobot-data foobot-data__error">';
    67     $content .= __('Sorry, something went wrong. Please try again later', 'aq-data-foobot');
     69    $content.= sprintf(
     70      __('The requested device has been found ("%s" UUID %s), but no data has been sent. Please confirm your device is working via the Foobot app or dashboard.', 'aq-data-foobot'), $device_name, $uuid
     71     );
    6872    $content .= '</div>';
    6973
  • air-quality-data-from-foobot/trunk/readme.txt

    r3042147 r3042738  
    55Requires at least: 5.3
    66Tested up to: 6.4
    7 Stable tag: 1.2.0
     7Stable tag: 1.2.1
    88Requires PHP: 5.2.4
    99License: GPLv2 or later
     
    4141== Changelog ==
    4242
     43= 1.2.1 =
     44* Fix database error
     45
    4346= 1.2 =
    4447* Display data timestamp in WordPress format
     
    5457== Upgrade Notice ==
    5558
    56 = 1.0 =
    57 * Initial plugin version
     59= 1.2.1 =
     60* Fix database error
    5861
    5962= 1.2 =
     
    6265* Force temp to show decimals
    6366
     67= 1.0 =
     68* Initial plugin version
     69
    6470== Credits ==
    6571
  • air-quality-data-from-foobot/trunk/uninstall.php

    r2228648 r3042738  
    66}
    77
    8 $options_name =     'baindesign_foobot_api_settings';
     8$options_name =     BD0019__API_OPTIONS_TABLE;
    99
    1010delete_option($options_name);
Note: See TracChangeset for help on using the changeset viewer.