Plugin Directory

Changeset 3338735


Ignore:
Timestamp:
08/04/2025 06:19:45 AM (7 months ago)
Author:
Tkama
Message:

Update to version 6.1.1 from GitHub

Location:
democracy-poll
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • democracy-poll/tags/6.1.1/classes/Poll_Renderer.php

    r3330963 r3338735  
    100100        // never use a poll caching mechanism in admin
    101101        if( ! $this->in_archive && ! is_admin() && plugin()->is_cachegear_on ){
    102             $html .= '
    103             <!--noindex-->
    104             <div class="dem-cache-screens" style="display:none;" data-opt_logs="' . (int) options()->keep_logs . '">';
    105 
    106             $saved_voted_for = $poll->voted_for;
    107             $poll->voted_for = '';
    108             $this->for_cache = true;
    109 
    110             // voted screen
    111             if( ! $this->not_show_results ){
    112                 $html .= self::minify_html( $this->get_screen_basis( 'voted' ) );
    113             }
    114 
    115             // vote screen
    116             if( $poll->open ){
    117                 $html .= self::minify_html( $this->get_screen_basis( 'force_vote' ) );
    118             }
    119 
    120             $this->for_cache = false;
    121             $poll->voted_for = $saved_voted_for;
    122 
    123             $html .= '
    124             </div>
    125             <!--/noindex-->';
     102            $html .= $this->get_cache_screens();
    126103        }
    127104
     
    131108
    132109        return Poll_Utils::get_minified_styles_once() . $html;
     110    }
     111
     112    protected function get_cache_screens(): string {
     113        $poll = $this->poll; // simplify
     114
     115        $saved_voted_for = $poll->voted_for;
     116        $poll->voted_for = '';
     117        $this->for_cache = true;
     118
     119        $html = '';
     120        // voted screen
     121        if( ! $this->not_show_results ){
     122            $html .= self::minify_html( $this->get_screen_basis( 'voted' ) );
     123        }
     124
     125        // vote screen
     126        if( $poll->open ){
     127            $html .= self::minify_html( $this->get_screen_basis( 'force_vote' ) );
     128        }
     129
     130        $this->for_cache = false;
     131        $poll->voted_for = $saved_voted_for;
     132
     133        $is_keep_logs = options()->keep_logs ? 1 : 0;
     134        return <<<HTML
     135            <!--noindex-->
     136            <div class="dem-cache-screens" style="display:none;" data-opt_logs="$is_keep_logs">$html</div>
     137            <!--/noindex-->
     138            HTML;
    133139    }
    134140
     
    503509    public static function voted_notice_html( $msg = '' ): string {
    504510        $js = <<<'JS'
    505             let el = this.parentElement; el.animate([{ opacity:1 }, { opacity:0 }], { duration:300 }).onfinish = () => { el.style.display = 'none'; };
     511            let el = this.parentElement; el.animate([{ opacity:1 }, { opacity:0 }], { duration:300 }).onfinish = () => { el.style.display = 'none' }
    506512            JS;
    507513
     
    513519                </div>
    514520                HTML,
    515                 [ '{JS}' => $js, '{MESSAGE}' => _x( 'You or your IP had already vote.', 'front', 'democracy-poll' ) ]
     521                [ '{JS}' => esc_attr( $js ), '{MESSAGE}' => _x( 'You or your IP had already vote.', 'front', 'democracy-poll' ) ]
    516522            );
    517523        }
     
    523529                </div>
    524530                HTML,
    525             [ '{JS}' => $js, '{MESSAGE}' => $msg ]
     531            [ '{JS}' => esc_attr( $js ), '{MESSAGE}' => $msg ]
    526532        );
    527533    }
  • democracy-poll/tags/6.1.1/democracy.php

    r3330963 r3338735  
    1414 * Requires PHP: 7.4
    1515 *
    16  * Version: 6.1.0
     16 * Version: 6.1.1
    1717 */
    1818
  • democracy-poll/tags/6.1.1/js/democracy.js

    r3330963 r3338735  
    290290    // устанавливает ответы пользователя в блоке результатов/голосования
    291291    Dem.cacheSetAnswrs = function( $screen, answrs ){
    292 
    293292        var aids = answrs.split( /,/ )
    294293
     
    310309            $screen.find( '.dem-vote-link' ).remove()
    311310        }
    312 
    313311        // если голосование
    314312        else {
     
    337335                $screen.find( '.dem-revote-button-wrap' ).show()
    338336            }
    339 
    340         }
    341 
     337        }
    342338    }
    343339
    344340    jQuery.fn.demCacheInit = function(){
    345 
    346341        return this.each( function(){
    347 
    348342            var $the = jQuery( this )
    349343
  • democracy-poll/tags/6.1.1/readme.txt

    r3330963 r3338735  
    120120
    121121== Upgrade Notice ==
     122
     123= 6.1.1 =
     124- FIX: esc_attr() added for inline js to fix possible bugs on some servers.
    122125
    123126= 6.1.0 =
  • democracy-poll/trunk/classes/Poll_Renderer.php

    r3330963 r3338735  
    100100        // never use a poll caching mechanism in admin
    101101        if( ! $this->in_archive && ! is_admin() && plugin()->is_cachegear_on ){
    102             $html .= '
    103             <!--noindex-->
    104             <div class="dem-cache-screens" style="display:none;" data-opt_logs="' . (int) options()->keep_logs . '">';
    105 
    106             $saved_voted_for = $poll->voted_for;
    107             $poll->voted_for = '';
    108             $this->for_cache = true;
    109 
    110             // voted screen
    111             if( ! $this->not_show_results ){
    112                 $html .= self::minify_html( $this->get_screen_basis( 'voted' ) );
    113             }
    114 
    115             // vote screen
    116             if( $poll->open ){
    117                 $html .= self::minify_html( $this->get_screen_basis( 'force_vote' ) );
    118             }
    119 
    120             $this->for_cache = false;
    121             $poll->voted_for = $saved_voted_for;
    122 
    123             $html .= '
    124             </div>
    125             <!--/noindex-->';
     102            $html .= $this->get_cache_screens();
    126103        }
    127104
     
    131108
    132109        return Poll_Utils::get_minified_styles_once() . $html;
     110    }
     111
     112    protected function get_cache_screens(): string {
     113        $poll = $this->poll; // simplify
     114
     115        $saved_voted_for = $poll->voted_for;
     116        $poll->voted_for = '';
     117        $this->for_cache = true;
     118
     119        $html = '';
     120        // voted screen
     121        if( ! $this->not_show_results ){
     122            $html .= self::minify_html( $this->get_screen_basis( 'voted' ) );
     123        }
     124
     125        // vote screen
     126        if( $poll->open ){
     127            $html .= self::minify_html( $this->get_screen_basis( 'force_vote' ) );
     128        }
     129
     130        $this->for_cache = false;
     131        $poll->voted_for = $saved_voted_for;
     132
     133        $is_keep_logs = options()->keep_logs ? 1 : 0;
     134        return <<<HTML
     135            <!--noindex-->
     136            <div class="dem-cache-screens" style="display:none;" data-opt_logs="$is_keep_logs">$html</div>
     137            <!--/noindex-->
     138            HTML;
    133139    }
    134140
     
    503509    public static function voted_notice_html( $msg = '' ): string {
    504510        $js = <<<'JS'
    505             let el = this.parentElement; el.animate([{ opacity:1 }, { opacity:0 }], { duration:300 }).onfinish = () => { el.style.display = 'none'; };
     511            let el = this.parentElement; el.animate([{ opacity:1 }, { opacity:0 }], { duration:300 }).onfinish = () => { el.style.display = 'none' }
    506512            JS;
    507513
     
    513519                </div>
    514520                HTML,
    515                 [ '{JS}' => $js, '{MESSAGE}' => _x( 'You or your IP had already vote.', 'front', 'democracy-poll' ) ]
     521                [ '{JS}' => esc_attr( $js ), '{MESSAGE}' => _x( 'You or your IP had already vote.', 'front', 'democracy-poll' ) ]
    516522            );
    517523        }
     
    523529                </div>
    524530                HTML,
    525             [ '{JS}' => $js, '{MESSAGE}' => $msg ]
     531            [ '{JS}' => esc_attr( $js ), '{MESSAGE}' => $msg ]
    526532        );
    527533    }
  • democracy-poll/trunk/democracy.php

    r3330963 r3338735  
    1414 * Requires PHP: 7.4
    1515 *
    16  * Version: 6.1.0
     16 * Version: 6.1.1
    1717 */
    1818
  • democracy-poll/trunk/js/democracy.js

    r3330963 r3338735  
    290290    // устанавливает ответы пользователя в блоке результатов/голосования
    291291    Dem.cacheSetAnswrs = function( $screen, answrs ){
    292 
    293292        var aids = answrs.split( /,/ )
    294293
     
    310309            $screen.find( '.dem-vote-link' ).remove()
    311310        }
    312 
    313311        // если голосование
    314312        else {
     
    337335                $screen.find( '.dem-revote-button-wrap' ).show()
    338336            }
    339 
    340         }
    341 
     337        }
    342338    }
    343339
    344340    jQuery.fn.demCacheInit = function(){
    345 
    346341        return this.each( function(){
    347 
    348342            var $the = jQuery( this )
    349343
  • democracy-poll/trunk/readme.txt

    r3330963 r3338735  
    120120
    121121== Upgrade Notice ==
     122
     123= 6.1.1 =
     124- FIX: esc_attr() added for inline js to fix possible bugs on some servers.
    122125
    123126= 6.1.0 =
Note: See TracChangeset for help on using the changeset viewer.