Plugin Directory

Changeset 3248723


Ignore:
Timestamp:
02/28/2025 08:45:52 PM (13 months ago)
Author:
creativform
Message:

2.0.2

  • Fixed JavaScript errors when clearing cache
  • Optimize JavaScript and code minification
  • Fixed GUI and optimized PHP code
Location:
easy-auto-reload
Files:
20 added
8 edited

Legend:

Unmodified
Added
Removed
  • easy-auto-reload/trunk/assets/js/clear-browser-cache.js

    r2598243 r3248723  
    11(function () {
    2     var process_scripts = false
    3         rep = /.*\?.*/,
    4         links = document.getElementsByTagName('link'),
    5         images = document.getElementsByTagName('img'),
    6         scripts = document.getElementsByTagName('script')
    7         value = document.getElementsByName('clear-browser-cache');
    8    
    9     if(value) {
    10         for (var i = 0; i < value.length; i++) {
    11             var val = value[i],
    12                 outerHTML = val.outerHTML,
    13                 check = /.*value="true".*/;
    14             if (check.test(outerHTML)) {
    15                 process_scripts = true;
    16             }
    17         }
    18     }
    19    
    20     if(links) {
    21         for (var i = 0; i < links.length; i++) {
    22             var link = links[i],
    23                 href = link.href;
    24             if(href) {
    25                 if (rep.test(href)) {
    26                     link.href = href + '&' + Date.now();
    27                 } else {
    28                     link.href = href + '?' + Date.now();
    29                 }
    30             }
    31         }
    32     }
    33    
    34     if(images) {
    35         for (var i = 0; i < images.length; i++) {
    36             var image = images[i],
    37                 src = image.src;
    38             if (src !== "") {
    39                 if (rep.test(src)) {
    40                     image.src = src + '&' + Date.now();
    41                 }
    42                 else {
    43                     image.src = src + '?' + Date.now();
    44                 }
    45             }
    46         }
    47     }
    48    
    49     if (process_scripts && scripts) {
    50         for (var i = 0; i < scripts.length; i++) {
    51             var script = scripts[i],
    52                 src = script.src;
    53             if (src !== "") {
    54                 if (rep.test(src)) {
    55                     script.src = src + '&' + Date.now();
    56                 } else {
    57                     script.src = src + '?' + Date.now();
    58                 }
     2    let process_scripts = false;
     3    const rep = /.*\?.*/;
     4    const links = document.getElementsByTagName('link');
     5    const images = document.getElementsByTagName('img');
     6    const scripts = document.getElementsByTagName('script');
     7    const values = document.getElementsByName('clear-browser-cache');
     8
     9    if (values.length > 0) {
     10        for (let i = 0; i < values.length; i++) {
     11            if (values[i].value === "true") {
     12                process_scripts = true;
     13                break;
    5914            }
    6015        }
    6116    }
     17
     18    const updateUrl = (element, attr) => {
     19        if (element[attr]) {
     20            let url = new URL(element[attr], window.location.origin);
     21            url.searchParams.set('t', Date.now());
     22            element[attr] = url.toString();
     23        }
     24    };
     25
     26    for (let i = 0; i < links.length; i++) {
     27        updateUrl(links[i], 'href');
     28    }
     29
     30    for (let i = 0; i < images.length; i++) {
     31        updateUrl(images[i], 'src');
     32    }
     33
     34    if (process_scripts) {
     35        for (let i = 0; i < scripts.length; i++) {
     36            updateUrl(scripts[i], 'src');
     37        }
     38    }
    6239})();
  • easy-auto-reload/trunk/easy-auto-reload.php

    r3236217 r3248723  
    55 * Plugin URI:        https://infinitumform.com
    66 * Description:       Auto refresh WordPress pages if there is no site activity after after any number of minutes.
    7  * Version:           2.0.1
     7 * Version:           2.0.2
    88 * Author:            Ivijan-Stefan Stipic
    99 * Author URI:        https://www.linkedin.com/in/ivijanstefanstipic/
     
    3535
    3636final class WP_Auto_Refresh{
     37
    3738    /*
    3839     * Private cached class object
     
    101102        }
    102103    }
    103 
     104   
    104105    /*
    105106     * Nonce Life
     
    117118            $this->options = get_option('wp-autorefresh', array());
    118119        }
    119        
    120         // Define the text domain
    121         $textdomain = 'autorefresh';
    122        
     120
     121        // Define text domain
     122        $domain = 'autorefresh';
     123
     124        // First, attempt to load translations from the WordPress languages directory
     125        load_plugin_textdomain($domain, false, WP_LANG_DIR . "/plugins/");
     126
    123127        // Check if the text domain is already loaded
    124         if (!is_textdomain_loaded($textdomain)) {
    125             // Determine the locale
    126             $locale = apply_filters("{$textdomain}_locale", get_locale(), $textdomain);
    127            
    128             // Standard .mo file format
    129             $mofile = "{$textdomain}-{$locale}.mo";
    130 
    131             // Order of loading .mo files
    132             // 1. Load from `/wp-content/languages/plugins`
    133             $loaded = load_textdomain($textdomain, WP_LANG_DIR . "/plugins/{$mofile}");
    134 
    135             // 2. Load from `/wp-content/languages`
    136             if (!$loaded) {
    137                 $loaded = load_textdomain($textdomain, WP_LANG_DIR . "/{$mofile}");
    138             }
    139 
    140             // 3. Load from `/wp-content/plugins/autorefresh/languages`
    141             if (!$loaded) {
    142                 $domain_path = __DIR__ . '/languages';
    143                 $loaded = load_textdomain($textdomain, "{$domain_path}/{$mofile}");
    144 
    145                 // 4. Load with just the locale, without the prefix
    146                 if (!$loaded) {
    147                     $loaded = load_textdomain($textdomain, "{$domain_path}/{$locale}.mo");
     128        if (!is_textdomain_loaded($domain)) {
     129            $locale = apply_filters("{$domain}_locale", get_locale(), $domain);
     130            $domain_path = __DIR__ . '/languages';
     131
     132            // Possible .mo file locations
     133            $mo_files = [
     134                "{$domain_path}/{$domain}-{$locale}.mo",
     135                "{$domain_path}/{$locale}.mo"
     136            ];
     137
     138            // Try to load the translation file
     139            foreach ($mo_files as $mo_file) {
     140                if (file_exists($mo_file) && load_textdomain($domain, $mo_file)) {
     141                    break;
    148142                }
    149143            }
    150 
    151             // If all else fails, use load_plugin_textdomain
    152             if (!$loaded) {
    153                 load_plugin_textdomain($textdomain, false, "{$domain_path}");
    154             }
    155         }
    156     }
    157 
    158    
     144        }
     145    }
     146
    159147    /*
    160148     * Initialize admin settings
     
    240228    }
    241229   
    242      /**
     230    /**
    243231     * Sanitize each setting field as needed
    244232     *
    245233     * @param array $input Contains all settings fields as array keys
    246234     */
    247     public function sanitize( $input )
    248     {
    249         $new_input = array();
    250        
    251         if( isset( $input['timeout'] ) ) {
    252             $new_input['timeout'] = absint( $input['timeout'] );
    253         }
    254        
    255         if( isset( $input['clear_cache'] ) ) {
    256             $new_input['clear_cache'] = absint( $input['clear_cache'] );
    257         }
    258        
    259         if( isset( $input['wp_admin'] ) ) {
    260             $new_input['wp_admin'] = absint( $input['wp_admin'] );
    261         }
    262        
    263         if( isset( $input['global_refresh'] ) ) {
    264             $new_input['global_refresh'] = absint( $input['global_refresh'] );
    265         }
    266 
    267         if( isset( $input['post_type'] ) ) {
    268             $new_input['post_type'] = array_filter(
    269                 is_array($input['post_type'])
    270                 ? array_map('sanitize_text_field', $input['post_type'])
    271                 : []
    272             );
    273         }
    274        
    275         if( isset( $input['nonce_life'] ) ) {
    276             $new_input['nonce_life'] = absint( $input['nonce_life'] );
    277         }
    278 
    279         return $new_input;
    280     }
     235    public function sanitize($input) {
     236        $fields = [
     237            'timeout',
     238            'clear_cache',
     239            'wp_admin',
     240            'global_refresh',
     241            'nonce_life'
     242        ];
     243
     244        $new_input = [];
     245
     246        // Sanitize integer fields
     247        foreach ($fields as $field) {
     248            if (isset($input[$field])) {
     249                $new_input[$field] = absint($input[$field]);
     250            }
     251        }
     252
     253        // Sanitize post_type separately since it's an array
     254        if (!empty($input['post_type']) && is_array($input['post_type'])) {
     255            $new_input['post_type'] = array_map('sanitize_text_field', array_filter($input['post_type']));
     256        }
     257
     258        return $new_input;
     259    }
     260
    281261   
    282262    /*
     
    335315    public function input_nonce_life__callback(){
    336316        printf(
    337             '<input type="number" min="1" step="1" id="nonce_life" name="wp-autorefresh[nonce_life]" value="%d" /><p class="description"><strong>%s</strong><br>%s</p>',
     317            '<input type="number" min="1" step="1" id="nonce_life" name="wp-autorefresh[nonce_life]" value="%d" /><p class="description"><strong style="color: #cc0000;">%s</strong><br>%s</p>',
    338318            esc_attr($this->get_nonce_life()),
    339319            __('WARNING: Do not change if you are not sure what it is for.','autorefresh'),
     
    415395    ?>
    416396   
    417 <!-- <?php printf(__('Auto-reload WordPress pages after %d minutes if there is no site activity.','autorefresh'), esc_html($this->get_timeout())); ?> -->
    418 <script>
    419 /* <![CDATA[ */
    420 (function() {
    421     if (typeof wp == 'undefined') {
    422         var wp = {};
    423     }
     397<!-- <?php printf(__('Auto-reload WordPress pages after %d minutes if there is no site activity.','autorefresh'), esc_html($this->get_timeout())); ?> --><?php ob_start(); ?>
     398<script>/* <![CDATA[ */
     399(function () {
     400    window.wp = window.wp || {};
    424401
    425402    wp.autorefresh = {
     
    436413            'scrollstart': 'window'
    437414        },
    438         callback: function() {
     415        callback: function () {
    439416            if (wp.autorefresh.setTimeOutId) {
    440417                clearTimeout(wp.autorefresh.setTimeOutId);
    441418            }
    442             wp.autorefresh.setTimeOutId = setTimeout(function() {
    443                 <?php if($this->clear_cache()) : ?>
    444                 var head = document.getElementsByTagName('head')[0],
    445                     script = document.createElement("script");
    446 
    447                 script.src = "<?php echo rtrim(plugin_dir_url(__FILE__), '/') . '/assets/js/clear-browser-cache.js'; ?>";
     419            wp.autorefresh.setTimeOutId = setTimeout(function () {
     420                <?php if ($this->clear_cache()) : ?>
     421                var head = document.head || document.getElementsByTagName('head')[0];
     422                if (!head) return;
     423
     424                var script = document.createElement("script");
     425                script.src = "<?php echo esc_url(plugin_dir_url(__FILE__) . 'assets/js/clear-browser-cache.min.js'); ?>";
    448426                script.type = 'text/javascript';
    449427                script.async = true;
    450428                head.appendChild(script);
    451                 script.onload = function() {
    452                     if (typeof caches !== 'undefined') {
    453                         caches.keys().then((keyList) => Promise.all(keyList.map((key) => caches.delete(key))));
    454                     } else {
    455                         // Fallback for browsers that do not support caches API
    456                         var cacheFallbackScript = document.createElement("script");
    457                         cacheFallbackScript.text = "if('serviceWorker' in navigator){navigator.serviceWorker.getRegistrations().then(function(registrations) {for(let registration of registrations) {registration.unregister();}});}";
    458                         head.appendChild(cacheFallbackScript);
     429
     430                script.onload = function () {
     431                    if (typeof caches !== 'undefined' && caches.keys) {
     432                        caches.keys().then(function (keyList) {
     433                            return Promise.all(keyList.map(function (key) {
     434                                return caches.delete(key);
     435                            }));
     436                        }).catch(function (err) {
     437                            console.warn("<?php esc_attr_e('Cache clearing failed:','autorefresh'); ?>", err);
     438                        });
     439                    } else if ('serviceWorker' in navigator) {
     440                        navigator.serviceWorker.getRegistrations().then(function (registrations) {
     441                            for (let registration of registrations) {
     442                                registration.unregister();
     443                            }
     444                        }).catch(function (err) {
     445                            console.warn("<?php esc_attr_e('Service Worker unregister failed:','autorefresh'); ?>", err);
     446                        });
    459447                    }
    460448                };
    461449                <?php endif; ?>
     450               
    462451                location.reload();
    463             }, (1e3 * 60 * <?php echo esc_attr($this->get_timeout()); ?>));
     452            }, 1000 * 60 * <?php echo json_encode($this->get_timeout()); ?>);
    464453        }
    465454    };
    466455
    467     for (var event in wp.autorefresh.events) {
    468         if (wp.autorefresh.events.hasOwnProperty(event)) {
    469             if (wp.autorefresh.events[event] === 'document') {
    470                 document.addEventListener(event, wp.autorefresh.callback);
    471             } else if (wp.autorefresh.events[event] === 'window') {
    472                 window.addEventListener(event, wp.autorefresh.callback);
    473             }
    474         }
    475     }
    476 }());
    477 /* ]]> */
    478 </script>
     456    Object.keys(wp.autorefresh.events).forEach(function (event) {
     457        var target = wp.autorefresh.events[event] === 'document' ? document : window;
     458        target.addEventListener(event, wp.autorefresh.callback);
     459    });
     460})();
     461/* ]]> */</script>
    479462<noscript><meta http-equiv="refresh" content="<?php echo esc_attr($this->get_timeout() * 60); ?>"></noscript>
    480     <?php }
     463    <?php $js_code = ob_get_clean();
     464        echo preg_replace(
     465            [
     466                '/\s+/',
     467                '/\s*([{};,:])\s*/'
     468            ],
     469            [
     470                ' ',
     471                '$1'
     472            ],
     473            $js_code
     474        );
     475    }
    481476   
    482477    /*
     
    510505        ?>
    511506        <p>
    512             <label for="easy_auto_reload_mode"><?php esc_html_e('Refresh option:','autorefresh'); ?></label><br>
     507            <label for="easy_auto_reload_mode"><?php esc_html_e('Refresh option:', 'autorefresh'); ?></label><br>
    513508            <select name="_auto_reload_mode" id="easy_auto_reload_mode" style="width:100%; max-width:90%;">
    514                 <option value="automatic" <?php selected( $select_value, 'automatic' ); ?>><?php esc_html_e('Automatic','autorefresh'); ?></option>
    515                 <option value="custom" <?php selected( $select_value, 'custom' ); ?>><?php esc_html_e('Custom','autorefresh'); ?></option>
    516                 <option value="disabled" <?php selected( $select_value, 'disabled' ); ?>><?php esc_html_e('Disabled','autorefresh'); ?></option>
     509                <?php
     510                $options = [
     511                    'automatic' => __('Automatic', 'autorefresh'),
     512                    'custom'    => __('Custom', 'autorefresh'),
     513                    'disabled'  => __('Disabled', 'autorefresh')
     514                ];
     515
     516                // Loop kroz opcije
     517                foreach ($options as $value => $label) {
     518                    printf(
     519                        '<option value="%s" %s>%s</option>',
     520                        esc_attr($value),
     521                        selected($select_value, $value, false),
     522                        esc_html($label)
     523                    );
     524                }
     525                ?>
    517526            </select>
    518527        </p>
    519528        <p>
    520             <label for="easy_auto_reload_time"><?php esc_html_e('Refresh interval in minutes:','autorefresh'); ?></label>
    521             <input type="number" name="_auto_reload_time" id="easy_auto_reload_time" value="<?php echo esc_attr( $number_value ); ?>" min="1" step="1" style="width:100%; max-width:100px;"<?php echo (in_array($select_value, ['disabled', 'automatic']) ? ' class="disabled" disabled' : ''); ?> />
     529            <label for="easy_auto_reload_time"><?php esc_html_e('Refresh interval in minutes:', 'autorefresh'); ?></label>
     530            <input
     531                type="number"
     532                name="_auto_reload_time"
     533                id="easy_auto_reload_time"
     534                value="<?php echo esc_attr($number_value); ?>"
     535                min="1"
     536                step="1"
     537                style="width: 100%; max-width: 100px;"
     538                <?php echo in_array($select_value, ['disabled', 'automatic']) ? 'class="disabled" disabled' : ''; ?>
     539            />
    522540        </p>
    523541        <?php add_action('admin_footer', function() { ?>
    524542<script>
     543/* <![CDATA[ */
    525544document.addEventListener('DOMContentLoaded', function () {
    526545    var modeSelect = document.getElementById('easy_auto_reload_mode');
     
    539558    modeSelect.addEventListener('change', toggleTimeInput);
    540559});
     560/* ]]> */
    541561</script>
    542562        <?php }, 1, 0);
  • easy-auto-reload/trunk/languages/autorefresh-en_US.po

    r3236217 r3248723  
    22msgstr ""
    33"Project-Id-Version: Easy Auto Reload\n"
    4 "POT-Creation-Date: 2025-02-06 19:44+0100\n"
    5 "PO-Revision-Date: 2025-02-06 19:44+0100\n"
     4"POT-Creation-Date: 2025-02-28 21:39+0100\n"
     5"PO-Revision-Date: 2025-02-28 21:39+0100\n"
    66"Last-Translator: Ivijan-Stefan Stipić <infinitumform@gmail.com>\n"
    77"Language-Team: \n"
     
    2222"X-Poedit-SearchPathExcluded-0: *.min.js\n"
    2323
    24 #: easy-auto-reload.php:171
     24#: easy-auto-reload.php:159
    2525msgid "Auto-Refresh Settings"
    2626msgstr ""
    2727
    28 #: easy-auto-reload.php:178 easy-auto-reload.php:233 easy-auto-reload.php:234
    29 #: easy-auto-reload.php:291
     28#: easy-auto-reload.php:166 easy-auto-reload.php:221 easy-auto-reload.php:222
     29#: easy-auto-reload.php:271
    3030msgid "Auto-Refresh"
    3131msgstr ""
    3232
    33 #: easy-auto-reload.php:186
     33#: easy-auto-reload.php:174
    3434msgid "Auto-Refresh Timeout"
    3535msgstr ""
    3636
    37 #: easy-auto-reload.php:194
     37#: easy-auto-reload.php:182
    3838msgid "Browser Cache"
    3939msgstr ""
    4040
    41 #: easy-auto-reload.php:202
     41#: easy-auto-reload.php:190
    4242msgid "WP Admin"
    4343msgstr ""
    4444
    45 #: easy-auto-reload.php:211
     45#: easy-auto-reload.php:199
    4646msgid "Lifespan of nonces"
    4747msgstr ""
    4848
    49 #: easy-auto-reload.php:220
     49#: easy-auto-reload.php:208
    5050msgid "Allow custom refresh in page and post types"
    5151msgstr ""
    5252
    53 #: easy-auto-reload.php:308
     53#: easy-auto-reload.php:288
    5454msgid ""
    5555"Automatically reloads web pages after any number of minutes if the user or "
     
    5757msgstr ""
    5858
    59 #: easy-auto-reload.php:315
     59#: easy-auto-reload.php:295
    6060msgid "Enable auto refresh globally on the entire site."
    6161msgstr ""
    6262
    63 #: easy-auto-reload.php:316
     63#: easy-auto-reload.php:296
    6464msgid "INFO:"
    6565msgstr ""
    6666
    67 #: easy-auto-reload.php:317
     67#: easy-auto-reload.php:297
    6868msgid ""
    6969"Even if this function is disabled, you can still choose for each page "
     
    7171msgstr ""
    7272
    73 #: easy-auto-reload.php:328
     73#: easy-auto-reload.php:308
    7474msgid "Enter the number in minutes."
    7575msgstr ""
    7676
    77 #: easy-auto-reload.php:339
     77#: easy-auto-reload.php:319
    7878msgid "WARNING: Do not change if you are not sure what it is for."
    7979msgstr ""
    8080
    81 #: easy-auto-reload.php:340
     81#: easy-auto-reload.php:320
    8282msgid ""
    8383"This field is used to define the lifespan of nonces in seconds. By default, "
     
    8989msgstr ""
    9090
    91 #: easy-auto-reload.php:351
     91#: easy-auto-reload.php:331
    9292msgid "Clear the browser cache during refresh."
    9393msgstr ""
    9494
    95 #: easy-auto-reload.php:362
     95#: easy-auto-reload.php:342
    9696msgid "Enable autoefresh inside WP Admin."
    9797msgstr ""
    9898
    99 #: easy-auto-reload.php:391
     99#: easy-auto-reload.php:371
    100100msgid ""
    101101"Enable autorefresh settings within pages and posts to have individual "
     
    103103msgstr ""
    104104
    105 #: easy-auto-reload.php:417
     105#: easy-auto-reload.php:397
    106106#, php-format
    107107msgid ""
     
    109109msgstr ""
    110110
    111 #: easy-auto-reload.php:495
     111#: easy-auto-reload.php:437
     112msgid "Cache clearing failed:"
     113msgstr ""
     114
     115#: easy-auto-reload.php:445
     116msgid "Service Worker unregister failed:"
     117msgstr ""
     118
     119#: easy-auto-reload.php:490
    112120msgid "Auto Reload"
    113121msgstr ""
    114122
    115 #: easy-auto-reload.php:512
     123#: easy-auto-reload.php:507
    116124msgid "Refresh option:"
    117125msgstr ""
    118126
    119 #: easy-auto-reload.php:514
     127#: easy-auto-reload.php:511
    120128msgid "Automatic"
    121129msgstr ""
    122130
    123 #: easy-auto-reload.php:515
     131#: easy-auto-reload.php:512
    124132msgid "Custom"
    125133msgstr ""
    126134
    127 #: easy-auto-reload.php:516
     135#: easy-auto-reload.php:513
    128136msgid "Disabled"
    129137msgstr ""
    130138
    131 #: easy-auto-reload.php:520
     139#: easy-auto-reload.php:529
    132140msgid "Refresh interval in minutes:"
    133141msgstr ""
  • easy-auto-reload/trunk/languages/autorefresh-hr.po

    r3236217 r3248723  
    22msgstr ""
    33"Project-Id-Version: Easy Auto Reload\n"
    4 "POT-Creation-Date: 2025-02-06 19:46+0100\n"
    5 "PO-Revision-Date: 2025-02-06 19:47+0100\n"
     4"POT-Creation-Date: 2025-02-28 21:38+0100\n"
     5"PO-Revision-Date: 2025-02-28 21:39+0100\n"
    66"Last-Translator: Ivijan-Stefan Stipić <infinitumform@gmail.com>\n"
    77"Language-Team: \n"
     
    2323"X-Poedit-SearchPathExcluded-0: *.min.js\n"
    2424
    25 #: easy-auto-reload.php:171
     25#: easy-auto-reload.php:159
    2626msgid "Auto-Refresh Settings"
    2727msgstr "Postavke automatskog osvježavanja"
    2828
    29 #: easy-auto-reload.php:178 easy-auto-reload.php:233 easy-auto-reload.php:234
    30 #: easy-auto-reload.php:291
     29#: easy-auto-reload.php:166 easy-auto-reload.php:221 easy-auto-reload.php:222
     30#: easy-auto-reload.php:271
    3131msgid "Auto-Refresh"
    3232msgstr "Automatsko osvježavanje"
    3333
    34 #: easy-auto-reload.php:186
     34#: easy-auto-reload.php:174
    3535msgid "Auto-Refresh Timeout"
    3636msgstr "Istek automatskog osvježavanja"
    3737
    38 #: easy-auto-reload.php:194
     38#: easy-auto-reload.php:182
    3939msgid "Browser Cache"
    4040msgstr "Predmemorija preglednika"
    4141
    42 #: easy-auto-reload.php:202
     42#: easy-auto-reload.php:190
    4343msgid "WP Admin"
    4444msgstr ""
    4545
    46 #: easy-auto-reload.php:211
     46#: easy-auto-reload.php:199
    4747msgid "Lifespan of nonces"
    4848msgstr "Vrijeme isteka za \"nonces\""
    4949
    50 #: easy-auto-reload.php:220
     50#: easy-auto-reload.php:208
    5151msgid "Allow custom refresh in page and post types"
    5252msgstr "Dopusti prilagođeno osvježavanje u vrstama stranica i postova"
    5353
    54 #: easy-auto-reload.php:308
     54#: easy-auto-reload.php:288
    5555msgid ""
    5656"Automatically reloads web pages after any number of minutes if the user or "
     
    6060"korisnik ili posjetitelj nije aktivan na stranici."
    6161
    62 #: easy-auto-reload.php:315
     62#: easy-auto-reload.php:295
    6363msgid "Enable auto refresh globally on the entire site."
    6464msgstr "Omogućite globalno automatsko osvježavanje na cijeloj web stranici."
    6565
    66 #: easy-auto-reload.php:316
     66#: easy-auto-reload.php:296
    6767msgid "INFO:"
    6868msgstr "INFORMACIJE:"
    6969
    70 #: easy-auto-reload.php:317
     70#: easy-auto-reload.php:297
    7171msgid ""
    7272"Even if this function is disabled, you can still choose for each page "
     
    7676"stranicu pojedinačno želite li da se osvježi."
    7777
    78 #: easy-auto-reload.php:328
     78#: easy-auto-reload.php:308
    7979msgid "Enter the number in minutes."
    8080msgstr "Unesite broj u minutama."
    8181
    82 #: easy-auto-reload.php:339
     82#: easy-auto-reload.php:319
    8383msgid "WARNING: Do not change if you are not sure what it is for."
    8484msgstr "UPOZORENJE: Ne mijenjajte ako niste sigurni čemu služi."
    8585
    86 #: easy-auto-reload.php:340
     86#: easy-auto-reload.php:320
    8787msgid ""
    8888"This field is used to define the lifespan of nonces in seconds. By default, "
     
    101101"zahtjeve prije nego napravite promjene u ovim postavkama."
    102102
    103 #: easy-auto-reload.php:351
     103#: easy-auto-reload.php:331
    104104msgid "Clear the browser cache during refresh."
    105105msgstr "Izbrišite predmemoriju preglednika tijekom osvježavanja."
    106106
    107 #: easy-auto-reload.php:362
     107#: easy-auto-reload.php:342
    108108msgid "Enable autoefresh inside WP Admin."
    109109msgstr "Omogućite automatsko osvježavanje unutar WP Admin."
    110110
    111 #: easy-auto-reload.php:391
     111#: easy-auto-reload.php:371
    112112msgid ""
    113113"Enable autorefresh settings within pages and posts to have individual "
     
    117117"biste imali individualnu kontrolu."
    118118
    119 #: easy-auto-reload.php:417
     119#: easy-auto-reload.php:397
    120120#, php-format
    121121msgid ""
     
    125125"aktivnosti na web-lokaciji."
    126126
    127 #: easy-auto-reload.php:495
     127#: easy-auto-reload.php:437
     128msgid "Cache clearing failed:"
     129msgstr "Greška pri brisanju predmemorije:"
     130
     131#: easy-auto-reload.php:445
     132msgid "Service Worker unregister failed:"
     133msgstr "Greška pri odjavi Service Workera:"
     134
     135#: easy-auto-reload.php:490
    128136msgid "Auto Reload"
    129137msgstr "Automatsko učitavanje"
    130138
    131 #: easy-auto-reload.php:512
     139#: easy-auto-reload.php:507
    132140msgid "Refresh option:"
    133141msgstr "Opcija osvježavanja:"
    134142
    135 #: easy-auto-reload.php:514
     143#: easy-auto-reload.php:511
    136144msgid "Automatic"
    137145msgstr "Automatski"
    138146
    139 #: easy-auto-reload.php:515
     147#: easy-auto-reload.php:512
    140148msgid "Custom"
    141149msgstr "Uobičajeno"
    142150
    143 #: easy-auto-reload.php:516
     151#: easy-auto-reload.php:513
    144152msgid "Disabled"
    145153msgstr "Onesposobljeno"
    146154
    147 #: easy-auto-reload.php:520
     155#: easy-auto-reload.php:529
    148156msgid "Refresh interval in minutes:"
    149157msgstr "Interval osvježavanja u minutama:"
  • easy-auto-reload/trunk/languages/autorefresh-sr_RS.po

    r3236217 r3248723  
    22msgstr ""
    33"Project-Id-Version: Easy Auto Reload\n"
    4 "POT-Creation-Date: 2025-02-06 19:45+0100\n"
    5 "PO-Revision-Date: 2025-02-06 19:48+0100\n"
     4"POT-Creation-Date: 2025-02-28 21:36+0100\n"
     5"PO-Revision-Date: 2025-02-28 21:44+0100\n"
    66"Last-Translator: Ivijan-Stefan Stipić <infinitumform@gmail.com>\n"
    77"Language-Team: \n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
     12"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
     13"n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
    1314"X-Generator: Poedit 3.5\n"
    1415"X-Poedit-Basepath: ..\n"
     
    1617"X-Poedit-WPHeader: easy-auto-reload.php\n"
    1718"X-Poedit-SourceCharset: UTF-8\n"
    18 "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
     19"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
     20"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;"
     21"_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
    1922"X-Poedit-SearchPath-0: .\n"
    2023"X-Poedit-SearchPathExcluded-0: *.min.js\n"
    2124
    22 #: easy-auto-reload.php:171
     25#: easy-auto-reload.php:159
    2326msgid "Auto-Refresh Settings"
    2427msgstr "Подешавања аутоматског освежавања"
    2528
    26 #: easy-auto-reload.php:178 easy-auto-reload.php:233 easy-auto-reload.php:234
    27 #: easy-auto-reload.php:291
     29#: easy-auto-reload.php:166 easy-auto-reload.php:221 easy-auto-reload.php:222
     30#: easy-auto-reload.php:271
    2831msgid "Auto-Refresh"
    2932msgstr "Аутоматско освежавање"
    3033
    31 #: easy-auto-reload.php:186
     34#: easy-auto-reload.php:174
    3235msgid "Auto-Refresh Timeout"
    3336msgstr "Временско ограничење аутоматског освежавања"
    3437
    35 #: easy-auto-reload.php:194
     38#: easy-auto-reload.php:182
    3639msgid "Browser Cache"
    3740msgstr "Кеш претраживача"
    3841
    39 #: easy-auto-reload.php:202
     42#: easy-auto-reload.php:190
    4043msgid "WP Admin"
    4144msgstr "Вордпресс администрација"
    4245
    43 #: easy-auto-reload.php:211
     46#: easy-auto-reload.php:199
    4447msgid "Lifespan of nonces"
    4548msgstr "Време трајања за \"nonces\""
    4649
    47 #: easy-auto-reload.php:220
     50#: easy-auto-reload.php:208
    4851msgid "Allow custom refresh in page and post types"
    4952msgstr "Дозволите прилагођено освежавање у страницама и постовима"
    5053
    51 #: easy-auto-reload.php:308
    52 msgid "Automatically reloads web pages after any number of minutes if the user or visitor is not active on the site."
    53 msgstr "Аутоматски поново учитавање веб страница након било којег броја минута ако корисник или посетилац није активан на сајту."
     54#: easy-auto-reload.php:288
     55msgid ""
     56"Automatically reloads web pages after any number of minutes if the user or "
     57"visitor is not active on the site."
     58msgstr ""
     59"Аутоматски поново учитавање веб страница након било којег броја минута ако "
     60"корисник или посетилац није активан на сајту."
    5461
    55 #: easy-auto-reload.php:315
     62#: easy-auto-reload.php:295
    5663msgid "Enable auto refresh globally on the entire site."
    5764msgstr "Омогућите глобално аутоматско освежавање на целом сајту."
    5865
    59 #: easy-auto-reload.php:316
     66#: easy-auto-reload.php:296
    6067msgid "INFO:"
    6168msgstr "ИНФОРМАЦИЈА:"
    6269
    63 #: easy-auto-reload.php:317
    64 msgid "Even if this function is disabled, you can still choose for each page individually whether you want it to refresh."
    65 msgstr "Чак и ако је ова функција онемогућена, и даље можете да изаберете за сваку страницу појединачно да ли желите да се освежи."
     70#: easy-auto-reload.php:297
     71msgid ""
     72"Even if this function is disabled, you can still choose for each page "
     73"individually whether you want it to refresh."
     74msgstr ""
     75"Чак и ако је ова функција онемогућена, и даље можете да изаберете за сваку "
     76"страницу појединачно да ли желите да се освежи."
    6677
    67 #: easy-auto-reload.php:328
     78#: easy-auto-reload.php:308
    6879msgid "Enter the number in minutes."
    6980msgstr "Унесите број у минутима."
    7081
    71 #: easy-auto-reload.php:339
     82#: easy-auto-reload.php:319
    7283msgid "WARNING: Do not change if you are not sure what it is for."
    7384msgstr "УПОЗОРЕЊЕ: Не мењајте ако нисте сигурни за шта служи."
    7485
    75 #: easy-auto-reload.php:340
    76 msgid "This field is used to define the lifespan of nonces in seconds. By default, nonces have a lifespan of 86,400 seconds, which is equivalent to one day. It's important to exercise caution when considering any extensions to this value, as longer lifespans may introduce security risks by extending the window of opportunity for potential attacks. Please ensure you carefully assess your security requirements before making changes to this setting."
    77 msgstr "Ово поље се користи да се дефинише трајање \"nonce\" вредности у секундама. Подразумевано, \"nonce\" вредности имају трајање од 86.400 секунди, што је еквивалентно једном дану. Важно је да будете опрезни при разматрању продужавања ове вредности, јер дуже трајање може увести безбедносне ризике ширењем прозора прилике за потенцијалне нападе. Молимо вас да пажљиво процените своје безбедносне захтеве пре него што направите измене на овим подешавањима."
     86#: easy-auto-reload.php:320
     87msgid ""
     88"This field is used to define the lifespan of nonces in seconds. By default, "
     89"nonces have a lifespan of 86,400 seconds, which is equivalent to one day. "
     90"It's important to exercise caution when considering any extensions to this "
     91"value, as longer lifespans may introduce security risks by extending the "
     92"window of opportunity for potential attacks. Please ensure you carefully "
     93"assess your security requirements before making changes to this setting."
     94msgstr ""
     95"Ово поље се користи да се дефинише трајање \"nonce\" вредности у секундама. "
     96"Подразумевано, \"nonce\" вредности имају трајање од 86.400 секунди, што је "
     97"еквивалентно једном дану. Важно је да будете опрезни при разматрању "
     98"продужавања ове вредности, јер дуже трајање може увести безбедносне ризике "
     99"ширењем прозора прилике за потенцијалне нападе. Молимо вас да пажљиво "
     100"процените своје безбедносне захтеве пре него што направите измене на овим "
     101"подешавањима."
    78102
    79 #: easy-auto-reload.php:351
     103#: easy-auto-reload.php:331
    80104msgid "Clear the browser cache during refresh."
    81105msgstr "Обришите кеш претраживач током освежавања."
    82106
    83 #: easy-auto-reload.php:362
     107#: easy-auto-reload.php:342
    84108msgid "Enable autoefresh inside WP Admin."
    85109msgstr "Омогућите аутоматско освежавање унутар ВП Админ-а."
    86110
    87 #: easy-auto-reload.php:391
    88 msgid "Enable autorefresh settings within pages and posts to have individual control."
    89 msgstr "Омогућите подешавања аутоматског освежавања унутар страница и постова да бисте имали индивидуалну контролу."
     111#: easy-auto-reload.php:371
     112msgid ""
     113"Enable autorefresh settings within pages and posts to have individual "
     114"control."
     115msgstr ""
     116"Омогућите подешавања аутоматског освежавања унутар страница и постова да "
     117"бисте имали индивидуалну контролу."
    90118
    91 #: easy-auto-reload.php:417
     119#: easy-auto-reload.php:397
    92120#, php-format
    93 msgid "Auto-reload WordPress pages after %d minutes if there is no site activity."
    94 msgstr "Аутоматски поново учитајте Вордпресс странице након %d минута ако нема активности на сајту."
     121msgid ""
     122"Auto-reload WordPress pages after %d minutes if there is no site activity."
     123msgstr ""
     124"Аутоматски поново учитајте Вордпресс странице након %d минута ако нема "
     125"активности на сајту."
    95126
    96 #: easy-auto-reload.php:495
     127#: easy-auto-reload.php:437
     128msgid "Cache clearing failed:"
     129msgstr "Грешка при брисању кеша:"
     130
     131#: easy-auto-reload.php:445
     132msgid "Service Worker unregister failed:"
     133msgstr "Грешка при уклањању сервисног радника:"
     134
     135#: easy-auto-reload.php:490
    97136msgid "Auto Reload"
    98137msgstr "Аутоматско учитавање"
    99138
    100 #: easy-auto-reload.php:512
     139#: easy-auto-reload.php:507
    101140msgid "Refresh option:"
    102141msgstr "Opcija osvežavanja:"
    103142
    104 #: easy-auto-reload.php:514
     143#: easy-auto-reload.php:511
    105144msgid "Automatic"
    106145msgstr "Аутоматски"
    107146
    108 #: easy-auto-reload.php:515
     147#: easy-auto-reload.php:512
    109148msgid "Custom"
    110149msgstr "Прилагођено"
    111150
    112 #: easy-auto-reload.php:516
     151#: easy-auto-reload.php:513
    113152msgid "Disabled"
    114153msgstr "Онемогућено"
    115154
    116 #: easy-auto-reload.php:520
     155#: easy-auto-reload.php:529
    117156msgid "Refresh interval in minutes:"
    118157msgstr "Интервал освежавања у минутима:"
     
    127166
    128167#. Description of the plugin/theme
    129 msgid "Auto refresh WordPress pages if there is no site activity after after any number of minutes."
    130 msgstr "Аутоматско освежавање Вордпресс страница ако нема активности на сајту након било којег броја минута."
     168msgid ""
     169"Auto refresh WordPress pages if there is no site activity after after any "
     170"number of minutes."
     171msgstr ""
     172"Аутоматско освежавање Вордпресс страница ако нема активности на сајту након "
     173"било којег броја минута."
    131174
    132175#. Author of the plugin/theme
     
    137180msgid "https://www.linkedin.com/in/ivijanstefanstipic/"
    138181msgstr ""
    139 
  • easy-auto-reload/trunk/readme.txt

    r3236408 r3248723  
    1 === Easy Auto Reload - Auto Refresh WP ===
     1=== Easy Auto Reload - Auto Refresh ===
    22Contributors: creativform, ivijanstefan
    33Donate link:
     
    66Tested up to: 6.7
    77Requires PHP: 7.0
    8 Stable tag: 2.0.1
     8Stable tag: 2.0.2
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1111Donate link: https://www.buymeacoffee.com/ivijanstefan
    1212
    13 Automatically refreshes your WordPress site at specified intervals to maintain session integrity and enhance user engagement.
     13Auto Refresh & Reload plugin for WordPress. Keep your website fresh by refreshing page after a set interval. Perfect for nonces & abandoned pages.
    1414
    15 === Description ==
     15== Description ==
    1616
    17 **Easy Auto Reload** is a WordPress plugin designed to automatically refresh your website pages after a specified period of inactivity. This ensures that your content remains current and that session-related functionalities, such as nonces, are properly managed.
     17Welcome to the bustling world of the digital café, where visitors explore, indulge, and sometimes linger a little too long. Introducing the Easy Auto Reload plugin, your virtual barista, ensuring that your website always offers a fresh and engaging experience.
    1818
    19 = Key Features =
     19### What Does It Do?
    2020
    21 - **Automatic Page Refresh**: Set a custom interval to refresh pages after user inactivity, ensuring content stays up-to-date.
    22 - **Session Management**: Helps in managing session expirations and nonces by refreshing pages, reducing potential security risks.
    23 - **User Engagement**: Keeps users engaged by ensuring they view the most recent content without manual reloads.
    24 - **Customizable Settings**: Easily configure refresh intervals and specify pages or sections to include or exclude from automatic refresh.
     21Think of Easy Auto Reload as a continual caffeine injection for your website. It's designed to:
    2522
    26 = Use Cases =
     23- Refresh the page automatically after a defined interval if there's no activity from the visitor.
     24- Keep things lively and engaging, attracting more footfall to your digital café.
     25- Avoid unnecessary reloads if the visitor is actively interacting, thus offering a seamless browsing experience.
     26- Refresh only when the café is unattended or if a new tab opens the site.
    2727
    28 - **Security**: Automatically refresh pages to manage nonces and prevent unauthorized actions due to expired sessions.
    29 - **Dynamic Content**: Ensure users always see the latest content on news sites, stock tickers, or live blogs.
    30 - **Idle Timeout**: Redirect or refresh pages after a period of inactivity to maintain session integrity.
     28### Why Do You Need It?
     29
     30This plugin is a must-have for managing those pesky nonces that occasionally require a refresh. Its setup is as easy as pouring a cup of coffee. Just input the number of minutes between reloads, and presto! Your website will pulsate with the liveliness of a bustling café.
     31
     32Treat your website to the Easy Auto Reload plugin. It's a refreshing touch that your digital space deserves.
     33
     34Cheers!
    3135
    3236= P.S. =
     
    3640== Installation ==
    3741
    38 1. **Automatic Installation**:
    39    - Navigate to `WP-Admin -> Plugins -> Add New`.
    40    - Search for "Easy Auto Reload" and click the "Install Now" button.
    41 
    42 2. **Manual Installation**:
    43    - Upload the `autorefresh.zip` file to the `/wp-content/plugins/` directory via the WordPress admin panel or extract the contents and upload the folder via FTP.
    44 
    45 3. **Activation**:
    46    - Activate the plugin through the "Plugins" menu in WordPress.
    47 
    48 4. **Configuration**:
    49    - Go to `Settings -> Auto Refresh` to customize the plugin settings according to your requirements.
    50 
    51 == Frequently Asked Questions ==
    52 
    53 = How do I set the refresh interval? =
    54 
    55 After activating the plugin, navigate to `Settings -> Auto Refresh` in your WordPress dashboard. Here, you can specify the desired refresh interval in minutes.
    56 
    57 = Will the plugin refresh pages if the user is active? =
    58 
    59 No, the plugin is designed to detect user activity. Pages will only refresh after the specified period of inactivity to ensure a seamless user experience.
    60 
    61 = Can I exclude certain pages from auto-refresh? =
    62 
    63 Yes, within the plugin settings, you can specify pages or sections to exclude from automatic refreshing.
     421. Navigate to `WP-Admin -> Plugins -> Add New`, search for "Auto Refresh," and click the "Install" button.
     432. Alternatively, upload **autorefresh.zip** to `/wp-content/plugins` directory via the WordPress admin panel or upload the unzipped folder to your plugins folder via FTP.
     443. Activate the plugin through the "Plugins" menu in WordPress.
     454. Proceed to `Settings -> Auto Refresh` to update the options and customize as you like.
    6446
    6547== Changelog ==
     48
     49= 2.0.2 =
     50* Fixed JavaScript errors when clearing cache
     51* Optimize JavaScript and code minification
     52* Fixed GUI and optimized PHP code
    6653
    6754= 2.0.1 =
     
    1191061. Admin Settings
    1201072. Page and post settings
    121 3. Disabled auto refresh
Note: See TracChangeset for help on using the changeset viewer.