Plugin Directory

Changeset 3217813


Ignore:
Timestamp:
01/06/2025 03:06:03 PM (15 months ago)
Author:
wibergsweb
Message:

Bugfix fetch interval - now working together with Wordpress native wp_remote_get()

Location:
csv-to-html
Files:
890 added
2 edited

Legend:

Unmodified
Added
Removed
  • csv-to-html/trunk/csvtohtml.php

    r3217022 r3217813  
    44Plugin URI: http://www.wibergsweb.se/plugins/csvtohtml
    55Description:Display/edit/synchronize csv-file(s) dynamically into a html-table
    6 Version: 3.20
     6Version: 3.21
    77Author: Wibergs Web
    88Author URI: http://www.wibergsweb.se/
     
    31493149            //Therefore this check has to be done               
    31503150            if ( $wp_filesystem->exists( $fpath ) )
    3151             {               
     3151            {                       
     3152                $relative_path = str_replace(ABSPATH, '', $fpath);
     3153                $file_url = site_url($relative_path);
     3154
    31523155                //Check fetch interval (daily is default)               
    3153                 $time_html = wp_remote_get( $fpath ); //String separated by ***time***
    3154                 $exp_htmltime = explode('***time***', $time_html);
    3155                 $time = $exp_htmltime[0];               
     3156                $response = wp_remote_get( $file_url );
     3157
     3158                // Extract the body from the response
     3159                $time_html = wp_remote_retrieve_body($response);       
     3160               
     3161                //Creates an array with:
     3162                //[0] first item: current time
     3163                //[1] second item: the actual csv-file-part
     3164                $exp_htmltime = explode('***time***', $time_html);                                             
     3165                $time = intval($exp_htmltime[0]); 
    31563166                $current_time = time();
    31573167
     
    50365046            //We can't just save html because of pagination, search etc (whole table is not loaded at once)
    50375047            //Instead we save the serialized content_arr generated
    5038             $wp_filesystem->put_contents( $file_arr, '***time***' . serialize( $content_arr), FS_CHMOD_FILE );
    5039         }
    5040 
     5048            $wp_filesystem->put_contents( $file_arr, time() . '***time***' . serialize( $content_arr), FS_CHMOD_FILE );
     5049        }
    50415050
    50425051        return $html;
  • csv-to-html/trunk/readme.txt

    r3217022 r3217813  
    66Requires at least: 3.0.1
    77Tested up to: 6.7
    8 Stable Tag: 3.20
     8Stable Tag: 3.21
    99License: GPLv2
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    141141== Changelog ==
    142142
     143= 3.21 = (2025-01-06)
     144Bugfix fetch interval - now working together with Wordpress native wp_remote_get()
     145
    143146= 3.20 = (2025-01-04)
    144147Bugfix shortcode generator - both functionality and html standards
Note: See TracChangeset for help on using the changeset viewer.