Plugin Directory

Changeset 3388215


Ignore:
Timestamp:
11/01/2025 11:05:22 PM (5 months ago)
Author:
tomflux
Message:

correct fatal error and fix day calculation

Location:
infoforflux/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • infoforflux/trunk/infoforflux.php

    r3376199 r3388215  
    33* Plugin Name: Info for Flux
    44* Description: Display and Monitor Flux Network (runonflux.com)
    5 * Version: 1.0.12
     5* Version: 1.0.13
    66* Author: Tom Moulton tom@runonflux.com
    77* Author URI: https://runonflux.com
     
    158158    $ret = '(unknown)';
    159159    $name = esc_attr( get_option('infoforflux_name') );
    160     $endblock = esc_attr( get_option('infoforflux_expire_block') );
    161     $current = infoforflux_get_current_block();
     160    $endblock = (int)esc_attr( get_option('infoforflux_expire_block') );
     161    $current = (int)infoforflux_get_current_block();
    162162    $height = esc_attr( get_option('infoforflux_block_height') );
    163163    if ($current) {
     
    170170                $ret = $days;
    171171            }
    172         } else { // App Updated before V2, Does it expire before V2?
    173             // Since app spec can't be changed due to fork
    174             // We can assume that Flux will properly handle the expiration DATE
    175             $minutes = $blocks * 2; // Flux Generates a block every 120 seconds +/-
    176             $days = (int)($minutes/(60*24));
    177             $ret = $days;
    178             if ($endblock < $flux_v2_start_block) { // Yes - V1 Only
    179                 $endblockV2 = $endblock;
    180             } else { // Starts in V1 expires in V2 - transition case, compute new endblock
    181                 // 4 V2 blocks per V1 Block time
    182                 $endblockV2 = ( ($endblock - $flux_v2_start_block) * 4) + $flux_v2_start_block;
     172        } else { // App Updated before V2
     173            // Starts in V1 expires in V2 - transition case, compute new endblock
     174            // 4 V2 blocks per V1 Block time
     175            $blocksV2 = ($endblock - $flux_v2_start_block) * 4;
     176            $endblockV2 = $blocksV2 + $flux_v2_start_block;
     177            if ($current > $endblockV2) $ret = 'Expired V1 -> V2';
     178                        else {
     179                            $blocks = $endblockV2 - $current;
     180                            $minutes  = $blocks / 2;
     181                $days = (int)($minutes/(60*24));
     182                $ret = $days;
    183183            }
    184             if ($current > $endblockV2) $ret = 'Expired V1 -> V2';
    185184        }
    186185    }
  • infoforflux/trunk/readme.txt

    r3376199 r3388215  
    44Requires at least: 4.7
    55Tested up to: 6.8.3
    6 Stable Tag: 1.0.12
     6Stable Tag: 1.0.13
    77License: GPLv3 or later.
    88License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    7777= Version 1.0.12 - 10 Oct 2025 =
    7878- Add actual Flux V2 PoUW Starting Block 2020000
     79
     80= Version 1.0.13 - 1 Nov 2025 =
     81- Fix V1 to V2 block calculation and fatal error
Note: See TracChangeset for help on using the changeset viewer.