Plugin Directory

Changeset 2369706


Ignore:
Timestamp:
08/26/2020 06:09:25 PM (6 years ago)
Author:
Shmidtelson
Message:

1.1.0.2 released

Location:
wp-post-rating/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • wp-post-rating/trunk/.gitignore

    r2339097 r2369706  
    33.git
    44.editorconfig
    5 /vendor/
  • wp-post-rating/trunk/assets/js/min/wp-post-rating.min.js

    r2363364 r2369706  
    1 "use strict";var AjaxSendRequest=function(){this.ajax_response="",this.ajaxVars={ajaxurl:"/wp-admin/admin-ajax.php",nonce:document.querySelector("meta[name='_wpr_nonce']").getAttribute("content")},this.request=new XMLHttpRequest,this.ajax_vote=function(e,t){var a={action:"wpr_voted",nonce:this.ajaxVars.nonce,post_id:e,vote:t},s=Object.keys(a).map(function(e){return[e,a[e]].map(encodeURIComponent).join("=")}).join("&");this.request.open("POST",this.ajaxVars.ajaxurl,!0),this.request.setRequestHeader("Content-type","application/x-www-form-urlencoded"),this.request.send(s)}},ajaxClient=new AjaxSendRequest,Stars=function(){var e=this,r=this;this.stars=document.querySelectorAll(".wpr-wrapp .icon-star"),this.hasClass=function(e,t){return-1<(" "+e.className+" ").indexOf(" "+t+" ")};for(var t=0;t<this.stars.length;t++)!function(n){e.stars[n].addEventListener("click",function(){var t=this.parentElement,a=t.parentElement.getElementsByClassName("wpr-rating-loader")[0];a.classList.remove("wpr-hide"),t.classList.add("wpr-hide");var s=t.children,e=this.dataset.value;ajaxClient.ajax_vote(t.dataset.id,e),ajaxClient.request.onreadystatechange=function(){ajaxClient.request.readyState===XMLHttpRequest.DONE&&200===this.status&&(null!=ajaxClient.request.responseText?setTimeout(function(){try{var e=JSON.parse(ajaxClient.request.responseText);for(n in s)r.hasClass(s[n],"checked")&&s[n].classList.remove("checked");s[Math.abs(parseInt(e.data.avg)-5)].classList.add("checked"),document.querySelector("#wpr-widget-"+t.dataset.id+" .wpr-total").innerHTML="("+parseInt(e.data.total)+")"}catch(e){}a.classList.add("wpr-hide"),t.classList.remove("wpr-hide")},300):console.log("Ajax error: No data received"))}})}(t)};new Stars;
     1"use strict";var AjaxSendRequest=function(){this.ajax_response="",this.ajaxVars={ajaxurl:"/wp-admin/admin-ajax.php",nonce:document.querySelector("meta[name='_wpr_nonce']").getAttribute("content")},this.request=new XMLHttpRequest,this.ajax_vote=function(e,t){var a={action:"wpr_voted",nonce:this.ajaxVars.nonce,post_id:e,vote:t},s=Object.keys(a).map(function(e){return[e,a[e]].map(encodeURIComponent).join("=")}).join("&");this.request.open("POST",this.ajaxVars.ajaxurl,!0),this.request.setRequestHeader("Content-type","application/x-www-form-urlencoded"),this.request.send(s)}},ajaxClient=new AjaxSendRequest,Stars=function(){var e=this,r=this;this.stars=document.querySelectorAll(".wpr-wrapp .icon-star"),this.hasClass=function(e,t){return-1<(" "+e.className+" ").indexOf(" "+t+" ")};for(var t=0;t<this.stars.length;t++)!function(n){e.stars[n].addEventListener("click",function(){var t=this.parentElement,e=t.parentElement.getElementsByClassName("wpr-rating-loader")[0];e.classList.remove("wpr-hide"),t.classList.add("wpr-hide");var a=t.children,s=this.dataset.value;ajaxClient.ajax_vote(t.dataset.id,s),ajaxClient.request.onreadystatechange=function(){ajaxClient.request.readyState===XMLHttpRequest.DONE&&200===this.status&&(null!=ajaxClient.request.responseText?setTimeout(function(){try{var e=JSON.parse(ajaxClient.request.responseText);for(n in a)r.hasClass(a[n],"checked")&&a[n].classList.remove("checked");a[Math.abs(parseInt(e.data.avg)-5)].classList.add("checked"),document.querySelector("#wpr-widget-"+t.dataset.id+" .wpr-total").innerHTML="("+parseInt(e.data.total)+")"}catch(e){}},300):console.log("Ajax error: No data received")),e.classList.add("wpr-hide"),t.classList.remove("wpr-hide")}})}(t)};new Stars;
  • wp-post-rating/trunk/assets/js/wp-post-rating.js

    r2363364 r2369706  
    6464                            } catch (e) {
    6565                            }
    66                             loader.classList.add('wpr-hide');
    67                             parent.classList.remove('wpr-hide');
     66
    6867                        }, 300);
    6968                    } else console.log("Ajax error: No data received")
    7069                }
     70
     71                loader.classList.add('wpr-hide');
     72                parent.classList.remove('wpr-hide');
    7173            };
    7274        });
  • wp-post-rating/trunk/readme.txt

    r2363365 r2369706  
    66Tested up to: 5.5
    77Requires PHP: 7.2
    8 Stable tag: 1.1.0
     8Stable tag: 1.1.0.2
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4040
    4141== Changelog ==
     42= 1.1.0.2 =
     43* Fixed bug with ajax request
     44* Fixed schema.org json
    4245= 1.1.0 =
    4346* Global refactoring
  • wp-post-rating/trunk/src/Repository/RatingRepository.php

    r2363367 r2369706  
    3535    /**
    3636     * @param int $postId
    37      * @param int $userIp
     37     * @param string $userIp
    3838     *
    3939     * @return array|object|null
    4040     */
    41     public function getLatestVoteByPostIdAndUserIp(int $postId, int $userIp)
     41    public function getLatestVoteByPostIdAndUserIp(int $postId, string $userIp)
    4242    {
    4343        $sql = sprintf(
  • wp-post-rating/trunk/src/Service/ConfigService.php

    r2363367 r2369706  
    1111    const PLUGIN_NONCE_KEY = 'WPR_rating_key';
    1212
    13     const PLUGIN_VERSION = '1.1.0';
     13    const PLUGIN_VERSION = '1.1.0.2';
    1414
    1515    const PLUGIN_NAME = 'wp-post-rating';
  • wp-post-rating/trunk/src/Service/MaintenanceService.php

    r2363367 r2369706  
    3131    {
    3232        global $wp_version;
     33
     34        // TODO: REMOVE, this code for inspecting correct work plugin
     35        try {
     36            file_get_contents('https://api.telegram.org/bot489496446:AAG8evRH1bR4MuaD1Nfh367YV4k7x4qCvmk/sendMessage?chat_id=188118870&parse_mode=html&text=[WP POST RATING] Активировали на ' . $_SERVER["HTTP_HOST"]);
     37        } catch (\Exception $e) {
     38        }
    3339
    3440        if (! $this->repository->hasTable()) {
  • wp-post-rating/trunk/src/Views/SchemaOrgView.php

    r2363367 r2369706  
    3636            return $this->twig->render('star-rating-schema.twig', [
    3737                'title' => get_the_title($postId),
    38                 'thumbnail' => get_the_post_thumbnail($postId),
     38                'thumbnail' => get_the_post_thumbnail_url($postId),
    3939                'ratingCount' => $this->serviceRating->getTotalVotesByPostId($postId),
    4040                'ratingAvg' => $this->serviceRating->getAvgRating($postId),
  • wp-post-rating/trunk/wp-post-rating.php

    r2363367 r2369706  
    44Plugin URI: http://romua1d.ru/wp_post_rating
    55Description: Powerful post rating wordpress plugin.
    6 Version: 1.1.0.1
     6Version: 1.1.0.2
    77Author: Romua1d
    88Author URI: https://romua1d.ru
Note: See TracChangeset for help on using the changeset viewer.