Version Description
- Auto-refresh list of notifications
- Fixed issue when notification wasn't updated correctly
- Improvement search engine (Deletion Section)
- Scrollbar fix on plugin configuration page
Download this release
Release Info
Developer | copydelete |
Plugin | Duplicate Post |
Version | 1.0.5 |
Comparing to | |
See all releases |
Code changes from version 1.0.3 to 1.0.5
- assets/imgs/intro_3.jpg +0 -0
- assets/js/cdp-icPagination.min.js +1 -1
- assets/js/cdp.min.js +1 -1
- copy-delete-posts.php +7 -7
- menu/configuration.php +2 -3
- post/handler.php +7 -0
- readme.txt +104 -33
assets/imgs/intro_3.jpg
DELETED
Binary file
|
assets/js/cdp-icPagination.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
class IcPagination{constructor(e,s,a){this.options=a,this.table=jQuery(e),this.pagiElem=s,this.itemsOnPage=this.options.itemsOnPage||1,this.table.find('[data-empty-info="true"]').remove(),this.rows=this.loadRows(),this.pages=Math.ceil(this.rows.length/this.itemsOnPage),jQuery(this.pagiElem+"-ilosc-wynikow").text(this.rows.length),!0===this.options.useParams?(this.urlParams=new URLSearchParams(location.search),this.urlParams.has("strona")&&parseInt(this.urlParams.get("strona"))<=this.pages&&parseInt(this.urlParams.get("strona"))>=1?this.selected=parseInt(this.urlParams.get("strona"))-1:this.selected=0):this.selected=0,this.options.emptylist?this.emptylist=this.options.emptylist:this.emptylist="Brak wyników!",this.showElements(),this.generatePagination(),this.handleClicks(),jQuery(".cdp-d-sel-all-con").length>0&&jQuery('[data-box="cdp-tabox-manual"]').hasClass("cdp-tab-active")&&(1==this.pages?jQuery(".cdp-d-sel-all-con").css({visibility:"hidden"}):jQuery(".cdp-d-sel-all-con").css({visibility:""})),0===this.rows.length?(this.table.find('tbody tr[data-ignore="true"]').hide(),this.table.find("tbody").append('<tr data-ignore="true" data-empty-info="true"><td colspan="100%">'+this.emptylist+"</td></tr>")):this.table.find('tbody tr[data-ignore="true"]').hide(),this.pagesStyle();let t=this;jQuery(document).keydown(function(e){if(0==jQuery("input:focus, .cdp-magic-input:focus").length)switch(e.which){case 37:e.preventDefault(),jQuery(t.prevPageElem).parents("li").hasClass("cdp-separator-dis")||t.changePage(t.selected-1);break;case 39:e.preventDefault(),jQuery(t.nextPageElem).parents("li").hasClass("cdp-separator-dis")||t.changePage(t.selected+1)}})}loadRows(){return this.table.find("tbody tr").not('[data-ignore="true"]')}generatePagination(e=!1){e||(jQuery(this.pagiElem).html('<nav class="pagination pagination-pages cdp-center"></nav>'),jQuery(this.pagiElem+" .pagination-pages").append('<li class="pagination-previous cdp-pagi-arrows cdp-no-style cdp-pointer cdp-left"><a class="prev_page">«</a></li>'),jQuery(this.pagiElem+" .pagination-pages").append('<li class="pagination-next cdp-pagi-arrows cdp-no-style cdp-pointer cdp-right"><a class="next_page">»</a></li>'),jQuery(this.pagiElem+" .pagination-pages").append('<ul class="pagination-pages-section pagination-list"><li class="cdp-separator-dis" data-separator="true"><a>···</a></li><li class="cdp-separator-dis" data-separator="true"><a>···</a></li></ul>'),this.prevPageElem=jQuery(this.pagiElem+" .pagination-pages").find("a.prev_page"),this.nextPageElem=jQuery(this.pagiElem+" .pagination-pages").find("a.next_page"),this.dataSeparators=jQuery(this.pagiElem+" .pagination-pages .pagination-pages-section").find('li[data-separator="true"]'),this.dataSeparators.addClass("cdp-hide")),jQuery(this.pagiElem+" .pagination-pages-section").find(".page-btn").remove(),jQuery(jQuery('<li class="page-btn"><a class="page_link pagination-link" data-page="0">1</a></li>')).insertBefore(jQuery(this.dataSeparators[0]));for(let e=1;e<this.pages;e++){let s=jQuery('<li class="page-btn"><a class="page_link pagination-link" data-page="'+e+'">'+(e+1)+"</a></li>");e<2&&this.pages>2?jQuery(s).insertBefore(jQuery(this.dataSeparators[0])):e<this.pages-2?jQuery(s).insertBefore(jQuery(this.dataSeparators[1])):jQuery(this.pagiElem+" .pagination-pages-section").append(jQuery(s))}this.pagesElems=jQuery(this.pagiElem+" .pagination-pages").find(".page-btn")}handleClicks(e=!1){e&&(jQuery(this.prevPageElem).off("click"),jQuery(this.nextPageElem).off("click"),jQuery(this.pagiElem+" .pagination-pages").find("a.page_link").off("click"));var s=this;jQuery(this.pagiElem+" .pagination-pages-section").find('[data-page="'+this.selected+'"]').parents("li").addClass("active is-current").addClass("off-clicks"),jQuery(this.prevPageElem).on("click",function(){jQuery(this).parents("li").hasClass("cdp-separator-dis")||s.changePage(s.selected-1)}),jQuery(this.nextPageElem).on("click",function(){jQuery(this).parents("li").hasClass("cdp-separator-dis")||s.changePage(s.selected+1)}),jQuery(this.pagiElem+" .pagination-pages").find("a.page_link").on("click",function(){s.changePage(jQuery(this).attr("data-page"))})}changePage(e){this.selected=parseInt(e),jQuery(this.pagiElem+" .pagination-pages").find(".active").removeClass("active is-current").removeClass("off-clicks"),jQuery(this.pagiElem+" .pagination-pages").find(`[data-page="${this.selected}"]`).parents("li").addClass("active is-current").addClass("off-clicks"),this.showElements(this.selected),this.pagesStyle(),jQuery(".cdp-d-section").length>0&&"0"!=jQuery("#cdp-d-table-pagi-ilosc-wynikow").text()&&(jQuery(".cdp-not-yet-search").is(":visible")&&(jQuery(".cdp-d-section").css({"max-height":"",height:""}),jQuery(".cdp-d-section").css({"max-height":jQuery(".cdp-d-section").height()})),jQuery(".cdp-input-d-id:visible:checked").length==jQuery(".cdp-input-d-id:visible").length?jQuery(".cdp-d-checkbox-all").prop("checked",!0):jQuery(".cdp-d-checkbox-all").prop("checked",!1))}changeUrlParam(e,s){!0===this.options.useParams&&(window.location.href.indexOf("?strona=")>-1?history.pushState({},null,window.location.href.replace(new RegExp(`(${e}=).*`),"jQuery1"+s)):history.pushState({},null,window.location.href+"?"+e+"="+s))}pagesStyle(){let e=this.getPages();if(this.selected+1>e-1?jQuery(this.nextPageElem).parents("li").addClass("cdp-separator-dis").addClass("off-clicks").parents(".right").css({cursor:"not-allowed"}):jQuery(this.nextPageElem).parents("li").removeClass("cdp-separator-dis").removeClass("off-clicks").parents(".right").css({cursor:""}),0===this.selected?jQuery(this.prevPageElem).parents("li").addClass("cdp-separator-dis").addClass("off-clicks").parents(".left").css({cursor:"not-allowed"}):jQuery(this.prevPageElem).parents("li").removeClass("cdp-separator-dis").removeClass("off-clicks").parents(".left").css({cursor:""}),this.pagesElems.hide(),this.pagesElems.eq(0).show(),e>=2){this.pagesElems.eq(-1).show();let s=parseInt(jQuery(this.pagiElem+" .pagination-pages").find(".active a").attr("data-page"));s-1!=-1&&this.pagesElems.eq(s-1).show(),s+1!==e&&this.pagesElems.eq(s+1).show(),this.pagesElems.eq(s).show(),e>3?(this.pagesElems.eq(1).is(":hidden")?jQuery(this.dataSeparators[0]).removeClass("cdp-hide"):jQuery(this.dataSeparators[0]).addClass("cdp-hide"),this.pagesElems.eq(-2).is(":hidden")?jQuery(this.dataSeparators[1]).removeClass("cdp-hide"):jQuery(this.dataSeparators[1]).addClass("cdp-hide")):(jQuery(this.dataSeparators[0]).addClass("cdp-hide"),jQuery(this.dataSeparators[1]).addClass("cdp-hide")),0==this.selected&&jQuery(this.dataSeparators[0]).addClass("cdp-hide")}else jQuery(this.dataSeparators[0]).addClass("cdp-hide"),jQuery(this.dataSeparators[1]).addClass("cdp-hide")}getPages(){return this.pages=Math.ceil(this.rows.length/this.itemsOnPage),Math.ceil(this.rows.length/this.itemsOnPage)}showElements(e=null){jQuery(this.rows).hide(),null!==e&&(this.selected=e);for(let e=this.selected*this.itemsOnPage,s=0;e<this.rows.length&&s<this.itemsOnPage;e++,s++)jQuery(this.rows[e]).show()}refresh(){let e=this.pages,s=this.selected===this.pages-1;this.table.find('[data-empty-info="true"]').remove(),this.rows=this.loadRows(),this.pages=Math.ceil(this.rows.length/this.itemsOnPage),jQuery(".cdp-d-sel-all-con").length>0&&jQuery('[data-box="cdp-tabox-manual"]').hasClass("cdp-tab-active")&&(1==this.pages?jQuery(".cdp-d-sel-all-con").css({visibility:"hidden"}):jQuery(".cdp-d-sel-all-con").css({visibility:""})),this.showElements(this.selected),this.generatePagination(!0),this.handleClicks(!0),this.pagesStyle(),0===this.rows.length?this.firstPage():s&&e>this.pages&&this.lastPage(),0===this.rows.length?(this.table.find('tbody tr[data-ignore="true"]').hide(),this.table.find("tbody").append('<tr data-ignore="true" data-empty-info="true"><td colspan="100%">'+this.emptylist+"</td></tr>")):this.table.find('tbody tr[data-ignore="true"]').hide(),jQuery(this.pagiElem+"-ilosc-wynikow").text(this.rows.length),jQuery(".cdp-d-section").length>0&&"0"!=jQuery("#cdp-d-table-pagi-ilosc-wynikow").text()&&jQuery(".cdp-not-yet-search").is(":visible")&&(jQuery(".cdp-d-section").css({"max-height":"",height:""}),jQuery(".cdp-d-section").css({"max-height":jQuery(".cdp-d-section").height()}))}lastPage(){this.changePage(this.pages-1)}firstPage(){this.changePage(0)}changePageSize(e=1){!isNaN(parseInt(e))&&parseInt(e)>=1&&(this.itemsOnPage=parseInt(e),this.refresh())}}
|
1 |
+
class IcPagination{constructor(e,s,a){this.options=a,this.table=jQuery(e),this.pagiElem=s,this.itemsOnPage=this.options.itemsOnPage||1,this.table.find('[data-empty-info="true"]').remove(),this.rows=this.loadRows(),this.pages=Math.ceil(this.rows.length/this.itemsOnPage),jQuery(this.pagiElem+"-ilosc-wynikow").text(this.rows.length),!0===this.options.useParams?(this.urlParams=new URLSearchParams(location.search),this.urlParams.has("strona")&&parseInt(this.urlParams.get("strona"))<=this.pages&&parseInt(this.urlParams.get("strona"))>=1?this.selected=parseInt(this.urlParams.get("strona"))-1:this.selected=0):this.selected=0,this.options.emptylist?this.emptylist=this.options.emptylist:this.emptylist="Brak wyników!",this.showElements(),this.generatePagination(),this.handleClicks(),jQuery(".cdp-d-sel-all-con").length>0&&jQuery('[data-box="cdp-tabox-manual"]').hasClass("cdp-tab-active")&&(1==this.pages?jQuery(".cdp-d-sel-all-con").css({visibility:"hidden"}):jQuery(".cdp-d-sel-all-con").css({visibility:""})),0===this.rows.length?(this.table.find('tbody tr[data-ignore="true"]').hide(),this.table.find("tbody").append('<tr data-ignore="true" data-empty-info="true"><td colspan="100%">'+this.emptylist+"</td></tr>")):this.table.find('tbody tr[data-ignore="true"]').hide(),this.pagesStyle();let t=this;jQuery(document).keydown(function(e){if(0==jQuery("input:focus, .cdp-magic-input:focus").length)switch(e.which){case 37:e.preventDefault(),jQuery(t.prevPageElem).parents("li").hasClass("cdp-separator-dis")||t.changePage(t.selected-1);break;case 39:e.preventDefault(),jQuery(t.nextPageElem).parents("li").hasClass("cdp-separator-dis")||t.changePage(t.selected+1)}})}loadRows(){return this.table.find("tbody tr").not('[data-ignore="true"]')}generatePagination(e=!1){e||(jQuery(this.pagiElem).html('<nav class="pagination pagination-pages cdp-center"></nav>'),jQuery(this.pagiElem+" .pagination-pages").append('<li class="pagination-previous cdp-pagi-arrows cdp-no-style cdp-pointer cdp-left"><a class="prev_page">«</a></li>'),jQuery(this.pagiElem+" .pagination-pages").append('<li class="pagination-next cdp-pagi-arrows cdp-no-style cdp-pointer cdp-right"><a class="next_page">»</a></li>'),jQuery(this.pagiElem+" .pagination-pages").append('<ul class="pagination-pages-section pagination-list"><li class="cdp-separator-dis" data-separator="true"><a>···</a></li><li class="cdp-separator-dis" data-separator="true"><a>···</a></li></ul>'),this.prevPageElem=jQuery(this.pagiElem+" .pagination-pages").find("a.prev_page"),this.nextPageElem=jQuery(this.pagiElem+" .pagination-pages").find("a.next_page"),this.dataSeparators=jQuery(this.pagiElem+" .pagination-pages .pagination-pages-section").find('li[data-separator="true"]'),this.dataSeparators.addClass("cdp-hide")),jQuery(this.pagiElem+" .pagination-pages-section").find(".page-btn").remove(),jQuery(jQuery('<li class="page-btn"><a class="page_link pagination-link" data-page="0">1</a></li>')).insertBefore(jQuery(this.dataSeparators[0]));for(let e=1;e<this.pages;e++){let s=jQuery('<li class="page-btn"><a class="page_link pagination-link" data-page="'+e+'">'+(e+1)+"</a></li>");e<2&&this.pages>2?jQuery(s).insertBefore(jQuery(this.dataSeparators[0])):e<this.pages-2?jQuery(s).insertBefore(jQuery(this.dataSeparators[1])):jQuery(this.pagiElem+" .pagination-pages-section").append(jQuery(s))}this.pagesElems=jQuery(this.pagiElem+" .pagination-pages").find(".page-btn")}handleClicks(e=!1){e&&(jQuery(this.prevPageElem).off("click"),jQuery(this.nextPageElem).off("click"),jQuery(this.pagiElem+" .pagination-pages").find("a.page_link").off("click"));var s=this;jQuery(this.pagiElem+" .pagination-pages-section").find('[data-page="'+this.selected+'"]').parents("li").addClass("active is-current").addClass("off-clicks"),jQuery(this.prevPageElem).on("click",function(){jQuery(this).parents("li").hasClass("cdp-separator-dis")||s.changePage(s.selected-1)}),jQuery(this.nextPageElem).on("click",function(){jQuery(this).parents("li").hasClass("cdp-separator-dis")||s.changePage(s.selected+1)}),jQuery(this.pagiElem+" .pagination-pages").find("a.page_link").on("click",function(){s.changePage(jQuery(this).attr("data-page"))})}changePage(e){this.table.is(":visible")&&(this.selected=parseInt(e),jQuery(this.pagiElem+" .pagination-pages").find(".active").removeClass("active is-current").removeClass("off-clicks"),jQuery(this.pagiElem+" .pagination-pages").find(`[data-page="${this.selected}"]`).parents("li").addClass("active is-current").addClass("off-clicks"),this.showElements(this.selected),this.pagesStyle(),jQuery(".cdp-d-section").length>0&&"0"!=jQuery("#cdp-d-table-pagi-ilosc-wynikow").text()&&(jQuery(".cdp-not-yet-search").is(":visible")&&(jQuery(".cdp-d-section").css({"max-height":"",height:""}),jQuery(".cdp-d-section").css({"max-height":jQuery(".cdp-d-section").height()})),jQuery("#cdp-redi-table").is(":visible")&&jQuery(".cdp-d-section").css({"max-height":"",height:""}),jQuery(".cdp-input-d-id:visible:checked").length==jQuery(".cdp-input-d-id:visible").length?jQuery(".cdp-d-checkbox-all").prop("checked",!0):jQuery(".cdp-d-checkbox-all").prop("checked",!1)))}changeUrlParam(e,s){!0===this.options.useParams&&(window.location.href.indexOf("?strona=")>-1?history.pushState({},null,window.location.href.replace(new RegExp(`(${e}=).*`),"jQuery1"+s)):history.pushState({},null,window.location.href+"?"+e+"="+s))}pagesStyle(){let e=this.getPages();if(this.selected+1>e-1?jQuery(this.nextPageElem).parents("li").addClass("cdp-separator-dis").addClass("off-clicks").parents(".right").css({cursor:"not-allowed"}):jQuery(this.nextPageElem).parents("li").removeClass("cdp-separator-dis").removeClass("off-clicks").parents(".right").css({cursor:""}),0===this.selected?jQuery(this.prevPageElem).parents("li").addClass("cdp-separator-dis").addClass("off-clicks").parents(".left").css({cursor:"not-allowed"}):jQuery(this.prevPageElem).parents("li").removeClass("cdp-separator-dis").removeClass("off-clicks").parents(".left").css({cursor:""}),this.pagesElems.hide(),this.pagesElems.eq(0).show(),e>=2){this.pagesElems.eq(-1).show();let s=parseInt(jQuery(this.pagiElem+" .pagination-pages").find(".active a").attr("data-page"));s-1!=-1&&this.pagesElems.eq(s-1).show(),s+1!==e&&this.pagesElems.eq(s+1).show(),this.pagesElems.eq(s).show(),e>3?(this.pagesElems.eq(1).is(":hidden")?jQuery(this.dataSeparators[0]).removeClass("cdp-hide"):jQuery(this.dataSeparators[0]).addClass("cdp-hide"),this.pagesElems.eq(-2).is(":hidden")?jQuery(this.dataSeparators[1]).removeClass("cdp-hide"):jQuery(this.dataSeparators[1]).addClass("cdp-hide")):(jQuery(this.dataSeparators[0]).addClass("cdp-hide"),jQuery(this.dataSeparators[1]).addClass("cdp-hide")),0==this.selected&&jQuery(this.dataSeparators[0]).addClass("cdp-hide")}else jQuery(this.dataSeparators[0]).addClass("cdp-hide"),jQuery(this.dataSeparators[1]).addClass("cdp-hide")}getPages(){return this.pages=Math.ceil(this.rows.length/this.itemsOnPage),Math.ceil(this.rows.length/this.itemsOnPage)}showElements(e=null){jQuery(this.rows).hide(),null!==e&&(this.selected=e);for(let e=this.selected*this.itemsOnPage,s=0;e<this.rows.length&&s<this.itemsOnPage;e++,s++)jQuery(this.rows[e]).show()}refresh(){let e=this.pages,s=this.selected===this.pages-1;this.table.find('[data-empty-info="true"]').remove(),this.rows=this.loadRows(),this.pages=Math.ceil(this.rows.length/this.itemsOnPage),jQuery(".cdp-d-sel-all-con").length>0&&jQuery('[data-box="cdp-tabox-manual"]').hasClass("cdp-tab-active")&&(1==this.pages?jQuery(".cdp-d-sel-all-con").css({visibility:"hidden"}):jQuery(".cdp-d-sel-all-con").css({visibility:""})),this.showElements(this.selected),this.generatePagination(!0),this.handleClicks(!0),this.pagesStyle(),0===this.rows.length?this.firstPage():s&&e>this.pages&&this.lastPage(),0===this.rows.length?(this.table.find('tbody tr[data-ignore="true"]').hide(),this.table.find("tbody").append('<tr data-ignore="true" data-empty-info="true"><td colspan="100%">'+this.emptylist+"</td></tr>")):this.table.find('tbody tr[data-ignore="true"]').hide(),jQuery(this.pagiElem+"-ilosc-wynikow").text(this.rows.length),jQuery(".cdp-d-section").length>0&&"0"!=jQuery("#cdp-d-table-pagi-ilosc-wynikow").text()&&(jQuery(".cdp-not-yet-search").is(":visible")&&(jQuery(".cdp-d-section").css({"max-height":"",height:""}),jQuery(".cdp-d-section").css({"max-height":jQuery(".cdp-d-section").height()})),jQuery("#cdp-redi-table").is(":visible")&&jQuery(".cdp-d-section").css({"max-height":"",height:""}))}lastPage(){this.changePage(this.pages-1)}firstPage(){this.changePage(0)}changePageSize(e=1){!isNaN(parseInt(e))&&parseInt(e)>=1&&(this.itemsOnPage=parseInt(e),this.refresh())}}
|
assets/js/cdp.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function cdp_tooltips_update_content(){if(jQuery("select").niceSelect("update"),!(void 0!==jQuery.cdp&&void 0!==jQuery.cdp.isPremium)||!jQuery.cdp.isPremium()){jQuery(".cdp-premium-in-select").find('.option[data-value="premium"]').addClass("cdp-tooltip-premium disabled"),jQuery(".cdp-option-premium").find('.option[data-value="3"]').addClass("cdp-tooltip-premium disabled"),$prems=jQuery(".cdp-tooltip-premium");for(let t=0;t<$prems.length;t++){let e=$prems[t],o=-15;isNaN(parseInt(jQuery(e).attr("data-top")))||(o=parseInt(jQuery(e).attr("data-top"))),jQuery(e).tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:o,side:"top",content:'This feature will come soon as part of the Premium Plugin. You can <a href="https://sellcodes.com/CylMIdJD" target="_blank">pre-order now</a> at a <b>huge discount</b>.',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0})}jQuery(".cdp-tooltip-premium-dc").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'This feature will come soon as part of the Premium Plugin. You can <a href="https://sellcodes.com/CylMIdJD" target="_blank">pre-order now</a> at a <b>huge discount</b>.',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0})}}function cdp_totally_know_what_i_am_doing(t){if("really"!=t)return"Are you REALLY sure?";console.log("You're crazy! – Here is the output:");let e=jQuery;e("#cdp-purl").val();e.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"debug_function"}).done(t=>{console.log(t),console.log("–––––––––––––- END OF THE DEBUG OUTPUT –––––––––––––- ")})}jQuery(document).ready(function(t){t("#cdp-purl").val();let e=null,o="default",i=null,c=null,n=null,d=null,p=null;const s=void 0!==t.cdp&&void 0!==t.cdp.isPremium;function a(e=null,o=!1){let i=this;"string"==typeof e&&(i=`.${e}`),0!=o&&(i=o),$parent=t(t(i).parents(".cdp-collapsible")[0]),$arrow=$parent.find(".cdp-arrow"),$body=$parent.find(".cdp-collapsible-content"),$title=$parent.find(".cdp-collapsible-title"),$titles=t(".cdp-collapsible-title"),group=$parent.attr("data-cdp-group"),height=$body.prop("scrollHeight"),$oArrows=t(`.cdp-collapsible[data-cdp-group="${group}"]`).not($parent).find(".cdp-arrow"),$oBodies=t(`.cdp-collapsible[data-cdp-group="${group}"]`).not($parent).find(".cdp-collapsible-content"),$body.hasClass("cdp-active")?($body.removeClass("cdp-active"),$titles.removeClass("cdp-active"),$oBodies.removeClass("cdp-active"),$arrow.removeClass("cdp-arrow-down").addClass("cdp-arrow-left"),$body.css({"max-height":""})):($titles.removeClass("cdp-active"),$body.addClass("cdp-active"),$title.addClass("cdp-active"),$oBodies.removeClass("cdp-active"),$arrow.removeClass("cdp-arrow-left").addClass("cdp-arrow-down"),$oArrows.removeClass("cdp-arrow-down").addClass("cdp-arrow-left"),$body.css({"max-height":`${height+30}px`}),$oBodies.css({"max-height":""}))}function l(){let e=t(".cdp-names-prefix").text(),o=t(".cdp-names-suffix").text(),i={year:(c=new Date).getFullYear(),month:("0"+(c.getMonth()+1)).slice(-2),day:c.getDate()<=9?"0"+c.getDate():c.getDate(),hour:c.getHours()<=9?"0"+c.getHours():c.getHours(),minute:c.getMinutes()<=9?"0"+c.getMinutes():c.getMinutes(),second:c.getSeconds()<=9?"0"+c.getSeconds():c.getSeconds(),week:c.getDay()};var c;let n="(blank)"==t(".cdp-togglable-name-b").text()?"":"(Name of original)",d=`${e.trim()} ${n} ${o.trim()}`;d=d.replace(/\[Counter\]/g,"2");let p=t(".cdp-date-picked").val();"1"==p?d=d.replace(/\[CurrentDate\]/g,`${i.month}/${i.day}/${i.year}`):"2"==p?d=d.replace(/\[CurrentDate\]/g,`${i.day}/${i.month}/${i.year}`):"3"==p&&function(e){let o=t(".cdp-custom-date-picking").val();t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"get_formatted_time",format:o}).done(t=>{e(t)}).fail(()=>{e(!1)})}(e=>{d=d.replace(/\[CurrentDate\]/g,`${e}`),t(".cdp-example-name").text(d),d=(d=d.replace(/\[CurrentTime\]/g,`${i.hour}:${i.minute}:${i.second}`)).replace(/\s+/gim," "),t(".cdp-example-name").text(d)}),"3"!=p&&(d=(d=d.replace(/\[CurrentTime\]/g,`${i.hour}:${i.minute}:${i.second}`)).replace(/\s+/gim," "),t(".cdp-example-name").text(d))}function r(e=""){before=t(e).html(),text=t(e).html(),$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],text=text.replace(/\[Counter\]/g,$picks[0]),text=text.replace(/\[CurrentDate\]/g,$picks[2]),text=text.replace(/\[CurrentTime\]/g,$picks[1]),text!=before&&t(e).html(text)}function u(){val=t('.cdp-other-options[name="after_copy"]').val(),2==val?t(".cdp-if-edit-page-selected").show(300):t(".cdp-if-edit-page-selected").is(":hidden")||t(".cdp-if-edit-page-selected").hide(300),setTimeout(()=>{jQuery(".cdp-oth-section").css({"max-height":""}),jQuery(".cdp-oth-section").css({"max-height":jQuery(".cdp-oth-section").height()})},310)}function h(i=!1){let c=t(this).attr("data-cdp-btn");1==i&&(c="copy-quick");let n=["copy-quick","copy-custom","copy-custom-link"],d=t(".cdp-modal-checkboxes").find(".cdp-input-dynamic");if(n.includes(c)){let i={type:c};if(c==n[0]){if(i.times=t(".cdp-modal-input-times-tooltip").val(),i.site=t('.cdp-input-dynamic[name="tooltip-which-site-first"]').val(),i.profile=t('.cdp-input-dynamic[name="tooltip-which-profile-first"]').val(),i.swap="2"==t(".cdp-swap").val()?"true":"false",!i.profile||"custom"==i.profile)return t.cdpNotification("warning","Please select settings for this copy."),void b()}else if(c==n[1]||c==n[2]){i.times=t('.cdp-modal-input-times[name="tooltip-which-times-second"]').val(),i.site=t('.cdp-input-dynamic[name="tooltip-which-site-second"]').val(),i.profile=t('.cdp-input-dynamic[name="tooltip-which-profile-second"]').val(),i.swap="2"==t(".cdp-swap").val()?"true":"false",i.custom={};for(let e=0;e<d.length;++e)i.custom[t(d[e]).attr("name")]=t(d[e]).is(":checked")}if(isNaN(parseInt(i.times))||parseInt(i.times)<=0)return void t.cdpNotification("warning","You need to insert positive number for copies.");i.profile&&!["custom","clear","custom_named"].includes(i.profile)||(i.profile=o),z(),function(e=(()=>{})){window.onbeforeunload=(()=>"Copy in progress..."),$e=t(".cdp-copy-loader-overlay"),$e.is(":hidden")&&($e.show(),$e.animate({opacity:1},300,function(){e(!0)}))}(()=>{t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"copy_post",origin:"tooltip",id:[e],data:i}).done(e=>{b(),t.isJsonString(e)&&(e=t.cdpParse(e)),"error"==e.status?t.cdpNotification("error","Something went wrong and we couldn't copy this post – please try again!"):c==n[2]||void 0!==e.link&&e.link.length>0?"pConv"==e.link?(t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"delete_success_img"}),"-28"==t(".cdp-copy-alert-success").position().top&&t(".cdp-copy-alert-success").animate({top:"32px",opacity:1},300),setTimeout(()=>{"32"==t(".cdp-copy-alert-success").position().top&&t(".cdp-copy-alert-success").animate({top:"-28px",opacity:0},300)},3e3)):window.location.href=e.link:location.reload()}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't copy this post. – See dev console for more info."),b(),console.log(e),console.log(e.responseText)})})}else t.cdpNotification("Couldn't recognize that button, please try again.")}function m(e,i=!1){let c=t('.cdp-input-dynamic[name="tooltip-which-profile-second"]'),n=t(".cdp-modal-checkboxes").find(".cdp-input-dynamic"),d=c.length>1?t(t(c[1])):t(t(c[0]));t(c[1])&&t(c[1])||(null==t(c[1])&&t(c[0])?d=t(t(c[0])):null==t(c[0])&&t(c[1])&&(d=t(t(c[1]))));let p=d.val();0==e&&(p=i),"custom_named"==p?c.val("custom_named"):"custom"==p||null==p||null==p?c.val("custom"):"clear"==p?(0!=e&&e.preventDefault(),n.prop("checked",!1),c.val("custom")):!["clear","custom","custom_named"].includes(p)&&p.length>=1?g(p,function(e){for(let o in e)"object"!=typeof o&&t(`.cdp-input-dynamic[name="${o}"]`).prop("checked",f(e[o]))}):(0!=e&&e.preventDefault(),t.cdpNotification("warning","Unable to recognize selected profile, please try again.")),0==e&&c.val(p),["clear","custom","custom_named"].includes(p)||(o=p),cdp_tooltips_update_content()}function f(t){return"string"==typeof t&&"true"==t.trim().toLowerCase()}function g(e="default",o){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"get_settings",profile:e}).done(e=>{if(t.isJsonString(e)&&(e=t.cdpParse(e)),e.status&&"error_no_exists"==e.status){t.cdpNotification("warning","Profile you selected is just empty, please update this profile or use custom settings!");let e={},i=t(".cdp-modal-option-r");for(let o=0;o<i.length;o++)e[t(i[o]).attr("name")]=t(i[o]).is(":checked");o(!1)}else o(e)}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't get profile settings. – Check console for more details"),console.log("Copy & Delete Post – Error"),console.log(e),console.log("––––––––––––––––––––––––––"),o(!1)})}function y(){t(this).attr("class");let e=parseInt(t(this).val());e<=0&&(e=1),e>9999&&(e=9999),isNaN(e)&&(e=1),e||(e=1),t(".cdp-modal-input-times").val(e),t(".cdp-modal-input-times-tooltip").val(e),e>50?(t(".cdp-error-span-tooltip").show(300),t(".cdp-tooltip-before").attr("style","height: calc(225px - 20px - 16px) !important")):(t(".cdp-error-span-tooltip").hide(300),t(".cdp-tooltip-before").attr("style","")),e>1?(t(".cdp-multiple-tooltip-count").animate({opacity:1},200),t('.cdp-tooltip-btn-copy[data-cdp-btn="copy-custom-link"]').hide()):(t(".cdp-multiple-tooltip-count").animate({opacity:0},200),t('.cdp-tooltip-btn-copy[data-cdp-btn="copy-custom-link"]').show()),setTimeout(()=>{A()},310)}function b(e=(()=>{})){window.onbeforeunload=null,$e=t(".cdp-copy-loader-overlay"),$e.is(":hidden")||$e.animate({opacity:0},300,function(){$e.hide(),e(!0)})}function v(){let e=t(".cdp-profile-selected").val();var o,i;g(e,c=>{if(t.isJsonString(c)||"object"==typeof c){"object"!=typeof c&&(c=JSON.parse(c));let n=["usmplugin","yoast"];for(k in c)"names"==k?(t(".cdp-names-prefix").html(c[k].prefix),t(".cdp-names-suffix").html(c[k].suffix),"3"!=c[k].format||s||(c[k].format="1"),t(".cdp-date-picked").val(c[k].format),t(".cdp-custom-date-picking").val(c[k].custom)):(!n.includes(k)||n.includes(k)&&s&&t.cdp.isPremium())&&t(`.cdp-data-set[data-cdp-opt="${k}"]`).prop("checked","true"==c[k]);cdp_tooltips_update_content(),l(),u(),s&&t.cdp.isPremium()&&t.cdp.premium.detectChangeOfCustom(),_(),r(".cdp-names-prefix"),r(".cdp-names-suffix"),o=e,i=(()=>{}),t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"set_default_profile",selection:o}).done(t=>{i(t)}).fail(()=>{i(!1)})}else t.cdpNotification("warning","There was an error while getting data from server, please try again.")})}function x(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;let e=t(".cdp-input-d-id").length,o=t(".cdp-input-d-id:checked").length;o==e?t(".cdp-d-select-all").text("Deselect all"):t(".cdp-d-select-all").text("Select all"),t(".cdp-t-d-ct").text(o),$visible=t(".cdp-input-d-id:visible").length,$visible_checked=t(".cdp-input-d-id:checked:visible").length,$visible==$visible_checked?t(".cdp-d-checkbox-all").prop("checked",!0):t(".cdp-d-checkbox-all").prop("checked",!1),function(){let e=t(".cdp-input-d-id").parents("tr"),o=t(".cdp-input-d-id:checked").parents("tr");e.removeClass("cdp-del"),o.addClass("cdp-del")}()}function w(e){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"give_me_current_tasks"}).done(o=>{t.isJsonString(o)&&(o=t.cdpParse(o)),"success"==o.status&&e(o.tasks)})}function $(e){let o=0,i=+new Date/1e3,c=t(".cdp-dd-item");for(let i=0;i<c.length;++i){e[t(c[i]).attr("data-token")]||t(c[i]).remove(),o++}for(task in e){let c=e[task],n=t(t(`.cdp-dd-item[data-token="${task}"]`)[0]);if(0==c.done){if(n.hasClass("cdp-dd-ud"))continue;{n.remove();let e=i-c.done>=86400;t(".cdp-dd-undone-list").append(D(c.shown,task,e,c.f)),o++}}else{if(n.hasClass("cdp-dd-d"))continue;n.remove(),t(".cdp-dd-done-list").append(P(c.shown,task,c.f)),o++}}(o>0||0==c.length)&&function(){let e=t(".cdp-dd-item").length,o=t(".cdp-dd-d").length,i=t(".cdp-dd-ud").length;o<=0?(t(".cdp-done-notis, .cdp-done-notis").addClass("cdp-noti-hide"),t(".cdp-done-hr").hide()):(t(".cdp-done-notis, .cdp-done-notis").removeClass("cdp-noti-hide"),t(".cdp-done-hr").show()),i<=0?(t(".cdp-undone-notis, .cdp-undone-notis").addClass("cdp-noti-hide"),t(".cdp-undone-hr").hide()):(t(".cdp-undone-notis, .cdp-undone-notis").removeClass("cdp-noti-hide"),t(".cdp-undone-hr").show()),e<=0?t(".cdp-admin-bar-noti").addClass("cdp-noti-hide"):t(".cdp-admin-bar-noti").removeClass("cdp-noti-hide"),t(".cdp-notis-counter").text(t(".cdp-bnew-notis").length)}()}function _(){$trs=t(".cdp-table tbody.cdp-ff-b1").find("tr");for(let e=0;e<$trs.length;e++){let o=t($trs[e]);o.find("input").is(":checked")?o.addClass("cdp-selected-tr-opt"):o.removeClass("cdp-selected-tr-opt")}}function C(e){if(t(".cdp-modal").is(":visible"))return;let o=window;0!=t("#wpbody").scrollTop()&&(o="#wpbody");let i=t(o).scrollTop()+2;i<=0&&(i=2),"click"!=e.type&&t(".nice-select, .nice-select .list").css({transition:"all 0s"}),t(".nice-select .list").css({"margin-top":`${-i}px`}),clearTimeout(d),d=setTimeout(()=>{t(".nice-select .list").css({transition:""})},100),clearTimeout(n),n=setTimeout(()=>{let i=t(o).scrollTop()+2;i<=0&&(i=2),"click"!=e.type&&t(".nice-select .list").css({transition:"all 0s !important"}),t(".nice-select .list").css({"margin-top":`${-i}px`}),clearTimeout(d),d=setTimeout(()=>{t(".nice-select .list").css({transition:""})},100)},100)}function T(){let e=t('.cdp-d-option[name="cdp-d-b-title"]').is(":checked"),o=t('.cdp-d-option[name="cdp-d-b-slug"]').is(":checked");e||o?t(".cdp-no-empty-text").html("<b>including</b> empty"):t(".cdp-no-empty-text").html("only if <u><b>not</b></u> empty")}function j(e){e.preventDefault(),$parent=t(this).parents(".cdp-collapsible"),$col=t(t($parent[0]).find(".cdp-collapsible-title")[0]),a("true",$col)}t(".cdp-intro-button").on("click",function(){let e=t(".cdp-intro").height();t(".cdp-intro").css({height:e+"px"}),t(".cdp-intro").animate({opacity:0,height:0},300,function(){t(".cdp-intro").hide(10),t("#cdp-never-intro").is(":checked")&&t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"no_intro"}).done(e=>{"error"==e&&t.cdpNotification("error","Something went wrong and we couldn't save intro settings!")}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't save intro settings.")})}),t(".cdp-s-i-a").show(),t(".cdp-s-i-a").animate({opacity:1},300)}),t(".cdp-save-options").on("click",function(){let e=t(".cdp-data-set"),o=t(".cdp-other-inputs"),i=t(".cdp-profile-selected").val(),c=t(".cdp-names-prefix").text().replace(/\s+/g," ").trim(),n=t(".cdp-names-suffix").text().replace(/\s+/g," ").trim(),d={names:{prefix:c,suffix:n,format:t(".cdp-date-picked").val(),custom:t(".cdp-custom-date-picking").val(),display:t(t(`option[value="${t(".cdp-profile-selected").val()}"]`)[0]).text()}},p={afterCopy:t('.cdp-other-options[name="after_copy"]').val(),postConverter:t('.cdp-other-options[name="post_converter"]').val(),others:{}},s={},a=t(".cdp-other-roles");for(let e=0;e<a.length;e++)s[t(a[e]).attr("name")]=t(a[e]).is(":checked");p.roles=s;for(let o=0;o<e.length;o++)d[t(e[o]).attr("data-cdp-opt")]=!!t(e[o]).is(":checked");for(let e=0;e<o.length;e++)p.others[t(o[e]).attr("name")]=!!t(o[e]).is(":checked");t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"save_options",options:d,profile:i,entire:p}).done(e=>{"success"==e?t.cdpNotification("success","All your settings were saved!",2e3):"error"==e?t.cdpNotification("error","Something went wrong and we couldn't save your settings."):t.cdpNotification("success","All your settings were saved!",2e3)}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't save your settings. – Please check console for more info."),console.log(e)})}),t("#cdp-show-into-again").on("click",function(){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"intro_again"}).done(e=>{"error"==e&&t.cdpNotification("error","Something went wrong and we couldn't update intro settings – try again!")}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't update intro settings. – Please check console for more info.")}),t(".cdp-s-i-a").animate({opacity:0},300,function(){t(".cdp-s-i-a").hide()}),function(){t(".cdp-intro").show().css({height:""});let e=t(".cdp-intro").height();t(".cdp-intro").css({height:"0px"}),t(".cdp-intro").animate({opacity:1,height:e+"px"},300,function(){})}()}),t(".cdp-show-projects").on("click",function(){t(".cdp-projects").is(":hidden")&&t(".cdp-projects").show(300);t(".cdp-show-projects").removeClass("cdp-pointer").animate({opacity:.5},300)}),t(".cdp-project-box").on("mouseenter",function(){t(".cdp-project-box").not(t(this)).addClass("cdp-half-opacity")}),t(".cdp-project-box").on("mouseleave",function(){t(".cdp-project-box").removeClass("cdp-half-opacity")}),t(".cdp-collapsible-title").on("click",a),t(".cdp-magic-input").on("keyup change",function(){before=t(this).html(),text=t(this).html(),$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],text=text.replace(/\[Counter\]/g,$picks[0]),text=text.replace(/\[CurrentDate\]/g,$picks[2]),text=text.replace(/\[CurrentTime\]/g,$picks[1]),text!=before&&t(this).html(text)}),t(".cdp-magic-input").on("focus",function(e,o){if(o)return;let i=t(this).text();" "!=i[0]&&(i=" "+i);" "!=i[i.length-1]&&(i+=" ");t(this).html(i),r(this)}),t(".cdp-magic-input").on("mouseup",".cdp-name-box-small",function(){t(this).hide(300),setTimeout(()=>{t(this).remove(),l()},300)}),t(".cdp-support-animated").on("mouseenter",function(){t(".cdp-support-animated").not(t(this)).addClass("cdp-half-opacity")}),t(".cdp-name-clickable").on("mouseup",function(e){if(e.preventDefault(),$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],$box={1:".cdp-names-prefix",2:".cdp-names-real-input",3:".cdp-names-suffix"},t($box[e.which]).append($picks[t(this).attr("data-cdp-val")]),l(),e.which==e)return!1}),t(".cdp-support-animated").on("mouseleave",function(){t(".cdp-support-animated").removeClass("cdp-half-opacity")}),t("body").on("change keyup",".cdp-input-dynamic",function(){$input=t(t(".cdp-tooltip-content, .cdp-modal-content").find(`[name="${t(this).attr("name")}"]`)),"checkbox"==t(this).attr("type")?$input.prop("checked",t(this).is(":checked")):t($input).is("select")?($input.val(t(this).val()),t($input).hasClass("cdp-modal-input-profiles-r")&&m(!1,t(this).val())):$input.val(t(this).val());cdp_tooltips_update_content()}),t(".cdp-names-real-input, .cdp-date-picked").on("keyup change",l),t('.cdp-other-options[name="after_copy"]').on("change",u),t("body").on("click",".cdp-tooltip-before-button",function(){let e=t('.cdp-input-dynamic[name="tooltip-which-profile-first"]').val();"custom"!=e&&m(!1,e);t(".cdp-tooltip-before-options").hide(200),setTimeout(()=>{t(".cdp-tooltip-full-options").show(200),setTimeout(()=>{A()},200)},200)}),t("body").on("click",".cdp-tooltip-btn-copy",h),t("body").on("change",'.cdp-input-dynamic[name="tooltip-which-profile-second"]',m),t("body").on("change",'.cdp-input-dynamic[name="tooltip-which-profile-first"]',function(){m(!1,t(this).val())}),t("body").on("change",".cdp-modal-checkboxes .cdp-input-dynamic",function(){t('.cdp-input-dynamic[name="tooltip-which-profile-second"]').val("custom_named"),cdp_tooltips_update_content(),m(!1,"custom_named")}),t("body").on("change",".cdp-modal-input-times-tooltip",y),t("body").on("change",".cdp-modal-input-times",y),t("body").on("click",".cdp-modal-times, .cdp-modal",t.cdpModalClose),t("body").on("click",".cdp-modal-open",t.cdpModal),t("body").on("change",".cdp-profile-selected",v),t("body").on("click",".cdp-show-more-d-title",function(e){e.preventDefault(),t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-more-d-title").is(":hidden")?(t(".cdp-more-d-title").show(300),t(this).text("(hide more options)")):(t(".cdp-more-d-title").hide(300),t(this).text("(show more options)"));setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("change",".cdp-d-first-chapter-cb",function(){t(".cdp-d-section").css({"max-height":"",height:""});let e=t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked")+0,o=t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked")+0,i=t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked")+0;e+o+i>1?t(".cdp-d-option-select-parent").show(300):t(".cdp-d-option-select-parent").hide(300);setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("click",".cdp-d-search",function(){let e=t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked")?1:0,o=t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked")?1:0,n=t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked")?1:0;e+o+n<=0?t.cdpNotification("error","Please, check for: which duplicates you are looking for"):null==c?function(e=function(){}){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"get_all_posts"}).done(o=>{t.isJsonString(o)&&(o=t.cdpParse(o)),e(o)}).fail(o=>{t.cdpNotification("error","Something went wrong and we couldn't get post list. – Please check console for more info."),console.log(o),e(!1)})}(t=>{0!=t&&p(t)}):p(c);function d(t,e){let o=parseInt(e[e.length-1]);for(let i=e.length;i>=0&&(o=parseInt(e[i-1]),ext=!1,t.posts.findIndex(t=>t.ID==o)>=0?ext=!0:t.pages.findIndex(t=>t.ID==o)>=0?ext=!0:t.custom.findIndex(t=>t.ID==o)>=0?ext=!0:o=!1,1!=ext);--i);return o}function p(e){let o={posts:[],pages:[],custom:[]},n={},p={};null!=c&&(o=c);let l=!!t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked"),r=!!t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked"),u=!!t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked"),h=!!t('.cdp-d-option[name="cdp-d-b-title"]').is(":checked"),m=!!t('.cdp-d-option[name="cdp-d-b-slug"]').is(":checked"),f=!!t('.cdp-d-option[name="cdp-d-c-excerpt"]').is(":checked"),g=!!t('.cdp-d-option[name="cdp-d-c-count"]').is(":checked"),y=t('.cdp-d-option-select[name="cdp-d-d-sel-which"]').val(),b=null,v=null;if(l+r+u>1&&(b=t('.cdp-d-option-select[name="cdp-d-sels-diftyp"]').val()),1==h&&(v="1"==t('.cdp-d-option[name="cdp-radio-btn-dtitles"]:checked').val()),null==c)for(post_type in e)if("meta"!=post_type)for(post in e[post_type]){post=e[post_type][post],post.post_type=post.post_type[0].toUpperCase()+post.post_type.slice(1);let t=e.meta[post.ID]._cdp_origin,i=e.meta[post.ID]._cdp_counter,c={id:post.ID,url:post.guid,slug:post.post_name,type:post.post_type,date:post.post_date,title:post.post_title,edit:post.post_modified,excerpt:post.post_excerpt,words:a(s(post.post_content)),origin:"object"==typeof t&&d(e,t),counter:"object"==typeof i&&i[i.length-1]};if(1301==c.id&&console.log(c,t),"object"==typeof t){let e=parseInt(t[t.length-1]);void 0===p[e]?p[e]=1:p[e]++}o[post_type].push(c)}o=function(t){let e=JSON.parse(JSON.stringify(t));return e.posts.sort((t,e)=>!1===t.origin?-1:!1===e.origin?1:0),e.pages.sort((t,e)=>!1===t.origin?-1:!1===e.origin?1:0),e.custom.sort((t,e)=>!1===t.origin?-1:!1===e.origin?1:0),e}(o),null==c&&(c=o);let k=[],w=[];if("2"==b){let t=[],e=[],i=[];1==l&&(t=o.posts),1==r&&(e=o.pages),1==u&&(i=o.custom),k=(k=[].concat(t,e,i)).sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),w=$(k)}else{let t=[],e=[],i=[];o.posts=o.posts.sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),1==l&&(t=$(o.posts)),o.pages=o.pages.sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),1==r&&(e=$(o.pages)),o.custom=o.custom.sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),1==u&&(i=$(o.custom)),w=[].concat(t,e,i)}function $(t){let e=[],o=[],i=!(h||m||f||g);if(!t)return e;for(let e=0;e<t.length;e++){let n=t[e];if(!o.includes(n.id))for(let d=i?0:e;d<t.length;d++){if(!t[d])continue;if(o.includes(t[d].id))continue;if(d==e)continue;let p=1==h&&(n.title==t[d].title||1==v&&n.id==t[d].origin&&t[d].date==t[d].edit),s=1==m&&I(n.slug,t[d].slug)>=.85,a=!1;a=1==p||1==s?1==f&&(""==n.excerpt||n.excerpt==t[d].excerpt):1==f&&""!=n.excerpt&&n.excerpt==t[d].excerpt;let l=1==g&&n.words==t[d].words,r=1==i&&n.id==t[d].origin&&t.findIndex(e=>e.origin==t[d].id)<=-1;!p&&h||!s&&m||!a&&f||!l&&g||!r&&i||(c(n,!0,!1),c(t[d],!1,n.id))}}function c(t,i=!1,c=!1){o.includes(t.id)||(1==i?n[t.id]=[]:0!=c&&n[c].push(t.id),o.push(t.id),e.push(t))}return e}for(post in $tbody=t("#cdp-d-table-tbody"),$tbody.html(""),w)$tbody.append((_=w[post],t(`<tr data-id="${_.id}">\n <td><input type="checkbox" id="cdp_in_${_.id}" class="cdp-input-d-id" name="${_.id}"/></td>\n <td><label for="cdp_in_${_.id}">${_.title}</label></td>\n <td><a href="${_.url}" target="_blank">${""!=_.slug?_.slug:_.url}</a></td>\n <td>${_.type}</td>\n <td>${_.date.slice(0,-8)}</td>\n <td>${_.words}</td>\n </tr>`)));var _;if("1"==y)for(parent in n)for(child in n[parent])t(`.cdp-input-d-id[name="${n[parent][child]}"]`).prop("checked",!0);else if("2"==y)for(parent in n){t(`.cdp-input-d-id[name="${parent}"]`).prop("checked",!0);let e=Math.max(...n[parent]);for(child in n[parent])n[parent][child]!=e&&t(`.cdp-input-d-id[name="${n[parent][child]}"]`).prop("checked",!0)}else"3"==y&&t(".cdp-input-d-id").prop("checked",!0);let C=!(h||m||f||g),T=t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked")+0,j=t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked")+0,D=t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked")+0;C&&T+j+D>0&&w.length>0?(t("#cdp-d-table-tbody").find("tr").attr("data-ignore",!0),i.refresh(),t(".cdp-delete-info").hide(300),t('[data-empty-info="true"]').find("div").html('You did not select any filter.<br>Click <a href="#" class="cdp-show-the-copies">here</a> to show all copies (of the selected post type) made by this plugin.'),t('[data-empty-info="true"]').addClass("cdp-customized")):i.refresh(),t(".cdp-d-searchbox-c").val(""),x(),0==w.length?(t.cdpNotification("warning","No posts/pages meeting the current filter conditions."),t(".cdp-delete-info").hide(300)):t(".cdp-not-yet-search").is(":visible")||(t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-not-yet-search").show(300),t('[data-empty-info="true"]').hasClass("cdp-customized")||t(".cdp-delete-info").show(300),setTimeout(()=>{t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-d-section").css({"max-height":`${t(".cdp-d-section").height()}px`})},320))}function s(t){return(t=(t=(t=t.replace(/\<\!\-\-(.*?)\-\-\>/gim,"")).replace(/<[^>]*>/gim," ")).replace(/\s+/gim," ")).trim()}function a(t){return(t=t.split(" ")).length}}),t("body").on("change",".cdp-input-d-id",function(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;let e=parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text()),o=parseInt(t(".cdp-t-d-ct").text());t(this).is(":checked")?(o++,t(this).parents("tr").addClass("cdp-del")):(o--,t(this).parents("tr").removeClass("cdp-del"));if(t(".cdp-t-d-ct").text(o),o==e)t(".cdp-d-select-all").text("Deselect all"),t(".cdp-d-checkbox-all").prop("checked",!0);else{t(".cdp-d-select-all").text("Select all");let e=t(".cdp-input-d-id:visible");for(let o=0;o<e.length;++o){if(!t(e[o]).is(":checked")){t(".cdp-d-checkbox-all").prop("checked",!1);break}o==e.length-1&&t(".cdp-d-checkbox-all").prop("checked",!0)}}}),t("body").on("change",".cdp-d-checkbox-all",function(e){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return e.preventDefault(),void t(this).prop("checked",!1);let o=parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text()),i=t(".cdp-d-checkbox-all").is(":checked"),c=t(".cdp-input-d-id:visible"),n=0;for(let e=0;e<c.length;++e)t(c[e]).is(":checked")&&!i?n--:!t(c[e]).is(":checked")&&i&&n++,t(c[e]).prop("checked",i);let d=parseInt(t(".cdp-t-d-ct").text())+n;t(".cdp-t-d-ct").text(d),d==o?t(".cdp-d-select-all").text("Deselect all"):t(".cdp-d-select-all").text("Select all");let p=t(".cdp-input-d-id:visible").parents("tr"),s=t(".cdp-input-d-id:visible:checked").parents("tr");p.removeClass("cdp-del"),s.addClass("cdp-del")}),t("body").on("click",".cdp-d-select-all",function(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;let e=parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text()),o=parseInt(t(".cdp-t-d-ct").text()),i=!0;e==o&&(i=!1);$chbs=t(".cdp-input-d-id");for(let e=0;e<$chbs.length;++e)t($chbs[e]).prop("checked",i);t(".cdp-t-d-ct").text(1==i?e:"0"),0==i?(t(".cdp-d-select-all").text("Select all"),t(".cdp-d-checkbox-all").prop("checked",!1),t(".cdp-input-d-id").parents("tr").removeClass("cdp-del")):(t(".cdp-d-checkbox-all").prop("checked",!0),t(".cdp-d-select-all").text("Deselect all"),t(".cdp-input-d-id").parents("tr").addClass("cdp-del"))}),t("body").on("click",".prev_page, .next_page, .page_link",function(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;t(".cdp-input-d-id:visible:checked").length==t(".cdp-input-d-id:visible").length?t(".cdp-d-checkbox-all").prop("checked",!0):t(".cdp-d-checkbox-all").prop("checked",!1)}),t("body").on("click",".cdp-d-real-delete",function e(o=!1,n=null,d=0){if(!t(".cdp-d-just-check-it").is(":checked"))return void t.cdpNotification("warning","Please check that you completed all steps, before this task!");let p=[];if(null===n){let e=t(".cdp-input-d-id:checked");for(let o=0;o<e.length;++o)p.push(parseInt(t(e[o]).attr("name")));if(0==p.length)return void t.cdpNotification("warning","Nothing to do here, please select at least one post to delete.")}else p=n;let s=t(".cdp-d-throttling").val(),l=t(".cdp-d-throttling-count").val(),r=t(".cdp-p-redirections").val(),u=!!t(".cdp-p-just-trash-them").is(":checked");if("1"==s&&(!l||0==l||""==l))return void t.cdpNotification("warning","You have wrong count in throttling field, please fix.");if(p.length>801&&!0!==o){let t=Math.ceil(p.length/800);for(let o=0,i=!0;o<t;++o)o==t-1&&(i=!1),e(i,p.slice(800*o,800*o+800),o);return}t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"delete_them",ids:p,throttling:s,thc:l,redi:r,thrs:u}).done(e=>{if(t.isJsonString(e)&&(e=t.cdpParse(e)),"success"==e.status){t("#cdp-d-table-tbody").find(".cdp-del").remove();let e=c.posts.filter(t=>!p.includes(t.id)),n=c.pages.filter(t=>!p.includes(t.id)),s=c.custom.filter(t=>!p.includes(t.id));c={posts:e,pages:n,custom:s},!0!==o&&i.refresh(),x(),0==d&&t.cdpNotification("success","Deletion process started, you can close this page now and wait till the process ends!"),w($),!0!==o&&($parent=t(".cdp-d-section").parents(".cdp-collapsible"),$col=t(t($parent[0]).find(".cdp-collapsible-title")[0]),a("true",$col))}else!0!==o&&t.cdpNotification("error",`Something went wrong and we couldn't setup the deletion task. ${"1"==s?"– Please try without throttling.":""}`)}).fail(e=>{!0!==o&&t.cdpNotification("error","Something went wrong and we couldn't setup the deletion task. – Please check console for more info."),console.log(e)})}),t("body").on("change",".cdp-d-throttling",function(){t(".cdp-d-section").css({"max-height":"",height:""}),"1"==t(this).val()?t(".cdp-d-throttling-count-p, .cdp-even-more-th-info").show(300):t(".cdp-d-throttling-count-p, .cdp-even-more-th-info").hide(300);setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("change",".cdp-d-throttling-count",function(){let e=parseInt(t(this).val());isNaN(e)?t(this).val(1):e>=1&&e<=10240?e>=1&&e<=1&&t(this).val(1):e<1?t(this).val(1):t(this).val(10240)}),t("body").on("change",".cdp-custom-date-picking",l),t("body").on("mouseover",".cdp-tooltip-copy",function(){t(this).hasClass("tooltipstered")||(t(this).tooltipster({delay:100,timer:400,debug:!1,delayTouch:[100,200],interactive:!0,distance:4,side:"bottom",contentAsHTML:!0,content:t(".cdp-tooltip-content").html(),repositionOnScroll:!0,selfDestruction:!1,trigger:"custom",triggerOpen:{mouseenter:!0,touchstart:!0},triggerClose:{mouseleave:!0,click:!0,tap:!0},functionBefore:S,functionReady:N,functionAfter:Q,functionFormat:M}),t(this).tooltipster("open"))}),t("body").on("keyup",".cdp-d-searchbox-c",function(){if(t('[data-empty-info="true"].cdp-customized').length>0)return;let e=t(this).val();e.length>100&&(e=e.substr(0,100));if(e=(e=e.trim().replace(/\s+/gim," ").toLowerCase()).split(" "),$trs=t("#cdp-d-table-tbody").find("tr"),$trs.length<=0)return;$trs.removeAttr("data-ignore");for(let o=0;o<$trs.length;++o){$tr=t($trs[o]),$title=t($tr.find("td")[1]).text().toLowerCase(),$url=t($tr.find("td")[2]).text().toLowerCase();let i=!1;for(let t=0;t<e.length;++t)if($title.includes(e[t]))i=!0;else{if(!$url.includes(e[t])){i=!1;break}i=!0}0==i&&$tr.attr("data-ignore","true")}clearTimeout(p),p=setTimeout(()=>{i.refresh()},20)}),t("body").on("change",".cdp-data-set",_),t("#wpbody").on("scroll",C),t(window).on("scroll",C),t("body").on("click",".nice-select",C),t("body").on("click",".cdp-show-the-copies",function(e){e.preventDefault(),t(".cdp-d-section").css({"max-height":"",height:""}),t("#cdp-d-table-tbody").find("tr").not('[data-empty-info="true"]').removeAttr("data-ignore"),t(".cdp-d-searchbox-c").val(""),t('[data-empty-info="true"]').addClass("cdp-customized"),i.refresh(),x(),parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text())>0&&t(".cdp-delete-info").show(300);t(".cdp-not-yet-search").is(":visible")||(t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-not-yet-search").show(300),t('[data-empty-info="true"]').hasClass("cdp-customized")||t(".cdp-delete-info").show(300));setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("change",".cdp-per-page-select-show",function(){let e=t(this).val();i.changePageSize(e)}),t("body").on("change",'.cdp-d-option[name="cdp-d-b-title"]',T),t("body").on("change",'.cdp-d-option[name="cdp-d-b-slug"]',T),t("body").on("click",".cdp-tab-element",function(){if(t(this).hasClass("cdp-tab-active"))return;if("true"==t(this).attr("data-disabled"))return;let e=t(t(`#${t(this).attr("data-box")}`)[0]),o=t(t(`#${t(".cdp-tab-active").attr("data-box")}`)[0]);if(!e||e.length<=0)return;t(".cdp-tab-active").removeClass("cdp-tab-active"),t(this).addClass("cdp-tab-active"),e.show(),e.css({"max-height":"",height:""});let i=e.height();e.css({"max-height":"0px",opacity:0}),e.animate({"max-height":i+"px",opacity:1},500,function(){let e=t(".cdp-d-section").height();t(".cdp-d-section").css({height:e+"px","max-height":e+"px"})}),t(".cdp-d-section").css({height:"","max-height":""}),o.css({"max-height":o.height()+"px",opacity:1}),o.animate({"max-height":"0px",opacity:0},500,function(){o.hide()}),setTimeout(()=>{o.css({"max-height":"",height:""}),e.css({"max-height":"",height:""})},510);let c=parseInt(t(window).height()/8);t("#wpbody").animate({scrollTop:jQuery(".cdp-d-section")[0].offsetTop-c},500)}),t("body").on("click",".cdp-premium-element",function(t){t.preventDefault()}),t("body").on("click",".cdp-go-to-names-chapter",function(e){e.preventDefault(),z(),a("cdp-name-section-cnx"),setTimeout(()=>{let e=parseInt(t(window).height()/4);t("#wpbody").animate({scrollTop:t(".cdp-name-section-cnx")[0].offsetTop-e},500)},400)}),t("body").on("click",".cdp-close-chapter",j),t("body").on("click",".cdp-save-options",j),t("body").on("click",".cdp-togglable-name-b",function(){"(Name of original)"==t(".cdp-togglable-name-b").text()?(t(".cdp-togglable-name-b").text("(blank)"),t(".cdp-togglable-name-b").tooltipster("content","Change it to (Name of original)")):(t(".cdp-togglable-name-b").text("(Name of original)"),t(".cdp-togglable-name-b").tooltipster("content","Change it to blank"));l()}),t(".cdp-select").niceSelect(),t(".cdp-tooltip").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:4,side:"top",contentAsHTML:!0,maxWidth:600,theme:["tooltipster-noir","tooltipster-noir-customized"],repositionOnScroll:!0}),t(".cdp-tooltip-top").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:6,side:"top",contentAsHTML:!0,maxWidth:400,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-center"],repositionOnScroll:!0}),t("#cdp-d-table").length>0&&(i=new IcPagination(t("#cdp-d-table"),"#cdp-d-table-pagi",{itemsOnPage:25,useParams:!1,emptylist:'<div class="cdp-center">No items to show, try with other filters!</div>'})),t(".cdp-copy-button").on("mouseup",function(){h(!0)});let D=(e,o,i,c)=>t(`<a class="ab-item cdp-dropdown-menu cdp-dd-item cdp-dd-ud${0==e?" cdp-bnew-notis":""}" data-token="${o}">\n <div style="display: block; width: calc(100% - 3px);">\n <div class="cdp-dropdown-left${1==i?" cdp-red":""}">${"delete"==c?"Deleting Posts":"Copying Posts"}</div>\n <div class="cdp-dropdown-right cdp-noti-kill-btn">Kill</div>\n </div>\n </a>`),P=(e,o,i)=>t(`<a class="ab-item cdp-dropdown-menu cdp-dd-item cdp-dd-d${0==e?" cdp-bnew-notis":""}" data-token="${o}">\n <div style="display: block; width: calc(100% - 3px);">\n <div class="cdp-dropdown-left">${"delete"==i?"Deleting Posts":"Copying Posts"}</div>\n <div class="cdp-dropdown-right cdp-noti-hide-btn">Hide</div>\n </div>\n </a>`);function I(t,e){let o=t,i=e;t.length<e.length&&(o=e,i=t);let c=o.length;return 0==c?1:(c-function(t,e){t=t.toLowerCase(),e=e.toLowerCase();let o=new Array;for(let i=0;i<=t.length;i++){let c=i;for(let n=0;n<=e.length;n++)if(0==i)o[n]=n;else if(n>0){let d=o[n-1];t.charAt(i-1)!=e.charAt(n-1)&&(d=Math.min(Math.min(d,c),o[n])+1),o[n-1]=c,c=d}i>0&&(o[e.length]=c)}return o[e.length]}(o,i))/parseFloat(c)}function S(o,i){z(!0),t(".cdp-tooltip-before-options").show(),t(".cdp-tooltip-full-options").hide(),$inputs=t(t(".cdp-tooltip-content").find("input, select"));for(let e=0;e<$inputs.length;++e){let o=t($inputs[e]);if("checkbox"==o.attr("type"))o.is(":checked")?o.attr("checked","checked"):o.removeAttr("checked");else if(t(o).is("select"))if("tooltip-which-profile-first"==t(o).attr("name")){let e=t(t('[name="tooltip-which-profile-first"]')[0]).val();"custom"==e||null==e?setTimeout(()=>{t('[name="tooltip-which-profile-first"]').val("custom")},50):setTimeout(()=>{t('[name="tooltip-which-profile-first"]').val(e)},50)}else{let e=t('[name="tooltip-which-profile-second"] option:selected').map(function(t,e){return this.value}).get()[0];"custom"==e||null==e?setTimeout(()=>{t('[name="tooltip-which-profile-second"]').val("custom")},50):setTimeout(()=>{t('[name="tooltip-which-profile-second"]').val(e)},50)}else o.attr("value",o.val())}return cdp_tooltips_update_content(),e=t(i.origin).attr("data-cdp-id"),!0}function N(e,o){$parent=t(o.origin).parents(".row-actions"),$parent.css({left:0});let i=t(t("a.menu-top.toplevel_page_copy-delete-posts")[0]).attr("href");t(".cdp-tooltip-info-intt").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:6,side:"top",contentAsHTML:!0,content:`Define your copy settings <a href="${i}">here</a>.`,maxWidth:400,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-center"],repositionOnScroll:!0}),s&&jQuery.cdp.isPremium()?t(".cdp-tooltip-premium-spc-3").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:"If you’re on a multisite you can copy it to other sites.",contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}):(t(".cdp-tooltip-premium-spc-2").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'If you’re on a multisite you can copy it to other sites with the Premium Plugin. <a href="https://sellcodes.com/CylMIdJD" target="_blank">Pre-order it now</a>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),t(".cdp-tooltip-premium-spc").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'This feature will come soon as part of the Premium Plugin. You can <a href="https://sellcodes.com/CylMIdJD" target="_blank">pre-order now</a> at a <b>huge discount</b>.',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),t(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").addClass("cdp-premium-element"),t(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").find("input, select").prop("disabled",!0),t(".cdp-tooltip-premium-spc-4").tooltipster("content",'You can copy it to other sites with the Premium Plugin.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Pre-order it now</a>'),cdp_tooltips_update_content())}function Q(e,o){return $parent=t(o.origin).parents(".row-actions"),$parent.css({left:""}),!1}function M(){return t(t(".cdp-tooltip-content").html())}function A(){setTimeout(()=>{let e=t.tooltipster.instances();for(instance in e)e[instance].reposition()},10)}function z(e=!1){if(e){let e=t.tooltipster.instances();for(instance in e)e[instance].close()}else setTimeout(()=>{let e=t.tooltipster.instances();for(instance in e)e[instance].close()},10)}if(t(".cdp-admin-bar-noti").length>0&&setInterval(w($),7e3),t(".cdp-drag-name").draggable({containment:".cdp-drags-cont",scroll:!1,helper:"clone",revert:"invalid"}),t(".cdp-names-real-input").droppable({drop:function(e,o){$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],t(this).html(`${t(this).html()}${$picks[t(o.helper).attr("data-cdp-val")]}`),l()}}),"undefined"!=typeof pagenow&&["edit-page","edit-post"].includes(pagenow)&&t(".column-cb, .check-column").find("input").prop("checked",!1),t("#titlediv").find(".inside").length>0&&t("#cdp-original-post").length>0){let e=t("#cdp-original-post").attr("data-cdp-parent"),o=t("#cdp-original-post").attr("data-cdp-parent-url");t("#titlediv").find(".inside").append(t(`<div style="padding-left: 10px">This post is a duplicate of <a href="${o}" target="_blank">${e}</a></div>`))}t(".cdp-preloader-c").length>0&&(l(),u(),v(),setTimeout(()=>{r(".cdp-names-prefix"),r(".cdp-names-suffix")},1e3),function(){let e=t(".cdp-tab-active");for(let o=0;o<e.length;o++){let i=t(`#${t(e[o]).attr("data-box")}`);i.show(),i.css({"max-height":"",height:""});let c=i.height();t(c).css({"max-height":c+"px",height:c+"px"})}}()),setTimeout(()=>{t(".cdp-container").is(":hidden")&&setTimeout(()=>{jQuery(".cdp-preloader-c").hide(),jQuery(".cdp-container").css({opacity:0}),jQuery(".cdp-container").show(),jQuery(".cdp-container").animate({opacity:1},300)},400)},5e3)}),jQuery(window).on("load",function(){setTimeout(()=>{jQuery(".cdp-preloader-c").hide(),jQuery(".cdp-container").css({opacity:0}),jQuery(".cdp-container").show(),jQuery(".cdp-container").animate({opacity:1},300);const t=void 0!==jQuery.cdp&&void 0!==jQuery.cdp.isPremium;jQuery(".cdp-tooltip-premium-dc").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'This feature will come soon as part of the Premium Plugin. You can <a href="https://sellcodes.com/CylMIdJD" target="_blank">pre-order now</a> at a <b>huge discount</b>.',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),t&&jQuery.cdp.isPremium()?(jQuery(".cdp-tooltip-premium-spc-3").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:"If you’re on a multisite you can copy it to other sites.",contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),jQuery(".cdp-tooltip-premium-spc-3").addClass("cdp-premium-element"),jQuery(".cdp-tooltip-premium-spc-3").find("input, select").prop("disabled",!0)):(jQuery('.cdp-option-premium [value="3"]').prop("disabled",!0),setTimeout(()=>{jQuery(".cdp-premium-in-select").find('.option[data-value="premium"]').addClass("cdp-tooltip-premium disabled"),jQuery(".cdp-option-premium").find('.option[data-value="3"]').addClass("cdp-tooltip-premium disabled"),jQuery(".cdp-tooltip-premium-spc-2").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'If you’re on a multisite you can copy it to other sites with the Premium Plugin. <a href="https://sellcodes.com/CylMIdJD" target="_blank">Pre-order it now</a>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),jQuery(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").addClass("cdp-premium-element"),jQuery(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").find("input, select").prop("disabled",!0),jQuery(".cdp-tooltip-premium-spc-4").tooltipster("content",'You can copy it to other sites with the Premium Plugin.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Pre-order it now</a>'),function(t){let e=void 0!==t?t:".cdp-tooltip-premium",o=-15;isNaN(parseInt(jQuery(e).attr("data-top")))||(o=parseInt(jQuery(e).attr("data-top")));jQuery(e).tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:o,side:"top",content:'This feature will come soon as part of the Premium Plugin. You can <a href="https://sellcodes.com/CylMIdJD" target="_blank">pre-order now</a> at a <b>huge discount</b>.',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),i=e,jQuery(i).addClass("cdp-premium-element"),jQuery(i).find("input, select").prop("disabled",!0);var i}(),cdp_tooltips_update_content()},1e3))},400)}),function(t){function e(t,e){if(!(t.originalEvent.touches.length>1)){t.preventDefault();let o=t.originalEvent.changedTouches[0],i=document.createEvent("MouseEvents");i.initMouseEvent(e,!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(i)}}if(t.support.touch="ontouchend"in document,t.support.touch){let o,i=t.ui.mouse.prototype,c=i._mouseInit,n=i._mouseDestroy;i._touchStart=function(t){!o&&this._mouseCapture(t.originalEvent.changedTouches[0])&&(o=!0,this._touchMoved=!1,e(t,"mouseover"),e(t,"mousemove"),e(t,"mousedown"))},i._touchMove=function(t){o&&(this._touchMoved=!0,e(t,"mousemove"))},i._touchEnd=function(t){o&&(e(t,"mouseup"),e(t,"mouseout"),this._touchMoved||e(t,"click"),o=!1)},i._mouseInit=function(){let e=this;e.element.bind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),c.call(e)},i._mouseDestroy=function(){let e=this;e.element.unbind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),n.call(e)}}}(jQuery);
|
1 |
+
function cdp_tooltips_update_content(){if(jQuery("select").niceSelect("update"),!(void 0!==jQuery.cdp&&void 0!==jQuery.cdp.isPremium)||!jQuery.cdp.isPremium()){jQuery(".cdp-premium-in-select").find('.option[data-value="premium"]').addClass("cdp-tooltip-premium disabled"),jQuery(".cdp-option-premium").find('.option[data-value="3"]').addClass("cdp-tooltip-premium disabled"),$prems=jQuery(".cdp-tooltip-premium");for(let t=0;t<$prems.length;t++){let e=$prems[t],o=-15;isNaN(parseInt(jQuery(e).attr("data-top")))||(o=parseInt(jQuery(e).attr("data-top"))),jQuery(e).tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:o,side:"top",content:'This feature will come soon as part of the Premium Plugin. You can <a href="https://sellcodes.com/CylMIdJD" target="_blank">pre-order now</a> at a <b>huge discount</b>.',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0})}jQuery(".cdp-tooltip-premium-dc").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'This feature will come soon as part of the Premium Plugin. You can <a href="https://sellcodes.com/CylMIdJD" target="_blank">pre-order now</a> at a <b>huge discount</b>.',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0})}}function cdp_totally_know_what_i_am_doing(t){if("really"!=t)return"Are you REALLY sure?";console.log("You're crazy! – Here is the output:");let e=jQuery;e("#cdp-purl").val();e.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"debug_function"}).done(t=>{console.log(t),console.log("–––––––––––––- END OF THE DEBUG OUTPUT –––––––––––––- ")})}jQuery(document).ready(function(t){t("#cdp-purl").val();let e=null,o="default",i=null,c=null,n=null,d=null,p=null;const s=void 0!==t.cdp&&void 0!==t.cdp.isPremium;function a(e=null,o=!1){let i=this;"string"==typeof e&&(i=`.${e}`),0!=o&&(i=o),$parent=t(t(i).parents(".cdp-collapsible")[0]),$arrow=$parent.find(".cdp-arrow"),$body=$parent.find(".cdp-collapsible-content"),$title=$parent.find(".cdp-collapsible-title"),$titles=t(".cdp-collapsible-title"),group=$parent.attr("data-cdp-group"),height=$body.prop("scrollHeight"),$oArrows=t(`.cdp-collapsible[data-cdp-group="${group}"]`).not($parent).find(".cdp-arrow"),$oBodies=t(`.cdp-collapsible[data-cdp-group="${group}"]`).not($parent).find(".cdp-collapsible-content"),$body.hasClass("cdp-active")?($body.removeClass("cdp-active"),$titles.removeClass("cdp-active"),$oBodies.removeClass("cdp-active"),$arrow.removeClass("cdp-arrow-down").addClass("cdp-arrow-left"),$body.css({"max-height":""})):($titles.removeClass("cdp-active"),$body.addClass("cdp-active"),$title.addClass("cdp-active"),$oBodies.removeClass("cdp-active"),$arrow.removeClass("cdp-arrow-left").addClass("cdp-arrow-down"),$oArrows.removeClass("cdp-arrow-down").addClass("cdp-arrow-left"),$body.css({"max-height":`${height+30}px`}),$oBodies.css({"max-height":""}))}function l(){let e=t(".cdp-names-prefix").text(),o=t(".cdp-names-suffix").text(),i={year:(c=new Date).getFullYear(),month:("0"+(c.getMonth()+1)).slice(-2),day:c.getDate()<=9?"0"+c.getDate():c.getDate(),hour:c.getHours()<=9?"0"+c.getHours():c.getHours(),minute:c.getMinutes()<=9?"0"+c.getMinutes():c.getMinutes(),second:c.getSeconds()<=9?"0"+c.getSeconds():c.getSeconds(),week:c.getDay()};var c;let n="(blank)"==t(".cdp-togglable-name-b").text()?"":"(Name of original)",d=`${e.trim()} ${n} ${o.trim()}`;d=d.replace(/\[Counter\]/g,"2");let p=t(".cdp-date-picked").val();"1"==p?d=d.replace(/\[CurrentDate\]/g,`${i.month}/${i.day}/${i.year}`):"2"==p?d=d.replace(/\[CurrentDate\]/g,`${i.day}/${i.month}/${i.year}`):"3"==p&&function(e){let o=t(".cdp-custom-date-picking").val();t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"get_formatted_time",format:o}).done(t=>{e(t)}).fail(()=>{e(!1)})}(e=>{d=d.replace(/\[CurrentDate\]/g,`${e}`),t(".cdp-example-name").text(d),d=(d=d.replace(/\[CurrentTime\]/g,`${i.hour}:${i.minute}:${i.second}`)).replace(/\s+/gim," "),t(".cdp-example-name").text(d)}),"3"!=p&&(d=(d=d.replace(/\[CurrentTime\]/g,`${i.hour}:${i.minute}:${i.second}`)).replace(/\s+/gim," "),t(".cdp-example-name").text(d))}function r(e=""){before=t(e).html(),text=t(e).html(),$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],text=text.replace(/\[Counter\]/g,$picks[0]),text=text.replace(/\[CurrentDate\]/g,$picks[2]),text=text.replace(/\[CurrentTime\]/g,$picks[1]),text!=before&&t(e).html(text)}function u(){val=t('.cdp-other-options[name="after_copy"]').val(),2==val?t(".cdp-if-edit-page-selected").show(300):t(".cdp-if-edit-page-selected").is(":hidden")||t(".cdp-if-edit-page-selected").hide(300),setTimeout(()=>{jQuery(".cdp-oth-section").css({"max-height":""}),jQuery(".cdp-oth-section").css({"max-height":jQuery(".cdp-oth-section").height()})},310)}function h(i=!1){let c=t(this).attr("data-cdp-btn");1==i&&(c="copy-quick");let n=["copy-quick","copy-custom","copy-custom-link"],d=t(".cdp-modal-checkboxes").find(".cdp-input-dynamic");if(n.includes(c)){let i={type:c};if(c==n[0]){if(i.times=t(".cdp-modal-input-times-tooltip").val(),i.site=t('.cdp-input-dynamic[name="tooltip-which-site-first"]').val(),i.profile=t('.cdp-input-dynamic[name="tooltip-which-profile-first"]').val(),i.swap="2"==t(".cdp-swap").val()?"true":"false",!i.profile||"custom"==i.profile)return t.cdpNotification("warning","Please select settings for this copy."),void b()}else if(c==n[1]||c==n[2]){i.times=t('.cdp-modal-input-times[name="tooltip-which-times-second"]').val(),i.site=t('.cdp-input-dynamic[name="tooltip-which-site-second"]').val(),i.profile=t('.cdp-input-dynamic[name="tooltip-which-profile-second"]').val(),i.swap="2"==t(".cdp-swap").val()?"true":"false",i.custom={};for(let e=0;e<d.length;++e)i.custom[t(d[e]).attr("name")]=t(d[e]).is(":checked")}if(isNaN(parseInt(i.times))||parseInt(i.times)<=0)return void t.cdpNotification("warning","You need to insert positive number for copies.");i.profile&&!["custom","clear","custom_named"].includes(i.profile)||(i.profile=o),z(),function(e=(()=>{})){window.onbeforeunload=(()=>"Copy in progress..."),$e=t(".cdp-copy-loader-overlay"),$e.is(":hidden")&&($e.show(),$e.animate({opacity:1},300,function(){e(!0)}))}(()=>{t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"copy_post",origin:"tooltip",id:[e],data:i}).done(e=>{b(),t.isJsonString(e)&&(e=t.cdpParse(e)),"error"==e.status?t.cdpNotification("error","Something went wrong and we couldn't copy this post – please try again!"):c==n[2]||void 0!==e.link&&e.link.length>0?"pConv"==e.link?(t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"delete_success_img"}),"-28"==t(".cdp-copy-alert-success").position().top&&t(".cdp-copy-alert-success").animate({top:"32px",opacity:1},300),setTimeout(()=>{"32"==t(".cdp-copy-alert-success").position().top&&t(".cdp-copy-alert-success").animate({top:"-28px",opacity:0},300)},3e3)):window.location.href=e.link:location.reload()}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't copy this post. – See dev console for more info."),b(),console.log(e),console.log(e.responseText)})})}else t.cdpNotification("Couldn't recognize that button, please try again.")}function m(e,i=!1){let c=t('.cdp-input-dynamic[name="tooltip-which-profile-second"]'),n=t(".cdp-modal-checkboxes").find(".cdp-input-dynamic"),d=c.length>1?t(t(c[1])):t(t(c[0]));t(c[1])&&t(c[1])||(null==t(c[1])&&t(c[0])?d=t(t(c[0])):null==t(c[0])&&t(c[1])&&(d=t(t(c[1]))));let p=d.val();0==e&&(p=i),"custom_named"==p?c.val("custom_named"):"custom"==p||null==p||null==p?c.val("custom"):"clear"==p?(0!=e&&e.preventDefault(),n.prop("checked",!1),c.val("custom")):!["clear","custom","custom_named"].includes(p)&&p.length>=1?g(p,function(e){for(let o in e)"object"!=typeof o&&t(`.cdp-input-dynamic[name="${o}"]`).prop("checked",f(e[o]))}):(0!=e&&e.preventDefault(),t.cdpNotification("warning","Unable to recognize selected profile, please try again.")),0==e&&c.val(p),["clear","custom","custom_named"].includes(p)||(o=p),cdp_tooltips_update_content()}function f(t){return"string"==typeof t&&"true"==t.trim().toLowerCase()}function g(e="default",o){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"get_settings",profile:e}).done(e=>{if(t.isJsonString(e)&&(e=t.cdpParse(e)),e.status&&"error_no_exists"==e.status){t.cdpNotification("warning","Profile you selected is just empty, please update this profile or use custom settings!");let e={},i=t(".cdp-modal-option-r");for(let o=0;o<i.length;o++)e[t(i[o]).attr("name")]=t(i[o]).is(":checked");o(!1)}else o(e)}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't get profile settings. – Check console for more details"),console.log("Copy & Delete Post – Error"),console.log(e),console.log("––––––––––––––––––––––––––"),o(!1)})}function y(){t(this).attr("class");let e=parseInt(t(this).val());e<=0&&(e=1),e>9999&&(e=9999),isNaN(e)&&(e=1),e||(e=1),t(".cdp-modal-input-times").val(e),t(".cdp-modal-input-times-tooltip").val(e),e>50?(t(".cdp-error-span-tooltip").show(300),t(".cdp-tooltip-before").attr("style","height: calc(225px - 20px - 16px) !important")):(t(".cdp-error-span-tooltip").hide(300),t(".cdp-tooltip-before").attr("style","")),e>1?(t(".cdp-multiple-tooltip-count").animate({opacity:1},200),t('.cdp-tooltip-btn-copy[data-cdp-btn="copy-custom-link"]').hide()):(t(".cdp-multiple-tooltip-count").animate({opacity:0},200),t('.cdp-tooltip-btn-copy[data-cdp-btn="copy-custom-link"]').show()),setTimeout(()=>{A()},310)}function b(e=(()=>{})){window.onbeforeunload=null,$e=t(".cdp-copy-loader-overlay"),$e.is(":hidden")||$e.animate({opacity:0},300,function(){$e.hide(),e(!0)})}function v(){let e=t(".cdp-profile-selected").val();var o,i;g(e,c=>{if(t.isJsonString(c)||"object"==typeof c){"object"!=typeof c&&(c=JSON.parse(c));let n=["usmplugin","yoast"];for(k in c)"names"==k?(t(".cdp-names-prefix").html(c[k].prefix),t(".cdp-names-suffix").html(c[k].suffix),"3"!=c[k].format||s||(c[k].format="1"),t(".cdp-date-picked").val(c[k].format),t(".cdp-custom-date-picking").val(c[k].custom)):(!n.includes(k)||n.includes(k)&&s&&t.cdp.isPremium())&&t(`.cdp-data-set[data-cdp-opt="${k}"]`).prop("checked","true"==c[k]);cdp_tooltips_update_content(),l(),u(),s&&t.cdp.isPremium()&&t.cdp.premium.detectChangeOfCustom(),_(),r(".cdp-names-prefix"),r(".cdp-names-suffix"),o=e,i=(()=>{}),t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"set_default_profile",selection:o}).done(t=>{i(t)}).fail(()=>{i(!1)})}else t.cdpNotification("warning","There was an error while getting data from server, please try again.")})}function x(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;let e=t(".cdp-input-d-id").length,o=t(".cdp-input-d-id:checked").length;o==e?t(".cdp-d-select-all").text("Deselect all"):t(".cdp-d-select-all").text("Select all"),t(".cdp-t-d-ct").text(o),$visible=t(".cdp-input-d-id:visible").length,$visible_checked=t(".cdp-input-d-id:checked:visible").length,$visible==$visible_checked?t(".cdp-d-checkbox-all").prop("checked",!0):t(".cdp-d-checkbox-all").prop("checked",!1),function(){let e=t(".cdp-input-d-id").parents("tr"),o=t(".cdp-input-d-id:checked").parents("tr");e.removeClass("cdp-del"),o.addClass("cdp-del")}()}function w(e){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"give_me_current_tasks"}).done(o=>{t.isJsonString(o)&&(o=t.cdpParse(o)),"success"==o.status&&e(o.tasks)})}function $(e){let o=0,i=+new Date/1e3,c=t(".cdp-dd-item");for(let i=0;i<c.length;++i){e[t(c[i]).attr("data-token")]||t(c[i]).remove(),o++}for(task in e){let c=e[task],n=t(t(`.cdp-dd-item[data-token="${task}"]`)[0]);if(0==c.done){if(n.hasClass("cdp-dd-ud"))continue;{n.remove();let e=i-c.done>=86400;t(".cdp-dd-undone-list").append(D(c.shown,task,e,c.f)),o++}}else{if(n.hasClass("cdp-dd-d"))continue;n.remove(),t(".cdp-dd-done-list").append(P(c.shown,task,c.f)),o++}}(o>0||0==c.length)&&function(){let e=t(".cdp-dd-item").length,o=t(".cdp-dd-d").length,i=t(".cdp-dd-ud").length;o<=0?(t(".cdp-done-notis, .cdp-done-notis").addClass("cdp-noti-hide"),t(".cdp-done-hr, .cdp-done-notis").hide()):(t(".cdp-done-notis, .cdp-done-notis").removeClass("cdp-noti-hide"),t(".cdp-done-hr, .cdp-done-notis").show()),i<=0?(t(".cdp-undone-notis, .cdp-undone-notis").addClass("cdp-noti-hide"),t(".cdp-undone-hr, .cdp-undone-notis").hide()):(t(".cdp-undone-notis, .cdp-undone-notis").removeClass("cdp-noti-hide"),t(".cdp-undone-hr, .cdp-undone-notis").show()),e<=0?t(".cdp-admin-bar-noti").addClass("cdp-noti-hide"):t(".cdp-admin-bar-noti").removeClass("cdp-noti-hide"),t(".cdp-notis-counter").text(t(".cdp-bnew-notis").length)}()}function _(){$trs=t(".cdp-table tbody.cdp-ff-b1").find("tr");for(let e=0;e<$trs.length;e++){let o=t($trs[e]);o.find("input").is(":checked")?o.addClass("cdp-selected-tr-opt"):o.removeClass("cdp-selected-tr-opt")}}function C(e){if(t(".cdp-modal").is(":visible"))return;let o=window;0!=t("#wpbody").scrollTop()&&(o="#wpbody");let i=t(o).scrollTop()+2;i<=0&&(i=2),"click"!=e.type&&t(".nice-select, .nice-select .list").css({transition:"all 0s"}),t(".nice-select .list").css({"margin-top":`${-i}px`}),clearTimeout(d),d=setTimeout(()=>{t(".nice-select .list").css({transition:""})},100),clearTimeout(n),n=setTimeout(()=>{let i=t(o).scrollTop()+2;i<=0&&(i=2),"click"!=e.type&&t(".nice-select .list").css({transition:"all 0s !important"}),t(".nice-select .list").css({"margin-top":`${-i}px`}),clearTimeout(d),d=setTimeout(()=>{t(".nice-select .list").css({transition:""})},100)},100)}function T(){let e=t('.cdp-d-option[name="cdp-d-b-title"]').is(":checked"),o=t('.cdp-d-option[name="cdp-d-b-slug"]').is(":checked");e||o?t(".cdp-no-empty-text").html("<b>including</b> empty"):t(".cdp-no-empty-text").html("only if <u><b>not</b></u> empty")}function j(e){e.preventDefault(),$parent=t(this).parents(".cdp-collapsible"),$col=t(t($parent[0]).find(".cdp-collapsible-title")[0]),a("true",$col)}t(".cdp-intro-button").on("click",function(){let e=t(".cdp-intro").height();t(".cdp-intro").css({height:e+"px"}),t(".cdp-intro").animate({opacity:0,height:0},300,function(){t(".cdp-intro").hide(10),t("#cdp-never-intro").is(":checked")&&t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"no_intro"}).done(e=>{"error"==e&&t.cdpNotification("error","Something went wrong and we couldn't save intro settings!")}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't save intro settings.")})}),t(".cdp-s-i-a").show(),t(".cdp-s-i-a").animate({opacity:1},300)}),t(".cdp-save-options").on("click",function(){let e=t(".cdp-data-set"),o=t(".cdp-other-inputs"),i=t(".cdp-profile-selected").val(),c=t(".cdp-names-prefix").text().replace(/\s+/g," ").trim(),n=t(".cdp-names-suffix").text().replace(/\s+/g," ").trim(),d={names:{prefix:c,suffix:n,format:t(".cdp-date-picked").val(),custom:t(".cdp-custom-date-picking").val(),display:t(t(`option[value="${t(".cdp-profile-selected").val()}"]`)[0]).text()}},p={afterCopy:t('.cdp-other-options[name="after_copy"]').val(),postConverter:t('.cdp-other-options[name="post_converter"]').val(),others:{}},s={},a=t(".cdp-other-roles");for(let e=0;e<a.length;e++)s[t(a[e]).attr("name")]=t(a[e]).is(":checked");p.roles=s;for(let o=0;o<e.length;o++)d[t(e[o]).attr("data-cdp-opt")]=!!t(e[o]).is(":checked");for(let e=0;e<o.length;e++)p.others[t(o[e]).attr("name")]=!!t(o[e]).is(":checked");t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"save_options",options:d,profile:i,entire:p}).done(e=>{"success"==e?t.cdpNotification("success","All your settings were saved!",2e3):"error"==e?t.cdpNotification("error","Something went wrong and we couldn't save your settings."):t.cdpNotification("success","All your settings were saved!",2e3)}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't save your settings. – Please check console for more info."),console.log(e)})}),t("#cdp-show-into-again").on("click",function(){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"intro_again"}).done(e=>{"error"==e&&t.cdpNotification("error","Something went wrong and we couldn't update intro settings – try again!")}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't update intro settings. – Please check console for more info.")}),t(".cdp-s-i-a").animate({opacity:0},300,function(){t(".cdp-s-i-a").hide()}),function(){t(".cdp-intro").show().css({height:""});let e=t(".cdp-intro").height();t(".cdp-intro").css({height:"0px"}),t(".cdp-intro").animate({opacity:1,height:e+"px"},300,function(){})}()}),t(".cdp-show-projects").on("click",function(){t(".cdp-projects").is(":hidden")&&t(".cdp-projects").show(300);t(".cdp-show-projects").removeClass("cdp-pointer").animate({opacity:.5},300)}),t(".cdp-project-box").on("mouseenter",function(){t(".cdp-project-box").not(t(this)).addClass("cdp-half-opacity")}),t(".cdp-project-box").on("mouseleave",function(){t(".cdp-project-box").removeClass("cdp-half-opacity")}),t(".cdp-collapsible-title").on("click",a),t(".cdp-magic-input").on("keyup change",function(){before=t(this).html(),text=t(this).html(),$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],text=text.replace(/\[Counter\]/g,$picks[0]),text=text.replace(/\[CurrentDate\]/g,$picks[2]),text=text.replace(/\[CurrentTime\]/g,$picks[1]),text!=before&&t(this).html(text)}),t(".cdp-magic-input").on("focus",function(e,o){if(o)return;let i=t(this).text();" "!=i[0]&&(i=" "+i);" "!=i[i.length-1]&&(i+=" ");t(this).html(i),r(this)}),t(".cdp-magic-input").on("mouseup",".cdp-name-box-small",function(){t(this).hide(300),setTimeout(()=>{t(this).remove(),l()},300)}),t(".cdp-support-animated").on("mouseenter",function(){t(".cdp-support-animated").not(t(this)).addClass("cdp-half-opacity")}),t(".cdp-name-clickable").on("mouseup",function(e){if(e.preventDefault(),$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],$box={1:".cdp-names-prefix",2:".cdp-names-real-input",3:".cdp-names-suffix"},t($box[e.which]).append($picks[t(this).attr("data-cdp-val")]),l(),e.which==e)return!1}),t(".cdp-support-animated").on("mouseleave",function(){t(".cdp-support-animated").removeClass("cdp-half-opacity")}),t("body").on("change keyup",".cdp-input-dynamic",function(){$input=t(t(".cdp-tooltip-content, .cdp-modal-content").find(`[name="${t(this).attr("name")}"]`)),"checkbox"==t(this).attr("type")?$input.prop("checked",t(this).is(":checked")):t($input).is("select")?($input.val(t(this).val()),t($input).hasClass("cdp-modal-input-profiles-r")&&m(!1,t(this).val())):$input.val(t(this).val());cdp_tooltips_update_content()}),t(".cdp-names-real-input, .cdp-date-picked").on("keyup change",l),t('.cdp-other-options[name="after_copy"]').on("change",u),t("body").on("click",".cdp-tooltip-before-button",function(){let e=t('.cdp-input-dynamic[name="tooltip-which-profile-first"]').val();"custom"!=e&&m(!1,e);t(".cdp-tooltip-before-options").hide(200),setTimeout(()=>{t(".cdp-tooltip-full-options").show(200),setTimeout(()=>{A()},200)},200)}),t("body").on("click",".cdp-tooltip-btn-copy",h),t("body").on("change",'.cdp-input-dynamic[name="tooltip-which-profile-second"]',m),t("body").on("change",'.cdp-input-dynamic[name="tooltip-which-profile-first"]',function(){m(!1,t(this).val())}),t("body").on("change",".cdp-modal-checkboxes .cdp-input-dynamic",function(){t('.cdp-input-dynamic[name="tooltip-which-profile-second"]').val("custom_named"),cdp_tooltips_update_content(),m(!1,"custom_named")}),t("body").on("change",".cdp-modal-input-times-tooltip",y),t("body").on("change",".cdp-modal-input-times",y),t("body").on("click",".cdp-modal-times, .cdp-modal",t.cdpModalClose),t("body").on("click",".cdp-modal-open",t.cdpModal),t("body").on("change",".cdp-profile-selected",v),t("body").on("click",".cdp-show-more-d-title",function(e){e.preventDefault(),t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-more-d-title").is(":hidden")?(t(".cdp-more-d-title").show(300),t(this).text("(hide more options)")):(t(".cdp-more-d-title").hide(300),t(this).text("(show more options)"));setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("change",".cdp-d-first-chapter-cb",function(){t(".cdp-d-section").css({"max-height":"",height:""});let e=t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked")+0,o=t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked")+0,i=t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked")+0;e+o+i>1?t(".cdp-d-option-select-parent").show(300):t(".cdp-d-option-select-parent").hide(300);setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("click",".cdp-d-search",function(){let e=t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked")?1:0,o=t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked")?1:0,n=t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked")?1:0;e+o+n<=0?t.cdpNotification("error","Please, check for: which duplicates you are looking for"):null==c?function(e=function(){}){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"get_all_posts"}).done(o=>{t.isJsonString(o)&&(o=t.cdpParse(o)),e(o)}).fail(o=>{t.cdpNotification("error","Something went wrong and we couldn't get post list. – Please check console for more info."),console.log(o),e(!1)})}(t=>{0!=t&&p(t)}):p(c);function d(t,e){let o=parseInt(e[e.length-1]);for(let i=e.length;i>=0&&(o=parseInt(e[i-1]),ext=!1,t.posts.findIndex(t=>t.ID==o)>=0?ext=!0:t.pages.findIndex(t=>t.ID==o)>=0?ext=!0:t.custom.findIndex(t=>t.ID==o)>=0?ext=!0:o=!1,1!=ext);--i);return o}function p(e){let o={posts:[],pages:[],custom:[]},n={},p={};null!=c&&(o=c);let l=!!t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked"),r=!!t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked"),u=!!t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked"),h=!!t('.cdp-d-option[name="cdp-d-b-title"]').is(":checked"),m=!!t('.cdp-d-option[name="cdp-d-b-slug"]').is(":checked"),f=!!t('.cdp-d-option[name="cdp-d-c-excerpt"]').is(":checked"),g=!!t('.cdp-d-option[name="cdp-d-c-count"]').is(":checked"),y=t('.cdp-d-option-select[name="cdp-d-d-sel-which"]').val(),b=null,v=null;if(l+r+u>1&&(b=t('.cdp-d-option-select[name="cdp-d-sels-diftyp"]').val()),1==h&&(v="1"==t('.cdp-d-option[name="cdp-radio-btn-dtitles"]:checked').val()),null==c)for(post_type in e)if("meta"!=post_type)for(post in e[post_type]){post=e[post_type][post],post.post_type=post.post_type[0].toUpperCase()+post.post_type.slice(1);let t=e.meta[post.ID]._cdp_origin,i=e.meta[post.ID]._cdp_counter,c={id:post.ID,url:post.guid,slug:post.post_name,type:post.post_type,date:post.post_date,title:post.post_title,edit:post.post_modified,excerpt:post.post_excerpt,words:a(s(post.post_content)),origin:"object"==typeof t&&d(e,t),counter:"object"==typeof i&&i[i.length-1]};if(1301==c.id&&console.log(c,t),"object"==typeof t){let e=parseInt(t[t.length-1]);void 0===p[e]?p[e]=1:p[e]++}o[post_type].push(c)}o=function(t){let e=JSON.parse(JSON.stringify(t));return e.posts.sort((t,e)=>!1===t.origin?-1:!1===e.origin?1:0),e.pages.sort((t,e)=>!1===t.origin?-1:!1===e.origin?1:0),e.custom.sort((t,e)=>!1===t.origin?-1:!1===e.origin?1:0),e}(o),null==c&&(c=o);let k=[],w=[];if("2"==b){let t=[],e=[],i=[];1==l&&(t=o.posts),1==r&&(e=o.pages),1==u&&(i=o.custom),k=(k=[].concat(t,e,i)).sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),w=$(k)}else{let t=[],e=[],i=[];o.posts=o.posts.sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),1==l&&(t=$(o.posts)),o.pages=o.pages.sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),1==r&&(e=$(o.pages)),o.custom=o.custom.sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),1==u&&(i=$(o.custom)),w=[].concat(t,e,i)}function $(t){let e=[],o=[],i=!(h||m||f||g);if(!t)return e;for(let e=0;e<t.length;e++){let n=t[e];if(!o.includes(n.id))for(let d=i?0:e;d<t.length;d++){if(!t[d])continue;if(o.includes(t[d].id))continue;if(d==e)continue;let p=1==h&&(n.title==t[d].title||1==v&&n.id==t[d].origin&&t[d].date==t[d].edit),s=1==m&&I(n.slug,t[d].slug)>=.85,a=!1;a=1==p||1==s?1==f&&(""==n.excerpt||n.excerpt==t[d].excerpt):1==f&&""!=n.excerpt&&n.excerpt==t[d].excerpt;let l=1==g&&n.words==t[d].words,r=1==i&&n.id==t[d].origin&&t.findIndex(e=>e.origin==t[d].id)<=-1;!p&&h||!s&&m||!a&&f||!l&&g||!r&&i||(c(n,!0,!1),c(t[d],!1,n.id))}}function c(t,i=!1,c=!1){o.includes(t.id)||(1==i?n[t.id]=[]:0!=c&&n[c].push(t.id),o.push(t.id),e.push(t))}return e}for(post in $tbody=t("#cdp-d-table-tbody"),$tbody.html(""),w)$tbody.append((_=w[post],t(`<tr data-id="${_.id}">\n <td><input type="checkbox" id="cdp_in_${_.id}" class="cdp-input-d-id" name="${_.id}"/></td>\n <td><label for="cdp_in_${_.id}">${_.title}</label></td>\n <td><a href="${_.url}" target="_blank">${""!=_.slug?_.slug:_.url}</a></td>\n <td>${_.type}</td>\n <td>${_.date.slice(0,-8)}</td>\n <td>${_.words}</td>\n </tr>`)));var _;if("1"==y)for(parent in n)for(child in n[parent])t(`.cdp-input-d-id[name="${n[parent][child]}"]`).prop("checked",!0);else if("2"==y)for(parent in n){t(`.cdp-input-d-id[name="${parent}"]`).prop("checked",!0);let e=Math.max(...n[parent]);for(child in n[parent])n[parent][child]!=e&&t(`.cdp-input-d-id[name="${n[parent][child]}"]`).prop("checked",!0)}else"3"==y&&t(".cdp-input-d-id").prop("checked",!0);let C=!(h||m||f||g),T=t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked")+0,j=t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked")+0,D=t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked")+0;C&&T+j+D>0&&w.length>0?(t("#cdp-d-table-tbody").find("tr").attr("data-ignore",!0),i.refresh(),t(".cdp-delete-info").hide(300),t('[data-empty-info="true"]').find("div").html('You did not select any filter.<br>Click <a href="#" class="cdp-show-the-copies">here</a> to show all copies (of the selected post type) made by this plugin.'),t('[data-empty-info="true"]').addClass("cdp-customized")):i.refresh(),t(".cdp-d-searchbox-c").val(""),x(),0==w.length?(t.cdpNotification("warning","No posts/pages meeting the current filter conditions."),t(".cdp-delete-info").hide(300)):t(".cdp-not-yet-search").is(":visible")||(t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-not-yet-search").show(300),t('[data-empty-info="true"]').hasClass("cdp-customized")||t(".cdp-delete-info").show(300),setTimeout(()=>{t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-d-section").css({"max-height":`${t(".cdp-d-section").height()}px`})},320))}function s(t){return(t=(t=(t=t.replace(/\<\!\-\-(.*?)\-\-\>/gim,"")).replace(/<[^>]*>/gim," ")).replace(/\s+/gim," ")).trim()}function a(t){return(t=t.split(" ")).length}}),t("body").on("change",".cdp-input-d-id",function(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;let e=parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text()),o=parseInt(t(".cdp-t-d-ct").text());t(this).is(":checked")?(o++,t(this).parents("tr").addClass("cdp-del")):(o--,t(this).parents("tr").removeClass("cdp-del"));if(t(".cdp-t-d-ct").text(o),o==e)t(".cdp-d-select-all").text("Deselect all"),t(".cdp-d-checkbox-all").prop("checked",!0);else{t(".cdp-d-select-all").text("Select all");let e=t(".cdp-input-d-id:visible");for(let o=0;o<e.length;++o){if(!t(e[o]).is(":checked")){t(".cdp-d-checkbox-all").prop("checked",!1);break}o==e.length-1&&t(".cdp-d-checkbox-all").prop("checked",!0)}}}),t("body").on("change",".cdp-d-checkbox-all",function(e){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return e.preventDefault(),void t(this).prop("checked",!1);let o=parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text()),i=t(".cdp-d-checkbox-all").is(":checked"),c=t(".cdp-input-d-id:visible"),n=0;for(let e=0;e<c.length;++e)t(c[e]).is(":checked")&&!i?n--:!t(c[e]).is(":checked")&&i&&n++,t(c[e]).prop("checked",i);let d=parseInt(t(".cdp-t-d-ct").text())+n;t(".cdp-t-d-ct").text(d),d==o?t(".cdp-d-select-all").text("Deselect all"):t(".cdp-d-select-all").text("Select all");let p=t(".cdp-input-d-id:visible").parents("tr"),s=t(".cdp-input-d-id:visible:checked").parents("tr");p.removeClass("cdp-del"),s.addClass("cdp-del")}),t("body").on("click",".cdp-d-select-all",function(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;let e=parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text()),o=parseInt(t(".cdp-t-d-ct").text()),i=!0;e==o&&(i=!1);$chbs=t(".cdp-input-d-id");for(let e=0;e<$chbs.length;++e)t($chbs[e]).prop("checked",i);t(".cdp-t-d-ct").text(1==i?e:"0"),0==i?(t(".cdp-d-select-all").text("Select all"),t(".cdp-d-checkbox-all").prop("checked",!1),t(".cdp-input-d-id").parents("tr").removeClass("cdp-del")):(t(".cdp-d-checkbox-all").prop("checked",!0),t(".cdp-d-select-all").text("Deselect all"),t(".cdp-input-d-id").parents("tr").addClass("cdp-del"))}),t("body").on("click",".prev_page, .next_page, .page_link",function(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;t(".cdp-input-d-id:visible:checked").length==t(".cdp-input-d-id:visible").length?t(".cdp-d-checkbox-all").prop("checked",!0):t(".cdp-d-checkbox-all").prop("checked",!1)}),t("body").on("click",".cdp-d-real-delete",function e(o=!1,n=null,d=0){if(!t(".cdp-d-just-check-it").is(":checked"))return void t.cdpNotification("warning","Please check that you completed all steps, before this task!");let p=[];if(null===n){let e=t(".cdp-input-d-id:checked");for(let o=0;o<e.length;++o)p.push(parseInt(t(e[o]).attr("name")));if(0==p.length)return void t.cdpNotification("warning","Nothing to do here, please select at least one post to delete.")}else p=n;let s=t(".cdp-d-throttling").val(),l=t(".cdp-d-throttling-count").val(),r=t(".cdp-p-redirections").val(),u=!!t(".cdp-p-just-trash-them").is(":checked");if("1"==s&&(!l||0==l||""==l))return void t.cdpNotification("warning","You have wrong count in throttling field, please fix.");if(p.length>801&&!0!==o){let t=Math.ceil(p.length/800);for(let o=0,i=!0;o<t;++o)o==t-1&&(i=!1),e(i,p.slice(800*o,800*o+800),o);return}t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"delete_them",ids:p,throttling:s,thc:l,redi:r,thrs:u}).done(e=>{if(t.isJsonString(e)&&(e=t.cdpParse(e)),"success"==e.status){t("#cdp-d-table-tbody").find(".cdp-del").remove();let e=c.posts.filter(t=>!p.includes(t.id)),n=c.pages.filter(t=>!p.includes(t.id)),s=c.custom.filter(t=>!p.includes(t.id));c={posts:e,pages:n,custom:s},!0!==o&&i.refresh(),x(),0==d&&t.cdpNotification("success","Deletion process started, you can close this page now and wait till the process ends!"),w($),!0!==o&&($parent=t(".cdp-d-section").parents(".cdp-collapsible"),$col=t(t($parent[0]).find(".cdp-collapsible-title")[0]),a("true",$col))}else!0!==o&&t.cdpNotification("error",`Something went wrong and we couldn't setup the deletion task. ${"1"==s?"– Please try without throttling.":""}`)}).fail(e=>{!0!==o&&t.cdpNotification("error","Something went wrong and we couldn't setup the deletion task. – Please check console for more info."),console.log(e)})}),t("body").on("change",".cdp-d-throttling",function(){t(".cdp-d-section").css({"max-height":"",height:""}),"1"==t(this).val()?t(".cdp-d-throttling-count-p, .cdp-even-more-th-info").show(300):t(".cdp-d-throttling-count-p, .cdp-even-more-th-info").hide(300);setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("change",".cdp-d-throttling-count",function(){let e=parseInt(t(this).val());isNaN(e)?t(this).val(1):e>=1&&e<=10240?e>=1&&e<=1&&t(this).val(1):e<1?t(this).val(1):t(this).val(10240)}),t("body").on("change",".cdp-custom-date-picking",l),t("body").on("mouseover",".cdp-tooltip-copy",function(){t(this).hasClass("tooltipstered")||(t(this).tooltipster({delay:100,timer:400,debug:!1,delayTouch:[100,200],interactive:!0,distance:4,side:"bottom",contentAsHTML:!0,content:t(".cdp-tooltip-content").html(),repositionOnScroll:!0,selfDestruction:!1,trigger:"custom",triggerOpen:{mouseenter:!0,touchstart:!0},triggerClose:{mouseleave:!0,click:!0,tap:!0},functionBefore:S,functionReady:N,functionAfter:Q,functionFormat:M}),t(this).tooltipster("open"))}),t("body").on("keyup",".cdp-d-searchbox-c",function(){if(t('[data-empty-info="true"].cdp-customized').length>0)return;let e=t(this).val();e.length>100&&(e=e.substr(0,100));if(e=(e=e.trim().replace(/\s+/gim," ").toLowerCase()).split(" "),$trs=t("#cdp-d-table-tbody").find("tr"),$trs.length<=0)return;$trs.removeAttr("data-ignore");for(let o=0;o<$trs.length;++o){$tr=t($trs[o]),$title=t($tr.find("td")[1]).text().toLowerCase(),$url=t($tr.find("td")[2]).text().toLowerCase();let i=!1;for(let t=0;t<e.length;++t)if($title.includes(e[t]))i=!0;else{if(!$url.includes(e[t])){i=!1;break}i=!0}0==i&&$tr.attr("data-ignore","true")}clearTimeout(p),p=setTimeout(()=>{i.refresh()},20)}),t("body").on("change",".cdp-data-set",_),t("#wpbody").on("scroll",C),t(window).on("scroll",C),t("body").on("click",".nice-select",C),t("body").on("click",".cdp-show-the-copies",function(e){e.preventDefault(),t(".cdp-d-section").css({"max-height":"",height:""}),t("#cdp-d-table-tbody").find("tr").not('[data-empty-info="true"]').removeAttr("data-ignore"),t(".cdp-d-searchbox-c").val(""),t('[data-empty-info="true"]').addClass("cdp-customized"),i.refresh(),x(),t(".cdp-d-section").css({"max-height":"",height:""}),parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text())>0&&t(".cdp-delete-info").show(300);t(".cdp-not-yet-search").is(":visible")||(t(".cdp-not-yet-search").show(300),t('[data-empty-info="true"]').hasClass("cdp-customized")||t(".cdp-delete-info").show(300));setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("change",".cdp-per-page-select-show",function(){let e=t(this).val();i.changePageSize(e)}),t("body").on("change",'.cdp-d-option[name="cdp-d-b-title"]',T),t("body").on("change",'.cdp-d-option[name="cdp-d-b-slug"]',T),t("body").on("click",".cdp-tab-element",function(){if(t(this).hasClass("cdp-tab-active"))return;if("true"==t(this).attr("data-disabled"))return;let e=t(t(`#${t(this).attr("data-box")}`)[0]),o=t(t(`#${t(".cdp-tab-active").attr("data-box")}`)[0]);if(!e||e.length<=0)return;t(".cdp-tab-active").removeClass("cdp-tab-active"),t(this).addClass("cdp-tab-active"),e.show(),e.css({"max-height":"",height:""});let i=e.height();e.css({"max-height":"0px",opacity:0}),e.animate({"max-height":i+"px",opacity:1},500,function(){let e=t(".cdp-d-section").height();t(".cdp-d-section").css({height:e+"px","max-height":e+"px"})}),t(".cdp-d-section").css({height:"","max-height":""}),o.css({"max-height":o.height()+"px",opacity:1}),o.animate({"max-height":"0px",opacity:0},500,function(){o.hide()}),setTimeout(()=>{o.css({"max-height":"",height:""}),e.css({"max-height":"",height:""})},510);let c=parseInt(t(window).height()/8);t("#wpbody").animate({scrollTop:jQuery(".cdp-d-section")[0].offsetTop-c},500)}),t("body").on("click",".cdp-premium-element",function(t){t.preventDefault()}),t("body").on("click",".cdp-go-to-names-chapter",function(e){e.preventDefault(),z(),a("cdp-name-section-cnx"),setTimeout(()=>{let e=parseInt(t(window).height()/4);t("#wpbody").animate({scrollTop:t(".cdp-name-section-cnx")[0].offsetTop-e},500)},400)}),t("body").on("click",".cdp-close-chapter",j),t("body").on("click",".cdp-save-options",j),t("body").on("click",".cdp-togglable-name-b",function(){"(Name of original)"==t(".cdp-togglable-name-b").text()?(t(".cdp-togglable-name-b").text("(blank)"),t(".cdp-togglable-name-b").tooltipster("content","Change it to (Name of original)")):(t(".cdp-togglable-name-b").text("(Name of original)"),t(".cdp-togglable-name-b").tooltipster("content","Change it to blank"));l()}),t(".cdp-select").niceSelect(),t(".cdp-tooltip").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:4,side:"top",contentAsHTML:!0,maxWidth:600,theme:["tooltipster-noir","tooltipster-noir-customized"],repositionOnScroll:!0}),t(".cdp-tooltip-top").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:6,side:"top",contentAsHTML:!0,maxWidth:400,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-center"],repositionOnScroll:!0}),t("#cdp-d-table").length>0&&(i=new IcPagination(t("#cdp-d-table"),"#cdp-d-table-pagi",{itemsOnPage:25,useParams:!1,emptylist:'<div class="cdp-center">No items to show, try with other filters!</div>'})),t(".cdp-copy-button").on("mouseup",function(){h(!0)});let D=(e,o,i,c)=>t(`<a class="ab-item cdp-dropdown-menu cdp-dd-item cdp-dd-ud${0==e?" cdp-bnew-notis":""}" data-token="${o}">\n <div style="display: block; width: calc(100% - 3px);">\n <div class="cdp-dropdown-left${1==i?" cdp-red":""}">${"delete"==c?"Deleting Posts":"Copying Posts"}</div>\n <div class="cdp-dropdown-right cdp-noti-kill-btn">Kill</div>\n </div>\n </a>`),P=(e,o,i)=>t(`<a class="ab-item cdp-dropdown-menu cdp-dd-item cdp-dd-d${0==e?" cdp-bnew-notis":""}" data-token="${o}">\n <div style="display: block; width: calc(100% - 3px);">\n <div class="cdp-dropdown-left">${"delete"==i?"Deleting Posts":"Copying Posts"}</div>\n <div class="cdp-dropdown-right cdp-noti-hide-btn">Hide</div>\n </div>\n </a>`);function I(t,e){let o=t,i=e;t.length<e.length&&(o=e,i=t);let c=o.length;return 0==c?1:(c-function(t,e){t=t.toLowerCase(),e=e.toLowerCase();let o=new Array;for(let i=0;i<=t.length;i++){let c=i;for(let n=0;n<=e.length;n++)if(0==i)o[n]=n;else if(n>0){let d=o[n-1];t.charAt(i-1)!=e.charAt(n-1)&&(d=Math.min(Math.min(d,c),o[n])+1),o[n-1]=c,c=d}i>0&&(o[e.length]=c)}return o[e.length]}(o,i))/parseFloat(c)}function S(o,i){z(!0),t(".cdp-tooltip-before-options").show(),t(".cdp-tooltip-full-options").hide(),$inputs=t(t(".cdp-tooltip-content").find("input, select"));for(let e=0;e<$inputs.length;++e){let o=t($inputs[e]);if("checkbox"==o.attr("type"))o.is(":checked")?o.attr("checked","checked"):o.removeAttr("checked");else if(t(o).is("select"))if("tooltip-which-profile-first"==t(o).attr("name")){let e=t(t('[name="tooltip-which-profile-first"]')[0]).val();"custom"==e||null==e?setTimeout(()=>{t('[name="tooltip-which-profile-first"]').val("custom")},50):setTimeout(()=>{t('[name="tooltip-which-profile-first"]').val(e)},50)}else{let e=t('[name="tooltip-which-profile-second"] option:selected').map(function(t,e){return this.value}).get()[0];"custom"==e||null==e?setTimeout(()=>{t('[name="tooltip-which-profile-second"]').val("custom")},50):setTimeout(()=>{t('[name="tooltip-which-profile-second"]').val(e)},50)}else o.attr("value",o.val())}return cdp_tooltips_update_content(),e=t(i.origin).attr("data-cdp-id"),!0}function N(e,o){$parent=t(o.origin).parents(".row-actions"),$parent.css({left:0});let i=t(t("a.menu-top.toplevel_page_copy-delete-posts")[0]).attr("href");t(".cdp-tooltip-info-intt").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:6,side:"top",contentAsHTML:!0,content:`Define your copy settings <a href="${i}">here</a>.`,maxWidth:400,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-center"],repositionOnScroll:!0}),s&&jQuery.cdp.isPremium()?t(".cdp-tooltip-premium-spc-3").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:"If you’re on a multisite you can copy it to other sites.",contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}):(t(".cdp-tooltip-premium-spc-2").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'If you’re on a multisite you can copy it to other sites with the Premium Plugin. <a href="https://sellcodes.com/CylMIdJD" target="_blank">Pre-order it now</a>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),t(".cdp-tooltip-premium-spc").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'This feature will come soon as part of the Premium Plugin. You can <a href="https://sellcodes.com/CylMIdJD" target="_blank">pre-order now</a> at a <b>huge discount</b>.',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),t(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").addClass("cdp-premium-element"),t(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").find("input, select").prop("disabled",!0),t(".cdp-tooltip-premium-spc-4").tooltipster("content",'You can copy it to other sites with the Premium Plugin.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Pre-order it now</a>'),cdp_tooltips_update_content())}function Q(e,o){return $parent=t(o.origin).parents(".row-actions"),$parent.css({left:""}),!1}function M(){return t(t(".cdp-tooltip-content").html())}function A(){setTimeout(()=>{let e=t.tooltipster.instances();for(instance in e)e[instance].reposition()},10)}function z(e=!1){if(e){let e=t.tooltipster.instances();for(instance in e)e[instance].close()}else setTimeout(()=>{let e=t.tooltipster.instances();for(instance in e)e[instance].close()},10)}if(t(".cdp-admin-bar-noti").length>0&&setInterval(()=>{w(t=>{$(t)})},7e3),t(".cdp-drag-name").draggable({containment:".cdp-drags-cont",scroll:!1,helper:"clone",revert:"invalid"}),t(".cdp-names-real-input").droppable({drop:function(e,o){$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],t(this).html(`${t(this).html()}${$picks[t(o.helper).attr("data-cdp-val")]}`),l()}}),"undefined"!=typeof pagenow&&["edit-page","edit-post"].includes(pagenow)&&t(".column-cb, .check-column").find("input").prop("checked",!1),t("#titlediv").find(".inside").length>0&&t("#cdp-original-post").length>0){let e=t("#cdp-original-post").attr("data-cdp-parent"),o=t("#cdp-original-post").attr("data-cdp-parent-url");t("#titlediv").find(".inside").append(t(`<div style="padding-left: 10px">This post is a duplicate of <a href="${o}" target="_blank">${e}</a></div>`))}t(".cdp-preloader-c").length>0&&(l(),u(),v(),setTimeout(()=>{r(".cdp-names-prefix"),r(".cdp-names-suffix")},1e3),function(){let e=t(".cdp-tab-active");for(let o=0;o<e.length;o++){let i=t(`#${t(e[o]).attr("data-box")}`);i.show(),i.css({"max-height":"",height:""});let c=i.height();t(c).css({"max-height":c+"px",height:c+"px"})}}()),setTimeout(()=>{t(".cdp-container").is(":hidden")&&setTimeout(()=>{jQuery(".cdp-preloader-c").hide(),jQuery(".cdp-container").css({opacity:0}),jQuery(".cdp-container").show(),jQuery(".cdp-container").animate({opacity:1},300)},400)},5e3)}),jQuery(window).on("load",function(){setTimeout(()=>{jQuery(".cdp-preloader-c").hide(),jQuery(".cdp-container").css({opacity:0}),jQuery(".cdp-container").show(),jQuery(".cdp-container").animate({opacity:1},300);const t=void 0!==jQuery.cdp&&void 0!==jQuery.cdp.isPremium;jQuery(".cdp-tooltip-premium-dc").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'This feature will come soon as part of the Premium Plugin. You can <a href="https://sellcodes.com/CylMIdJD" target="_blank">pre-order now</a> at a <b>huge discount</b>.',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),t&&jQuery.cdp.isPremium()?(jQuery(".cdp-tooltip-premium-spc-3").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:"If you’re on a multisite you can copy it to other sites.",contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),jQuery(".cdp-tooltip-premium-spc-3").addClass("cdp-premium-element"),jQuery(".cdp-tooltip-premium-spc-3").find("input, select").prop("disabled",!0)):(jQuery('.cdp-option-premium [value="3"]').prop("disabled",!0),setTimeout(()=>{jQuery(".cdp-premium-in-select").find('.option[data-value="premium"]').addClass("cdp-tooltip-premium disabled"),jQuery(".cdp-option-premium").find('.option[data-value="3"]').addClass("cdp-tooltip-premium disabled"),jQuery(".cdp-tooltip-premium-spc-2").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'If you’re on a multisite you can copy it to other sites with the Premium Plugin. <a href="https://sellcodes.com/CylMIdJD" target="_blank">Pre-order it now</a>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),jQuery(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").addClass("cdp-premium-element"),jQuery(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").find("input, select").prop("disabled",!0),jQuery(".cdp-tooltip-premium-spc-4").tooltipster("content",'You can copy it to other sites with the Premium Plugin.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Pre-order it now</a>'),function(t){let e=void 0!==t?t:".cdp-tooltip-premium",o=-15;isNaN(parseInt(jQuery(e).attr("data-top")))||(o=parseInt(jQuery(e).attr("data-top")));jQuery(e).tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:o,side:"top",content:'This feature will come soon as part of the Premium Plugin. You can <a href="https://sellcodes.com/CylMIdJD" target="_blank">pre-order now</a> at a <b>huge discount</b>.',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),i=e,jQuery(i).addClass("cdp-premium-element"),jQuery(i).find("input, select").prop("disabled",!0);var i}(),cdp_tooltips_update_content()},1e3))},400)}),function(t){function e(t,e){if(!(t.originalEvent.touches.length>1)){t.preventDefault();let o=t.originalEvent.changedTouches[0],i=document.createEvent("MouseEvents");i.initMouseEvent(e,!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(i)}}if(t.support.touch="ontouchend"in document,t.support.touch){let o,i=t.ui.mouse.prototype,c=i._mouseInit,n=i._mouseDestroy;i._touchStart=function(t){!o&&this._mouseCapture(t.originalEvent.changedTouches[0])&&(o=!0,this._touchMoved=!1,e(t,"mouseover"),e(t,"mousemove"),e(t,"mousedown"))},i._touchMove=function(t){o&&(this._touchMoved=!0,e(t,"mousemove"))},i._touchEnd=function(t){o&&(e(t,"mouseup"),e(t,"mouseout"),this._touchMoved||e(t,"click"),o=!1)},i._mouseInit=function(){let e=this;e.element.bind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),c.call(e)},i._mouseDestroy=function(){let e=this;e.element.unbind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),n.call(e)}}}(jQuery);
|
copy-delete-posts.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Plugin Name: Copy Delete Posts
|
4 |
* Plugin URI: https://copy-delete-posts.com
|
5 |
* Description: The best solution to easily make duplicates of your posts & pages, and delete them in one go.
|
6 |
-
* Version: 1.0.
|
7 |
* Author: Copy Delete Posts
|
8 |
-
* Author URI: https://copy-delete-posts.com
|
9 |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
10 |
|
11 |
// Exit if accessed directly.
|
@@ -17,7 +17,7 @@ if (!defined('ABSPATH')) exit;
|
|
17 |
*/
|
18 |
|
19 |
// Plugin constants
|
20 |
-
define('CDP_VERSION', '1.0.
|
21 |
define('CDP_WP_VERSION', get_bloginfo('version'));
|
22 |
define('CDP_SCRIPT_DEBUG', false);
|
23 |
$cdp_plug_url = plugins_url('', __FILE__);
|
@@ -37,6 +37,7 @@ if (!defined('ABSPATH')) exit;
|
|
37 |
}
|
38 |
|
39 |
}
|
|
|
40 |
/** –– **/
|
41 |
|
42 |
/** –– **\
|
@@ -497,13 +498,12 @@ if (!defined('ABSPATH')) exit;
|
|
497 |
if ($i == ($size - 1)) $last = $otsk;
|
498 |
}
|
499 |
|
500 |
-
if ($last == $tsk || $falsed == false || $cdp_cron[$tok]['tasks'][$last] != false) {
|
|
|
501 |
$cdp_cron[$tok]['done'] = current_time('timestamp');
|
502 |
$cdp_cron[$tok]['shown'] = false;
|
503 |
}
|
504 |
|
505 |
-
update_option('_cdp_crons', $cdp_cron);
|
506 |
-
|
507 |
});
|
508 |
/** –– **/
|
509 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Plugin Name: Copy & Delete Posts
|
4 |
* Plugin URI: https://copy-delete-posts.com
|
5 |
* Description: The best solution to easily make duplicates of your posts & pages, and delete them in one go.
|
6 |
+
* Version: 1.0.5
|
7 |
* Author: Copy Delete Posts
|
8 |
+
* Author URI: https://copy-delete-posts.com/
|
9 |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
10 |
|
11 |
// Exit if accessed directly.
|
17 |
*/
|
18 |
|
19 |
// Plugin constants
|
20 |
+
define('CDP_VERSION', '1.0.5');
|
21 |
define('CDP_WP_VERSION', get_bloginfo('version'));
|
22 |
define('CDP_SCRIPT_DEBUG', false);
|
23 |
$cdp_plug_url = plugins_url('', __FILE__);
|
37 |
}
|
38 |
|
39 |
}
|
40 |
+
|
41 |
/** –– **/
|
42 |
|
43 |
/** –– **\
|
498 |
if ($i == ($size - 1)) $last = $otsk;
|
499 |
}
|
500 |
|
501 |
+
if ($tsk == '-0' || $last == $tsk || $falsed == false || $cdp_cron[$tok]['tasks'][$last] != false) {
|
502 |
+
error_log('spotting as done');
|
503 |
$cdp_cron[$tok]['done'] = current_time('timestamp');
|
504 |
$cdp_cron[$tok]['shown'] = false;
|
505 |
}
|
506 |
|
|
|
|
|
507 |
});
|
508 |
/** –– **/
|
509 |
|
menu/configuration.php
CHANGED
@@ -89,9 +89,8 @@ function cdp_configuration() {
|
|
89 |
?>
|
90 |
|
91 |
<style>
|
92 |
-
|
93 |
-
#
|
94 |
-
#wpbody {overflow-y: scroll; overflow-x: auto; max-height: 100vh; min-height: calc(100vh - 32px);}
|
95 |
#wpfooter {display: none;}
|
96 |
</style>
|
97 |
<?php if ($areWePro && function_exists('cdpp_profile_manager_html')) cdpp_profile_manager_html(); ?>
|
89 |
?>
|
90 |
|
91 |
<style>
|
92 |
+
#wpcontent {padding-left: 2px !important;}
|
93 |
+
#wpbody {overflow-y: scroll;overflow-x: auto;max-height: calc(100vh - 32px);min-height: calc(100vh - 32px);}
|
|
|
94 |
#wpfooter {display: none;}
|
95 |
</style>
|
96 |
<?php if ($areWePro && function_exists('cdpp_profile_manager_html')) cdpp_profile_manager_html(); ?>
|
post/handler.php
CHANGED
@@ -63,6 +63,10 @@
|
|
63 |
else if ($_POST['f'] == 'give_me_current_tasks') cdp_just_get_tasks();
|
64 |
else if ($_POST['f'] == 'debug_function') cdp_debug_function();
|
65 |
else if ($_POST['f'] == 'delete_success_img') delete_option('_cdp_show_copy');
|
|
|
|
|
|
|
|
|
66 |
else echo 'error';
|
67 |
|
68 |
} else echo 'error';
|
@@ -912,6 +916,9 @@
|
|
912 |
* @return object of success message — WARNING: ALWAYS
|
913 |
*/
|
914 |
function cdp_set_noti_as_seen() {
|
|
|
|
|
|
|
915 |
$token = ((isset($_POST['noti_token']))?sanitize_text_field($_POST['noti_token']):false);
|
916 |
$cdp_cron = get_option('_cdp_crons', array());
|
917 |
$cdp_cron[$token]['shown'] = true;
|
63 |
else if ($_POST['f'] == 'give_me_current_tasks') cdp_just_get_tasks();
|
64 |
else if ($_POST['f'] == 'debug_function') cdp_debug_function();
|
65 |
else if ($_POST['f'] == 'delete_success_img') delete_option('_cdp_show_copy');
|
66 |
+
else if ($_POST['f'] == 'save_redi_state' && $areWePro) cdpp_save_redi_state();
|
67 |
+
else if ($_POST['f'] == 'save_redirections' && $areWePro) cdpp_save_redirections();
|
68 |
+
else if ($_POST['f'] == 'delete_redirect' && $areWePro) cdpp_delete_redirection();
|
69 |
+
else if ($_POST['f'] == 'switch_redirects' && $areWePro) cdpp_switch_redirects();
|
70 |
else echo 'error';
|
71 |
|
72 |
} else echo 'error';
|
916 |
* @return object of success message — WARNING: ALWAYS
|
917 |
*/
|
918 |
function cdp_set_noti_as_seen() {
|
919 |
+
if (wp_doing_ajax()) return;
|
920 |
+
if (wp_doing_cron()) return;
|
921 |
+
|
922 |
$token = ((isset($_POST['noti_token']))?sanitize_text_field($_POST['noti_token']):false);
|
923 |
$cdp_cron = get_option('_cdp_crons', array());
|
924 |
$cdp_cron[$token]['shown'] = true;
|
readme.txt
CHANGED
@@ -1,58 +1,87 @@
|
|
1 |
=== Copy Delete Posts ===
|
2 |
-
Contributors: CopyDeletePosts
|
3 |
-
Tags: Copy posts,
|
4 |
Requires at least: 4.9
|
5 |
Tested up to: 5.4
|
6 |
-
Stable tag: 1.0.
|
7 |
License: GPLv3
|
8 |
Requires PHP: 7.0
|
9 |
|
10 |
-
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
The new copy post option will be visible on:
|
23 |
|
24 |
- Your overview of pages and posts
|
25 |
-
- Edit screens (post or
|
26 |
- Admin bar (at the top)
|
27 |
-
- Bulk-option on your list of pages and posts
|
28 |
- Gutenberg editor
|
29 |
|
30 |
-
The plugin also offers an intuitive tool to define how the new posts or pages should be named (e.g. you can add a counter, or the date of copying etc.).
|
31 |
|
32 |
-
Other options
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
- Define to show a reference to the original copied page or post
|
38 |
|
39 |
-
Not only can you
|
40 |
|
41 |
-
As part of
|
42 |
|
43 |
-
- Where the plugin should look for duplicates (posts, pages or custom posts)
|
44 |
-
- What should count as duplicate (i.e. have same title, slug, excerpt or word count)
|
45 |
-
- Which version you want to keep (oldest version or newest version)
|
46 |
|
47 |
-
|
48 |
|
49 |
-
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
-
|
54 |
-
|
55 |
-
-
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
Just try it out! You'll love it :)
|
58 |
|
@@ -67,16 +96,44 @@ Just try it out! You'll love it :)
|
|
67 |
|
68 |
= Admin Installer via zip =
|
69 |
1. Visit the Add New plugin screen and click the "Upload Plugin" button.
|
70 |
-
2. Click the "Browse..." button and select zip file of our plugin.
|
71 |
3. Click "Install Now" button.
|
72 |
4. Once uploading is done, activate Copy & Delete Posts.
|
73 |
-
5. The plugin should be shown below settings menu.
|
74 |
|
75 |
== Frequently Asked Questions ==
|
76 |
-
|
77 |
-
|
|
|
78 |
`define('ALTERNATE_WP_CRON', true);`
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
|
82 |
== Screenshots ==
|
@@ -91,6 +148,20 @@ It should fix the issue :)
|
|
91 |
|
92 |
== Changelog ==
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
= 1.0.2 =
|
95 |
* Added new cool GIF inside the intro
|
96 |
* Added photos to the screenshots library
|
1 |
=== Copy Delete Posts ===
|
2 |
+
Contributors: CopyDeletePosts, copydelete
|
3 |
+
Tags: Copy posts, Copy pages, Duplicate posts, Duplicate pages, Clone posts, Clone pages, Delete posts, Delete pages, Duplicate post, Duplicator, copy post, copy page
|
4 |
Requires at least: 4.9
|
5 |
Tested up to: 5.4
|
6 |
+
Stable tag: 1.0.5
|
7 |
License: GPLv3
|
8 |
Requires PHP: 7.0
|
9 |
|
10 |
+
Duplicate posts and delete posts
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
+
Massively increase your WordPress productivity!
|
15 |
|
16 |
+
This plugin makes it easy to duplicate posts or copy pages - and delete them again!
|
17 |
|
18 |
+
And why is it important to duplicate posts? Some use cases:
|
19 |
+
|
20 |
+
- Duplicate posts to save you the work to enter again the same elements you repeatedly use (e.g. content, excerpt, featured image, etc.)
|
21 |
+
- Create a different version of a page or post quickly to modify them and compare side by side (for yourself, or your client or boss)
|
22 |
+
- Create one stellar set of templates and then re-use them for different projects or clients
|
23 |
+
- Give your product page a facelift but keep the old version if you want to switch back to it later
|
24 |
+
- Create a "holiday special" template and use it for the various holidays with some adjustments
|
25 |
+
- Make duplicates for pages used in page builders with their various settings
|
26 |
+
|
27 |
+
You can also load-test your server by duplicate posts by a factor of 1,000, and see how it behaves. The plugin also allows you to easily bulk delete posts again later!
|
28 |
+
|
29 |
+
**How to use it**
|
30 |
+
|
31 |
+
For all you visual people out there:
|
32 |
+
|
33 |
+
[youtube https://youtu.be/lX8UbDy62Do]
|
34 |
+
|
35 |
+
After installation you'll see a new copy post link which, on mouse-over, shows you a tooltip (see screenshot) which allows you to copy posts or copy pages with different options:
|
36 |
+
|
37 |
+
- Copy page or duplicate post instantly with one click
|
38 |
+
- Specify how often you want to duplicate pages or clone posts
|
39 |
+
- Choose to see more copy post options and define specifically what elements should be copied for this copy page or copy post operation
|
40 |
|
41 |
The new copy post option will be visible on:
|
42 |
|
43 |
- Your overview of pages and posts
|
44 |
+
- Edit screens (duplicate post or duplicate page on the respective edit post or page screens)
|
45 |
- Admin bar (at the top)
|
46 |
+
- Bulk-option to copy posts or copy pages on your list of pages and posts
|
47 |
- Gutenberg editor
|
48 |
|
|
|
49 |
|
50 |
+
You can remove copy post or copy pages button on any of these places from the plugin menu (Other options). Copy post function on the editor screen can help you quickly multiply post you are working on currently (and open it in the new tab immediately, too), so you can quickly create two variations, pick the one you like better, and later use the remove duplicates capabilities to trash duplicate that you didn’t like.
|
51 |
|
52 |
+
The copy posts plugin also offers an intuitive tool to define how the new posts or pages should be named (e.g. you can add a counter or the time/date of copying, etc.). So you can replicate post that will have a simple name, e.g. “ExamplePost - #4” - where number at the end will increase with each copy made; or you can replicate page with much more detailed copy-name such as: “ExamplePage created at 12:15:01 on Saturday, July 4th, 2020” - thanks to PHP date/time shortcodes being supported in custom date settings. Long name always help to spot the clone post more easily, either for further use or to remove duplicate.
|
53 |
+
|
54 |
+
Need to multiply page but also it’s child-page(s)? You can multiply pages all together with child-pages with all the copy settings that are applied to the parent page copy.
|
55 |
+
|
56 |
+
Other options available if you copy posts:
|
57 |
+
|
58 |
+
- Define where you should be navigated to after you copy posts or copy pages
|
59 |
+
- Define which users (roles) should be allowed to copy posts or copy pages
|
60 |
+
- Define which content types should be allowed to be copied, i.e. copy posts, copy pages, and copy custom post types
|
61 |
- Define to show a reference to the original copied page or post
|
62 |
|
63 |
+
Not only can you clone posts or clone pages quickly, but the plugin also offers a sophisticated tool to delete duplicate posts or delete pages.
|
64 |
|
65 |
+
As part of the cleanup process, you can define:
|
66 |
|
67 |
+
- Where the plugin should look for duplicates (i.e. delete posts, delete pages or delete custom posts)
|
68 |
+
- What should count as duplicate post or duplicate page (i.e. have the same title, slug, excerpt or word count)
|
69 |
+
- Which version you want to keep (oldest version - original or newest version - latest clone)
|
70 |
|
71 |
+
Even if you used this replicator tool to multiply pages or multiply posts in huge numbers, and you want to use this tool to trash duplicates every now and then, but leave out a few specific ones - you will be able to easily find duplicates when you use our duplicates scanner. After setting the parameters to find duplicates, you can use a search box to make sure you don’t delete duplicates you don’t want to, or remove duplicates to the last one (original included!). The duplicate checker tool can help you find duplicate and immediately visually check the clone page by clicking on the URL/slug link, in case you can’t tell by the name or the date clone page was created.
|
72 |
|
73 |
+
You can select to throttle the delete posts or delete pages process - which you may want to do when you’re on a slow server (note however: the plugin codes to delete posts or delete pages are already optimized, so usually there shouldn’t be an issue).
|
74 |
|
75 |
+
Copy Delete Posts is a cloner tool with a beautiful, modern design and features going beyond today’s post duplicator tools. Hopefully this will make it your favorite posts duplicator tool :)
|
76 |
+
|
77 |
+
The free copy posts plugin offers a lot of options - if you want even more options to copy posts or copy pages, then check out the premium copy posts plugin (currently under development) which will offer the following additional features:
|
78 |
+
|
79 |
+
- Use several configuration sets to copy posts or delete posts - useful when you want to quickly switch between the copy types, without having to go to the settings page.
|
80 |
+
- Export and import configuration sets - a handy tool for all of us who manage multiple sites and regularly replicate posts.
|
81 |
+
- Also include information from third party plugins when you copy posts (e.g. Yoast-information linked to pages/posts)
|
82 |
+
- Replicate pages across multisite will also prove to be a real time-saver for multisite administrators
|
83 |
+
- Automatically delete pages or posts - extremely useful for users that multiply posts or pages at high levels.
|
84 |
+
- Apply automatic redirects for deleted pages or posts
|
85 |
|
86 |
Just try it out! You'll love it :)
|
87 |
|
96 |
|
97 |
= Admin Installer via zip =
|
98 |
1. Visit the Add New plugin screen and click the "Upload Plugin" button.
|
99 |
+
2. Click the "Browse..." button and select the zip file of our plugin.
|
100 |
3. Click "Install Now" button.
|
101 |
4. Once uploading is done, activate Copy & Delete Posts.
|
102 |
+
5. The plugin should be shown below the settings menu.
|
103 |
|
104 |
== Frequently Asked Questions ==
|
105 |
+
|
106 |
+
= It seems the post deletion process doesn’t work. Why? =
|
107 |
+
If you are trying to delete posts and it doesn’t work try to append your wp-config.php with this line of code:
|
108 |
`define('ALTERNATE_WP_CRON', true);`
|
109 |
+
Does it work if you try to delete posts then? If not, please reach out to us in the support forum.
|
110 |
+
|
111 |
+
= When I copy post or copy page, why is title of the duplicate not the same? =
|
112 |
+
If you copy posts or copy pages and want the new versions to have exactly the same title as the original post, make sure that prefix and suffix fields are blank in the “What name(s) should the copies have?” section of the Copy Delete Posts plugin area in the WordPress Dashboard.
|
113 |
+
|
114 |
+
= If I duplicate posts, how do I know what their original page was? =
|
115 |
+
It can be a challenge to keep track of the original content if you duplicate posts.To prevent this we suggest to not leave the prefix and suffix fields empty (which define the name of the new posts) if you duplicate posts. However, even if you want to duplicate posts without any prefix or suffix, you can solve the issue as follows: Go to section “Other options” (on the duplicate post plugin configuration page), and at the bottom of this section you will find the option “Show reference to original item?”. Check this to ensure you can always keep track of original posts when duplicate pages or posts.
|
116 |
+
|
117 |
+
= Can I limit who can duplicate posts on my site? =
|
118 |
+
By default only Administrators can access the plugin and copy posts or copy pages. You can extend these permissions to other user roles by going to the section “Other options”, and then tick boxes next to WP user roles that you want to give permission to. Then also those roles can duplicate posts (or delete posts).
|
119 |
+
|
120 |
+
= I want to duplicate posts *only*, i.e. not duplicate pages. Is that possible? =
|
121 |
+
You can limit the features to duplicate posts only by going to the “Other options”-chapter and select where it says “Content types which can be copied” to only copy posts, copy pages, copy custom posts or all of these.
|
122 |
+
|
123 |
+
= How can I make bulk copies? =
|
124 |
+
If you want to duplicate posts en masse, select the copy posts option in the “Bulk actions” menu. You’ll see the lightbox asking you to specify your duplicate post options (i.e. which elements to copy).
|
125 |
+
|
126 |
+
= I can duplicate posts but it takes a long time. Why? =
|
127 |
+
If you duplicate posts and it takes long, then you may have selected to include attachments in the duplicate posts configurations. Go to the second chapter titled “Which elements should be copied?” and de-select the attachments option to exclude those when you duplicate posts.
|
128 |
+
|
129 |
+
= Can I bulk delete posts created by this plugin? =
|
130 |
+
To easily clean posts or delete duplicate pages that were created by this plugin, go to ”Delete duplicate posts or pages” section, tab “Manual cleanup”. Select Posts, Pages and Custom Posts, and uncheck all other filters, then hit the Scan button. In the empty results list, you will see the message “Click here to show all copies…” - “here” link will show you all posts and pages created by our multiplier plugin.
|
131 |
+
|
132 |
+
= Which dupicate post features do you have which the other plugins don’t? =
|
133 |
+
Other duplicate post plugins mostly only allow you to duplicate post to the same site. With the Copy Delete Posts plugin (premium version) you can duplicate post to other sites, e.g. duplicate post to a multisite, or duplicate post to a site on a different domain altogether (we’re currently working on this duplicate post functionality). Also, other duplicate post plugins don’t give you the granularity to define how to duplicate post, e.g. which elements specifically should appear on the cloned posts.
|
134 |
+
|
135 |
+
= Is this plugin GDPR friendly? =
|
136 |
+
Copy Delete Posts WordPress plugin doesn’t store any site visitor information so it is completely GDPR friendly.
|
137 |
|
138 |
|
139 |
== Screenshots ==
|
148 |
|
149 |
== Changelog ==
|
150 |
|
151 |
+
= 1.0.5 =
|
152 |
+
* Auto-refresh list of notifications
|
153 |
+
* Fixed issue when notification wasn't updated correctly
|
154 |
+
* Improvement search engine (Deletion Section)
|
155 |
+
* Scrollbar fix on plugin configuration page
|
156 |
+
|
157 |
+
= 1.0.4 =
|
158 |
+
* This is Hotfix
|
159 |
+
* Fixed issue during activation which shows "Header Error"
|
160 |
+
|
161 |
+
= 1.0.3 =
|
162 |
+
* Tested with new version of WordPress
|
163 |
+
* Fixed visual issue with deletion process
|
164 |
+
|
165 |
= 1.0.2 =
|
166 |
* Added new cool GIF inside the intro
|
167 |
* Added photos to the screenshots library
|