WP ULike - Version 4.4.2

Version Description

  • Added: "SG Optimiser" plugin cache support.
  • Added: New option to hide counter box when no votes have been cast.
  • Added: User (profile) edit forms. (Using a new shortcode) [PRO]
  • Added: Local avatar upload option inside front-end and dashboard area. [PRO]
  • Added: Export CSV logs button on admin column filters. [PRO]
  • Updated: Meta query functions.
  • Fixed: Purge cache referrer url issue.
  • Fixed: Attachment post type issue on top items.
  • Fixed: Some major issues.
Download this release

Release Info

Developer alimir
Plugin Icon 128x128 WP ULike
Version 4.4.2
Comparing to
See all releases

Code changes from version 4.4.1 to 4.4.2

admin/assets/js/plugins.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! WP ULike - v4.4.1
2
  * https://wpulike.com
3
  * TechnoWich 2020;
4
  */
1
+ /*! WP ULike - v4.4.2
2
  * https://wpulike.com
3
  * TechnoWich 2020;
4
  */
admin/classes/class-wp-ulike-admin-panel.php CHANGED
@@ -671,6 +671,12 @@ if ( ! class_exists( 'wp_ulike_admin_panel' ) ) {
671
  'logged_in_users' => __('Only Logged In Users', WP_ULIKE_SLUG)
672
  )
673
  ),
 
 
 
 
 
 
674
  'logging_method' => array(
675
  'id' => 'logging_method',
676
  'type' => 'select',
671
  'logged_in_users' => __('Only Logged In Users', WP_ULIKE_SLUG)
672
  )
673
  ),
