Post Views Counter - Version 1.1.0

Version Description

  • New: Quick post views edit
  • New: Bulk post views edit
  • Tweak: Admin UI improvements
Download this release

Release Info

Developer dfactory
Plugin Icon 128x128 Post Views Counter
Version 1.1.0
Comparing to
See all releases

Code changes from version 1.0.12 to 1.1.0

assets/chosen/chosen-sprite.png DELETED
Binary file
assets/chosen/chosen-sprite@2x.png DELETED
Binary file
assets/chosen/chosen.jquery.min.js DELETED
@@ -1,2 +0,0 @@
1
- /* Chosen v1.1.0 | (c) 2011-2013 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
- !function(){var a,AbstractChosen,Chosen,SelectParser,b,c={}.hasOwnProperty,d=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};SelectParser=function(){function SelectParser(){this.options_index=0,this.parsed=[]}return SelectParser.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},SelectParser.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),children:0,disabled:a.disabled}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},SelectParser.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},SelectParser.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&amp;"})):a},SelectParser}(),SelectParser.select_to_array=function(a){var b,c,d,e,f;for(c=new SelectParser,f=a.childNodes,d=0,e=f.length;e>d;d++)b=f[d],c.add_node(b);return c.parsed},AbstractChosen=function(){function AbstractChosen(a,b){this.form_field=a,this.options=null!=b?b:{},AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers())}return AbstractChosen.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0},AbstractChosen.prototype.set_default_text=function(){return this.default_text=this.form_field.getAttribute("data-placeholder")?this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text},AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0},AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1},AbstractChosen.prototype.input_focus=function(){var a=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return a.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},AbstractChosen.prototype.input_blur=function(){var a=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return a.blur_test()},100))},AbstractChosen.prototype.results_option_build=function(a){var b,c,d,e,f;for(b="",f=this.results_data,d=0,e=f.length;e>d;d++)c=f[d],b+=c.group?this.result_add_group(c):this.result_add_option(c),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(c.text));return b},AbstractChosen.prototype.result_add_option=function(a){var b,c;return a.search_match?this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,this.outerHTML(c)):"":""},AbstractChosen.prototype.result_add_group=function(a){var b;return a.search_match||a.group_match?a.active_options>0?(b=document.createElement("li"),b.className="group-result",b.innerHTML=a.search_text,this.outerHTML(b)):"":""},AbstractChosen.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},AbstractChosen.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},AbstractChosen.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},AbstractChosen.prototype.results_search=function(){return this.results_showing?this.winnow_results():this.results_show()},AbstractChosen.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m;for(this.no_results_clear(),e=0,g=this.get_search_text(),a=g.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),d=this.search_contains?"":"^",c=new RegExp(d+a,"i"),j=new RegExp(a,"i"),m=this.results_data,k=0,l=m.length;l>k;k++)b=m[k],b.search_match=!1,f=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(f=this.results_data[b.group_array_index],0===f.active_options&&f.search_match&&(e+=1),f.active_options+=1),(!b.group||this.group_search)&&(b.search_text=b.group?b.label:b.html,b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(e+=1),b.search_match?(g.length&&(h=b.search_text.search(j),i=b.search_text.substr(0,h+g.length)+"</em>"+b.search_text.substr(h+g.length),b.search_text=i.substr(0,h)+"<em>"+i.substr(h)),null!=f&&(f.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>e&&g.length?(this.update_results_content(""),this.no_results(g)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},AbstractChosen.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},AbstractChosen.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},AbstractChosen.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},AbstractChosen.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},AbstractChosen.prototype.clipboard_event_checker=function(){var a=this;return setTimeout(function(){return a.results_search()},50)},AbstractChosen.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},AbstractChosen.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},AbstractChosen.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},AbstractChosen.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},AbstractChosen.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},AbstractChosen.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},AbstractChosen.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent)?!1:!0},AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results match",AbstractChosen}(),a=jQuery,a.fn.extend({chosen:function(b){return AbstractChosen.browser_is_supported()?this.each(function(){var c,d;c=a(this),d=c.data("chosen"),"destroy"===b&&d?d.destroy():d||c.data("chosen",new Chosen(this,b))}):this}}),Chosen=function(c){function Chosen(){return b=Chosen.__super__.constructor.apply(this,arguments)}return d(Chosen,c),Chosen.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},Chosen.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("<div />",c),this.is_multiple?this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'):this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},Chosen.prototype.register_observers=function(){var a=this;return this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},Chosen.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},Chosen.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},Chosen.prototype.container_mousedown=function(b){return this.is_disabled||(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},Chosen.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},Chosen.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},Chosen.prototype.blur_test=function(){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},Chosen.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},Chosen.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},Chosen.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},Chosen.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},Chosen.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},Chosen.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},Chosen.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},Chosen.prototype.update_results_content=function(a){return this.search_results.html(a)},Chosen.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},Chosen.prototype.set_tab_index=function(){var a;return this.form_field.tabIndex?(a=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=a):void 0},Chosen.prototype.set_label_behavior=function(){var b=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()}):void 0},Chosen.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},Chosen.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},Chosen.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},Chosen.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},Chosen.prototype.choice_build=function(b){var c,d,e=this;return c=a("<li />",{"class":"search-choice"}).html("<span>"+b.html+"</span>"),b.disabled?c.addClass("search-choice-disabled"):(d=a("<a />",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},Chosen.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},Chosen.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},Chosen.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},Chosen.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},Chosen.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(c.text),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())):void 0},Chosen.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").text(a)},Chosen.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},Chosen.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")):void 0},Chosen.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":a("<div/>").text(a.trim(this.search_field.val())).html()},Chosen.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},Chosen.prototype.no_results=function(b){var c;return c=a('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},Chosen.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},Chosen.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},Chosen.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},Chosen.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},Chosen.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},Chosen.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;j>i;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("<div />",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},Chosen}(AbstractChosen)}.call(this);
 
 
assets/chosen/chosen.min.css DELETED
@@ -1,3 +0,0 @@
1
- /* Chosen v1.1.0 | (c) 2011-2013 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
-
3
- .chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;zoom:1;*display:inline;-webkit-user-select:none;-moz-user-select:none;user-select:none}.chosen-container .chosen-drop{position:absolute;top:100%;left:-9999px;z-index:1010;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15)}.chosen-container.chosen-with-drop .chosen-drop{left:0}.chosen-container a{cursor:pointer}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:23px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),color-stop(100%,#f4f4f4));background:-webkit-linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-moz-linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-o-linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url(chosen-sprite.png) no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:#fff url(chosen-sprite.png) no-repeat 100% -20px;background:url(chosen-sprite.png) no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:-webkit-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-moz-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-o-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;width:100%;height:auto!important;height:1%;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(1%,#eee),color-stop(15%,#fff));background-image:-webkit-linear-gradient(#eee 1%,#fff 15%);background-image:-moz-linear-gradient(#eee 1%,#fff 15%);background-image:-o-linear-gradient(#eee 1%,#fff 15%);background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:5px;height:15px;outline:0;border:0!important;background:transparent!important;box-shadow:none;color:#666;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-multi .chosen-choices li.search-field .default{color:#999}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 0 3px 5px;padding:3px 20px 3px 5px;border:1px solid #aaa;border-radius:3px;background-color:#e4e4e4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;-moz-border-radius-bottomright:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#eee),color-stop(80%,#fff));background-image:-webkit-linear-gradient(#eee 20%,#fff 80%);background-image:-moz-linear-gradient(#eee 20%,#fff 80%);background-image:-o-linear-gradient(#eee 20%,#fff 80%);background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:0;background:transparent}.chosen-container-active.chosen-with-drop .chosen-single div b{background-position:-18px 2px}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#111!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single-nosearch .chosen-search,.chosen-rtl .chosen-drop{left:9999px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:0}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;background:#fff url(chosen-sprite.png) no-repeat -30px -20px;background:url(chosen-sprite.png) no-repeat -30px -20px;direction:rtl}.chosen-rtl.chosen-container-single .chosen-single div b{background-position:6px 2px}.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b{background-position:-12px 2px}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min-resolution:144dpi){.chosen-rtl .chosen-search input[type=text],.chosen-container-single .chosen-single abbr,.chosen-container-single .chosen-single div b,.chosen-container-single .chosen-search input[type=text],.chosen-container-multi .chosen-choices .search-choice .search-choice-close,.chosen-container .chosen-results-scroll-down span,.chosen-container .chosen-results-scroll-up span{background-image:url(chosen-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}}
 
 
 
css/admin.css CHANGED
@@ -16,17 +16,6 @@
16
  display: block;
17
  }
18
 
19
- .post-views-counter-settings .chosen-container {
20
- margin: 0.25em 0 0.5em;
21
- }
22
-
23
- .post-views-counter-settings .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
24
- font-family: inherit;
25
- height: inherit;
26
- line-height: 1em;
27
- margin: 0;
28
- }
29
-
30
  .post-views-counter-settings p.help, .post-views-counter-settings p.description, .post-views-counter-settings span.description {
31
  font-size: 13px;
32
  font-style: italic;
@@ -89,4 +78,412 @@
89
  color: #888;
90
  content: "\f185";
91
  top: -1px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  }
16
  display: block;
17
  }
18
 
 
 
 
 
 
 
 
 
 
 
 
19
  .post-views-counter-settings p.help, .post-views-counter-settings p.description, .post-views-counter-settings span.description {
20
  font-size: 13px;
21
  font-style: italic;
78
  color: #888;
79
  content: "\f185";
80
  top: -1px;
81
+ }
82
+
83
+ /* Listing edit screen */
84
+ .edit-php .widefat th#post_views {
85
+ width: 5.5em;
86
+ }
87
+ .edit-php .widefat th.column-post_views .dashicons,
88
+ .edit-php .widefat th.column-post_views .dashicons:before {
89
+ font-size: 1.1em;
90
+ vertical-align: middle;
91
+ }
92
+ .edit-php .widefat th .dash-title {
93
+ display:none;
94
+ }
95
+ .edit-php .metabox-prefs .dash-icon {
96
+ display:none;
97
+ }
98
+ .edit-php .widefat td .dashicons,
99
+ .edit-php .widefat td .dashicons:before {
100
+ font-size: 1.1em;
101
+ }
102
+ .edit-php #inline-edit-post_views input {
103
+ width: auto;
104
+ }
105
+
106
+ /*
107
+ * checkBo lightweight jQuery plugin v0.1.4 by @ElmahdiMahmoud
108
+ * Licensed under the MIT license - https://github.com/elmahdim/checkbo/blob/master/LICENSE
109
+ *
110
+ * Custom checkbox and radio
111
+ * Author URL: elmahdim.com
112
+ */
113
+ .cb-checkbox .cb-inner, .cb-checkbox i {
114
+ width:18px;
115
+ height:18px;
116
+ -moz-border-radius:3px;
117
+ -webkit-border-radius:3px;
118
+ border-radius:3px
119
+ }
120
+ .cb-checkbox.cb-sm i, .cb-checkbox.cb-sm .cb-inner {
121
+ width:14px;
122
+ height:14px
123
+ }
124
+ .cb-checkbox.cb-md i, .cb-checkbox.cb-md .cb-inner {
125
+ width:24px;
126
+ height:24px;
127
+ -moz-border-radius:4px;
128
+ -webkit-border-radius:4px;
129
+ border-radius:4px
130
+ }
131
+ .cb-checkbox.cb-lg i, .cb-checkbox.cb-lg .cb-inner {
132
+ width:30px;
133
+ height:30px;
134
+ -moz-border-radius:6px;
135
+ -webkit-border-radius:6px;
136
+ border-radius:6px
137
+ }
138
+ .cb-radio .cb-inner {
139
+ width:18px;
140
+ height:18px
141
+ }
142
+ .cb-radio.cb-sm .cb-inner {
143
+ width:14px;
144
+ height:14px
145
+ }
146
+ .cb-radio.cb-md .cb-inner {
147
+ width:24px;
148
+ height:24px
149
+ }
150
+ .cb-radio.cb-lg .cb-inner {
151
+ width:30px;
152
+ height:30px
153
+ }
154
+ .cb-checkbox, .cb-radio {
155
+ color:inherit;
156
+ cursor:pointer;
157
+ overflow:hidden;
158
+ font-size:inherit;
159
+ font-weight:normal;
160
+ display:inline-block;
161
+ line-height:18px;
162
+ margin-right: 8px;
163
+ }
164
+ .form-table td fieldset label.cb-checkbox,
165
+ .form-table td fieldset label.cb-radio {
166
+ margin-right: 8px !important;
167
+ }
168
+ .cb-checkbox.disabled, .cb-checkbox.disabled *, .cb-radio.disabled, .cb-radio.disabled * {
169
+ cursor:default
170
+ }
171
+ .cb-checkbox input[type="checkbox"], .cb-radio input[type="radio"], .cb-switcher input[type="checkbox"], .cb-switcher input[type="radio"] {
172
+ display:none
173
+ }
174
+ .cb-checkbox.disabled, .cb-checkbox.disabled *, .cb-radio.disabled, .cb-radio.disabled *, .cb-switcher.disabled, .cb-switcher.disabled * {
175
+ cursor:default
176
+ }
177
+ .cb-checkbox.disabled {
178
+ color:#ddd
179
+ }
180
+ .cb-checkbox.disabled .cb-inner {
181
+ color:#ddd
182
+ }
183
+ .cb-checkbox.disabled:hover .cb-inner {
184
+ border-color:#ddd
185
+ }
186
+ .cb-checkbox.disabled.checked .cb-inner {
187
+ background-color:#ddd;
188
+ border-color:#ddd
189
+ }
190
+ .cb-radio.disabled {
191
+ color:#ddd
192
+ }
193
+ .cb-radio.disabled .cb-inner {
194
+ border-color:#ddd
195
+ }
196
+ .cb-radio.disabled i {
197
+ background-color:transparent
198
+ }
199
+ .cb-radio.disabled.checked .cb-inner {
200
+ border-color:#ddd
201
+ }
202
+ .cb-radio.disabled.checked .cb-inner i {
203
+ background-color:#ddd
204
+ }
205
+ .cb-radio.disabled:hover .cb-inner {
206
+ border-color:#ddd
207
+ }
208
+ .cb-checkbox .cb-inner {
209
+ float:left;
210
+ overflow:hidden;
211
+ margin:0 5px 0 0;
212
+ position:relative;
213
+ background:#f2f2f2;
214
+ display:inline-block;
215
+ border:1px solid #d6d6d6;
216
+ -moz-transition:all 0.5s ease;
217
+ -o-transition:all 0.5s ease;
218
+ -webkit-transition:all 0.5s ease;
219
+ transition:all 0.5s ease
220
+ }
221
+ .cb-checkbox i {
222
+ top:1px;
223
+ left:2px;
224
+ display:block;
225
+ position:absolute
226
+ }
227
+ .cb-checkbox i:before, .cb-checkbox i:after {
228
+ height:0;
229
+ width:2px;
230
+ content:"";
231
+ display:block;
232
+ position:absolute;
233
+ background-color:#fff;
234
+ -moz-transition:all 0.2s ease;
235
+ -o-transition:all 0.2s ease;
236
+ -webkit-transition:all 0.2s ease;
237
+ transition:all 0.2s ease
238
+ }
239
+ .cb-checkbox i:before {
240
+ top:0;
241
+ left:0;
242
+ -moz-transform:rotate(-45deg);
243
+ -ms-transform:rotate(-45deg);
244
+ -webkit-transform:rotate(-45deg);
245
+ transform:rotate(-45deg)
246
+ }
247
+ .cb-checkbox i:after {
248
+ left:7px;
249
+ bottom:5px;
250
+ -moz-transition-delay:0.3s;
251
+ -o-transition-delay:0.3s;
252
+ -webkit-transition-delay:0.3s;
253
+ transition-delay:0.3s;
254
+ -moz-transform:rotate(30deg);
255
+ -ms-transform:rotate(30deg);
256
+ -webkit-transform:rotate(30deg);
257
+ transform:rotate(30deg)
258
+ }
259
+ .cb-radio .cb-inner {
260
+ float:left;
261
+ overflow:hidden;
262
+ margin:0 5px 0 0;
263
+ position:relative;
264
+ display:inline-block;
265
+ border:1px solid #d7d7d7;
266
+ background-color:#f2f2f2;
267
+ -moz-border-radius:100%;
268
+ -webkit-border-radius:100%;
269
+ border-radius:100%;
270
+ -moz-transition:all 0.1s ease;
271
+ -o-transition:all 0.1s ease;
272
+ -webkit-transition:all 0.1s ease;
273
+ transition:all 0.1s ease
274
+ }
275
+ .cb-radio i {
276
+ top:50%;
277
+ left:50%;
278
+ width:6px;
279
+ height:6px;
280
+ margin-top:-3px;
281
+ margin-left:-3px;
282
+ position:absolute;
283
+ background-color:transparent;
284
+ -moz-border-radius:100%;
285
+ -webkit-border-radius:100%;
286
+ border-radius:100%;
287
+ -moz-transform:scale(0.05, 5);
288
+ -ms-transform:scale(0.05, 5);
289
+ -webkit-transform:scale(0.05, 5);
290
+ transform:scale(0.05, 5);
291
+ -moz-transition:all 0.2s ease;
292
+ -o-transition:all 0.2s ease;
293
+ -webkit-transition:all 0.2s ease;
294
+ transition:all 0.2s ease
295
+ }
296
+ .cb-checkbox.cb-sm, .cb-radio.cb-sm {
297
+ line-height:14px
298
+ }
299
+ .cb-checkbox.cb-md, .cb-radio.cb-md {
300
+ line-height:24px
301
+ }
302
+ .cb-checkbox.cb-lg, .cb-radio.cb-lg {
303
+ line-height:30px
304
+ }
305
+ .cb-checkbox.cb-sm i:before {
306
+ top:4px;
307
+ left:1px
308
+ }
309
+ .cb-checkbox.cb-sm i:after {
310
+ left:5px
311
+ }
312
+ .cb-checkbox.cb-md i:before {
313
+ top:10px;
314
+ left:5px
315
+ }
316
+ .cb-checkbox.cb-md i:after {
317
+ bottom:6px;
318
+ left:11px
319
+ }
320
+ .cb-checkbox.checked .cb-inner {
321
+ border-color:#0073aa;
322
+ background-color:#00a0d2;
323
+ box-shadow: 0 1px 0 rgba(120, 200, 230, 0.5) inset, 0 1px 0 rgba(0, 0, 0, 0.15);
324
+ }
325
+ .cb-checkbox.checked:hover .cb-inner {
326
+ background-color:#0091cd
327
+ }
328
+ .cb-checkbox.checked.cb-sm i:before {
329
+ top:4px;
330
+ left:1px
331
+ }
332
+ .cb-checkbox.checked.cb-sm i:after {
333
+ height:9px
334
+ }
335
+ .cb-checkbox.checked.cb-md i:before {
336
+ top:10px;
337
+ left:4px;
338
+ height:8px
339
+ }
340
+ .cb-checkbox.checked.cb-md i:after {
341
+ bottom:6px;
342
+ left:11px;
343
+ height:16px
344
+ }
345
+ .cb-checkbox.checked.cb-lg i:before {
346
+ top:11px;
347
+ left:6px;
348
+ height:12px
349
+ }
350
+ .cb-checkbox.checked.cb-lg i:after {
351
+ left:14px;
352
+ bottom:7px;
353
+ height:20px
354
+ }
355
+ .cb-checkbox.checked i:before {
356
+ top:6px;
357
+ left:2px;
358
+ height:6px
359
+ }
360
+ .cb-checkbox.checked i:after {
361
+ height:12px
362
+ }
363
+ .cb-radio.checked .cb-inner {
364
+ background:#fff;
365
+ box-shadow:0 0 3px #efefef
366
+ }
367
+ .cb-radio.checked i {
368
+ -moz-transform:scale(1.1, 1.1);
369
+ -ms-transform:scale(1.1, 1.1);
370
+ -webkit-transform:scale(1.1, 1.1);
371
+ transform:scale(1.1, 1.1);
372
+ background-color:#00a0d2
373
+ }
374
+ .cb-checkbox:hover .cb-inner, .cb-radio:hover .cb-inner {
375
+ border-color:#0073aa
376
+ }
377
+ .cb-switcher {
378
+ display:inline-block;
379
+ border:1px solid #eee;
380
+ background-color:#fff;
381
+ width:95px;
382
+ height:35px;
383
+ position:relative;
384
+ -moz-border-radius:20px;
385
+ -webkit-border-radius:20px;
386
+ border-radius:20px;
387
+ -moz-transition:background 0.4s ease;
388
+ -o-transition:background 0.4s ease;
389
+ -webkit-transition:background 0.4s ease;
390
+ transition:background 0.4s ease
391
+ }
392
+ .cb-switcher, .cb-switcher * {
393
+ cursor:pointer
394
+ }
395
+ .cb-switcher ::-moz-selection {
396
+ background-color:transparent
397
+ }
398
+ .cb-switcher ::selection {
399
+ background-color:transparent
400
+ }
401
+ .cb-switcher .cb-state {
402
+ z-index:1;
403
+ text-align:center;
404
+ font-size:12px
405
+ }
406
+ .cb-switcher .cb-state, .cb-switcher:before {
407
+ width:34px;
408
+ height:34px;
409
+ line-height:34px;
410
+ position:absolute;
411
+ left:0;
412
+ top:-1px;
413
+ -moz-border-radius:100%;
414
+ -webkit-border-radius:100%;
415
+ border-radius:100%;
416
+ -moz-transition:all 0.4s ease;
417
+ -o-transition:all 0.4s ease;
418
+ -webkit-transition:all 0.4s ease;
419
+ transition:all 0.4s ease
420
+ }
421
+ .cb-switcher:before {
422
+ content:"";
423
+ background-color:#eee;
424
+ -moz-box-shadow:1px 1px 1px rgba(0, 0, 0, 0.1);
425
+ -webkit-box-shadow:1px 1px 1px rgba(0, 0, 0, 0.1);
426
+ box-shadow:1px 1px 1px rgba(0, 0, 0, 0.1)
427
+ }
428
+ .cb-switcher.checked {
429
+ background-color:#00a0d2
430
+ }
431
+ .cb-switcher.checked .cb-state, .cb-switcher.checked:before {
432
+ left:60px;
433
+ color:#00a0d2
434
+ }
435
+ .cb-switcher.checked:before {
436
+ background-color:#fff;
437
+ -moz-box-shadow:-1px 1px 1px rgba(0, 0, 0, 0.1);
438
+ -webkit-box-shadow:-1px 1px 1px rgba(0, 0, 0, 0.1);
439
+ box-shadow:-1px 1px 1px rgba(0, 0, 0, 0.1)
440
+ }
441
+ .cb-switcher.checked .inner-switcher:before {
442
+ border-top-color:#0073aa
443
+ }
444
+ .cb-switcher.checked .inner-switcher:after {
445
+ border-bottom-color:#0073aa
446
+ }
447
+ .cb-switcher .inner-switcher:before, .cb-switcher .inner-switcher:after {
448
+ content:"";
449
+ position:absolute;
450
+ left:50%;
451
+ width:0;
452
+ height:0;
453
+ z-index:2;
454
+ margin-left:-20px;
455
+ border-left:20px solid transparent;
456
+ border-right:20px solid transparent;
457
+ -moz-transition:border 0.4s ease;
458
+ -o-transition:border 0.4s ease;
459
+ -webkit-transition:border 0.4s ease;
460
+ transition:border 0.4s ease
461
+ }
462
+ .cb-switcher .inner-switcher:before {
463
+ border-top:17px solid #fff;
464
+ top:0
465
+ }
466
+ .cb-switcher .inner-switcher:after {
467
+ border-bottom:17px solid #fff;
468
+ bottom:0
469
+ }
470
+ .cb-state {
471
+ color:#ccc;
472
+ display:inline-block
473
+ }
474
+ .cb-switcher-group .cb-state {
475
+ position:relative;
476
+ top:7px
477
+ }
478
+ .is-hidden {
479
+ display:none !important;
480
+ visibility:hidden !important
481
+ }
482
+ output {
483
+ display: block;
484
+ font-size: 30px;
485
+ font-weight: bold;
486
+ text-align: center;
487
+ margin: 30px 0;
488
+ width: 100%;
489
  }
