Duplicate Post - Version 1.0.0

Version Description

  • Initial release

=

Download this release

Release Info

Developer copydeleteposts
Plugin Icon wp plugin Duplicate Post
Version 1.0.0
Comparing to
See all releases

Version 1.0.0

assets/css/cdp-editor.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #delete-action,#publishing-action{float: none!important;line-height: 1.5}#delete-action{width: calc(100% - 121px)!important}#publishing-action{position: absolute!important;right: 10px!important;bottom: 12px!important}@media screen and (max-width: 782px){#delete-action,#publishing-action{line-height: 1.6!important}#publishing-action{bottom: 7px!important}}
assets/css/cdp-global.min.css ADDED
@@ -0,0 +1 @@
 
1
+ @import url('https://fonts.googleapis.com/css?family=Montserrat:200,300,400,400i,500,600,700,800,900&display=swap');.cdp-admin-bar-icon-noti::before{font-family: dashicons;content: '\f465';top: 5px;position: relative;color: rgba(240,245,250,.6);margin-right: 3px;font-size: 18px}.cdp-admin-bar-icon-noti{line-height: 1!important}.cdp-admin-bar-copy{line-height: 1!important}.cdp-ab-sub .ab-item[target="_self"]{display: none!important}.cdp-dropdown-submenu{padding-top: 0!important;padding: 0!important}.cdp-dropdown-submenu *{line-height: 25px!important}.cdp-dropdown-left-header{height: 25px!important;display: inline-block!important;width: calc(100% - 35px)!important;color: #eee!important;font-weight: bolder!important}.cdp-undone-notis .cdp-dropdown-left{cursor: progress}.cdp-dropdown-left{height: 25px!important;display: inline-block!important;width: calc(100% - 35px)!important}.cdp-dropdown-right{height: 25px!important;display: inline-block!important;width: 35px!important;text-align: right!important;cursor: pointer}.cdp-dropdown-hr{display: block;background: #035baa;border-color: #aaa;border-width: 1;margin-top: 4px;margin-bottom: 3px}.cdp-bnew-notis{font-style: italic}.cdp-tooltip-content{display: none}.cdp-copy-loader-overlay .cdp-text-overlay{position: absolute;left: calc(50% - 200px);top: calc(50% - 50px);height: 130px;width: 400px;margin: 0px auto;font-weight: bolder;overflow: hidden;color: #fff;text-align: center}.cdp-copy-loader-overlay{display: none;position: fixed;top: 0;left: 0;width: 100vw;height: 100vh;background: rgba(0,0,0,.4);z-index: 199999}.cdp-modal{display: none;position: fixed;width: 100vw;height: 100vh;top: 0;left: 0;background: rgba(80,182,168,.32);z-index: 100000}.cdp-modal input,.cdp-tooltip-content input{box-shadow: none!important;outline: 0!important}.cdp-modal input:focus,.cdp-tooltip-content input:focus{border-color: #50b6a8!important;box-shadow: none!important;outline: 0!important}.cdp-modal-content{position: absolute;top: 50%;left: 50%;line-height: normal;transform: translate(-50%,-50%);color: #333;background: #fff;z-index: 200000;min-width: 720px;max-width: 80vw;width: 35%;overflow-y: auto;max-height: 70vh}.cdp-modal-content .cdp-button{border-radius: 3px!important;font-size: 18px!important}.cdp-button.cdp-d-real-delete{border-radius: 3px;font-weight: 600;font-size: 19px!important;width: 569px!important;height: 53px!important}.cdp-modal-padding{padding: 10px 15px}.cdp-modal-title{color: #000;text-align: center;font-size: 22px;font-weight: bolder;background: #f2f2f2;border-bottom: 1px solid #31538f;min-width: 300px}.cdp-modal-bottom-margin{margin-bottom: 10px}.cdp-notification-box{position: fixed;top: 15px;right: 15px;min-width: 100px;max-width: 40vw;z-index: 1000000}.cdp-notification.is-info,.cdp-title.is-info{background-color: rgb(12,150,183)}.cdp-notification.is-danger,.cdp-title.is-danger{background-color: rgb(228,112,111)}.cdp-notification.is-success,.cdp-title.is-success{background-color: rgb(109,183,153)}.cdp-alert-icon{height: 100%;width: 25px}.cdp-alert-icon .cdp-icon-bg{width: 25px;height: 25px}.cdp-alert-msg-title{padding-left: 40px!important}.cdp-notification .cdp-icon-bg{background-position: center;background-repeat: no-repeat;position: absolute;height: calc(100% - 36px)}.cdp-notification.is-success .cdp-icon-bg{background-image: url('../imgs/alert_success.png')}.cdp-notification.is-warning .cdp-icon-bg{background-image: url('../imgs/alert_warning.png')}.cdp-notification.is-info .cdp-icon-bg{background-image: url('../imgs/alert_info.png')}.cdp-notification.is-danger .cdp-icon-bg{background-image: url('../imgs/alert_error.png')}.cdp-notification.is-warning,.cdp-title.is-warning{background-color: rgb(236,177,53)}.cdp-title{margin-bottom: 3px;font-weight: 500;font-size: 15px!important}.cdp-notification{border-radius: 3px;padding: 18px 36px 18px 20px!important;position: relative;margin-bottom: 15px;padding-left: 3px;font-family: 'Montserrat',sans-serif!important;font-size: 15px!important;font-weight: 300;color: white}.cdp-times-button{top: 2px;right: 1px;position: absolute;background: none!important;border: none;font-size: 24px;cursor: pointer;font-weight: 500;color: white;opacity: .6;transition: opacity .2s;padding: 2px 9px!important}.cdp-times-button:hover{cursor: pointer;opacity: 1}.cdp-noti-hide{display: none}.cdp-modal-times{position: absolute;top: 10px;right: 10px;transition: all .3s;cursor: pointer;background: url('../imgs/close.png');width: 20px;height: 20px;background-position: center;background-repeat: no-repeat;background-size: cover;opacity: .4}.cdp-modal-times.cdp-no-border{border: 0!important}.cdp-modal-times:hover{opacity: 1}.cdp-modal *{font-family: 'Montserrat',sans-serif!important;font-weight: 400}.cdp-modal a{color: #50b6a8}.cdp-modal a:hover{color: #48a598}.cdp-modal a:active{color: #429388}.cdp-modal-checkboxes,.cdp-modal-checkboxes-r{width: 100%}.cdp-modal-checkboxes span,.cdp-modal-checkboxes-r span{font-weight: 400!important;font-size: 15px;line-height: 33px!important;cursor: pointer;color: black}.cdp-modal-checkboxes label,.cdp-modal-checkboxes-r label{display: inline-block;width: calc(25% - 4px);line-height: 2.5}.cdp-modal-checkboxes-three label:nth-child(1){width: calc(25% - 4px)!important}.cdp-modal-checkboxes-three label:nth-child(2):not(.cdp-yoast){width: calc(25% - 4px)!important}.cdp-modal-checkboxes-three label:nth-child(3),label.cdp-yoast{width: calc(50% - 4px)!important;max-width: 175px}.cdp-modal-copy-times{margin-top: 10px;text-align: center}.cdp-modal-copy-times-tooltip{text-align: center}.cdp-modal-copy-times-content{position: relative;padding: 17px;background: #f9f9f9}.cdp-copy-modal .cdp-modal-content{width: 850px!important;min-width: 850px!important;border-radius: 3px}.cdp-cp-pad{padding: 20px 65px}.cdp-modal-content h2{font-size: 16px;font-weight: 600}.cdp-modal-input-times{min-height: 36px!important;max-height: 36px!important;max-width: 60px!important;font-size: 15px!important;line-height: 36px!important}.cdp-modal-input-times{width: 55px;text-align: center;font-family: 'Montserrat',sans-serif;box-shadow: 0 0 0 transparent;padding: 5px 2px;border-radius: 3px;border: 1px solid #7e8993!important;background-color: #fff;color: #32373c;-webkit-appearance: none;-moz-appearance: textfield}.cdp-modal-input-times::-webkit-outer-spin-button,.cdp-modal-input-times::-webkit-inner-spin-button{-webkit-appearance: none;-moz-appearance: textfield}.cdp-modal-input-times-tooltip{width: 59px!important;font-family: 'Montserrat',sans-serif;margin: 0}.cdp-p-right-l{margin-left: 7px}.cdp-p-right-h{margin-left: 15px}.cdp-low-round{border-radius: 5px!important}.cdp-rl-round{border-radius: 2px!important}.cdp-no-round{border-radius: 0px!important}.cdp-copy-now-btn-tooltip{max-width: 88px;max-height: 13px;font-size: 16px!important;line-height: 14px;font-weight: 400!important}.cdp-f-w-thin{font-weight: 100!important}.cdp-f-w-extra-light{font-weight: 200!important}.cdp-f-w-light{font-weight: 300!important}.cdp-f-w-regular{font-weight: 400!important}.cdp-f-w-medium{font-weight: 500!important}.cdp-f-w-semi-bold{font-weight: 600!important}.cdp-f-w-bold{font-weight: 600!important}.cdp-f-w-extra-bold{font-weight: 700!important}.cdp-f-w-black{font-weight: 800!important}.cdp-f-s-10{font-size: 10px!important}.cdp-f-s-11{font-size: 11px!important}.cdp-f-s-12{font-size: 12px!important}.cdp-f-s-13{font-size: 13px!important}.cdp-f-s-14{font-size: 14px!important}.cdp-f-s-15{font-size: 15px!important}.cdp-f-s-16{font-size: 16px!important}.cdp-f-s-17{font-size: 17px!important}.cdp-f-s-18{font-size: 18px!important}.cdp-f-s-19{font-size: 19px!important}.cdp-f-s-20{font-size: 20px!important}.cdp-f-s-21{font-size: 21px!important}.cdp-f-s-22{font-size: 22px!important}.cdp-f-s-30{font-size: 30px!important}.cdp-tooltip-before{height: calc(190px - 20px - 16px);width: calc(246px - 6px - 20px);padding: 10px 3px}.cdp-below-tooltip-before{font-size: 12px}.cdp-sizes-profile-tooltip{width: 118px!important;max-width: 118px!important}.cdp-info-icon{position: absolute;top: calc(50% - 8px);width: 16px;height: 16px;background: url('../imgs/info.png');display: inline-block;line-height: 16px;background-repeat: no-repeat;background-position: center;background-size: cover;margin: 0;margin-left: 3px;cursor: pointer}.cdp-tbody-of-settings .cdp-info-icon{display: none!important;visibility: hidden}.cdp-premium-icon{position: absolute;width: 16px;height: 16px;top: calc(50% - 8px);background: url('../imgs/premium.png');display: inline-block;line-height: 16px;background-repeat: no-repeat;background-position: center;background-size: cover;padding: 0;margin-left: 7px;cursor: pointer}.cdp-big-icon{width: 22px;height: 22px;top: calc(50% - 11px);line-height: 22px}.cdp-relative{position: relative}.cdp-padding-20-h{padding-top: 20px;padding-bottom: 20px}.cdp-padding-10-h{padding-top: 10px;padding-bottom: 10px}.cdp-padding-5-h{padding-top: 5px;padding-bottom: 5px}.cdp-input-border{border-width: 1px!important;border-color: rgb(198,201,206)!important;outline: 0!important;box-shadow: none!important}.cdp-input-border:focus{border-color: #50b6a8!important;outline: 0!important;box-shadow: none!important}.cdp-lh-24{line-height: 24px}.cdp-lh-30{line-height: 30px}.cdp-lh-48{line-height: 48px}.cdp-p-20-b{padding-bottom: 20px!important}.cdp-p-35-b{padding-bottom: 35px!important}.cdp-checkboxes [type="checkbox"]{color: #555;clear: none;cursor: pointer;display: inline-block;margin: -.25rem .25rem 0 0;outline: 0;padding: 0;text-align: center;vertical-align: middle;-webkit-appearance: none;box-shadow: inset 0 1px 2px rgba(0,0,0,.1);border: 1px solid #50b6a8;height: 22px;width: 22px;margin-right: 5px;margin-top: -2px;background: #fff;transition: all .3s;border-radius: 6px;margin-right: 5px}.cdp-checkboxes [type="checkbox"]:checked{background: #50b6a8}.cdp-checkboxes [type="checkbox"]:checked::before{content: '';border-top: 2px solid white;border-left: 2px solid white;height: 9px!important;width: 5px!important;margin: -.1875rem 0 0 -.25rem;margin-top: 3px;margin-left: 7px;transform: rotate(220deg);float: left;display: inline-block;vertical-align: middle}.cdp-p-25-h{padding-top: 25px;padding-bottom: 25px}.cdp-tooltip-c-t{margin-left: -20px;width: calc(100% + 40px)}#toplevel_page_copy-delete-posts img{max-height: 22px;margin-left: 6px;margin-top: -1px}.cdp-copy-alert-success{display: block!important;position: fixed;left: 0;right: 0;text-align: center;z-index: 99998}.cdp-original-info-b{max-width: calc(76vw - 340px - 180px);text-overflow: ellipsis;word-wrap: break-word;overflow: hidden;max-height: 36px}
assets/css/cdp-gutenberg.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .editor-post-trash{margin-left: 5px!important}.cdp-editor-gutenberg-copy{margin-right: 5px!important}.cdp-red{color: red!important;font-style: italic!important;pointer-events: none!important}
assets/css/cdp-select.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .nice-select{-webkit-tap-highlight-color: transparent;background-color: #fff;border-radius: 3px;border: solid 2px rgb(198,201,206);box-sizing: border-box;cursor: pointer;font-family: inherit;font-size: 14px;font-weight: 400;height: 32px;line-height: 30px!important;outline: none;padding-left: 28px!important;padding-right: 37px!important;padding-top: 0px!important;padding-bottom: 0px!important;position: relative;-webkit-transition: all 0.2s ease-in-out;transition: all 0.2s ease-in-out;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;white-space: nowrap;width: auto;outline: 0!important;display: inline-block!important;box-shadow: none!important;text-align: center;overflow: hidden!important;text-overflow: ellipsis;color: black!important}.nice-select:hover{border-color: #48a598!important}.nice-select:active,.nice-select.open,.nice-select:focus{border-color: #50b6a8!important}.nice-select.open{border-bottom-left-radius: 0;border-bottom-right-radius: 0}.cdp-sel-separat::before{content: '';border-left: 1px solid #c1c1c1;height: 34px;position: absolute;top: 9px;right: 38px}.nice-select:not(.cdp-select-padding):not(.cdp-modal-select):not(.cdp-tooltip-select):not(.cdp-per-page-select-show) .list,.cdp-sel-separat .list{margin-left: -29px!important}.nice-select:not(.cdp-select-padding):not(.cdp-tooltip-select):not(.cdp-dis-en-opt):not(.cdp-per-page-select-show):not(.cdp-pad-60-list) .option,.cdp-sel-separat:not(.cdp-pad-60-list) .option{padding-right: 40px}.nice-select:after{border-bottom: 1px solid #50b6a8;border-right: 1px solid #50b6a8;content: '';display: block;height: 8px;width: 8px;margin-top: -6px;pointer-events: none;position: absolute;right: 18px;top: 50%;-webkit-transform-origin: 66% 66%;-ms-transform-origin: 66% 66%;transform-origin: 66% 66%;-webkit-transform: rotate(45deg);-ms-transform: rotate(45deg);transform: rotate(45deg);-webkit-transition: all 0.15s ease-in-out;transition: all 0.15s ease-in-out}.nice-select:not(.cdp-select-padding):not(.cdp-tooltip-select):not(.cdp-per-page-select-show):not(.cdp-pad-49-list):not(.cdp-pad-60-list) .option{padding-left: 29px;padding-right: 34px}.nice-select.open:after{-webkit-transform: rotate(135deg);-ms-transform: rotate(135deg);transform: rotate(135deg)}.nice-select.open .list{opacity: 1;pointer-events: auto;-webkit-transform: scale(1) translateY(0);-ms-transform: scale(1) translateY(0);transform: scale(1) translateY(0)}.nice-select.disabled{border-color: rgba(198,201,206,0.5)!important;color: rgba(198,201,206,0.5)!important;pointer-events: none}.nice-select.disabled::before{border-color: rgba(198,201,206,0.7)!important}.nice-select.disabled:after{border-color: rgba(198,201,206,0.5)!important}.nice-select.wide{width: 100%}.nice-select.wide .list{left: 0!important;right: 0!important}.nice-select.right{float: right}.nice-select.right .list{left: auto;right: 0}.nice-select.small{font-size: 12px;height: 36px;line-height: 34px}.nice-select.small:after{height: 4px;width: 4px}.nice-select.small .option{line-height: 34px;min-height: 34px}.nice-select .list{background-color: #fff;border-radius: 5px;box-shadow: 0 0 0 1px rgba(68,68,68,0.11);box-sizing: border-box;margin-top: -2px;opacity: 0;padding: 0;pointer-events: none;position: fixed;margin-left: -10px;-webkit-transform-origin: 50% 0;-ms-transform-origin: 50% 0;transform-origin: 50% 0;-webkit-transform: scale(0.75) translateY(-21px);-ms-transform: scale(0.75) translateY(-21px);transform: scale(0.75) translateY(-21px);-webkit-transition: all 0.2s cubic-bezier(0.5,0,0,1.25),opacity 0.15s ease-out;transition: all 0.2s cubic-bezier(0.5,0,0,1.25),opacity 0.15s ease-out;z-index: 10000!important;max-height: 600px;overflow: auto;border-top-left-radius: 0;border-top-right-radius: 0;border: 1px solid #50b6a8;border-top: 1px solid #50b6a8}.nice-select .list:hover .option:not(:hover){background-color: transparent!important}.nice-select .option{cursor: pointer;font-weight: 400;line-height: 42px;list-style: none;min-height: 43px;outline: none;padding-left: 20px;padding-right: 44px;margin: 0!important;text-align: left;-webkit-transition: all 0.2s;transition: all 0.2s;border-bottom: 1px solid rgb(234,234,234)!important}.cdp-dd-p-43 .option{padding-right: 43px}.cdp-dd-p-40 .option{padding-right: 40px!important}.nice-select .option:last-child{border-bottom: 0}.nice-select .option:hover,.nice-select .option.focus,.nice-select .option.selected.focus{background-color: rgb(247,247,247);border-bottom: rgb(235,235,235)}.nice-select .option.selected{font-weight: 400}.nice-select .option.disabled{background-color: transparent;color: #999;cursor: default}.no-csspointerevents .nice-select .list{display: none}.no-csspointerevents .nice-select.open .list{display: block}.cdp-m-l-9-d .list{margin-left: -10px!important}.cdp-ow-border{border-width: 1px!important}.cdp-ow-border .list{border-width: 1px!important;margin-left: -21px}.cdp-select-black{color: black!important;font-size: 18px!important}.cdp-select-large{font-size: 18px!important;height: 56px!important;line-height: 56px!important;border-width: 1px!important;padding-right: 58px!important}.cdp-select-large .list{border-width: 1px!important;margin-left: 29px!important}.cdp-select-large:not(.cdp-pad-60-list):not(.cdp-tooltip-select) .list li{padding-right: 35px}.cdp-pad-49-list .option{padding-left: 49px!important}.cdp-pad-60-list .option{padding-right: 70px!important}.cdp-per-page-select-show{color: #292929!important}.cdp-per-page-select-show .list{margin-left: -21px!important;color: #292929!important}.cdp-per-page-select-show .option{padding-left: 21px!important}.cdp-dis-en-opt{width: 189px!important;height: 42px!important;text-align: center;line-height: 42px!important;font-size: 17px!important}.cdp-dis-en-opt:not(.cdp-tooltip-select) .option{padding-left: 52px!important;padding-right: 60px!important}.cdp-tooltip-select{min-height: 32px;max-height: 32px;max-width: 96px;min-width: 96px;border: 1px solid #d7d9dd!important;line-height: 30px!important;margin-top: 1px;padding-left: 10px!important;padding-right: 25px!important;text-align: left}.cdp-tooltip-select::before{content: '';border-left: 1px solid #c1c1c1;height: 20px;position: absolute;top: 5px;right: 20px}.cdp-tooltip-select::after{height: 5px;width: 5px;margin-top: -6px;right: 8px;top: calc(50% + 2px)}.cdp-tooltip-select .option{padding-left: 10px!important;padding-right: 28px!important;line-height: 30px!important;min-height: 30px!important}.cdp-tooltip-select .list{margin-left: -11px!important}.cdp-modal-select{min-height: 38px;max-height: 38px;max-width: 250px;border: 1px solid #d7d9dd!important;line-height: 38px!important;margin-top: 1px;padding-left: 10px!important;padding-right: 45px!important;text-align: left;margin-left: 5px;width: auto!important}.cdp-modal-select::before{content: '';border-left: 1px solid #c1c1c1;height: 26px;position: absolute;top: 6px;right: 30px}.cdp-modal-select::after{height: 5px;width: 5px;margin-top: -6px;right: 13px;top: calc(50% + 2px)}.cdp-modal-select .option{padding-left: 10px!important;padding-right: 12px!important;line-height: 29px!important;min-height: 29px!important}.cdp-modal-select-2 .option{min-width: 89px}.cdp-modal-select .list{margin-left: -11px!important}.cdp-max-600 .option{padding-left: 60px!important;padding-right: 85px!important}.cdp-premium-modal-dropdown .option{padding-right: 50px!important;text-align: center!important}
assets/css/cdp-user.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .cdp-admin-bar-icon::before{font-family: dashicons;content: '\f105';top: 4px;position: relative;color: rgba(240,245,250,.6);margin-right: 3px;font-size: 18px}.cdp-admin-bar-icon{line-height: 1!important}.cdp-admin-bar-copy{line-height: 1!important}
assets/css/cdp.min.css ADDED
@@ -0,0 +1 @@
 
1
+ [contenteditable]{-webkit-user-select: text;user-select: text}.cdp-preloader{width: 90%;height: 4px;background: linear-gradient(to right,#429388,#429388);background-color: #ccc;position: absolute;margin-top: 3px;padding-top: 2px;top: 60px;left: 0;right: 0;margin: auto;border-radius: 4px;background-size: 20%;background-repeat: repeat-y;background-position: -25% 0;animation: cdpscroll 1.2s ease-in-out infinite}@keyframes cdpscroll{50%{background-size: 80%}100%{background-position: 125% 0}}.cdp-content *{outline: 0;font-weight: 300}.cdp-preloader-c{padding: 30px!important}.cdp-container,.cdp-preloader-c{width: calc(100% - 40px);padding: 0 20px;max-width: 1286px;margin: 0 auto;-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none}.cdp-f20{font-size: 20px;padding-bottom: 10px}.cdp-box{border-radius: 3px;margin-top: 23px}.cdp-cf::after{content: '';clear: both;display: block}.cdp-bg-green{background: #e1efd8}.cdp-bg-green-title{background: #00b050;border-bottom: 1px solid #31538f;color: white}.cdp-nm{margin: 0!important}.cdp-center{text-align: center}.cdp-left{float: left}.cdp-right{float: right}.cdp-text-left{text-align: left}.cdp-text-right{text-align: right}.cdp-inline{display: inline-block}.cdp-showcase-3{width: calc(100% / 3 - 37px - 32px);margin-right: 37px}.cdp-showcase-3:first-child{margin-left: 67px}.cdp-showcase-3:last-child{margin-right: 0}.cfg-img-sc-3{width: 100%;object-fit: cover;object-position: center}.cdp-font-heading{font-size: 24px;line-height: 1;padding-top: 50px;padding-left: 67px;padding-bottom: 66px}.cdp-font-title{color: black;padding-bottom: 25px}.cdp-font-footer{font-size: 18px;color: black;padding-top: calc(42px + 20px);padding-bottom: 26px}.cdp-ff-i{font-weight: 400;font-style: italic}.cdp-ff-b1{font-weight: 200}.cdp-ff-b2{font-weight: 400}.cdp-ff-b3{font-weight: 500}.cdp-ff-b4{font-weight: 600}.cdp-ff-b5{font-weight: 700}.cdp-ff-b6{font-weight: 800}.cdp-welcome-title{padding-top: 35px;padding-bottom: 10px}.cdp-welcome-title-after{padding: 0;margin: 0;padding-top: 40px;line-height: 53px}.cdp-welcome-title-after h1{padding: 0;margin: 0;line-height: normal}.cdp-intro{font-family: 'Montserrat',sans-serif!important;margin-bottom: 70px}.cdp-intro-options{padding-bottom: 50px}.cdp-intro-button{background: #50b6a8;border: 0;color: white;font-size: 24px;padding: 17px 117px;border-radius: 30px;transition: .3s;cursor: pointer}.cdp-button{background: #50b6a8!important;border: 0!important;color: white!important;font-size: 23px;padding: 12px 66px;font-weight: 600;border-radius: 29px;height: 58px;width: 317px;transition: .3s!important;cursor: pointer!important}.cdp-intro-button:hover,.cdp-button:hover{background: #48a598!important}.cdp-intro-button:active,.cdp-button:active{background: #429388!important;transition: 0s!important}.cdp-pointer{cursor: pointer}.cdp-manager-btns{line-height: 2}.cdp-arrow{border: solid #50b6a8;display: inline-block;border-width: 0 4px 4px 0;padding: 5px;border-radius: 2px;transition: all .3s;display: block}.cdp-arrow-down{transform: rotate(135deg);-webkit-transform: rotate(135deg);margin-top: 2px}.cdp-arrow-right{transform: rotate(-135deg);-webkit-transform: rotate(-135deg);margin-right: 3px}.cdp-arrow-left{transform: rotate(45deg);-webkit-transform: rotate(45deg)}.cdp-collapsibles{padding: 20px 0}.cdp-collapsible{margin-bottom: 15px}.cdp-collapsible-title{border: 0;font-size: 21px;background-color: #fff;padding: 24px 44px;color: black;transition: all .2s;cursor: pointer;border-radius: 3px}.cdp-collapsible-title:hover{background-color: #48a598;color: white}.cdp-collapsible-title:hover *{border-color: white}.cdp-collapsible-title:active{transition: all 0s;background-color: #429388}.cdp-collapsible-content{transition: height .3s ease-out,max-height .5s ease-out,border-bottom .5s .3s,padding .3s;border-bottom: 0!important;overflow: hidden;padding: 0 10px;border-top: 0;max-height: 0;background: #fff}.cdp-collapsible-content.cdp-active{padding: 10px;max-height: unset;border-bottom: 0!important}.cdp-collapsible-title.cdp-active *{border-color: white}.cdp-collapsible-title.cdp-active{background: #50b6a8;color: white}.cdp-collapsible:last-child{margin-bottom: 0}.cdp-supports{padding: 10px 0}.cdp-support-box{border: 1px solid #31538f;background: #ddeaf6;padding: 10px;color: black;min-height: 84px}.cdp-s-i-a{line-height: 53px}.cdp-third{width: calc(100% / 3 - 29px);margin-right: 10px}.cdp-third:not(.cdp-ignore):last-child{margin-right: 0}.cdp-fourth{width: calc(100% / 4 - 30px);margin-right: 10px}.cdp-fourth:not(.cdp-ignore):last-child{margin-right: 0}.cdp-projects{background: #fff;border: 1px solid #44546a;color: black;padding: 25px 30px;padding-top: 5px;margin-top: 10px}.cdp-project-box{padding: 10px;border: 1px solid #44546a;min-height: 261.78125px}.cdp-support-title{position: absolute;top: 50%;transform: translateY(-50%);width: calc(100% - 50px - 20px);padding: 0px 10px;margin-left: 50px}.cdp-support-header{position: relative}.cdp-support-img{height: 50px;width: 50px;object-position: center;object-fit: cover}.cdp-support-img-rd{height: 50px;width: 50px;object-position: center;object-fit: cover}.cdp-support-desc{padding: 5px 0}.cdp-tool{position: relative}.cdp-animated{transition: .3s all}.cdp-half-opacity{opacity: .5}span.cdp-green,.cdp-green{color: #50b6a8;transition: color .3s}.cdp-green.cdp-hover:hover{color: #48a598}.cdp-green.cdp-hover:active{transition: all 0s;color: #429388}.cdp-table{width: 100%;border-spacing: 0px;color: black}.cdp-table tr td:nth-child(1),.cdp-table tr th:nth-child(1),.cdp-table tr th:nth-child(2),.cdp-table tr th:nth-child(3),.cdp-table tr td:nth-child(2),.cdp-table tr td:nth-child(3){padding: 3px 20px}.cdp-table tr td:nth-child(1),.cdp-table tr th:nth-child(1){min-width: 192px;text-align: left;padding-left: 44px!important}.cdp-table tr td:nth-child(3),.cdp-table tr th:nth-child(3){padding-right: 44px!important}.cdp-table tr th:nth-child(2),.cdp-table tr th:nth-child(3),.cdp-table tr td:nth-child(2),.cdp-table tr td:nth-child(3){width: 50%;text-align: left}.cdp-table tr th:nth-child(2),.cdp-table tr td:nth-child(2){width: 50%;text-align: left;padding-right:}.cdp-table tr:nth-child(1) td{padding-top: 35px!important}.cdp-table tr td{padding: 16px 20px!important;line-height: 24px}.cdp-table .cdp-thead{background: #f7f7f7}.cdp-table tr th{border-bottom: 1px solid #e1e1e1;font-weight: 400;height: 33px;padding: 5px 10px;height: 58px}.cdp-padding{padding: 15px 20px}.cdp-nbp{padding-bottom: 0!important}.cdp-ntp{padding-top: 0!important}.cdp-padding-10{padding: 10px}.cdp-padding-10-h{padding-top: 10px;padding-bottom: 10px}.cdp-np{padding: 0!important}.cdp-nlh{line-height: inherit!important}.cdp-green-bg{background: #f7f7f7}.cdp-shadow{-moz-box-shadow: 3px 3px 15px 10px #eee!important;-webkit-box-shadow: 3px 3px 15px 10px #eee!important;box-shadow: 3px 3px 15px 10px #eee!important}.cdp-white-bg{background: #fff}.cdp-names-input{width: calc(50% - 97.5px)}.cdp-names-input input{width: 100%}.cdp-names-divider{font-size: 16px;line-height: 49px;padding: 0 10px;width: 175px;color: black;margin-top: 14px}.cdp-name-box{background-color: #50b6a8;width: 165px;padding: 5px;font-weight: 200;border-radius: 1px;text-align: center;color: white;font-size: 18px;cursor: pointer;transition: background-color .3s;height: 29px;line-height: 29px;border-radius: 3px}.cdp-name-box:hover{background-color: #48a598;cursor: pointer}.cdp-name-box-small{background: #50b6a8;font-size: 18px;font-weight: 200;border-radius: 1px;text-align: left;display: inline-block;position: relative;cursor: pointer;pointer-events: none;color: white;padding: 0px 19px!important;padding-right: 63px!important;margin-left: 1px;margin-right: 1px;height: 38px;border-radius: 3px}.cdp-name-box-small[data-cdp-val="0"]{width: 68px}.cdp-name-box-small[data-cdp-val="1"]{width: 108px}.cdp-name-box-small[data-cdp-val="2"]{width: 109px}.cdp-name-box-small::after{content: '\00d7';position: absolute;right: 0px;top: 0px;height: 100%;width: 22px;font-size: 28px;line-height: 38px;padding-right: 3px;padding-left: 9px;pointer-events: auto;background: #42a89a;border-top-right-radius: 3px;border-bottom-right-radius: 3px}.cdp-names-text-info{padding-left: 30px;line-height: 40px}.cdp-magic-input{text-align: left;line-height: 39px;font-size: 17px;box-shadow: 0 0 0 transparent;border-radius: 1px;background-color: #fff;color: #32373c;overflow-x: hidden;word-wrap: unset;white-space: nowrap;resize: none;padding: 6px;min-height: 39px;width: 100%;width: calc(100% - 12px);margin: 0 auto;margin-top: 14px;margin-bottom: 14px;border-radius: 3px}.cdp-magic-input br{display: none!important}.cdp-magic-input *:not(.cdp-drag){display: inline;white-space: nowrap}.cdp-magic-input i{font-style: normal}.cdp-magic-input:focus{border-color: #50b6a8;box-shadow: 0 0 0 1px #50b6a8;outline: 2px solid transparent}.cdp-novis{visibility: hidden}.tb-close-icon,.tb-close-icon:focus{outline: 0!important;outline-style: none}.cdp-gray-button{background: #f2f2f2;border: 1px solid #31538f;color: #000;padding: 5px 40px}.cdp-gray{color: #666}.cdp-h2{font-size: 16px;margin: 10px 0}.cdp-white{color: #fff!important}.cdp-error-span-tooltip{display: none;color: #991111;font-size: 10px}.tooltipster-box{border-color: #888!important;-webkit-box-shadow: 0px 0px 10px 3px rgba(0,0,0,.2);-moz-box-shadow: 0px 0px 10px 3px rgba(0,0,0,.2);box-shadow: 0px 0px 10px 3px rgba(0,0,0,.2)}.cdp-spinner{position: absolute;left: calc(50% - 40px);top: calc(50% - 120px);height: 60px;width: 60px;margin: 0px auto;-webkit-animation: cdp-rotation .9s infinite linear;-moz-animation: cdp-rotation .9s infinite linear;-o-animation: cdp-rotation .9s infinite linear;animation: cdp-rotation .9s infinite linear;border-left: 6px solid rgba(55,190,190,0.48);border-right: 6px solid rgba(55,190,190,0.48);border-bottom: 6px solid rgba(74,255,255,0.77);border-top: 6px solid rgba(74,255,255,0.77);border-radius: 100%;z-index: 200000}@-webkit-keyframes cdp-rotation{from {-webkit-transform: rotate(0deg)} to {-webkit-transform: rotate(359deg)}}@-moz-keyframes cdp-rotation{from {-moz-transform: rotate(0deg)} to {-moz-transform: rotate(359deg)}}@-o-keyframes cdp-rotation{from {-o-transform: rotate(0deg)} to {-o-transform: rotate(359deg)}}@keyframes cdp-rotation{from {transform: rotate(0deg)} to {transform: rotate(359deg)}}.cdp-blue-circle{background: #50b6a8;color: white;font-weight: 400;font-size: 14px;border-radius: 50%;width: 27px;height: 27px;text-align: center;margin-bottom: 20px;margin-right: 7px;line-height: 27px}.cdp-low-margin-bot{margin-bottom: 5px}.cdp-margin-left{margin-left: 5px}.cdp-margin-left-25{margin-left: 25px}.cdp-red-bg{background: #bf0000}.cdp-button.cdp-red-bg:hover{background: #ae0000}.cdp-button.cdp-red-bg:active{background: #9d0000}.cdp-d-header{font-size: 16px;font-weight: 600;margin-top: 13px;margin-bottom: 0px}.cdp-d-header-2{font-size: 14px;margin-top: 33px;margin-bottom: 18px}.cdp-delete-table{border-spacing: 0;padding-bottom: 20px!important}.cdp-delete-table tbody td{}.cdp-delete-table .cdp-h-tbe{padding-top: 15px;min-height: 15px;background: rgb(245,245,245)}.cdp-delete-table tbody td,.cdp-delete-table thead th{padding-bottom: 20px!important;padding-top: 20px;padding-left: 20px!important;padding-right: 10px;font-size: 19px!important;text-align: left!important}.cdp-delete-table thead th{padding: 20px!important;border-bottom: 2px solid rgb(223,223,223)!important}.cdp-delete-table tbody td{background: rgb(245,245,245)!important}.cdp-delete-table tbody td:nth-child(1),.cdp-delete-table thead th:nth-child(1){padding-left: 40px!important;width: 32px}.cdp-delete-table tbody td:nth-child(2),.cdp-delete-table thead th:nth-child(2){text-align: left!important}.cdp-delete-table tbody td:nth-child(3),.cdp-delete-table thead th:nth-child(3){text-align: left!important}.cdp-delete-table tbody td:nth-child(4),.cdp-delete-table thead th:nth-child(4){min-width: 110px;width: 110px}.cdp-delete-table tbody td:nth-child(5),.cdp-delete-table thead th:nth-child(5){min-width: 165px;width: 165px}.cdp-delete-table tbody td:nth-child(6),.cdp-delete-table thead th:nth-child(6){min-width: 88px;width: 88px;padding-right: 40px!important}.cdp-delete-table tbody{background: rgb(245,245. 245)!important}.cdp-delete-table tbody td:nth-child(2),.cdp-delete-table thead th:nth-child(2){padding-left: 7px!important}.cdp-delete-table tbody td:nth-child(1),.cdp-delete-table thead th:nth-child(1){padding-right: 0px!important}.cdp-table-cont{overflow-x: auto;max-width: 100%;width: 100%;overflow-y: hidden!important}.cdp-table-cont table{width: 100%}.cdp-multiple-tooltip-count{opacity: 0}.cdp-hide{display: none}.cdp-no-style{list-style: none}.pagination-link,.pagination-next,.pagination-previous{border-color:#dbdbdb;color:#363636}.pagination-link:hover,.pagination-next:hover,.pagination-previous:hover{border-color:#b5b5b5;color:#363636}.pagination-link:focus,.pagination-next:focus,.pagination-previous:focus{border-color:#3273dc}.pagination-link:active,.pagination-next:active,.pagination-previous:active{box-shadow:inset 0 1px 2px rgba(10,10,10,.2)}.pagination-link[disabled],.pagination-next[disabled],.pagination-previous[disabled]{background-color:#dbdbdb;border-color:#dbdbdb;box-shadow:none;color:#7a7a7a;opacity:.5}.pagination-next,.pagination-previous{white-space:nowrap}.pagination-link.is-current{background-color:#3273dc;border-color:#3273dc;color:#fff}.pagination-ellipsis{color:#b5b5b5;pointer-events:none}.pagination-list{flex-wrap:wrap}.cdp-pagination .page-btn.active a{transition: background-color .3s,color .3s;color: white}.cdp-pagination .page-btn{transition: background-color .3s,color .3s}.cdp-pagination .page-btn.active{transition: background-color .3s,color .3s;border-color: #50b6a8;background: #50b6a8;color: white}#cdp-d-table-tbody tr.cdp-del td:not(td:nth-child(1)),#cdp-d-table-tbody tr.cdp-del td:not(td:nth-child(1)) a{color: #c50000!important;text-decoration: none!important;text-decoration: line-through!important}.cdp-del td,.cdp-del a{text-decoration: line-through!important;color: red!important}.cdp-tab-list{width: 100%;margin: 0 auto;text-align: center;margin-top: 10px}.cdp-tab-element:not(:last-child){border-right: 0!important}.cdp-tab-element{width: calc(100% / 3 - 16px);color: black;background: #f6f6f6;padding: 8px;text-align: center;border-bottom: 4px solid #50b6a8;cursor: pointer;transition: all .3s;height: 25px;line-height: 25px;font-size: 20px}.cdp-tab-element span{font-weight: 500}.cdp-tab-element:hover:not(.cdp-tab-active):not([data-disabled="true"]){background: #eee}.cdp-tab-element[data-disabled="true"]{cursor: not-allowed}.cdp-tab-element:first-child{border-top-left-radius: 3px}.cdp-tab-element:last-child{border-top-right-radius: 3px}.cdp-tab-active{background: #50b6a8;color: white}.cdp-content *:not(.cdp-normal-font),.cdp-tooltip-content *:not(.cdp-normal-font){font-family: 'Montserrat',sans-serif!important}.cdp-content b{font-weight: 600}.cdp-content a{color: #50b6a8}.cdp-content a:hover{color: #48a598}.cdp-content a:active{color: #429388}.cdp-profile-bar{margin-bottom: 24px;margin-top: 16px}.cdp-select-styled,.cdp-select{font-size: 14px;color: #666;border-color: rgb(198,201,206);background: #fff}.cdp-select-padding{padding: 0 45px 0 20px!important;height: 48px;line-height: 48px!important;margin: 0 13px}.cdp-content [type="checkbox"],.cdp-other-inputs[type="checkbox"],.cdp-checkbox,input[type="checkbox"].cdp-data-set{color: #555;clear: none;cursor: pointer;display: inline-block;margin: -.25rem .25rem 0 0;outline: 0;padding: 0;text-align: center;vertical-align: middle;-webkit-appearance: none;box-shadow: inset 0 1px 2px rgba(0,0,0,.1);border: 1px solid #50b6a8;height: 29px;width: 29px;margin-right: 5px;margin-top: -2px;background: #fff;transition: all .3s;border-radius: 6px;margin-right: 12px}.cdp-content [type="checkbox"]:checked,.cdp-other-inputs[type="checkbox"]:checked,.cdp-checkbox:checked,input[type="checkbox"].cdp-data-set:checked{background: #50b6a8}.cdp-content [type="checkbox"]:checked::before,.cdp-other-inputs[type="checkbox"]:checked::before,.cdp-checkbox:checked::before,input[type="checkbox"].cdp-data-set:checked::before{content: '';border-top: 2px solid white;border-left: 2px solid white;height: 13px!important;width: 7px!important;margin: -.1875rem 0 0 -.25rem;margin-top: 4px;margin-left: 9px;transform: rotate(220deg);float: left;display: inline-block;vertical-align: middle}.cdp-table tbody td{color: gray}.cdp-table tbody td:nth-child(1){font-weight: 300}.cdp-table tbody td:nth-child(3){color: black;font-weight: 500}tr.cdp-selected-tr-opt td:nth-child(2){color: black!important;font-weight: 500!important}tr.cdp-selected-tr-opt td:nth-child(2) span{font-weight: 500!important}tr.cdp-selected-tr-opt td:nth-child(3){color: gray!important;font-weight: 300!important}tr.cdp-selected-tr-opt td:nth-child(1) span{font-weight: 500!important;color: black!important}.cdp-d-search{height: 110px;width: 644px;font-size: 30px}.cdp-d-searchbox-c{line-height: 30px!important;margin-left: 3px;padding-left: 15px!important;position: relative!important;background: url('../imgs/search.png');background-position: calc(100% - 13px) center;background-repeat: no-repeat;width: 193px;height: 42px;padding-right: 28px;background-size: 16px;font-size: 18px!important;border-radius: 3px!important;border-color: rgb(198,201,206)!important}.cdp-d-searchbox-c:focus,.cdp-content input:focus{border-color: #50b6a8!important;box-shadow: none!important;outline: 0!important}.cdp-padding-23{padding: 23px}.cdp-padding-23-h{padding-top: 23px;padding-bottom: 23px}.cdp-padding-15-h{padding-top: 15px;padding-bottom: 15px}.cdp-pad-lin{padding: 28px 44px}.cdp-curr-cont{padding-left: 3px;text-align: center;width: 90%;margin: 0 auto;margin-top: 7px!important}.cdp-con-cen{margin: 0 auto;text-align: center}.cdp-select-centered{width: 57%!important;max-width: 637px;text-align: center!important;margin: 0 auto;margin-bottom: 5px}.cdp-c-x-a-v{max-width: 661px!important}.cdp-special-cb-p label{margin-right: 60px;display: inline-block;line-height: 44px}.cdp-special-cb-p input[type="checkbox"]{margin-right: 8px!important}.cdp-special-cb-p label:last-child{margin-right: 0px!important}.cdp-special-cb-p h2{margin-bottom: 5px}.cdp-cont-d-box-tabed{background: #f9f9f9}.cdp-radio{border: 1px solid #50b6a8!important;transition: all .3s;margin-right: 15px;width: 25px!important;height: 25px!important}.cdp-radio:checked::before{margin: 0;content: "";border-radius: 50%;width: 13px!important;height: 13px!important;background-color: #1e8cbe;line-height: 1.14285714;margin-top: 5px!important;margin-left: 5px!important}.cdp-radio:checked::before{background-color: #50b6a8!important}.cdp-sm-d{font-size: 12px}.cdp-ff-20{font-size: 20px}.cdp-d-sel-all-con{display: inline-block;width: 305px;max-width: 305px;line-height: 30px}.cdp-d-pagi-cent{display: inline-block;padding-right: 334px;width: calc(100% - 394px - 245px)}.pagination-pages-section{margin: 0;margin-bottom: 25px;width: auto;float: right!important}.pagination-next{margin: 0;float: right!important}.pagination-previous{margin: 0;float: left;margin: 0 1px}.pagination-pages{display: inline-block;text-align: center;margin: 0 1px}#cdp-d-table-pagi{text-align: center}.page-btn{border: 1px solid #aaa;font-size: 18px;background: #fff;top: -0.5px;font-weight: 400;float: left;margin: 0 1px;min-width: 28px!important;text-align: center;height: 28px;line-height: 29px;color: #969696;cursor: not-allowed}.page-btn:not(.active){cursor: pointer!important}.page-btn:not(.active):hover{border: 1px solid #48a598;background: #48a598}.page-btn:not(.active):active{border: 1px solid #429388;background: #429388}.page-btn:not(.active):hover a{color: white!important}.page-btn:not(.active):active a{color: white!important}.page-btn a{color: #555;padding: 3px 10px!important}.cdp-pagi-arrows{width: 28px!important;border: 1px solid #aaa!important;height: 28px!important;font-size: 40px!important;position: relative!important;background: #fff;font-weight: 400!important;line-height: 26px!important;margin-left: 1px}.cdp-pagi-arrows a{position: absolute!important;right: 0!important;left: 0px!important;top: -2px!important;bottom: 0!important;color: #969696;height: 28px!important;width: 28px!important}.cdp-separator-dis{pointer-events: none;float: left;width: 28px;border: 1px solid #b8b8b8!important;height: 28px!important;font-size: 33px;position: relative;background: #fff;top: 0px;font-weight: 400;margin: 0 1px;line-height: 27px;cursor: not-allowed!important}.cdp-separator-dis a{color: #b8b8b8!important;position: absolute;right: 0;left: 1px;top: -2px;bottom: 0;height: 19px;width: 19px}.cdp-pagi-arrows .prev_page{left: 0px!important}.cdp-pagi-arrows .next_page{left: 1px!important}.cdp-width-166{width: 68px!important}.cdp-vtop-pad{vertical-align: top;padding-top: 15px;min-width: 230px;padding-left: 13px}.cdp-d-tp-pad{padding-top: 15px;padding-bottom: 45px}.cdp-even-more-th-info{padding-top: 7px}.cdp-number-field-styled{width: 70px!important;text-align: center;font-family: 'Montserrat',sans-serif;box-shadow: 0 0 0 transparent;padding: 5px 7px;appearance: none!important;-webkit-appearance: none!important;-moz-appearance: textfield!important}.cdp-number-field-styled::-webkit-inner-spin-button{-webkit-appearance: none!important;-moz-appearance: textfield!important}.cdp-number-field-styled::-webkit-outer-spin-button{-webkit-appearance: none!important;-moz-appearance: textfield!important}.cdp-custom-date-picking{border-color: rgb(198,201,206)!important;line-height: 48px!important;border-radius: 3px!important;height: 48px;font-size: 18px;width: 160px;margin-left: 15px}.cdp-color-p-i{}.cdp-p-hh{padding-bottom: 25px;padding-top: 25px}.cdp-p-25-40{padding-top: 25px;padding-bottom: 40px}.cdp-p-40-b{padding-bottom: 40px}.cdp-p-10-b{padding-bottom: 10px}.cdp-p-20-b{padding-bottom: 20px}.cdp-p-25-t{padding-top: 25px}.cdp-p-15-25{padding-top: 15px}.cdp-p-10-h{padding-top: 10px;padding-bottom: 10px}.cdp-p-15-h{padding-top: 15px;padding-bottom: 15px}.cdp-p-20-h{padding-top: 20px;padding-bottom: 20px}.cdp-p-30-h{padding-top: 30px;padding-bottom: 30px}.cdp-max-600{max-width: 637px!important;min-width: 637px!important;margin-left: 49px}.cdp-per-page-select-show{width: 96px!important;height: 42px;font-size: 17px!important;padding-right: 44px!important;padding: 0 45px 0 20px!important;line-height: 42px!important;text-align: left;margin-left: 10px;margin-right: 10px}.cdp-d-pad-sp{padding: 0 40px}.cdp-hr{border: 1px solid #dfdfdf!important;margin-bottom: 20px}.cdp-d-throttling-count{width: 85px!important;height: 42px!important;line-height: 40px!important;color: #32373c;border-color: rgb(198,201,206)!important;font-size: 17px!important}.cdp-date-picked{margin-right: 0px!important}.cdp-option-premium .option[data-value="3"],.cdp-premium-in-select .option[data-value="premium"]{position: relative}.cdp-option-premium .option[data-value="3"]::after,.cdp-premium-in-select .option[data-value="premium"]::after{content: '';display: inline-block;position: absolute;width: 19px;height: 19px;top: calc(50% - 10px);background: url('../imgs/premium.png');display: inline-block;line-height: 19px;background-repeat: no-repeat;background-position: center;background-size: cover;padding: 0;margin-left: 7px;cursor: pointer}.cdp-cont-d-box-tabed{display: none;overflow: hidden}.cdp-tbody-of-settings a{text-decoration: none}.cdp-tbody-of-settings a:hover,.cdp-tbody-of-settings a:hover span{color: #429388!important}.cdp-content ::placeholder{color: #ddd!important;opacity: 1}.cdp-content ::-moz-placeholder{color: #ddd!important;opacity: 1}.cdp-content :-moz-placeholder{color: #ddd!important;opacity: 1}.cdp-content ::-webkit-input-placeholder{color: #ddd!important;opacity: 1}.cdp-content ::-ms-input-placeholder{color: #ddd!important;opacity: 1}.cdp-content :-ms-input-placeholder{color: #ddd!important;opacity: 1}.cdp-backup-alert{background: #fcecec;color: black;border-radius: 1px;text-align: center;line-height: 23px;padding: 38px;font-size: 14px;border-radius: 3px}.cdp-delete-btn{margin-top: 10px;border: 0;border-radius: 7px}.cdp-delete-info b{font-weight: 500}.cdp-final-ask{background: #fbe4d4;line-height: 1.9;margin-top: 2px;margin-bottom: 5px;padding: 1px 5px;cursor: default}.cdp-small-btn{border: 0;border-radius: 2px}.cdp-delete-info{background: #e2edf7;text-align: center;padding: 10px;color: black;margin: 0 auto;font-weight: 300;width: 663px!important;height: 33px!important;line-height: 33px}.cdp-intro-image{width: 100%;border-radius: 6px;transition: all .3s;cursor: zoom-in}.cdp-intro-image:hover{-ms-transform: scale(2);-webkit-transform: scale(2);transform: scale(2)}.cdp-intro-img-1:hover{margin-left: calc(6vw + 5px)}.cdp-intro-img-1{background-image: url('../imgs/intro_1.gif');background-position: 41% 61%;background-size: 120% auto}.cdp-intro-img-2{background-image: url('../imgs/intro_2.gif');background-position: 44% 61%;background-size: 120% auto}.cdp-intro-img-3:hover{margin-left: calc(-6vw - 5px)}.cdp-intro-img-3{background-image: url('../imgs/intro_3.jpg');background-position: 52% 63%;background-size: 120% auto}.cdp-no-vis{visibility: hidden}.cdp-togglable-name-b{cursor: pointer}.cdp-tooltip-premium-spc-2{margin-bottom: 0;padding-bottom: 0;max-height: 32px}
assets/css/cdp.tooltip.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .tooltipster-fall,.tooltipster-grow.tooltipster-show{-webkit-transition-timing-function:cubic-bezier(.175,.885,.32,1);-moz-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);-ms-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);-o-transition-timing-function:cubic-bezier(.175,.885,.32,1.15)}.tooltipster-base{display:flex;pointer-events:none;position:absolute}.tooltipster-box{flex:1 1 auto}.tooltipster-content{color:#333;box-sizing:border-box;max-height:100%;max-width:100%;overflow:hidden}.tooltipster-ruler{bottom:0;left:0;overflow:hidden;position:fixed;right:0;top:0;visibility:hidden}.tooltipster-fade{opacity:0;-webkit-transition-property:opacity;-moz-transition-property:opacity;-o-transition-property:opacity;-ms-transition-property:opacity;transition-property:opacity}.tooltipster-fade.tooltipster-show{opacity:1}.tooltipster-grow{-webkit-transform:scale(0,0);-moz-transform:scale(0,0);-o-transform:scale(0,0);-ms-transform:scale(0,0);transform:scale(0,0);-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;-o-transition-property:-o-transform;-ms-transition-property:-ms-transform;transition-property:transform;-webkit-backface-visibility:hidden}.tooltipster-grow.tooltipster-show{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-o-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1);-webkit-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);transition-timing-function:cubic-bezier(.175,.885,.32,1.15)}.tooltipster-swing{opacity:0;-webkit-transform:rotateZ(4deg);-moz-transform:rotateZ(4deg);-o-transform:rotateZ(4deg);-ms-transform:rotateZ(4deg);transform:rotateZ(4deg);-webkit-transition-property:-webkit-transform,opacity;-moz-transition-property:-moz-transform;-o-transition-property:-o-transform;-ms-transition-property:-ms-transform;transition-property:transform}.tooltipster-swing.tooltipster-show{opacity:1;-webkit-transform:rotateZ(0);-moz-transform:rotateZ(0);-o-transform:rotateZ(0);-ms-transform:rotateZ(0);transform:rotateZ(0);-webkit-transition-timing-function:cubic-bezier(.23,.635,.495,1);-webkit-transition-timing-function:cubic-bezier(.23,.635,.495,2.4);-moz-transition-timing-function:cubic-bezier(.23,.635,.495,2.4);-ms-transition-timing-function:cubic-bezier(.23,.635,.495,2.4);-o-transition-timing-function:cubic-bezier(.23,.635,.495,2.4);transition-timing-function:cubic-bezier(.23,.635,.495,2.4)}.tooltipster-fall{-webkit-transition-property:top;-moz-transition-property:top;-o-transition-property:top;-ms-transition-property:top;transition-property:top;-webkit-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);transition-timing-function:cubic-bezier(.175,.885,.32,1.15)}.tooltipster-fall.tooltipster-initial{top:0!important}.tooltipster-fall.tooltipster-dying{-webkit-transition-property:all;-moz-transition-property:all;-o-transition-property:all;-ms-transition-property:all;transition-property:all;top:0!important;opacity:0}.tooltipster-slide{-webkit-transition-property:left;-moz-transition-property:left;-o-transition-property:left;-ms-transition-property:left;transition-property:left;-webkit-transition-timing-function:cubic-bezier(.175,.885,.32,1);-webkit-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);-moz-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);-ms-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);-o-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);transition-timing-function:cubic-bezier(.175,.885,.32,1.15)}.tooltipster-slide.tooltipster-initial{left:-40px!important}.tooltipster-slide.tooltipster-dying{-webkit-transition-property:all;-moz-transition-property:all;-o-transition-property:all;-ms-transition-property:all;transition-property:all;left:0!important;opacity:0}@keyframes tooltipster-fading{0%{opacity:0}100%{opacity:1}}.tooltipster-update-fade{animation:tooltipster-fading .4s}@keyframes tooltipster-rotating{25%{transform:rotate(-2deg)}75%{transform:rotate(2deg)}100%{transform:rotate(0)}}.tooltipster-update-rotate{animation:tooltipster-rotating .6s}@keyframes tooltipster-scaling{50%{transform:scale(1.1)}100%{transform:scale(1)}}.tooltipster-update-scale{animation:tooltipster-scaling .6s}.tooltipster-sidetip .tooltipster-box{background:#fff;border-radius:4px}.tooltipster-sidetip.tooltipster-bottom .tooltipster-box{margin-top:8px}.tooltipster-sidetip.tooltipster-left .tooltipster-box{margin-right:8px}.tooltipster-sidetip.tooltipster-right .tooltipster-box{margin-left:8px}.tooltipster-sidetip.tooltipster-top .tooltipster-box{margin-bottom:8px}.tooltipster-sidetip .tooltipster-content{border-radius:5px;font-size:15px;line-height:18px;padding:8px 10px;font-family: 'Montserrat',sans-serif!important}.tooltipster-sidetip .tooltipster-arrow{overflow:hidden;position:absolute}.tooltipster-sidetip.tooltipster-bottom .tooltipster-arrow{height:10px;margin-left:-10px;top:0;width:20px}.tooltipster-sidetip.tooltipster-left .tooltipster-arrow{height:20px;margin-top:-10px;right:0;top:0;width:10px}.tooltipster-sidetip.tooltipster-right .tooltipster-arrow{height:20px;margin-top:-10px;left:0;top:0;width:10px}.tooltipster-sidetip.tooltipster-top .tooltipster-arrow{bottom:0;height:10px;margin-left:-10px;width:20px}.tooltipster-sidetip .tooltipster-arrow-background,.tooltipster-sidetip .tooltipster-arrow-border{height:0;position:absolute;width:0}.tooltipster-sidetip .tooltipster-arrow-background{border:10px solid transparent}.tooltipster-sidetip.tooltipster-bottom .tooltipster-arrow-background{border-bottom-color:#fff;left:0;top:3px}.tooltipster-sidetip.tooltipster-left .tooltipster-arrow-background{border-left-color:#fff;left:-3px;top:0}.tooltipster-sidetip.tooltipster-right .tooltipster-arrow-background{border-right-color:#fff;left:3px;top:0}.tooltipster-sidetip.tooltipster-top .tooltipster-arrow-background{border-top-color:#fff;left:0;top:-3px}.tooltipster-sidetip .tooltipster-arrow-border{border:10px solid transparent;left:0;top:0}.tooltipster-sidetip.tooltipster-bottom .tooltipster-arrow-border{border-bottom-color:#fff}.tooltipster-sidetip.tooltipster-left .tooltipster-arrow-border{border-left-color:#fff}.tooltipster-sidetip.tooltipster-right .tooltipster-arrow-border{border-right-color:#fff}.tooltipster-sidetip.tooltipster-top .tooltipster-arrow-border{border-top-color:#fff}.tooltipster-sidetip .tooltipster-arrow-uncropped{position:relative}.tooltipster-sidetip.tooltipster-bottom .tooltipster-arrow-uncropped{top:-10px}.tooltipster-sidetip.tooltipster-right .tooltipster-arrow-uncropped{left:-10px}.tooltipster-noir-customized .tooltipster-box{background: #50b6a8!important}.tooltipster-noir-customized .tooltipster-content{background: #50b6a8!important;color: white;padding: 16px 10px}.tooltipster-noir-customized.tooltipster-bottom .tooltipster-arrow-background{border-bottom-color: #50b6a8!important}.tooltipster-noir-customized.tooltipster-left .tooltipster-arrow-background{border-left-color: #50b6a8!important}.tooltipster-noir-customized.tooltipster-right .tooltipster-arrow-background{border-right-color: #50b6a8!important}.tooltipster-noir-customized.tooltipster-top .tooltipster-arrow-background{border-top-color: #50b6a8!important}.tooltipster-noir-customized.tooltipster-top .tooltipster-arrow-border{border-top-color: #50b6a8!important}.tooltipster-noir-customized.tooltipster-bottom .tooltipster-arrow-border{border-bottom-color: #50b6a8!important}.tooltipster-noir-customized.tooltipster-right .tooltipster-arrow-border{border-right-color: #50b6a8!important}.tooltipster-noir-customized.tooltipster-left .tooltipster-arrow-border{border-left-color: #50b6a8!important}.tooltipster-noir-customized .tooltipster-arrow-border{}.cdp-tooltip-premium-css{text-align: center;width: 350px}.cdp-premium-element *{cursor: not-allowed!important;border-color: rgba(198,201,206,0.5)!important}.cdp-premium-element {}.tooltipster-noir a{color: white!important}
assets/imgs/alert_error.png ADDED
Binary file
assets/imgs/alert_info.png ADDED
Binary file
assets/imgs/alert_success.png ADDED
Binary file
assets/imgs/alert_warning.png ADDED
Binary file
assets/imgs/arrow.png ADDED
Binary file
assets/imgs/close.png ADDED
Binary file
assets/imgs/copy.png ADDED
Binary file
assets/imgs/icon.png ADDED
Binary file
assets/imgs/info.png ADDED
Binary file
assets/imgs/intro_1.gif ADDED
Binary file
assets/imgs/intro_2.gif ADDED
Binary file
assets/imgs/intro_3.jpg ADDED
Binary file
assets/imgs/premium.png ADDED
Binary file
assets/imgs/search.png ADDED
Binary file
assets/imgs/stars.gif ADDED
Binary file
assets/js/cdp-global.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(t){let e=t("#cdp-purl").val();function i(){let e=t(".cdp-dd-item").length,i=t(".cdp-dd-d").length,n=t(".cdp-dd-ud").length;i<=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()),n<=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)}if(t("body").on("click",".cdp-notification .cdp-times-button",t.cdpRemoveNotifiaction),t("body").on("mouseover",".cdp-bnew-notis",function(){let e=parseInt(t(".cdp-notis-counter").text()),i=t(".cdp-bnew-notis").length,n=t(this).attr("data-token");t(this).hasClass("cdp-bnew-notis")&&e-1>=0&&(t(this).removeClass("cdp-bnew-notis"),t(".cdp-notis-counter").text(e-1));(e>0||i>0)&&t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"i_saw_this_noti",noti_token:n})}),t("body").on("click",".cdp-dropdown-clear-all-notis",function(e){e.preventDefault(),t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"clear_crons"}).done(e=>{if(t.isJsonString(e)&&(e=t.cdpParse(e)),"success"==e.status){let e=t(".cdp-dd-item");e.hide(300),setTimeout(()=>{e.remove(),i()},300),t.cdpNotification("success","Tasks cleared!")}else"fail"==e.status?t.cdpNotification(e.type,e.msg):t.cdpNotification("error","We couldn't update task list, please try again later or kill tasks individualy.")}).fail(e=>{t.cdpNotification("error","We couldn't update task list, please try again later or kill tasks individualy.")})}),t("body").on("click",".cdp-noti-hide-btn",function(){let e=t(this).parents(".ab-item").attr("data-token");t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"try_to_hide_the_tasks",task:e}).done(e=>{t.isJsonString(e)&&(e=t.cdpParse(e)),"success"==e.status?(t(this).parents(".ab-item").hide(300),setTimeout(()=>{t(this).parents(".ab-item").remove(),i()},300),t.cdpNotification("success","The task has been hidden")):"fail"==e.status?t.cdpNotification(e.type,e.msg):t.cdpNotification("error","There was an error and we couldn't hide the task.")}).fail(()=>{t.cdpNotification("error","There was an error and we couldn't hide the task.")})}),t("body").on("click",".cdp-noti-kill-btn",function(){let e=t(this).parents(".ab-item").attr("data-token");t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"try_to_kill_the_tasks",task:e}).done(e=>{t.isJsonString(e)&&(e=t.cdpParse(e)),"success"==e.status?(t(this).parents(".ab-item").hide(300),setTimeout(()=>{t(this).parents(".ab-item").remove(),i()},300),t.cdpNotification("success","The task has been killed")):"fail"==e.status?t.cdpNotification(e.type,e.msg):t.cdpNotification("error","There was an error and we couldn't kill the task.")}).fail(()=>{t.cdpNotification("error","There was an error and we couldn't kill the task.")})}),t("#cdp-show-copy-banner").length>0&&("-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)),"undefined"!=typeof pagenow&&["plugins"].includes(pagenow)){let i=`background:url('${`${e}/assets/imgs/stars.gif`}')`;t('[data-slug="copy-delete-posts-premium"]').find("strong").html(`<span style="">Copy & Delete Posts <b style="color: orange; ${i}">Premium</b></span>`)}}),function(t){t.extend({cdpNotification:function(e="default",i="There was an error with this notification.",n=7e3){t(".cdp-notification-box").length<=0&&t("body").prepend(t('<div class="cdp-notification-box"></div>')),e="default"==e?"":"success"==e?" is-success":"warning"==e?" is-warning":"error"==e?" is-danger":" is-info";let o=Math.floor(Math.random()*Math.floor(64e3)),s=`<div style="display: none;" id="ntf-${o}" class="cdp-notification${e}">\n <button class="cdp-times-button">&times;</button>\n <div class="cdp-cf">\n <div class="cdp-left cdp-alert-icon"><div class="cdp-icon-bg"></div></div>\n <div class="cdp-left cdp-alert-msg-title">\n <div class="cdp-title${e}">Copy & Delete Posts</div>\n <div>${i}</div>\n </div>\n </div>\n </div>`;t(".cdp-notification-box").prepend(s);let a=t(`#ntf-${o}`);a.css({opacity:0,display:"block"});let d=a.outerWidth();a.outerHeight();a.css({right:"-35vw","font-size":"0px",width:0,padding:0,opacity:"0"}),a.animate({right:"15px",width:d,padding:"1rem 2rem 1rem 1.5rem",opacity:"1"},{duration:200,queue:!1}),a.animate({"font-size":"16px"},{duration:300,queue:!1}),setTimeout(()=>{t(`#ntf-${o}`).css({width:""})},250),setTimeout(()=>{a.animate({"font-size":"0px"},{duration:200,queue:!1}),a.animate({right:"-35vw",height:0,width:0,margin:0,padding:0,opacity:"0"},300,function(){a.remove()})},n)},cdpRemoveNotifiaction:function(){let e=t(this).parents(".cdp-notification");e.animate({"font-size":"0px"},{duration:200,queue:!1}),e.animate({right:"-35vw",height:0,width:0,margin:0,padding:0,opacity:"0"},300,function(){e.remove()})},isJsonString:function(e){try{JSON.parse(e)}catch(i){if("string"==typeof e){let i=t.cdpReverseString(e).indexOf("}");i=0==i?e.length:-i,e=e.slice(e.indexOf("{"),i);try{JSON.parse(e)}catch(t){return!1}return!0}return!1}return!0},cdpReverseString:function(e){return"string"==typeof e?""===e?"":t.cdpReverseString(e.substr(1))+e.charAt(0):e},cdpParse:function(e){try{JSON.parse(e)}catch(i){if("string"==typeof e){let i=t.cdpReverseString(e).indexOf("}");i=0==i?e.length:-i,e=e.slice(e.indexOf("{"),i);try{JSON.parse(e)}catch(t){return!1}return JSON.parse(e)}return!1}return JSON.parse(e)},cdpModal:function(e){let i;(i=t("string"==typeof e?`#${e}`:`#${t(this).attr("data-modal-name")}`)).is(":hidden")&&($content=t(i.find(".cdp-modal-content")),i.css({opacity:0}),$content.css({opacity:0,top:"60%"}),i.show(),i.animate({opacity:1},300),$content.animate({opacity:1,top:"50%"},300))},cdpModalClose:function(e){let i,n=e.target,o="string"==typeof e;(n&&(t(n).hasClass("cdp-modal-times")||t(n).hasClass("cdp-modal"))||o)&&((i=o?t(`#${e}`):t(this).hasClass("cdp-modal")?t(this):t(this).parents(".cdp-modal")).is(":hidden")||($content=t(i.find(".cdp-modal-content")),i.animate({opacity:0},300),$content.animate({opacity:0,top:"60%"},300,function(){i.hide()})))}})}(jQuery);
assets/js/cdp-gutenberg.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(t){function e(e=100){"number"!=typeof e&&(e=100),setTimeout(()=>{0==t(".cdp-editor-gutenberg-copy").length&&($parent=t(".editor-post-trash").parents(".components-panel__row"),$html='<button type="button" class="components-button cdp-editor-gutenberg-copy is-button is-default is-large">Copy this</button>',t($parent).prepend($html))},e)}t(document).on("readystatechange",function(){if(e(10),$button=t(t(".edit-post-header__settings").find('.components-button.components-icon-button[aria-label="Settings"]')[0]),$button.on("click",e),t(".edit-post-sidebar__panel-tab").on("click",e),t("#cdp-original-post").length>0){let e=t("#cdp-original-post").attr("data-cdp-parent"),n=t("#cdp-original-post").attr("data-cdp-parent-url");t(".edit-post-header-toolbar").append(t(`<div class="cdp-original-info-b">This post is a duplicate of <a href="${n}" target="_blank">${e}</a></div>`))}setInterval(()=>{t(".cdp-editor-gutenberg-copy").length<=0&&e(10)},5e3),t(window).on("resize",e)})});
assets/js/cdp-icPagination.min.js ADDED
@@ -0,0 +1 @@
 