674
+ 'hide_zero_counter' => array(
675
+ 'id' => 'hide_zero_counter',
676
+ 'type' => 'switcher',
677
+ 'title' => __('Hide Zero Counter Box', WP_ULIKE_SLUG),
678
+ 'dependency' => array( 'counter_display_condition', '!=', 'hidden' )
679
+ ),
680
  'logging_method' => array(
681
  'id' => 'logging_method',
682
  'type' => 'select',
assets/css/wp-ulike.css CHANGED
@@ -59,6 +59,9 @@
59
  .wpulike.wpulike-hide-counter .count-box {
60
  display: none;
61
  }
 
 
 
62
 
63
  .wp_ulike_click_is_disabled {
64
  pointer-events: none;
59
  .wpulike.wpulike-hide-counter .count-box {
60
  display: none;
61
  }
62
+ .wpulike .count-box:empty {
63
+ display: none;
64
+ }
65
 
66
  .wp_ulike_click_is_disabled {
67
  pointer-events: none;
assets/css/wp-ulike.min.css CHANGED
@@ -3,4 +3,4 @@
3
  * WP ULike
4
  * @author Alimir [https://wordpress.org/plugins/wp-ulike/]
5
  ===============================================================
6
- */.wpulike{display:block;position:relative;line-height:normal;margin:0;padding:10px 0}.wpulike .wp_ulike_btn{margin:0;position:relative;display:inline-block;vertical-align:middle;border-radius:.25em;box-shadow:none;padding:15px 25px;border:none;text-align:center;transition-property:none;cursor:pointer}.wpulike .wp_ulike_btn:active,.wpulike .wp_ulike_btn:focus,.wpulike .wp_ulike_btn:hover{outline:0}.wpulike .wp_ulike_btn::-moz-focus-inner{border:0}.wpulike .wp_ulike_btn:disabled:active,.wpulike .wp_ulike_btn:disabled:focus,.wpulike .wp_ulike_btn:disabled:hover,.wpulike .wp_ulike_btn[disabled=disabled]:active,.wpulike .wp_ulike_btn[disabled=disabled]:focus,.wpulike .wp_ulike_btn[disabled=disabled]:hover{outline:0;background-color:initial}.wpulike .wp_ulike_put_text{font-size:14px;font-weight:600;line-height:28px;padding:0 10px;min-width:50px}.wpulike .wp_ulike_general_class{display:inline-flex;align-items:center}.wpulike .wp_ulike_is_loading .wp_ulike_btn{background-image:url(../img/svg/loader.svg);background-repeat:no-repeat;background-position:center center}.wpulike .wp_ulike_is_loading .wp_ulike_btn span{visibility:hidden}.wpulike .wp_ulike_is_loading .wp_ulike_btn.wp_ulike_put_image:after{content:none}.wpulike.wpulike-hide-counter .count-box{display:none}.wp_ulike_click_is_disabled{pointer-events:none;cursor:default}.wp_ulike_hide_me{visibility:hidden}.wpulike-default .wp_ulike_btn{color:#616161;background-color:#e0e0e0;min-height:30px;min-width:50px}.wpulike-default .wp_ulike_btn:focus,.wpulike-default .wp_ulike_btn:hover{color:#616161;background-color:#e0e0e0;text-decoration:none}.wpulike-default .wp_ulike_btn:disabled:active,.wpulike-default .wp_ulike_btn:disabled:focus,.wpulike-default .wp_ulike_btn:disabled:hover,.wpulike-default .wp_ulike_btn[disabled=disabled]:active,.wpulike-default .wp_ulike_btn[disabled=disabled]:focus,.wpulike-default .wp_ulike_btn[disabled=disabled]:hover{background-color:#e0e0e0}.wpulike-default .wp_ulike_is_liked .wp_ulike_btn{color:#757575}.wpulike-default .wp_ulike_put_image:after{content:'';display:block;background:url(../img/svg/like.svg) no-repeat;background-size:contain;width:16px;height:16px;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}.wpulike-default .wp_ulike_put_image.wp_ulike_btn_is_active:after{filter:invert(44%) sepia(40%) saturate(3852%) hue-rotate(329deg) brightness(100%) contrast(111%)}.wpulike-default .count-box{position:relative;border-radius:.25em;font-size:12px;text-decoration:none;background-color:#fff;margin-left:8px;line-height:28px;display:inline-block;padding:0 10px;box-shadow:0 0 0 1px #bdbdbd inset;color:#616161;vertical-align:middle;text-align:center}.wpulike-default .count-box:before{content:'';position:absolute;border:1px solid transparent;background:#fff;border-bottom-color:#bdbdbd;left:-5px;top:50%;border-left-color:#bdbdbd;transform:rotate(45deg) translatey(-50%);width:5px;height:5px;margin:0}#buddypress #activity-stream .activity-comments .wpulike,#buddypress #activity-stream .activity-meta .wpulike{display:flex;align-items:center;padding:0}#buddypress #activity-stream .activity-comments .wpulike-default .wp_ulike_btn,#buddypress #activity-stream .activity-meta .wpulike-default .wp_ulike_btn{border-radius:0;background-color:#fff;box-shadow:0 0 0 1px #bdbdbd inset;font-size:initial;padding:initial}#buddypress #activity-stream .wp_ulike_likers_wrapper .wp-ulike-liker,#buddypress #activity-stream .wp_ulike_likers_wrapper li{border:none;padding:0}#buddypress #activity-stream .wp_ulike_likers_wrapper .wp-ulike-liker a,#buddypress #activity-stream .wp_ulike_likers_wrapper .wp-ulike-liker img,#buddypress #activity-stream .wp_ulike_likers_wrapper li a,#buddypress #activity-stream .wp_ulike_likers_wrapper li img{float:none;padding:0;margin:0}#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) .wp-ulike-likers-list,#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) ul{margin:0!important}#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) .wp-ulike-likers-list li,#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) ul li{list-style-type:none}.wpulike-heart .wp_ulike_general_class{box-shadow:0 0 0 1px #bdbdbd inset;border-radius:.25em;padding:5px}.wpulike-heart .wp_ulike_put_text{padding:0 5px;text-transform:uppercase;font-weight:600;color:#757575}.wpulike-heart .wp_ulike_btn{background:0 0}.wpulike-heart .wp_ulike_btn:focus,.wpulike-heart .wp_ulike_btn:hover{color:#757575;background-color:transparent;text-decoration:none}.wpulike-heart .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){bottom:10px}.wpulike-heart .wp_ulike_put_image{background:0 0;padding:15px}.wpulike-heart .wp_ulike_put_image:disabled:active,.wpulike-heart .wp_ulike_put_image:disabled:focus,.wpulike-heart .wp_ulike_put_image:disabled:hover,.wpulike-heart .wp_ulike_put_image[disabled=disabled]:active,.wpulike-heart .wp_ulike_put_image[disabled=disabled]:focus,.wpulike-heart .wp_ulike_put_image[disabled=disabled]:hover{padding:15px}.wpulike-heart .wp_ulike_put_image:after{content:'';display:block;background:url(../img/svg/love.svg) no-repeat;background-size:contain;width:20px;height:20px;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}.wpulike-heart .wp_ulike_put_image.wp_ulike_btn_is_active:after{filter:invert(44%) sepia(40%) saturate(3852%) hue-rotate(329deg) brightness(100%) contrast(111%)}.wpulike-heart .count-box{font-size:14px;text-decoration:none;line-height:28px;display:inline-block;color:#616161;text-align:center;font-weight:600;vertical-align:middle;padding:0 5px}#buddypress #activity-stream .wpulike-heart .wp_ulike_btn{background:0 0;border:0;font-size:initial;padding:initial}#buddypress #activity-stream .wpulike-heart .wp_ulike_put_image{padding:10px 15px}#buddypress #activity-stream .wpulike-heart .wp_ulike_general_class{border-radius:0;padding:.2em .5em;margin-bottom:0}#buddypress #activity-stream .acomment-options,#buddypress #activity-stream .activity-meta{display:flex;align-items:center}.wpulike-robeen .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){bottom:5px}.wpulike-robeen .count-box{font-weight:600;padding:0 14px;font-size:16px}.wpulike-robeen .wp_ulike_is_loading .wp_ulike_btn{background-image:initial;padding:0}.wpulike-robeen .wp_ulike_is_loading .wp_ulike_btn.wp_ulike_put_image:after{content:''}.wpulike-robeen .wp_ulike_btn{width:30px;height:30px;overflow:hidden;padding:0;border:0;background:0 0}.wpulike-robeen .wp_ulike_btn:focus,.wpulike-robeen .wp_ulike_btn:hover{background-color:transparent}.wpulike-robeen .wp_ulike_btn:after{content:'';background:url(../img/icons/twitter-heart.png) no-repeat;background-position:0 0;transition:background-position 1s steps(28);transition-duration:0s;width:100px;height:100px;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}.wpulike-robeen .wp_ulike_btn.wp_ulike_btn_is_active{overflow:visible}.wpulike-robeen .wp_ulike_btn.wp_ulike_btn_is_active:after{transition-duration:1s;background-position:-2800px 0}#buddypress #activity-stream .activity-comments .wpulike-robeen .wp_ulike_btn,#buddypress #activity-stream .activity-inner .wpulike-robeen .wp_ulike_btn,#buddypress #activity-stream .activity-meta .wpulike-robeen .wp_ulike_btn{background:0 0;border:0;width:30px;height:30px;border:0;padding:0}.wpulike-animated-heart .wp_ulike_is_loading .wp_ulike_btn{background-image:none}.wpulike-animated-heart .wp_ulike_btn{position:relative;border-radius:50em;background-color:#fff;padding:0;box-shadow:0 5px 30px rgba(255,111,99,.4);border:0;width:50px;height:50px}.wpulike-animated-heart .wp_ulike_btn:focus,.wpulike-animated-heart .wp_ulike_btn:hover{background-color:#fff;background-image:none}.wpulike-animated-heart .wp_ulike_btn:disabled:active,.wpulike-animated-heart .wp_ulike_btn:disabled:focus,.wpulike-animated-heart .wp_ulike_btn:disabled:hover,.wpulike-animated-heart .wp_ulike_btn[disabled=disabled]:active,.wpulike-animated-heart .wp_ulike_btn[disabled=disabled]:focus,.wpulike-animated-heart .wp_ulike_btn[disabled=disabled]:hover{background-color:#fff}.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active{background-color:#ff6f63}.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active:disabled:active,.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active:disabled:focus,.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active:disabled:hover,.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active[disabled=disabled]:active,.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active[disabled=disabled]:focus,.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active[disabled=disabled]:hover{background-color:#ff6f63}.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active .wpulike-svg-heart{fill:#fff}.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active .wpulike-svg-heart-pop{animation-direction:normal}.wpulike-animated-heart .wp_ulike_btn:active{box-shadow:0 0 4px 0 rgba(0,0,0,.25)}.wpulike-animated-heart .wpulike-svg-heart{width:20px;fill:#ff6f63;transition:fill .5s,transform .5s;pointer-events:none;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}.wpulike-animated-heart .wpulike-svg-heart-pop{position:absolute;width:30%;fill:#ff6f63;opacity:0;left:0;animation:popHearts 1s ease forwards reverse}.wpulike-animated-heart .wpulike-svg-heart-pop.one{left:1%;transform:rotate(-10deg);animation-delay:.45s}.wpulike-animated-heart .wpulike-svg-heart-pop.two{left:15%;transform:rotate(8deg);animation-delay:.25s}.wpulike-animated-heart .wpulike-svg-heart-pop.three{left:30%;transform:rotate(-5deg);animation-delay:0s}.wpulike-animated-heart .wpulike-svg-heart-pop.four{left:50%;transform:rotate(-8deg);animation-delay:.3s}.wpulike-animated-heart .wpulike-svg-heart-pop.five{left:60%;transform:rotate(-10deg);animation-delay:.9s}.wpulike-animated-heart .wpulike-svg-heart-pop.six{left:70%;transform:rotate(-8deg);animation-delay:.2s}.wpulike-animated-heart .wpulike-svg-heart-pop.seven{left:85%;transform:rotate(6deg);animation-delay:.35s}.wpulike-animated-heart .wpulike-svg-heart-pop.eight{left:90%;transform:rotate(-4deg);animation-delay:.5s}.wpulike-animated-heart .wpulike-svg-heart-pop.nine{left:95%;transform:rotate(8deg);animation-delay:.2s}.wpulike-animated-heart .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){bottom:30px}.wpulike-animated-heart .count-box{margin:0 15px;color:#ff6f63;display:inline-block;vertical-align:middle}#buddypress #activity-stream .wpulike-animated-heart .wp_ulike_btn{background:inherit;border:0;width:40px;height:40px}#buddypress #activity-stream .wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active{background-color:#ff6f63}@keyframes popHearts{0%{left:calc(50% - 7px);top:10px}20%{opacity:1}80%{top:-20px}100%{opacity:0}}.wp_ulike_likers_wrapper{margin:10px 0;flex:0 0 100%}.wp_ulike_likers_wrapper:empty{display:none}.wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){transition:all .5s cubic-bezier(.19,1,.22,1);display:block;position:absolute;left:0;transform:translateY(-30px);bottom:0;background:#eee;padding:5px;opacity:0;visibility:hidden;box-shadow:2px 2px 1px rgba(0,0,0,.1);border-radius:5px;z-index:9}.wp_ulike_likers_wrapper:not(.wp_ulike_display_inline):after{content:'';position:absolute;top:100%;left:15px;width:0;height:0;border-top:8px solid #eee;border-right:8px solid transparent;border-left:8px solid transparent}.wp_ulike_likers_wrapper .tiles,.wp_ulike_likers_wrapper .wp-ulike-likers-list{display:flex;align-items:center;flex-wrap:wrap;margin:0;padding:0}.wp_ulike_likers_wrapper .tiles .wp-ulike-liker,.wp_ulike_likers_wrapper .tiles li,.wp_ulike_likers_wrapper .wp-ulike-likers-list .wp-ulike-liker,.wp_ulike_likers_wrapper .wp-ulike-likers-list li{padding:3px;margin:0;list-style:none;display:block}.wp_ulike_likers_wrapper .tiles .wp-ulike-liker a>img,.wp_ulike_likers_wrapper .tiles li a>img,.wp_ulike_likers_wrapper .wp-ulike-likers-list .wp-ulike-liker a>img,.wp_ulike_likers_wrapper .wp-ulike-likers-list li a>img{border-radius:5px;display:block;border:0;box-shadow:none}.wpulike:hover .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){transform:translateY(-40px);opacity:1;visibility:visible}.most_liked_users{list-style-type:none!important;position:relative!important;margin:10px 0!important;padding:0!important}.most_liked_users li{display:inline-table!important;cursor:pointer!important;margin:0 2px!important}.most_liked_users li img{display:block!important;float:none!important}.most_liked_users li.inactive{visibility:hidden!important;opacity:0!important}.commentlist .tiles .avatar,.commentlist .wp-ulike-liker .avatar{left:0!important}.wp_ulike_thumbnail{vertical-align:middle;margin:0 10px 0 0}.most_liked_comment .avatar{vertical-align:middle;margin:0 10px 0 0}.wp_ulike_style_simple .wp_counter_span:before{content:"("}.wp_ulike_style_simple .wp_counter_span:after{content:")"}.wp_ulike_style_love .wp_counter_span{float:right;display:inline-block;background:#f1f1f1 url(../img/icons/heart.png) 5px center no-repeat;color:#333;font-size:9px;line-height:17px;font-weight:400;margin:2px 0 0 2px;vertical-align:middle;border-radius:10px;padding:0 5px 0 23px;z-index:26}.wpulike-notification{position:fixed;z-index:999999;pointer-events:none;right:20px;bottom:20px}.wpulike-notification *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.wpulike-notification .wpulike-message{position:relative;pointer-events:auto;word-wrap:break-word;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 55px;width:280px;border-radius:3px;background-color:#00bcd4;color:#fff;animation:wpUlikeNotifitcationsAnimation .2s backwards;box-shadow:0 3px 5px rgba(0,0,0,.08);font-size:14px;font-weight:500}.wpulike-notification .wpulike-message:hover{opacity:.9;cursor:pointer}.wpulike-notification .wpulike-message:before{content:"";background-position:center center;background-repeat:no-repeat;background-image:url(../img/svg/info.svg);position:absolute;left:0;width:45px;top:0;height:100%;background-color:rgba(0,0,0,.08)}.wpulike-notification .wpulike-message.wpulike-success{background-color:#8bc34a}.wpulike-notification .wpulike-message.wpulike-success:before{background-image:url(../img/svg/success.svg)}.wpulike-notification .wpulike-message.wpulike-error{background-color:#ef5350}.wpulike-notification .wpulike-message.wpulike-error:before{background-image:url(../img/svg/error.svg)}.wpulike-notification .wpulike-message.wpulike-warning{background-color:#ffab00}.wpulike-notification .wpulike-message.wpulike-warning:before{background-image:url(../img/svg/warning.svg)}@keyframes wpUlikeNotifitcationsAnimation{from{opacity:0;transform:translateY(100%)}to{opacity:.8;transform:translateY(0)}}@media all and (max-width:240px){.wpulike-notification .wpulike-message{padding:8px 8px 8px 55px;width:11em}}@media all and (min-width:241px) and (max-width:480px){.wpulike-notification .wpulike-message{padding:8px 8px 8px 55px;width:18em}}@media all and (min-width:481px) and (max-width:768px){.wpulike-notification .wpulike-message{padding:15px 15px 15px 55px;width:25em}}/*!>>>>>>>>>>>>>>>>>>>>>>> #RTL <<<<<<<<<<<<<<<<<<<<<<<<<<< */.rtl .wpulike-default .count-box{margin-right:8px;margin-left:inherit}.rtl .wpulike-default .count-box:before{right:-1px;left:auto;border-color:#bdbdbd #bdbdbd transparent transparent}.rtl .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){left:auto;right:0}.rtl .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline):after{left:auto;right:15px}.rtl .commentlist .tiles .avatar{left:inherit!important;right:0!important}.rtl .wp_ulike_thumbnail{margin:0 0 0 10px}.rtl .most_liked_comment .avatar{margin:0 0 0 10px}.rtl .wp_ulike_style_love .wp_counter_span{float:left;background:#f1f1f1 url(../img/icons/heart.png) no-repeat scroll 85% center;margin:2px 2px 0 0;padding:0 23px 0 5px}.rtl .wpulike-notification{left:20px;right:inherit}.rtl .wpulike-notification .wpulike-message{padding:15px 55px 15px 15px}.rtl .wpulike-notification .wpulike-message:before{left:auto;right:0}@media all and (max-width:240px){.rtl .wpulike-notification .wpulike-message{padding:8px 55px 8px 8px}}@media all and (min-width:241px) and (max-width:480px){.rtl .wpulike-notification .wpulike-message{padding:8px 55px 8px 8px}}@media all and (min-width:481px) and (max-width:768px){.rtl .wpulike-notification .wpulike-message{padding:15px 55px 15px 15px}}
3
  * WP ULike
4
  * @author Alimir [https://wordpress.org/plugins/wp-ulike/]
5
  ===============================================================
6
+ */.wpulike{display:block;position:relative;line-height:normal;margin:0;padding:10px 0}.wpulike .wp_ulike_btn{margin:0;position:relative;display:inline-block;vertical-align:middle;border-radius:.25em;box-shadow:none;padding:15px 25px;border:none;text-align:center;transition-property:none;cursor:pointer}.wpulike .wp_ulike_btn:active,.wpulike .wp_ulike_btn:focus,.wpulike .wp_ulike_btn:hover{outline:0}.wpulike .wp_ulike_btn::-moz-focus-inner{border:0}.wpulike .wp_ulike_btn:disabled:active,.wpulike .wp_ulike_btn:disabled:focus,.wpulike .wp_ulike_btn:disabled:hover,.wpulike .wp_ulike_btn[disabled=disabled]:active,.wpulike .wp_ulike_btn[disabled=disabled]:focus,.wpulike .wp_ulike_btn[disabled=disabled]:hover{outline:0;background-color:initial}.wpulike .wp_ulike_put_text{font-size:14px;font-weight:600;line-height:28px;padding:0 10px;min-width:50px}.wpulike .wp_ulike_general_class{display:inline-flex;align-items:center}.wpulike .wp_ulike_is_loading .wp_ulike_btn{background-image:url(../img/svg/loader.svg);background-repeat:no-repeat;background-position:center center}.wpulike .wp_ulike_is_loading .wp_ulike_btn span{visibility:hidden}.wpulike .wp_ulike_is_loading .wp_ulike_btn.wp_ulike_put_image:after{content:none}.wpulike.wpulike-hide-counter .count-box{display:none}.wpulike .count-box:empty{display:none}.wp_ulike_click_is_disabled{pointer-events:none;cursor:default}.wp_ulike_hide_me{visibility:hidden}.wpulike-default .wp_ulike_btn{color:#616161;background-color:#e0e0e0;min-height:30px;min-width:50px}.wpulike-default .wp_ulike_btn:focus,.wpulike-default .wp_ulike_btn:hover{color:#616161;background-color:#e0e0e0;text-decoration:none}.wpulike-default .wp_ulike_btn:disabled:active,.wpulike-default .wp_ulike_btn:disabled:focus,.wpulike-default .wp_ulike_btn:disabled:hover,.wpulike-default .wp_ulike_btn[disabled=disabled]:active,.wpulike-default .wp_ulike_btn[disabled=disabled]:focus,.wpulike-default .wp_ulike_btn[disabled=disabled]:hover{background-color:#e0e0e0}.wpulike-default .wp_ulike_is_liked .wp_ulike_btn{color:#757575}.wpulike-default .wp_ulike_put_image:after{content:'';display:block;background:url(../img/svg/like.svg) no-repeat;background-size:contain;width:16px;height:16px;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}.wpulike-default .wp_ulike_put_image.wp_ulike_btn_is_active:after{filter:invert(44%) sepia(40%) saturate(3852%) hue-rotate(329deg) brightness(100%) contrast(111%)}.wpulike-default .count-box{position:relative;border-radius:.25em;font-size:12px;text-decoration:none;background-color:#fff;margin-left:8px;line-height:28px;display:inline-block;padding:0 10px;box-shadow:0 0 0 1px #bdbdbd inset;color:#616161;vertical-align:middle;text-align:center}.wpulike-default .count-box:before{content:'';position:absolute;border:1px solid transparent;background:#fff;border-bottom-color:#bdbdbd;left:-5px;top:50%;border-left-color:#bdbdbd;transform:rotate(45deg) translatey(-50%);width:5px;height:5px;margin:0}#buddypress #activity-stream .activity-comments .wpulike,#buddypress #activity-stream .activity-meta .wpulike{display:flex;align-items:center;padding:0}#buddypress #activity-stream .activity-comments .wpulike-default .wp_ulike_btn,#buddypress #activity-stream .activity-meta .wpulike-default .wp_ulike_btn{border-radius:0;background-color:#fff;box-shadow:0 0 0 1px #bdbdbd inset;font-size:initial;padding:initial}#buddypress #activity-stream .wp_ulike_likers_wrapper .wp-ulike-liker,#buddypress #activity-stream .wp_ulike_likers_wrapper li{border:none;padding:0}#buddypress #activity-stream .wp_ulike_likers_wrapper .wp-ulike-liker a,#buddypress #activity-stream .wp_ulike_likers_wrapper .wp-ulike-liker img,#buddypress #activity-stream .wp_ulike_likers_wrapper li a,#buddypress #activity-stream .wp_ulike_likers_wrapper li img{float:none;padding:0;margin:0}#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) .wp-ulike-likers-list,#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) ul{margin:0!important}#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) .wp-ulike-likers-list li,#bbpress-forums .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline) ul li{list-style-type:none}.wpulike-heart .wp_ulike_general_class{box-shadow:0 0 0 1px #bdbdbd inset;border-radius:.25em;padding:5px}.wpulike-heart .wp_ulike_put_text{padding:0 5px;text-transform:uppercase;font-weight:600;color:#757575}.wpulike-heart .wp_ulike_btn{background:0 0}.wpulike-heart .wp_ulike_btn:focus,.wpulike-heart .wp_ulike_btn:hover{color:#757575;background-color:transparent;text-decoration:none}.wpulike-heart .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){bottom:10px}.wpulike-heart .wp_ulike_put_image{background:0 0;padding:15px}.wpulike-heart .wp_ulike_put_image:disabled:active,.wpulike-heart .wp_ulike_put_image:disabled:focus,.wpulike-heart .wp_ulike_put_image:disabled:hover,.wpulike-heart .wp_ulike_put_image[disabled=disabled]:active,.wpulike-heart .wp_ulike_put_image[disabled=disabled]:focus,.wpulike-heart .wp_ulike_put_image[disabled=disabled]:hover{padding:15px}.wpulike-heart .wp_ulike_put_image:after{content:'';display:block;background:url(../img/svg/love.svg) no-repeat;background-size:contain;width:20px;height:20px;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}.wpulike-heart .wp_ulike_put_image.wp_ulike_btn_is_active:after{filter:invert(44%) sepia(40%) saturate(3852%) hue-rotate(329deg) brightness(100%) contrast(111%)}.wpulike-heart .count-box{font-size:14px;text-decoration:none;line-height:28px;display:inline-block;color:#616161;text-align:center;font-weight:600;vertical-align:middle;padding:0 5px}#buddypress #activity-stream .wpulike-heart .wp_ulike_btn{background:0 0;border:0;font-size:initial;padding:initial}#buddypress #activity-stream .wpulike-heart .wp_ulike_put_image{padding:10px 15px}#buddypress #activity-stream .wpulike-heart .wp_ulike_general_class{border-radius:0;padding:.2em .5em;margin-bottom:0}#buddypress #activity-stream .acomment-options,#buddypress #activity-stream .activity-meta{display:flex;align-items:center}.wpulike-robeen .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){bottom:5px}.wpulike-robeen .count-box{font-weight:600;padding:0 14px;font-size:16px}.wpulike-robeen .wp_ulike_is_loading .wp_ulike_btn{background-image:initial;padding:0}.wpulike-robeen .wp_ulike_is_loading .wp_ulike_btn.wp_ulike_put_image:after{content:''}.wpulike-robeen .wp_ulike_btn{width:30px;height:30px;overflow:hidden;padding:0;border:0;background:0 0}.wpulike-robeen .wp_ulike_btn:focus,.wpulike-robeen .wp_ulike_btn:hover{background-color:transparent}.wpulike-robeen .wp_ulike_btn:after{content:'';background:url(../img/icons/twitter-heart.png) no-repeat;background-position:0 0;transition:background-position 1s steps(28);transition-duration:0s;width:100px;height:100px;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}.wpulike-robeen .wp_ulike_btn.wp_ulike_btn_is_active{overflow:visible}.wpulike-robeen .wp_ulike_btn.wp_ulike_btn_is_active:after{transition-duration:1s;background-position:-2800px 0}#buddypress #activity-stream .activity-comments .wpulike-robeen .wp_ulike_btn,#buddypress #activity-stream .activity-inner .wpulike-robeen .wp_ulike_btn,#buddypress #activity-stream .activity-meta .wpulike-robeen .wp_ulike_btn{background:0 0;border:0;width:30px;height:30px;border:0;padding:0}.wpulike-animated-heart .wp_ulike_is_loading .wp_ulike_btn{background-image:none}.wpulike-animated-heart .wp_ulike_btn{position:relative;border-radius:50em;background-color:#fff;padding:0;box-shadow:0 5px 30px rgba(255,111,99,.4);border:0;width:50px;height:50px}.wpulike-animated-heart .wp_ulike_btn:focus,.wpulike-animated-heart .wp_ulike_btn:hover{background-color:#fff;background-image:none}.wpulike-animated-heart .wp_ulike_btn:disabled:active,.wpulike-animated-heart .wp_ulike_btn:disabled:focus,.wpulike-animated-heart .wp_ulike_btn:disabled:hover,.wpulike-animated-heart .wp_ulike_btn[disabled=disabled]:active,.wpulike-animated-heart .wp_ulike_btn[disabled=disabled]:focus,.wpulike-animated-heart .wp_ulike_btn[disabled=disabled]:hover{background-color:#fff}.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active{background-color:#ff6f63}.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active:disabled:active,.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active:disabled:focus,.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active:disabled:hover,.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active[disabled=disabled]:active,.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active[disabled=disabled]:focus,.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active[disabled=disabled]:hover{background-color:#ff6f63}.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active .wpulike-svg-heart{fill:#fff}.wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active .wpulike-svg-heart-pop{animation-direction:normal}.wpulike-animated-heart .wp_ulike_btn:active{box-shadow:0 0 4px 0 rgba(0,0,0,.25)}.wpulike-animated-heart .wpulike-svg-heart{width:20px;fill:#ff6f63;transition:fill .5s,transform .5s;pointer-events:none;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)}.wpulike-animated-heart .wpulike-svg-heart-pop{position:absolute;width:30%;fill:#ff6f63;opacity:0;left:0;animation:popHearts 1s ease forwards reverse}.wpulike-animated-heart .wpulike-svg-heart-pop.one{left:1%;transform:rotate(-10deg);animation-delay:.45s}.wpulike-animated-heart .wpulike-svg-heart-pop.two{left:15%;transform:rotate(8deg);animation-delay:.25s}.wpulike-animated-heart .wpulike-svg-heart-pop.three{left:30%;transform:rotate(-5deg);animation-delay:0s}.wpulike-animated-heart .wpulike-svg-heart-pop.four{left:50%;transform:rotate(-8deg);animation-delay:.3s}.wpulike-animated-heart .wpulike-svg-heart-pop.five{left:60%;transform:rotate(-10deg);animation-delay:.9s}.wpulike-animated-heart .wpulike-svg-heart-pop.six{left:70%;transform:rotate(-8deg);animation-delay:.2s}.wpulike-animated-heart .wpulike-svg-heart-pop.seven{left:85%;transform:rotate(6deg);animation-delay:.35s}.wpulike-animated-heart .wpulike-svg-heart-pop.eight{left:90%;transform:rotate(-4deg);animation-delay:.5s}.wpulike-animated-heart .wpulike-svg-heart-pop.nine{left:95%;transform:rotate(8deg);animation-delay:.2s}.wpulike-animated-heart .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){bottom:30px}.wpulike-animated-heart .count-box{margin:0 15px;color:#ff6f63;display:inline-block;vertical-align:middle}#buddypress #activity-stream .wpulike-animated-heart .wp_ulike_btn{background:inherit;border:0;width:40px;height:40px}#buddypress #activity-stream .wpulike-animated-heart .wp_ulike_btn.wp_ulike_btn_is_active{background-color:#ff6f63}@keyframes popHearts{0%{left:calc(50% - 7px);top:10px}20%{opacity:1}80%{top:-20px}100%{opacity:0}}.wp_ulike_likers_wrapper{margin:10px 0;flex:0 0 100%}.wp_ulike_likers_wrapper:empty{display:none}.wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){transition:all .5s cubic-bezier(.19,1,.22,1);display:block;position:absolute;left:0;transform:translateY(-30px);bottom:0;background:#eee;padding:5px;opacity:0;visibility:hidden;box-shadow:2px 2px 1px rgba(0,0,0,.1);border-radius:5px;z-index:9}.wp_ulike_likers_wrapper:not(.wp_ulike_display_inline):after{content:'';position:absolute;top:100%;left:15px;width:0;height:0;border-top:8px solid #eee;border-right:8px solid transparent;border-left:8px solid transparent}.wp_ulike_likers_wrapper .tiles,.wp_ulike_likers_wrapper .wp-ulike-likers-list{display:flex;align-items:center;flex-wrap:wrap;margin:0;padding:0}.wp_ulike_likers_wrapper .tiles .wp-ulike-liker,.wp_ulike_likers_wrapper .tiles li,.wp_ulike_likers_wrapper .wp-ulike-likers-list .wp-ulike-liker,.wp_ulike_likers_wrapper .wp-ulike-likers-list li{padding:3px;margin:0;list-style:none;display:block}.wp_ulike_likers_wrapper .tiles .wp-ulike-liker a>img,.wp_ulike_likers_wrapper .tiles li a>img,.wp_ulike_likers_wrapper .wp-ulike-likers-list .wp-ulike-liker a>img,.wp_ulike_likers_wrapper .wp-ulike-likers-list li a>img{border-radius:5px;display:block;border:0;box-shadow:none}.wpulike:hover .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){transform:translateY(-40px);opacity:1;visibility:visible}.most_liked_users{list-style-type:none!important;position:relative!important;margin:10px 0!important;padding:0!important}.most_liked_users li{display:inline-table!important;cursor:pointer!important;margin:0 2px!important}.most_liked_users li img{display:block!important;float:none!important}.most_liked_users li.inactive{visibility:hidden!important;opacity:0!important}.commentlist .tiles .avatar,.commentlist .wp-ulike-liker .avatar{left:0!important}.wp_ulike_thumbnail{vertical-align:middle;margin:0 10px 0 0}.most_liked_comment .avatar{vertical-align:middle;margin:0 10px 0 0}.wp_ulike_style_simple .wp_counter_span:before{content:"("}.wp_ulike_style_simple .wp_counter_span:after{content:")"}.wp_ulike_style_love .wp_counter_span{float:right;display:inline-block;background:#f1f1f1 url(../img/icons/heart.png) 5px center no-repeat;color:#333;font-size:9px;line-height:17px;font-weight:400;margin:2px 0 0 2px;vertical-align:middle;border-radius:10px;padding:0 5px 0 23px;z-index:26}.wpulike-notification{position:fixed;z-index:999999;pointer-events:none;right:20px;bottom:20px}.wpulike-notification *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.wpulike-notification .wpulike-message{position:relative;pointer-events:auto;word-wrap:break-word;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 55px;width:280px;border-radius:3px;background-color:#00bcd4;color:#fff;animation:wpUlikeNotifitcationsAnimation .2s backwards;box-shadow:0 3px 5px rgba(0,0,0,.08);font-size:14px;font-weight:500}.wpulike-notification .wpulike-message:hover{opacity:.9;cursor:pointer}.wpulike-notification .wpulike-message:before{content:"";background-position:center center;background-repeat:no-repeat;background-image:url(../img/svg/info.svg);position:absolute;left:0;width:45px;top:0;height:100%;background-color:rgba(0,0,0,.08)}.wpulike-notification .wpulike-message.wpulike-success{background-color:#8bc34a}.wpulike-notification .wpulike-message.wpulike-success:before{background-image:url(../img/svg/success.svg)}.wpulike-notification .wpulike-message.wpulike-error{background-color:#ef5350}.wpulike-notification .wpulike-message.wpulike-error:before{background-image:url(../img/svg/error.svg)}.wpulike-notification .wpulike-message.wpulike-warning{background-color:#ffab00}.wpulike-notification .wpulike-message.wpulike-warning:before{background-image:url(../img/svg/warning.svg)}@keyframes wpUlikeNotifitcationsAnimation{from{opacity:0;transform:translateY(100%)}to{opacity:.8;transform:translateY(0)}}@media all and (max-width:240px){.wpulike-notification .wpulike-message{padding:8px 8px 8px 55px;width:11em}}@media all and (min-width:241px) and (max-width:480px){.wpulike-notification .wpulike-message{padding:8px 8px 8px 55px;width:18em}}@media all and (min-width:481px) and (max-width:768px){.wpulike-notification .wpulike-message{padding:15px 15px 15px 55px;width:25em}}/*!>>>>>>>>>>>>>>>>>>>>>>> #RTL <<<<<<<<<<<<<<<<<<<<<<<<<<< */.rtl .wpulike-default .count-box{margin-right:8px;margin-left:inherit}.rtl .wpulike-default .count-box:before{right:-1px;left:auto;border-color:#bdbdbd #bdbdbd transparent transparent}.rtl .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline){left:auto;right:0}.rtl .wp_ulike_likers_wrapper:not(.wp_ulike_display_inline):after{left:auto;right:15px}.rtl .commentlist .tiles .avatar{left:inherit!important;right:0!important}.rtl .wp_ulike_thumbnail{margin:0 0 0 10px}.rtl .most_liked_comment .avatar{margin:0 0 0 10px}.rtl .wp_ulike_style_love .wp_counter_span{float:left;background:#f1f1f1 url(../img/icons/heart.png) no-repeat scroll 85% center;margin:2px 2px 0 0;padding:0 23px 0 5px}.rtl .wpulike-notification{left:20px;right:inherit}.rtl .wpulike-notification .wpulike-message{padding:15px 55px 15px 15px}.rtl .wpulike-notification .wpulike-message:before{left:auto;right:0}@media all and (max-width:240px){.rtl .wpulike-notification .wpulike-message{padding:8px 55px 8px 8px}}@media all and (min-width:241px) and (max-width:480px){.rtl .wpulike-notification .wpulike-message{padding:8px 55px 8px 8px}}@media all and (min-width:481px) and (max-width:768px){.rtl .wpulike-notification .wpulike-message{padding:15px 55px 15px 15px}}
assets/js/wp-ulike.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! WP ULike - v4.4.1
2
  * https://wpulike.com
3
  * TechnoWich 2020;
4
  */
1
+ /*! WP ULike - v4.4.2
2
  * https://wpulike.com
3
  * TechnoWich 2020;
4
  */
inc/classes/class-wp-ulike-cta-template.php CHANGED
@@ -101,7 +101,7 @@ if ( ! class_exists( 'wp_ulike_cta_template' ) ) {
101
  $button_class_name .= strtolower( ' wp_' . $this->args['slug'] . '_btn_' . $this->args['id'] );
102
 
103
  $total_likes = wp_ulike_get_counter_value( $this->args['id'], $this->args['slug'], 'like', $this->isDistinct() );
104
- $formatted_val = apply_filters( 'wp_ulike_count_box_template', '<span class="count-box">'. wp_ulike_format_number( $total_likes ) .'</span>' , $total_likes );
105
  $this->args['is_distinct'] = $this->isDistinct();
106
 
107
  $wp_ulike_template = apply_filters( 'wp_ulike_add_templates_args', array(
101
  $button_class_name .= strtolower( ' wp_' . $this->args['slug'] . '_btn_' . $this->args['id'] );
102
 
103
  $total_likes = wp_ulike_get_counter_value( $this->args['id'], $this->args['slug'], 'like', $this->isDistinct() );
104
+ $formatted_val = apply_filters( 'wp_ulike_count_box_template', '<span class="count-box">'. wp_ulike_format_number( $total_likes ) .'</span>' , $total_likes, $this->args['slug'] );
105
  $this->args['is_distinct'] = $this->isDistinct();
106
 
107
  $wp_ulike_template = apply_filters( 'wp_ulike_add_templates_args', array(
inc/classes/class-wp-ulike-entities-process.php CHANGED
@@ -175,6 +175,11 @@ if ( ! class_exists( 'wp_ulike_entities_process' ) ) {
175
  */
176
  public function setPrevStatus( $item_id ){
177
  $meta_key = sanitize_key( $this->itemType . '_status' );
 
 
 
 
 
178
  $user_info = wp_ulike_get_meta_data( $this->currentUser, 'user', $meta_key, true );
179
 
180
  if( empty( $user_info ) || ! isset( $user_info[$item_id] ) ){
@@ -231,7 +236,7 @@ if ( ! class_exists( 'wp_ulike_entities_process' ) ) {
231
  * @return boolean
232
  */
233
  public function isDistinct(){
234
- return wp_ulike_setting_repo::isDistinct( $this->itemMethod );
235
  }
236
 
237
  /**
@@ -296,6 +301,10 @@ if ( ! class_exists( 'wp_ulike_entities_process' ) ) {
296
  * @return integer
297
  */
298
  public function updateCounterMeta( $item_id ){
 
 
 
 
299
  // Get current value
300
  $value = wp_ulike_get_counter_value( $item_id, $this->itemType, $this->currentStatus, $this->isDistinct() );
301
 
@@ -337,6 +346,11 @@ if ( ! class_exists( 'wp_ulike_entities_process' ) ) {
337
  public function updateUserMetaStatus( $item_id ){
338
  // Update object cache (memcached issue)
339
  $meta_key = sanitize_key( $this->itemType . '_status' );
 
 
 
 
 
340
  $user_info = wp_ulike_get_meta_data( $this->currentUser, 'user', $meta_key, true );
341
 
342
  if( empty( $user_info ) ){
@@ -356,7 +370,11 @@ if ( ! class_exists( 'wp_ulike_entities_process' ) ) {
356
  * @return void
357
  */
358
  public function updateLikerMetaList( $item_id ){
359
- // Update likers list
 
 
 
 
360
  $get_likers = wp_ulike_get_meta_data( $item_id, $this->itemType, 'likers_list', true );
361
  if( ! empty( $get_likers ) ){
362
  $get_user = get_userdata( $this->currentUser );
175
  */
176
  public function setPrevStatus( $item_id ){
177
  $meta_key = sanitize_key( $this->itemType . '_status' );
178
+ // delete cache to get fresh data
179
+ if( wp_ulike_is_cache_exist() ){
180
+ wp_cache_delete( $this->currentUser, 'wp_ulike_user_meta' );
181
+ }
182
+ // Get meta data
183
  $user_info = wp_ulike_get_meta_data( $this->currentUser, 'user', $meta_key, true );
184
 
185
  if( empty( $user_info ) || ! isset( $user_info[$item_id] ) ){
236
  * @return boolean
237
  */
238
  public function isDistinct(){
239
+ return wp_ulike_setting_repo::isDistinct( $this->itemType );
240
  }
241
 
242
  /**
301
  * @return integer
302
  */
303
  public function updateCounterMeta( $item_id ){
304
+ // delete cache to get fresh data
305
+ if( wp_ulike_is_cache_exist() ){
306
+ wp_cache_delete( $item_id, sprintf( 'wp_ulike_%s_meta', $this->itemType ) );
307
+ }
308
  // Get current value
309
  $value = wp_ulike_get_counter_value( $item_id, $this->itemType, $this->currentStatus, $this->isDistinct() );
310
 
346
  public function updateUserMetaStatus( $item_id ){
347
  // Update object cache (memcached issue)
348
  $meta_key = sanitize_key( $this->itemType . '_status' );
349
+ // delete cache to get fresh data
350
+ if( wp_ulike_is_cache_exist() ){
351
+ wp_cache_delete( $this->currentUser, 'wp_ulike_user_meta' );
352
+ }
353
+ // Get meta data
354
  $user_info = wp_ulike_get_meta_data( $this->currentUser, 'user', $meta_key, true );
355
 
356
  if( empty( $user_info ) ){
370
  * @return void
371
  */
372
  public function updateLikerMetaList( $item_id ){
373
+ // delete cache to get fresh data
374
+ if( wp_ulike_is_cache_exist() ){
375
+ wp_cache_delete( $item_id, sprintf( 'wp_ulike_%s_meta', $this->itemType ) );
376
+ }
377
+ // Get meta data
378
  $get_likers = wp_ulike_get_meta_data( $item_id, $this->itemType, 'likers_list', true );
379
  if( ! empty( $get_likers ) ){
380
  $get_user = get_userdata( $this->currentUser );
inc/classes/class-wp-ulike-setting-repo.php CHANGED
@@ -114,6 +114,15 @@ class wp_ulike_setting_repo {
114
  }
115
  }
116
 
 
 
 
 
 
 
 
 
 
117
 
118
  /**
119
  * Check distinct status by logging method
114
  }
115
  }
116
 
117
+ /**
118
+ * Check counter zero visibility
119
+ *
120
+ * @return boolean
121
+ */
122
+ public static function isCounterZeroVisible( $typeName ){
123
+ return self::getOption( self::getSettingKey( $typeName ) . '|hide_zero_counter', false );
124
+ }
125
+
126
 
127
  /**
128
  * Check distinct status by logging method
inc/functions/content-types.php CHANGED
@@ -111,6 +111,7 @@ if( ! function_exists( 'wp_ulike_get_most_liked_posts' ) ){
111
 
112
  $args = array(
113
  'post_type' => $post_type,
 
114
  'posts_per_page' => $numberposts
115
  );
116
 
111
 
112
  $args = array(
113
  'post_type' => $post_type,
114
+ 'post_status' => array('publish', 'inherit'),
115
  'posts_per_page' => $numberposts
116
  );
117
 
inc/functions/meta.php CHANGED
@@ -40,7 +40,7 @@ if( ! function_exists( 'wp_ulike_add_meta_data' ) ){
40
  }
41
 
42
  $table = $wpdb->prefix . 'ulike_meta';
43
- $column = sanitize_key( 'item_id' );
44
  $id_column = 'meta_id';
45
 
46
  // expected_slashed ($meta_key)
@@ -48,6 +48,11 @@ if( ! function_exists( 'wp_ulike_add_meta_data' ) ){
48
  $meta_key = wp_unslash( $meta_key );
49
  $meta_value = wp_unslash( $meta_value );
50
 
 
 
 
 
 
51
  if ( $unique && $wpdb->get_var(
52
  $wpdb->prepare(
53
  "SELECT COUNT(*) FROM $table WHERE meta_group = %s AND meta_key = %s AND $column = %d",
@@ -62,6 +67,8 @@ if( ! function_exists( 'wp_ulike_add_meta_data' ) ){
62
  $_meta_value = $meta_value;
63
  $meta_value = maybe_serialize( $meta_value );
64
 
 
 
65
  $result = $wpdb->insert(
66
  $table,
67
  array(
@@ -80,6 +87,8 @@ if( ! function_exists( 'wp_ulike_add_meta_data' ) ){
80
 
81
  wp_cache_delete( $object_id, sprintf( 'wp_ulike_%s_meta', $meta_group ) );
82
 
 
 
83
  return $mid;
84
  }
85
  }
@@ -113,7 +122,7 @@ if( ! function_exists( 'wp_ulike_update_meta_data' ) ){
113
  }
114
 
115
  $table = $wpdb->prefix . 'ulike_meta';
116
- $column = sanitize_key( 'item_id' );
117
  $id_column = 'meta_id';
118
 
119
  // expected_slashed ($meta_key)
@@ -124,10 +133,15 @@ if( ! function_exists( 'wp_ulike_update_meta_data' ) ){
124
  $passed_value = $meta_value;
125
  $meta_value = wp_unslash( $meta_value );
126
 
 
 
 
 
 
127
  // Compare existing value to new value if no prev value given and the key exists only once.
128
  if ( empty( $prev_value ) ) {
129
- $old_value = wp_ulike_get_meta_data( $object_id, $meta_group, $meta_key );
130
- if ( count( $old_value ) == 1 ) {
131
  if ( $old_value[0] === $meta_value ) {
132
  return false;
133
  }
@@ -146,7 +160,7 @@ if( ! function_exists( 'wp_ulike_update_meta_data' ) ){
146
  $where = array(
147
  $column => $object_id,
148
  'meta_group' => $meta_group,
149
- 'meta_key' => $meta_key,
150
  );
151
 
152
  if ( ! empty( $prev_value ) ) {
@@ -154,6 +168,10 @@ if( ! function_exists( 'wp_ulike_update_meta_data' ) ){
154
  $where['meta_value'] = $prev_value;
155
  }
156
 
 
 
 
 
157
  $result = $wpdb->update( $table, $data, $where );
158
  if ( ! $result ) {
159
  return false;
@@ -161,6 +179,10 @@ if( ! function_exists( 'wp_ulike_update_meta_data' ) ){
161
 
162
  wp_cache_delete( $object_id, sprintf( 'wp_ulike_%s_meta', $meta_group ) );
163
 
 
 
 
 
164
  return true;
165
  }
166
  }
@@ -177,12 +199,12 @@ if( ! function_exists( 'wp_ulike_update_meta_cache' ) ){
177
  function wp_ulike_update_meta_cache( $object_ids, $meta_group ) {
178
  global $wpdb;
179
 
180
- if ( ! $object_ids ) {
181
  return false;
182
  }
183
 
184
  $table = $wpdb->prefix . 'ulike_meta';
185
- $column = sanitize_key( 'item_id' );
186
 
187
  if ( ! is_array( $object_ids ) ) {
188
  $object_ids = preg_replace( '|[^0-9,]|', '', $object_ids );
@@ -191,24 +213,30 @@ if( ! function_exists( 'wp_ulike_update_meta_cache' ) ){
191
 
192
  $object_ids = array_map( 'intval', $object_ids );
193
 
194
- $cache_key = sprintf( 'wp_ulike_%s_meta', $meta_group );
195
- $ids = array();
196
- $cache = array();
197
- foreach ( $object_ids as $id ) {
198
- $cached_object = wp_cache_get( $id, $cache_key );
 
 
 
 
 
 
199
  if ( false === $cached_object ) {
200
- $ids[] = $id;
201
  } else {
202
  $cache[ $id ] = $cached_object;
203
  }
204
  }
205
 
206
- if ( empty( $ids ) ) {
207
  return $cache;
208
  }
209
 
210
  // Get meta info.
211
- $id_list = join( ',', $ids );
212
  $id_column = 'meta_id';
213
  $meta_list = $wpdb->get_results( "SELECT $column, meta_group, meta_key, meta_value FROM $table WHERE $column IN ($id_list) AND meta_group = '$meta_group' ORDER BY $id_column ASC", ARRAY_A );
214
 
@@ -231,7 +259,7 @@ if( ! function_exists( 'wp_ulike_update_meta_cache' ) ){
231
  }
232
  }
233
 
234
- foreach ( $ids as $id ) {
235
  if ( ! isset( $cache[ $id ] ) ) {
236
  $cache[ $id ] = array();
237
  }
@@ -242,20 +270,21 @@ if( ! function_exists( 'wp_ulike_update_meta_cache' ) ){
242
  }
243
  }
244
 
245
- if( ! function_exists( 'wp_ulike_get_meta_data' ) ){
246
  /**
247
- * Retrieves metadata for the specified object.
248
- *
249
  *
 
 
250
  * @param int $object_id ID of the object metadata is for.
251
- * @param string $meta_group Metadata group
252
  * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for
253
  * the specified object. Default empty.
254
  * @param bool $single Optional. If true, return only the first value of the specified meta_key.
255
  * This parameter has no effect if meta_key is not specified. Default false.
256
- * @return mixed Single metadata value, or array of values
 
257
  */
258
- function wp_ulike_get_meta_data( $object_id, $meta_group, $meta_key = '', $single = false ) {
259
  if ( ! is_numeric( $object_id ) ) {
260
  return false;
261
  }
@@ -294,4 +323,68 @@ if( ! function_exists( 'wp_ulike_get_meta_data' ) ){
294
  return array();
295
  }
296
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  }
40
  }
41
 
42
  $table = $wpdb->prefix . 'ulike_meta';
43
+ $column = 'item_id';
44
  $id_column = 'meta_id';
45
 
46
  // expected_slashed ($meta_key)
48
  $meta_key = wp_unslash( $meta_key );
49
  $meta_value = wp_unslash( $meta_value );
50
 
51
+ $check = apply_filters( "wp_ulike_add_{$meta_group}_metadata", null, $object_id, $meta_key, $meta_value, $unique );
52
+ if ( null !== $check ) {
53
+ return $check;
54
+ }
55
+
56
  if ( $unique && $wpdb->get_var(
57
  $wpdb->prepare(
58
  "SELECT COUNT(*) FROM $table WHERE meta_group = %s AND meta_key = %s AND $column = %d",
67
  $_meta_value = $meta_value;
68
  $meta_value = maybe_serialize( $meta_value );
69
 
70
+ do_action( "wp_ulike_add_{$meta_group}_meta", $object_id, $meta_key, $_meta_value );
71
+
72
  $result = $wpdb->insert(
73
  $table,
74
  array(
87
 
88
  wp_cache_delete( $object_id, sprintf( 'wp_ulike_%s_meta', $meta_group ) );
89
 
90
+ do_action( "wp_ulike_added_{$meta_group}_meta", $mid, $object_id, $meta_key, $_meta_value );
91
+
92
  return $mid;
93
  }
94
  }
122
  }
123
 
124
  $table = $wpdb->prefix . 'ulike_meta';
125
+ $column = 'item_id';
126
  $id_column = 'meta_id';
127
 
128
  // expected_slashed ($meta_key)
133
  $passed_value = $meta_value;
134
  $meta_value = wp_unslash( $meta_value );
135
 
136
+ $check = apply_filters( "wp_ulike_update_{$meta_group}_metadata", null, $object_id, $meta_key, $meta_value, $prev_value );
137
+ if ( null !== $check ) {
138
+ return (bool) $check;
139
+ }
140
+
141
  // Compare existing value to new value if no prev value given and the key exists only once.
142
  if ( empty( $prev_value ) ) {
143
+ $old_value = wp_ulike_get_meta_data_raw( $object_id, $meta_group, $meta_key );
144
+ if ( is_countable( $old_value ) && count( $old_value ) == 1 ) {
145
  if ( $old_value[0] === $meta_value ) {
146
  return false;
147
  }
160
  $where = array(
161
  $column => $object_id,
162
  'meta_group' => $meta_group,
163
+ 'meta_key' => $meta_key
164
  );
165
 
166
  if ( ! empty( $prev_value ) ) {
168
  $where['meta_value'] = $prev_value;
169
  }
170
 
171
+ foreach ( $meta_ids as $meta_id ) {
172
+ do_action( "wp_ulike_update_{$meta_group}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
173
+ }
174
+
175
  $result = $wpdb->update( $table, $data, $where );
176
  if ( ! $result ) {
177
  return false;
179
 
180
  wp_cache_delete( $object_id, sprintf( 'wp_ulike_%s_meta', $meta_group ) );
181
 
182
+ foreach ( $meta_ids as $meta_id ) {
183
+ do_action( "wp_ulike_updated_{$meta_group}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
184
+ }
185
+
186
  return true;
187
  }
188
  }
199
  function wp_ulike_update_meta_cache( $object_ids, $meta_group ) {
200
  global $wpdb;
201
 
202
+ if ( ! $object_ids || ! $meta_group ) {
203
  return false;
204
  }
205
 
206
  $table = $wpdb->prefix . 'ulike_meta';
207
+ $column = 'item_id';
208
 
209
  if ( ! is_array( $object_ids ) ) {
210
  $object_ids = preg_replace( '|[^0-9,]|', '', $object_ids );
213
 
214
  $object_ids = array_map( 'intval', $object_ids );
215
 
216
+ $check = apply_filters( "wp_ulike_update_{$meta_group}_metadata_cache", null, $object_ids );
217
+ if ( null !== $check ) {
218
+ return (bool) $check;
219
+ }
220
+
221
+ $cache_key = sprintf( 'wp_ulike_%s_meta', $meta_group );
222
+ $non_cached_ids = array();
223
+ $cache = array();
224
+ $cache_values = wp_cache_get_multiple( $object_ids, $cache_key );
225
+
226
+ foreach ( $cache_values as $id => $cached_object ) {
227
  if ( false === $cached_object ) {
228
+ $non_cached_ids[] = $id;
229
  } else {
230
  $cache[ $id ] = $cached_object;
231
  }
232
  }
233
 
234
+ if ( empty( $non_cached_ids ) ) {
235
  return $cache;
236
  }
237
 
238
  // Get meta info.
239
+ $id_list = join( ',', $non_cached_ids );
240
  $id_column = 'meta_id';
241
  $meta_list = $wpdb->get_results( "SELECT $column, meta_group, meta_key, meta_value FROM $table WHERE $column IN ($id_list) AND meta_group = '$meta_group' ORDER BY $id_column ASC", ARRAY_A );
242
 
259
  }
260
  }
261
 
262
+ foreach ( $non_cached_ids as $id ) {
263
  if ( ! isset( $cache[ $id ] ) ) {
264
  $cache[ $id ] = array();
265
  }
270
  }
271
  }
272
 
273
+ if( ! function_exists( 'wp_ulike_get_meta_data_raw' ) ){
274
  /**
275
+ * Retrieves raw metadata value for the specified object.
 
276
  *
277
+ * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
278
+ * or any other object type with an associated meta table.
279
  * @param int $object_id ID of the object metadata is for.
 
280
  * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for
281
  * the specified object. Default empty.
282
  * @param bool $single Optional. If true, return only the first value of the specified meta_key.
283
  * This parameter has no effect if meta_key is not specified. Default false.
284
+ * @return mixed Single metadata value, or array of values. Null if the value does not exist.
285
+ * False if there's a problem with the parameters passed to the function.
286
  */
287
+ function wp_ulike_get_meta_data_raw( $object_id, $meta_group, $meta_key = '', $single = false ) {
288
  if ( ! is_numeric( $object_id ) ) {
289
  return false;
290
  }
323
  return array();
324
  }
325
  }
326
+ }
327
+
328
+ if( ! function_exists( 'wp_ulike_get_meta_data' ) ){
329
+ /**
330
+ * Retrieves the value of a metadata field for the specified object type and ID.
331
+ *
332
+ * If the meta field exists, a single value is returned if `$single` is true,
333
+ * or an array of values if it's false.
334
+ *
335
+ * If the meta field does not exist, the result depends on get_metadata_default().
336
+ * By default, an empty string is returned if `$single` is true, or an empty array
337
+ * if it's false.
338
+ *
339
+ *
340
+ * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
341
+ * or any other object type with an associated meta table.
342
+ * @param int $object_id ID of the object metadata is for.
343
+ * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for
344
+ * the specified object. Default empty.
345
+ * @param bool $single Optional. If true, return only the first value of the specified meta_key.
346
+ * This parameter has no effect if meta_key is not specified. Default false.
347
+ * @return mixed Single metadata value, or array of values.
348
+ * False if there's a problem with the parameters passed to the function.
349
+ */
350
+ function wp_ulike_get_meta_data( $object_id, $meta_group, $meta_key = '', $single = false ) {
351
+ $value = wp_ulike_get_meta_data_raw( $object_id, $meta_group, $meta_key, $single );
352
+ if ( ! is_null( $value ) ) {
353
+ return $value;
354
+ }
355
+
356
+ return wp_ulike_get_meta_data_default( $object_id, $meta_group, $meta_key, $single );
357
+ }
358
+ }
359
+
360
+ if( ! function_exists( 'wp_ulike_get_meta_data_default' ) ){
361
+ /**
362
+ * Retrieves default metadata value for the specified meta key and object.
363
+ *
364
+ * By default, an empty string is returned if `$single` is true, or an empty array
365
+ * if it's false.
366
+ *
367
+ * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
368
+ * or any other object type with an associated meta table.
369
+ * @param int $object_id ID of the object metadata is for.
370
+ * @param string $meta_key Metadata key.
371
+ * @param bool $single Optional. If true, return only the first value of the specified meta_key.
372
+ * This parameter has no effect if meta_key is not specified. Default false.
373
+ * @return mixed Single metadata value, or array of values.
374
+ */
375
+ function wp_ulike_get_meta_data_default( $object_id, $meta_group, $meta_key, $single = false ) {
376
+ if ( $single ) {
377
+ $value = '';
378
+ } else {
379
+ $value = array();
380
+ }
381
+
382
+ $value = apply_filters( "wp_ulike_default_{$meta_group}_metadata", $value, $object_id, $meta_key, $single, $meta_group );
383
+
384
+ if ( ! $single && ! wp_is_numeric_array( $value ) ) {
385
+ $value = array( $value );
386
+ }
387
+
388
+ return $value;
389
+ }
390
  }
inc/functions/queries.php CHANGED
@@ -65,7 +65,7 @@ if( ! function_exists( 'wp_ulike_get_popular_items_info' ) ){
65
  } elseif( ! empty( $parsed_args['rel_type'] ) ) {
66
  $post_type = sprintf( " AND r.post_type = '%s'", $parsed_args['rel_type'] );
67
  }
68
- $related_condition = 'AND r.post_status = \'publish\'' . $post_type;
69
  break;
70
  }
71
 
@@ -224,7 +224,7 @@ if( ! function_exists( 'wp_ulike_get_popular_items_total_number' ) ){
224
  } elseif( ! empty( $parsed_args['rel_type'] ) ) {
225
  $post_type = sprintf( " AND r.post_type = '%s'", $parsed_args['rel_type'] );
226
  }
227
- $related_condition = 'AND r.post_status = \'publish\'' . $post_type;
228
  break;
229
  }
230
 
65
  } elseif( ! empty( $parsed_args['rel_type'] ) ) {
66
  $post_type = sprintf( " AND r.post_type = '%s'", $parsed_args['rel_type'] );
67
  }
68
+ $related_condition = 'AND r.post_status IN (\'publish\', \'inherit\', \'private\')' . $post_type;
69
  break;
70
  }
71
 
224
  } elseif( ! empty( $parsed_args['rel_type'] ) ) {
225
  $post_type = sprintf( " AND r.post_type = '%s'", $parsed_args['rel_type'] );
226
  }
227
+ $related_condition = 'AND r.post_status IN (\'publish\', \'inherit\', \'private\')' . $post_type;
228
  break;
229
  }
230
 
inc/functions/templates.php CHANGED
@@ -86,7 +86,10 @@ if( ! function_exists( 'wp_ulike_set_default_template' ) ){
86
  }
87
  ?>
88
  </button>
89
- <?php echo $counter; ?>
 
 
 
90
  </div>
91
  <?php
92
  do_action( 'wp_ulike_inside_template', $wp_ulike_template );
@@ -132,7 +135,10 @@ if( ! function_exists( 'wp_ulike_set_simple_heart_template' ) ){
132
  }
133
  ?>
134
  </button>
135
- <?php echo $counter; ?>
 
 
 
136
  </div>
137
  <?php
138
  do_action( 'wp_ulike_inside_template', $wp_ulike_template );
@@ -175,7 +181,10 @@ if( ! function_exists( 'wp_ulike_set_robeen_template' ) ){
175
  do_action( 'wp_ulike_inside_like_button', $wp_ulike_template );
176
  ?>
177
  </button>
178
- <?php echo $counter; ?>
 
 
 
179
  </div>
180
  <?php
181
  do_action( 'wp_ulike_inside_template', $wp_ulike_template );
@@ -224,7 +233,10 @@ if( ! function_exists( 'wp_ulike_set_animated_heart_template' ) ){
224
  d="m471.382812 44.578125c-26.503906-28.746094-62.871093-44.578125-102.410156-44.578125-29.554687 0-56.621094 9.34375-80.449218 27.769531-12.023438 9.300781-22.917969 20.679688-32.523438 33.960938-9.601562-13.277344-20.5-24.660157-32.527344-33.960938-23.824218-18.425781-50.890625-27.769531-80.445312-27.769531-39.539063 0-75.910156 15.832031-102.414063 44.578125-26.1875 28.410156-40.613281 67.222656-40.613281 109.292969 0 43.300781 16.136719 82.9375 50.78125 124.742187 30.992188 37.394531 75.535156 75.355469 127.117188 119.3125 17.613281 15.011719 37.578124 32.027344 58.308593 50.152344 5.476563 4.796875 12.503907 7.4375 19.792969 7.4375 7.285156 0 14.316406-2.640625 19.785156-7.429687 20.730469-18.128907 40.707032-35.152344 58.328125-50.171876 51.574219-43.949218 96.117188-81.90625 127.109375-119.304687 34.644532-41.800781 50.777344-81.4375 50.777344-124.742187 0-42.066407-14.425781-80.878907-40.617188-109.289063zm0 0" />
225
  </svg>
226
  </button>
227
- <?php echo $counter; ?>
 
 
 
228
  </div>
229
  <?php
230
  do_action( 'wp_ulike_inside_template', $wp_ulike_template );
86
  }
87
  ?>
88
  </button>
89
+ <?php
90
+ echo $counter;
91
+ do_action( 'wp_ulike_after_up_vote_button', $wp_ulike_template );
92
+ ?>
93
  </div>
94
  <?php
95
  do_action( 'wp_ulike_inside_template', $wp_ulike_template );
135
  }
136
  ?>
137
  </button>
138
+ <?php
139
+ echo $counter;
140
+ do_action( 'wp_ulike_after_up_vote_button', $wp_ulike_template );
141
+ ?>
142
  </div>
143
  <?php
144
  do_action( 'wp_ulike_inside_template', $wp_ulike_template );
181
  do_action( 'wp_ulike_inside_like_button', $wp_ulike_template );
182
  ?>
183
  </button>
184
+ <?php
185
+ echo $counter;
186
+ do_action( 'wp_ulike_after_up_vote_button', $wp_ulike_template );
187
+ ?>
188
  </div>
189
  <?php
190
  do_action( 'wp_ulike_inside_template', $wp_ulike_template );
233
  d="m471.382812 44.578125c-26.503906-28.746094-62.871093-44.578125-102.410156-44.578125-29.554687 0-56.621094 9.34375-80.449218 27.769531-12.023438 9.300781-22.917969 20.679688-32.523438 33.960938-9.601562-13.277344-20.5-24.660157-32.527344-33.960938-23.824218-18.425781-50.890625-27.769531-80.445312-27.769531-39.539063 0-75.910156 15.832031-102.414063 44.578125-26.1875 28.410156-40.613281 67.222656-40.613281 109.292969 0 43.300781 16.136719 82.9375 50.78125 124.742187 30.992188 37.394531 75.535156 75.355469 127.117188 119.3125 17.613281 15.011719 37.578124 32.027344 58.308593 50.152344 5.476563 4.796875 12.503907 7.4375 19.792969 7.4375 7.285156 0 14.316406-2.640625 19.785156-7.429687 20.730469-18.128907 40.707032-35.152344 58.328125-50.171876 51.574219-43.949218 96.117188-81.90625 127.109375-119.304687 34.644532-41.800781 50.777344-81.4375 50.777344-124.742187 0-42.066407-14.425781-80.878907-40.617188-109.289063zm0 0" />
234
  </svg>
235
  </button>
236
+ <?php
237
+ echo $counter;
238
+ do_action( 'wp_ulike_after_up_vote_button', $wp_ulike_template );
239
+ ?>
240
  </div>
241
  <?php
242
  do_action( 'wp_ulike_inside_template', $wp_ulike_template );
inc/functions/utilities.php CHANGED
@@ -192,11 +192,10 @@ if( ! function_exists( 'wp_ulike_generate_user_id' ) ){
192
  $user_ip = wp_ulike_get_user_ip();
193
  $binary_val = '';
194
  foreach ( unpack( 'C*', inet_pton( $user_ip ) ) as $byte ) {
195
- $binary_val .= decbin( $byte );
196
  }
197
  return base_convert( ltrim( $binary_val, '0' ), 2, 10 );
198
  }
199
-
200
  }
201
  }
202
 
192
  $user_ip = wp_ulike_get_user_ip();
193
  $binary_val = '';
194
  foreach ( unpack( 'C*', inet_pton( $user_ip ) ) as $byte ) {
195
+ $binary_val .= str_pad( decbin( $byte ), 8, "0", STR_PAD_LEFT );
196
  }
197
  return base_convert( ltrim( $binary_val, '0' ), 2, 10 );
198
  }
 
199
  }
200
  }
201
 
inc/hooks/general.php CHANGED
@@ -210,3 +210,81 @@ if( ! function_exists( 'wp_ulike_update_button_icon' ) ){
210
  }
211
  add_action( 'wp_ulike_inside_template', 'wp_ulike_update_button_icon', 1 );
212
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  }
211
  add_action( 'wp_ulike_inside_template', 'wp_ulike_update_button_icon', 1 );
212
  }
213
+
214
+ /**
215
+ * Hide ajax data when counter zero
216
+ *
217
+ * @param integer $counterValue
218
+ * @param integer $id
219
+ * @param string $slug
220
+ * @param string $status
221
+ * @param boolean $is_distinct
222
+ * @return integer|string
223
+ */
224
+ function wp_ulike_hide_couter_box_ajax_when_zero( $counterValue, $id, $slug, $status, $is_distinct ){
225
+ // Check zero function
226
+ if( wp_ulike_setting_repo::isCounterZeroVisible( $slug ) ){
227
+ if( is_array( $counterValue ) ){
228
+ $counterValue['sub'] = ($counterValue['up'] - $counterValue['down']) == 0 ? '' : $counterValue['up'] - $counterValue['down'];
229
+ $counterValue['up'] = empty( $counterValue['up'] ) ? '' : $counterValue['up'];
230
+ $counterValue['down'] = empty( $counterValue['down'] ) ? '' : $counterValue['down'];
231
+ } elseif( empty( $counterValue ) ) {
232
+ $counterValue = '';
233
+ }
234
+ }
235
+
236
+ return $counterValue;
237
+ }
238
+
239
+ /**
240
+ * Hide counter args
241
+ *
242
+ * @param array $args
243
+ * @return array
244
+ */
245
+ function wp_ulike_hide_couter_box_when_zero( $args ){
246
+ // Check zero function
247
+ if( wp_ulike_setting_repo::isCounterZeroVisible( $args['slug'] ) ){
248
+ if( isset( $args['total_likes'] ) ){
249
+ $args['total_likes'] = empty( $args['total_likes'] ) ? '' : $args['total_likes'];
250
+ }
251
+ if( isset( $args['total_dislikes'] ) ){
252
+ $args['total_dislikes'] = empty( $args['total_dislikes'] ) ? '' : $args['total_dislikes'];
253
+ }
254
+ }
255
+
256
+ return $args;
257
+ }
258
+
259
+ /**
260
+ * Hide counter box template
261
+ *
262
+ * @param string $string
263
+ * @param integer $counter
264
+ * @param string $slug
265
+ * @return string
266
+ */
267
+ function wp_ulike_hide_count_box_template( $string, $counter, $slug ) {
268
+ // Check zero function
269
+ if( wp_ulike_setting_repo::isCounterZeroVisible( $slug ) ){
270
+ // Check counter value
271
+ $value = preg_replace("/[^0-9,.]/", "", $counter);
272
+ if( ! $value ){
273
+ return '<span class="count-box"></span>';
274
+ }
275
+ }
276
+
277
+ return $string;
278
+ }
279
+
280
+ /**
281
+ * Init plugins loaded hook
282
+ *
283
+ * @return void
284
+ */
285
+ function wp_ulike_init_plugins_loaded_hook(){
286
+ add_filter( 'wp_ulike_ajax_counter_value', 'wp_ulike_hide_couter_box_ajax_when_zero', 5, 15 );
287
+ add_filter( 'wp_ulike_add_templates_args', 'wp_ulike_hide_couter_box_when_zero', 10, 1);
288
+ add_filter('wp_ulike_count_box_template', 'wp_ulike_hide_count_box_template', 10, 3);
289
+ }
290
+ add_action( 'plugins_loaded', 'wp_ulike_init_plugins_loaded_hook' );
inc/hooks/third-party.php CHANGED
@@ -542,9 +542,8 @@ if( ! function_exists( 'wp_ulike_purge_litespeed_cache' ) ){
542
  if( $type === '_liked' ){
543
  if( get_post_type( $ID ) ){
544
  do_action( 'litespeed_purge_post', $ID );
545
- } else {
546
- global $wp;
547
- do_action( 'litespeed_purge_url', home_url( add_query_arg( array(), $wp->request ) ) );
548
  }
549
  } elseif( $type === '_commentliked' ){
550
  $comment = get_comment( $ID );
@@ -574,9 +573,8 @@ if( ! function_exists( 'wp_ulike_purge_w3_total_cache' ) ){
574
  if( $type === '_liked' ){
575
  if( get_post_type( $ID ) ){
576
  w3tc_flush_post( $ID );
577
- } else {
578
- global $wp;
579
- w3tc_flush_url( home_url( add_query_arg( array(), $wp->request ) ) );
580
  }
581
  } elseif( $type === '_commentliked' ){
582
  $comment = get_comment( $ID );
@@ -607,29 +605,22 @@ if( ! function_exists( 'wp_ulike_purge_wp_fastest_cache' ) ){
607
 
608
  // to remove cache if vote is from homepage or category page or tag
609
  if( isset($_SERVER["HTTP_REFERER"]) && $_SERVER["HTTP_REFERER"] ){
610
- $url = parse_url( $_SERVER["HTTP_REFERER"] );
611
-
612
  $url["path"] = isset($url["path"]) ? $url["path"] : "/index.html";
613
 
614
- $paths = array();
615
-
616
- array_push($paths, $cache_interface->getWpContentDir("/cache/all").$url["path"]);
617
-
618
- if(class_exists("WpFcMobileCache")){
619
- $wpfc_mobile = new WpFcMobileCache();
620
- array_push($paths, $cache_interface->getWpContentDir("/cache/wpfc-mobile-cache").$url["path"]);
621
- }
622
-
623
- foreach ($paths as $key => $value){
624
- if(file_exists($value)){
625
- if(preg_match("/\/(all|wpfc-mobile-cache)\/index\.html$/i", $value)){
626
- @unlink($value);
627
- }else{
628
- $cache_interface->rm_folder_recursively($value);
629
  }
630
  }
631
  }
632
- } elseif( in_array( $type, array( '_liked', '_commentliked' ) ) ){
 
 
633
  $comment_id = false;
634
  $post_id = $ID;
635
  if( $type === '_commentliked' ){
@@ -668,9 +659,8 @@ if( ! function_exists( 'wp_ulike_purge_wp_super_cache' ) ){
668
  if( $type === '_liked' ){
669
  if( get_post_type( $ID ) ){
670
  wpsc_delete_post_cache( $ID );
671
- } else {
672
- global $wp;
673
- wpsc_delete_url_cache( home_url( add_query_arg( array(), $wp->request ) ) );
674
  }
675
  } elseif( $type === '_commentliked' ){
676
  $comment = get_comment( $ID );
@@ -701,9 +691,8 @@ if( ! function_exists( 'wp_ulike_purge_rocket_cache' ) ){
701
  // Check post type ID
702
  if( get_post_type( $ID ) ){
703
  rocket_clean_post( $ID );
704
- } else {
705
- global $wp;
706
- rocket_clean_files( home_url( add_query_arg( array(), $wp->request ) ) );
707
  }
708
  } elseif( $type === '_commentliked' ){
709
  $comment = get_comment( $ID );
@@ -733,9 +722,8 @@ if( ! function_exists( 'wp_ulike_purge_wp_optimize_cache' ) ){
733
  if( $type === '_liked' ){
734
  if( get_post_type( $ID ) ){
735
  WPO_Page_Cache::delete_single_post_cache( $ID );
736
- } else {
737
- global $wp;
738
- WPO_Page_Cache::delete_cache_by_url( home_url( add_query_arg( array(), $wp->request ) ) );
739
  }
740
  } elseif( $type === '_commentliked' ){
741
  $comment = get_comment( $ID );
@@ -747,6 +735,38 @@ if( ! function_exists( 'wp_ulike_purge_wp_optimize_cache' ) ){
747
  add_action( 'wp_ulike_after_process', 'wp_ulike_purge_wp_optimize_cache' , 10, 2 );
748
  }
749
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
750
  /*******************************************************
751
  Other Plugins
752
  *******************************************************/
542
  if( $type === '_liked' ){
543
  if( get_post_type( $ID ) ){
544
  do_action( 'litespeed_purge_post', $ID );
545
+ } elseif( false !== ( $reffer_url = wp_get_referer() ) ) {
546
+ do_action( 'litespeed_purge_url', $reffer_url );
 
547
  }
548
  } elseif( $type === '_commentliked' ){
549
  $comment = get_comment( $ID );
573
  if( $type === '_liked' ){
574
  if( get_post_type( $ID ) ){
575
  w3tc_flush_post( $ID );
576
+ } elseif( false !== ( $reffer_url = wp_get_referer() ) ) {
577
+ w3tc_flush_url( $reffer_url );
 
578
  }
579
  } elseif( $type === '_commentliked' ){
580
  $comment = get_comment( $ID );
605
 
606
  // to remove cache if vote is from homepage or category page or tag
607
  if( isset($_SERVER["HTTP_REFERER"]) && $_SERVER["HTTP_REFERER"] ){
608
+ $url = parse_url($_SERVER["HTTP_REFERER"]);
 
609
  $url["path"] = isset($url["path"]) ? $url["path"] : "/index.html";
610
 
611
+ if(isset($url["path"])){
612
+ if($url["path"] == "/"){
613
+ $this->rm_folder_recursively($this->getWpContentDir("/cache/all/index.html"));
614
+ }else{
615
+ // to prevent changing path with ../ or with another method
616
+ if($url["path"] == realpath(".".$url["path"])){
617
+ $this->rm_folder_recursively($this->getWpContentDir("/cache/all").$url["path"]);
 
 
 
 
 
 
 
 
618
  }
619
  }
620
  }
621
+ }
622
+ // Delete post cache
623
+ if( in_array( $type, array( '_liked', '_commentliked' ) ) ){
624
  $comment_id = false;
625
  $post_id = $ID;
626
  if( $type === '_commentliked' ){
659
  if( $type === '_liked' ){
660
  if( get_post_type( $ID ) ){
661
  wpsc_delete_post_cache( $ID );
662
+ } elseif( false !== ( $reffer_url = wp_get_referer() ) ) {
663
+ wpsc_delete_url_cache( $reffer_url );
 
664
  }
665
  } elseif( $type === '_commentliked' ){
666
  $comment = get_comment( $ID );
691
  // Check post type ID
692
  if( get_post_type( $ID ) ){
693
  rocket_clean_post( $ID );
694
+ } elseif( false !== ( $reffer_url = wp_get_referer() ) ) {
695
+ rocket_clean_files( $reffer_url );
 
696
  }
697
  } elseif( $type === '_commentliked' ){
698
  $comment = get_comment( $ID );
722
  if( $type === '_liked' ){
723
  if( get_post_type( $ID ) ){
724
  WPO_Page_Cache::delete_single_post_cache( $ID );
725
+ } elseif ( false !== ( $reffer_url = wp_get_referer() ) ) {
726
+ WPO_Page_Cache::delete_cache_by_url( $reffer_url );
 
727
  }
728
  } elseif( $type === '_commentliked' ){
729
  $comment = get_comment( $ID );
735
  add_action( 'wp_ulike_after_process', 'wp_ulike_purge_wp_optimize_cache' , 10, 2 );
736
  }
737
 
738
+ // SG optimizer cache plugin
739
+ if( ! function_exists( 'wp_ulike_purge_sg_cachepress_cache' ) ){
740
+ /**
741
+ * Purge SG Optimizer cache
742
+ *
743
+ * @param integer $ID
744
+ * @param string $type
745
+ * @return void
746
+ */
747
+ function wp_ulike_purge_sg_cachepress_cache( $ID, $type ){
748
+ // Check functionality existence
749
+ if( ! function_exists( 'sg_cachepress_purge_cache' ) ){
750
+ return;
751
+ }
752
+
753
+ if( $type === '_liked' ){
754
+ // Check post type ID
755
+ if( get_post_type( $ID ) ){
756
+ sg_cachepress_purge_cache( get_permalink( $ID ) );
757
+ } elseif( false !== ( $reffer_url = wp_get_referer() ) ) {
758
+ sg_cachepress_purge_cache( $reffer_url );
759
+ }
760
+ } elseif( $type === '_commentliked' ){
761
+ $comment = get_comment( $ID );
762
+ if( isset( $comment->comment_post_ID ) ){
763
+ sg_cachepress_purge_cache( get_permalink( $comment->comment_post_ID ) );
764
+ }
765
+ }
766
+ }
767
+ add_action( 'wp_ulike_after_process', 'wp_ulike_purge_sg_cachepress_cache' , 10, 2 );
768
+ }
769
+
770
  /*******************************************************
771
  Other Plugins
772
  *******************************************************/
readme.txt CHANGED
@@ -2,11 +2,11 @@
2
  Contributors: alimir
3
  Donate link: https://wpulike.com/?utm_source=wp-repo&utm_medium=link&utm_campaign=readme
4
  Author: TechnoWich
5
- Tags: like, marketing, elementor, favorite, statistics, multisite, rating, voting, dislike, gamification, bookmark, member
6
  Requires PHP: 5.6
7
  Requires at least: 5.0
8
- Tested up to: 5.5.3
9
- Stable tag: 4.4.1
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -38,6 +38,9 @@ The [WP ULike profile builder](https://wpulike.com/blog/wordpress-ultimate-profi
38
  Elementor is the #1 WordPress page builder. In the new version of the WP ULike PRO plugin, we fully support this page builder and have a variety of widgets & controllers that make life much easier for you.
39
  Just drag your desired widget and drop it in your Elementor sections, customize as you go and enjoy your like and dislike buttons on your contents.
40
 
 
 
 
41
  = Boost Your SEO by Using Our Schema Markup Generator [PRO] =
42
  Schema markup is a form of data structure and helps Search Engine to have a better understanding of content. The Process for adding these schemas to your webpage is quite messy and confusing. Because of that, WP ULike Pro adds a Metabox to your posts so you can easily generate your custom rich snippets.
43
 
@@ -47,20 +50,24 @@ So let's talk [PROfessional](https://wpulike.com/pricing/?utm_source=wp-repo&utm
47
  There are many other [features](https://wpulike.com/blog/wp-ulike-pro-vs-free/?utm_source=wp-repo&utm_medium=link&utm_campaign=readme) to help you build better websites:
48
 
49
  * Like, Dislike and Subtotal Votings support
 
50
  * Supports Rest APIs with a Variety of Routes for Use in Apps
51
  * Advanced Settings Panel With Easy Backup and Flexible Customization Options
52
  * Professional Schema.org Generator + Start Ratings
 
 
53
  * Progressive Log Management Panel, with advanced search capabilities
54
  * Database optimization panel with various options
55
  * +20 Carefully Designed Premium Templates
56
  * Anonymize IP option for GDPR compliance
57
  * Flexible Metabox Options with More Customization Settings For Each Post
58
- * Full myCred (Points, Rewards, Gamification, Ranks, Badges & Loyalty Plugin) Support.
59
  * Professional Statistics Panel With Date Range & Status Controllers
60
- * Notifications System. (Custom toast messages after each activity)
61
  * Applied Shortcodes with Easy Shortcode Generator Button
62
  * Full Support for Elementor Page Builder With Functional Widgets
63
- * And much more.
 
64
 
65
  Join the elite web professionals who enjoy **[WP ULike PRO](https://wpulike.com/?utm_source=wp-repo&utm_medium=link&utm_campaign=readme)**.
66
 
@@ -96,11 +103,14 @@ You can also add a new language via [translate.wordpress.org](https://translate.
96
 
97
  == Screenshots ==
98
 
99
- 1. **Get Ratings From Every Section of Your Website**
100
- 2. **Check Votings, BestLikers & Top contents**
101
- 3. **Start to Configure your Voting Plugin in a few Steps**
102
- 4. **Boost Your SEO by Using Our Professional Schema Generator [PRO]**
103
- 5. **Customize Every Aspect of Your Like Buttons with Elementor Widgets [PRO]**
 
 
 
104
 
105
  == Frequently Asked Questions ==
106
 
@@ -152,6 +162,17 @@ define( 'WP_MEMORY_LIMIT', '256M' );
152
 
153
  == Changelog ==
154
 
 
 
 
 
 
 
 
 
 
 
 
155
  = 4.4.1 =
156
  * Updated: Options panel framework.
157
  * Fixed: Some major issues.
2
  Contributors: alimir
3
  Donate link: https://wpulike.com/?utm_source=wp-repo&utm_medium=link&utm_campaign=readme
4
  Author: TechnoWich
5
+ Tags: like, marketing, elementor, user profile, statistics, favorite, rating, button, dislike, gamification, bookmark, member
6
  Requires PHP: 5.6
7
  Requires at least: 5.0
8
+ Tested up to: 5.6
9
+ Stable tag: 4.4.2
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
38
  Elementor is the #1 WordPress page builder. In the new version of the WP ULike PRO plugin, we fully support this page builder and have a variety of widgets & controllers that make life much easier for you.
39
  Just drag your desired widget and drop it in your Elementor sections, customize as you go and enjoy your like and dislike buttons on your contents.
40
 
41
+ = Easy WordPress login and registration forms [PRO] =
42
+ Not happy with the default WordPress login and registration pages? In WP ULike Pro, We provide you with more control and flexibility over your WordPress default forms. It redefines what a login and registration plugin be able to do with fast AJAX requests & easy made templates.
43
+
44
  = Boost Your SEO by Using Our Schema Markup Generator [PRO] =
45
  Schema markup is a form of data structure and helps Search Engine to have a better understanding of content. The Process for adding these schemas to your webpage is quite messy and confusing. Because of that, WP ULike Pro adds a Metabox to your posts so you can easily generate your custom rich snippets.
46
 
50
  There are many other [features](https://wpulike.com/blog/wp-ulike-pro-vs-free/?utm_source=wp-repo&utm_medium=link&utm_campaign=readme) to help you build better websites:
51
 
52
  * Like, Dislike and Subtotal Votings support
53
+ * Simple and effective options to customize every aspect of plugin styles
54
  * Supports Rest APIs with a Variety of Routes for Use in Apps
55
  * Advanced Settings Panel With Easy Backup and Flexible Customization Options
56
  * Professional Schema.org Generator + Start Ratings
57
+ * AJAX Based Login, Registration, Reset Password and Edit Profile forms
58
+ * Easy local avatar upload inside front-end and dashboard area
59
  * Progressive Log Management Panel, with advanced search capabilities
60
  * Database optimization panel with various options
61
  * +20 Carefully Designed Premium Templates
62
  * Anonymize IP option for GDPR compliance
63
  * Flexible Metabox Options with More Customization Settings For Each Post
64
+ * Full myCred (Points, Rewards, Gamification, Ranks, Badges & Loyalty Plugin) Support
65
  * Professional Statistics Panel With Date Range & Status Controllers
66
+ * Notifications System (Custom toast messages after each activity)
67
  * Applied Shortcodes with Easy Shortcode Generator Button
68
  * Full Support for Elementor Page Builder With Functional Widgets
69
+ * Support Cache Plugins: WP Rocket, LiteSpeed, W3 Total Cache, Fastest Cache, Super Cache, etc.
70
+ * And much more...
71
 
72
  Join the elite web professionals who enjoy **[WP ULike PRO](https://wpulike.com/?utm_source=wp-repo&utm_medium=link&utm_campaign=readme)**.
73
 
103
 
104
  == Screenshots ==
105
 
106
+ 1. **Carefully designed templates**
107
+ 2. **Professional statistics panel**
108
+ 3. **Simple and user-friendly settings panel**
109
+ 4. **Progressive log management panel**
110
+ 5. **Complete customizer options**
111
+ 6. **Full support for elementor with +7 functional widgets [PRO]**
112
+ 7. **Easy wordPress login and registration forms [PRO]**
113
+ 8. **Flexible metabox panel [PRO]**
114
 
115
  == Frequently Asked Questions ==
116
 
162
 
163
  == Changelog ==
164
 
165
+ = 4.4.2 =
166
+ * Added: "SG Optimiser" plugin cache support.
167
+ * Added: New option to hide counter box when no votes have been cast.
168
+ * Added: User (profile) edit forms. (Using a new shortcode) [PRO]
169
+ * Added: Local avatar upload option inside front-end and dashboard area. [PRO]
170
+ * Added: Export CSV logs button on admin column filters. [PRO]
171
+ * Updated: Meta query functions.
172
+ * Fixed: Purge cache referrer url issue.
173
+ * Fixed: Attachment post type issue on top items.
174
+ * Fixed: Some major issues.
175
+
176
  = 4.4.1 =
177
  * Updated: Options panel framework.
178
  * Fixed: Some major issues.
wp-ulike.php CHANGED
@@ -10,7 +10,7 @@
10
  * Plugin Name: WP ULike
11
  * Plugin URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
12
  * Description: WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and unlike pages, posts, comments AND buddypress activities. Its very simple to use and supports many options.
13
- * Version: 4.4.1
14
  * Author: TechnoWich
15
  * Author URI: https://technowich.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
16
  * Text Domain: wp-ulike
@@ -46,7 +46,7 @@ if ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) {
46
 
47
  // Do not change these values
48
  define( 'WP_ULIKE_PLUGIN_URI' , 'https://wpulike.com/' );
49
- define( 'WP_ULIKE_VERSION' , '4.4.1' );
50
  define( 'WP_ULIKE_DB_VERSION' , '2.1' );
51
  define( 'WP_ULIKE_SLUG' , 'wp-ulike' );
52
  define( 'WP_ULIKE_NAME' , __( 'WP ULike', WP_ULIKE_SLUG ));
10
  * Plugin Name: WP ULike
11
  * Plugin URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
12
  * Description: WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and unlike pages, posts, comments AND buddypress activities. Its very simple to use and supports many options.
13
+ * Version: 4.4.2
14
  * Author: TechnoWich
15
  * Author URI: https://technowich.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
16
  * Text Domain: wp-ulike
46
 
47
  // Do not change these values
48
  define( 'WP_ULIKE_PLUGIN_URI' , 'https://wpulike.com/' );
49
+ define( 'WP_ULIKE_VERSION' , '4.4.2' );
50
  define( 'WP_ULIKE_DB_VERSION' , '2.1' );
51
  define( 'WP_ULIKE_SLUG' , 'wp-ulike' );
52
  define( 'WP_ULIKE_NAME' , __( 'WP ULike', WP_ULIKE_SLUG ));