includes/columns.php CHANGED
@@ -8,13 +8,20 @@ class Post_Views_Counter_Columns {
8
 
9
  public function __construct() {
10
  // actions
11
- add_action( 'current_screen', array( &$this, 'register_new_column' ) );
12
  add_action( 'post_submitbox_misc_actions', array( &$this, 'submitbox_views' ) );
13
  add_action( 'save_post', array( &$this, 'save_post' ), 10, 2 );
 
 
 
14
  }
15
 
16
  /**
17
  * Output post views for single post.
 
 
 
 
18
  */
19
  public function submitbox_views() {
20
  global $post;
@@ -31,7 +38,7 @@ class Post_Views_Counter_Columns {
31
  global $wpdb;
32
 
33
  // get total post views
34
- $views = $wpdb->get_var(
35
  $wpdb->prepare( "
36
  SELECT count
37
  FROM " . $wpdb->prefix . "post_views
@@ -46,7 +53,7 @@ class Post_Views_Counter_Columns {
46
 
47
  <span id="post-views-display">
48
 
49
- <?php echo __( 'Post Views', 'post-views-counter' ) . ': <b>' . number_format_i18n( (int) $views ) . '</b>'; ?>
50
 
51
  </span>
52
 
@@ -60,8 +67,8 @@ class Post_Views_Counter_Columns {
60
  <div id="post-views-input-container" class="hide-if-js">
61
 
62
  <p><?php _e( 'Adjust the views count for this post.', 'post-views-counter' ); ?></p>
63
- <input type="hidden" name="current_post_views" id="post-views-current" value="<?php echo (int) $views; ?>" />
64
- <input type="text" name="post_views" id="post-views-input" value="<?php echo (int) $views; ?>"/><br />
65
  <p>
66
  <a href="#post-views" class="save-post-views hide-if-no-js button"><?php _e( 'OK', 'post-views-counter' ); ?></a>
67
  <a href="#post-views" class="cancel-post-views hide-if-no-js"><?php _e( 'Cancel', 'post-views-counter' ); ?></a>
@@ -77,7 +84,10 @@ class Post_Views_Counter_Columns {
77
  }
78
 
79
  /**
80
- * Save post views data
 
 
 
81
  */
82
  public function save_post( $post_id, $post ) {
83
 
@@ -129,27 +139,26 @@ class Post_Views_Counter_Columns {
129
  * Register post views column for specific post types
130
  */
131
  public function register_new_column() {
132
- $screen = get_current_screen();
133
-
134
- if ( Post_Views_Counter()->get_attribute( 'options', 'general', 'post_views_column' ) && ($screen->base == 'edit' && in_array( $screen->post_type, Post_Views_Counter()->get_attribute( 'options', 'general', 'post_types_count' ) )) ) {
135
-
136
- foreach ( Post_Views_Counter()->get_attribute( 'options', 'general', 'post_types_count' ) as $post_type ) {
137
 
138
- if ( $post_type === 'page' && $screen->post_type === 'page' ) {
139
  // actions
140
  add_action( 'manage_pages_custom_column', array( &$this, 'add_new_column_content' ), 10, 2 );
141
 
142
  // filters
143
  add_filter( 'manage_pages_columns', array( &$this, 'add_new_column' ) );
144
  add_filter( 'manage_edit-page_sortable_columns', array( &$this, 'register_sortable_custom_column' ) );
145
- } elseif ( $post_type === 'post' && $screen->post_type === 'post' ) {
146
  // actions
147
  add_action( 'manage_posts_custom_column', array( &$this, 'add_new_column_content' ), 10, 2 );
148
 
149
  // filters
150
  add_filter( 'manage_posts_columns', array( &$this, 'add_new_column' ) );
151
  add_filter( 'manage_edit-post_sortable_columns', array( &$this, 'register_sortable_custom_column' ) );
152
- } elseif ( $screen->post_type === $post_type ) {
153
  // actions
154
  add_action( 'manage_' . $post_type . '_posts_custom_column', array( &$this, 'add_new_column_content' ), 10, 2 );
155
 
@@ -162,7 +171,10 @@ class Post_Views_Counter_Columns {
162
  }
163
 
164
  /**
165
- * Register sortable post views column
 
 
 
166
  */
167
  public function register_sortable_custom_column( $columns ) {
168
  // add new sortable column
@@ -172,7 +184,10 @@ class Post_Views_Counter_Columns {
172
  }
173
 
174
  /**
175
- * Add post views column
 
 
 
176
  */
177
  public function add_new_column( $columns ) {
178
  $offset = 0;
@@ -190,19 +205,24 @@ class Post_Views_Counter_Columns {
190
  unset( $columns[$column] );
191
  }
192
 
193
- $columns['post_views'] = __( 'Post Views', 'post-views-counter' );
194
 
195
  foreach ( $date as $column => $name ) {
196
  $columns[$column] = $name;
197
  }
198
  } else
199
- $columns['post_views'] = __( 'Post Views', 'post-views-counter' );
200
 
201
  return $columns;
202
  }
203
 
204
  /**
205
- * Add post views column content
 
 
 
 
 
206
  */
207
  public function add_new_column_content( $column_name, $id ) {
208
 
@@ -211,7 +231,7 @@ class Post_Views_Counter_Columns {
211
  global $wpdb;
212
 
213
  // get total post views
214
- $views = $wpdb->get_var(
215
  $wpdb->prepare( "
216
  SELECT count
217
  FROM " . $wpdb->prefix . "post_views
@@ -219,8 +239,96 @@ class Post_Views_Counter_Columns {
219
  )
220
  );
221
 
222
- echo number_format_i18n( (int) $views );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  }
 
224
  }
225
 
226
- }
8
 
9
  public function __construct() {
10
  // actions
11
+ add_action( 'admin_init', array( &$this, 'register_new_column' ) );
12
  add_action( 'post_submitbox_misc_actions', array( &$this, 'submitbox_views' ) );
13
  add_action( 'save_post', array( &$this, 'save_post' ), 10, 2 );
14
+ add_action( 'bulk_edit_custom_box', array( &$this, 'quick_edit_custom_box' ), 10, 2 );
15
+ add_action( 'quick_edit_custom_box', array( &$this, 'quick_edit_custom_box') , 10, 2 );
16
+ add_action( 'wp_ajax_save_bulk_post_views', array( &$this, 'save_bulk_post_views' ) );
17
  }
18
 
19
  /**
20
  * Output post views for single post.
21
+ *
22
+ * @global object $post
23
+ * @global object $wpbd;
24
+ * @return mixed
25
  */
26
  public function submitbox_views() {
27
  global $post;
38
  global $wpdb;
39
 
40
  // get total post views
41
+ $count = $wpdb->get_var(
42
  $wpdb->prepare( "
43
  SELECT count
44
  FROM " . $wpdb->prefix . "post_views
53
 
54
  <span id="post-views-display">
55
 
56
+ <?php echo __( 'Post Views', 'post-views-counter' ) . ': <b>' . number_format_i18n( (int) $count ) . '</b>'; ?>
57
 
58
  </span>
59
 
67
  <div id="post-views-input-container" class="hide-if-js">
68
 
69
  <p><?php _e( 'Adjust the views count for this post.', 'post-views-counter' ); ?></p>
70
+ <input type="hidden" name="current_post_views" id="post-views-current" value="<?php echo (int) $count; ?>" />
71
+ <input type="text" name="post_views" id="post-views-input" value="<?php echo (int) $count; ?>"/><br />
72
  <p>
73
  <a href="#post-views" class="save-post-views hide-if-no-js button"><?php _e( 'OK', 'post-views-counter' ); ?></a>
74
  <a href="#post-views" class="cancel-post-views hide-if-no-js"><?php _e( 'Cancel', 'post-views-counter' ); ?></a>
84
  }
85
 
86
  /**
87
+ * Save post views data.
88
+ *
89
+ * @param int $post_id
90
+ * @param object $post
91
  */
92
  public function save_post( $post_id, $post ) {
93
 
139
  * Register post views column for specific post types
140
  */
141
  public function register_new_column() {
142
+ $post_types = Post_Views_Counter()->get_attribute( 'options', 'general', 'post_types_count' );
143
+
144
+ if ( ! empty( $post_types ) ) {
145
+ foreach ( $post_types as $post_type ) {
 
146
 
147
+ if ( $post_type === 'page' ) {
148
  // actions
149
  add_action( 'manage_pages_custom_column', array( &$this, 'add_new_column_content' ), 10, 2 );
150
 
151
  // filters
152
  add_filter( 'manage_pages_columns', array( &$this, 'add_new_column' ) );
153
  add_filter( 'manage_edit-page_sortable_columns', array( &$this, 'register_sortable_custom_column' ) );
154
+ } elseif ( $post_type === 'post' ) {
155
  // actions
156
  add_action( 'manage_posts_custom_column', array( &$this, 'add_new_column_content' ), 10, 2 );
157
 
158
  // filters
159
  add_filter( 'manage_posts_columns', array( &$this, 'add_new_column' ) );
160
  add_filter( 'manage_edit-post_sortable_columns', array( &$this, 'register_sortable_custom_column' ) );
161
+ } else{
162
  // actions
163
  add_action( 'manage_' . $post_type . '_posts_custom_column', array( &$this, 'add_new_column_content' ), 10, 2 );
164
 
171
  }
172
 
173
  /**
174
+ * Register sortable post views column.
175
+ *
176
+ * @param array $columns
177
+ * @return array
178
  */
179
  public function register_sortable_custom_column( $columns ) {
180
  // add new sortable column
184
  }
185
 
186
  /**
187
+ * Add post views column.
188
+ *
189
+ * @param array $columns
190
+ * @return array
191
  */
192
  public function add_new_column( $columns ) {
193
  $offset = 0;
205
  unset( $columns[$column] );
206
  }
207
 
208
+ $columns['post_views'] = '<span class="dash-icon dashicons dashicons-chart-bar" title="' . __( 'Post Views', 'post-views-counter' ) . '"></span><span class="dash-title">' . __( 'Post Views', 'post-views-counter' ) . '</span>';
209
 
210
  foreach ( $date as $column => $name ) {
211
  $columns[$column] = $name;
212
  }
213
  } else
214
+ $columns['post_views'] = '<span class="dash-icon dashicons dashicons-chart-bar" title="' . __( 'Post Views', 'post-views-counter' ) . '"></span><span class="dash-title">' . __( 'Post Views', 'post-views-counter' ) . '</span>';
215
 
216
  return $columns;
217
  }
218
 
219
  /**
220
+ * Add post views column content.
221
+ *
222
+ * @global object $wpdb
223
+ * @param string $column_name
224
+ * @param int $id
225
+ * @return muxed
226
  */
227
  public function add_new_column_content( $column_name, $id ) {
228
 
231
  global $wpdb;
232
 
233
  // get total post views
234
+ $count = $wpdb->get_var(
235
  $wpdb->prepare( "
236
  SELECT count
237
  FROM " . $wpdb->prefix . "post_views
239
  )
240
  );
241
 
242
+ echo (int) $count;
243
+ }
244
+ }
245
+
246
+ /**
247
+ * Handle quick edit.
248
+ *
249
+ * @global string $pagenow
250
+ * @global object $wpdb
251
+ * @param string $column_name
252
+ * @return mixed
253
+ */
254
+ function quick_edit_custom_box( $column_name, $post_type ) {
255
+ global $pagenow, $post;
256
+
257
+ if ( $pagenow !== 'edit.php' )
258
+ return;
259
+
260
+ if ( ! Post_Views_Counter()->get_attribute( 'options', 'general', 'post_views_column' ) || ! in_array( $post_type, Post_Views_Counter()->get_attribute( 'options', 'general', 'post_types_count' ) ) )
261
+ return;
262
+
263
+ // break if views editing is restricted
264
+ $restrict = (bool) Post_Views_Counter()->get_attribute( 'options', 'general', 'restrict_edit_views' );
265
+
266
+ if ( $restrict === true && ! current_user_can( apply_filters( 'pvc_restrict_edit_capability', 'manage_options' ) ) )
267
+ return;
268
+
269
+ if ( $column_name != 'post_views' )
270
+ return;
271
+
272
+ global $wpdb;
273
+
274
+ // get total post views
275
+ $count = $wpdb->get_var(
276
+ $wpdb->prepare( "
277
+ SELECT count
278
+ FROM " . $wpdb->prefix . "post_views
279
+ WHERE id = %d AND type = 4", $post->ID
280
+ )
281
+ );
282
+ ?>
283
+ <fieldset class="inline-edit-col-left">
284
+ <div id="inline-edit-post_views" class="inline-edit-col">
285
+ <label class="inline-edit-group">
286
+ <span class="title"><?php _e( 'Post Views', 'post-views-counter' ); ?></span>
287
+ <span class="input-text-wrap"><input type="text" name="post_views" class="title text" value="<?php echo absint( $count ); ?>"></span>
288
+ <?php wp_nonce_field( 'post_views_count', 'pvc_nonce' ); ?>
289
+ </label>
290
+ </div>
291
+ </fieldset>
292
+ <?php
293
+ }
294
+
295
+ /**
296
+ * Bulk save post views.
297
+ *
298
+ * @global object $wpdb;
299
+ * @return type
300
+ */
301
+ function save_bulk_post_views() {
302
+
303
+ $post_ids = ( ! empty( $_POST[ 'post_ids' ] ) && is_array( $post_ids ) ) ? array_map( 'absint', $_POST[ 'post_ids' ] ) : array();
304
+ $count = ( ! empty( $_POST[ 'post_views' ] ) ) ? absint( $_POST[ 'post_views' ] ) : null;
305
+
306
+ // break if views editing is restricted
307
+ $restrict = (bool) Post_Views_Counter()->get_attribute( 'options', 'general', 'restrict_edit_views' );
308
+
309
+ if ( $restrict === true && ! current_user_can( apply_filters( 'pvc_restrict_edit_capability', 'manage_options' ) ) )
310
+ die();
311
+
312
+ if ( ! empty( $post_ids ) ) {
313
+ foreach ( $post_ids as $post_id ) {
314
+
315
+ // break if current user can't edit this post
316
+ if ( ! current_user_can( 'edit_post', $post_id ) )
317
+ continue;
318
+
319
+ global $wpdb;
320
+
321
+ // insert or update db post views count
322
+ $wpdb->query(
323
+ $wpdb->prepare( "
324
+ INSERT INTO " . $wpdb->prefix . "post_views (id, type, period, count)
325
+ VALUES (%d, %d, %s, %d)
326
+ ON DUPLICATE KEY UPDATE count = %d", $post_id, 4, 'total', $count, $count
327
+ )
328
+ );
329
+ }
330
  }
331
+ die();
332
  }
333
 
334
+ }
includes/settings.php CHANGED
@@ -226,8 +226,7 @@ class Post_Views_Counter_Settings {
226
  <div id="pvc_post_views_label">
227
  <fieldset>
228
  <input type="text" class="large-text" name="post_views_counter_settings_display[label]" value="' . esc_attr( Post_Views_Counter()->get_attribute( 'options', 'display', 'label' ) ) . '" />
229
- <br/>
230
- <span class="description">' . esc_html__( 'Enter the label for the post views counter field.', 'post-views-counter' ) . '</span>
231
  </fieldset>
232
  </div>';
233
  }
@@ -237,20 +236,15 @@ class Post_Views_Counter_Settings {
237
  */
238
  public function post_types_count() {
239
  echo '
240
- <div id="pvc_post_types_count">
241
- <fieldset>
242
- <select class="pvc-chosen" data-placeholder="' . esc_attr__( 'Select post types', 'post-views-counter' ) . '" name="post_views_counter_settings_general[post_types_count][]" multiple="multiple">';
243
 
244
  foreach ( $this->post_types as $post_type => $post_type_name ) {
245
  echo '
246
- <option value="' . esc_attr( $post_type ) . '" ' . selected( in_array( $post_type, Post_Views_Counter()->get_attribute( 'options', 'general', 'post_types_count' ), true ), true, false ) . '>' . esc_html( $post_type_name ) . '</option>';
247
  }
248
 
249
  echo '
250
- </select>
251
- <br/>
252
- <span class="description">' . esc_html__( 'Select post types for which post views will be counted.', 'post-views-counter' ) . '</span>
253
- </fieldset>
254
  </div>';
255
  }
256
 
@@ -259,20 +253,15 @@ class Post_Views_Counter_Settings {
259
  */
260
  public function post_types_display() {
261
  echo '
262
- <div id="pvc_post_types_display">
263
- <fieldset>
264
- <select class="pvc-chosen" data-placeholder="' . esc_attr__( 'Select groups', 'post-views-counter' ) . '" name="post_views_counter_settings_display[post_types_display][]" multiple="multiple">';
265
-
266
  foreach ( $this->post_types as $post_type => $post_type_name ) {
267
  echo '
268
- <option value="' . esc_attr( $post_type ) . '" ' . selected( in_array( $post_type, Post_Views_Counter()->get_attribute( 'options', 'display', 'post_types_display' ), true ), true, false ) . '>' . esc_html( $post_type_name ) . '</option>';
269
  }
270
 
271
  echo '
272
- </select>
273
- <br/>
274
- <span class="description">' . esc_html__( 'Select post types for which post views will be displayed.', 'post-views-counter' ) . '</span>
275
- </fieldset>
276
  </div>';
277
  }
278
 
@@ -281,20 +270,17 @@ class Post_Views_Counter_Settings {
281
  */
282
  public function counter_mode() {
283
  echo '
284
- <div id="pvc_counter_mode">
285
- <fieldset>';
286
 
287
  foreach ( $this->modes as $key => $value ) {
288
  $key = esc_attr( $key );
289
 
290
  echo '
291
- <input id="pvc-counter-mode-' . $key . '" type="radio" name="post_views_counter_settings_general[counter_mode]" value="' . $key . '" ' . checked( $key, Post_Views_Counter()->get_attribute( 'options', 'general', 'counter_mode' ), false ) . ' /><label for="pvc-counter-mode-' . $key . '">' . esc_html( $value ) . '</label>';
292
  }
293
 
294
  echo '
295
- <br/>
296
- <span class="description">' . esc_html__( 'Select the method of collecting post views data. If you are using any of the caching plugins select Javascript.', 'post-views-counter' ) . '</span>
297
- </fieldset>
298
  </div>';
299
  }
300
 
@@ -304,7 +290,7 @@ class Post_Views_Counter_Settings {
304
  public function post_views_column() {
305
  echo '
306
  <div id="pvc_post_views_column">
307
- <input id="pvc-post-views-column-enable" type="checkbox" name="post_views_counter_settings_general[post_views_column]" value="1" ' . checked( true, (bool) Post_Views_Counter()->get_attribute( 'options', 'general', 'post_views_column' ), false ) . ' /><label for="pvc-post-views-column-enable">' . esc_html__( 'Enable to display post views count column for each of the selected post types.', 'post-views-counter' ) . '</label>
308
  </div>';
309
  }
310
 
@@ -314,9 +300,8 @@ class Post_Views_Counter_Settings {
314
  public function time_between_counts() {
315
  echo '
316
  <div id="pvc_time_between_counts">
317
- <fieldset>
318
- <input size="4" type="text" name="post_views_counter_settings_general[time_between_counts][number]" value="' . esc_attr( Post_Views_Counter()->get_attribute( 'options', 'general', 'time_between_counts', 'number' ) ) . '" />
319
- <select class="pvc-chosen-short" name="post_views_counter_settings_general[time_between_counts][type]">';
320
 
321
  foreach ( $this->time_types as $type => $type_name ) {
322
  echo '
@@ -324,10 +309,8 @@ class Post_Views_Counter_Settings {
324
  }
325
 
326
  echo '
327
- </select>
328
- <br/>
329
- <span class="description">' . esc_html__( 'Enter the time between single user visit count.', 'post-views-counter' ) . '</span>
330
- </fieldset>
331
  </div>';
332
  }
333
 
@@ -337,20 +320,17 @@ class Post_Views_Counter_Settings {
337
  public function reset_counts() {
338
  echo '
339
  <div id="pvc_reset_counts">
340
- <fieldset>
341
- <input size="4" type="text" name="post_views_counter_settings_general[reset_counts][number]" value="' . esc_attr( Post_Views_Counter()->get_attribute( 'options', 'general', 'reset_counts', 'number' ) ) . '" />
342
- <select class="pvc-chosen-short" name="post_views_counter_settings_general[reset_counts][type]">';
343
 
344
  foreach ( $this->time_types as $type => $type_name ) {
345
  echo '
346
- <option value="' . esc_attr( $type ) . '" ' . selected( $type, Post_Views_Counter()->get_attribute( 'options', 'general', 'reset_counts', 'type' ), false ) . '>' . esc_html( $type_name ) . '</option>';
347
  }
348
 
349
  echo '
350
- </select>
351
- <br/>
352
- <span class="description">' . esc_html__( 'Delete single day post views data older than specified above. Enter 0 (number zero) if you want to preserve your data regardless of its age.', 'post-views-counter' ) . '</span>
353
- </fieldset>
354
  </div>';
355
  }
356
 
@@ -360,20 +340,17 @@ class Post_Views_Counter_Settings {
360
  public function flush_interval() {
361
  echo '
362
  <div id="pvc_flush_interval">
363
- <fieldset>
364
- <input size="4" type="text" name="post_views_counter_settings_general[flush_interval][number]" value="' . esc_attr( Post_Views_Counter()->get_attribute( 'options', 'general', 'flush_interval', 'number' ) ) . '" />
365
- <select class="pvc-chosen-short" name="post_views_counter_settings_general[flush_interval][type]">';
366
 
367
  foreach ( $this->time_types as $type => $type_name ) {
368
  echo '
369
- <option value="' . esc_attr( $type ) . '" ' . selected( $type, Post_Views_Counter()->get_attribute( 'options', 'general', 'flush_interval', 'type' ), false ) . '>' . esc_html( $type_name ) . '</option>';
370
  }
371
 
372
  echo '
373
- </select>
374
- <br/>
375
- <span class="description">' . __( 'How often to flush cached view counts from the object cache into the database. This feature is used only if a persistent object cache is detected and the interval is greater than 0 (number zero)). When used, view counts will be collected and stored in the object cache instead of the database and will then be asynchronously flushed to the database according to the specified interval.<br /><strong>Notice:</strong> Potential data loss may occur if the object cache is cleared/unavailable for the duration of the interval.', 'post-views-counter' ) . '</span>
376
- </fieldset>
377
  </div>';
378
  }
379
 
@@ -383,30 +360,22 @@ class Post_Views_Counter_Settings {
383
  public function exclude() {
384
  echo '
385
  <div id="pvc_exclude">
386
- <fieldset>
387
- <select class="pvc-chosen" data-placeholder="' . esc_attr__( 'Select groups', 'post-views-counter' ) . '" name="post_views_counter_settings_general[exclude][groups][]" multiple="multiple">';
388
 
389
  foreach ( $this->groups as $type => $type_name ) {
390
  echo '
391
- <option value="' . esc_attr( $type ) . '" ' . selected( in_array( $type, Post_Views_Counter()->get_attribute( 'options', 'general', 'exclude', 'groups' ), true ), true, false ) . '>' . esc_html( $type_name ) . '</option>';
392
  }
393
 
394
- echo '
395
- </select>
396
- <br/>
397
- <div class="pvc_user_roles"' . (in_array( 'roles', Post_Views_Counter()->get_attribute( 'options', 'general', 'exclude', 'groups' ), true ) ? '' : ' style="display: none;"') . '>
398
- <select class="pvc-chosen" data-placeholder="' . esc_attr__( 'Select user roles', 'post-views-counter' ) . '" name="post_views_counter_settings_general[exclude][roles][]" multiple="multiple">';
399
 
400
  foreach ( $this->user_roles as $role => $role_name ) {
401
- echo '
402
- <option value="' . esc_attr( $role ) . '" ' . selected( in_array( $role, Post_Views_Counter()->get_attribute( 'options', 'general', 'exclude', 'roles' ), true ), true, false ) . '>' . esc_html( $role_name ) . '</option>';
403
  }
404
 
405
- echo '
406
- </select>
407
- <br/>
408
  </div>
409
- <span class="description">' . esc_html__( 'Select the type of visitors to be excluded from post views count.', 'post-views-counter' ) . '</span>
410
  </fieldset>
411
  </div>';
412
  }
@@ -415,26 +384,29 @@ class Post_Views_Counter_Settings {
415
  * Exclude IPs option.
416
  */
417
  public function exclude_ips() {
 
 
 
418
  echo '
419
- <div id="pvc_exclude_ips">
420
- <fieldset>';
421
 
422
- foreach ( Post_Views_Counter()->get_attribute( 'options', 'general', 'exclude_ips' ) as $key => $ip ) {
423
- echo '
 
424
  <div class="ip-box">
425
- <input type="text" name="post_views_counter_settings_general[exclude_ips][]" value="' . esc_attr( $ip ) . '" /> <input type="button" class="button button-secondary remove-exclude-ip" value="' . esc_attr__( 'Remove', 'post-views-counter' ) . '" />
426
  </div>';
 
 
 
 
 
 
427
  }
428
 
429
- // lovely php 5.2 limitations
430
- $ips = Post_Views_Counter()->get_attribute( 'options', 'general', 'exclude_ips' );
431
-
432
  echo '
433
- <div class="ip-box">
434
- <input type="text" name="post_views_counter_settings_general[exclude_ips][]" value="" /> <input type="button" class="button button-secondary remove-exclude-ip" value="' . esc_attr__( 'Remove', 'post-views-counter' ) . '"' . (empty( $ips ) ? ' style="display: none;"' : '') . ' /> <input type="button" class="button button-secondary add-exclude-ip" value="' . esc_attr__( 'Add new', 'post-views-counter' ) . '" /> <input type="button" class="button button-secondary add-current-ip" value="' . esc_attr__( 'Add my current IP', 'post-views-counter' ) . '" data-rel="' . esc_attr( $_SERVER['REMOTE_ADDR'] ) . '" />
435
- </div>
436
- <span class="description">' . esc_html__( 'Enter the IP addresses to be excluded from post views count.', 'post-views-counter' ) . '</span>
437
- </fieldset>
438
  </div>';
439
  }
440
 
@@ -446,9 +418,8 @@ class Post_Views_Counter_Settings {
446
  <div id="pvc_wp_postviews">
447
  <fieldset>
448
  <input type="submit" class="button button-secondary" name="post_views_counter_import_wp_postviews" value="' . __( 'Import', 'post-views-counter' ) . '"/>
449
- <br/>
450
  <p class="description">' . esc_html__( 'Import post views data from WP-PostViews plugin.', 'post-views-counter' ) . '</p>
451
- <input id="pvc-wp-postviews" type="checkbox" name="post_views_counter_import_wp_postviews_override" value="1" /><label for="pvc-wp-postviews">' . esc_html__( 'Override existing Post Views Counter data.', 'post-views-counter' ) . '</label>
452
  </fieldset>
453
  </div>';
454
  }
@@ -459,7 +430,7 @@ class Post_Views_Counter_Settings {
459
  public function restrict_edit_views() {
460
  echo '
461
  <div id="pvc_restrict_edit_views">
462
- <input id="pvc-restrict-edit-views-enable" type="checkbox" name="post_views_counter_settings_general[restrict_edit_views]" value="1" ' . checked( true, (bool) Post_Views_Counter()->get_attribute( 'options', 'general', 'restrict_edit_views' ), false ) . ' /><label for="pvc-restrict-edit-views-enable">' . esc_html__( 'Enable to restrict post views editing to admins only.', 'post-views-counter' ) . '</label>
463
  </div>';
464
  }
465
 
@@ -469,7 +440,7 @@ class Post_Views_Counter_Settings {
469
  public function deactivation_delete() {
470
  echo '
471
  <div id="pvc_deactivation_delete">
472
- <input id="pvc-deactivation-delete-enable" type="checkbox" name="post_views_counter_settings_general[deactivation_delete]" value="1" ' . checked( true, (bool) Post_Views_Counter()->get_attribute( 'options', 'general', 'deactivation_delete' ), false ) . ' /><label for="pvc-deactivation-delete-enable">' . esc_html__( 'Enable to delete all plugin data on deactivation.', 'post-views-counter' ) . '</label>
473
  </div>';
474
  }
475
 
@@ -479,19 +450,16 @@ class Post_Views_Counter_Settings {
479
  public function position() {
480
  echo '
481
  <div id="pvc_position">
482
- <fieldset>
483
- <select class="pvc-chosen-short" name="post_views_counter_settings_display[position]">';
484
 
485
  foreach ( $this->positions as $position => $position_name ) {
486
  echo '
487
- <option value="' . esc_attr( $position ) . '" ' . selected( $position, Post_Views_Counter()->get_attribute( 'options', 'display', 'position' ), false ) . '>' . esc_html( $position_name ) . '</option>';
488
  }
489
 
490
  echo '
491
- </select>
492
- <br/>
493
- <span class="description">' . esc_html__( 'Select where would you like to display the post views counter. Use [post-views] shortcode for manual display.', 'post-views-counter' ) . '</span>
494
- </fieldset>
495
  </div>';
496
  }
497
 
@@ -500,20 +468,17 @@ class Post_Views_Counter_Settings {
500
  */
501
  public function display_style() {
502
  echo '
503
- <div id="pvc_display_style">
504
- <fieldset>';
505
 
506
  foreach ( $this->display_styles as $display => $style ) {
507
  $display = esc_attr( $display );
508
 
509
  echo '
510
- <input id="pvc-display-style-' . $display . '" type="checkbox" name="post_views_counter_settings_display[display_style][' . $display . ']" value="' . $display . '" ' . checked( true, Post_Views_Counter()->get_attribute( 'options', 'display', 'display_style', $display ), false ) . ' /><label for="pvc-display-style-' . $display . '">' . esc_html( $style ) . '</label>';
511
  }
512
 
513
  echo '
514
- <br/>
515
- <span class="description">' . esc_html__( 'Choose how to display the post views counter.', 'post-views-counter' ) . '</span>
516
- </fieldset>
517
  </div>';
518
  }
519
 
@@ -523,11 +488,8 @@ class Post_Views_Counter_Settings {
523
  public function icon_class() {
524
  echo '
525
  <div id="pvc_icon_class">
526
- <fieldset>
527
- <input type="text" name="post_views_counter_settings_display[icon_class]" class="large-text" value="' . esc_attr( Post_Views_Counter()->get_attribute( 'options', 'display', 'icon_class' ) ) . '"/>
528
- <br/>
529
- <span class="description">' . sprintf( __( 'Enter the post views icon class. Any of the <a href="%s" target="_blank">Dashicons</a> classes are available.', 'post-views-counter' ), 'http://melchoyce.github.io/dashicons/' ) . '</span>
530
- </fieldset>
531
  </div>';
532
  }
533
 
@@ -537,8 +499,7 @@ class Post_Views_Counter_Settings {
537
  public function restrict_display() {
538
  echo '
539
  <div id="pvc_restrict_display">
540
- <fieldset>
541
- <select class="pvc-chosen" data-placeholder="' . esc_attr__( 'Select groups', 'post-views-counter' ) . '" name="post_views_counter_settings_display[restrict_display][groups][]" multiple="multiple">';
542
 
543
  foreach ( $this->groups as $type => $type_name ) {
544
 
@@ -546,25 +507,18 @@ class Post_Views_Counter_Settings {
546
  continue;
547
 
548
  echo '
549
- <option value="' . esc_attr( $type ) . '" ' . selected( in_array( $type, Post_Views_Counter()->get_attribute( 'options', 'display', 'restrict_display', 'groups' ), true ), true, false ) . '>' . esc_html( $type_name ) . '</option>';
550
  }
551
 
552
- echo '
553
- </select>
554
- <br/>
555
- <div class="pvc_user_roles"' . (in_array( 'roles', Post_Views_Counter()->get_attribute( 'options', 'display', 'restrict_display', 'groups' ), true ) ? '' : ' style="display: none;"') . '>
556
- <select class="pvc-chosen" data-placeholder="' . esc_attr__( 'Select user roles', 'post-views-counter' ) . '" name="post_views_counter_settings_display[restrict_display][roles][]" multiple="multiple">';
557
 
558
  foreach ( $this->user_roles as $role => $role_name ) {
559
- echo '
560
- <option value="' . esc_attr( $role ) . '" ' . selected( in_array( $role, Post_Views_Counter()->get_attribute( 'options', 'display', 'restrict_display', 'roles' ), true ), true, false ) . '>' . esc_html( $role_name ) . '</option>';
561
  }
562
 
563
- echo '
564
- </select>
565
- <br/>
566
  </div>
567
- <span class="description">' . esc_html__( 'Use it to hide the post views counter from selected type of visitors.', 'post-views-counter' ) . '</span>
568
  </fieldset>
569
  </div>';
570
  }
@@ -601,7 +555,7 @@ class Post_Views_Counter_Settings {
601
  if ( isset( $input['post_types_count'] ) ) {
602
  $post_types = array();
603
 
604
- foreach ( $input['post_types_count'] as $post_type ) {
605
  if ( isset( $this->post_types[$post_type] ) )
606
  $post_types[] = $post_type;
607
  }
@@ -614,7 +568,7 @@ class Post_Views_Counter_Settings {
614
  $input['counter_mode'] = (isset( $input['counter_mode'], $this->modes[$input['counter_mode']] ) ? $input['counter_mode'] : Post_Views_Counter()->get_attribute( 'defaults', 'general', 'counter_mode' ));
615
 
616
  // post views column
617
- $input['post_views_column'] = (isset( $input['post_views_column'] ) ? (bool) $input['post_views_column'] : Post_Views_Counter()->get_attribute( 'defaults', 'general', 'post_views_column' ));
618
 
619
  // time between counts
620
  $input['time_between_counts']['number'] = (int) (isset( $input['time_between_counts']['number'] ) ? $input['time_between_counts']['number'] : Post_Views_Counter()->get_attribute( 'defaults', 'general', 'time_between_counts', 'number' ));
@@ -647,7 +601,7 @@ class Post_Views_Counter_Settings {
647
  if ( isset( $input['exclude']['groups'] ) ) {
648
  $groups = array();
649
 
650
- foreach ( $input['exclude']['groups'] as $group ) {
651
  if ( isset( $this->groups[$group] ) )
652
  $groups[] = $group;
653
  }
@@ -659,7 +613,7 @@ class Post_Views_Counter_Settings {
659
  if ( in_array( 'roles', $input['exclude']['groups'], true ) && isset( $input['exclude']['roles'] ) ) {
660
  $roles = array();
661
 
662
- foreach ( $input['exclude']['roles'] as $role ) {
663
  if ( isset( $this->user_roles[$role] ) )
664
  $roles[] = $role;
665
  }
@@ -685,7 +639,7 @@ class Post_Views_Counter_Settings {
685
  $input['restrict_edit_views'] = (isset( $input['restrict_edit_views'] ) ? (bool) $input['restrict_edit_views'] : Post_Views_Counter()->get_attribute( 'defaults', 'general', 'restrict_edit_views' ));
686
 
687
  // deactivation delete
688
- $input['deactivation_delete'] = (isset( $input['deactivation_delete'] ) ? (bool) $input['deactivation_delete'] : Post_Views_Counter()->get_attribute( 'defaults', 'general', 'deactivation_delete' ));
689
  } elseif ( isset( $_POST['save_pvc_display'] ) ) {
690
 
691
  // post views label
@@ -698,11 +652,11 @@ class Post_Views_Counter_Settings {
698
  $input['position'] = (isset( $input['position'], $this->positions[$input['position']] ) ? $input['position'] : Post_Views_Counter()->get_attribute( 'defaults', 'general', 'position' ));
699
 
700
  // display style
701
- $input['display_style']['icon'] = (isset( $input['display_style']['icon'] ) ? true : false);
702
- $input['display_style']['text'] = (isset( $input['display_style']['text'] ) ? true : false);
703
 
704
  // link to post
705
- $input['link_to_post'] = (isset( $input['link_to_post'] ) ? (bool) $input['link_to_post'] : Post_Views_Counter()->get_attribute( 'defaults', 'general', 'link_to_post' ));
706
 
707
  // icon class
708
  $input['icon_class'] = (isset( $input['icon_class'] ) ? trim( $input['icon_class'] ) : Post_Views_Counter()->get_attribute( 'defaults', 'general', 'icon_class' ));
@@ -711,7 +665,7 @@ class Post_Views_Counter_Settings {
711
  if ( isset( $input['post_types_display'] ) ) {
712
  $post_types = array();
713
 
714
- foreach ( $input['post_types_display'] as $post_type ) {
715
  if ( isset( $this->post_types[$post_type] ) )
716
  $post_types[] = $post_type;
717
  }
@@ -724,7 +678,7 @@ class Post_Views_Counter_Settings {
724
  if ( isset( $input['restrict_display']['groups'] ) ) {
725
  $groups = array();
726
 
727
- foreach ( $input['restrict_display']['groups'] as $group ) {
728
  if ( $group === 'robots' )
729
  continue;
730
 
@@ -739,7 +693,7 @@ class Post_Views_Counter_Settings {
739
  if ( in_array( 'roles', $input['restrict_display']['groups'], true ) && isset( $input['restrict_display']['roles'] ) ) {
740
  $roles = array();
741
 
742
- foreach ( $input['restrict_display']['roles'] as $role ) {
743
  if ( isset( $this->user_roles[$role] ) )
744
  $roles[] = $role;
745
  }
226
  <div id="pvc_post_views_label">
227
  <fieldset>
228
  <input type="text" class="large-text" name="post_views_counter_settings_display[label]" value="' . esc_attr( Post_Views_Counter()->get_attribute( 'options', 'display', 'label' ) ) . '" />
229
+ <p class="description">' . esc_html__( 'Enter the label for the post views counter field.', 'post-views-counter' ) . '</p>
 
230
  </fieldset>
231
  </div>';
232
  }
236
  */
237
  public function post_types_count() {
238
  echo '
239
+ <div id="pvc_post_types_count">';
 
 
240
 
241
  foreach ( $this->post_types as $post_type => $post_type_name ) {
242
  echo '
243
+ <label class="cb-checkbox"><input id="pvc_post_types_count-' . esc_attr( $post_type ) . '" type="checkbox" name="post_views_counter_settings_general[post_types_count][' . esc_attr( $post_type ) . ']" value="1" ' . checked( in_array( $post_type, Post_Views_Counter()->get_attribute( 'options', 'general', 'post_types_count' ), true ), true, false ) . ' />' . esc_html( $post_type_name ) . ' </label>';
244
  }
245
 
246
  echo '
247
+ <p class="description">' . esc_html__( 'Select post types for which post views will be counted.', 'post-views-counter' ) . '</p>
 
 
 
248
  </div>';
249
  }
250
 
253
  */
254
  public function post_types_display() {
255
  echo '
256
+ <div id="pvc_post_types_display">';
257
+
 
 
258
  foreach ( $this->post_types as $post_type => $post_type_name ) {
259
  echo '
260
+ <label class="cb-checkbox"><input id="pvc_post_types_display-' . esc_attr( $post_type ) . '" type="checkbox" name="post_views_counter_settings_display[post_types_display][' . esc_attr( $post_type ) . ']" value="1" ' . checked( in_array( $post_type, Post_Views_Counter()->get_attribute( 'options', 'display', 'post_types_display' ), true ), true, false ) . ' />' . esc_html( $post_type_name ) . '</label>';
261
  }
262
 
263
  echo '
264
+ <p class="description">' . esc_html__( 'Select post types for which post views will be displayed.', 'post-views-counter' ) . '</p>
 
 
 
265
  </div>';
266
  }
267
 
270
  */
271
  public function counter_mode() {
272
  echo '
273
+ <div id="pvc_counter_mode">';
 
274
 
275
  foreach ( $this->modes as $key => $value ) {
276
  $key = esc_attr( $key );
277
 
278
  echo '
279
+ <label class="cb-radio"><input type="radio" name="post_views_counter_settings_general[counter_mode]" value="' . $key . '" ' . checked( $key, Post_Views_Counter()->get_attribute( 'options', 'general', 'counter_mode' ), false ) . ' />' . esc_html( $value ) . '</label>';
280
  }
281
 
282
  echo '
283
+ <p class="description">' . esc_html__( 'Select the method of collecting post views data. If you are using any of the caching plugins select Javascript.', 'post-views-counter' ) . '</p>
 
 
284
  </div>';
285
  }
286
 
290
  public function post_views_column() {
291
  echo '
292
  <div id="pvc_post_views_column">
293
+ <label class="cb-checkbox"><input id="pvc-post-views-column-enable" type="checkbox" name="post_views_counter_settings_general[post_views_column]" value="1" ' . checked( true, (bool) Post_Views_Counter()->get_attribute( 'options', 'general', 'post_views_column' ), false ) . ' />' . esc_html__( 'Enable to display post views count column for each of the selected post types.', 'post-views-counter' ) . '</label>
294
  </div>';
295
  }
296
 
300
  public function time_between_counts() {
301
  echo '
302
  <div id="pvc_time_between_counts">
303
+ <input size="4" type="text" name="post_views_counter_settings_general[time_between_counts][number]" value="' . esc_attr( Post_Views_Counter()->get_attribute( 'options', 'general', 'time_between_counts', 'number' ) ) . '" />
304
+ <select class="pvc-chosen-short" name="post_views_counter_settings_general[time_between_counts][type]">';
 
305
 
306
  foreach ( $this->time_types as $type => $type_name ) {
307
  echo '
309
  }
310
 
311
  echo '
312
+ </select>
313
+ <p class="description">' . esc_html__( 'Enter the time between single user visit count.', 'post-views-counter' ) . '</p>
 
 
314
  </div>';
315
  }
316
 
320
  public function reset_counts() {
321
  echo '
322
  <div id="pvc_reset_counts">
323
+ <input size="4" type="text" name="post_views_counter_settings_general[reset_counts][number]" value="' . esc_attr( Post_Views_Counter()->get_attribute( 'options', 'general', 'reset_counts', 'number' ) ) . '" />
324
+ <select class="pvc-chosen-short" name="post_views_counter_settings_general[reset_counts][type]">';
 
325
 
326
  foreach ( $this->time_types as $type => $type_name ) {
327
  echo '
328
+ <option value="' . esc_attr( $type ) . '" ' . selected( $type, Post_Views_Counter()->get_attribute( 'options', 'general', 'reset_counts', 'type' ), false ) . '>' . esc_html( $type_name ) . '</option>';
329
  }
330
 
331
  echo '
332
+ </select>
333
+ <p class="description">' . esc_html__( 'Delete single day post views data older than specified above. Enter 0 (number zero) if you want to preserve your data regardless of its age.', 'post-views-counter' ) . '</p>
 
 
334
  </div>';
335
  }
336
 
340
  public function flush_interval() {
341
  echo '
342
  <div id="pvc_flush_interval">
343
+ <input size="4" type="text" name="post_views_counter_settings_general[flush_interval][number]" value="' . esc_attr( Post_Views_Counter()->get_attribute( 'options', 'general', 'flush_interval', 'number' ) ) . '" />
344
+ <select class="pvc-chosen-short" name="post_views_counter_settings_general[flush_interval][type]">';
 
345
 
346
  foreach ( $this->time_types as $type => $type_name ) {
347
  echo '
348
+ <option value="' . esc_attr( $type ) . '" ' . selected( $type, Post_Views_Counter()->get_attribute( 'options', 'general', 'flush_interval', 'type' ), false ) . '>' . esc_html( $type_name ) . '</option>';
349
  }
350
 
351
  echo '
352
+ </select>
353
+ <p class="description">' . __( 'How often to flush cached view counts from the object cache into the database. This feature is used only if a persistent object cache is detected and the interval is greater than 0 (number zero)). When used, view counts will be collected and stored in the object cache instead of the database and will then be asynchronously flushed to the database according to the specified interval.<br /><strong>Notice:</strong> Potential data loss may occur if the object cache is cleared/unavailable for the duration of the interval.', 'post-views-counter' ) . '</p>
 
 
354
  </div>';
355
  }
356
 
360
  public function exclude() {
361
  echo '
362
  <div id="pvc_exclude">
363
+ <fieldset>';
 
364
 
365
  foreach ( $this->groups as $type => $type_name ) {
366
  echo '
367
+ <label class="cb-checkbox"><input id="pvc_exclude-' . $type . '" type="checkbox" name="post_views_counter_settings_general[exclude][groups][' . $type . ']" value="1" ' . checked( in_array( $type, Post_Views_Counter()->get_attribute( 'options', 'general', 'exclude', 'groups' ), true ), true, false ) . ' />' . esc_html( $type_name ) . '</label>';
368
  }
369
 
370
+ echo ' <p class="description">' . esc_html__( 'Use it to hide the post views counter from selected type of visitors.', 'post-views-counter' ) . '</p>
371
+ <div class="pvc_user_roles"' . (in_array( 'roles', Post_Views_Counter()->get_attribute( 'options', 'general', 'exclude', 'groups' ), true ) ? '' : ' style="display: none;"') . '>';
 
 
 
372
 
373
  foreach ( $this->user_roles as $role => $role_name ) {
374
+ echo ' <label class="cb-checkbox"><input type="checkbox" name="post_views_counter_settings_general[exclude][roles][' . $role . ']" value="1" ' . checked( in_array( $role, Post_Views_Counter()->get_attribute( 'options', 'general', 'exclude', 'roles' ), true ), true, false ) . '>' . esc_html( $role_name ) . '</label>';
 
375
  }
376
 
377
+ echo ' <p class="description">' . esc_html__( 'Use it to hide the post views counter from selected user roles.', 'post-views-counter' ) . '</p>
 
 
378
  </div>
 
379
  </fieldset>
380
  </div>';
381
  }
384
  * Exclude IPs option.
385
  */
386
  public function exclude_ips() {
387
+ // lovely php 5.2 limitations
388
+ $ips = Post_Views_Counter()->get_attribute( 'options', 'general', 'exclude_ips' );
389
+
390
  echo '
391
+ <div id="pvc_exclude_ips">';
 
392
 
393
+ if ( ! empty( $ips ) ) {
394
+ foreach ( $ips as $key => $ip ) {
395
+ echo '
396
  <div class="ip-box">
397
+ <input type="text" name="post_views_counter_settings_general[exclude_ips][]" value="' . esc_attr( $ip ) . '" /> <a href="#" class="remove-exclude-ip" title="' . esc_attr__( 'Remove', 'post-views-counter' ) . '">' . esc_attr__( 'Remove', 'post-views-counter' ) . '</a>
398
  </div>';
399
+ }
400
+ } else {
401
+ echo '
402
+ <div class="ip-box">
403
+ <input type="text" name="post_views_counter_settings_general[exclude_ips][]" value="" /> <a href="#" class="remove-exclude-ip" title="' . esc_attr__( 'Remove', 'post-views-counter' ) . '">' . esc_attr__( 'Remove', 'post-views-counter' ) . '</a>
404
+ </div>';
405
  }
406
 
 
 
 
407
  echo '
408
+ <p><input type="button" class="button button-secondary add-exclude-ip" value="' . esc_attr__( 'Add new', 'post-views-counter' ) . '" /> <input type="button" class="button button-secondary add-current-ip" value="' . esc_attr__( 'Add my current IP', 'post-views-counter' ) . '" data-rel="' . esc_attr( $_SERVER['REMOTE_ADDR'] ) . '" /></p>
409
+ <p class="description">' . esc_html__( 'Enter the IP addresses to be excluded from post views count.', 'post-views-counter' ) . '</p>
 
 
 
410
  </div>';
411
  }
412
 
418
  <div id="pvc_wp_postviews">
419
  <fieldset>
420
  <input type="submit" class="button button-secondary" name="post_views_counter_import_wp_postviews" value="' . __( 'Import', 'post-views-counter' ) . '"/>
 
421
  <p class="description">' . esc_html__( 'Import post views data from WP-PostViews plugin.', 'post-views-counter' ) . '</p>
422
+ <label class="cb-checkbox"><input id="pvc-wp-postviews" type="checkbox" name="post_views_counter_import_wp_postviews_override" value="1" />' . esc_html__( 'Override existing Post Views Counter data.', 'post-views-counter' ) . '</label>
423
  </fieldset>
424
  </div>';
425
  }
430
  public function restrict_edit_views() {
431
  echo '
432
  <div id="pvc_restrict_edit_views">
433
+ <label class="cb-checkbox"><input type="checkbox" name="post_views_counter_settings_general[restrict_edit_views]" value="1" ' . checked( true, (bool) Post_Views_Counter()->get_attribute( 'options', 'general', 'restrict_edit_views' ), false ) . ' />' . esc_html__( 'Enable to restrict post views editing to admins only.', 'post-views-counter' ) . '</label>
434
  </div>';
435
  }
436
 
440
  public function deactivation_delete() {
441
  echo '
442
  <div id="pvc_deactivation_delete">
443
+ <label class="cb-checkbox"><input type="checkbox" name="post_views_counter_settings_general[deactivation_delete]" value="1" ' . checked( true, (bool) Post_Views_Counter()->get_attribute( 'options', 'general', 'deactivation_delete' ), false ) . ' />' . esc_html__( 'Enable to delete all plugin data on deactivation.', 'post-views-counter' ) . '</label>
444
  </div>';
445
  }
446
 
450
  public function position() {
451
  echo '
452
  <div id="pvc_position">
453
+ <select class="pvc-chosen-short" name="post_views_counter_settings_display[position]">';
 
454
 
455
  foreach ( $this->positions as $position => $position_name ) {
456
  echo '
457
+ <option value="' . esc_attr( $position ) . '" ' . selected( $position, Post_Views_Counter()->get_attribute( 'options', 'display', 'position' ), false ) . '>' . esc_html( $position_name ) . '</option>';
458
  }
459
 
460
  echo '
461
+ </select>
462
+ <p class="description">' . esc_html__( 'Select where would you like to display the post views counter. Use [post-views] shortcode for manual display.', 'post-views-counter' ) . '</p>
 
 
463
  </div>';
464
  }
465
 
468
  */
469
  public function display_style() {
470
  echo '
471
+ <div id="pvc_display_style">';
 
472
 
473
  foreach ( $this->display_styles as $display => $style ) {
474
  $display = esc_attr( $display );
475
 
476
  echo '
477
+ <label class="cb-checkbox"><input type="checkbox" name="post_views_counter_settings_display[display_style][' . $display . ']" value="1" ' . checked( true, Post_Views_Counter()->get_attribute( 'options', 'display', 'display_style', $display ), false ) . ' />' . esc_html( $style ) . '</label>';
478
  }
479
 
480
  echo '
481
+ <p class="description">' . esc_html__( 'Choose how to display the post views counter.', 'post-views-counter' ) . '</p>
 
 
482
  </div>';
483
  }
484
 
488
  public function icon_class() {
489
  echo '
490
  <div id="pvc_icon_class">
491
+ <input type="text" name="post_views_counter_settings_display[icon_class]" class="large-text" value="' . esc_attr( Post_Views_Counter()->get_attribute( 'options', 'display', 'icon_class' ) ) . '" />
492
+ <p class="description">' . sprintf( __( 'Enter the post views icon class. Any of the <a href="%s" target="_blank">Dashicons</a> classes are available.', 'post-views-counter' ), 'http://melchoyce.github.io/dashicons/' ) . '</p>
 
 
 
493
  </div>';
494
  }
495
 
499
  public function restrict_display() {
500
  echo '
501
  <div id="pvc_restrict_display">
502
+ <fieldset>';
 
503
 
504
  foreach ( $this->groups as $type => $type_name ) {
505
 
507
  continue;
508
 
509
  echo '
510
+ <label class="cb-checkbox"><input id="pvc_restrict_display-' . $type . '" type="checkbox" name="post_views_counter_settings_display[restrict_display][groups][' . esc_html( $type ) . ']" value="1" ' . checked( in_array( $type, Post_Views_Counter()->get_attribute( 'options', 'display', 'restrict_display', 'groups' ), true ), true, false ) . ' />' . esc_html( $type_name ) . '</label>';
511
  }
512
 
513
+ echo ' <p class="description">' . esc_html__( 'Use it to hide the post views counter from selected type of visitors.', 'post-views-counter' ) . '</p>
514
+ <div class="pvc_user_roles"' . (in_array( 'roles', Post_Views_Counter()->get_attribute( 'options', 'display', 'restrict_display', 'groups' ), true ) ? '' : ' style="display: none;"') . '>';
 
 
 
515
 
516
  foreach ( $this->user_roles as $role => $role_name ) {
517
+ echo ' <label class="cb-checkbox"><input type="checkbox" name="post_views_counter_settings_display[restrict_display][roles][' . $role . ']" value="1" ' . checked( in_array( $role, Post_Views_Counter()->get_attribute( 'options', 'display', 'restrict_display', 'roles' ), true ), true, false ) . ' />' . esc_html( $role_name ) . '</label>';
 
518
  }
519
 
520
+ echo ' <p class="description">' . esc_html__( 'Use it to hide the post views counter from selected user roles.', 'post-views-counter' ) . '</p>
 
 
521
  </div>
 
522
  </fieldset>
523
  </div>';
524
  }
555
  if ( isset( $input['post_types_count'] ) ) {
556
  $post_types = array();
557
 
558
+ foreach ( $input['post_types_count'] as $post_type => $set ) {
559
  if ( isset( $this->post_types[$post_type] ) )
560
  $post_types[] = $post_type;
561
  }
568
  $input['counter_mode'] = (isset( $input['counter_mode'], $this->modes[$input['counter_mode']] ) ? $input['counter_mode'] : Post_Views_Counter()->get_attribute( 'defaults', 'general', 'counter_mode' ));
569
 
570
  // post views column
571
+ $input['post_views_column'] = (bool) $input['post_views_column'];
572
 
573
  // time between counts
574
  $input['time_between_counts']['number'] = (int) (isset( $input['time_between_counts']['number'] ) ? $input['time_between_counts']['number'] : Post_Views_Counter()->get_attribute( 'defaults', 'general', 'time_between_counts', 'number' ));
601
  if ( isset( $input['exclude']['groups'] ) ) {
602
  $groups = array();
603
 
604
+ foreach ( $input['exclude']['groups'] as $group => $set ) {
605
  if ( isset( $this->groups[$group] ) )
606
  $groups[] = $group;
607
  }
613
  if ( in_array( 'roles', $input['exclude']['groups'], true ) && isset( $input['exclude']['roles'] ) ) {
614
  $roles = array();
615
 
616
+ foreach ( $input['exclude']['roles'] as $role => $set ) {
617
  if ( isset( $this->user_roles[$role] ) )
618
  $roles[] = $role;
619
  }
639
  $input['restrict_edit_views'] = (isset( $input['restrict_edit_views'] ) ? (bool) $input['restrict_edit_views'] : Post_Views_Counter()->get_attribute( 'defaults', 'general', 'restrict_edit_views' ));
640
 
641
  // deactivation delete
642
+ $input['deactivation_delete'] = (bool) isset( $input['deactivation_delete'] );
643
  } elseif ( isset( $_POST['save_pvc_display'] ) ) {
644
 
645
  // post views label
652
  $input['position'] = (isset( $input['position'], $this->positions[$input['position']] ) ? $input['position'] : Post_Views_Counter()->get_attribute( 'defaults', 'general', 'position' ));
653
 
654
  // display style
655
+ $input['display_style']['icon'] = (bool) isset( $input['display_style']['icon'] );
656
+ $input['display_style']['text'] = (bool) isset( $input['display_style']['text'] );
657
 
658
  // link to post
659
+ $input['link_to_post'] = (isset( $input['link_to_post'] ) ? (bool) $input['link_to_post'] : Post_Views_Counter()->get_attribute( 'defaults', 'display', 'link_to_post' ));
660
 
661
  // icon class
662
  $input['icon_class'] = (isset( $input['icon_class'] ) ? trim( $input['icon_class'] ) : Post_Views_Counter()->get_attribute( 'defaults', 'general', 'icon_class' ));
665
  if ( isset( $input['post_types_display'] ) ) {
666
  $post_types = array();
667
 
668
+ foreach ( $input['post_types_display'] as $post_type => $set ) {
669
  if ( isset( $this->post_types[$post_type] ) )
670
  $post_types[] = $post_type;
671
  }
678
  if ( isset( $input['restrict_display']['groups'] ) ) {
679
  $groups = array();
680
 
681
+ foreach ( $input['restrict_display']['groups'] as $group => $set ) {
682
  if ( $group === 'robots' )
683
  continue;
684
 
693
  if ( in_array( 'roles', $input['restrict_display']['groups'], true ) && isset( $input['restrict_display']['roles'] ) ) {
694
  $roles = array();
695
 
696
+ foreach ( $input['restrict_display']['roles'] as $role => $set ) {
697
  if ( isset( $this->user_roles[$role] ) )
698
  $roles[] = $role;
699
  }
js/admin-quick-edit.js ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function ( $ ) {
2
+ // we create a copy of the WP inline edit post function
3
+ var $wp_inline_edit = inlineEditPost.edit;
4
+ // and then we overwrite the function with our own code
5
+ inlineEditPost.edit = function ( id ) {
6
+ // call the original WP edit function
7
+ // we don't want to leave WordPress hanging
8
+ $wp_inline_edit.apply( this, arguments );
9
+
10
+ // get the post ID
11
+ var $post_id = 0;
12
+
13
+ if ( typeof ( id ) == 'object' )
14
+ $post_id = parseInt( this.getId( id ) );
15
+
16
+ if ( $post_id > 0 ) {
17
+ // define the edit row
18
+ var $edit_row = $( '#edit-' + $post_id );
19
+ var $post_row = $( '#post-' + $post_id );
20
+
21
+ // get the data
22
+ var $post_views = $( '.column-post_views', $post_row ).text();
23
+
24
+ // populate the data
25
+ $( ':input[name="post_views"]', $edit_row ).val( $post_views );
26
+ }
27
+
28
+ return false;
29
+ };
30
+
31
+ $( document ).on( 'click', '#bulk_edit', function () {
32
+ // define the bulk edit row
33
+ var $bulk_row = $( '#bulk-edit' );
34
+
35
+ // get the selected post ids that are being edited
36
+ var $post_ids = new Array();
37
+ $bulk_row.find( '#bulk-titles' ).children().each( function () {
38
+ $post_ids.push( $( this ).attr( 'id' ).replace( /^(ttle)/i, '' ) );
39
+ } );
40
+
41
+ // get the data
42
+ var $post_views = $bulk_row.find( 'input[name="post_views"]' ).val();
43
+
44
+ // save the data
45
+ $.ajax( {
46
+ url: ajaxurl, // this is a variable that WordPress has already defined for us
47
+ type: 'post',
48
+ async: false,
49
+ cache: false,
50
+ data: {
51
+ action: 'save_bulk_post_views', // this is the name of our WP AJAX function that we'll set up next
52
+ post_ids: $post_ids, // and these are the 2 parameters we're passing to our function
53
+ post_views: $post_views,
54
+ }
55
+ } );
56
+ } );
57
+ } )( jQuery );
js/admin-settings.js CHANGED
@@ -1,20 +1,12 @@
1
  ( function ( $ ) {
2
 
3
  $( document ).ready( function () {
4
-
5
- // default chosen
6
- $( '.pvc-chosen' ).chosen( {
7
- disable_search_threshold: 8,
8
- display_selected_options: false,
9
- search_contains: true,
10
- width: '300px'
11
- } );
12
-
13
- // time types and position
14
- $( '.pvc-chosen-short' ).chosen( {
15
- disable_search_threshold: 8,
16
- width: '200px'
17
- } );
18
 
19
  // ask whether to reset options to defaults
20
  $( document ).on( 'click', '.reset_pvc_settings', function () {
@@ -22,72 +14,61 @@
22
  } );
23
 
24
  // remove ip box
25
- $( document ).on( 'click', '.remove-exclude-ip', function () {
26
- var parent = $( this ).parent(),
27
- nextParent = parent.parent(),
28
- addButton = parent.find( '.add-exclude-ip' ).hide(),
29
- addCurrentIPButton = parent.find( '.add-current-ip' ).hide();
30
-
 
31
  // remove ip box
32
- parent.remove();
33
-
34
- var children = nextParent.find( 'div' );
35
-
36
- // was there add button?
37
- if ( addButton.length === 1 ) {
38
- children.last().append( addButton.show(), ' ', addCurrentIPButton.show() );
39
- // children.last().append();
40
- }
41
-
42
- // only one ip box left?
43
- if ( children.length === 1 ) {
44
- children.find( '.remove-exclude-ip' ).hide();
45
- }
46
  } );
47
 
48
  // add ip box
49
  $( document ).on( 'click', '.add-exclude-ip', function () {
50
- var parent = $( this ).parent(),
51
- newBox = parent.clone().hide();
52
-
 
 
53
  // clear value
54
- newBox.find( 'input' ).first().val( '' );
55
-
56
- // remove add buttons
57
- $( this ).remove();
58
- parent.find( '.add-current-ip' ).remove();
59
 
60
  // add and display new ip box
61
- parent.after( newBox.show() );
62
-
63
- parent.parent().find( '.remove-exclude-ip' ).show();
64
  } );
65
 
66
  // add current ip
67
  $( document ).on( 'click', '.add-current-ip', function () {
68
- // fills input with user's current ip
69
- $( this ).parent().find( 'input' ).first().val( $( this ).attr( 'data-rel' ) );
70
  } );
71
-
72
- // display user roles if needed
73
- $( document ).on( 'change', '.pvc-chosen-groups', function () {
74
- var foundRoles = false;
75
-
76
- // check whether roles are selected
77
- $( this ).find( ':selected' ).each( function ( i, item ) {
78
- if ( item.value === 'roles' ) {
79
- foundRoles = true;
80
- }
81
- } );
82
-
83
- // are roles selected?
84
- if ( foundRoles ) {
85
- $( this ).parent().find( '.pvc_user_roles' ).fadeIn( 300 );
86
  } else {
87
- $( this ).parent().find( '.pvc_user_roles' ).fadeOut( 300 );
88
  }
89
  } );
90
 
91
  } );
92
 
93
- } )( jQuery );
 
 
 
 
 
 
 
 
 
1
  ( function ( $ ) {
2
 
3
  $( document ).ready( function () {
4
+
5
+ $( '.post-views-counter-settings' ).checkBo();
6
+
7
+ var ip_boxes = $( '#pvc_exclude_ips' ).find( '.ip-box' ).length;
8
+
9
+ $( '#pvc_exclude_ips .ip-box:first' ).find( '.remove-exclude-ip' ).hide();
 
 
 
 
 
 
 
 
10
 
11
  // ask whether to reset options to defaults
12
  $( document ).on( 'click', '.reset_pvc_settings', function () {
14
  } );
15
 
16
  // remove ip box
17
+ $( document ).on( 'click', '.remove-exclude-ip', function ( e ) {
18
+ e.preventDefault();
19
+
20
+ ip_boxes--;
21
+
22
+ var parent = $( this ).parent();
23
+
24
  // remove ip box
25
+ parent.slideUp( 'fast', function() {
26
+ $( this ).remove();
27
+ } );
 
 
 
 
 
 
 
 
 
 
 
28
  } );
29
 
30
  // add ip box
31
  $( document ).on( 'click', '.add-exclude-ip', function () {
32
+ ip_boxes++;
33
+
34
+ var parent = $( this ).parents( '#pvc_exclude_ips' ),
35
+ new_ip_box = parent.find( '.ip-box:last' ).clone().hide();
36
+
37
  // clear value
38
+ new_ip_box.find( 'input' ).val( '' );
39
+
40
+ if ( ip_boxes > 1 ) {
41
+ new_ip_box.find( '.remove-exclude-ip' ).show();
42
+ }
43
 
44
  // add and display new ip box
45
+ parent.find( '.ip-box:last' ).after( new_ip_box ).next().slideDown( 'fast' );
 
 
46
  } );
47
 
48
  // add current ip
49
  $( document ).on( 'click', '.add-current-ip', function () {
50
+ // fill input with user's current ip
51
+ $( this ).parents( '#pvc_exclude_ips' ).find( '.ip-box' ).last().find( 'input' ).val( $( this ).attr( 'data-rel' ) );
52
  } );
53
+
54
+ // toggle user roles
55
+ $( '#pvc_exclude-roles, #pvc_restrict_display-roles' ).change( function () {
56
+ if ( $( this ).is(':checked') ) {
57
+ $( '.pvc_user_roles' ).slideDown( 'fast' );
 
 
 
 
 
 
 
 
 
 
58
  } else {
59
+ $( '.pvc_user_roles' ).slideUp( 'fast' );
60
  }
61
  } );
62
 
63
  } );
64
 
65
+ } )( jQuery );
66
+
67
+ /*
68
+ * checkBo lightweight jQuery plugin v0.1.4 by @ElmahdiMahmoud
69
+ * Licensed under the MIT license - https://github.com/elmahdim/checkbo/blob/master/LICENSE
70
+ *
71
+ * Custom checkbox and radio
72
+ * Author URL: elmahdim.com
73
+ */
74
+ !function(e){e.fn.checkBo=function(c){return c=e.extend({},{checkAllButton:null,checkAllTarget:null,checkAllTextDefault:null,checkAllTextToggle:null},c),this.each(function(){function t(e){this.input=e}function n(){var c=e(this).is(":checked");e(this).closest("label").toggleClass("checked",c)}function i(e,c,t){e.text(e.parent(a).hasClass("checked")?t:c)}function h(c){var t=c.attr("data-show");c=c.attr("data-hide"),e(t).removeClass("is-hidden"),e(c).addClass("is-hidden")}var l=e(this),a=l.find(".cb-checkbox"),d=l.find(".cb-radio"),o=l.find(".cb-switcher"),s=a.find("input:checkbox"),f=d.find("input:radio");s.wrap('<span class="cb-inner"><i></i></span>'),f.wrap('<span class="cb-inner"><i></i></span>');var k=new t("input:checkbox"),r=new t("input:radio");if(t.prototype.checkbox=function(e){var c=e.find(this.input).is(":checked");e.find(this.input).prop("checked",!c).trigger("change")},t.prototype.radiobtn=function(c,t){var n=e('input:radio[name="'+t+'"]');n.prop("checked",!1),n.closest(n.closest(d)).removeClass("checked"),c.addClass("checked"),c.find(this.input).get(0).checked=c.hasClass("checked"),c.find(this.input).change()},s.on("change",n),f.on("change",n),a.find("a").on("click",function(e){e.stopPropagation()}),a.on("click",function(c){c.preventDefault(),k.checkbox(e(this)),c=e(this).attr("data-toggle"),e(c).toggleClass("is-hidden"),h(e(this))}),d.on("click",function(c){c.preventDefault(),r.radiobtn(e(this),e(this).find("input:radio").attr("name")),h(e(this))}),e.fn.toggleCheckbox=function(){this.prop("checked",!this.is(":checked"))},e.fn.switcherChecker=function(){var c=e(this),t=c.find("input"),n=c.find(".cb-state");t.is(":checked")?(c.addClass("checked"),n.html(t.attr("data-state-on"))):(c.removeClass("checked"),n.html(t.attr("data-state-off")))},o.on("click",function(c){c.preventDefault(),c=e(this),c.find("input").toggleCheckbox(),c.switcherChecker(),e(c.attr("data-toggle")).toggleClass("is-hidden")}),o.each(function(){e(this).switcherChecker()}),c.checkAllButton&&c.checkAllTarget){var u=e(this);u.find(e(c.checkAllButton)).on("click",function(){u.find(c.checkAllTarget).find("input:checkbox").each(function(){u.find(e(c.checkAllButton)).hasClass("checked")?u.find(c.checkAllTarget).find("input:checkbox").prop("checked",!0).change():u.find(c.checkAllTarget).find("input:checkbox").prop("checked",!1).change()}),i(u.find(e(c.checkAllButton)).find(".toggle-text"),c.checkAllTextDefault,c.checkAllTextToggle)}),u.find(c.checkAllTarget).find(a).on("click",function(){u.find(c.checkAllButton).find("input:checkbox").prop("checked",!1).change().removeClass("checked"),i(u.find(e(c.checkAllButton)).find(".toggle-text"),c.checkAllTextDefault,c.checkAllTextToggle)})}l.find('[checked="checked"]').closest("label").addClass("checked"),l.find("input").is("input:disabled")&&l.find("input:disabled").closest("label").off().addClass("disabled")})}}(jQuery,window,document);
languages/post-views-counter-pl_PL.mo CHANGED
Binary file
languages/post-views-counter-pl_PL.po CHANGED
@@ -1,15 +1,15 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Post Views Counter\n"
4
- "POT-Creation-Date: 2015-05-27 14:35+0100\n"
5
- "PO-Revision-Date: 2015-05-27 14:36+0100\n"
6
  "Last-Translator: Bartosz Arendt <info@dfactory.eu>\n"
7
  "Language-Team: dFactory <info@dfactory.eu>\n"
8
  "Language: pl_PL\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.8\n"
13
  "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e;esc_attr__;esc_attr_e;"
14
  "esc_html__;esc_html_e\n"
15
  "X-Poedit-Basepath: .\n"
@@ -17,24 +17,24 @@ msgstr ""
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
  "X-Poedit-SearchPath-0: ..\n"
19
 
20
- #: ../includes/columns.php:49 ../includes/columns.php:193
21
- #: ../includes/columns.php:199
22
  msgid "Post Views"
23
  msgstr "Odwiedziny"
24
 
25
- #: ../includes/columns.php:58
26
  msgid "Edit"
27
  msgstr "Edytuj"
28
 
29
- #: ../includes/columns.php:62
30
  msgid "Adjust the views count for this post."
31
  msgstr "Zmodyfikuj liczbę odsłon tego wpisu."
32
 
33
- #: ../includes/columns.php:66
34
  msgid "OK"
35
  msgstr "OK"
36
 
37
- #: ../includes/columns.php:67
38
  msgid "Cancel"
39
  msgstr "Anuluj"
40
 
@@ -257,28 +257,19 @@ msgstr "Styl wyświetlania"
257
  msgid "Icon Class"
258
  msgstr "Klasa ikony"
259
 
260
- #: ../includes/settings.php:230
261
  msgid "Enter the label for the post views counter field."
262
  msgstr "Wpisz etykietę jaka będzie wyświetlana w liczniku odwiedzin wpisu."
263
 
264
- #: ../includes/settings.php:242
265
- msgid "Select post types"
266
- msgstr "Wybierz typy wpisów"
267
-
268
- #: ../includes/settings.php:252
269
  msgid "Select post types for which post views will be counted."
270
  msgstr "Wybierz typy wpisów dla których będzie włączone zliczanie."
271
 
272
- #: ../includes/settings.php:264 ../includes/settings.php:387
273
- #: ../includes/settings.php:541
274
- msgid "Select groups"
275
- msgstr "Wybierz grupy"
276
-
277
- #: ../includes/settings.php:274
278
  msgid "Select post types for which post views will be displayed."
279
  msgstr "Wybierz typy wpisów dla których licznik będzie wyświetlony."
280
 
281
- #: ../includes/settings.php:296
282
  msgid ""
283
  "Select the method of collecting post views data. If you are using any of the "
284
  "caching plugins select Javascript."
@@ -286,17 +277,17 @@ msgstr ""
286
  "Wybierz metodę gromadzenia danych. Jeśli używaż jakiejkolwiek wtyczki do "
287
  "cachowania wybierz Javascript."
288
 
289
- #: ../includes/settings.php:307
290
  msgid ""
291
  "Enable to display post views count column for each of the selected post "
292
  "types."
293
  msgstr "Włącz aby wyświetlić kolumnę z liczbą odsłon."
294
 
295
- #: ../includes/settings.php:329
296
  msgid "Enter the time between single user visit count."
297
  msgstr "Określ czas pomiędzy zliczaniem wizyt poszczególnego użytkownika."
298
 
299
- #: ../includes/settings.php:352
300
  msgid ""
301
  "Delete single day post views data older than specified above. Enter 0 "
302
  "(number zero) if you want to preserve your data regardless of its age."
@@ -304,7 +295,7 @@ msgstr ""
304
  "Usuwanie dziennych danych o liczbie wpisów po określonym powyżej czasie. "
305
  "Wpisz 0 jeśli chcesz przetrzymywać te dane bez ograniczeń."
306
 
307
- #: ../includes/settings.php:375
308
  msgid ""
309
  "How often to flush cached view counts from the object cache into the "
310
  "database. This feature is used only if a persistent object cache is detected "
@@ -323,52 +314,56 @@ msgstr ""
323
  "jeśli cachowanie obiektowe nie będzie dostępne lub cache zostanie "
324
  "wyczyszczony w trakcie trwania wybranego okresu."
325
 
326
- #: ../includes/settings.php:398 ../includes/settings.php:556
327
- msgid "Select user roles"
328
- msgstr "Wybierz role użytkowników"
 
 
329
 
330
- #: ../includes/settings.php:409
331
- msgid "Select the type of visitors to be excluded from post views count."
332
- msgstr "Wybierz typy użytkowników wyłączonych z działania licznika."
 
 
333
 
334
- #: ../includes/settings.php:425 ../includes/settings.php:434
335
  msgid "Remove"
336
  msgstr "Usuń"
337
 
338
- #: ../includes/settings.php:434
339
  msgid "Add new"
340
  msgstr "Dodaj nowy"
341
 
342
- #: ../includes/settings.php:434
343
  msgid "Add my current IP"
344
  msgstr "Dodaj mój aktualny IP"
345
 
346
- #: ../includes/settings.php:436
347
  msgid "Enter the IP addresses to be excluded from post views count."
348
  msgstr "Wpisz adresy IP, któe mają być wyłączone z działania licznika."
349
 
350
- #: ../includes/settings.php:448
351
  msgid "Import"
352
  msgstr "Importuj"
353
 
354
- #: ../includes/settings.php:450
355
  msgid "Import post views data from WP-PostViews plugin."
356
  msgstr "Importuj dane o liczbie odwiedzin z wtyczki WP-PostViews."
357
 
358
- #: ../includes/settings.php:451
359
  msgid "Override existing Post Views Counter data."
360
  msgstr "Nadpisz istniejące dane Licznika odwiedzin."
361
 
362
- #: ../includes/settings.php:462
363
  msgid "Enable to restrict post views editing to admins only."
364
  msgstr ""
365
  "Włącz aby ograniczyć możliwość edycji liczby wpisów do administratorów."
366
 
367
- #: ../includes/settings.php:472
368
  msgid "Enable to delete all plugin data on deactivation."
369
  msgstr "Włącz aby usunąć wszystkie dane wtyczki podczas deaktywacji"
370
 
371
- #: ../includes/settings.php:493
372
  msgid ""
373
  "Select where would you like to display the post views counter. Use [post-"
374
  "views] shortcode for manual display."
@@ -376,11 +371,11 @@ msgstr ""
376
  "Wybierz w którym miejscu chcesz wyświetlać licznik odwiedzin. Użyj skrótu "
377
  "[post-views] aby wyświetlić licznik ręcznie."
378
 
379
- #: ../includes/settings.php:515
380
  msgid "Choose how to display the post views counter."
381
  msgstr "Wybierz w jaki sposób chcesz wyświetlać licznik."
382
 
383
- #: ../includes/settings.php:529
384
  #, php-format
385
  msgid ""
386
  "Enter the post views icon class. Any of the <a href=\"%s\" target=\"_blank"
@@ -389,25 +384,19 @@ msgstr ""
389
  "Wpisz klasę CSS ikony. Każda z ikond typu <a href=\"%s\" target=\"_blank"
390
  "\">Dashicons</a> może być tutaj zastosowana."
391
 
392
- #: ../includes/settings.php:567
393
- msgid "Use it to hide the post views counter from selected type of visitors."
394
- msgstr ""
395
- "Użyj tego aby ograniczyć wyświetlanie licznika do określonych typów "
396
- "użytkowników."
397
-
398
- #: ../includes/settings.php:595
399
  msgid "WP-PostViews data imported succesfully."
400
  msgstr "Dane z wtyczki WP-PostViews zostały zaimportowane pomyślnie."
401
 
402
- #: ../includes/settings.php:597
403
  msgid "There was no data to import."
404
  msgstr "Niestety, nie znaleziono danych do zaimportowania."
405
 
406
- #: ../includes/settings.php:753
407
  msgid "General settings restored to defaults."
408
  msgstr "Ustawienia zostały przywrócone do domyślnych."
409
 
410
- #: ../includes/settings.php:757
411
  msgid "Display settings restored to defaults."
412
  msgstr "Ustawienia wyświetlania została przywrócone do domyślnych."
413
 
@@ -467,18 +456,30 @@ msgstr "WYświetlanie miniatury?"
467
  msgid "Thumbnail size"
468
  msgstr "WIelkość miniatury"
469
 
470
- #: ../post-views-counter.php:281
471
  msgid "Are you sure you want to reset these settings to defaults?"
472
  msgstr "Czy jesteś pewny, że chcesz zresetować ustawienia do domyślnych?"
473
 
474
- #: ../post-views-counter.php:313
475
  msgid "Support"
476
  msgstr "Forum pomocy"
477
 
478
- #: ../post-views-counter.php:332
479
  msgid "Settings"
480
  msgstr "Ustawienia"
481
 
 
 
 
 
 
 
 
 
 
 
 
 
482
  #~ msgid "Enable"
483
  #~ msgstr "Włącz"
484
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Post Views Counter\n"
4
+ "POT-Creation-Date: 2015-10-18 13:38+0200\n"
5
+ "PO-Revision-Date: 2015-10-18 13:38+0200\n"
6
  "Last-Translator: Bartosz Arendt <info@dfactory.eu>\n"
7
  "Language-Team: dFactory <info@dfactory.eu>\n"
8
  "Language: pl_PL\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.5\n"
13
  "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e;esc_attr__;esc_attr_e;"
14
  "esc_html__;esc_html_e\n"
15
  "X-Poedit-Basepath: .\n"
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
  "X-Poedit-SearchPath-0: ..\n"
19
 
20
+ #: ../includes/columns.php:56 ../includes/columns.php:208
21
+ #: ../includes/columns.php:214 ../includes/columns.php:286
22
  msgid "Post Views"
23
  msgstr "Odwiedziny"
24
 
25
+ #: ../includes/columns.php:65
26
  msgid "Edit"
27
  msgstr "Edytuj"
28
 
29
+ #: ../includes/columns.php:69
30
  msgid "Adjust the views count for this post."
31
  msgstr "Zmodyfikuj liczbę odsłon tego wpisu."
32
 
33
+ #: ../includes/columns.php:73
34
  msgid "OK"
35
  msgstr "OK"
36
 
37
+ #: ../includes/columns.php:74
38
  msgid "Cancel"
39
  msgstr "Anuluj"
40
 
257
  msgid "Icon Class"
258
  msgstr "Klasa ikony"
259
 
260
+ #: ../includes/settings.php:229
261
  msgid "Enter the label for the post views counter field."
262
  msgstr "Wpisz etykietę jaka będzie wyświetlana w liczniku odwiedzin wpisu."
263
 
264
+ #: ../includes/settings.php:247
 
 
 
 
265
  msgid "Select post types for which post views will be counted."
266
  msgstr "Wybierz typy wpisów dla których będzie włączone zliczanie."
267
 
268
+ #: ../includes/settings.php:264
 
 
 
 
 
269
  msgid "Select post types for which post views will be displayed."
270
  msgstr "Wybierz typy wpisów dla których licznik będzie wyświetlony."
271
 
272
+ #: ../includes/settings.php:283
273
  msgid ""
274
  "Select the method of collecting post views data. If you are using any of the "
275
  "caching plugins select Javascript."
277
  "Wybierz metodę gromadzenia danych. Jeśli używaż jakiejkolwiek wtyczki do "
278
  "cachowania wybierz Javascript."
279
 
280
+ #: ../includes/settings.php:293
281
  msgid ""
282
  "Enable to display post views count column for each of the selected post "
283
  "types."
284
  msgstr "Włącz aby wyświetlić kolumnę z liczbą odsłon."
285
 
286
+ #: ../includes/settings.php:313
287
  msgid "Enter the time between single user visit count."
288
  msgstr "Określ czas pomiędzy zliczaniem wizyt poszczególnego użytkownika."
289
 
290
+ #: ../includes/settings.php:333
291
  msgid ""
292
  "Delete single day post views data older than specified above. Enter 0 "
293
  "(number zero) if you want to preserve your data regardless of its age."
295
  "Usuwanie dziennych danych o liczbie wpisów po określonym powyżej czasie. "
296
  "Wpisz 0 jeśli chcesz przetrzymywać te dane bez ograniczeń."
297
 
298
+ #: ../includes/settings.php:353
299
  msgid ""
300
  "How often to flush cached view counts from the object cache into the "
301
  "database. This feature is used only if a persistent object cache is detected "
314
  "jeśli cachowanie obiektowe nie będzie dostępne lub cache zostanie "
315
  "wyczyszczony w trakcie trwania wybranego okresu."
316
 
317
+ #: ../includes/settings.php:370 ../includes/settings.php:508
318
+ msgid "Use it to hide the post views counter from selected type of visitors."
319
+ msgstr ""
320
+ "Użyj tego aby ograniczyć wyświetlanie licznika do określonych typów "
321
+ "użytkowników."
322
 
323
+ #: ../includes/settings.php:377 ../includes/settings.php:515
324
+ msgid "Use it to hide the post views counter from selected user roles."
325
+ msgstr ""
326
+ "Użyj tego aby ograniczyć wyświetlanie licznika do określonych tról "
327
+ "użytkowników."
328
 
329
+ #: ../includes/settings.php:393 ../includes/settings.php:402
330
  msgid "Remove"
331
  msgstr "Usuń"
332
 
333
+ #: ../includes/settings.php:402
334
  msgid "Add new"
335
  msgstr "Dodaj nowy"
336
 
337
+ #: ../includes/settings.php:402
338
  msgid "Add my current IP"
339
  msgstr "Dodaj mój aktualny IP"
340
 
341
+ #: ../includes/settings.php:404
342
  msgid "Enter the IP addresses to be excluded from post views count."
343
  msgstr "Wpisz adresy IP, któe mają być wyłączone z działania licznika."
344
 
345
+ #: ../includes/settings.php:415
346
  msgid "Import"
347
  msgstr "Importuj"
348
 
349
+ #: ../includes/settings.php:416
350
  msgid "Import post views data from WP-PostViews plugin."
351
  msgstr "Importuj dane o liczbie odwiedzin z wtyczki WP-PostViews."
352
 
353
+ #: ../includes/settings.php:417
354
  msgid "Override existing Post Views Counter data."
355
  msgstr "Nadpisz istniejące dane Licznika odwiedzin."
356
 
357
+ #: ../includes/settings.php:428
358
  msgid "Enable to restrict post views editing to admins only."
359
  msgstr ""
360
  "Włącz aby ograniczyć możliwość edycji liczby wpisów do administratorów."
361
 
362
+ #: ../includes/settings.php:438
363
  msgid "Enable to delete all plugin data on deactivation."
364
  msgstr "Włącz aby usunąć wszystkie dane wtyczki podczas deaktywacji"
365
 
366
+ #: ../includes/settings.php:457
367
  msgid ""
368
  "Select where would you like to display the post views counter. Use [post-"
369
  "views] shortcode for manual display."
371
  "Wybierz w którym miejscu chcesz wyświetlać licznik odwiedzin. Użyj skrótu "
372
  "[post-views] aby wyświetlić licznik ręcznie."
373
 
374
+ #: ../includes/settings.php:476
375
  msgid "Choose how to display the post views counter."
376
  msgstr "Wybierz w jaki sposób chcesz wyświetlać licznik."
377
 
378
+ #: ../includes/settings.php:487
379
  #, php-format
380
  msgid ""
381
  "Enter the post views icon class. Any of the <a href=\"%s\" target=\"_blank"
384
  "Wpisz klasę CSS ikony. Każda z ikond typu <a href=\"%s\" target=\"_blank"
385
  "\">Dashicons</a> może być tutaj zastosowana."
386
 
387
+ #: ../includes/settings.php:544
 
 
 
 
 
 
388
  msgid "WP-PostViews data imported succesfully."
389
  msgstr "Dane z wtyczki WP-PostViews zostały zaimportowane pomyślnie."
390
 
391
+ #: ../includes/settings.php:546
392
  msgid "There was no data to import."
393
  msgstr "Niestety, nie znaleziono danych do zaimportowania."
394
 
395
+ #: ../includes/settings.php:702
396
  msgid "General settings restored to defaults."
397
  msgstr "Ustawienia zostały przywrócone do domyślnych."
398
 
399
+ #: ../includes/settings.php:706
400
  msgid "Display settings restored to defaults."
401
  msgstr "Ustawienia wyświetlania została przywrócone do domyślnych."
402
 
456
  msgid "Thumbnail size"
457
  msgstr "WIelkość miniatury"
458
 
459
+ #: ../post-views-counter.php:275
460
  msgid "Are you sure you want to reset these settings to defaults?"
461
  msgstr "Czy jesteś pewny, że chcesz zresetować ustawienia do domyślnych?"
462
 
463
+ #: ../post-views-counter.php:314
464
  msgid "Support"
465
  msgstr "Forum pomocy"
466
 
467
+ #: ../post-views-counter.php:333
468
  msgid "Settings"
469
  msgstr "Ustawienia"
470
 
471
+ #~ msgid "Select post types"
472
+ #~ msgstr "Wybierz typy wpisów"
473
+
474
+ #~ msgid "Select groups"
475
+ #~ msgstr "Wybierz grupy"
476
+
477
+ #~ msgid "Select user roles"
478
+ #~ msgstr "Wybierz role użytkowników"
479
+
480
+ #~ msgid "Select the type of visitors to be excluded from post views count."
481
+ #~ msgstr "Wybierz typy użytkowników wyłączonych z działania licznika."
482
+
483
  #~ msgid "Enable"
484
  #~ msgstr "Włącz"
485
 
languages/post-views-counter.pot CHANGED
@@ -2,7 +2,7 @@
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Post Views Counter\n"
5
- "POT-Creation-Date: 2015-05-27 14:35+0100\n"
6
  "PO-Revision-Date: 2015-04-08 18:59+0100\n"
7
  "Last-Translator: Bartosz Arendt <info@dfactory.eu>\n"
8
  "Language-Team: dFactory <info@dfactory.eu>\n"
@@ -10,7 +10,7 @@ msgstr ""
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
- "X-Generator: Poedit 1.8\n"
14
  "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e;esc_attr__;esc_attr_e;"
15
  "esc_html__;esc_html_e\n"
16
  "X-Poedit-Basepath: .\n"
@@ -18,24 +18,24 @@ msgstr ""
18
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
  "X-Poedit-SearchPath-0: ..\n"
20
 
21
- #: ../includes/columns.php:49 ../includes/columns.php:193
22
- #: ../includes/columns.php:199
23
  msgid "Post Views"
24
  msgstr ""
25
 
26
- #: ../includes/columns.php:58
27
  msgid "Edit"
28
  msgstr ""
29
 
30
- #: ../includes/columns.php:62
31
  msgid "Adjust the views count for this post."
32
  msgstr ""
33
 
34
- #: ../includes/columns.php:66
35
  msgid "OK"
36
  msgstr ""
37
 
38
- #: ../includes/columns.php:67
39
  msgid "Cancel"
40
  msgstr ""
41
 
@@ -257,50 +257,41 @@ msgstr ""
257
  msgid "Icon Class"
258
  msgstr ""
259
 
260
- #: ../includes/settings.php:230
261
  msgid "Enter the label for the post views counter field."
262
  msgstr ""
263
 
264
- #: ../includes/settings.php:242
265
- msgid "Select post types"
266
- msgstr ""
267
-
268
- #: ../includes/settings.php:252
269
  msgid "Select post types for which post views will be counted."
270
  msgstr ""
271
 
272
- #: ../includes/settings.php:264 ../includes/settings.php:387
273
- #: ../includes/settings.php:541
274
- msgid "Select groups"
275
- msgstr ""
276
-
277
- #: ../includes/settings.php:274
278
  msgid "Select post types for which post views will be displayed."
279
  msgstr ""
280
 
281
- #: ../includes/settings.php:296
282
  msgid ""
283
  "Select the method of collecting post views data. If you are using any of the "
284
  "caching plugins select Javascript."
285
  msgstr ""
286
 
287
- #: ../includes/settings.php:307
288
  msgid ""
289
  "Enable to display post views count column for each of the selected post "
290
  "types."
291
  msgstr ""
292
 
293
- #: ../includes/settings.php:329
294
  msgid "Enter the time between single user visit count."
295
  msgstr ""
296
 
297
- #: ../includes/settings.php:352
298
  msgid ""
299
  "Delete single day post views data older than specified above. Enter 0 "
300
  "(number zero) if you want to preserve your data regardless of its age."
301
  msgstr ""
302
 
303
- #: ../includes/settings.php:375
304
  msgid ""
305
  "How often to flush cached view counts from the object cache into the "
306
  "database. This feature is used only if a persistent object cache is detected "
@@ -312,84 +303,80 @@ msgid ""
312
  "interval."
313
  msgstr ""
314
 
315
- #: ../includes/settings.php:398 ../includes/settings.php:556
316
- msgid "Select user roles"
317
  msgstr ""
318
 
319
- #: ../includes/settings.php:409
320
- msgid "Select the type of visitors to be excluded from post views count."
321
  msgstr ""
322
 
323
- #: ../includes/settings.php:425 ../includes/settings.php:434
324
  msgid "Remove"
325
  msgstr ""
326
 
327
- #: ../includes/settings.php:434
328
  msgid "Add new"
329
  msgstr ""
330
 
331
- #: ../includes/settings.php:434
332
  msgid "Add my current IP"
333
  msgstr ""
334
 
335
- #: ../includes/settings.php:436
336
  msgid "Enter the IP addresses to be excluded from post views count."
337
  msgstr ""
338
 
339
- #: ../includes/settings.php:448
340
  msgid "Import"
341
  msgstr ""
342
 
343
- #: ../includes/settings.php:450
344
  msgid "Import post views data from WP-PostViews plugin."
345
  msgstr ""
346
 
347
- #: ../includes/settings.php:451
348
  msgid "Override existing Post Views Counter data."
349
  msgstr ""
350
 
351
- #: ../includes/settings.php:462
352
  msgid "Enable to restrict post views editing to admins only."
353
  msgstr ""
354
 
355
- #: ../includes/settings.php:472
356
  msgid "Enable to delete all plugin data on deactivation."
357
  msgstr ""
358
 
359
- #: ../includes/settings.php:493
360
  msgid ""
361
  "Select where would you like to display the post views counter. Use [post-"
362
  "views] shortcode for manual display."
363
  msgstr ""
364
 
365
- #: ../includes/settings.php:515
366
  msgid "Choose how to display the post views counter."
367
  msgstr ""
368
 
369
- #: ../includes/settings.php:529
370
  #, php-format
371
  msgid ""
372
  "Enter the post views icon class. Any of the <a href=\"%s\" target=\"_blank"
373
  "\">Dashicons</a> classes are available."
374
  msgstr ""
375
 
376
- #: ../includes/settings.php:567
377
- msgid "Use it to hide the post views counter from selected type of visitors."
378
- msgstr ""
379
-
380
- #: ../includes/settings.php:595
381
  msgid "WP-PostViews data imported succesfully."
382
  msgstr ""
383
 
384
- #: ../includes/settings.php:597
385
  msgid "There was no data to import."
386
  msgstr ""
387
 
388
- #: ../includes/settings.php:753
389
  msgid "General settings restored to defaults."
390
  msgstr ""
391
 
392
- #: ../includes/settings.php:757
393
  msgid "Display settings restored to defaults."
394
  msgstr ""
395
 
@@ -449,14 +436,14 @@ msgstr ""
449
  msgid "Thumbnail size"
450
  msgstr ""
451
 
452
- #: ../post-views-counter.php:281
453
  msgid "Are you sure you want to reset these settings to defaults?"
454
  msgstr ""
455
 
456
- #: ../post-views-counter.php:313
457
  msgid "Support"
458
  msgstr ""
459
 
460
- #: ../post-views-counter.php:332
461
  msgid "Settings"
462
  msgstr ""
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Post Views Counter\n"
5
+ "POT-Creation-Date: 2015-10-18 13:38+0200\n"
6
  "PO-Revision-Date: 2015-04-08 18:59+0100\n"
7
  "Last-Translator: Bartosz Arendt <info@dfactory.eu>\n"
8
  "Language-Team: dFactory <info@dfactory.eu>\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 1.8.5\n"
14
  "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e;esc_attr__;esc_attr_e;"
15
  "esc_html__;esc_html_e\n"
16
  "X-Poedit-Basepath: .\n"
18
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
  "X-Poedit-SearchPath-0: ..\n"
20
 
21
+ #: ../includes/columns.php:56 ../includes/columns.php:208
22
+ #: ../includes/columns.php:214 ../includes/columns.php:286
23
  msgid "Post Views"
24
  msgstr ""
25
 
26
+ #: ../includes/columns.php:65
27
  msgid "Edit"
28
  msgstr ""
29
 
30
+ #: ../includes/columns.php:69
31
  msgid "Adjust the views count for this post."
32
  msgstr ""
33
 
34
+ #: ../includes/columns.php:73
35
  msgid "OK"
36
  msgstr ""
37
 
38
+ #: ../includes/columns.php:74
39
  msgid "Cancel"
40
  msgstr ""
41
 
257
  msgid "Icon Class"
258
  msgstr ""
259
 
260
+ #: ../includes/settings.php:229
261
  msgid "Enter the label for the post views counter field."
262
  msgstr ""
263
 
264
+ #: ../includes/settings.php:247
 
 
 
 
265
  msgid "Select post types for which post views will be counted."
266
  msgstr ""
267
 
268
+ #: ../includes/settings.php:264
 
 
 
 
 
269
  msgid "Select post types for which post views will be displayed."
270
  msgstr ""
271
 
272
+ #: ../includes/settings.php:283
273
  msgid ""
274
  "Select the method of collecting post views data. If you are using any of the "
275
  "caching plugins select Javascript."
276
  msgstr ""
277
 
278
+ #: ../includes/settings.php:293
279
  msgid ""
280
  "Enable to display post views count column for each of the selected post "
281
  "types."
282
  msgstr ""
283
 
284
+ #: ../includes/settings.php:313
285
  msgid "Enter the time between single user visit count."
286
  msgstr ""
287
 
288
+ #: ../includes/settings.php:333
289
  msgid ""
290
  "Delete single day post views data older than specified above. Enter 0 "
291
  "(number zero) if you want to preserve your data regardless of its age."
292
  msgstr ""
293
 
294
+ #: ../includes/settings.php:353
295
  msgid ""
296
  "How often to flush cached view counts from the object cache into the "
297
  "database. This feature is used only if a persistent object cache is detected "
303
  "interval."
304
  msgstr ""
305
 
306
+ #: ../includes/settings.php:370 ../includes/settings.php:508
307
+ msgid "Use it to hide the post views counter from selected type of visitors."
308
  msgstr ""
309
 
310
+ #: ../includes/settings.php:377 ../includes/settings.php:515
311
+ msgid "Use it to hide the post views counter from selected user roles."
312
  msgstr ""
313
 
314
+ #: ../includes/settings.php:393 ../includes/settings.php:402
315
  msgid "Remove"
316
  msgstr ""
317
 
318
+ #: ../includes/settings.php:402
319
  msgid "Add new"
320
  msgstr ""
321
 
322
+ #: ../includes/settings.php:402
323
  msgid "Add my current IP"
324
  msgstr ""
325
 
326
+ #: ../includes/settings.php:404
327
  msgid "Enter the IP addresses to be excluded from post views count."
328
  msgstr ""
329
 
330
+ #: ../includes/settings.php:415
331
  msgid "Import"
332
  msgstr ""
333
 
334
+ #: ../includes/settings.php:416
335
  msgid "Import post views data from WP-PostViews plugin."
336
  msgstr ""
337
 
338
+ #: ../includes/settings.php:417
339
  msgid "Override existing Post Views Counter data."
340
  msgstr ""
341
 
342
+ #: ../includes/settings.php:428
343
  msgid "Enable to restrict post views editing to admins only."
344
  msgstr ""
345
 
346
+ #: ../includes/settings.php:438
347
  msgid "Enable to delete all plugin data on deactivation."
348
  msgstr ""
349
 
350
+ #: ../includes/settings.php:457
351
  msgid ""
352
  "Select where would you like to display the post views counter. Use [post-"
353
  "views] shortcode for manual display."
354
  msgstr ""
355
 
356
+ #: ../includes/settings.php:476
357
  msgid "Choose how to display the post views counter."
358
  msgstr ""
359
 
360
+ #: ../includes/settings.php:487
361
  #, php-format
362
  msgid ""
363
  "Enter the post views icon class. Any of the <a href=\"%s\" target=\"_blank"
364
  "\">Dashicons</a> classes are available."
365
  msgstr ""
366
 
367
+ #: ../includes/settings.php:544
 
 
 
 
368
  msgid "WP-PostViews data imported succesfully."
369
  msgstr ""
370
 
371
+ #: ../includes/settings.php:546
372
  msgid "There was no data to import."
373
  msgstr ""
374
 
375
+ #: ../includes/settings.php:702
376
  msgid "General settings restored to defaults."
377
  msgstr ""
378
 
379
+ #: ../includes/settings.php:706
380
  msgid "Display settings restored to defaults."
381
  msgstr ""
382
 
436
  msgid "Thumbnail size"
437
  msgstr ""
438
 
439
+ #: ../post-views-counter.php:275
440
  msgid "Are you sure you want to reset these settings to defaults?"
441
  msgstr ""
442
 
443
+ #: ../post-views-counter.php:314
444
  msgid "Support"
445
  msgstr ""
446
 
447
+ #: ../post-views-counter.php:333
448
  msgid "Settings"
449
  msgstr ""
post-views-counter.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Post Views Counter
4
  Description: Forget WP-PostViews. Display how many times a post, page or custom post type had been viewed in a simple, fast and reliable way.
5
- Version: 1.0.12
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/post-views-counter/
@@ -42,7 +42,7 @@ include_once( POST_VIEWS_COUNTER_PATH . 'includes/widgets.php' );
42
  * Post Views Counter class
43
  *
44
  * @class Post_Views_Counter
45
- * @version 1.0.12
46
  */
47
  class Post_Views_Counter {
48
 
@@ -89,9 +89,9 @@ class Post_Views_Counter {
89
  'text' => true
90
  ),
91
  'link_to_post' => true,
92
- 'icon_class' => 'dashicons-visibility'
93
  ),
94
- 'version' => '1.0.12'
95
  );
96
 
97
  public static function instance() {
@@ -219,7 +219,7 @@ class Post_Views_Counter {
219
  * Get instance of a class
220
  */
221
  public function get_instance( $name ) {
222
- if ( in_array( $name, array( 'counter', 'settings' ), true ) )
223
  return $this->instances[$name];
224
  }
225
 
@@ -249,31 +249,25 @@ class Post_Views_Counter {
249
  * Enqueue admin scripts and styles
250
  */
251
  public function admin_scripts_styles( $page ) {
252
-
253
  wp_register_style(
254
  'pvc-admin', POST_VIEWS_COUNTER_URL . '/css/admin.css'
255
  );
256
 
257
- wp_register_style(
258
- 'pvc-chosen', POST_VIEWS_COUNTER_URL . '/assets/chosen/chosen.min.css'
259
- );
260
-
261
  wp_register_script(
262
- 'pvc-admin-chosen', POST_VIEWS_COUNTER_URL . '/assets/chosen/chosen.jquery.min.js', array( 'jquery' ), $this->defaults['version']
263
- );
264
-
265
- wp_register_script(
266
- 'pvc-admin-settings', POST_VIEWS_COUNTER_URL . '/js/admin-settings.js', array( 'jquery', 'pvc-admin-chosen' ), $this->defaults['version']
267
  );
268
 
269
  wp_register_script(
270
  'pvc-admin-post', POST_VIEWS_COUNTER_URL . '/js/admin-post.js', array( 'jquery' ), $this->defaults['version']
271
  );
 
 
 
 
272
 
273
  // load on PVC settings page
274
  if ( $page === 'settings_page_post-views-counter' ) {
275
 
276
- wp_enqueue_script( 'pvc-admin-chosen' );
277
  wp_enqueue_script( 'pvc-admin-settings' );
278
 
279
  wp_localize_script(
@@ -282,19 +276,26 @@ class Post_Views_Counter {
282
  )
283
  );
284
 
285
- wp_enqueue_style( 'pvc-chosen' );
286
  wp_enqueue_style( 'pvc-admin' );
287
 
288
  // load on single post page
289
- } elseif ( $page = 'post.php' ) {
290
 
291
  $post_types = Post_Views_Counter()->get_attribute( 'options', 'general', 'post_types_count' );
292
 
293
  if ( ! in_array( get_post_type(), (array) $post_types ) )
294
  return;
295
-
296
  wp_enqueue_style( 'pvc-admin' );
297
  wp_enqueue_script( 'pvc-admin-post' );
 
 
 
 
 
 
 
 
298
  }
299
  }
300
 
2
  /*
3
  Plugin Name: Post Views Counter
4
  Description: Forget WP-PostViews. Display how many times a post, page or custom post type had been viewed in a simple, fast and reliable way.
5
+ Version: 1.1.0
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/post-views-counter/
42
  * Post Views Counter class
43
  *
44
  * @class Post_Views_Counter
45
+ * @version 1.1.0
46
  */
47
  class Post_Views_Counter {
48
 
89
  'text' => true
90
  ),
91
  'link_to_post' => true,
92
+ 'icon_class' => 'dashicons-chart-bar'
93
  ),
94
+ 'version' => '1.1.0'
95
  );
96
 
97
  public static function instance() {
219
  * Get instance of a class
220
  */
221
  public function get_instance( $name ) {
222
+ if ( in_array( $name, array( 'counter', 'settings', 'cron' ), true ) )
223
  return $this->instances[$name];
224
  }
225
 
249
  * Enqueue admin scripts and styles
250
  */
251
  public function admin_scripts_styles( $page ) {
 
252
  wp_register_style(
253
  'pvc-admin', POST_VIEWS_COUNTER_URL . '/css/admin.css'
254
  );
255
 
 
 
 
 
256
  wp_register_script(
257
+ 'pvc-admin-settings', POST_VIEWS_COUNTER_URL . '/js/admin-settings.js', array( 'jquery' ), $this->defaults['version']
 
 
 
 
258
  );
259
 
260
  wp_register_script(
261
  'pvc-admin-post', POST_VIEWS_COUNTER_URL . '/js/admin-post.js', array( 'jquery' ), $this->defaults['version']
262
  );
263
+
264
+ wp_register_script(
265
+ 'pvc-admin-quick-edit', POST_VIEWS_COUNTER_URL . '/js/admin-quick-edit.js', array( 'jquery', 'inline-edit-post' ), $this->defaults['version']
266
+ );
267
 
268
  // load on PVC settings page
269
  if ( $page === 'settings_page_post-views-counter' ) {
270
 
 
271
  wp_enqueue_script( 'pvc-admin-settings' );
272
 
273
  wp_localize_script(
276
  )
277
  );
278
 
 
279
  wp_enqueue_style( 'pvc-admin' );
280
 
281
  // load on single post page
282
+ } elseif ( $page === 'post.php' ) {
283
 
284
  $post_types = Post_Views_Counter()->get_attribute( 'options', 'general', 'post_types_count' );
285
 
286
  if ( ! in_array( get_post_type(), (array) $post_types ) )
287
  return;
288
+
289
  wp_enqueue_style( 'pvc-admin' );
290
  wp_enqueue_script( 'pvc-admin-post' );
291
+ } elseif ( $page === 'edit.php' ) {
292
+ $post_types = Post_Views_Counter()->get_attribute( 'options', 'general', 'post_types_count' );
293
+
294
+ if ( ! in_array( get_post_type(), (array) $post_types ) )
295
+ return;
296
+
297
+ wp_enqueue_style( 'pvc-admin' );
298
+ wp_enqueue_script( 'pvc-admin-quick-edit' );
299
  }
300
  }
301
 
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: dfactory
3
  Donate link: http://www.dfactory.eu/
4
  Tags: counter, hits, postviews, post views, views, count
5
- Requires at least: 3.8.0
6
- Tested up to: 4.2.2
7
- Stable tag: 1.0.12
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
@@ -21,16 +21,17 @@ For more information, check out plugin page at [dFactory](http://www.dfactory.eu
21
  * Option to select post types for which post views will be counted and displayed.
22
  * 2 methods of collecting post views data: PHP and Javascript, for greater flexibility
23
  * Possibility to manually set views count for each post
 
24
  * Option to set time between counts
25
  * Excluding counts from visitors: bots, logged in users, selected user roles
26
  * Excluding users by IPs
27
  * Restricting display by user roles
28
  * Restricting post views editing to admins
29
  * One-click data import from WP-PostViews
 
30
  * Post views display position, automatic or manual via shortcode
31
  * W3 Cache/WP SuperCache compatible
32
  * Optional object cache support
33
- * Post views admin column
34
  * WPML and Polylang compatible
35
  * .pot file for translations included
36
 
@@ -66,6 +67,11 @@ No questions yet.
66
 
67
  == Changelog ==
68
 
 
 
 
 
 
69
  = 1.0.12 =
70
  * New: Italian translation, thanks to [Rene Querin](http://www.q-design.it)
71
 
@@ -108,5 +114,7 @@ Initial release
108
 
109
  == Upgrade Notice ==
110
 
111
- = 1.0.12 =
112
- * New: Italian translation, thanks to [Ren� Querin](http://www.q-design.it)
 
 
2
  Contributors: dfactory
3
  Donate link: http://www.dfactory.eu/
4
  Tags: counter, hits, postviews, post views, views, count
5
+ Requires at least: 4.0.0
6
+ Tested up to: 4.3.1
7
+ Stable tag: 1.1.0
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
21
  * Option to select post types for which post views will be counted and displayed.
22
  * 2 methods of collecting post views data: PHP and Javascript, for greater flexibility
23
  * Possibility to manually set views count for each post
24
+ * Capability to query posts according to its views count
25
  * Option to set time between counts
26
  * Excluding counts from visitors: bots, logged in users, selected user roles
27
  * Excluding users by IPs
28
  * Restricting display by user roles
29
  * Restricting post views editing to admins
30
  * One-click data import from WP-PostViews
31
+ * Sortable admin column
32
  * Post views display position, automatic or manual via shortcode
33
  * W3 Cache/WP SuperCache compatible
34
  * Optional object cache support
 
35
  * WPML and Polylang compatible
36
  * .pot file for translations included
37
 
67
 
68
  == Changelog ==
69
 
70
+ = 1.1.0 =
71
+ * New: Quick post views edit
72
+ * New: Bulk post views edit
73
+ * Tweak: Admin UI improvements
74
+
75
  = 1.0.12 =
76
  * New: Italian translation, thanks to [Rene Querin](http://www.q-design.it)
77
 
114
 
115
  == Upgrade Notice ==
116
 
117
+ = 1.1.0 =
118
+ * New: Quick post views edit
119
+ * New: Bulk post views edit
120
+ * Tweak: Admin UI improvements