1
+ class IcPagination{constructor(e,s,t){this.options=t,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&&(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 a=this;jQuery(document).keydown(function(e){if(0==jQuery("input:focus, .cdp-magic-input:focus").length)switch(e.which){case 37:e.preventDefault(),jQuery(a.prevPageElem).parents("li").hasClass("cdp-separator-dis")||a.changePage(a.selected-1);break;case 39:e.preventDefault(),jQuery(a.nextPageElem).parents("li").hasClass("cdp-separator-dis")||a.changePage(a.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":""}),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&&(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":""}),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())}}
assets/js/cdp-modal.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(o){o("#cdp-purl").val();let t="default";function e(){o.cdpModal("cdp-copy-modal-global");let t=o(".cdp-modal-input-profiles-r").val();o('[name="tooltip-which-profile-second"]').val(t),o('.cdp-input-dynamic[name="tooltip-which-profile-second"]').trigger("change")}function c(){if(o("#cdp-current-post-id").length>0)return[o("#cdp-current-post-id").val()];$rows=o("#the-list").find("tr"),$ids=[];for(var t=0;t<$rows.length;t++){let e=o($rows[t]);e.find(".check-column input").is(":checked")&&$ids.push(e.find(".cdp_copy span").attr("data-cdp-id"))}return $ids}function i(t=(()=>{})){window.onbeforeunload=null,$e=o(".cdp-copy-loader-overlay"),$e.is(":hidden")||$e.animate({opacity:0},300,function(){$e.hide(),t(!0)})}o(".cdp-admin-bar-copy").on("click",e),o("body").on("click",".cdp-editor-gutenberg-copy",e),o("body").on("click",".cdp-copy-btn-editor",e),o("body").on("click",".cdp-copy-modal-button",function(){let e=o(this).attr("data-cdp-btn"),n=["copy-quick","copy-custom","copy-custom-link"];if(n.includes(e)){let a={type:e},p=c(),l=o(".cdp-modal-checkboxes").find(".cdp-modal-option-r");if(p.length<=0)return void o.cdpNotification("warning","Please select at least one row to copy and try again.");let d=o(".cdp-modal-input-profiles-r").val();a.custom={},a.times=o(".cdp-modal-input-times").val(),a.site=o(".cdp-modal-input-site").val(),a.swap="2"==o(".cdp-swap").val()?"true":"false",a.profile=d;let s=["clear","custom","custom_named","null","undefined",null,void 0];if(d&&!s.includes(d)&&(t=d),!a.profile){if(!t||s.includes(t))return o.cdpNotification("warning","Please select basic settings for this copy."),void i();a.profile=t}for(let t=0;t<l.length;++t)a.custom[o(l[t]).attr("name")]=o(l[t]).is(":checked");setTimeout(()=>{let t=o.tooltipster.instances();for(instance in t)t[instance].close()},10),function(t=(()=>{})){window.onbeforeunload=(()=>"Copy in progress..."),$e=o(".cdp-copy-loader-overlay"),$e.is(":hidden")&&($e.show(),$e.animate({opacity:1},300,function(){t(!0)}))}(()=>{o.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"copy_post",origin:"modal",id:p,data:a}).done(t=>{o.isJsonString(t)&&(t=o.cdpParse(t)),"error"==t.status?o.cdpNotification("error","Something went wrong and we couldn't copy this post – please try again!"):(i(),e==n[2]||t.link&&t.link.length>0?"pConv"==t.link?(o.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"delete_success_img"}),"-28"==o(".cdp-copy-alert-success").position().top&&o(".cdp-copy-alert-success").animate({top:"32px",opacity:1},300),setTimeout(()=>{"32"==o(".cdp-copy-alert-success").position().top&&o(".cdp-copy-alert-success").animate({top:"-28px",opacity:0},300)},3e3),o.cdpModalClose("cdp-copy-modal-global")):window.location.href=t.link:"undefined"==typeof pagenow||"post"==pagenow||"page"==pagenow?(o.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"delete_success_img"}),"-28"==o(".cdp-copy-alert-success").position().top&&o(".cdp-copy-alert-success").animate({top:"32px",opacity:1},300),setTimeout(()=>{"32"==o(".cdp-copy-alert-success").position().top&&o(".cdp-copy-alert-success").animate({top:"-28px",opacity:0},300)},3e3),o.cdpModalClose("cdp-copy-modal-global")):location.reload())}).fail(t=>{o.cdpNotification("error","Something went wrong and we couldn't copy this post. – See dev console for more info."),i()})})}else o.cdpNotification("Couldn't recognize that button, please try again.")}),o("body").on("change",".cdp-modal-input-profiles-r",function(){let e=["clear","custom","custom_named","null","undefined",null,void 0];o(this).val()&&!e.includes(o(this).val())&&(t=o(this).val())}),o("#posts-filter").on("submit",function(t){"cdp_bulk_copy"==o("#bulk-action-selector-top").val()&&(t.preventDefault(),$ids=c(),$ids.length<=0?o.cdpNotification("warning","Please select at least one row to copy."):e())})});
assets/js/cdp-select.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("<div></div>").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html('<span class="current"></span><ul class="list"></ul>'));var s=t.next(),n=t.find("option"),l=t.find("option:selected");s.find(".current").html(l.data("display")||l.text()),n.each(function(t){var n=e(this),l=n.data("display");s.find("ul").append(e("<li></li>").attr("data-value",n.val()).attr("data-display",l||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),l=n.hasClass("open");n.length&&(n.remove(),s(t),l&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var l=s.data("display")||s.text();n.find(".current").text(l),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var l=n.nextAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var i=n.prevAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery),jQuery(document).ready(function(e){e("body").on("mousewheel DOMMouseScroll",".nice-select .list, .cdp-content-with-scroll",function(t){let s=null;"mousewheel"==t.type?s=-1*t.originalEvent.wheelDelta:"DOMMouseScroll"==t.type&&(s=40*t.originalEvent.detail),s&&(t.preventDefault(),e(this).scrollTop(s+e(this).scrollTop()))})});
assets/js/cdp-user.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(e){});
assets/js/cdp.min.js ADDED
@@ -0,0 +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"];if(n.includes(c)){let i={type:c};if(c==n[0]){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";t(".cdp-modal-checkboxes").find(".cdp-input-dynamic");if(!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<$inputs.length;++e)i.custom[t($inputs[e]).attr("name")]=t($inputs[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),L(),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="&nbsp;"+i);" "!=i[i.length-1]&&(i+="&nbsp;");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":""}),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":""});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||t(".cdp-more-d-title").is(":hidden")||(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=[].concat(t,e,i),w=(w=$(k)).sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0)}else{let t=[],e=[],i=[];1==l&&(t=$(o.posts)),1==r&&(e=$(o.pages)),1==u&&(i=$(o.custom)),w=(w=[].concat(t,e,i)).sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0)}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":""}),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").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(){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 e=[],o=t(".cdp-input-d-id:checked");for(let i=0;i<o.length;++i)e.push(parseInt(t(o[i]).attr("name")));if(0==e.length)return void t.cdpNotification("warning","Nothing to do here, please select at least one post to delete.");let n=t(".cdp-d-throttling").val(),d=t(".cdp-d-throttling-count").val(),p=t(".cdp-p-redirections").val(),s=!!t(".cdp-p-just-trash-them").is(":checked");if("1"==n&&(!d||0==d||""==d))return void t.cdpNotification("warning","You have wrong count in throttling field, please fix.");t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"delete_them",ids:e,throttling:n,thc:d,redi:p,thrs:s}).done(o=>{if(t.isJsonString(o)&&(o=t.cdpParse(o)),"success"==o.status){t("#cdp-d-table-tbody").find(".cdp-del").remove();let o=c.posts.filter(t=>!e.includes(t.id)),n=c.pages.filter(t=>!e.includes(t.id)),d=c.custom.filter(t=>!e.includes(t.id));c={posts:o,pages:n,custom:d},i.refresh(),x(),t.cdpNotification("success","Deletion process started, you can close this page now and wait till the process ends!"),w($),$parent=t(this).parents(".cdp-collapsible"),$col=t(t($parent[0]).find(".cdp-collapsible-title")[0]),a("true",$col)}else t.cdpNotification("error",`Something went wrong and we couldn't setup the deletion task. ${"1"==n?"– Please try without throttling.":""}`)}).fail(e=>{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":""}),"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-table-tbody").find("tr").not('[data-empty-info="true"]').removeAttr("data-ignore"),t(".cdp-d-searchbox-c").val(""),i.refresh(),x(),t('[data-empty-info="true"]').addClass("cdp-customized"),parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text())>0?t(".cdp-delete-info").show(300):console.log(parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text()))}),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"),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()}),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"})});let c=parseInt(t(window).height()/8);t("#wpbody").animate({scrollTop:t(".cdp-d-section").offset().top-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(),L(),a("cdp-name-section-cnx"),setTimeout(()=>{let e=parseInt(t(window).height()/4);t("#wpbody").animate({scrollTop:t(".cdp-name-section-cnx").offset().top-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){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:10,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:10,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 L(){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:10,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:10,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);
assets/js/cdp.tooltip.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(t,i){void 0===t&&void 0!==window&&(t=window),"function"==typeof define&&define.amd?define(["jquery"],function(t){return i(t)}):"object"==typeof module&&module.exports?module.exports=i(require("jquery")):i(t.jQuery)}(this,function(t){var i={animation:"fade",animationDuration:350,content:null,contentAsHTML:!1,contentCloning:!1,debug:!0,delay:300,delayTouch:[300,500],functionInit:null,functionBefore:null,functionReady:null,functionAfter:null,functionFormat:null,IEmin:6,interactive:!1,multiple:!1,parent:null,plugins:["sideTip"],repositionOnScroll:!1,restoration:"none",selfDestruction:!0,theme:[],timer:0,trackerInterval:500,trackOrigin:!1,trackTooltip:!1,trigger:"hover",triggerClose:{click:!1,mouseleave:!1,originClick:!1,scroll:!1,tap:!1,touchleave:!1},triggerOpen:{click:!1,mouseenter:!1,tap:!1,touchstart:!1},updateAnimation:"rotate",zIndex:9999999},o="undefined"!=typeof window?window:null,e={hasTouchCapability:!(!o||!("ontouchstart"in o||o.DocumentTouch&&o.document instanceof o.DocumentTouch||o.navigator.maxTouchPoints)),hasTransitions:function(){if(!o)return!1;var t=(o.document.body||o.document.documentElement).style,i="transition",e=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof t[i])return!0;i=i.charAt(0).toUpperCase()+i.substr(1);for(var n=0;n<e.length;n++)if("string"==typeof t[e[n]+i])return!0;return!1}(),IE:!1,semVer:"4.2.6",window:o},n=function(){this.ept=t({}),this.epn=t({}),this.__instancesLatestArr=[],this.__plugins={},this._env=e};function s(t){this.$container,this.constraints=null,this.__$tooltip,this.__init(t)}function r(i,o){var e=!0;return t.each(i,function(t,n){if(void 0===o[t]||i[t]!==o[t])return e=!1,!1}),e}function _(i){var o=i.attr("id"),n=o?e.window.document.getElementById(o):null;return n?n===i[0]:t.contains(e.window.document.body,i[0])}n.prototype={__bridge:function(o,e,n){if(!e[n]){var s=function(){};s.prototype=o;var r=new s;r.__init&&r.__init(e),t.each(o,function(t,o){0!=t.indexOf("__")&&(e[t]?i.debug&&console.log("The "+t+" method of the "+n+" plugin conflicts with another plugin or native methods"):(e[t]=function(){return r[t].apply(r,Array.prototype.slice.apply(arguments))},e[t].bridged=r))}),e[n]=r}return this},__setWindow:function(t){return e.window=t,this},_getRuler:function(t){return new s(t)},_off:function(){return this.ept.off.apply(this.ept,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.ept.on.apply(this.ept,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.ept.one.apply(this.ept,Array.prototype.slice.apply(arguments)),this},_plugin:function(i){if("string"==typeof i){var o=i,e=null;return o.indexOf(".")>0?e=this.__plugins[o]:t.each(this.__plugins,function(t,i){if(i.name.substring(i.name.length-o.length-1)=="."+o)return e=i,!1}),e}if(i.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return this.__plugins[i.name]=i,i.core&&this.__bridge(i.core,this,i.name),this},_trigger:function(){var t=Array.prototype.slice.apply(arguments);return"string"==typeof t[0]&&(t[0]={type:t[0]}),this.ept.trigger.apply(this.ept,t),this.epn.trigger.apply(this.epn,t),this},instances:function(i){var o=[];return t(i||".tooltipstered").each(function(){var i=t(this),e=i.data("tooltipster-ns");e&&t.each(e,function(t,e){o.push(i.data(e))})}),o},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.epn.off.apply(this.epn,Array.prototype.slice.apply(arguments)),this},on:function(){return this.epn.on.apply(this.epn,Array.prototype.slice.apply(arguments)),this},one:function(){return this.epn.one.apply(this.epn,Array.prototype.slice.apply(arguments)),this},origins:function(i){return t((i?i+" ":"")+".tooltipstered").toArray()},setDefaults:function(o){return t.extend(i,o),this},triggerHandler:function(){return this.epn.triggerHandler.apply(this.epn,Array.prototype.slice.apply(arguments)),this}},t.tooltipster=new n,t.Tooltipster=function(i,o){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.ept=t({}),this.epn=t({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace="tooltipster-"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state="closed",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(i,o)},t.Tooltipster.prototype={__init:function(o,n){var s=this;if(s._$origin=t(o),s.__options=t.extend(!0,{},i,n),s.__optionsFormat(),!e.IE||e.IE>=s.__options.IEmin){var r=null;if(void 0===s._$origin.data("tooltipster-initialTitle")&&(void 0===(r=s._$origin.attr("title"))&&(r=null),s._$origin.data("tooltipster-initialTitle",r)),null!==s.__options.content)s.__contentSet(s.__options.content);else{var _,a=s._$origin.attr("data-tooltip-content");a&&(_=t(a)),_&&_[0]?s.__contentSet(_.first()):s.__contentSet(r)}s._$origin.removeAttr("title").addClass("tooltipstered"),s.__prepareOrigin(),s.__prepareGC(),t.each(s.__options.plugins,function(t,i){s._plug(i)}),e.hasTouchCapability&&t(e.window.document.body).on("touchmove."+s.__namespace+"-triggerOpen",function(t){s._touchRecordEvent(t)}),s._on("created",function(){s.__prepareTooltip()})._on("repositioned",function(t){s.__lastPosition=t.position})}else s.__options.disabled=!0},__contentInsert:function(){var t=this._$tooltip.find(".tooltipster-content"),i=this.__Content;return this._trigger({type:"format",content:this.__Content,format:function(t){i=t}}),this.__options.functionFormat&&(i=this.__options.functionFormat.call(this,this,{origin:this._$origin[0]},this.__Content)),"string"!=typeof i||this.__options.contentAsHTML?t.empty().append(i):t.text(i),this},__contentSet:function(i){return i instanceof t&&this.__options.contentCloning&&(i=i.clone(!0)),this.__Content=i,this._trigger({type:"updated",content:i}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var i=this._$origin,o=this._$origin.is("area");if(o){var n=this._$origin.parent().attr("name");i=t('img[usemap="#'+n+'"]')}var s=i[0].getBoundingClientRect(),r=t(e.window.document),_=t(e.window),a=i,l={available:{document:null,window:null},document:{size:{height:r.height(),width:r.width()}},window:{scroll:{left:e.window.scrollX||e.window.document.documentElement.scrollLeft,top:e.window.scrollY||e.window.document.documentElement.scrollTop},size:{height:_.height(),width:_.width()}},origin:{fixedLineage:!1,offset:{},size:{height:s.bottom-s.top,width:s.right-s.left},usemapImage:o?i[0]:null,windowOffset:{bottom:s.bottom,left:s.left,right:s.right,top:s.top}}};if(o){var p=this._$origin.attr("shape"),c=this._$origin.attr("coords");if(c&&(c=c.split(","),t.map(c,function(t,i){c[i]=parseInt(t)})),"default"!=p)switch(p){case"circle":var h=c[0],d=c[1],g=c[2],u=d-g,f=h-g;l.origin.size.height=2*g,l.origin.size.width=l.origin.size.height,l.origin.windowOffset.left+=f,l.origin.windowOffset.top+=u;break;case"rect":var m=c[0],w=c[1],v=c[2],y=c[3];l.origin.size.height=y-w,l.origin.size.width=v-m,l.origin.windowOffset.left+=m,l.origin.windowOffset.top+=w;break;case"poly":for(var b=0,$=0,C=0,O=0,T="even",z=0;z<c.length;z++){var E=c[z];"even"==T?(E>C&&(C=E,0===z&&(b=C)),E<b&&(b=E),T="odd"):(E>O&&(O=E,1==z&&($=O)),E<$&&($=E),T="even")}l.origin.size.height=O-$,l.origin.size.width=C-b,l.origin.windowOffset.left+=b,l.origin.windowOffset.top+=$}}for(this._trigger({type:"geometry",edit:function(t){l.origin.size.height=t.height,l.origin.windowOffset.left=t.left,l.origin.windowOffset.top=t.top,l.origin.size.width=t.width},geometry:{height:l.origin.size.height,left:l.origin.windowOffset.left,top:l.origin.windowOffset.top,width:l.origin.size.width}}),l.origin.windowOffset.right=l.origin.windowOffset.left+l.origin.size.width,l.origin.windowOffset.bottom=l.origin.windowOffset.top+l.origin.size.height,l.origin.offset.left=l.origin.windowOffset.left+l.window.scroll.left,l.origin.offset.top=l.origin.windowOffset.top+l.window.scroll.top,l.origin.offset.bottom=l.origin.offset.top+l.origin.size.height,l.origin.offset.right=l.origin.offset.left+l.origin.size.width,l.available.document={bottom:{height:l.document.size.height-l.origin.offset.bottom,width:l.document.size.width},left:{height:l.document.size.height,width:l.origin.offset.left},right:{height:l.document.size.height,width:l.document.size.width-l.origin.offset.right},top:{height:l.origin.offset.top,width:l.document.size.width}},l.available.window={bottom:{height:Math.max(l.window.size.height-Math.max(l.origin.windowOffset.bottom,0),0),width:l.window.size.width},left:{height:l.window.size.height,width:Math.max(l.origin.windowOffset.left,0)},right:{height:l.window.size.height,width:Math.max(l.window.size.width-Math.max(l.origin.windowOffset.right,0),0)},top:{height:Math.max(l.origin.windowOffset.top,0),width:l.window.size.width}};"html"!=a[0].tagName.toLowerCase();){if("fixed"==a.css("position")){l.origin.fixedLineage=!0;break}a=a.parent()}return l},__optionsFormat:function(){return"number"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),"number"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),"number"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),"string"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),null===this.__options.parent?this.__options.parent=t(e.window.document.body):"string"==typeof this.__options.parent&&(this.__options.parent=t(this.__options.parent)),"hover"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):"click"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger("options"),this},__prepareGC:function(){var i=this;return i.__options.selfDestruction?i.__garbageCollector=setInterval(function(){var o=(new Date).getTime();i.__touchEvents=t.grep(i.__touchEvents,function(t,i){return o-t.time>6e4}),_(i._$origin)||i.close(function(){i.destroy()})},2e4):clearInterval(i.__garbageCollector),i},__prepareOrigin:function(){var t=this;if(t._$origin.off("."+t.__namespace+"-triggerOpen"),e.hasTouchCapability&&t._$origin.on("touchstart."+t.__namespace+"-triggerOpen touchend."+t.__namespace+"-triggerOpen touchcancel."+t.__namespace+"-triggerOpen",function(i){t._touchRecordEvent(i)}),t.__options.triggerOpen.click||t.__options.triggerOpen.tap&&e.hasTouchCapability){var i="";t.__options.triggerOpen.click&&(i+="click."+t.__namespace+"-triggerOpen "),t.__options.triggerOpen.tap&&e.hasTouchCapability&&(i+="touchend."+t.__namespace+"-triggerOpen"),t._$origin.on(i,function(i){t._touchIsMeaningfulEvent(i)&&t._open(i)})}return(t.__options.triggerOpen.mouseenter||t.__options.triggerOpen.touchstart&&e.hasTouchCapability)&&(i="",t.__options.triggerOpen.mouseenter&&(i+="mouseenter."+t.__namespace+"-triggerOpen "),t.__options.triggerOpen.touchstart&&e.hasTouchCapability&&(i+="touchstart."+t.__namespace+"-triggerOpen"),t._$origin.on(i,function(i){!t._touchIsTouchEvent(i)&&t._touchIsEmulatedEvent(i)||(t.__pointerIsOverOrigin=!0,t._openShortly(i))})),(t.__options.triggerClose.mouseleave||t.__options.triggerClose.touchleave&&e.hasTouchCapability)&&(i="",t.__options.triggerClose.mouseleave&&(i+="mouseleave."+t.__namespace+"-triggerOpen "),t.__options.triggerClose.touchleave&&e.hasTouchCapability&&(i+="touchend."+t.__namespace+"-triggerOpen touchcancel."+t.__namespace+"-triggerOpen"),t._$origin.on(i,function(i){t._touchIsMeaningfulEvent(i)&&(t.__pointerIsOverOrigin=!1)})),t},__prepareTooltip:function(){var i=this,o=i.__options.interactive?"auto":"";return i._$tooltip.attr("id",i.__namespace).css({"pointer-events":o,zIndex:i.__options.zIndex}),t.each(i.__previousThemes,function(t,o){i._$tooltip.removeClass(o)}),t.each(i.__options.theme,function(t,o){i._$tooltip.addClass(o)}),i.__previousThemes=t.merge([],i.__options.theme),i},__scrollHandler:function(i){if(this.__options.triggerClose.scroll)this._close(i);else if(_(this._$origin)&&_(this._$tooltip)){var o=null;if(i.target===e.window.document)this.__Geometry.origin.fixedLineage||this.__options.repositionOnScroll&&this.reposition(i);else{o=this.__geometry();var n=!1;if("fixed"!=this._$origin.css("position")&&this.__$originParents.each(function(i,e){var s=t(e),r=s.css("overflow-x"),_=s.css("overflow-y");if("visible"!=r||"visible"!=_){var a=e.getBoundingClientRect();if("visible"!=r&&(o.origin.windowOffset.left<a.left||o.origin.windowOffset.right>a.right))return n=!0,!1;if("visible"!=_&&(o.origin.windowOffset.top<a.top||o.origin.windowOffset.bottom>a.bottom))return n=!0,!1}if("fixed"==s.css("position"))return!1}),n)this._$tooltip.css("visibility","hidden");else if(this._$tooltip.css("visibility","visible"),this.__options.repositionOnScroll)this.reposition(i);else{var s=o.origin.offset.left-this.__Geometry.origin.offset.left,r=o.origin.offset.top-this.__Geometry.origin.offset.top;this._$tooltip.css({left:this.__lastPosition.coord.left+s,top:this.__lastPosition.coord.top+r})}}this._trigger({type:"scroll",event:i,geo:o})}return this},__stateSet:function(t){return this.__state=t,this._trigger({type:"state",state:t}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,t.each(this.__timeouts.close,function(t,i){clearTimeout(i)}),this.__timeouts.close=[],this},__trackerStart:function(){var t=this,i=t._$tooltip.find(".tooltipster-content");return t.__options.trackTooltip&&(t.__contentBcr=i[0].getBoundingClientRect()),t.__tracker=setInterval(function(){if(_(t._$origin)&&_(t._$tooltip)){if(t.__options.trackOrigin){var o=t.__geometry(),e=!1;r(o.origin.size,t.__Geometry.origin.size)&&(t.__Geometry.origin.fixedLineage?r(o.origin.windowOffset,t.__Geometry.origin.windowOffset)&&(e=!0):r(o.origin.offset,t.__Geometry.origin.offset)&&(e=!0)),e||(t.__options.triggerClose.mouseleave?t._close():t.reposition())}if(t.__options.trackTooltip){var n=i[0].getBoundingClientRect();n.height===t.__contentBcr.height&&n.width===t.__contentBcr.width||(t.reposition(),t.__contentBcr=n)}}else t._close()},t.__options.trackerInterval),t},_close:function(i,o,n){var s=this,r=!0;if(s._trigger({type:"close",event:i,stop:function(){r=!1}}),r||n){o&&s.__callbacks.close.push(o),s.__callbacks.open=[],s.__timeoutsClear();var _=function(){t.each(s.__callbacks.close,function(t,o){o.call(s,s,{event:i,origin:s._$origin[0]})}),s.__callbacks.close=[]};if("closed"!=s.__state){var a=!0,l=(new Date).getTime()+s.__options.animationDuration[1];if("disappearing"==s.__state&&l>s.__closingTime&&s.__options.animationDuration[1]>0&&(a=!1),a){s.__closingTime=l,"disappearing"!=s.__state&&s.__stateSet("disappearing");var p=function(){clearInterval(s.__tracker),s._trigger({type:"closing",event:i}),s._$tooltip.off("."+s.__namespace+"-triggerClose").removeClass("tooltipster-dying"),t(e.window).off("."+s.__namespace+"-triggerClose"),s.__$originParents.each(function(i,o){t(o).off("scroll."+s.__namespace+"-triggerClose")}),s.__$originParents=null,t(e.window.document.body).off("."+s.__namespace+"-triggerClose"),s._$origin.off("."+s.__namespace+"-triggerClose"),s._off("dismissable"),s.__stateSet("closed"),s._trigger({type:"after",event:i}),s.__options.functionAfter&&s.__options.functionAfter.call(s,s,{event:i,origin:s._$origin[0]}),_()};e.hasTransitions?(s._$tooltip.css({"-moz-animation-duration":s.__options.animationDuration[1]+"ms","-ms-animation-duration":s.__options.animationDuration[1]+"ms","-o-animation-duration":s.__options.animationDuration[1]+"ms","-webkit-animation-duration":s.__options.animationDuration[1]+"ms","animation-duration":s.__options.animationDuration[1]+"ms","transition-duration":s.__options.animationDuration[1]+"ms"}),s._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),s.__options.animationDuration[1]>0&&s._$tooltip.delay(s.__options.animationDuration[1]),s._$tooltip.queue(p)):s._$tooltip.stop().fadeOut(s.__options.animationDuration[1],p)}}else _()}return s},_off:function(){return this.ept.off.apply(this.ept,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.ept.on.apply(this.ept,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.ept.one.apply(this.ept,Array.prototype.slice.apply(arguments)),this},_open:function(i,o){var n=this;if(!n.__destroying&&_(n._$origin)&&n.__enabled){var s=!0;if("closed"==n.__state&&(n._trigger({type:"before",event:i,stop:function(){s=!1}}),s&&n.__options.functionBefore&&(s=n.__options.functionBefore.call(n,n,{event:i,origin:n._$origin[0]}))),!1!==s&&null!==n.__Content){o&&n.__callbacks.open.push(o),n.__callbacks.close=[],n.__timeoutsClear();var r,a=function(){"stable"!=n.__state&&n.__stateSet("stable"),t.each(n.__callbacks.open,function(t,i){i.call(n,n,{origin:n._$origin[0],tooltip:n._$tooltip[0]})}),n.__callbacks.open=[]};if("closed"!==n.__state)r=3e3,"disappearing"===n.__state?(n.__stateSet("appearing"),e.hasTransitions?(n._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),n.__options.animationDuration[0]>0&&n._$tooltip.delay(n.__options.animationDuration[0]),n._$tooltip.queue(a)):n._$tooltip.stop().fadeIn(a)):"stable"==n.__state&&a();else{if(n.__stateSet("appearing"),r=n.__options.animationDuration[0],n.__contentInsert(),n.reposition(i,!0),e.hasTransitions?(n._$tooltip.addClass("tooltipster-"+n.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":n.__options.animationDuration[0]+"ms","-ms-animation-duration":n.__options.animationDuration[0]+"ms","-o-animation-duration":n.__options.animationDuration[0]+"ms","-webkit-animation-duration":n.__options.animationDuration[0]+"ms","animation-duration":n.__options.animationDuration[0]+"ms","transition-duration":n.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=n.__state&&(n._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),n.__options.animationDuration[0]>0&&n._$tooltip.delay(n.__options.animationDuration[0]),n._$tooltip.queue(a))},0)):n._$tooltip.css("display","none").fadeIn(n.__options.animationDuration[0],a),n.__trackerStart(),t(e.window).on("resize."+n.__namespace+"-triggerClose",function(i){var o=t(document.activeElement);(o.is("input")||o.is("textarea"))&&t.contains(n._$tooltip[0],o[0])||n.reposition(i)}).on("scroll."+n.__namespace+"-triggerClose",function(t){n.__scrollHandler(t)}),n.__$originParents=n._$origin.parents(),n.__$originParents.each(function(i,o){t(o).on("scroll."+n.__namespace+"-triggerClose",function(t){n.__scrollHandler(t)})}),n.__options.triggerClose.mouseleave||n.__options.triggerClose.touchleave&&e.hasTouchCapability){n._on("dismissable",function(t){t.dismissable?t.delay?(h=setTimeout(function(){n._close(t.event)},n.__options.timer+r),n.__timeouts.close.push(h)):n._close(t):clearTimeout(h)});var l=n._$origin,p="",c="",h=null;n.__options.interactive&&(l=l.add(n._$tooltip)),n.__options.triggerClose.mouseleave&&(p+="mouseenter."+n.__namespace+"-triggerClose ",c+="mouseleave."+n.__namespace+"-triggerClose "),n.__options.triggerClose.touchleave&&e.hasTouchCapability&&(p+="touchstart."+n.__namespace+"-triggerClose",c+="touchend."+n.__namespace+"-triggerClose touchcancel."+n.__namespace+"-triggerClose"),l.on(c,function(t){if(n._touchIsTouchEvent(t)||!n._touchIsEmulatedEvent(t)){var i="mouseleave"==t.type?n.__options.delay:n.__options.delayTouch;n._trigger({delay:i[1],dismissable:!0,event:t,type:"dismissable"})}}).on(p,function(t){!n._touchIsTouchEvent(t)&&n._touchIsEmulatedEvent(t)||n._trigger({dismissable:!1,event:t,type:"dismissable"})})}n.__options.triggerClose.originClick&&n._$origin.on("click."+n.__namespace+"-triggerClose",function(t){n._touchIsTouchEvent(t)||n._touchIsEmulatedEvent(t)||n._close(t)}),(n.__options.triggerClose.click||n.__options.triggerClose.tap&&e.hasTouchCapability)&&setTimeout(function(){if("closed"!=n.__state){var i="",o=t(e.window.document.body);n.__options.triggerClose.click&&(i+="click."+n.__namespace+"-triggerClose "),n.__options.triggerClose.tap&&e.hasTouchCapability&&(i+="touchend."+n.__namespace+"-triggerClose"),o.on(i,function(i){n._touchIsMeaningfulEvent(i)&&(n._touchRecordEvent(i),n.__options.interactive&&t.contains(n._$tooltip[0],i.target)||n._close(i))}),n.__options.triggerClose.tap&&e.hasTouchCapability&&o.on("touchstart."+n.__namespace+"-triggerClose",function(t){n._touchRecordEvent(t)})}},0),n._trigger("ready"),n.__options.functionReady&&n.__options.functionReady.call(n,n,{origin:n._$origin[0],tooltip:n._$tooltip[0]})}}}return n},_openShortly:function(t){var i=this,o=!0;if("stable"!=i.__state&&"appearing"!=i.__state&&!i.__timeouts.open&&(i._trigger({type:"start",event:t,stop:function(){o=!1}}),o)){var e=0==t.type.indexOf("touch")?i.__options.delayTouch:i.__options.delay;e[0]?i.__timeouts.open=setTimeout(function(){i.__timeouts.open=null,i.__pointerIsOverOrigin&&i._touchIsMeaningfulEvent(t)?(i._trigger("startend"),i._open(t)):i._trigger("startcancel")},e[0]):(i._trigger("startend"),i._open(t))}return i},_optionsExtract:function(i,o){var e=this,n=t.extend(!0,{},o),s=e.__options[i];return s||(s={},t.each(o,function(t,i){var o=e.__options[t];void 0!==o&&(s[t]=o)})),t.each(n,function(i,o){void 0!==s[i]&&("object"!=typeof o||o instanceof Array||null==o||"object"!=typeof s[i]||s[i]instanceof Array||null==s[i]?n[i]=s[i]:t.extend(n[i],s[i]))}),n},_plug:function(i){var o=t.tooltipster._plugin(i);if(!o)throw new Error('The "'+i+'" plugin is not defined');return o.instance&&t.tooltipster.__bridge(o.instance,this,o.name),this},_touchIsEmulatedEvent:function(t){for(var i=!1,o=(new Date).getTime(),e=this.__touchEvents.length-1;e>=0;e--){var n=this.__touchEvents[e];if(!(o-n.time<500))break;n.target===t.target&&(i=!0)}return i},_touchIsMeaningfulEvent:function(t){return this._touchIsTouchEvent(t)&&!this._touchSwiped(t.target)||!this._touchIsTouchEvent(t)&&!this._touchIsEmulatedEvent(t)},_touchIsTouchEvent:function(t){return 0==t.type.indexOf("touch")},_touchRecordEvent:function(t){return this._touchIsTouchEvent(t)&&(t.time=(new Date).getTime(),this.__touchEvents.push(t)),this},_touchSwiped:function(t){for(var i=!1,o=this.__touchEvents.length-1;o>=0;o--){var e=this.__touchEvents[o];if("touchmove"==e.type){i=!0;break}if("touchstart"==e.type&&t===e.target)break}return i},_trigger:function(){var i=Array.prototype.slice.apply(arguments);return"string"==typeof i[0]&&(i[0]={type:i[0]}),i[0].instance=this,i[0].origin=this._$origin?this._$origin[0]:null,i[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.ept.trigger.apply(this.ept,i),t.tooltipster._trigger.apply(t.tooltipster,i),this.epn.trigger.apply(this.epn,i),this},_unplug:function(i){var o=this;if(o[i]){var e=t.tooltipster._plugin(i);e.instance&&t.each(e.instance,function(t,e){o[t]&&o[t].bridged===o[i]&&delete o[t]}),o[i].__destroy&&o[i].__destroy(),delete o[i]}return o},close:function(t){return this.__destroyed?this.__destroyError():this._close(null,t),this},content:function(t){var i=this;if(void 0===t)return i.__Content;if(i.__destroyed)i.__destroyError();else if(i.__contentSet(t),null!==i.__Content){if("closed"!==i.__state&&(i.__contentInsert(),i.reposition(),i.__options.updateAnimation))if(e.hasTransitions){var o=i.__options.updateAnimation;i._$tooltip.addClass("tooltipster-update-"+o),setTimeout(function(){"closed"!=i.__state&&i._$tooltip.removeClass("tooltipster-update-"+o)},1e3)}else i._$tooltip.fadeTo(200,.5,function(){"closed"!=i.__state&&i._$tooltip.fadeTo(200,1)})}else i._close();return i},destroy:function(){var i=this;if(i.__destroyed)i.__destroyError();else{"closed"!=i.__state?i.option("animationDuration",0)._close(null,null,!0):i.__timeoutsClear(),i._trigger("destroy"),i.__destroyed=!0,i._$origin.removeData(i.__namespace).off("."+i.__namespace+"-triggerOpen"),t(e.window.document.body).off("."+i.__namespace+"-triggerOpen");var o=i._$origin.data("tooltipster-ns");if(o)if(1===o.length){var n=null;"previous"==i.__options.restoration?n=i._$origin.data("tooltipster-initialTitle"):"current"==i.__options.restoration&&(n="string"==typeof i.__Content?i.__Content:t("<div></div>").append(i.__Content).html()),n&&i._$origin.attr("title",n),i._$origin.removeClass("tooltipstered"),i._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else o=t.grep(o,function(t,o){return t!==i.__namespace}),i._$origin.data("tooltipster-ns",o);i._trigger("destroyed"),i._off(),i.off(),i.__Content=null,i.ept=null,i.epn=null,i.__options.parent=null,i._$origin=null,i._$tooltip=null,t.tooltipster.__instancesLatestArr=t.grep(t.tooltipster.__instancesLatestArr,function(t,o){return i!==t}),clearInterval(i.__garbageCollector)}return i},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){if(!this.__destroyed)return this._$origin[0];this.__destroyError()},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(t){return this.close(t)},instance:function(){return this},off:function(){return this.__destroyed||this.epn.off.apply(this.epn,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.epn.on.apply(this.epn,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.epn.one.apply(this.epn,Array.prototype.slice.apply(arguments)),this},open:function(t){return this.__destroyed?this.__destroyError():this._open(null,t),this},option:function(i,o){return void 0===o?this.__options[i]:(this.__destroyed?this.__destroyError():(this.__options[i]=o,this.__optionsFormat(),t.inArray(i,["trigger","triggerClose","triggerOpen"])>=0&&this.__prepareOrigin(),"selfDestruction"===i&&this.__prepareGC()),this)},reposition:function(t,i){return this.__destroyed?this.__destroyError():"closed"!=this.__state&&_(this._$origin)&&(i||_(this._$tooltip))&&(i||this._$tooltip.detach(),this.__Geometry=this.__geometry(),this._trigger({type:"reposition",event:t,helper:{geo:this.__Geometry}})),this},show:function(t){return this.open(t)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.epn.triggerHandler.apply(this.epn,Array.prototype.slice.apply(arguments)),this}},t.fn.tooltipster=function(){var o=Array.prototype.slice.apply(arguments),e="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof o[0]){var n="#*$~&";return this.each(function(){var i=t(this).data("tooltipster-ns"),s=i?t(this).data(i[0]):null;if(!s)throw new Error("You called Tooltipster's \""+o[0]+'" method on an uninitialized element');if("function"!=typeof s[o[0]])throw new Error('Unknown method "'+o[0]+'"');this.length>1&&"content"==o[0]&&(o[1]instanceof t||"object"==typeof o[1]&&null!=o[1]&&o[1].tagName)&&!s.__options.contentCloning&&s.__options.debug&&console.log(e);var r=s[o[0]](o[1],o[2]);if(r!==s||"instance"===o[0])return n=r,!1}),"#*$~&"!==n?n:this}t.tooltipster.__instancesLatestArr=[];var s=o[0]&&void 0!==o[0].multiple,r=s&&o[0].multiple||!s&&i.multiple,_=o[0]&&void 0!==o[0].content,a=_&&o[0].content||!_&&i.content,l=o[0]&&void 0!==o[0].contentCloning,p=l&&o[0].contentCloning||!l&&i.contentCloning,c=o[0]&&void 0!==o[0].debug,h=c&&o[0].debug||!c&&i.debug;return this.length>1&&(a instanceof t||"object"==typeof a&&null!=a&&a.tagName)&&!p&&h&&console.log(e),this.each(function(){var i=!1,e=t(this),n=e.data("tooltipster-ns"),s=null;n?r?i=!0:h&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):i=!0,i&&(s=new t.Tooltipster(this,o[0]),n||(n=[]),n.push(s.__namespace),e.data("tooltipster-ns",n),e.data(s.__namespace,s),s.__options.functionInit&&s.__options.functionInit.call(s,s,{origin:this}),s._trigger("init")),t.tooltipster.__instancesLatestArr.push(s)}),this},s.prototype={__init:function(i){this.__$tooltip=i,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=t('<div class="tooltipster-ruler"></div>').append(this.__$tooltip).appendTo(e.window.document.body)},__forceRedraw:function(){var t=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(t)},constrain:function(t,i){return this.constraints={width:t,height:i},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:t}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var t=this.__$tooltip[0].getBoundingClientRect(),i={size:{height:t.height||t.bottom-t.top,width:t.width||t.right-t.left}};if(this.constraints){var o=this.__$tooltip.find(".tooltipster-content"),n=this.__$tooltip.outerHeight(),s=o[0].getBoundingClientRect(),r={height:n<=this.constraints.height,width:t.width<=this.constraints.width&&s.width>=o[0].scrollWidth-1};i.fits=r.height&&r.width}return e.IE&&e.IE<=11&&i.size.width!==e.window.document.documentElement.clientWidth&&(i.size.width=Math.ceil(i.size.width)+1),i}};var a=navigator.userAgent.toLowerCase();return-1!=a.indexOf("msie")?e.IE=parseInt(a.split("msie")[1]):-1!==a.toLowerCase().indexOf("trident")&&-1!==a.indexOf(" rv:11")?e.IE=11:-1!=a.toLowerCase().indexOf("edge/")&&(e.IE=parseInt(a.toLowerCase().split("edge/")[1])),t.tooltipster._plugin({name:"tooltipster.sideTip",instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(t){var i=this;i.__instance=t,i.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),i.__previousState="closed",i.__options,i.__optionsFormat(),i.__instance._on("state."+i.__namespace,function(t){"closed"==t.state?i.__close():"appearing"==t.state&&"closed"==i.__previousState&&i.__create(),i.__previousState=t.state}),i.__instance._on("options."+i.__namespace,function(){i.__optionsFormat()}),i.__instance._on("reposition."+i.__namespace,function(t){i.__reposition(t.event,t.helper)})},__close:function(){this.__instance.content()instanceof t&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var i=t('<div class="tooltipster-base tooltipster-sidetip"><div class="tooltipster-box"><div class="tooltipster-content"></div></div><div class="tooltipster-arrow"><div class="tooltipster-arrow-uncropped"><div class="tooltipster-arrow-border"></div><div class="tooltipster-arrow-background"></div></div></div></div>');this.__options.arrow||i.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&i.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&i.css("max-width",this.__options.maxWidth+"px"),this.__instance._$tooltip=i,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){this.__options=this.__instance._optionsExtract("tooltipster.sideTip",this.__defaults()),this.__options.position&&(this.__options.side=this.__options.position),"object"!=typeof this.__options.distance&&(this.__options.distance=[this.__options.distance]),this.__options.distance.length<4&&(void 0===this.__options.distance[1]&&(this.__options.distance[1]=this.__options.distance[0]),void 0===this.__options.distance[2]&&(this.__options.distance[2]=this.__options.distance[0]),void 0===this.__options.distance[3]&&(this.__options.distance[3]=this.__options.distance[1]),this.__options.distance={top:this.__options.distance[0],right:this.__options.distance[1],bottom:this.__options.distance[2],left:this.__options.distance[3]}),"string"==typeof this.__options.side&&(this.__options.side=[this.__options.side,{top:"bottom",right:"left",bottom:"top",left:"right"}[this.__options.side]],"left"==this.__options.side[0]||"right"==this.__options.side[0]?this.__options.side.push("top","bottom"):this.__options.side.push("right","left")),6===t.tooltipster._env.IE&&!0!==this.__options.arrow&&(this.__options.arrow=!1)},__reposition:function(i,o){var e,n=this,s=n.__targetFind(o),r=[];n.__instance._$tooltip.detach();var _=n.__instance._$tooltip.clone(),a=t.tooltipster._getRuler(_),l=!1,p=n.__instance.option("animation");switch(p&&_.removeClass("tooltipster-"+p),t.each(["window","document"],function(e,p){var c=null;if(n.__instance._trigger({container:p,helper:o,satisfied:l,takeTest:function(t){c=t},results:r,type:"positionTest"}),1==c||0!=c&&0==l&&("window"!=p||n.__options.viewportAware))for(e=0;e<n.__options.side.length;e++){var h={horizontal:0,vertical:0},d=n.__options.side[e];"top"==d||"bottom"==d?h.vertical=n.__options.distance[d]:h.horizontal=n.__options.distance[d],n.__sideChange(_,d),t.each(["natural","constrained"],function(t,e){if(c=null,n.__instance._trigger({container:p,event:i,helper:o,mode:e,results:r,satisfied:l,side:d,takeTest:function(t){c=t},type:"positionTest"}),1==c||0!=c&&0==l){var _={container:p,distance:h,fits:null,mode:e,outerSize:null,side:d,size:null,target:s[d],whole:null},g=("natural"==e?a.free():a.constrain(o.geo.available[p][d].width-h.horizontal,o.geo.available[p][d].height-h.vertical)).measure();if(_.size=g.size,_.outerSize={height:g.size.height+h.vertical,width:g.size.width+h.horizontal},"natural"==e?o.geo.available[p][d].width>=_.outerSize.width&&o.geo.available[p][d].height>=_.outerSize.height?_.fits=!0:_.fits=!1:_.fits=g.fits,"window"==p&&(_.fits?_.whole="top"==d||"bottom"==d?o.geo.origin.windowOffset.right>=n.__options.minIntersection&&o.geo.window.size.width-o.geo.origin.windowOffset.left>=n.__options.minIntersection:o.geo.origin.windowOffset.bottom>=n.__options.minIntersection&&o.geo.window.size.height-o.geo.origin.windowOffset.top>=n.__options.minIntersection:_.whole=!1),r.push(_),_.whole)l=!0;else if("natural"==_.mode&&(_.fits||_.size.width<=o.geo.available[p][d].width))return!1}})}}),n.__instance._trigger({edit:function(t){r=t},event:i,helper:o,results:r,type:"positionTested"}),r.sort(function(t,i){return t.whole&&!i.whole?-1:!t.whole&&i.whole?1:t.whole&&i.whole?(o=n.__options.side.indexOf(t.side))<(e=n.__options.side.indexOf(i.side))?-1:o>e?1:"natural"==t.mode?-1:1:t.fits&&!i.fits?-1:!t.fits&&i.fits?1:t.fits&&i.fits?(o=n.__options.side.indexOf(t.side))<(e=n.__options.side.indexOf(i.side))?-1:o>e?1:"natural"==t.mode?-1:1:"document"==t.container&&"bottom"==t.side&&"natural"==t.mode?-1:1;var o,e}),(e=r[0]).coord={},e.side){case"left":case"right":e.coord.top=Math.floor(e.target-e.size.height/2);break;case"bottom":case"top":e.coord.left=Math.floor(e.target-e.size.width/2)}switch(e.side){case"left":e.coord.left=o.geo.origin.windowOffset.left-e.outerSize.width;break;case"right":e.coord.left=o.geo.origin.windowOffset.right+e.distance.horizontal;break;case"top":e.coord.top=o.geo.origin.windowOffset.top-e.outerSize.height;break;case"bottom":e.coord.top=o.geo.origin.windowOffset.bottom+e.distance.vertical}"window"==e.container?"top"==e.side||"bottom"==e.side?e.coord.left<0?o.geo.origin.windowOffset.right-this.__options.minIntersection>=0?e.coord.left=0:e.coord.left=o.geo.origin.windowOffset.right-this.__options.minIntersection-1:e.coord.left>o.geo.window.size.width-e.size.width&&(o.geo.origin.windowOffset.left+this.__options.minIntersection<=o.geo.window.size.width?e.coord.left=o.geo.window.size.width-e.size.width:e.coord.left=o.geo.origin.windowOffset.left+this.__options.minIntersection+1-e.size.width):e.coord.top<0?o.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?e.coord.top=0:e.coord.top=o.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:e.coord.top>o.geo.window.size.height-e.size.height&&(o.geo.origin.windowOffset.top+this.__options.minIntersection<=o.geo.window.size.height?e.coord.top=o.geo.window.size.height-e.size.height:e.coord.top=o.geo.origin.windowOffset.top+this.__options.minIntersection+1-e.size.height):(e.coord.left>o.geo.window.size.width-e.size.width&&(e.coord.left=o.geo.window.size.width-e.size.width),e.coord.left<0&&(e.coord.left=0)),n.__sideChange(_,e.side),o.tooltipClone=_[0],o.tooltipParent=n.__instance.option("parent").parent[0],o.mode=e.mode,o.whole=e.whole,o.origin=n.__instance._$origin[0],o.tooltip=n.__instance._$tooltip[0],delete e.container,delete e.fits,delete e.mode,delete e.outerSize,delete e.whole,e.distance=e.distance.horizontal||e.distance.vertical;var c,h,d,g=t.extend(!0,{},e);if(n.__instance._trigger({edit:function(t){e=t},event:i,helper:o,position:g,type:"position"}),n.__options.functionPosition){var u=n.__options.functionPosition.call(n,n.__instance,o,g);u&&(e=u)}a.destroy(),"top"==e.side||"bottom"==e.side?(c={prop:"left",val:e.target-e.coord.left},h=e.size.width-this.__options.minIntersection):(c={prop:"top",val:e.target-e.coord.top},h=e.size.height-this.__options.minIntersection),c.val<this.__options.minIntersection?c.val=this.__options.minIntersection:c.val>h&&(c.val=h),d=o.geo.origin.fixedLineage?o.geo.origin.windowOffset:{left:o.geo.origin.windowOffset.left+o.geo.window.scroll.left,top:o.geo.origin.windowOffset.top+o.geo.window.scroll.top},e.coord={left:d.left+(e.coord.left-o.geo.origin.windowOffset.left),top:d.top+(e.coord.top-o.geo.origin.windowOffset.top)},n.__sideChange(n.__instance._$tooltip,e.side),o.geo.origin.fixedLineage?n.__instance._$tooltip.css("position","fixed"):n.__instance._$tooltip.css("position",""),n.__instance._$tooltip.css({left:e.coord.left,top:e.coord.top,height:e.size.height,width:e.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(c.prop,c.val),n.__instance._$tooltip.appendTo(n.__instance.option("parent")),n.__instance._trigger({type:"repositioned",event:i,position:e})},__sideChange:function(t,i){t.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+i)},__targetFind:function(t){var i={},o=this.__instance._$origin[0].getClientRects();if(o.length>1&&1==this.__instance._$origin.css("opacity")&&(this.__instance._$origin.css("opacity",.99),o=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1)),o.length<2)i.top=Math.floor(t.geo.origin.windowOffset.left+t.geo.origin.size.width/2),i.bottom=i.top,i.left=Math.floor(t.geo.origin.windowOffset.top+t.geo.origin.size.height/2),i.right=i.left;else{var e=o[0];i.top=Math.floor(e.left+(e.right-e.left)/2),e=o.length>2?o[Math.ceil(o.length/2)-1]:o[0],i.right=Math.floor(e.top+(e.bottom-e.top)/2),e=o[o.length-1],i.bottom=Math.floor(e.left+(e.right-e.left)/2),e=o.length>2?o[Math.ceil((o.length+1)/2)-1]:o[o.length-1],i.left=Math.floor(e.top+(e.bottom-e.top)/2)}return i}}}),t});
copy-delete-posts.php ADDED
@@ -0,0 +1,718 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.0
7
+ * Author: Copy Delete Posts
8
+ * Author URI: https://copy-delete-posts.com
9
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
10
+
11
+ // Exit if accessed directly.
12
+ if (!defined('ABSPATH')) exit;
13
+
14
+ /** –– **\
15
+ * Global variables and constants.
16
+ * @since 1.0.0
17
+ */
18
+ // Plugin constants
19
+ define('CDP_VERSION', '1.0.0');
20
+ define('CDP_WP_VERSION', get_bloginfo('version'));
21
+ define('CDP_SCRIPT_DEBUG', false);
22
+ $cdp_plug_url = plugins_url('', __FILE__);
23
+
24
+ // Other only admin stuff
25
+ if (is_admin()) {
26
+
27
+ // Set constant variables for this file
28
+ $cdp_dir = dirname(__FILE__);
29
+ $cdp_globals = get_option('_cdp_globals');
30
+ $cdp_premium = 'copy-delete-posts-premium/copy-delete-posts-premium.php';
31
+
32
+ // Try to show error while debugging
33
+ if (CDP_SCRIPT_DEBUG === true) {
34
+ error_reporting(E_ALL);
35
+ ini_set('display_errors', 1);
36
+ }
37
+
38
+ }
39
+ /** –– **/
40
+
41
+ /** –– **\
42
+ * Fired on plugin activation.
43
+ * @since 1.0.0
44
+ */
45
+ register_activation_hook(__FILE__, function () {
46
+ if (function_exists('activate_plugin')) {
47
+ add_option('_cdp_redirect', true);
48
+ $cdp_premium_path = WP_PLUGIN_DIR . '/copy-delete-posts-premium';
49
+ $plugin = 'copy-delete-posts-premium/copy-delete-posts-premium.php';
50
+ if (!is_plugin_active($plugin) && is_dir($cdp_premium_path)) activate_plugin($plugin);
51
+ }
52
+
53
+ do_action('cdp_plugin_setup');
54
+ });
55
+ /** –– **/
56
+
57
+ /** –– **\
58
+ * Fired on plugin deactivation.
59
+ * @since 1.0.0
60
+ */
61
+ register_deactivation_hook(__FILE__, function () {
62
+ if (function_exists('deactivate_plugins')) {
63
+ $plugin = 'copy-delete-posts-premium/copy-delete-posts-premium.php';
64
+ if (is_plugin_active($plugin)) add_action('update_option_active_plugins', function () {
65
+ $plugin = 'copy-delete-posts-premium/copy-delete-posts-premium.php';
66
+ deactivate_plugins($plugin);
67
+ });
68
+ }
69
+ });
70
+ /** –– **/
71
+
72
+ /** –– **\
73
+ * Fired on plugin load and check permissions.
74
+ * @since 1.0.0
75
+ */
76
+ add_action('plugins_loaded', function () {
77
+ do_action('cdp_loaded');
78
+ });
79
+ /** –– **/
80
+
81
+ /** –– **\
82
+ * Include all menus.
83
+ * @since 1.0.0
84
+ */
85
+ add_action('cdp_loaded', function () {
86
+ if (cdp_check_permissions(wp_get_current_user()) == false) return;
87
+ require_once plugin_dir_path(__FILE__) . 'menu/configuration.php';
88
+ require_once plugin_dir_path(__FILE__) . 'menu/tooltips.php';
89
+ require_once plugin_dir_path(__FILE__) . 'menu/variables.php';
90
+ require_once plugin_dir_path(__FILE__) . 'menu/modal.php';
91
+ require_once plugin_dir_path(__FILE__) . 'menu/notifications.php';
92
+ require_once plugin_dir_path(__FILE__) . 'post/handler.php';
93
+ });
94
+ /** –– **/
95
+
96
+ /** –– **\
97
+ * Admin Init
98
+ * @since 1.0.0
99
+ */
100
+ add_action('admin_init', function () {
101
+ if (cdp_check_permissions(wp_get_current_user()) == false) return;
102
+
103
+ if (get_option('_cdp_redirect', false)) {
104
+ delete_option('_cdp_redirect', false);
105
+ wp_redirect(admin_url('admin.php?page=copy-delete-posts'));
106
+ }
107
+
108
+ global $cdp_premium;
109
+ $cdp_premium_path = WP_PLUGIN_DIR . '/copy-delete-posts-premium';
110
+ $cdp_premium_ver_path = WP_PLUGIN_DIR . '/copy-delete-posts-premium/version.txt';
111
+ if (defined('CDP_PREMIUM_VERSION') && version_compare(CDP_PREMIUM_VERSION, CDP_VERSION, '!=')) {
112
+ if (is_plugin_active($cdp_premium)) deactivate_plugins($cdp_premium);
113
+ } else {
114
+ if (is_dir($cdp_premium_path) && file_exists($cdp_premium_ver_path)) {
115
+ $cdp_prem_ver_file = fopen($cdp_premium_ver_path, 'r') or false;
116
+ $cdp_prem_ver = fgets($cdp_prem_ver_file);
117
+ fclose($cdp_prem_ver_file);
118
+
119
+ if ((trim($cdp_prem_ver) == CDP_VERSION) && !is_plugin_active($cdp_premium)) activate_plugin($cdp_premium);
120
+ }
121
+ }
122
+ if (is_plugin_active($cdp_premium) && !file_exists($cdp_premium_ver_path)) {
123
+ if (is_plugin_active($cdp_premium)) deactivate_plugins($cdp_premium, true);
124
+ }
125
+ });
126
+ /** –– **/
127
+
128
+ /** –– **\
129
+ * Setup assets.
130
+ * @since 1.0.0
131
+ */
132
+ add_action('admin_enqueue_scripts', function () {
133
+ if (cdp_check_permissions(wp_get_current_user()) == false) return;
134
+ if (wp_doing_ajax()) return; global $cdp_plug_url;
135
+
136
+ global $pagenow;
137
+ global $post;
138
+ $screen = get_current_screen();
139
+ $min = defined('CDP_SCRIPT_DEBUG') && CDP_SCRIPT_DEBUG ? '' : '.min';
140
+ $allowed = ['post', 'edit-post', 'toplevel_page_copy-delete-posts', 'edit-page', 'page'];
141
+ $at = ($screen->id != 'attachment');
142
+
143
+ $g = get_option('_cdp_globals');
144
+ if ($g['others']) $g = $g['others'];
145
+ else $g = cdp_default_global_options();
146
+
147
+ if (is_object($post)) $type = $post->post_type;
148
+ else $type = false;
149
+
150
+ $ver = preg_replace('#[^\pL\pN/-]+#', '', CDP_VERSION);
151
+ wp_enqueue_style('cdp-css-global', "{$cdp_plug_url}/assets/css/cdp-global{$min}.css", '', $ver);
152
+ wp_enqueue_script('cdp-js-global', "{$cdp_plug_url}/assets/js/cdp-global{$min}.js", ['jquery'], $ver, true);
153
+ wp_enqueue_style('cdp-css-select', "{$cdp_plug_url}/assets/css/cdp-select{$min}.css", '', $ver);
154
+ wp_enqueue_script('cdp-js-select', "{$cdp_plug_url}/assets/js/cdp-select{$min}.js", '', $ver, true);
155
+ if (!$screen->is_block_editor() && $pagenow == 'post.php' && $at) {
156
+ if ($g['cdp-display-edit'] == 'true') {
157
+ $a = ($type == 'post' && $g['cdp-content-posts'] == 'true');
158
+ $b = ($type == 'page' && $g['cdp-content-pages'] == 'true');
159
+ $c = ($type != 'post' && $type != 'page' && $g['cdp-content-custom'] == 'true');
160
+ if ($a || $b || $c) wp_enqueue_style('cdp-editor', "{$cdp_plug_url}/assets/css/cdp-editor{$min}.css", '', $ver);
161
+ }
162
+ }
163
+
164
+ $ver = preg_replace('#[^\pL\pN/-]+#', '', CDP_VERSION);
165
+ if (!$screen || !in_array($screen->id, $allowed)) return;
166
+ wp_enqueue_style('cdp-css', "{$cdp_plug_url}/assets/css/cdp{$min}.css", '', $ver);
167
+ wp_enqueue_style('cdp-tooltips-css', "{$cdp_plug_url}/assets/css/cdp.tooltip{$min}.css", '', $ver);
168
+ wp_enqueue_style('cdp-css-user', "{$cdp_plug_url}/assets/css/cdp-user{$min}.css", '', $ver);
169
+ wp_enqueue_script('cdp-icPagination', "{$cdp_plug_url}/assets/js/cdp-icPagination{$min}.js", '', $ver);
170
+ wp_enqueue_script('cdp', "{$cdp_plug_url}/assets/js/cdp{$min}.js", '', $ver, true);
171
+ wp_enqueue_script('cdp-tooltips', "{$cdp_plug_url}/assets/js/cdp.tooltip{$min}.js", '', $ver, true);
172
+ wp_enqueue_script('cdp-modal', "{$cdp_plug_url}/assets/js/cdp-modal{$min}.js", '', $ver, true);
173
+ });
174
+ /** –– **/
175
+
176
+ /** –– **\
177
+ * Setup assets (not admin).
178
+ * @since 1.0.0
179
+ */
180
+ add_action('wp_enqueue_scripts', function () {
181
+ if (cdp_check_permissions(wp_get_current_user()) == false) return;
182
+ if (wp_doing_ajax() || (!(is_single() || is_page()))) return; global $cdp_plug_url;
183
+
184
+ $ver = preg_replace('#[^\pL\pN/-]+#', '', CDP_VERSION);
185
+ $min = defined('CDP_SCRIPT_DEBUG') && CDP_SCRIPT_DEBUG ? '' : '.min';
186
+ wp_enqueue_script('jquery-ui-draggable');
187
+ wp_enqueue_script('jquery-ui-droppable');
188
+ wp_enqueue_script('jquery-ui-sortable');
189
+ wp_enqueue_style('cdp-css-global', "{$cdp_plug_url}/assets/css/cdp-global{$min}.css", '', $ver);
190
+ wp_enqueue_script('cdp-js-global', "{$cdp_plug_url}/assets/js/cdp-global{$min}.js", ['jquery'], $ver, true);
191
+ wp_enqueue_style('cdp-css', "{$cdp_plug_url}/assets/css/cdp{$min}.css", '', $ver);
192
+ wp_enqueue_style('cdp-css-user', "{$cdp_plug_url}/assets/css/cdp-user{$min}.css", '', $ver);
193
+ wp_enqueue_script('cdp', "{$cdp_plug_url}/assets/js/cdp{$min}.js", ['jquery'], $ver, true);
194
+ wp_enqueue_script('cdp-tooltips', "{$cdp_plug_url}/assets/js/cdp.tooltip{$min}.js", '', $ver, true);
195
+ wp_enqueue_style('cdp-tooltips-css', "{$cdp_plug_url}/assets/css/cdp.tooltip{$min}.css", '', $ver);
196
+ wp_enqueue_script('cdp-modal', "{$cdp_plug_url}/assets/js/cdp-modal{$min}.js", ['jquery'], $ver, true);
197
+ wp_enqueue_script('cdp-js-user', "{$cdp_plug_url}/assets/js/cdp-user{$min}.js", '', $ver, true);
198
+ wp_enqueue_style('cdp-css-select', "{$cdp_plug_url}/assets/css/cdp-select{$min}.css", '', $ver);
199
+ wp_enqueue_script('cdp-js-select', "{$cdp_plug_url}/assets/js/cdp-select{$min}.js", '', $ver, true);
200
+ });
201
+ /** –– **/
202
+
203
+ /** –– **\
204
+ * Setup assets (for gutenberg).
205
+ * @since 1.0.0
206
+ */
207
+ add_action('enqueue_block_editor_assets', function () {
208
+ global $post;
209
+ global $cdp_plug_url;
210
+ $min = defined('CDP_SCRIPT_DEBUG') && CDP_SCRIPT_DEBUG ? '' : '.min';
211
+
212
+ $g = get_option('_cdp_globals')['others'];
213
+
214
+ $ver = preg_replace('#[^\pL\pN/-]+#', '', CDP_VERSION);
215
+ if (is_object($post)) $type = $post->post_type; else $type = false;
216
+ $a = ($type == 'post' && $g['cdp-content-posts'] == 'true');
217
+ $b = ($type == 'page' && $g['cdp-content-pages'] == 'true');
218
+ $c = ($type != 'post' && $type != 'page' && $g['cdp-content-custom'] == 'true');
219
+ if ($g['cdp-display-gutenberg'] == 'true' && ($a || $b || $c)) {
220
+ wp_enqueue_style('cdp-gutenberg', "{$cdp_plug_url}/assets/css/cdp-gutenberg{$min}.css", '', $ver);
221
+ wp_enqueue_script('cdp-js-gutenberg', "{$cdp_plug_url}/assets/js/cdp-gutenberg{$min}.js", ['jquery'], $ver, true);
222
+ }
223
+ });
224
+ /** –– **/
225
+
226
+ /** –– **\
227
+ * Settings and menu initializer.
228
+ * @since 1.0.0
229
+ */
230
+ add_action('admin_menu', function () {
231
+ if (cdp_check_permissions(wp_get_current_user()) == false) return;
232
+
233
+ // Menu icon
234
+ $icon_url = plugin_dir_url(__FILE__) . 'assets/imgs/icon.png'; // TODO: Add icon URL here
235
+
236
+ // Main menu slug
237
+ $parentSlug = 'copy-delete-posts';
238
+
239
+ // Main menu hook
240
+ add_menu_page('Copy & Delete Posts', '<span id="cdp-menu">Copy & Delete Posts</span>', 'read', $parentSlug, 'cdp_configuration', $icon_url, $position = 98);
241
+
242
+ // Remove default submenu by menu
243
+ remove_submenu_page($parentSlug, $parentSlug);
244
+ });
245
+ /** –– **/
246
+
247
+ /** –– **\
248
+ * Add copy option to Quick Actions of Posts.
249
+ * @since 1.0.0
250
+ */
251
+ add_filter('post_row_actions', function ($actions, $post) {
252
+ if (cdp_check_permissions(wp_get_current_user()) == false) return $actions;
253
+
254
+ // Get global options and post type
255
+ $g = get_option('_cdp_globals')['others'];
256
+ $type = $post->post_type;
257
+
258
+ // If user want to see the copy buton here pass
259
+ if ($g['cdp-display-posts'] == 'true')
260
+ if (($type == 'post' && $g['cdp-content-posts'] == 'true') || ($type != 'post' && $g['cdp-content-custom'] == 'true'))
261
+ $actions['cdp_copy'] = "<a href='#'><span class='cdp-copy-button cdp-tooltip-copy' x='".$type."' title='test' data-cdp-id='{$post->ID}'>Copy</span></a>";
262
+
263
+ return $actions;
264
+ }, 10, 2);
265
+ /** –– **/
266
+
267
+ /** –– **\
268
+ * Add copy option to Quick Actions of Pages.
269
+ * @since 1.0.0
270
+ */
271
+ add_filter('page_row_actions', function ($actions, $page) {
272
+ if (cdp_check_permissions(wp_get_current_user()) == false) return;
273
+
274
+ // Get global options and post type
275
+ $g = get_option('_cdp_globals')['others'];
276
+ $type = $page->post_type;
277
+
278
+ // If user want to see the copy buton here pass
279
+ if ($g['cdp-display-posts'] == 'true')
280
+ if (($type == 'page' && $g['cdp-content-pages'] == 'true') || ($type != 'page' && $g['cdp-content-custom'] == 'true'))
281
+ $actions['cdp_copy'] = "<a href='#'><span class='cdp-copy-button cdp-tooltip-copy' title='test' data-cdp-id='{$page->ID}'>Copy</span></a>";
282
+
283
+ return $actions;
284
+ }, 10, 2);
285
+ /** –– **/
286
+
287
+ /** –– **\
288
+ * Add copy option to Bulk Actions of Posts.
289
+ * @since 1.0.0
290
+ */
291
+ add_filter('bulk_actions-edit-post', function ($bulk_actions) {
292
+ if (cdp_check_permissions(wp_get_current_user()) == false) return;
293
+
294
+ $g = get_option('_cdp_globals')['others'];
295
+ if ($g['cdp-display-bulk'] == 'true') $bulk_actions['cdp_bulk_copy'] = 'Copy';
296
+
297
+ return $bulk_actions;
298
+ });
299
+ /** –– **/
300
+
301
+ /** –– **\
302
+ * Add copy option to Bulk Actions of Pages.
303
+ * @since 1.0.0
304
+ */
305
+ add_filter('bulk_actions-edit-page', function ($bulk_actions) {
306
+ if (cdp_check_permissions(wp_get_current_user()) == false) return;
307
+
308
+ $g = get_option('_cdp_globals')['others'];
309
+ if ($g['cdp-display-bulk'] == 'true') $bulk_actions['cdp_bulk_copy'] = 'Copy';
310
+
311
+ return $bulk_actions;
312
+ });
313
+ /** –– **/
314
+
315
+ /** –– **\
316
+ * Add copy option to admin bar inside preview.
317
+ * @since 1.0.0
318
+ */
319
+ add_action('admin_bar_menu', function ($admin_bar) {
320
+ if (cdp_check_permissions(wp_get_current_user()) == false) return;
321
+ $screen = ((function_exists('get_current_screen')?get_current_screen():false));
322
+ $screens = ['post', 'page'];
323
+
324
+ if (!(is_single() || is_page() || (isset($screen) && ($screen != false && in_array($screen->id, $screens))))) return;
325
+
326
+ $g = get_option('_cdp_globals')['others'];
327
+
328
+ global $post;
329
+ if (is_object($post)) $type = $post->post_type; else $type = false;
330
+ $a = ($type == 'post' && $g['cdp-content-posts'] == 'true');
331
+ $b = ($type == 'page' && $g['cdp-content-pages'] == 'true');
332
+ $c = ($type != 'post' && $type != 'page' && $g['cdp-content-custom'] == 'true');
333
+
334
+ if ($g['cdp-display-admin'] == 'false') return;
335
+ global $cdp_plug_url;
336
+
337
+ if ($a || $b || $c) {
338
+ $icon = '<span class="cdp-admin-bar-icon" data-plug-path="' . $cdp_plug_url . '" data-this-id="' . get_the_ID() . '"></span>';
339
+ $admin_bar->add_menu(array(
340
+ 'id' => '#cdp-copy-bar-x',
341
+ 'parent' => null,
342
+ 'group' => null,
343
+ 'title' => $icon . 'Copy this',
344
+ 'href' => '#',
345
+ 'meta' => array('class' => 'cdp-admin-bar-copy', 'target' => '_self')
346
+ ));
347
+ }
348
+ }, 80);
349
+ /** –– **/
350
+
351
+ /** –– **\
352
+ * Add notification to admin bar.
353
+ * @since 1.0.0
354
+ */
355
+ add_action('admin_bar_menu', function ($admin_bar) {
356
+ if (cdp_check_permissions(wp_get_current_user()) == false) return;
357
+ if (!is_admin()) return;
358
+
359
+ $data = cdp_notifications_menu();
360
+ $admin_bar->add_menu(array(
361
+ 'id' => 'wp-admin-copy-and-delete-posts',
362
+ 'parent' => null,
363
+ 'group' => null,
364
+ 'title' => $data['html'],
365
+ 'href' => '#',
366
+ 'meta' => array(
367
+ 'class' => 'cdp-admin-bar-noti menupop' . (($data['in_list'] == 0)?' cdp-noti-hide':''),
368
+ 'target' => '_self'
369
+ )
370
+ ));
371
+ }, 80);
372
+ /** –– **/
373
+
374
+ /** –– **\
375
+ * This function adds thickbox modal to preview and view pages.
376
+ * @since 1.0.0
377
+ */
378
+ add_action('wp_head', function () {
379
+ $g = get_option('_cdp_globals')['others'];
380
+ if ($g['cdp-display-admin'] == 'false') return;
381
+
382
+ global $cdp_plug_url, $post;
383
+
384
+ $post_id = false;
385
+ if (isset($post->ID)) $post_id = $post->ID;
386
+
387
+ // $wp_path = preg_replace('/wp-content.*$/','',__DIR__);
388
+ // $wp_path = preg_replace('/wp-content(?!.*wp-content).*/','',__DIR__);
389
+ // require_once($wp_path . 'wp-admin/includes/screen.php');
390
+
391
+ $screen = ((function_exists('get_current_screen'))?get_current_screen():false);
392
+ $profiles = get_option('_cdp_profiles');
393
+
394
+ if (cdp_check_permissions(wp_get_current_user()) == false) return;
395
+ if (is_single() || is_page()) {
396
+ cdp_vars($cdp_plug_url, $post_id);
397
+ cdp_modal($screen, $profiles);
398
+ }
399
+ });
400
+ /** –– **/
401
+
402
+ /** –– **\
403
+ * Add prepared HTML for tooltips and other info.
404
+ * @since 1.0.0
405
+ */
406
+ add_action('admin_notices', function () {
407
+ if (cdp_check_permissions(wp_get_current_user()) == false) return;
408
+
409
+ global $post, $cdp_plug_url, $cdp_globals;
410
+
411
+ $post_id = false; $hasParent = false;
412
+ $screen = get_current_screen();
413
+ $profiles = get_option('_cdp_profiles');
414
+ $deny = ['edit-page', 'edit-post'];
415
+
416
+ if (!in_array($screen->id, $deny)) {
417
+ if (isset($post->ID)) {
418
+ $post_id = $post->ID;
419
+ $meta = get_post_meta($post->ID, '_cdp_origin');
420
+ $site = get_post_meta($post->ID, '_cdp_origin_site');
421
+ if ($cdp_globals && array_key_exists('others', $cdp_globals) && array_key_exists('cdp-references-post', $cdp_globals['others'])) {
422
+ if ($cdp_globals['others']['cdp-references-edit'] == 'true') {
423
+ if (function_exists('switch_to_blog') && $site) switch_to_blog($site);
424
+ if (array_key_exists(0, $meta) && get_post_status($meta[0])) {
425
+ $parentTitle = get_the_title($meta[0]);
426
+ $link = get_post_permalink($meta[0]);
427
+ $hasParent = array(
428
+ 'title' => $parentTitle,
429
+ 'link' => $link
430
+ );
431
+ }
432
+ if (function_exists('restore_current_blog') && $site) restore_current_blog();
433
+ }
434
+ }
435
+ }
436
+ }
437
+
438
+ if (get_option('_cdp_show_copy', false)) {
439
+ echo '<span style="display: none; visibility: hidden;" id="cdp-show-copy-banner" data-value="true"></span>';
440
+ delete_option('_cdp_show_copy');
441
+ }
442
+ echo cdp_vars($cdp_plug_url, $post_id, $hasParent);
443
+ echo cdp_tooltip_content($profiles);
444
+ echo cdp_modal($screen, $profiles);
445
+ });
446
+ /** –– **/
447
+
448
+ /** –– **\
449
+ * Add button in standard editor.
450
+ * @since 1.0.0
451
+ */
452
+ add_action('post_submitbox_start', function () {
453
+ if (cdp_check_permissions(wp_get_current_user()) == false) return;
454
+ $g = get_option('_cdp_globals')['others'];
455
+ if ($g['cdp-display-edit'] == 'false') return;
456
+
457
+ global $post;
458
+ if (is_object($post)) $type = $post->post_type; else $type = false;
459
+ $a = ($type == 'post' && $g['cdp-content-posts'] == 'true');
460
+ $b = ($type == 'page' && $g['cdp-content-pages'] == 'true');
461
+ $c = ($type != 'post' && $type != 'page' && $g['cdp-content-custom'] == 'true');
462
+
463
+ if ($a || $b || $c)
464
+ echo '<div id="cdp-copy-btn"><a class="cdp-copy-btn-editor" href="#">Copy this post</a></div>';
465
+
466
+ });
467
+ /** –– **/
468
+
469
+ /** –– **\
470
+ * Add hook for cron (deletion).
471
+ * @since 1.0.0
472
+ */
473
+ add_action('cdp_cron_delete', function ($args = false) {
474
+
475
+ $ids = $args['ids'];
476
+ $trash = $args['trash'];
477
+ $site = (array_key_exists('site', $args)) ? $args['site'] : '-1';
478
+ $tok = $args['token']['token'];
479
+ $tsk = $args['token']['tsk'];
480
+
481
+ if ($args == false) return;
482
+
483
+ $cdp_cron = get_option('_cdp_crons');
484
+
485
+ if (!isset($cdp_cron[$tok]) || !$cdp_cron[$tok]) return;
486
+
487
+ $areWePro = areWePro(true, '/handler/crons.php');
488
+
489
+ if ($trash == true && $areWePro && function_exists('cdpp_crons_trash_post')) cdpp_crons_trash_post($ids);
490
+ else foreach ($ids as $i => $id) wp_delete_post($id, true);
491
+
492
+ $cdp_cron[$tok]['tasks'][$tsk] = current_time('timestamp');
493
+
494
+ $falsed = false; $last = false;
495
+ $i = 0; $size = sizeof($cdp_cron[$tok]['tasks']);
496
+ foreach ($cdp_cron[$tok]['tasks'] as $otsk => $val) {
497
+ if ($val == false) $falsed = true; $i++;
498
+ if ($i == ($size - 1)) $last = $otsk;
499
+ }
500
+
501
+ if ($last == $tsk || $falsed == false || $cdp_cron[$tok]['tasks'][$last] != false) {
502
+ $cdp_cron[$tok]['done'] = current_time('timestamp');
503
+ $cdp_cron[$tok]['shown'] = false;
504
+ }
505
+
506
+ update_option('_cdp_crons', $cdp_cron);
507
+
508
+ });
509
+ /** –– **/
510
+
511
+ /** –– **\
512
+ * Check if user is permmited to use this plugin.
513
+ * @since 1.0.0
514
+ * @param $user = current_user = object
515
+ *
516
+ * @return boolean
517
+ */
518
+ function cdp_check_permissions($user = array()) {
519
+ if (!isset($user) || empty($user)) return false;
520
+
521
+ $access = false;
522
+ $access_roles = get_option('_cdp_globals');
523
+ if (!isset($access_roles['roles'])) $access_roles = array();
524
+
525
+ foreach ($user->roles as $role => $name) {
526
+ if ($name == 'administrator' || (isset($access_roles['roles'][$name]) && $access_roles['roles'][$name] == 'true')) {
527
+ $access = true;
528
+ break;
529
+ }
530
+ }
531
+
532
+ return $access;
533
+ }
534
+ /** –– **/
535
+
536
+ /** –– **\
537
+ * First run of the plugin setup default options for Default profile
538
+ * @since 1.0.0
539
+ */
540
+ add_action('cdp_plugin_setup', 'cdp_setup_default_profile');
541
+ function cdp_setup_default_profile() {
542
+ $current = get_option('_cdp_globals');
543
+ $isSetup = get_option('_cdp_default_setup');
544
+ if (($current != false && array_key_exists('default', $current)) || $isSetup) return;
545
+
546
+ $already = array(); $globals = array();
547
+ $already['default'] = cdp_default_options();
548
+ $globals['others'] = cdp_default_global_options();
549
+
550
+ $s1 = update_option('_cdp_globals', $globals);
551
+ $s2 = update_option('_cdp_profiles', $already);
552
+
553
+ if ($s1 || $s2) update_option('_cdp_default_setup', true);
554
+ }
555
+ /** –– **/
556
+
557
+ /** –– **\
558
+ * Default settings for unset profiles
559
+ * @since 1.0.0
560
+ */
561
+ function cdp_default_options() {
562
+ return array(
563
+ 'title' => 'true',
564
+ 'date' => 'false',
565
+ 'status' => 'false',
566
+ 'slug' => 'true',
567
+ 'excerpt' => 'true',
568
+ 'content' => 'true',
569
+ 'f_image' => 'true',
570
+ 'template' => 'true',
571
+ 'format' => 'true',
572
+ 'author' => 'true',
573
+ 'password' => 'true',
574
+ 'attachments' => 'false',
575
+ 'children' => 'false',
576
+ 'comments' => 'false',
577
+ 'menu_order' => 'true',
578
+ 'category' => 'true',
579
+ 'post_tag' => 'true',
580
+ 'taxonomy' => 'true',
581
+ 'nav_menu' => 'true',
582
+ 'link_category' => 'true',
583
+ 'names' => array(
584
+ 'prefix' => '',
585
+ 'suffix' => '#[Counter]',
586
+ 'format' => '1',
587
+ 'custom' => 'm/d/Y',
588
+ 'display' => 'Default'
589
+ ),
590
+ 'usmplugin' => 'false',
591
+ 'yoast' => 'false'
592
+ );
593
+ }
594
+ function cdp_default_global_options() {
595
+ return array(
596
+ 'cdp-content-pages' => 'true',
597
+ 'cdp-content-posts' => 'true',
598
+ 'cdp-content-custom' => 'true',
599
+ 'cdp-display-posts' => 'true',
600
+ 'cdp-display-edit' => 'true',
601
+ 'cdp-display-admin' => 'true',
602
+ 'cdp-display-bulk' => 'true',
603
+ 'cdp-display-gutenberg' => 'true',
604
+ 'cdp-references-post' => 'false',
605
+ 'cdp-references-edit' => 'false'
606
+ );
607
+ }
608
+ /** –– **/
609
+
610
+ /** –– **\
611
+ * Add state info if user want it (the reference to original)
612
+ * @since 1.0.0
613
+ */
614
+ if (is_admin()) {
615
+ if ($cdp_globals && array_key_exists('others', $cdp_globals) && array_key_exists('cdp-references-post', $cdp_globals['others'])) {
616
+ if ($cdp_globals['others']['cdp-references-post'] == 'true') add_filter('display_post_states', 'cdp_state_post_add', 1, 10 );
617
+ }
618
+ }
619
+
620
+ function cdp_state_post_add($post_states, $post) {
621
+ if (cdp_check_permissions(wp_get_current_user()) == false) return $post_states;
622
+
623
+ $meta = get_post_meta($post->ID, '_cdp_origin');
624
+ $site = get_post_meta($post->ID, '_cdp_origin_site');
625
+
626
+ if (function_exists('switch_to_blog') && $site) switch_to_blog($site);
627
+ for ($i = sizeof($meta); $i >= 0; --$i) {
628
+ if (array_key_exists(($i-1), $meta) && get_post_status($meta[$i-1])) {
629
+ $link = get_post_permalink($meta[$i-1]);
630
+ $title = get_the_title($meta[$i-1]) . " – " . "ID: " . $meta[$i-1];
631
+ $post_states['_cdp'] = "Copy of <a class='cdp-tooltip-top' title='$title' href='$link' target='_blank'>this</a> post";
632
+ break;
633
+ }
634
+ }
635
+ if (function_exists('restore_current_blog') && $site) restore_current_blog();
636
+
637
+ return $post_states;
638
+ }
639
+ /** –– **/
640
+
641
+ /** –– **\
642
+ * Check the premium status and correction
643
+ * @since 1.0.0
644
+ */
645
+ function areWePro($include = true, $file = '/content/premium.php') {
646
+ // Get WP-Plugin path
647
+ $premium_plugin = 'copy-delete-posts-premium/copy-delete-posts-premium.php';
648
+ $premium_dir = WP_PLUGIN_DIR . '/' . 'copy-delete-posts-premium';
649
+ $pplugin_path = $premium_dir . $file;
650
+ $areWePro = false;
651
+
652
+ // Load premium content if the plugin is here
653
+ if (is_dir($premium_dir) && is_plugin_active($premium_plugin)) {
654
+
655
+ // Include cool features
656
+ if ($include) require_once($pplugin_path);
657
+
658
+ // Is premium function
659
+ $areWePro = true;
660
+
661
+ }
662
+
663
+ // Return answer
664
+ return $areWePro;
665
+ }
666
+ /** –– **/
667
+
668
+ /** –– **\
669
+ * It adds button on plugin list below plugin
670
+ * @since 1.0.0
671
+ */
672
+ add_filter('plugin_action_links_' . plugin_basename(__FILE__), function ($links) {
673
+ $links['cdp-settings-link'] = '<a href="' . admin_url('/admin.php?page=copy-delete-posts') . '">Settings</a>';
674
+ return $links;
675
+ });
676
+ /** –– **/
677
+
678
+ /** –– **\
679
+ * This function fixes Wordpress wp_upload_dir function
680
+ * @since 1.0.0
681
+ */
682
+ function cdp_fix_upload_paths($data) {
683
+ // Check if the base URL matches the format
684
+ $needs_fixing = preg_match("/wp-content\/blogs\.dir\/(\d+)\/files/", $data['baseurl'], $uri_part);
685
+
686
+ if ($needs_fixing) {
687
+ $data['url'] = str_replace($uri_part[0], 'files', $data['url']);
688
+ $data['baseurl'] = str_replace($uri_part[0], 'files', $data['baseurl']);
689
+ }
690
+
691
+ return $data;
692
+ }
693
+ /** –– **/
694
+
695
+ /** –– **\
696
+ * This function will sanitize whole array with sanitize_text_field – by RECURSION
697
+ * @since 1.0.0
698
+ */
699
+ function cdp_sanitize_array($data = null) {
700
+ $array = array();
701
+ if (is_array($data) || is_object($data))
702
+ foreach ($data as $key => $value) {
703
+ $key = ((is_numeric($key))?intval($key):sanitize_text_field($key));
704
+ if (is_array($value) || is_object($value)) $array[$key] = cdp_sanitize_array($value);
705
+ else $array[$key] = sanitize_text_field($value);
706
+ }
707
+ else if (is_string($data)) return sanitize_text_field($data);
708
+ else if (is_bool($data)) return $data;
709
+ else if (is_null($data)) return 'false';
710
+ else {
711
+ error_log('Copy & Delete Posts[copy-delete-posts.php:707]: Unknown AJaX datatype – ' . gettype($data));
712
+ echo 'error – invalid data';
713
+ wp_die();
714
+ }
715
+
716
+ return $array;
717
+ }
718
+ /** –– **/
menu/configuration.php ADDED
@@ -0,0 +1,914 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copy & Delete Posts – default menu.
4
+ *
5
+ * @package CDP
6
+ * @subpackage Configuration
7
+ * @author CopyDeletePosts
8
+ * @since 1.0.0
9
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
10
+
11
+ // Exit if accessed directly.
12
+ if (!defined('ABSPATH')) exit;
13
+
14
+ /** –– **\
15
+ * Adding assets.
16
+ * @since 1.0.0
17
+ */
18
+ add_action('admin_enqueue_scripts', function() {
19
+ if (cdp_check_permissions(wp_get_current_user()) == false) return;
20
+ $current_screen = get_current_screen();
21
+
22
+ if (!is_object($current_screen)) return;
23
+ if (wp_doing_ajax()) return;
24
+
25
+ wp_enqueue_script('cdp');
26
+ wp_enqueue_script('jquery-ui-draggable');
27
+ wp_enqueue_script('jquery-ui-droppable');
28
+ wp_enqueue_script('jquery-ui-sortable');
29
+ wp_enqueue_style('cdp-css');
30
+ });
31
+ /** –– **/
32
+
33
+ /** –– **\
34
+ * Main plugin configuration menu.
35
+ * @since 1.0.0
36
+ */
37
+ function cdp_configuration() {
38
+ if (cdp_check_permissions(wp_get_current_user()) == false) return;
39
+
40
+ global $cdp_plug_url;
41
+ $current_user = wp_get_current_user();
42
+ $user_id = get_current_user_id();
43
+ $no_intro = (get_option('_cdp_no_intro')) ? get_option('_cdp_no_intro') : array();
44
+ $has_intro = !in_array($user_id, $no_intro) || false;
45
+ $profiles = get_option('_cdp_profiles');
46
+ $defaults = get_option('_cdp_profiles')['default'];
47
+ $globals = get_option('_cdp_globals');
48
+ $roles = get_editable_roles();
49
+
50
+ $names_format = false;
51
+ $after_copy = false;
52
+ $post_converter = false;
53
+ $gos = false;
54
+ if (isset($defaults['names']))
55
+ if (isset($defaults['names']['format'])) $names_format = intval($defaults['names']['format']);
56
+
57
+ if (isset($globals)) {
58
+ if (isset($globals['afterCopy'])) $after_copy = $globals['afterCopy'];
59
+ if (isset($globals['postConverter'])) $post_converter = $globals['postConverter'];
60
+ if (isset($globals['others'])) $gos = $globals['others'];
61
+ }
62
+
63
+ // Ask for pro features
64
+ $areWePro = areWePro();
65
+
66
+ if (!$has_intro) {
67
+ $intro = ' style="display: none;"';
68
+ $content = '';
69
+ } else {
70
+ $intro = '';
71
+ $content = ' style="display: none; opacity: 0;"';
72
+ }
73
+
74
+ $isYoast = false; $isUSM = false;
75
+ if (is_plugin_active('wordpress-seo/wp-seo.php') || is_plugin_active('wordpress-seo-premium/wp-seo-premium.php')) $isYoast = true;
76
+ if (
77
+ is_plugin_active('Ultimate-Premium-Plugin/usm_premium_icons.php') ||
78
+ is_plugin_active('ultimate-social-media-icons/ultimate_social_media_icons.php') ||
79
+ is_plugin_active('ultimate-social-media-plus/ultimate-social-media-plus.php') ||
80
+ is_plugin_active('ultimate-social-media-plus/ultimate_social_media_plus.php')
81
+ ) $isUSM = true;
82
+
83
+ ?>
84
+
85
+ <style>
86
+ body {overflow: hidden}
87
+ #wpcontent { padding-left: 2px !important; }
88
+ #wpbody {overflow-y: scroll; overflow-x: auto; max-height: 100vh; min-height: calc(100vh - 32px);}
89
+ #wpfooter {display: none;}
90
+ </style>
91
+ <?php if ($areWePro && function_exists('cdpp_profile_manager_html')) cdpp_profile_manager_html(); ?>
92
+ <div class="cdp-preloader-c">
93
+ <div class="cdp-center">Loading...</div>
94
+ <div class="cdp-preloader"></div>
95
+ </div>
96
+ <div class="cdp-container cdp-main-menu-cont" style="display: none;">
97
+ <div class="cdp-content">
98
+ <div class="cdp-cf">
99
+ <div class="cdp-left">
100
+ <!-- <h1 class="cdp-f-s-30 cdp-f-w-light cdp-welcome-title-after">Welcome<?php echo ' ' . $current_user->user_login . ','; ?> to Copy & Delete Posts!</h1> -->
101
+ <h1 class="cdp-f-s-30 cdp-f-w-medium cdp-welcome-title-after">Welcome to Copy & Delete Posts!</h1>
102
+ </div>
103
+ <div class="cdp-right">
104
+ <div class="cdp-s-i-a cdp-welcome-title-after cdp-text-right cdp-green"<?php echo $content ?>><a class="cdp-pointer" id="cdp-show-into-again"><span class="cdp-green cdp-f-s-16">Show intro</span></a></div>
105
+ </div>
106
+ </div>
107
+
108
+ <div class="cdp-intro"<?php echo $intro ?>>
109
+ <div class="cdp-box cdp-white-bg cdp-shadow">
110
+ <div class="cdp-font-heading cdp-f-s-21 cdp-f-w-regular">You can now easily copy posts & pages in various areas:</div>
111
+ <div class="cdp-cf">
112
+ <div class="cdp-showcase-3 cdp-left">
113
+ <div class="cdp-font-title cdp-f-s-22 cdp-f-w-bold cdp-center">List of posts/pages</div>
114
+ <div class="cfg-img-sc-3 cdp-intro-image cdp-intro-img-1" alt="lists">
115
+ <img src="<?php echo $cdp_plug_url; ?>/assets/imgs/intro_1.gif" class="cdp-no-vis cfg-img-sc-3" alt="lists">
116
+ </div>
117
+ </div>
118
+ <div class="cdp-showcase-3 cdp-left">
119
+ <div class="cdp-font-title cdp-f-s-22 cdp-f-w-bold cdp-center">Edit screen</div>
120
+ <div class="cfg-img-sc-3 cdp-intro-image cdp-intro-img-2" alt="edit">
121
+ <img src="<?php echo $cdp_plug_url; ?>/assets/imgs/intro_2.gif" class="cdp-no-vis cfg-img-sc-3" alt="edit">
122
+ </div>
123
+ </div>
124
+ <div class="cdp-showcase-3 cdp-left">
125
+ <div class="cdp-font-title cdp-f-s-22 cdp-f-w-bold cdp-center">Admin bar</div>
126
+ <div class="cfg-img-sc-3 cdp-intro-image cdp-intro-img-3" alt="adminbar">
127
+ <img src="<?php echo $cdp_plug_url; ?>/assets/imgs/intro_3.jpg" class="cdp-no-vis cfg-img-sc-3" alt="adminbar">
128
+ </div>
129
+ </div>
130
+ </div>
131
+ <div class="cdp-center cdp-font-footer">…and you can also <b>delete duplicate</b> posts easily, see below :)</div>
132
+ <div class="cdp-center cdp-intro-options">
133
+ <button class="cdp-intro-button cdp-f-s-21 cdp-f-w-bold">Got it, close intro!</button>
134
+ <div class="cdp-ff-b1 cdp-checkboxes cdp-hide" style="margin-top: 5px;">
135
+ <label for="cdp-never-intro">
136
+ <input type="checkbox" checked id="cdp-never-intro" style="margin-top: -3px !important"/>
137
+ Don't show this intro – never again!
138
+ </label>
139
+ </div>
140
+ </div>
141
+ </div>
142
+ </div>
143
+
144
+ <div class="cdp-cf cdp-profile-bar">
145
+ <div class="cdp-left cdp-lh-48 cdp-f-s-20">
146
+ <div class="cdp-cf">
147
+ <div class="cdp-left cdp-f-w-light">
148
+ Below are your
149
+ </div>
150
+ <select class="cdp-left cdp-profile-selected cdp-select-styled cdp-select cdp-select-padding cdp-ow-border cdp-f-s-19 cdp-color-p-i<?php echo ((!$areWePro)?' cdp-premium-in-select':''); ?>">
151
+ <?php
152
+ $preSelProf = get_option('_cdp_preselections')[get_current_user_id()];
153
+ if ($profiles != false && $areWePro) {
154
+ foreach ($profiles as $profile => $vals):
155
+ $isSel = ($preSelProf == $profile);
156
+ ?>
157
+ <option value="<?php echo htmlspecialchars($profile); ?>"<?php echo ($isSel)?' selected':''?>><?php echo ucfirst(htmlspecialchars($vals['names']['display'])); ?></option>
158
+ <?php endforeach; } else { ?>
159
+ <option value="default" selected>Default</option>
160
+ <option value="premium" disabled>Add new</option>
161
+ <?php } ?>
162
+ </select>
163
+ <div class="cdp-left cdp-f-w-light">
164
+ settings
165
+ </div>
166
+ </div>
167
+ </div>
168
+ <div class="cdp-right cdp-lh-48 cdp-relative">
169
+ <div>
170
+ <span class="cdp-tooltip-premium" style="padding: 25px 0">
171
+ <span class="cdp-manager-btns cdp-green cdp-hover cdp-pointer cdp-f-w-light cdp-f-s-16" style="padding-right: 33px;">+ Add / manage / import / export settings</span>
172
+ <span class="cdp-premium-icon cdp-big-icon" style="right: 3px;"></span>
173
+ </span>
174
+ </div>
175
+ </div>
176
+ </div>
177
+ <div class="cdp-collapsibles" style="padding-top: 5px;">
178
+ <div class="cdp-collapsible" data-cdp-group="mains">
179
+ <div class="cdp-collapsible-title">
180
+ <div class="cdp-cf">
181
+ <div class="cdp-left cdp-ff-b1">Which <b class="cdp-ff-b4">elements</b> shall be copied?</div>
182
+ <div class="cdp-right"><i class="cdp-arrow cdp-arrow-left"></i></div>
183
+ </div>
184
+ </div>
185
+ <div class="cdp-collapsible-content cdp-nm cdp-np">
186
+ <div style="overflow-x: auto; max-width: 100%;">
187
+ <table class="cdp-table">
188
+ <thead class="cdp-thead cdp-f-s-18">
189
+ <tr>
190
+ <th></th>
191
+ <th><b>If checked</b> copies will...</th>
192
+ <th><b>If <u class="cdp-f-w-bold">un</u>checked</b> copies will...</th>
193
+ </tr>
194
+ </thead>
195
+ <tbody class="cdp-ff-b1 cdp-f-s-18 cdp-tbody-of-settings">
196
+ <tr>
197
+ <td><label class="cdp-relative"><input <?php echo $defaults['title']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="title" type="checkbox" /><span>Title <span class="cdp-info-icon"></span></span></label></td>
198
+ <td>…get the title as defined in the <a href="#" class="cdp-go-to-names-chapter"><span class="cdp-green">next chapter</span></a>.</td>
199
+ <td>…be titled “Untitled”.</td>
200
+ </tr>
201
+ <tr>
202
+ <td><label class="cdp-relative"><input <?php echo $defaults['date']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="date" type="checkbox" /><span>Date <span class="cdp-info-icon"></span></span></label></td>
203
+ <td>…get the same creation date & time as the original.</td>
204
+ <td>…get the date & time at time of copying. </td>
205
+ </tr>
206
+ <tr>
207
+ <td><label class="cdp-relative"><input <?php echo $defaults['status']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="status" type="checkbox" /><span>Status <span class="cdp-info-icon"></span></span></label></td>
208
+ <td>…get status of original article (which can be “published” or “deleted” etc.)</td>
209
+ <td>…get the status “Draft”.</td>
210
+ </tr>
211
+ <tr>
212
+ <td><label class="cdp-relative"><input <?php echo $defaults['slug']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="slug" type="checkbox" /><span>Slug <span class="cdp-info-icon"></span></span></label></td>
213
+ <td>…get the same <a href="https://kinsta.com/knowledgebase/wordpress-slug/" target="_blank"><span class="cdp-green">slug</span></a> of the original. (However after publishing it will give it automatically a new slug because 2 pages cannot be on the same URL).</td>
214
+ <td>…get a blank slug, unless the page is published, then it will generate it automatically.</td>
215
+ </tr>
216
+ <tr>
217
+ <td><label class="cdp-relative"><input <?php echo $defaults['excerpt']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="excerpt" type="checkbox" /><span>Excerpt <span class="cdp-info-icon"></span></span></label></td>
218
+ <td>…get the custom <a href="https://wordpress.org/support/article/excerpt/" target="_blank"><span class="cdp-green">excerpt</span></a> (post/page summary) of the original (if the original had any).</td>
219
+ <td>…get an empty <i>custom</i> excerpt (and default to taking the first 55 words of the post).</td>
220
+ </tr>
221
+ <tr>
222
+ <td><label class="cdp-relative"><input <?php echo $defaults['content']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="content" type="checkbox" /><span>Content <span class="cdp-info-icon"></span></span></label></td>
223
+ <td>…get all the content (text, images, videos and other elements/blocks) from the original.</td>
224
+ <td>…get no content (be completely blank).</td>
225
+ </tr>
226
+ <tr>
227
+ <td><label class="cdp-relative"><input <?php echo $defaults['f_image']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="f_image" type="checkbox" /><span>Featured image <span class="cdp-info-icon"></span></span></label></td>
228
+ <td>…it will set the same <a href="https://firstsiteguide.com/wordpress-featured-image/" target="_blank"><span class="cdp-green">featured image</span></a> as the original.</td>
229
+ <td>…get no featured image.</td>
230
+ </tr>
231
+ <tr>
232
+ <td><label class="cdp-relative"><input <?php echo $defaults['template']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="template" type="checkbox" /><span>Template <span class="cdp-info-icon"></span></span></label></td>
233
+ <td>…get the same page <a href="https://wpapprentice.com/blog/wordpress-theme-vs-template/" target="_blank"><span class="cdp-green">template</span></a> as original.</td>
234
+ <td>…get the default page template.</td>
235
+ </tr>
236
+ <tr>
237
+ <td><label class="cdp-relative"><input <?php echo $defaults['format']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="format" type="checkbox" /><span>Format <span class="cdp-info-icon"></span></span></label></td>
238
+ <td>…get the same <a href="https://wordpress.org/support/article/post-formats/" target="_blank"><span class="cdp-green">post format</span></a> as original.</td>
239
+ <td>…get the standard post format.</td>
240
+ </tr>
241
+ <tr>
242
+ <td><label class="cdp-relative"><input <?php echo $defaults['author']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="author" type="checkbox" /><span>Author <span class="cdp-info-icon"></span></span></label></td>
243
+ <td>…get the same author as original.</td>
244
+ <td>…get the user that is duplicating as an author.</td>
245
+ </tr>
246
+ <tr>
247
+ <td><label class="cdp-relative"><input <?php echo $defaults['password']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="password" type="checkbox" /><span>Password <span class="cdp-info-icon"></span></span></label></td>
248
+ <td>…get the same <a href="https://wordpress.org/support/article/using-password-protection/" target="_blank"><span class="cdp-green">password</span></a> as original.</td>
249
+ <td>…get no password.</td>
250
+ </tr>
251
+ <tr>
252
+ <td><label class="cdp-relative"><input <?php echo $defaults['attachments']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="attachments" type="checkbox" /><span>Attachments <span class="cdp-info-icon"></span></span></label></td>
253
+ <td>…create new <a href="https://wordpress.org/support/article/using-image-and-file-attachments/#attachment-to-a-post" target="_blank"><span class="cdp-green">attachments</span></a> (duplicates in Media Library) as well. <i>Recommended only for Multisites.</i></td>
254
+ <td>…get existing attachments from the original.</td>
255
+ </tr>
256
+ <tr>
257
+ <td><label class="cdp-relative"><input <?php echo $defaults['children']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="children" type="checkbox" /><span>Children <span class="cdp-info-icon"></span></span></label></td>
258
+ <td>…get their <a href="https://phppot.com/wordpress/how-to-create-a-child-page-in-wordpress/" target="_blank"><span class="cdp-green">child pages</span></a> copied as well, with all current settings applied to child-duplicates (if the page is a parent).</td>
259
+ <td>…not get their child pages copied along (if the page is a parent).</td>
260
+ </tr>
261
+ <tr>
262
+ <td><label class="cdp-relative"><input <?php echo $defaults['comments']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="comments" type="checkbox" /><span>Comments <span class="cdp-info-icon"></span></span></label></td>
263
+ <td>…get all comments from the original.</td>
264
+ <td>…get no comments from the original.</td>
265
+ </tr>
266
+ <tr>
267
+ <td><label class="cdp-relative"><input <?php echo $defaults['menu_order']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="menu_order" type="checkbox" /><span>Menu order <span class="cdp-info-icon"></span></span></label></td>
268
+ <td>…get the <a href="https://wordpress.stackexchange.com/questions/25202/how-to-change-order-of-menu-items" target="_blank"><span class="cdp-green">menu order</span></a> from the original.</td>
269
+ <td>…get the menu order set to default (0).</td>
270
+ </tr>
271
+ <tr>
272
+ <td><label class="cdp-relative"><input <?php echo $defaults['category']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="category" type="checkbox" /><span>Categories <span class="cdp-info-icon"></span></span></label></td>
273
+ <td>…get all categories from the original post.</td>
274
+ <td>…be Uncategorized, no categories will be copied.</td>
275
+ </tr>
276
+ <tr>
277
+ <td><label class="cdp-relative"><input <?php echo $defaults['post_tag']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="post_tag" type="checkbox" /><span>Tags <span class="cdp-info-icon"></span></span></label></td>
278
+ <td>…get all tags of the original post.</td>
279
+ <td>…be without any tags.</td>
280
+ </tr>
281
+ <tr>
282
+ <td><label class="cdp-relative"><input <?php echo $defaults['taxonomy']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="taxonomy" type="checkbox" /><span>Taxonomies <span class="cdp-info-icon"></span></span></label></td>
283
+ <td>…get all custom taxonomy from the original.</td>
284
+ <td>…be without custom taxonomy.</td>
285
+ </tr>
286
+ <tr>
287
+ <td>
288
+ <label>
289
+ <div class="cdp-cf">
290
+ <div class="cdp-left">
291
+ <input <?php echo $defaults['nav_menu']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="nav_menu" type="checkbox" />
292
+ </div>
293
+ <div class="cdp-left cdp-relative" style="width: calc(100% - 45px)">
294
+ <span>Navigation Menus <span class="cdp-info-icon" style="top: calc(50% + 4px) !important;"></span> </span>
295
+ </div>
296
+ </div>
297
+ </label>
298
+ </td>
299
+ <td>…get this private taxonomy from the original.</td>
300
+ <td>…be without private taxonomy.</td>
301
+ </tr>
302
+ <tr>
303
+ <td><label class="cdp-relative"><input <?php echo $defaults['link_category']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="link_category" type="checkbox" /><span>Link categories <span class="cdp-info-icon"></span></span></label></td>
304
+ <td>…get this private taxonomy from the original.</td>
305
+ <td>…be without private taxonomy.</td>
306
+ </tr>
307
+
308
+ <tr<?php echo (!$isUSM)?' style="display: none;"':'' ?>>
309
+ <td class="cdp-tooltip-premium">
310
+ <label>
311
+ <div class="cdp-cf">
312
+ <div class="cdp-left">
313
+ <input <?php echo ($defaults['usmplugin']=='true' && $areWePro == true)?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="usmplugin" type="checkbox" />
314
+ </div>
315
+ <div class="cdp-left cdp-relative" style="width: calc(100% - 45px)">
316
+ <span>Ultimate Social Media Settings<span class="cdp-premium-icon cdp-big-icon" style="top: calc(50% + 2px) !important;"></span> </span>
317
+ </div>
318
+ </div>
319
+ </label>
320
+ </td>
321
+ <td>…the same settings from the <a href="https://www.ultimatelysocial.com/usm-premium/" target="_blank"><span class="cdp-green">Ultimate Social Media plugin</span></a> as the original.</td>
322
+ <td>…get empty settings.</td>
323
+ </tr>
324
+
325
+ <tr<?php echo (!$isYoast)?' style="display: none;"':'' ?>>
326
+ <td class="cdp-tooltip-premium">
327
+ <label>
328
+ <div class="cdp-cf">
329
+ <div class="cdp-left">
330
+ <input <?php echo ($defaults['yoast']=='true' && $areWePro == true)?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="yoast" type="checkbox" />
331
+ </div>
332
+ <div class="cdp-left cdp-relative" style="width: calc(100% - 45px)">
333
+ <span>Yoast SEO Settings <span class="cdp-premium-icon cdp-big-icon" style="top: calc(50% + 2px) !important;"></span> </span>
334
+ </div>
335
+ </div>
336
+ </label>
337
+ </td>
338
+ <td>…the same settings from the <a href="https://wordpress.org/plugins/wordpress-seo/" target="_blank"><span class="cdp-green">Yoast SEO plugin</span></a> as the original.</td>
339
+ <td>…get empty settings.</td>
340
+ </tr>
341
+
342
+ </tbody>
343
+ </table>
344
+ <div class="cdp-pad-lin cdp-gray cdp-f-s-18 cdp-lh-24 cdp-center" style="padding-top: 40px; padding-bottom: 20px;">
345
+ <i>Do you know anything else you want to have copied (e.g. data added by a different plugin)? <br />
346
+ Please <a href="mailto:hi@copy-delete-posts.com" target="_blank"><span class="cdp-green">tell us about it</span></a>, we always want to further improve this plugin! :) </i>
347
+ </div>
348
+ <div class="cdp-center cdp-padding cdp-p-35-b">
349
+ <button class="cdp-button cdp-save-options">Save</button>
350
+ <div class="cdp-padding cdp-f-s-17">
351
+ <a href="#" class="cdp-close-chapter">Close chapter</a>
352
+ </div>
353
+ </div>
354
+ </div>
355
+ </div>
356
+ </div>
357
+ <div class="cdp-collapsible" data-cdp-group="mains">
358
+ <div class="cdp-collapsible-title cdp-name-section-cnx">
359
+ <div class="cdp-cf">
360
+ <div class="cdp-left cdp-ff-b1">What <b class="cdp-ff-b4">name(s)</b> should the copies have?</div>
361
+ <div class="cdp-right"><i class="cdp-arrow cdp-arrow-left"></i></div>
362
+ </div>
363
+ </div>
364
+ <div class="cdp-collapsible-content cdp-np cdp-drags-cont">
365
+ <div class="cdp-pad-lin cdp-f-s-18 cdp-f-w-light">
366
+ Build your preferred naming logic for the copies:
367
+ </div>
368
+ <div class="cdp-green-bg cdp-pad-lin" style="padding-bottom: 20px;">
369
+ <div class="cdp-cf cdp-center">
370
+ <div class="cdp-left cdp-names-input cdp-f-s-16">Prefix</div>
371
+ <div class="cdp-left cdp-names-divider cdp-nlh"></div>
372
+ <div class="cdp-left cdp-names-input cdp-f-s-16">Suffix</div>
373
+ </div>
374
+ <div class="cdp-cf cdp-center">
375
+ <div class="cdp-left cdp-names-input">
376
+ <div strip-br="true" class="cdp-magic-input cdp-shadow cdp-sorts cdp-names-real-input cdp-names-prefix" wrap="off" contenteditable="true" style="margin-right: 0">
377
+ <?php echo (isset($defaults['names']) && isset($defaults['names']['prefix']))?$defaults['names']['prefix']:''; ?>
378
+ </div>
379
+ </div>
380
+ <div class="cdp-left cdp-names-divider cdp-f-s-19 cdp-f-w-light">
381
+ <span class="cdp-tooltip-top cdp-togglable-name-b" title="Change to blank">(Name of original)</span>
382
+ </div>
383
+ <div class="cdp-left cdp-names-input">
384
+ <div strip-br="true" class="cdp-magic-input cdp-shadow cdp-sorts cdp-names-real-input cdp-names-suffix" wrap="off" contenteditable="true" style="margin-left: 0">
385
+ <?php echo (isset($defaults['names']) && isset($defaults['names']['suffix']))?$defaults['names']['suffix']:''; ?>
386
+ </div>
387
+ </div>
388
+ </div>
389
+ <div class="cdp-curr-cont">
390
+ <span class="cdp-f-s-18">Example based on current selections:</span>
391
+ <span class="cdp-f-s-16 cdp-padding-10-h">
392
+ <span class="cdp-example-name cdp-f-w-bold">(Name of original)</span>
393
+ </span>
394
+ </div>
395
+ </div>
396
+ <div class="cdp-pad-lin cdp-f-s-18">
397
+ <div class="cdp-padding-23-h">Drag & drop the automatic elements into the Prefix/Suffix fields to add them.</div>
398
+ <div class="">
399
+ <div class="cdp-cf cdp-padding-10-h">
400
+ <div class="cdp-left">
401
+ <div class="cdp-name-box cdp-drag-name cdp-name-clickable" oncontextmenu="return false;" data-cdp-val="0">Counter</div>
402
+ </div>
403
+ <div class="cdp-left cdp-names-text-info">Adds an <b class="cdp-f-w-semi-bold">incremental counter</b> (starting with “2”)</div>
404
+ </div>
405
+ <div class="cdp-cf cdp-padding-10-h">
406
+ <div class="cdp-left" style="margin-top: 6px;">
407
+ <div class="cdp-name-box cdp-drag-name cdp-name-clickable" oncontextmenu="return false;" data-cdp-val="2">CurrentDate</div>
408
+ </div>
409
+ <div class="cdp-left cdp-names-text-info">
410
+ <div class="cdp-cf" style="line-height: 49px !important;">
411
+ <div class="cdp-left">
412
+ Adds the <b class="cdp-f-w-semi-bold">current date</b> in
413
+ </div>
414
+ <select class="cdp-left cdp-select-styled cdp-date-picked cdp-select cdp-dd-p-43 cdp-select-padding cdp-ow-border cdp-f-s-19 cdp-select-black cdp-option-premium" name="cdp-date-option">
415
+ <option value="1"<?php echo ($names_format == 1 || $names_format == false || (!$areWePro && $names_format == 3))?' selected':''; ?>>mm/dd/yyyy</option>
416
+ <option value="2"<?php echo ($names_format == 2)?' selected':''; ?>>dd/mm/yyyy</option>
417
+ <option value="3"<?php echo (($areWePro && $names_format == 3)?' selected':''); ?>>Custom</option>
418
+ </select>
419
+ <?php if ($areWePro && function_exists('cdpp_custom_date')) cdpp_custom_date($names_format, $defaults); ?>
420
+ <div class="cdp-left" style="padding-left: 15px;">format.</div>
421
+ </div>
422
+ <?php if ($areWePro && function_exists('cdpp_custom_date_info')) cdpp_custom_date_info(); ?>
423
+ </div>
424
+ </div>
425
+ <div class="cdp-cf cdp-padding-10-h" style="padding-bottom: 0; margin-top: 6px;">
426
+ <div class="cdp-left">
427
+ <div class="cdp-name-box cdp-drag-name cdp-name-clickable" oncontextmenu="return false;" data-cdp-val="1">CurrentTime</div>
428
+ </div>
429
+ <div class="cdp-left cdp-names-text-info">Adds the <b class="cdp-f-w-semi-bold">current time</b> in hh:mm:ss format</div>
430
+ </div>
431
+ </div>
432
+ <div class="cdp-padding-23-h">
433
+ <p class="cdp-f-s-18">You can also type tailored text into the fields above.</p>
434
+ <p class="cdp-f-s-18">If you’re not of the drag & droppy-type, you can also enter shortcodes [Counter], [CurrentDate] and [CurrentTime].</p>
435
+ <p class="cdp-f-s-18">If you make multiple copies in one go, use the Counter-option as otherwise some copies will have the same name.</p>
436
+ </div>
437
+ <div class="cdp-center">
438
+ <button class="cdp-button cdp-save-options">Save</button>
439
+ <div class="cdp-padding cdp-f-s-17">
440
+ <a href="#" class="cdp-close-chapter">Close chapter</a>
441
+ </div>
442
+ </div>
443
+ </div>
444
+ </div>
445
+ </div>
446
+
447
+ <div class="cdp-collapsible" data-cdp-group="mains">
448
+ <div class="cdp-collapsible-title">
449
+ <div class="cdp-cf">
450
+ <div class="cdp-left cdp-ff-b1"><b class="cdp-ff-b4">Other</b> options</div>
451
+ <div class="cdp-right"><i class="cdp-arrow cdp-arrow-left"></i></div>
452
+ </div>
453
+ </div>
454
+ <div class="cdp-collapsible-content cdp-oth-section cdp-np cdp-special-cb-p">
455
+ <div class="cdp-pad-lin">
456
+ <div><h2 class="cdp-f-s-18"><b class="cdp-f-w-bold">Navigation after copying</b></h2></div>
457
+ <div class="cdp-padding-15-h">
458
+ <div class="cdp-con-cen">
459
+ <select class="cdp-other-options cdp-select cdp-select-centered cdp-sel-separat cdp-select-large cdp-dd-p-40 cdp-c-x-a-v" name="after_copy">
460
+ <option value="1"<?php echo ($after_copy == '1' || $after_copy == false)?' selected':''; ?>>Leave me where I was</option>
461
+ <option value="2"<?php echo ($after_copy == '2')?' selected':''; ?>>Take me to the edit-page of the created copy</option>
462
+ <option value="3"<?php echo ($after_copy == '3')?' selected':''; ?>>Decide on a case-by-case basis (adds new button on copy screen)</option>
463
+ </select>
464
+ </div>
465
+ <div class="cdp-if-edit-page-selected cdp-con-cen cdp-f-s-18 cdp-f-w-light cdp-p-25-40" style="display: none;">If you created multiple copies in one go, you’ll be taken to the first copy. </div>
466
+ </div>
467
+ <div>
468
+ <h2>
469
+ <b class="cdp-relative cdp-f-s-18 cdp-f-w-bold cdp-tooltip-premium" data-top="5" style="padding-right: 30px;">Pages vs. Posts converter <span class="cdp-premium-icon cdp-big-icon"></span></b>
470
+ </h2>
471
+ </div>
472
+ <div class="cdp-f-s-18 cdp-f-w-light">
473
+ <p class="cdp-f-s-18 cdp-f-w-light">By default, the type of what you copy does not change, i.e. if you copy a post the new version will also be a post, and the same for pages.</p>
474
+ <p class="cdp-padding-15-h cdp-f-s-18 cdp-f-w-light">If you want to make a page out of a post, or vice versa, then you can do this on a <b class="cdp-f-w-bold">case by case basis</b> if you select the option “Define it specifically for this case” in the copy-tooltip, and then select this option on the following screen in the tooltip.</p>
475
+ <p class="cdp-f-s-18 cdp-f-w-light">However, if you want it as a <b class="cdp-f-w-bold">default setting option</b>, then please select it below: </p>
476
+ </div>
477
+ <div class="cdp-con-cen">
478
+ <span class="cdp-tooltip-premium" data-top="-5" style="padding: 20px 0">
479
+ <select class="cdp-other-options cdp-select cdp-select-centered cdp-sel-separat cdp-select-large cdp-c-x-a-v" name="post_converter">
480
+ <option value="1"<?php echo ($post_converter == '1' || $post_converter == false)?' selected':''; ?>>Copies will be the same type as the original</option>
481
+ <option value="2"<?php echo ($post_converter == '2')?' selected':''; ?>>ALWAYS change the type when copied (posts will become pages, pages will become posts)</option>
482
+ </select>
483
+ </span>
484
+ </div>
485
+ <div class=""><h2><b class="cdp-f-s-18 cdp-f-w-bold">User level permissions</b></h2></div>
486
+ <div class="cdp-f-s-18 cdp-p-15-25 cdp-f-w-light">Which user role(s) should be able to copy & delete? <i style="color: gray">– The role also must have access to the dashboard.</i></div>
487
+ <div class="cdp-p-25-40 cdp-f-s-18 cdp-f-w-light">
488
+ <?php
489
+ $isSaved = false;
490
+
491
+ if (isset($globals)) $isSaved = true;
492
+ foreach ($roles as $role => $value) {
493
+ $checked = '';
494
+ $role = ucwords($role);
495
+ $rn = preg_replace('/[^a-z]/', '', strtolower($role));
496
+ $d = ($role == 'Administrator')?' disabled checked="checked"':'';
497
+
498
+ if ($isSaved && $role != 'Administrator')
499
+ if (isset($globals['roles'][$rn]) && $globals['roles'][$rn] == 'true')
500
+ $checked = ' checked';
501
+
502
+ echo('<label for="cdp-roles-'.$rn.'"><input class="cdp-other-roles" id="cdp-roles-'.$rn.'"'.$checked.' type="checkbox"'.$d.' name="'.$rn.'">'.$role.'</label>&nbsp;');
503
+ }
504
+ ?>
505
+ </div>
506
+ <div class=""><h2><b class="cdp-f-s-18 cdp-f-w-bold">Content types which can be copied</b></h2></div>
507
+ <div class="cdp-p-25-40 cdp-f-s-18 cdp-f-w-light">
508
+ <label for="cdp-o-pages"><input <?php echo ($gos['cdp-content-pages'] == 'true')?'checked ':''; ?>id="cdp-o-pages" type="checkbox" class="cdp-other-inputs" name="cdp-content-pages">Pages</label>
509
+ <label for="cdp-o-posts"><input <?php echo ($gos['cdp-content-posts'] == 'true')?'checked ':''; ?>id="cdp-o-posts" type="checkbox" class="cdp-other-inputs" name="cdp-content-posts">Posts</label>
510
+ <label for="cdp-o-custom"><input <?php echo ($gos['cdp-content-custom'] == 'true')?'checked ':''; ?>id="cdp-o-custom" type="checkbox" class="cdp-other-inputs" name="cdp-content-custom">Custom posts types</label>
511
+ </div>
512
+ <div class=""><h2><b class="cdp-f-s-18 cdp-f-w-bold">Display copy option on...</b></h2></div>
513
+ <div class="cdp-p-25-40 cdp-f-s-18 cdp-f-w-light">
514
+ <label for="cdp-o-postspages"><input <?php echo ($gos['cdp-display-posts'] == 'true')?'checked ':''; ?>id="cdp-o-postspages" type="checkbox" class="cdp-other-inputs" name="cdp-display-posts">Posts/pages lists</label>
515
+ <label for="cdp-o-edit"><input <?php echo ($gos['cdp-display-edit'] == 'true')?'checked ':''; ?>id="cdp-o-edit" type="checkbox" class="cdp-other-inputs" name="cdp-display-edit">Edit screens</label>
516
+ <label for="cdp-o-admin"><input <?php echo ($gos['cdp-display-admin'] == 'true')?'checked ':''; ?>id="cdp-o-admin" type="checkbox" class="cdp-other-inputs" name="cdp-display-admin">Admin bar</label>
517
+ <label for="cdp-o-bulk"><input <?php echo ($gos['cdp-display-bulk'] == 'true')?'checked ':''; ?>id="cdp-o-bulk" type="checkbox" class="cdp-other-inputs" name="cdp-display-bulk">Bulk actions menu</label>
518
+ <label for="cdp-o-gutenberg"><input <?php echo ($gos['cdp-display-gutenberg'] == 'true')?'checked ':''; ?>id="cdp-o-gutenberg" type="checkbox" class="cdp-other-inputs" name="cdp-display-gutenberg">Gutenberg editor</label>
519
+ </div>
520
+ <div class=""><h2><b class="cdp-f-s-18 cdp-f-w-bold">Show reference to original item?</b></h2></div>
521
+ <div class="cdp-f-s-18 cdp-f-w-light cdp-p-15-25">If checked, you will see a reference to the original post/page (on the copied version).</div>
522
+ <div class="cdp-p-25-40 cdp-f-s-18 cdp-f-w-light">
523
+ <label for="cdp-o-posts2"><input <?php echo ($gos['cdp-references-post'] == 'true')?'checked ':''; ?>id="cdp-o-posts2" type="checkbox" class="cdp-other-inputs" name="cdp-references-post">Posts/pages lists</label>
524
+ <label for="cdp-o-edits2"><input <?php echo ($gos['cdp-references-edit'] == 'true')?'checked ':''; ?>id="cdp-o-edits2" type="checkbox" class="cdp-other-inputs" name="cdp-references-edit">Edit screens</label>
525
+ </div>
526
+ <div class="cdp-center cdp-padding-15-h">
527
+ <button class="cdp-button cdp-save-options">Save</button>
528
+ <div class="cdp-padding cdp-f-s-17">
529
+ <a href="#" class="cdp-close-chapter">Close chapter</a>
530
+ </div>
531
+ </div>
532
+ </div>
533
+ </div>
534
+ </div>
535
+ <div class="cdp-f-s-20 cdp-p-hh">
536
+ ...and after your copy frenzy, you may need to…
537
+ </div>
538
+
539
+ <!-- DELETE SECTION -->
540
+
541
+ <div class="cdp-collapsible" data-cdp-group="mains">
542
+ <div class="cdp-collapsible-title">
543
+ <div class="cdp-cf">
544
+ <div class="cdp-left cdp-ff-b1"><b class="cdp-ff-b4">Delete duplicate posts/pages</b></div>
545
+ <div class="cdp-right"><i class="cdp-arrow cdp-arrow-left"></i></div>
546
+ </div>
547
+ </div>
548
+ <div class="cdp-collapsible-content cdp-d-section cdp-np">
549
+
550
+ <div class="cdp-padding">
551
+ <div class="cdp-backup-alert cdp-f-s-20 cdp-f-w-light">
552
+ Before you delete anything here (which cannot be undone!) we <b class="cdp-f-w-bold">strongly suggest</b><br />
553
+ that you create a backup, for example with <a href="https://wordpress.org/plugins/wp-clone-by-wp-academy/" target="_blank">this plugin</a>
554
+ </div>
555
+ <div class="cdp-cf cdp-tab-list">
556
+ <div class="cdp-left cdp-tab-element cdp-tab-active" data-box="cdp-tabox-manual">
557
+ <span>Manual Cleanup</span>
558
+ </div>
559
+ <div class="cdp-left cdp-tab-element cdp-tooltip-premium" data-top="-4" data-box="cdp-tabox-automatic" data-disabled="true">
560
+ <span class="cdp-relative">Automatic Cleanup <span class="cdp-premium-icon cdp-big-icon"></span></span>
561
+ </div>
562
+ <div class="cdp-left cdp-tab-element cdp-tooltip-premium" data-top="-4" data-box="cdp-tabox-redirects" data-disabled="true">
563
+ <span class="cdp-relative">Redirection <span class="cdp-premium-icon cdp-big-icon"></span></span>
564
+ </div>
565
+ </div>
566
+ <div class="cdp-cont-d-box-tabed" id="cdp-tabox-redirects">
567
+ TEST TEST 3
568
+ </div>
569
+ <div class="cdp-cont-d-box-tabed" id="cdp-tabox-automatic">
570
+ TEST TEST 2
571
+ </div>
572
+ <div class="cdp-cont-d-box-tabed" id="cdp-tabox-manual">
573
+
574
+ <!-- ABOVE DELETION TABLE -->
575
+ <div class="cdp-d-pad-sp" style="padding-top: 20px">
576
+ <div class="cdp-special-cb-p">
577
+ <div class="cdp-d-header cdp-f-s-19">
578
+ Scan for duplicates in...
579
+ </div>
580
+ <div class="cdp-p-25-40 cdp-f-s-18">
581
+ <label><input type="checkbox" name="cdp-d-a-posts" checked class="cdp-d-option cdp-d-first-chapter-cb" />Posts</label>
582
+ <label><input type="checkbox" name="cdp-d-a-pages" checked class="cdp-d-option cdp-d-first-chapter-cb" />Pages</label>
583
+ <label><input type="checkbox" name="cdp-d-a-customs" checked class="cdp-d-option cdp-d-first-chapter-cb" />Custom posts</label>
584
+ </div>
585
+ </div>
586
+ <div class="cdp-special-cb-p">
587
+ <div class="cdp-d-header cdp-f-s-19">
588
+ Count them as duplicates if they are identical with respect to <u class="cdp-f-w-bold">all</u> of the below...
589
+ </div>
590
+ <div>
591
+ <div class="cdp-p-25-t cdp-cf">
592
+ <div class="cdp-left cdp-f-s-18">
593
+ <label style="margin-right: 5px;"><input type="checkbox" checked name="cdp-d-b-title" class="cdp-d-option"/>Title</label>
594
+ </div>
595
+ <div class="cdp-left" style="margin-top: 1px; margin-left: 5px; font-size: 13px;">
596
+ <a href="#" class="cdp-show-more-d-title cdp-f-s-16" style="line-height: 43px;">(show more options)</a>
597
+ </div>
598
+ <div class="cdp-left cdp-f-s-18" style="margin-left: 50px;">
599
+ <label><input type="checkbox" name="cdp-d-b-slug" class="cdp-d-option" />Similar slug <span class="cdp-tooltip-top" title="Slugs are never 100% identical (i.e. Wordpress adds a counter automatically to ensure they are unique). The rule to only have them at least 85% identical does the job fine (you can see after the scan which posts are considered identical).">(x ≥ 85%)</span></label>
600
+ </div>
601
+ </div>
602
+ <div class="cdp-p-20-h cdp-more-d-title" style="display: none; padding-left: 37px;">
603
+ <div class="cdp-f-s-17 cdp-p-20-b cdp-lh-24">
604
+ Do you want to consider different titles still to be identical if a) the copied posts/pages<br />were created by this plugin and b) they were not modified thereafter?
605
+ </div>
606
+ <div class="cdp-cf">
607
+ <label class="cdp-left cdp-f-s-18"><input type="radio" class="cdp-d-option cdp-radio" value="0" name="cdp-radio-btn-dtitles" checked>No</label>
608
+ <label class="cdp-left cdp-f-s-18"><input type="radio" class="cdp-d-option cdp-radio" value="1" name="cdp-radio-btn-dtitles">Yes</label>
609
+ <span class="cdp-green cdp-f-s-17 cdp-tooltip-top cdp-left" title="The copies you created may have been given different titles automatically (according to the rules in <a href='#' class='cdp-go-to-names-chapter'>this chapter</a>) and therefore would not count as duplicates as they have different titles.<br /><br />To remedy this, you can select “Yes” here so that those posts/pages also get considered as duplicates." style="line-height: 44px;">When does “yes” make sense here?</span>
610
+ </div>
611
+ </div>
612
+ <!-- <div class="cdp-padding-15-h cdp-f-s-18">
613
+ </div> -->
614
+ <div class="cdp-cf cdp-p-40-b">
615
+ <label class="cdp-left cdp-f-s-18" style="margin-right: 21px;">
616
+ <input type="checkbox" name="cdp-d-c-excerpt" class="cdp-d-option" />Excerpt (<span class="cdp-no-empty-text"><b>including</b> empty</span>)
617
+ </label>
618
+ <label class="cdp-left cdp-f-s-18" style="margin-right: 90px !important;"><input type="checkbox" name="cdp-d-c-count" class="cdp-d-option"/>Word count</label>
619
+ <div class="cdp-left cdp-f-s-17" style="line-height: 43px;">
620
+ ...need others? <a href="mailto:hi@copy-delete-posts.com" target="_blank">Suggest them!</a>
621
+ </div>
622
+ </div>
623
+ </div>
624
+ <div class="cdp-d-option-select-parent cdp-padding-15-h cdp-center cdp-ntp">
625
+ <div class="cdp-inline cdp-cf">
626
+ <select class="cdp-left cdp-d-option-select cdp-pad-49-list cdp-select-large cdp-max-600 cdp-select cdp-select-centered cdp-sel-separat" name="cdp-d-sels-diftyp">
627
+ <option value="1">Only count pages/posts of the same type as duplicates</option>
628
+ <option value="2">Also count pages/posts of different types as duplicates</option>
629
+ </select>
630
+ <span class="cdp-left cdp-green">
631
+ <div style="margin-left: 15px; line-height: 51px;">
632
+ <span class="cdp-tooltip-top" title='Select the “same type”-option if the pages/posts have to be of the same type (i.e. post / page / specific custom post category) in order to count as duplicates. If you select “cross-type” then pages/posts of different types will also be considered as duplicates.'>Huh?</span>
633
+ </div>
634
+ </span>
635
+ </div>
636
+ </div>
637
+ </div>
638
+ <div class="">
639
+ <div class="cdp-d-header cdp-f-s-19">
640
+ Which version do you want to keep?
641
+ </div>
642
+ <div class="cdp-p-30-h cdp-center">
643
+ <select class="cdp-d-option-select cdp-pad-49-list cdp-select-large cdp-select cdp-select-centered cdp-sel-separat" name="cdp-d-d-sel-which">
644
+ <option value="1">Keep the oldest duplicate (typically the original)</option>
645
+ <option value="2">Keep the newest duplicate (typically the last copy you made)</option>
646
+ <option value="3">Delete ALL duplicates, don’t keep any (Be careful!)</option>
647
+ </select>
648
+ </div>
649
+ </div>
650
+ <div class="cdp-relative cdp-f-s-19">
651
+ <span class="cdp-tooltip-premium" data-top="0">
652
+ <b>More filters (optional)</b>: Only list them (as candidate for deletion) if they […] <span class="cdp-premium-icon cdp-big-icon"></span>
653
+ </span>
654
+ </div>
655
+ <br />
656
+ <div class="cdp-center cdp-p-30-h">
657
+ <button class="cdp-button cdp-delete-btn cdp-d-search cdp-rl-round cdp-f-w-bold" type="button" name="button">Scan for duplicates now!<br /><small class="cdp-sm-d cdp-f-s-17 cdp-f-w-medium">(at this point nothing gets deleted)</small></button>
658
+ </div>
659
+ </div>
660
+
661
+ <div class="cdp-padding-15-h">
662
+ <div class="cdp-cf cdp-d-pad-sp cdp-not-yet-search" style="display: none; padding-bottom: 30px;">
663
+ <div class="cdp-left cdp-f-s-19 cdp-f-w-bold" style="line-height: 41px;">
664
+ Scan has found [<span id="cdp-d-table-pagi-ilosc-wynikow" class="cdp-f-w-bold"></span>] duplicates
665
+ </div>
666
+ <div class="cdp-right">
667
+ <input type="text" class="cdp-d-searchbox-c" name="cdp-d-searchbox" placeholder="Search...">
668
+ </div>
669
+ <div class="cdp-right cdp-f-s-19" style="padding-right: 45px;">
670
+ <div class="cdp-cf" style="line-height: 41px;">
671
+ <div class="cdp-left">
672
+ Show
673
+ </div>
674
+ <select class="cdp-left cdp-select cdp-ow-border cdp-per-page-select-show cdp-width-166">
675
+ <option value="5">5</option>
676
+ <option value="10">10</option>
677
+ <option value="25" selected>25</option>
678
+ <option value="40">40</option>
679
+ <option value="50">50</option>
680
+ <option value="60">60</option>
681
+ <option value="75">75</option>
682
+ <option value="100">100</option>
683
+ </select>
684
+ <div class="cdp-left">
685
+ per page
686
+ </div>
687
+ </div>
688
+ </div>
689
+ </div>
690
+
691
+ <!-- DELETION TABLE -->
692
+ <div class="cdp-table-cont cdp-not-yet-search" style="display: none;">
693
+ <table id="cdp-d-table" class="cdp-delete-table">
694
+ <thead>
695
+ <tr class="cdp-f-s-19 cdp-f-w-medium">
696
+ <th><input type="checkbox" class="cdp-d-checkbox-all"/></th>
697
+ <th>Title</th>
698
+ <th>Slug/URL</th>
699
+ <th>Type</th>
700
+ <th>Date created</th>
701
+ <th># Words</th>
702
+ </tr>
703
+ </thead>
704
+ <thead>
705
+ <tr data-ignore="true"><td class="cdp-h-tbe" colspan="6"></td></tr>
706
+ </thead>
707
+ <tbody id="cdp-d-table-tbody"></tbody>
708
+ <tfoot>
709
+ <tr data-ignore="true"><td class="cdp-h-tbe" colspan="6"></td></tr>
710
+ </tfoot>
711
+ </table>
712
+ </div>
713
+
714
+ <!-- BELOW DELETION TABLE -->
715
+
716
+ <div class="cdp-d-pad-sp">
717
+ <div class="cdp-cf cdp-not-yet-search" style="display: none;">
718
+ <div class="cdp-d-sel-all-con cdp-left cdp-f-w-light cdp-f-s-17">
719
+ <u class="cdp-d-select-all cdp-f-w-light">Select all</u> (also from other pages)
720
+ </div>
721
+ <div class="cdp-center cdp-d-pagi-cent cdp-left">
722
+ <div id="cdp-d-table-pagi" class="cdp-pagination"></div>
723
+ </div>
724
+ </div>
725
+ <div class="cdp-center cdp-p-10-h cdp-not-yet-search" style="display: none;">
726
+ <div class="cdp-delete-info cdp-f-w-light cdp-f-s-19">
727
+ You selected <b class="cdp-t-d-ct cdp-f-w-light">0</b> pages/posts to be deleted
728
+ </div>
729
+ </div>
730
+ <div class="cdp-p-10-h cdp-not-yet-search" style="display: none;">
731
+ <div class="cdp-d-header-2 cdp-f-s-19 cdp-f-w-light">
732
+ Steps to deletion:
733
+ </div>
734
+ <div class="cdp-margin-left cdp-f-s-19">
735
+ <div class="cdp-p-10-h">
736
+ <div class="cdp-cf cdp-low-margin-bot" style="line-height: 28px;">
737
+ <div class="cdp-left cdp-blue-circle">1</div>
738
+ <div class="cdp-left">&nbsp;Make sure you created a backup with, e.g. with <a href="https://wordpress.org/plugins/wp-clone-by-wp-academy/" target="_blank">this plugin</a>.</div>
739
+ </div>
740
+ <div class="cdp-cf cdp-low-margin-bot" style="line-height: 28px;">
741
+ <div class="cdp-left cdp-blue-circle">2</div>
742
+ <div class="cdp-left">&nbsp;Select all the posts & pages which should be deleted (by ticking the checkboxes in the table above).</div>
743
+ </div>
744
+ <div class="cdp-cf cdp-low-margin-bot" style="line-height: 28px;">
745
+ <div class="cdp-left cdp-blue-circle">3</div>
746
+ <div class="cdp-left">&nbsp;Check if you need these features (optional):</div>
747
+ </div>
748
+ </div>
749
+ <div class="cdp-margin-left-25 cdp-p-20-h cdp-nbp" style="padding-top: 0px">
750
+ <table>
751
+ <tbody>
752
+ <tr>
753
+ <td class="cdp-vtop-pad">Automatic redirection</td>
754
+ <td>
755
+ <div class="cdp-relative">
756
+ <span class="cdp-tooltip-premium-dc" style="padding: 25px 0;">
757
+ <select class="cdp-p-redirections cdp-select cdp-ow-border cdp-dis-en-opt" disabled name="cdp-redirections">
758
+ <option value="0">Disabled</option>
759
+ <option value="1">Enabled</option>
760
+ </select>
761
+ </span>
762
+ <div class="cdp-premium-icon cdp-big-icon" style="margin-left: 17px;"></div>
763
+ </div>
764
+ <div class="cdp-d-tp-pad cdp-f-s-17 cdp-lh-24">Enable this if you want to redirect the urls from your deleted posts/pages to the main one you decided to keep.</div>
765
+ </td>
766
+ </tr>
767
+ <tr>
768
+ <td class="cdp-vtop-pad">Deletion throttling</td>
769
+ <td>
770
+ <div class="cdp-cf">
771
+ <select class="cdp-left cdp-d-throttling cdp-select cdp-ow-border cdp-dis-en-opt" name="cdp-throttling">
772
+ <option value="0">Disabled</option>
773
+ <option value="1">Enabled</option>
774
+ </select>
775
+ <div class="cdp-left cdp-inline cdp-cf cdp-d-throttling-count-p" style="display: none; line-height: 41px;">
776
+ <div class="cdp-left">
777
+ <span style="padding: 0px 15px;">Delete</span>
778
+ </div>
779
+ <div class="cdp-left">
780
+ <input type="number" class="cdp-d-throttling-count cdp-number-field-styled" name="cdp-throttling-count" min="1" max="10240" placeholder="50">
781
+ </div>
782
+ <div class="cdp-left">
783
+ <span style="padding: 0px 15px;">per minute</span>
784
+ </div>
785
+ </div>
786
+ </div>
787
+ <div class="cdp-d-tp-pad cdp-f-s-17 cdp-lh-24">
788
+ Enable this if you want to have your posts/pages getting deleted in batches (instead of all at once).<br />This reduces the risk of timeouts if you have a lot to delete.<br />
789
+ <span class="cdp-even-more-th-info" style="display: none">
790
+ If it’s necessary the process will dynamically slow down - depending on your server’s resource consumption. For example, if you’re using another plugin which is running a background process and it takes a lot of resources (+50%), our plugin will wait/slow down until the other process is complete.
791
+ </span>
792
+ </div>
793
+ </td>
794
+ </tr>
795
+ <tr>
796
+ <td class="cdp-vtop-pad" style="padding-top: 4px">Move post(s) to trash?</td>
797
+ <td>
798
+ <div class="">
799
+ <span class="cdp-tooltip-premium" style="padding: 25px 0">
800
+ <label class="cdp-relative" style="padding-right: 25px;"><input type="checkbox" class="cdp-p-just-trash-them" /> Yes, keep deleted posts in trash! <span class="cdp-premium-icon cdp-big-icon"></span></label>
801
+ </span>
802
+ <div class="cdp-d-tp-pad cdp-f-s-17 cdp-lh-24">Select this option to move deleted posts to trash (instead of deleting them permanently right away).</div>
803
+ </div>
804
+ </td>
805
+ </tr>
806
+ </tbody>
807
+ </table>
808
+ </div>
809
+ </div>
810
+ </div>
811
+ <div class="">
812
+ <div class="cdp-not-yet-search" style="display: none;">
813
+ <hr class="cdp-hr">
814
+ <div class="cdp-center cdp-padding-15-h cdp-f-s-19">
815
+ <label><input type="checkbox" class="cdp-d-just-check-it"> I completed <u>all</u> steps, it’s ok!</label>
816
+ </div>
817
+ <div class="cdp-center cdp-p-10-h">
818
+ <button type="button" class="cdp-button cdp-red-bg cdp-d-real-delete cdp-f-s-19" name="button">Delete selected pages/posts!</button>
819
+ </div>
820
+ <div class="cdp-center cdp-padding-15-h cdp-f-s-19">
821
+ You will be notified when the deletion process ends via <span class="cdp-green">Admin Bar Menu</span>.
822
+ </div>
823
+ </div>
824
+ <div class="cdp-padding cdp-f-s-17 cdp-center">
825
+ <a href="#" class="cdp-close-chapter">Close chapter</a>
826
+ </div>
827
+ </div>
828
+ </div>
829
+
830
+ </div>
831
+ </div>
832
+ </div>
833
+
834
+ </div>
835
+ </div>
836
+ </div>
837
+ <div class="cdp-supports cdp-hide">
838
+ <div class="cdp-cf">
839
+ <a href="#" target="_blank">
840
+ <div class="cdp-left cdp-third cdp-support-box cdp-animated cdp-support-animated cdp-ignore">
841
+ <div class="cdp-support-header">
842
+ <img class="cdp-support-img" src="https://via.placeholder.com/50" alt="">
843
+ <div class="cdp-support-title"><b>Issues? Ask us in the Support Forum!</b></div>
844
+ </div>
845
+ <div class="cdp-support-desc">Your first port of call. We’ll try to respond quickly!</div>
846
+ </div>
847
+ </a>
848
+ <a href="#" target="_blank">
849
+ <div class="cdp-left cdp-third cdp-support-box cdp-animated cdp-support-animated cdp-ignore">
850
+ <div class="cdp-support-header">
851
+ <img class="cdp-support-img" src="https://via.placeholder.com/50" alt="">
852
+ <div class="cdp-support-title"><b>Get the Premium Plugin</b></div>
853
+ </div>
854
+ <div class="cdp-support-desc">…which many fancy features and hands-on support.</div>
855
+ </div>
856
+ </a>
857
+ <div class="cdp-left cdp-third cdp-support-box cdp-show-projects cdp-pointer">
858
+ <div class="cdp-center cdp-f20"><b>Check out our other projects</b></div>
859
+ <div class="cdp-center">
860
+ <div class="cdp-inline cdp-fourth"><img class="cdp-support-img" src="https://via.placeholder.com/50" alt=""></div>
861
+ <div class="cdp-inline cdp-fourth"><img class="cdp-support-img" src="https://via.placeholder.com/50" alt=""></div>
862
+ <div class="cdp-inline cdp-fourth"><img class="cdp-support-img" src="https://via.placeholder.com/50" alt=""></div>
863
+ <div class="cdp-inline cdp-fourth"><img class="cdp-support-img" src="https://via.placeholder.com/50" alt=""></div>
864
+ </div>
865
+ </div>
866
+ </div>
867
+ <div class="cdp-cf">
868
+ <div class="cdp-left cdp-center cdp-third"><span class="cdp-tooltip-top" title="Your account on Wordpress.org (where you open a new support thread) is different to the one you login to your WordPress dashboard (where you are now). If you don’t have a WordPress.org account yet, please sign up at the top right on the Support Forum page, and then scroll down on that page. It only takes a minute :) Thank you!">Cannot log in there?</span></div>
869
+ <div class="cdp-left cdp-center cdp-third"></div>
870
+ <div class="cdp-left cdp-center cdp-third"></div>
871
+ </div>
872
+ </div>
873
+ <div class="cdp-projects" style="display: none;">
874
+ <h1 class="cdp-center">Our other projects...</h1>
875
+ <div class="cdp-cf">
876
+ <a href="#" target="_blank">
877
+ <div class="cdp-left cdp-fourth cdp-ignore cdp-animated cdp-project-box cdp-center">
878
+ <img src="https://via.placeholder.com/170" alt="">
879
+ <h3>Backup & Migration</h3>
880
+ <div>The best Backup plugin for WordPress!</div>
881
+ </div>
882
+ </a>
883
+
884
+ <a href="#" target="_blank">
885
+ <div class="cdp-left cdp-fourth cdp-ignore cdp-animated cdp-project-box cdp-center">
886
+ <img src="https://via.placeholder.com/170" alt="">
887
+ <h3>Ultimatelysocial</h3>
888
+ <div>The best Social Media plugin for WordPress!</div>
889
+ </div>
890
+ </a>
891
+ <a href="#" target="_blank">
892
+ <div class="cdp-left cdp-fourth cdp-ignore cdp-animated cdp-project-box cdp-center">
893
+ <img src="https://via.placeholder.com/170" alt="">
894
+ <h3>follow.it</h3>
895
+ <div>Get more traffic for your website & follow the news!</div>
896
+ </div>
897
+ </a>
898
+ <a href="#" target="_blank">
899
+ <div class="cdp-left cdp-fourth cdp-animated cdp-project-box cdp-center">
900
+ <img src="https://via.placeholder.com/170" alt="">
901
+ <h3>MyPopUps</h3>
902
+ <div>Create the best pop-ups for highest conversion!</div>
903
+ </div>
904
+ </a>
905
+ </div>
906
+ </div>
907
+ </div>
908
+ </div>
909
+
910
+ <?php
911
+ }
912
+ /** –– **/
913
+
914
+ ?>
menu/modal.php ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copy & Delete Posts – default menu.
4
+ *
5
+ * @package CDP
6
+ * @subpackage CopyModal
7
+ * @author CopyDeletePosts
8
+ * @since 1.0.0
9
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
10
+
11
+ // Exit if accessed directly.
12
+ if (!defined('ABSPATH')) exit;
13
+
14
+ /** –– **\
15
+ * There is constant modal html form using thickbox.
16
+ * @since 1.0.0
17
+ */
18
+ function cdp_modal($screen = '', $profiles = array()) {
19
+ if (!function_exists('is_plugin_active')) require_once(ABSPATH.'wp-admin/includes/plugin.php');
20
+
21
+ $isYoast = false; $isUSM = false;
22
+ if (is_plugin_active('wordpress-seo/wp-seo.php') || is_plugin_active('wordpress-seo-premium/wp-seo-premium.php')) $isYoast = true;
23
+ if (
24
+ is_plugin_active('Ultimate-Premium-Plugin/usm_premium_icons.php') ||
25
+ is_plugin_active('ultimate-social-media-icons/ultimate_social_media_icons.php') ||
26
+ is_plugin_active('ultimate-social-media-plus/ultimate-social-media-plus.php') ||
27
+ is_plugin_active('ultimate-social-media-plus/ultimate_social_media_plus.php')
28
+ ) $isUSM = true;
29
+
30
+ $isMulti = is_multisite() != true ? ' disabled="disabled"' : '';
31
+
32
+ // Ask for pro features
33
+ $areWePro = areWePro();
34
+ $globals = get_option('_cdp_globals');
35
+ ?>
36
+ <div id="cdp-copy-modal-global" class="cdp-modal cdp-copy-modal" style="display:none;">
37
+
38
+ <div class="cdp-modal-content" style="padding-bottom: 15px; max-height: 90vh;">
39
+
40
+ <div class="cdp-modal-times"></div>
41
+
42
+ <div class="cdp-cf cdp-cp-pad" style="margin-top: 50px; padding-top: 0; padding-bottom: 10px;">
43
+ <div class="cdp-left">
44
+ <h2 class="cdp-f-s-16 cdp-f-w-semi-bold" style="margin: 0; line-height: 40px;">Elements to copy:</h2>
45
+ </div>
46
+ <div class="cdp-right" style="width: calc(100% - 200px) !important; text-align: right !important;">
47
+ <div class="cdp-cf cdp-inline" style="line-height: 40px">
48
+ <div class="cdp-left cdp-f-s-16">Use as basis settings</div>
49
+ <?php $preSelProf = get_option('_cdp_preselections')[get_current_user_id()]; ?>
50
+ <select class="cdp-left cdp-modal-select cdp-ow-border cdp-input-dynamic cdp-modal-input-profiles-r cdp-select cdp-m-l-9-d" name="tooltip-which-profile-second">
51
+ <option value="custom"<?php echo (array_key_exists($preSelProf, $profiles) && !$profiles[$preSelProf])?' selected':''?> disabled>–– Select ––</option>
52
+ <option value="clear">Clean slate</option>
53
+ <optgroup label="–– Profiles ––"></optgroup>
54
+ <option value="custom_named" disabled>Custom</option>
55
+ <?php
56
+ if ($profiles != false && $areWePro) {
57
+ foreach ($profiles as $profile => $vals):
58
+ $isSel = ($preSelProf == $profile);
59
+ ?>
60
+ <option value="<?php echo htmlspecialchars($profile); ?>"<?php echo ($isSel)?' selected':''?>><?php echo ucfirst(htmlspecialchars($vals['names']['display'])); ?></option>
61
+ <?php endforeach; } else { ?>
62
+ <option value="default">Default</option>
63
+ <?php } ?>
64
+ </select>
65
+ </div>
66
+ </div>
67
+ </div>
68
+
69
+ <div class="cdp-cp-pad">
70
+ <div class="cdp-modal-checkboxes cdp-checkboxes">
71
+ <label>
72
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="title">
73
+ <span>Title</span>
74
+ </label>
75
+ <label>
76
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="date">
77
+ <span>Date</span>
78
+ </label>
79
+ <label>
80
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="status">
81
+ <span>Status</span>
82
+ </label>
83
+ <label>
84
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="slug">
85
+ <span>Slug</span>
86
+ </label>
87
+ </div>
88
+ <div class="cdp-modal-checkboxes cdp-checkboxes">
89
+ <label>
90
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="excerpt">
91
+ <span>Excerpt</span>
92
+ </label>
93
+ <label>
94
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="content">
95
+ <span>Content</span>
96
+ </label>
97
+ <label>
98
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="f_image">
99
+ <span>Feat. image</span>
100
+ </label>
101
+ <label>
102
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="template">
103
+ <span>Template</span>
104
+ </label>
105
+ </div>
106
+ <div class="cdp-modal-checkboxes cdp-checkboxes">
107
+ <label>
108
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="format">
109
+ <span>Format</span>
110
+ </label>
111
+ <label>
112
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="author">
113
+ <span>Author</span>
114
+ </label>
115
+ <label>
116
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="password">
117
+ <span>Password</span>
118
+ </label>
119
+ <label>
120
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="children">
121
+ <span>Children</span>
122
+ </label>
123
+ </div>
124
+ <div class="cdp-modal-checkboxes cdp-checkboxes">
125
+ <label>
126
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="comments">
127
+ <span>Comments</span>
128
+ </label>
129
+ <label>
130
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="menu_order">
131
+ <span>Menu order</span>
132
+ </label>
133
+ <label>
134
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="attachments">
135
+ <span>Attachments</span>
136
+ </label>
137
+ <label>
138
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="category">
139
+ <span>Categories</span>
140
+ </label>
141
+ </div>
142
+ <div class="cdp-modal-checkboxes cdp-checkboxes">
143
+ <label>
144
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="post_tag">
145
+ <span>Tags</span>
146
+ </label>
147
+ <label>
148
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="taxonomy">
149
+ <span>Taxonomies</span>
150
+ </label>
151
+ <label>
152
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="nav_menu">
153
+ <span>Navigation Menus</span>
154
+ </label>
155
+ <label>
156
+ <input class="cdp-modal-option-r cdp-input-dynamic" type="checkbox" name="link_category">
157
+ <span>Link categories</span>
158
+ </label>
159
+ </div>
160
+ <?php if ($isYoast || $isUSM): ?>
161
+ <div class="cdp-modal-checkboxes cdp-checkboxes cdp-modal-checkboxes-three">
162
+ <label class="cdp-relative"><span class="cdp-premium-icon" style="margin-left: 0"></span><b style="padding-left: 21px;" class="cdp-f-s-15 cdp-f-w-medium">Plugin options:</b></label>
163
+ <?php if ($isUSM): ?>
164
+ <label>
165
+ <span class="cdp-tooltip-premium" style="padding: 22px 0;">
166
+ <input class="cdp-input-dynamic" type="checkbox" name="usmplugin">
167
+ <span>USM Settings</span>
168
+ </span>
169
+ </label>
170
+ <?php endif; ?>
171
+ <?php if ($isYoast): ?>
172
+ <label class="cdp-yoast">
173
+ <span class="cdp-tooltip-premium" style="padding: 22px 0;">
174
+ <input class="cdp-input-dynamic" type="checkbox" name="yoast">
175
+ <span>Yoast SEO Settings</span>
176
+ </span>
177
+ </label>
178
+ <?php endif; ?>
179
+ </div>
180
+ <?php endif; ?>
181
+ </div>
182
+
183
+ <div class="cdp-modal-copy-times cdp-f-s-15">
184
+ <div class="cdp-modal-copy-times-content">
185
+ <?php if (function_exists('cdpp_change_post_type')) cdpp_change_post_type(); ?>
186
+ <div class="cdp-cf cdp-inline">
187
+ <div class="cdp-left" style="line-height: 40px;">Copy&nbsp;</div>
188
+ <div class="cdp-left" style="line-height: 40px;">
189
+ <input class="cdp-modal-input-times cdp-input-border" style="border-width: 1px !important;" placeholder="1" type="number" value="1">
190
+ </div>
191
+ <div class="cdp-left" style="line-height: 40px;">
192
+ &nbsp;time(s)
193
+ </div>
194
+ <div class="cdp-left" style="line-height: 40px;">&nbsp;to</div>
195
+ <div class="cdp-left">
196
+ <div class="cdp-inline cdp-tooltip-premium-spc-2 <?php echo (($isMulti != '')?' cdp-tooltip-premium-spc-3':' cdp-tooltip-premium-spc-4'); ?>">
197
+ <select class="cdp-input-dynamic cdp-modal-select cdp-modal-select-2 cdp-ow-border cdp-modal-input-site cdp-select cdp-m-l-9-d" name="tooltip-which-site-second" <?php echo $isMulti; ?>>
198
+ <option value="-1">this site</option>
199
+ <?php if ($areWePro && function_exists('cdpp_get_sites')) echo cdpp_get_sites(true); ?>
200
+ </select>
201
+ </div>
202
+ </div>
203
+ </div>
204
+ </div>
205
+ </div>
206
+
207
+ <div class="cdp-center">
208
+ <span class="cdp-error-span-tooltip">Making more than 50 copies will take some time. – depending on your server.</span>
209
+ </div>
210
+
211
+ <div class="cdp-center cdp-p-25-h">
212
+ <button class="cdp-button cdp-copy-modal-button cdp-f-s-15 cdp-f-w-regular" data-cdp-btn="copy-custom" style="height:44px; width:211px;padding:0 20px;line-height: 44px;">Copy it!</button>
213
+ <?php if (isset($globals) && array_key_exists('afterCopy', $globals) && $globals['afterCopy'] == '3'): ?>
214
+ <button class="cdp-button cdp-copy-modal-button cdp-p-right-h cdp-f-s-15 cdp-f-w-regular" data-cdp-btn="copy-custom-link" style="height:44px; width:292px;padding:0 20px;line-height: 44px;margin-left: 15px !important;">Copy and jump to editing</button>
215
+ <?php endif; ?>
216
+ </div>
217
+ </div>
218
+
219
+ </div>
220
+ <?php
221
+ }
222
+ /** –– **/
menu/notifications.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copy & Delete Posts – default menu.
4
+ *
5
+ * @package CDP
6
+ * @subpackage Notifications
7
+ * @author CopyDeletePosts
8
+ * @since 1.0.0
9
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
10
+
11
+ // Exit if accessed directly.
12
+ if (!defined('ABSPATH')) exit;
13
+
14
+ /** –– **\
15
+ * There is dynamic html for notifications.
16
+ * @since 1.0.0
17
+ */
18
+ function cdp_notifications_menu() {
19
+
20
+ $current = current_time('timestamp');
21
+ $cdp_cron = get_option('_cdp_crons', array());
22
+ $sorts = array('done' => array(), 'undone' => array());
23
+ $to_show = 0;
24
+
25
+ if (sizeof($cdp_cron) > 0) {
26
+ foreach ($cdp_cron as $cron => $val) {
27
+ $entry = array('t' => $cron, 's' => $val['shown'], 'f' => $val['f'], 'st' => $val['start']);
28
+
29
+ if ($val['done'] == false) array_push($sorts['undone'], $entry);
30
+ else if ($val['done'] == true) array_push($sorts['done'], $entry);
31
+
32
+ if ($val['shown'] == false) $to_show++;
33
+ }
34
+ }
35
+
36
+ $html = '<span class="cdp-admin-bar-icon-noti"></span>';
37
+ $html .= 'Copy & Delete [<span class="cdp-notis-counter">' . $to_show . '</span>]';
38
+ $html .= '<div class="ab-sub-wrapper cdp-ab-sub">
39
+ <ul class="ab-submenu cdp-dropdown-submenu">';
40
+
41
+ $html .= '<li class="cdp-undone-notis"' . ((sizeof($sorts['undone']) <= 0)?' style="display: none;"':'') . '>
42
+ <a class="ab-item cdp-dropdown-menu">
43
+ <div style="display: block;">
44
+ <div class="cdp-dropdown-left-header">In progress:</div>
45
+ </div>
46
+ </a>
47
+ </li>
48
+ <li class="cdp-dd-undone-list">';
49
+
50
+ foreach ($sorts['undone'] as $index => $val) {
51
+ $red = (($current - $val['st']) >= 86400) ? true : false;
52
+ $html .= '<a class="ab-item cdp-dropdown-menu cdp-dd-item cdp-dd-ud' . (($val['s'] == false)?' cdp-bnew-notis':'') . '" data-token="' . $val['t'] . '">
53
+ <div style="display: block; width: calc(100% - 3px);">
54
+ <div class="cdp-dropdown-left' . (($red)?' cdp-red':'') . '">' . (($val['f'] == 'delete')?'Deleting Posts':'Copying Posts') . '</div>
55
+ <div class="cdp-dropdown-right cdp-noti-kill-btn">Kill</div>
56
+ </div>
57
+ </a>';
58
+ }
59
+
60
+ $html .= '</li>
61
+ <hr class="cdp-dropdown-hr cdp-undone-hr"'. ((sizeof($sorts['undone']) <= 0)?' style="display: none;"':'') .'>';
62
+
63
+
64
+ $html .= '<li class="cdp-done-notis"' . ((sizeof($sorts['done']) <= 0)?' style="display: none;"':'') . '>
65
+ <a class="ab-item cdp-dropdown-menu">
66
+ <div style="display: block;">
67
+ <div class="cdp-dropdown-left-header">Done:</div>
68
+ </div>
69
+ </a>
70
+ </li>
71
+ <li class="cdp-dd-done-list">';
72
+
73
+ foreach ($sorts['done'] as $index => $val) {
74
+ $html .= '<a class="ab-item cdp-dropdown-menu cdp-dd-item cdp-dd-d' . (($val['s'] == false)?' cdp-bnew-notis':'') . '" data-token="' . $val['t'] . '">
75
+ <div style="display: block; width: calc(100% - 3px);">
76
+ <div class="cdp-dropdown-left">' . (($val['f'] == 'delete')?'Deleted Posts':'Copied Posts') . '</div>
77
+ <div class="cdp-dropdown-right cdp-noti-hide-btn">Hide</div>
78
+ </div>
79
+ </a>';
80
+ }
81
+
82
+ $html .= '</li>
83
+ <hr class="cdp-dropdown-hr cdp-done-hr"'. ((sizeof($sorts['done']) <= 0)?' style="display: none;"':'') .'>';
84
+
85
+ $html .= '<li><a class="ab-item cdp-dropdown-clear-all-notis" href="#">Clear notifiactions</a></li>
86
+ </ul>
87
+ </div>';
88
+
89
+ return array('html' => $html, 'in_list' => (sizeof($sorts['done']) + sizeof($sorts['undone'])));
90
+
91
+ }
92
+ /** –– **/
menu/tooltips.php ADDED
@@ -0,0 +1,286 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copy & Delete Posts – default menu.
4
+ *
5
+ * @package CDP
6
+ * @subpackage TooltipsPrepare
7
+ * @author CopyDeletePosts
8
+ * @since 1.0.0
9
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
10
+
11
+ // Exit if accessed directly.
12
+ if (!defined('ABSPATH')) exit;
13
+
14
+ /** –– **\
15
+ * There is constant tooltip content for dynamic load.
16
+ * @since 1.0.0
17
+ */
18
+ function cdp_tooltip_content($profiles = array()) {
19
+
20
+ $isYoast = false; $isUSM = false;
21
+ if (is_plugin_active('wordpress-seo/wp-seo.php') || is_plugin_active('wordpress-seo-premium/wp-seo-premium.php')) $isYoast = true;
22
+ if (
23
+ is_plugin_active('Ultimate-Premium-Plugin/usm_premium_icons.php') ||
24
+ is_plugin_active('ultimate-social-media-icons/ultimate_social_media_icons.php') ||
25
+ is_plugin_active('ultimate-social-media-plus/ultimate-social-media-plus.php') ||
26
+ is_plugin_active('ultimate-social-media-plus/ultimate_social_media_plus.php')
27
+ ) $isUSM = true;
28
+
29
+ $globals = get_option('_cdp_globals');
30
+
31
+ $isMulti = is_multisite() != true ? ' disabled="disabled"' : '';
32
+
33
+ // Ask for pro features
34
+ $areWePro = areWePro();
35
+
36
+ ?>
37
+ <div class="cdp-tooltip-content">
38
+
39
+ <div class="cdp-tooltip-before-options cdp-checkboxes">
40
+ <div class="cdp-tooltip-before">
41
+
42
+ <div class="cdp-button cdp-tooltip-btn-copy cdp-low-round cdp-copy-now-btn-tooltip cdp-center" data-cdp-btn="copy-quick">Copy now!</div>
43
+
44
+ <div class="cdp-modal-copy-times-tooltip">
45
+ <div class="cdp-modal-copy-times-content-tooltip">
46
+
47
+ <div class="cdp-cf" style="line-height: 32px; margin-top: 13px; margin-bottom: 12px;">
48
+
49
+ <div class="cdp-left">
50
+ <input class="cdp-input-border cdp-input-dynamic cdp-number-field-styled cdp-modal-input-times-tooltip" style="width: 44px !important; padding: 0 1px;" value="1" placeholder="1" min="1" max="10000" type="number" name="tooltip-times-first">
51
+ </div>
52
+
53
+ <div class="cdp-left">&nbsp;time(s)</div>
54
+
55
+ <div class="cdp-left">&nbsp;to&nbsp;</div>
56
+ <div class="cdp-left" style="max-height: 32px;">
57
+ <div class="cdp-inline cdp-tooltip-premium-spc-2 <?php echo (($isMulti != '')?' cdp-tooltip-premium-spc-3':' cdp-tooltip-premium-spc-4'); ?>">
58
+ <select<?php echo $isMulti; ?> class="cdp-input-dynamic cdp-tooltip-top cdp-premiu cdp-tooltip-select cdp-select cdp-sel-separat cdp-m-l-9-d" style="max-width: 98px !important" name="tooltip-which-site-first">
59
+ <option value="-1">this site</option>
60
+ <?php if ($areWePro && function_exists('cdpp_get_sites')) echo cdpp_get_sites(true); ?>
61
+ </select>
62
+ </div>
63
+ </div>
64
+
65
+ </div>
66
+
67
+ <div class="cdp-cf" style="line-height: 32px; margin-top: 3px; margin-bottom: 5px;">
68
+ <div class="cdp-left">Settings:&nbsp;&nbsp;</div>
69
+
70
+ <div class="cdp-left" style="line-height: 10px;">
71
+ <select class="cdp-input-dynamic cdp-select cdp-tooltip-select cdp-sel-separat cdp-m-l-9-d cdp-sizes-profile-tooltip" name="tooltip-which-profile-first">
72
+ <?php $preSelProf = get_option('_cdp_preselections')[get_current_user_id()]; ?>
73
+ <option value="custom"<?php echo (array_key_exists($preSelProf, $profiles) && !$profiles[$preSelProf])?' selected':''?> disabled>–– Select ––</option>
74
+ <?php
75
+ if ($profiles != false && $areWePro) {
76
+ foreach ($profiles as $profile => $vals):
77
+ $isSel = ($preSelProf == $profile);
78
+ ?>
79
+ <option value="<?php echo htmlspecialchars($profile); ?>"<?php echo ($isSel)?' selected':''?>><?php echo ucfirst(htmlspecialchars($vals['names']['display'])); ?></option>
80
+ <?php endforeach; } else { ?>
81
+ <option value="default">Default</option>
82
+ <?php } ?>
83
+ </select>
84
+ </div>
85
+
86
+ <div class="cdp-left cdp-relative">
87
+ <span class="cdp-info-icon cdp-tooltip-info-intt" style="top: calc(50% + 8px); margin-left: 9px;"></span>
88
+ </div>
89
+ </div>
90
+
91
+ </div>
92
+ </div>
93
+
94
+ <div class="cdp-center cdp-f-s-12 cdp-padding-5-h">
95
+ Or <span class="cdp-green cdp-pointer cdp-clickable cdp-tooltip-before-button">define it for this case</span>
96
+ </div>
97
+ <div class="cdp-center cdp-below-tooltip-before">
98
+ <!-- Define the possible settings <span class="cdp-green">on the plugin page</span>.<br /> -->
99
+ <span class="cdp-error-span-tooltip">Making more than 50 copies will take some time. – depending on your server.</span>
100
+ </div>
101
+ </div>
102
+ </div>
103
+
104
+ <div class="cdp-tooltip-full-options cdp-checkboxes" style="display: none; min-height: 360px; min-width: 602px; padding: 10px;">
105
+ <div class="cdp-cf">
106
+ <div class="cdp-left">
107
+ <h2 class="cdp-f-s-16 cdp-f-w-semi-bold" style="margin: 0; line-height: 40px;">Elements to copy:</h2>
108
+ </div>
109
+ <div class="cdp-right" style="width: calc(100% - 200px); text-align: right;">
110
+ <div class="cdp-cf cdp-inline" style="line-height: 40px">
111
+ <div class="cdp-left cdp-f-s-16">Use as basis settings</div>
112
+ <?php $preSelProf = get_option('_cdp_preselections')[get_current_user_id()]; ?>
113
+ <select class="cdp-left cdp-modal-select cdp-ow-border cdp-input-dynamic cdp-modal-input-profiles-r cdp-select cdp-m-l-9-d" name="tooltip-which-profile-second">
114
+ <option value="custom" selected disabled>–– Select ––</option>
115
+ <option value="clear">Clean slate</option>
116
+ <optgroup label="–– Profiles ––"></optgroup>
117
+ <option value="custom_named" disabled>Custom</option>
118
+ <?php
119
+ if ($profiles != false && $areWePro) {
120
+ foreach ($profiles as $profile => $vals):
121
+ $isSel = ($preSelProf == $profile);
122
+ ?>
123
+ <option value="<?php echo htmlspecialchars($profile); ?>"<?php echo ($isSel)?' selected':''?>><?php echo ucfirst(htmlspecialchars($vals['names']['display'])); ?></option>
124
+ <?php endforeach; } else { ?>
125
+ <option value="default">Default</option>
126
+ <?php } ?>
127
+ </select>
128
+ </div>
129
+ </div>
130
+ </div>
131
+
132
+ <div class="cdp-modal-checkboxes">
133
+ <label>
134
+ <input class="cdp-input-dynamic" type="checkbox" name="title">
135
+ <span>Title</span>
136
+ </label>
137
+ <label>
138
+ <input class="cdp-input-dynamic" type="checkbox" name="date">
139
+ <span>Date</span>
140
+ </label>
141
+ <label>
142
+ <input class="cdp-input-dynamic" type="checkbox" name="status">
143
+ <span>Status</span>
144
+ </label>
145
+ <label>
146
+ <input class="cdp-input-dynamic" type="checkbox" name="slug">
147
+ <span>Slug</span>
148
+ </label>
149
+ </div>
150
+ <div class="cdp-modal-checkboxes">
151
+ <label>
152
+ <input class="cdp-input-dynamic" type="checkbox" name="excerpt">
153
+ <span>Excerpt</span>
154
+ </label>
155
+ <label>
156
+ <input class="cdp-input-dynamic" type="checkbox" name="content">
157
+ <span>Content</span>
158
+ </label>
159
+ <label>
160
+ <input class="cdp-input-dynamic" type="checkbox" name="f_image">
161
+ <span>Feat. image</span>
162
+ </label>
163
+ <label>
164
+ <input class="cdp-input-dynamic" type="checkbox" name="template">
165
+ <span>Template</span>
166
+ </label>
167
+ </div>
168
+ <div class="cdp-modal-checkboxes">
169
+ <label>
170
+ <input class="cdp-input-dynamic" type="checkbox" name="format">
171
+ <span>Format</span>
172
+ </label>
173
+ <label>
174
+ <input class="cdp-input-dynamic" type="checkbox" name="author">
175
+ <span>Author</span>
176
+ </label>
177
+ <label>
178
+ <input class="cdp-input-dynamic" type="checkbox" name="password">
179
+ <span>Password</span>
180
+ </label>
181
+ <label>
182
+ <input class="cdp-input-dynamic" type="checkbox" name="children">
183
+ <span>Children</span>
184
+ </label>
185
+ </div>
186
+ <div class="cdp-modal-checkboxes">
187
+ <label>
188
+ <input class="cdp-input-dynamic" type="checkbox" name="comments">
189
+ <span>Comments</span>
190
+ </label>
191
+ <label>
192
+ <input class="cdp-input-dynamic" type="checkbox" name="menu_order">
193
+ <span>Menu order</span>
194
+ </label>
195
+ <label>
196
+ <input class="cdp-input-dynamic" type="checkbox" name="attachments">
197
+ <span>Attachments</span>
198
+ </label>
199
+ <label>
200
+ <input class="cdp-input-dynamic" type="checkbox" name="category">
201
+ <span>Categories</span>
202
+ </label>
203
+ </div>
204
+ <div class="cdp-modal-checkboxes">
205
+ <label>
206
+ <input class="cdp-input-dynamic" type="checkbox" name="post_tag">
207
+ <span>Tags</span>
208
+ </label>
209
+ <label>
210
+ <input class="cdp-input-dynamic" type="checkbox" name="taxonomy">
211
+ <span>Taxonomies</span>
212
+ </label>
213
+ <label>
214
+ <input class="cdp-input-dynamic" type="checkbox" name="nav_menu">
215
+ <span>Nav Menus</span>
216
+ </label>
217
+ <label>
218
+ <input class="cdp-input-dynamic" type="checkbox" name="link_category">
219
+ <span>Link cats</span>
220
+ </label>
221
+ </div>
222
+ <?php if ($isYoast || $isUSM): ?>
223
+ <div class="cdp-modal-checkboxes cdp-modal-checkboxes-three">
224
+ <label class="cdp-relative"><span class="cdp-premium-icon" style="margin-left: 0"></span><b style="padding-left: 21px;" class="cdp-f-s-15 cdp-f-w-medium">Plugin options:</b></label>
225
+ <?php if ($isUSM): ?>
226
+ <label>
227
+ <div class="cdp-inline cdp-tooltip-premium-spc">
228
+ <input class="cdp-input-dynamic" type="checkbox" name="usmplugin">
229
+ <span>USM Settings</span>
230
+ </div>
231
+ </label>
232
+ <?php endif; ?>
233
+ <?php if ($isYoast): ?>
234
+ <label class="cdp-yoast">
235
+ <div class="cdp-inline cdp-tooltip-premium-spc">
236
+ <input class="cdp-input-dynamic" type="checkbox" name="yoast">
237
+ <span>Yoast SEO Settings</span>
238
+ </div>
239
+ </label>
240
+ <?php endif; ?>
241
+ </div>
242
+ <?php endif; ?>
243
+
244
+ <div class="cdp-relative">
245
+ <div class="cdp-modal-copy-times cdp-tooltip-c-t cdp-f-s-15">
246
+ <div class="cdp-modal-copy-times-content">
247
+ <?php if (function_exists('cdpp_change_post_type')) cdpp_change_post_type(); ?>
248
+ <div class="cdp-cf cdp-inline">
249
+ <div class="cdp-left" style="line-height: 40px;">Copy&nbsp;</div>
250
+ <div class="cdp-left" style="line-height: 40px;">
251
+ <input class="cdp-modal-input-times cdp-input-border" name="tooltip-which-times-second" style="border-width: 1px !important;" placeholder="1" type="number" value="1">
252
+ </div>
253
+ <div class="cdp-left" style="line-height: 40px;">
254
+ &nbsp;time(s)
255
+ </div>
256
+ <div class="cdp-left" style="line-height: 40px;">&nbsp;to</div>
257
+ <div class="cdp-left">
258
+ <div class="cdp-tooltip-premium-spc-2 cdp-inline<?php echo (($isMulti != '')?' cdp-tooltip-premium-spc-3':' cdp-tooltip-premium-spc-4'); ?>">
259
+ <select<?php echo $isMulti; ?> class="cdp-input-dynamic cdp-modal-select cdp-modal-select-2 cdp-ow-border cdp-modal-input-site cdp-select cdp-m-l-9-d" name="tooltip-which-site-second">
260
+ <option value="-1">this site</option>
261
+ <?php if ($areWePro && function_exists('cdpp_get_sites')) echo cdpp_get_sites(true); ?>
262
+ </select>
263
+ </div>
264
+ </div>
265
+ </div>
266
+ </div>
267
+ </div>
268
+ </div>
269
+
270
+ <div class="cdp-center">
271
+ <span class="cdp-error-span-tooltip">Making more than 50 copies will take some time. – depending on your server.</span>
272
+ </div>
273
+
274
+ <div class="cdp-center cdp-padding" style="min-width: 420px; padding-bottom: 10px;">
275
+ <button class="cdp-button cdp-tooltip-btn-copy cdp-f-s-15 cdp-f-s-regular" data-cdp-btn="copy-custom" style="height:44px; width:211px;padding:0 20px;line-height: 44px;border-radius: 3px;">Copy it!</button>
276
+ <?php if (isset($globals) && array_key_exists('afterCopy', $globals) && $globals['afterCopy'] == '3'): ?>
277
+ <button class="cdp-button cdp-tooltip-btn-copy cdp-f-s-15 cdp-f-s-regular" data-cdp-btn="copy-custom-link" style="height:44px; width:292px;padding:0 20px;line-height: 44px;border-radius: 3px;margin-left: 15px !important;">Copy and jump to editing</button>
278
+ <?php endif; ?>
279
+ </div>
280
+
281
+ </div>
282
+
283
+ </div>
284
+ <?php
285
+ }
286
+ /** –– **/
menu/variables.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copy & Delete Posts – default menu.
4
+ *
5
+ * @package CDP
6
+ * @subpackage SendingVariables
7
+ * @author CopyDeletePosts
8
+ * @since 1.0.0
9
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
10
+
11
+ // Exit if accessed directly.
12
+ if (!defined('ABSPATH')) exit;
13
+
14
+ /** –– **\
15
+ * There are constant (but dynamic per blog) variables.
16
+ * @since 1.0.0
17
+ */
18
+ function cdp_vars($cdp_plug_url = 'x', $post_id = false, $parent = false) {
19
+ ?>
20
+ <script>
21
+ if (typeof ajaxurl === 'undefined') ajaxurl = '<?php echo esc_url(admin_url('admin-ajax.php')); ?>';
22
+ </script>
23
+ <div class="cdp-copy-alert-success" style="top: -28px; opacity: 0; display: none;">
24
+ <img src="<?php echo $cdp_plug_url ?>/assets/imgs/copy.png" alt="Successfull copy image">
25
+ </div>
26
+ <div class="cdp-copy-loader-overlay" style="opacity: 0">
27
+ <div class="cdp-text-overlay">
28
+ <h1 style="color: white; font-size: 25px;">Please wait, copying in progress...</h1>
29
+ <p>
30
+ If you’re making a lot of copies it can take a while
31
+ <br>(up to 5 minutes if you’re on a slow server).
32
+ </p>
33
+ <span>Average time is 8 copies per second.</span>
34
+ </div>
35
+ <div class="cdp-spinner"></div>
36
+ </div>
37
+ <input type="text" hidden id="cdp-purl" style="display: none; visibility: hidden;" value="<?php echo $cdp_plug_url ?>">
38
+
39
+ <?php if ($post_id != false): ?>
40
+ <input type="text" hidden id="cdp-current-post-id" style="display: none; visibility: hidden;" value="<?php echo $post_id ?>">
41
+ <?php endif;?>
42
+
43
+ <?php if ($parent != false): ?>
44
+ <input type="text" hidden id="cdp-original-post" style="display: none; visibility: hidden;" data-cdp-parent="<?php echo $parent['title'] ?>" data-cdp-parent-url="<?php echo $parent['link'] ?>">
45
+ <?php endif;?>
46
+
47
+ <?php
48
+ }
49
+ /** –– **/
post/handler.php ADDED
@@ -0,0 +1,1000 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copy & Delete Posts – Post requests handler file.
4
+ *
5
+ * @package CDP
6
+ * @subpackage PostHandler
7
+ * @author CopyDeletePosts
8
+ * @since 1.0.0
9
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
10
+
11
+ /** –– **\
12
+ * Main handler + It will also sanitize and verify that request a little bit.
13
+ * @since 1.0.0
14
+ */
15
+ add_action('wp_ajax_cdp_action_handling', function () {
16
+
17
+ if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') {
18
+ if (isset($_POST['token']) && $_POST['token'] == 'cdp' && isset($_POST['f']) && is_admin()) {
19
+
20
+ // Get WP-Plugin path
21
+ $premium_plugin = 'copy-delete-posts-premium/copy-delete-posts-premium.php';
22
+ $premium_dir = WP_PLUGIN_DIR . '/' . 'copy-delete-posts-premium';
23
+ $pplugin_path = $premium_dir . '/handler/premium.php';
24
+
25
+ // Load premium content if the plugin is here
26
+ if (is_dir($premium_dir) && is_plugin_active($premium_plugin))
27
+ require_once($pplugin_path);
28
+
29
+ // Is premium function
30
+ $areWePro = is_plugin_active($premium_plugin);
31
+
32
+ // Get user roles and check if the role is permmited to use plugin
33
+ $access = false;
34
+ $current_user = wp_get_current_user();
35
+ $access_roles = get_option('_cdp_globals');
36
+ if (!isset($access_roles['roles'])) $access_roles = array();
37
+ foreach ($current_user->roles as $role => $name)
38
+ if ($name == 'administrator' || (isset($access_roles['roles'][$name]) && $access_roles['roles'][$name] == 'true')) {
39
+ $access = true;
40
+ break;
41
+ }
42
+
43
+ // Check user permission
44
+ if ($access === true) {
45
+
46
+ // Pointers
47
+ if ($_POST['f'] == 'no_intro') cdp_add_new_no_intro();
48
+ else if ($_POST['f'] == 'intro_again') cdp_add_new_intro();
49
+ else if ($_POST['f'] == 'save_options') cdp_save_plugin_options();
50
+ else if ($_POST['f'] == 'copy_post') cdp_insert_new_post($areWePro);
51
+ else if ($_POST['f'] == 'get_settings') cdp_get_profile();
52
+ else if ($_POST['f'] == 'get_all_settings') cdp_get_all_profiles();
53
+ else if ($_POST['f'] == 'save_profiles' && $areWePro) cdp_save_profile_set();
54
+ else if ($_POST['f'] == 'get_all_posts') cdp_get_all_posts();
55
+ else if ($_POST['f'] == 'delete_them') cdp_delete_posts();
56
+ else if ($_POST['f'] == 'get_formatted_time' && $areWePro) cdp_formatted_time();
57
+ else if ($_POST['f'] == 'set_default_profile') cdp_set_default_profile();
58
+ else if ($_POST['f'] == 'get_default_profile') cdp_get_default_profile();
59
+ else if ($_POST['f'] == 'clear_crons') cdp_clear_all_crons();
60
+ else if ($_POST['f'] == 'i_saw_this_noti') cdp_set_noti_as_seen();
61
+ else if ($_POST['f'] == 'try_to_hide_the_tasks') cdp_just_hide_task();
62
+ else if ($_POST['f'] == 'try_to_kill_the_tasks') cdp_just_kill_task();
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';
69
+
70
+ } else echo 'no_access';
71
+ } else echo 'no_access';
72
+
73
+ wp_die();
74
+ });
75
+ /** –– **/
76
+
77
+ /** –– **\
78
+ * This function will be fired when user don't want to see intro – never again.
79
+ * @since 1.0.0
80
+ */
81
+ function cdp_add_new_no_intro() {
82
+
83
+ // Get user id and array from db
84
+ $user_id = get_current_user_id();
85
+ $already = get_option('_cdp_no_intro');
86
+
87
+ // Check if it's first time that user checked this option.
88
+ if (!$already)
89
+ $already = array($user_id);
90
+
91
+ // If it already exists just add another user.
92
+ else if (!in_array($user_id, $already))
93
+ array_push($already, $user_id);
94
+
95
+ // If the user already exists exit.
96
+ else exit;
97
+
98
+ // Add option to datbase if not exit.
99
+ $opt = update_option('_cdp_no_intro', $already);
100
+
101
+ }
102
+ /** –– **/
103
+
104
+ /** –– **\
105
+ * This function will be fired when user want to see intro – again.
106
+ * @since 1.0.0
107
+ */
108
+ function cdp_add_new_intro() {
109
+
110
+ // Get user id and array from db
111
+ $user_id = get_current_user_id();
112
+ $already = get_option('_cdp_no_intro');
113
+
114
+ // Check if it's first time that user checked this option.
115
+ if ($already && in_array($user_id, $already))
116
+ unset($already[array_search($user_id, $already, true)]);
117
+
118
+ // If the user no exists exit.
119
+ else exit;
120
+
121
+ // Add option to database if not exit.
122
+ $opt = update_option('_cdp_no_intro', $already);
123
+
124
+ }
125
+ /** –– **/
126
+
127
+ /** –– **\
128
+ * This function will be fired when user want to save plugin options – again.
129
+ * @since 1.0.0
130
+ */
131
+ function cdp_save_plugin_options() {
132
+
133
+ // Get the info about our professionalness
134
+ global $areWePro;
135
+
136
+ // Get new options and current profile.
137
+ $options = ((isset($_POST['options']))?cdp_sanitize_array($_POST['options']):false);
138
+ $entire = ((isset($_POST['entire']))?cdp_sanitize_array($_POST['entire']):false);
139
+ $profile = ((isset($_POST['profile']))?sanitize_text_field($_POST['profile']):false);
140
+
141
+ // Get current options and profiles.
142
+ $a_or = get_option('_cdp_profiles');
143
+ $already = get_option('_cdp_profiles');
144
+ $g_or = get_option('_cdp_globals');
145
+ $globals = get_option('_cdp_globals');
146
+
147
+ // Check if it's first time – create array.
148
+ if (!is_array($already)) $already = array();
149
+ if (!is_array($globals)) $globals = array();
150
+
151
+ // Add display name for this profile
152
+ $profile = preg_replace('/\s+/', '_', trim(strtolower($profile)));
153
+
154
+ // Write new settings for this profile.
155
+ $already[$profile] = $options;
156
+ $already[$profile]['usmplugin'] = 'false';
157
+ $already[$profile]['yoast'] = 'false';
158
+ if ($areWePro) $already[$profile] = cdpp_filter_premium_opts($already, $options, $profile);
159
+
160
+ if (!isset($already[$profile]['names']['display']) || (strlen(trim($already[$profile]['names']['display'])) <= 0))
161
+ $already[$profile]['names']['display'] = $profile;
162
+ $globals = $entire;
163
+
164
+ // Check if there is default profile
165
+ if (!array_key_exists('default', $already) || !array_key_exists('title', $already['default'])) {
166
+ $already['default'] = array();
167
+
168
+ if (function_exists('cdp_default_options')) $already['default'] = cdp_default_options();
169
+ if (function_exists('cdp_default_global_options')) $globals['others'] = cdp_default_global_options();
170
+ }
171
+
172
+ // Add new options to database.
173
+ $s1 = update_option('_cdp_globals', $globals);
174
+ $s2 = update_option('_cdp_profiles', $already);
175
+
176
+ // Check if success while uploading
177
+ if (($s1 || $s2) || ($globals == $g_or) || ($already == $a_or)) echo 'success';
178
+ else echo 'error';
179
+
180
+ }
181
+ /** –– **/
182
+
183
+ /** –– **\
184
+ * This function will be fired when user want to save plugin options – again.
185
+ * @since 1.0.0
186
+ */
187
+ function cdp_insert_new_post($areWePro = false) {
188
+
189
+ // Create output array which will be returned to requester
190
+ $output = array('status' => 'success');
191
+
192
+ // Get ID(s) of post(s)
193
+ $ids = ((isset($_POST['id']))?cdp_sanitize_array($_POST['id']):false);
194
+
195
+ // Get all important pieces of information from requester
196
+ $data = ((isset($_POST['data']))?cdp_sanitize_array($_POST['data']):false);
197
+ $site = isset($_POST['data']['site']) ? sanitize_text_field($_POST['data']['site']) : false;
198
+ $times = isset($_POST['data']['times']) ? sanitize_text_field($_POST['data']['times']) : 1;
199
+ $swap = isset($_POST['data']['swap']) ? sanitize_text_field($_POST['data']['swap']) : false;
200
+ $profile = isset($_POST['data']['profile']) ? sanitize_text_field($_POST['data']['profile']) : 'default';
201
+ $origin = isset($_POST['origin']) ? sanitize_text_field($_POST['origin']) : false;
202
+ $custom = isset($_POST['data']['custom']) ? sanitize_text_field($_POST['data']['custom']) : false;
203
+
204
+ // Load default options for selected profile
205
+ $defaults = get_option('_cdp_profiles')[$profile];
206
+
207
+ // Settings for this copy
208
+ $settings = (($data['type'] != 'copy-quick' && $custom != false)?$custom:$defaults);
209
+ if (!isset($settings['names'])) $settings['names'] = $defaults['names'];
210
+
211
+ // Convert string to boolean – only for much less code later
212
+ foreach ($settings as $setting => $val)
213
+ if ($setting != 'names')
214
+ $settings[$setting] = (($val == 'true')?true:false);
215
+
216
+ /**
217
+ * This local function filters post data by user settings
218
+ * @param $post (array of wordpress post/page data)
219
+ * @param $settings (array of preselected settings of profile or by user)
220
+ * @return array with insert ready values for wordpress post || false on wrong $post
221
+ */
222
+ function cdp_filter_post($post, $swap, $opt, $settings, $taxonomies = false, $areWePro) {
223
+
224
+ // If $post has wrong format return false
225
+ if (!(is_array($post) || is_object($post))) return false;
226
+
227
+ // Array for formatted and prepared taxonomy
228
+ $ft = array();
229
+ $buin = array('link_category', 'nav_menu', 'post_tag', 'category', 'post_format');
230
+
231
+ // Loop thorugh all taxonomies from post
232
+ foreach ($taxonomies as $taxonomy) {
233
+
234
+ // Set the name to shorted variable
235
+ $tn = $taxonomy->taxonomy;
236
+
237
+ // Check if it's private taxonomy and if it's set in options
238
+ if ($tn == 'link_category' && !$settings['link_category']) continue;
239
+ if ($tn == 'nav_menu' && !$settings['nav_menu']) continue;
240
+ if ($tn == 'post_tag' && !$settings['post_tag']) continue;
241
+ if ($tn == 'category' && !$settings['category']) continue;
242
+ if ($tn == 'post_format' && !$settings['format']) continue;
243
+
244
+ // Don't copy custom taxonomy if it's not checked
245
+ if (!in_array($tn, $buin) && !$settings['taxonomy']) continue;
246
+
247
+ // Push next term of existing taxonomy
248
+ if (isset($ft[$tn])) array_push($ft[$tn], $taxonomy->term_id);
249
+
250
+ // Create new taxonomy and push new term
251
+ else {
252
+ $ft[$tn] = array();
253
+ array_push($ft[$tn], $taxonomy->term_id);
254
+ }
255
+
256
+ }
257
+
258
+ // Create array with required values and contant values
259
+ $new = array(
260
+ 'post_title' => ($settings['title'] ? cdp_create_title($post['post_title'], $settings['names'], $post['ID'], $areWePro) : 'Untitled Copy'),
261
+ 'post_date' => ($settings['date'] ? $post['post_date'] : current_time('mysql')),
262
+ 'post_status' => ($settings['status'] ? $post['post_status'] : 'draft'),
263
+ 'post_author' => ($settings['author'] ? $post['post_author'] : wp_get_current_user()->ID),
264
+ 'post_content' => ($settings['content']) ? $post['post_content'] : ' ',
265
+ 'comment_status' => $post['comment_status'], // that's additional element which cannot be edited by user
266
+ 'post_parent' => $post['post_parent'] // that's additional element which cannot be edited by user
267
+ );
268
+
269
+ // Converter
270
+ if ((($opt == '2' && $swap == 'true') || $swap == 'true') && $areWePro && function_exists('cdpp_post_converter'))
271
+ $new['post_type'] = cdpp_post_converter($post['post_type']);
272
+ else $new['post_type'] = $post['post_type'];
273
+
274
+ // Add optional values of post – depending on settings
275
+ if ($settings['slug']) $new['post_name'] = $post['post_name'];
276
+ if ($settings['excerpt']) $new['post_excerpt'] = $post['post_excerpt'];
277
+ if ($settings['template']) $new['page_template'] = $post['page_template'];
278
+ if ($settings['password']) $new['post_password'] = $post['post_password'];
279
+ if ($settings['menu_order']) $new['menu_order'] = $post['menu_order'];
280
+ if ($settings['category']) $new['post_category'] = $post['post_category'];
281
+ if ($settings['post_tag']) $new['tags_input'] = $post['tags_input'];
282
+ if ($taxonomies != false) $new['tax_input'] = $ft;
283
+
284
+ // Return filtered data of current post
285
+ return $new;
286
+
287
+ }
288
+
289
+ /**
290
+ * This local function filters post data by user settings
291
+ * @param $metas (array of wordpress post/page meta data)
292
+ * @param $settings (array of preselected settings of profile or by user)
293
+ * @return array with metadata values for post || false on wrong $metas
294
+ */
295
+ function cdp_filter_meta($metas, $settings, $id, $areWePro, $site) {
296
+
297
+ // If $metas has wrong format return false
298
+ if (!(is_array($metas) || is_object($metas))) return false;
299
+
300
+ // Create empty array for filtered meta data
301
+ $prepared = array(
302
+ // Add or replace ours copy tracker
303
+ array('_cdp_origin' => $id),
304
+ array('_cdp_origin_site' => $site),
305
+ array('_cdp_counter' => '0')
306
+ );
307
+
308
+ // Iterate through every meta index
309
+ foreach ($metas as $meta => $vals) {
310
+
311
+ // Conditions
312
+ $a = ($areWePro && function_exists('cdpp_check_yoast'))?cdpp_check_yoast($settings, $meta):false;
313
+ $b = ($areWePro && function_exists('cdpp_check_usm'))?cdpp_check_usm($settings, $meta):false;
314
+ $c = ($settings['f_image'] && $meta == '_thumbnail_id')?true:false;
315
+ $d = (mb_substr($meta, 0, 4) == '_wp_')?true:false;
316
+ $e = ($meta == '_thumbnail_id' && $settings['f_image'])?true:false;
317
+ $f = ($meta == '_cdp_origin')?true:false;
318
+
319
+ // If any of above condition is true pass the meta tag
320
+ if ($a || $b || $c || $d || $e || $f) {
321
+
322
+ // Prepare data and insert filtered to results
323
+ foreach ($vals as $val)
324
+ array_push($prepared, array($meta => $val));
325
+
326
+ }
327
+
328
+ }
329
+
330
+ // Return results
331
+ return $prepared;
332
+
333
+ }
334
+
335
+ /**
336
+ * This local function format title by user settings
337
+ * @param $title (string)
338
+ * @param $settings (array of name settings preselected in profile)
339
+ * @return string formated title
340
+ */
341
+ function cdp_create_title($title, $settings, $id, $areWePro) {
342
+
343
+ // Date formats
344
+ $date_format = intval($settings['format']);
345
+
346
+ // Get right format
347
+ if ($date_format == 1) $date_format = 'm/d/Y';
348
+ else if ($date_format == 2) $date_format = 'd/m/Y';
349
+ else {
350
+ if ($areWePro && function_exists('cdpp_custom_date'))
351
+ $date_format = cdpp_custom_date($settings);
352
+ else $date_format = 'd/m/Y';
353
+ }
354
+
355
+ // Create date and time replacements
356
+ $curr = current_time('timestamp', true);
357
+ $date = date($date_format, $curr);
358
+ $time = date('H:i:s', $curr);
359
+
360
+ // Concat whole title with prefix and suffix
361
+ $new_title = $settings['prefix'] . ' ' . $title . ' ' . $settings['suffix'];
362
+
363
+ // Make replace of placeholders
364
+ $new_title = str_replace('[CurrentDate]', $date, $new_title);
365
+ $new_title = str_replace('[CurrentTime]', $time, $new_title);
366
+
367
+ // Return formatted title
368
+ return $new_title;
369
+
370
+ }
371
+
372
+ /**
373
+ * This local function inserts whole post into database
374
+ * @param $data (array prepared by cdp_filter_post function)
375
+ * @param $times (int how many times should this function copy post)
376
+ * @return array of new inserted post(s) and error status
377
+ * Structure of return array: { ids: [$ids], error: (count of errors) }
378
+ */
379
+ function cdp_insert_post($id, $data, $times, $areWePro, $isChild = false, $p_ids = null, $site) {
380
+
381
+ // Get Wordpress database
382
+ global $wpdb;
383
+
384
+ // Create empty array for new id(s) and error(s)
385
+ $results = array('ids' => array(), 'error' => 0, 'counter' => 0);
386
+
387
+ // Get Counter value
388
+ $prefix = (($site != -1)?$wpdb->get_blog_prefix($site):$wpdb->get_blog_prefix());
389
+ $counter = $wpdb->get_results("SELECT COUNT(post_id) AS 'Counter' FROM {$prefix}postmeta WHERE meta_key = '_cdp_origin' AND meta_value = {$id}", ARRAY_A)[0]['Counter'];
390
+
391
+ $base_title = $data['post_title'];
392
+ $counter = intval($counter) + 2;
393
+
394
+ // Handle multisite for premium
395
+ if ($areWePro && function_exists('cdpp_handle_multisite'))
396
+ cdpp_handle_multisite($site);
397
+
398
+ // Loop for each post iteration
399
+ for ($i = 0; $i < $times; ++$i) {
400
+
401
+ // Change parent if it's child
402
+ if ($isChild) $data['post_parent'] = $p_ids['posts'][$i];
403
+
404
+ // Replace title with Counter if multiple copies
405
+ $data['post_title'] = str_replace('[Counter]', ($counter + $i), $base_title);
406
+
407
+ // Insert post with filtered data
408
+ $new = wp_insert_post($data, true);
409
+
410
+ // Check if the post is inserted successfully and append array
411
+ if (is_numeric($new)) array_push($results['ids'], $new);
412
+ else $results['error']++;
413
+
414
+ }
415
+
416
+ // Handle multisite for premium fix
417
+ if ($areWePro && function_exists('cdpp_handle_multisite_after'))
418
+ cdpp_handle_multisite_after($site);
419
+
420
+ // Set first counter number for future
421
+ $results['counter'] = $counter;
422
+
423
+ // Return array with results
424
+ return $results;
425
+
426
+ }
427
+
428
+ /**
429
+ * This local function filter and adds missing meta to added post
430
+ * @param $ids (array of post ids)
431
+ * @param $metas (filtered meta data with cdp_filter_meta function)
432
+ * @return array structure below
433
+ * { ids: { [id] => [failed times]}, error: { [id] => [failed times]} }
434
+ */
435
+ function cdp_insert_post_meta($ids, $metas, $areWePro, $counter, $site) {
436
+
437
+ // Handle multisite for premium
438
+ if ($areWePro && function_exists('cdpp_handle_multisite'))
439
+ cdpp_handle_multisite($site);
440
+
441
+ // Create empty array for new id(s) and error(s)
442
+ $results = array('ids' => array(), 'error' => array());
443
+
444
+ // Iterate through every inserted post
445
+ foreach ($ids as $id) {
446
+
447
+ // Iterate through every meta tag
448
+ foreach ($metas as $meta_id => $meta) {
449
+
450
+ // Get individual data from metas array
451
+ foreach ($meta as $key => $val) {
452
+
453
+ // Replace the counter with dynamic value
454
+ if ($key == '_cdp_counter') $val = $counter;
455
+
456
+ // Insert meta tag
457
+ $res = add_post_meta($id, $key, $val);
458
+
459
+ // Check if the insert was successfull
460
+ if ($res != false) {
461
+ if (!isset($results['ids'][$id])) $results['ids'][$id] = [];
462
+ array_push($results['ids'][$id], array($key, $val));
463
+ } else {
464
+ if (!isset($results['error'][$id])) $results['error'][$id] = [];
465
+ array_push($results['error'][$id], array($key, $val));
466
+ }
467
+
468
+ }
469
+
470
+ }
471
+
472
+ // Iterate the counter
473
+ $counter++;
474
+
475
+ }
476
+
477
+ // Fix multisite handler
478
+ if ($areWePro && function_exists('cdpp_handle_multisite_after'))
479
+ cdpp_handle_multisite_after($site);
480
+
481
+ // Return the results
482
+ return $results;
483
+
484
+ }
485
+
486
+ /**
487
+ * This local function search for childs and catch their IDs
488
+ * @param $id string/int (post id)
489
+ * @return array of child(s) ID(s)
490
+ */
491
+ function cdp_check_childs($id) {
492
+ $childs = [];
493
+ $childrens = get_children(array('post_parent' => $id));
494
+
495
+ foreach ($childrens as $i => $child)
496
+ array_push($childs, $child->ID);
497
+
498
+ return $childs;
499
+ }
500
+
501
+ /**
502
+ * This local function copies original attachments
503
+ * @param $path string (path to original file)
504
+ * @return string path to new file
505
+ */
506
+ function cdp_copy_attachment($path = '', $destination) {
507
+ if ($path == '') return false;
508
+
509
+ $dirname = $destination;
510
+ $name = basename($path);
511
+ $actual_name = pathinfo($name, PATHINFO_FILENAME);
512
+ $original_name = $actual_name;
513
+ $extension = pathinfo($name, PATHINFO_EXTENSION);
514
+
515
+ $i = 1;
516
+ while (file_exists($dirname.'/'.$actual_name.".".$extension)) {
517
+ $actual_name = (string)$original_name.'-'.$i;
518
+ $name = $actual_name.'.'.$extension;
519
+ $i++;
520
+ }
521
+
522
+ copy($path, $dirname.'/'.$name);
523
+ return $dirname.'/'.$name;
524
+ }
525
+
526
+ /**
527
+ * This local function gets copy and insert attachments
528
+ * @param $id int/string of post
529
+ * @return array of inserted attachments
530
+ */
531
+ function cdp_insert_attachments($id, $inserted_posts, $areWePro, $site) {
532
+ $inserts = array();
533
+ $media = get_attached_media('', $id);
534
+
535
+ // Handle multisite for premium
536
+ if ($areWePro && function_exists('cdpp_handle_multisite'))
537
+ cdpp_handle_multisite($site);
538
+
539
+ // Fix wordpress multisite path
540
+ add_filter('upload_dir', 'cdp_fix_upload_paths');
541
+ $wp_upload_dir = wp_upload_dir();
542
+ remove_filter('upload_dir', 'cdp_fix_upload_paths');
543
+
544
+ // Handle multisite for premium fix
545
+ if ($areWePro && function_exists('cdpp_handle_multisite_after'))
546
+ cdpp_handle_multisite_after($site);
547
+
548
+ foreach ($media as $i => $m) {
549
+ if (get_attached_file($m->ID) == '') continue;
550
+ $path = cdp_copy_attachment(get_attached_file($m->ID), $wp_upload_dir['path']);
551
+
552
+ $filename = $path;
553
+ $parent_post_id = $inserted_posts['ids'][0];
554
+
555
+ $filetype = wp_check_filetype(basename($filename), null);
556
+
557
+ // Handle multisite for premium
558
+ if ($areWePro && function_exists('cdpp_handle_multisite'))
559
+ cdpp_handle_multisite($site);
560
+
561
+ $attachment = array(
562
+ 'guid' => $wp_upload_dir['url'] . '/' . basename($filename),
563
+ 'post_mime_type' => $filetype['type'],
564
+ 'post_title' => preg_replace( '/\.[^.]+$/', '', basename($filename)),
565
+ 'post_content' => '',
566
+ 'post_status' => 'inherit'
567
+ );
568
+
569
+ $attach_id = wp_insert_attachment($attachment, $filename, $parent_post_id);
570
+ array_push($inserts, array('url' => wp_get_attachment_url($attach_id), 'id' => $attach_id));
571
+
572
+ $attach_data = wp_generate_attachment_metadata($attach_id, $filename);
573
+ wp_update_attachment_metadata($attach_id, $attach_data);
574
+
575
+ // Handle multisite for premium fix
576
+ if ($areWePro && function_exists('cdpp_handle_multisite_after'))
577
+ cdpp_handle_multisite_after($site);
578
+ }
579
+
580
+ return $inserts;
581
+ }
582
+
583
+ /**
584
+ * This local function gets comments and copy them
585
+ * @param $id int/string of base post
586
+ * @param $dests array of post ids where the comms from $id should be copied
587
+ * @return array of inserted comments
588
+ */
589
+ function cdp_copy_comments($id, $dests) {
590
+ $comments = get_comments(array('post_id' => $id));
591
+ $curr = current_time('mysql');
592
+ $all_inserts = array();
593
+ $all_inserts['fix_try'] = array();
594
+ $all_inserts['olds'] = '';
595
+
596
+ foreach ($dests as $dest) {
597
+ $p = 0;
598
+ $olds = array();
599
+
600
+ $cm1 = $comments;
601
+ foreach ($cm1 as $i => $c) {
602
+ $c = $c->to_array();
603
+ $old_id = $c['comment_ID'];
604
+ $parent = $c['comment_parent'];
605
+
606
+ $c['comment_date'] = $curr;
607
+ $c['comment_date_gmt'] = $curr;
608
+ $c['comment_post_ID'] = $dest;
609
+ $c['comment_parent'] = 0;
610
+ if ($parent != "0") $p++;
611
+
612
+ $new_id = @wp_insert_comment($c);
613
+
614
+ $olds[$old_id] = array('new' => $new_id, 'old_parent_id' => $parent);
615
+ array_push($all_inserts, array('old' => $old_id, 'new' => $new_id, 'parent' => $parent));
616
+ }
617
+
618
+ if ($p != 0) {
619
+ $cm2 = $comments;
620
+ foreach ($cm2 as $j => $m) {
621
+ if ($m->comment_parent != "0" && $olds[$m->comment_ID]['old_parent_id'] == $m->comment_parent) {
622
+ $post = get_comment($olds[$m->comment_ID]['new']);
623
+ $post = $post->to_array();
624
+ $post['comment_parent'] = $olds[$m->comment_parent]['new'];
625
+ wp_update_comment($post);
626
+ }
627
+ }
628
+ }
629
+
630
+ }
631
+
632
+ return $all_inserts;
633
+ }
634
+
635
+ // Main code for this duplication – for each id (post) do whole process
636
+ function cdp_process_ids($ids, $swap, $settings, $times, $site, $areWePro, $g, $isChild = false, $p_ids = null) {
637
+
638
+ // Make it clear
639
+ $globals = cdp_default_global_options();
640
+ if ($g != false) $globals = $g;
641
+ $g = $globals['others'];
642
+
643
+ // Return data storage
644
+ $output = [];
645
+ $new_posts = array('parents' => array(), 'childs' => array(), 'ids' => array());
646
+
647
+ // Iterate each id
648
+ foreach ($ids as $id) {
649
+
650
+ // Get post data and meta data
651
+ $post = get_post($id)->to_array();
652
+ $meta = get_post_custom($id);
653
+ $taxonomies = wp_get_object_terms($id, get_taxonomies());
654
+
655
+ // Check if this post type is allowed to copy
656
+ $type = $post['post_type'];
657
+ if ($g['cdp-content-pages'] == 'false' && $type == 'page') continue;
658
+ if ($g['cdp-content-posts'] == 'false' && $type == 'post') continue;
659
+ if ($g['cdp-content-custom'] == 'false' && ($type != 'page' && $type != 'post')) continue;
660
+
661
+ // Post converting?
662
+ $pConv = false;
663
+ if (array_key_exists('postConverter', $globals))
664
+ $pConv = $globals['postConverter'];
665
+
666
+ // Run process and validate response
667
+ $childrens = cdp_check_childs($id); // if sizeof($this) == has childs
668
+ $post_data = cdp_filter_post($post, $swap, $pConv, $settings, $taxonomies, $areWePro, $swap); // can be false
669
+ $meta_data = cdp_filter_meta($meta, $settings, $id, $areWePro, $site); // can be false
670
+ $inserted_posts = cdp_insert_post($id, $post_data, $times, $areWePro, $isChild, $p_ids, $site); // $res['error'] must be == 0
671
+ $inserted_metas = cdp_insert_post_meta($inserted_posts['ids'], $meta_data, $areWePro, $inserted_posts['counter'], $site); // sizeof($res['error']) must be == 0
672
+
673
+ // Comments copy
674
+ if ($settings['comments']) $inserted_comments = cdp_copy_comments($id, $inserted_posts['ids']);
675
+ $cms = get_comments(array('post_id' => $id));
676
+
677
+ // Post format
678
+ if ($settings['format']) foreach ($inserted_posts['ids'] as $i => $tid)
679
+ $isReFormat = set_post_format($tid, get_post_format($id));
680
+
681
+ // Featured image copy
682
+ if ($settings['attachments']) $inserted_attachments = cdp_insert_attachments($id, $inserted_posts, $areWePro, $site);
683
+ else $inserted_attachments = false;
684
+
685
+ // Copy childrens recursively if exist
686
+ if ($settings['children'] && sizeof($childrens) > 0) {
687
+ $child_helpers = array('posts' => $inserted_posts['ids']);
688
+ $inserted_childs = cdp_process_ids($childrens, $swap, $settings, $times, $site, $areWePro, $globals, true, $child_helpers);
689
+ array_push($new_posts['childs'], array($id => $inserted_childs['$new_posts']['ids']));
690
+ }
691
+
692
+ // Add new inserted IDs
693
+ foreach ($inserted_posts['ids'] as $i_id)
694
+ array_push($new_posts['parents'], $i_id);
695
+
696
+ // Merge for easier read
697
+ $new_posts['ids'] = array_merge($new_posts['ids'], $new_posts['parents'], $new_posts['childs']);
698
+
699
+ }
700
+
701
+ // Return all data to main request
702
+ return array('$output' => $output, '$new_posts' => $new_posts);
703
+
704
+ }
705
+
706
+ // Run the machine for selected post(s)
707
+ $g = get_option('_cdp_globals', false);
708
+ $new_insertions = cdp_process_ids($ids, $swap, $settings, $times, $site, $areWePro, $g);
709
+
710
+ // Handle multisite for premium
711
+ if ($areWePro && function_exists('cdpp_handle_multisite'))
712
+ cdpp_handle_multisite($site);
713
+
714
+ $pConv = false;
715
+ if (array_key_exists('postConverter', $g) && $areWePro)
716
+ $pConv = (($g['postConverter'] === '2' || $g['postConverter'] === 2)?true:false);
717
+
718
+ // Output link if it's edited post
719
+ $aCop = ((array_key_exists('afterCopy', $g))?$g['afterCopy']:'1');
720
+ if (($data['type'] == 'copy-custom-link' || $aCop == '2'))
721
+ $output['link'] = get_edit_post_link($new_insertions['$new_posts']['parents'][0], 'x');
722
+
723
+ if ($pConv == true && !($data['type'] == 'copy-custom-link' || $aCop == '2')) $output['link'] = 'pConv';
724
+ else update_option('_cdp_show_copy', true);
725
+
726
+ // Handle multisite for premium fix
727
+ if ($areWePro && function_exists('cdpp_handle_multisite_after'))
728
+ cdpp_handle_multisite_after($site);
729
+
730
+ echo json_encode(cdp_sanitize_array($output));
731
+ }
732
+ /** –– **/
733
+
734
+ /** –– **\
735
+ * This function will return profile information for presets.
736
+ * @return object of settings by requested profile
737
+ * @since 1.0.0
738
+ */
739
+ function cdp_get_profile() {
740
+
741
+ if (function_exists('cdpp_get_all_profiles')) cdpp_get_profile();
742
+ else {
743
+
744
+ // Search for the settings of profile
745
+ $settings = get_option('_cdp_profiles')['default'];
746
+
747
+ // Display those settings
748
+ echo json_encode(cdp_sanitize_array($settings));
749
+
750
+ }
751
+
752
+ }
753
+ /** –– **/
754
+
755
+ /** –– **\
756
+ * This function will return all profile information for manager.
757
+ * @return object of settings by requested profile
758
+ * @since 1.0.0
759
+ */
760
+ function cdp_get_all_profiles() {
761
+
762
+ if (function_exists('cdpp_get_all_profiles')) cdpp_get_all_profiles();
763
+ else cdp_get_profile();
764
+
765
+ }
766
+ /** –– **/
767
+
768
+ /** –– **\
769
+ * This function will return all not trashed posts
770
+ * @return object of posts and success or fail message
771
+ */
772
+ function cdp_get_all_posts() {
773
+ $output = array();
774
+
775
+ $args = array(
776
+ 'numberposts' => -1,
777
+ 'post_type' => 'post',
778
+ 'post_status' => 'publish,private,draft,future,pending,inherit,sticky'
779
+ );
780
+
781
+ $output['posts'] = get_posts($args);
782
+ $args['post_type'] = 'page';
783
+ $output['pages'] = get_posts($args);
784
+ $output['custom'] = array();
785
+
786
+ $post_types = get_post_types(array( 'public' => true, '_builtin' => false ));
787
+
788
+ if (sizeof($post_types) > 0)
789
+ $output['custom'] = get_posts(array('post_type' => $post_types, 'numberposts' => -1));
790
+
791
+ $output['meta'] = array();
792
+ foreach ($output['posts'] as $k => $p) $output['meta'][$p->ID] = get_post_meta($p->ID);
793
+ foreach ($output['pages'] as $k => $p) $output['meta'][$p->ID] = get_post_meta($p->ID);
794
+ foreach ($output['custom'] as $k => $p) $output['meta'][$p->ID] = get_post_meta($p->ID);
795
+
796
+ echo json_encode(cdp_sanitize_array($output));
797
+ }
798
+ /** –– **/
799
+
800
+ /** –– **\
801
+ * This function will delete all posts in array PERMANENTLY!
802
+ * @return object of success message or error
803
+ */
804
+ function cdp_delete_posts() {
805
+ $ids = ((isset($_POST['ids']))?cdp_sanitize_array($_POST['ids']):false); // ids to delete
806
+ $throttling = sanitize_text_field($_POST['throttling']); // throttling if enabeld
807
+ $thc = sanitize_text_field($_POST['thc']); // throttling count if enabeld
808
+ $thrs = sanitize_text_field($_POST['thrs']) == 'true' ? true : false; // trash or not?
809
+ $redi = sanitize_text_field($_POST['redi']) == 'true' ? true : false; // redirect if enabled
810
+
811
+ $prepared_ids = array(); $inGroup = 0;
812
+ $curr = current_time('timestamp'); $token = uniqid($curr, true);
813
+ $cdp_cron = get_option('_cdp_crons');
814
+ $site = is_multisite() ? get_current_blog_id() : '-1';
815
+ if ($cdp_cron == false) $cdp_cron = array();
816
+ $cdp_cron[$token] = array(
817
+ 'start' => $curr,
818
+ 'ids' => $ids,
819
+ 'done' => false,
820
+ 'shown' => false,
821
+ 'f' => 'delete',
822
+ 'handler' => 'cdp_cron_delete'
823
+ );
824
+ $cdp_cron[$token]['tasks'] = array();
825
+ $cdp_cron[$token]['args'] = array();
826
+
827
+ if ($throttling == '1' && $thc && intval($thc) >= 1 && intval($thc) <= 10240) {
828
+
829
+ $inGroup = ceil(intval($thc) / 30);
830
+
831
+ for ($i=0, $k=4; $i < sizeof($ids); $i = $i + $inGroup, $k++)
832
+ $cdp_cron[$token]['tasks']["-$k"] = false;
833
+
834
+ update_option('_cdp_crons', $cdp_cron);
835
+
836
+ for ($i=0, $k=4; $i < sizeof($ids); $i = $i + $inGroup, $k++) {
837
+ $tg = array(); $tt = array('tsk' => "-".$k, 'token' => $token);
838
+
839
+ for ($j=$i; $j < ($i + $inGroup); $j++) if (isset($ids[$j])) array_push($tg, $ids[$j]);
840
+
841
+ array_push($prepared_ids, $tg);
842
+ $time = $k * 2;
843
+ $args = array(array('ids' => $tg, 'site' => $site, 'trash' => $thrs, 'token' => $tt));
844
+ wp_schedule_single_event(strtotime("+$time seconds"), 'cdp_cron_delete', $args);
845
+ array_push($cdp_cron[$token]['args'], $args);
846
+ }
847
+
848
+ } else {
849
+
850
+ $cdp_cron[$token]['tasks']["-0"] = false;
851
+ update_option('_cdp_crons', $cdp_cron);
852
+ $tt = array('tsk' => "-0", 'token' => $token);
853
+ $args = array(array('ids' => $ids, 'site' => $site, 'trash' => $thrs, 'token' => $tt));
854
+ wp_schedule_single_event(strtotime('+2 seconds'), 'cdp_cron_delete', $args);
855
+ array_push($cdp_cron[$token]['args'], $args);
856
+
857
+ }
858
+
859
+ echo json_encode(array('status' => 'success', 'token' => cdp_sanitize_array($token)));
860
+ }
861
+ /** –– **/
862
+
863
+ /** –– **\
864
+ * This function will delete all posts in array PERMANENTLY!
865
+ * @return object of success message or error
866
+ */
867
+ function cdp_clear_all_crons() {
868
+ $cdp_cron = get_option('_cdp_crons');
869
+
870
+ foreach ($cdp_cron as $cron => $val) {
871
+ if ($val['done'] != true) {
872
+ echo json_encode(array(
873
+ 'status' => 'fail',
874
+ 'type' => 'warning',
875
+ 'msg' => 'You can\'t clear messages when tasks are in progress, please firstly kill tasks or wait till the end.'
876
+ ));
877
+ return;
878
+ }
879
+ }
880
+
881
+ $cdp_cron = delete_option('_cdp_crons');
882
+ echo json_encode(array('status' => 'success'));
883
+ }
884
+ /** –– **/
885
+
886
+ /** –– **\
887
+ * Local function which sets default profile for user
888
+ * @return Boolean
889
+ */
890
+ function cdp_set_default_profile() {
891
+ $curr = get_option('_cdp_preselections');
892
+ $id = get_current_user_id();
893
+ $new = array();
894
+ $selection = ((isset($_POST['selection']))?cdp_sanitize_array($_POST['selection']):false);
895
+ if ($curr && !is_object($curr) || $curr == false) $new = array($id => $selection);
896
+ else { $new = $curr; $new[$id] = $selection; }
897
+ $stat = update_option('_cdp_preselections', $new);
898
+ echo cdp_sanitize_array($stat);
899
+ }
900
+ /** –– **/
901
+
902
+ /** –– **\
903
+ * Local function which gets default profile for user
904
+ * @return String
905
+ */
906
+ function cdp_get_default_profile() {
907
+ echo(esc_html(get_option('_cdp_preselections')[get_current_user_id()]));
908
+ }
909
+ /** –– **/
910
+
911
+ /** –– **\
912
+ * This function will set as seen notification!
913
+ * @return object of success message — WARNING: ALWAYS
914
+ */
915
+ function cdp_set_noti_as_seen() {
916
+ $token = ((isset($_POST['noti_token']))?sanitize_text_field($_POST['noti_token']):false);
917
+ $cdp_cron = get_option('_cdp_crons', array());
918
+ $cdp_cron[$token]['shown'] = true;
919
+ update_option('_cdp_crons', $cdp_cron);
920
+
921
+ echo json_encode(array('status' => 'success'));
922
+ }
923
+ /** –– **/
924
+
925
+ /** –– **\
926
+ * This function will delete task from the history!
927
+ * @return object of success message or fail
928
+ */
929
+ function cdp_just_hide_task() {
930
+ $token = ((isset($_POST['task']))?sanitize_text_field($_POST['task']):false);
931
+ $cdp_cron = get_option('_cdp_crons', array());
932
+ unset($cdp_cron[$token]);
933
+ $res = update_option('_cdp_crons', $cdp_cron);
934
+
935
+ if ($res) echo json_encode(array('status' => 'success'));
936
+ else echo json_encode(array('status' => 'fail', 'type' => 'error', 'msg' => 'We can\'t hide this task now, – maybe it\'t already hidden. Please try again later.'));
937
+ }
938
+ /** –– **/
939
+
940
+ /** –– **\
941
+ * This function will kill task from the cron!
942
+ * @return object of success message or fail
943
+ */
944
+ function cdp_just_kill_task() {
945
+ $token = ((isset($_POST['task']))?sanitize_text_field($_POST['task']):false);
946
+ $cdp_cron = get_option('_cdp_crons', array());
947
+ $handler = $cdp_cron[$token]['handler'];
948
+ $args = $cdp_cron[$token]['args'];
949
+
950
+ if ($cdp_cron[$token]['done'] == true) {
951
+ echo json_encode(array('status' => 'fail', 'type' => 'error', 'msg' => 'This task has already ended this work, please wait for list refresh and try again.'));
952
+ return;
953
+ }
954
+
955
+ $status = true; $res = false;
956
+ foreach ($args as $arg => $val) {
957
+ $sres = wp_clear_scheduled_hook($handler, $val);
958
+ if ($sres == false) $status = false;
959
+ }
960
+
961
+ if ($cdp_cron[$token]['done'] == true) $status = true;
962
+
963
+ if ($status == true) {
964
+ unset($cdp_cron[$token]);
965
+ $res = update_option('_cdp_crons', $cdp_cron);
966
+ }
967
+
968
+ if ($status || $res) echo json_encode(array('status' => 'success'));
969
+ else echo json_encode(array('status' => 'fail', 'type' => 'error', 'msg' => 'We can\'t confirm that we killed this task now, please try again later or check if it\'t killed.'));
970
+ }
971
+ /** –– **/
972
+
973
+ /** –– **\
974
+ * This function will catch current cron tasks!
975
+ * @return object of tasks or fail
976
+ */
977
+ function cdp_just_get_tasks() {
978
+ $cdp_cron = get_option('_cdp_crons', false);
979
+
980
+ if ($cdp_cron) echo json_encode(array('status' => 'success', 'tasks' => cdp_sanitize_array($cdp_cron)));
981
+ else echo json_encode(array('status' => 'fail', 'type' => 'error', 'msg' => 'We couldn\'t catch current tasks, please try again later.'));
982
+ }
983
+ /** –– **/
984
+
985
+ /** –– **\
986
+ * This function is just for debug have fun with it!
987
+ * It can be fired by function cdp_totally_know_what_i_am_doing('really');
988
+ * It won't work in production mode so dont even try it, if you're not me ~ Mikołaj :P
989
+ * @return mixed
990
+ */
991
+ function cdp_debug_function() {
992
+
993
+ $things_to_debug = array(
994
+
995
+ );
996
+
997
+ var_export($things_to_debug);
998
+
999
+ }
1000
+ /** –– **/
readme.txt ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Copy Delete Posts ===
2
+ Contributors: CopyDeletePosts, copydelete
3
+ Tags: Copy posts, Delete posts, Copy pages, Delete pages, Duplicate pages
4
+ Requires at least: 4.9
5
+ Tested up to: 5.3.2
6
+ Stable tag: 1.0.0
7
+ License: GPLv3
8
+ Requires PHP: 7.0
9
+
10
+ Copy and delete posts quickly & easily
11
+
12
+ == Description ==
13
+
14
+ This plugin makes it easy to copy and delete posts or pages.
15
+
16
+ After installation you'll see a new copy link which, on mouse-over, shows you a tooltip (see screenshot) which allows you to:
17
+
18
+ - Copy the page or post instantly with one click
19
+ - Specify how often you want to duplicate the page or post
20
+ - Choose to see more options and define specifically what elements should be copied for this page or post
21
+
22
+ The new copy post option will be visible on:
23
+
24
+ - Your overview of pages and posts
25
+ - Edit screens (post or pages)
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 available if you copy or delete posts:
33
+
34
+ - Define where you should be navigated to after you copy a page or post
35
+ - Define which users (roles) should be allowed to copy posts or pages
36
+ - Define which content types should be allowed to be copied, i.e. posts, pages, and custom post types
37
+ - Define to show a reference to the original copied page or post
38
+
39
+ Not only can you copy a page or post quickly, but the plugin also offers a sophisticated tool to delete duplicate post or pages.
40
+
41
+ As part of that process, you can define:
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
+ You can select to throttle the deletion of posts or pages (in case you're on a slow server).
48
+
49
+ The free plugin offers a lot of options - if you want even more, then check out the premium plugin (currently under development) which will offer the following additional features:
50
+
51
+ - Use several configuration sets & import / export them
52
+ - Also include information from third party plugins when copying (e.g. Yoast-information linked to pages/posts)
53
+ - Copy pages/posts to other sites in a multisite set-up
54
+ - Automatically delete pages/posts
55
+ - Apply automatic redirects for deleted pages/posts
56
+
57
+ Just try it out! You'll love it :)
58
+
59
+
60
+ == Installation ==
61
+
62
+ = Admin Installer via search =
63
+ 1. Visit the Add New plugin screen and search for "Copy & Delete Posts".
64
+ 2. Click the "Install Now" button.
65
+ 3. Activate the plugin.
66
+ 4. The plugin should be shown below settings menu.
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
+ = Why doesn't the deletion process work correctly? =
77
+ If the deletion process seems to not work please append your wp-config.php with this line of code:
78
+ `define('ALTERNATE_WP_CRON', true);`
79
+ It should fix the issue :)
80
+
81
+
82
+ == Screenshots ==
83
+ 1. This is the description for the first screenshot
84
+
85
+ == Changelog ==
86
+
87
+ = 1.0.0 =
88
+ * Initial release
89
+
90
+ == Upgrade Notice ==
91
+ = 1.0.0 =
92
+ * Initial release