Nenhuma Descrição

configuration.php 76KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059
  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. // Exit if accessed directly.
  11. if (!defined('ABSPATH')) exit;
  12. /** –– **\
  13. * Adding assets.
  14. * @since 1.0.0
  15. */
  16. add_action('admin_enqueue_scripts', function() {
  17. if (cdp_check_permissions(wp_get_current_user()) == false) return;
  18. $current_screen = get_current_screen();
  19. if (!is_object($current_screen)) return;
  20. if (function_exists('wp_doing_ajax') && wp_doing_ajax()) return;
  21. wp_enqueue_script('cdp');
  22. wp_enqueue_script('jquery-ui-draggable');
  23. wp_enqueue_script('jquery-ui-droppable');
  24. wp_enqueue_script('jquery-ui-sortable');
  25. wp_enqueue_style('cdp-css');
  26. });
  27. /** –– **/
  28. /** –– **\
  29. * Adding assets.
  30. * @since 1.0.9
  31. */
  32. add_action('cdp_notices_special', function() {
  33. if (cdp_check_permissions(wp_get_current_user()) == false) return;
  34. if (!get_option('cdp_dismiss_perf_notice', false) && get_option('cdp_latest_slow_performance', false)) {
  35. cdp_render_performance_notice();
  36. }
  37. });
  38. /** –– **/
  39. /** –– **\
  40. * Main plugin configuration menu.
  41. * @since 1.0.0
  42. */
  43. function cdp_configuration() {
  44. if (cdp_check_permissions(wp_get_current_user()) == false) return;
  45. global $cdp_plug_url;
  46. $current_user = wp_get_current_user();
  47. $user_id = get_current_user_id();
  48. $no_intro = (get_option('_cdp_no_intro')) ? get_option('_cdp_no_intro') : array();
  49. $has_intro = !in_array($user_id, $no_intro) || false;
  50. $profiles = get_option('_cdp_profiles');
  51. $defaults = get_option('_cdp_profiles');
  52. if ($defaults && array_key_exists('default', $defaults)) $defaults = $defaults['default'];
  53. else $defaults = cdp_default_options();
  54. $globals = get_option('_cdp_globals');
  55. $roles = get_editable_roles();
  56. $isCoolInstalled = '';
  57. if (get_option('_cdp_cool_installation', false)) {
  58. delete_option('_cdp_cool_installation');
  59. $isCoolInstalled = ' cdp_is_cool_installed';
  60. }
  61. $names_format = false;
  62. $after_copy = false;
  63. $post_converter = false;
  64. $gos = cdp_default_global_options();
  65. if (isset($defaults['names']))
  66. if (isset($defaults['names']['format'])) $names_format = intval($defaults['names']['format']);
  67. if (isset($globals)) {
  68. if (isset($globals['afterCopy'])) $after_copy = $globals['afterCopy'];
  69. if (isset($globals['postConverter'])) $post_converter = $globals['postConverter'];
  70. if (isset($globals['others'])) $gos = $globals['others'];
  71. }
  72. if (!array_key_exists('cdp-display-bulk', $gos)) $gos = cdp_default_global_options();
  73. // Ask for pro features
  74. $areWePro = areWePro();
  75. if (!$has_intro) {
  76. $intro = ' style="display: none;"';
  77. $content = '';
  78. } else {
  79. $intro = '';
  80. $content = ' style="display: none; opacity: 0;"';
  81. }
  82. $isYoast = false; $isUSM = false; $isWoo = false;
  83. if (is_plugin_active('woocommerce/woocommerce.php')) $isWoo = true;
  84. if (is_plugin_active('wordpress-seo/wp-seo.php') || is_plugin_active('wordpress-seo-premium/wp-seo-premium.php')) $isYoast = true;
  85. if (
  86. is_plugin_active('USM-Premium/usm_premium_icons.php') ||
  87. is_plugin_active('Ultimate-Social-Media-Plus/ultimate_social_media_icons.php') ||
  88. is_plugin_active('Ultimate-Social-Media-Icons/ultimate_social_media_icons.php') ||
  89. is_plugin_active('Ultimate-Premium-Plugin/usm_premium_icons.php') ||
  90. is_plugin_active('ultimate-social-media-icons/ultimate_social_media_icons.php') ||
  91. is_plugin_active('ultimate-social-media-plus/ultimate-social-media-plus.php') ||
  92. is_plugin_active('ultimate-social-media-plus/ultimate_social_media_plus.php')
  93. ) $isUSM = true;
  94. ?>
  95. <style>
  96. #wpcontent {padding-left: 2px !important;}
  97. /* #wpbody {overflow-y: scroll;overflow-x: auto;max-height: calc(100vh - 32px);} */
  98. #wpfooter { display: none; padding-bottom: 30vh; }
  99. #wpfooter #footer-left { display: none; }
  100. #wpfooter #footer-upgrade { display: none; }
  101. </style>
  102. <?php if ($areWePro && function_exists('cdpp_profile_manager_html')) cdpp_profile_manager_html(); ?>
  103. <?php if ($areWePro && function_exists('cdpp_delete_redi_modal')) cdpp_delete_redi_modal(); ?>
  104. <div class="cdp-preloader-c<?php echo $isCoolInstalled ?>">
  105. <div class="cdp-center"><?php _e('Loading...', 'copy-delete-posts'); ?></div>
  106. <div class="cdp-preloader"></div>
  107. </div>
  108. <div class="cdp-container cdp-main-menu-cont" style="display: none;">
  109. <div class="cdp-content">
  110. <div class="cdp-cf">
  111. <div class="cdp-left">
  112. <!-- <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> -->
  113. <h1 class="cdp-f-s-30 cdp-f-w-medium cdp-welcome-title-after"><?php _e('Welcome to Copy & Delete Posts!', 'copy-delete-posts'); ?></h1>
  114. </div>
  115. <div class="cdp-right">
  116. <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"><?php _e('Show intro', 'copy-delete-posts'); ?></span></a></div>
  117. </div>
  118. </div>
  119. <?php do_action('cdp_notices_special'); ?>
  120. <div class="cdp-intro"<?php echo $intro ?>>
  121. <div class="cdp-box cdp-white-bg cdp-shadow">
  122. <div class="cdp-font-heading cdp-f-s-21 cdp-f-w-regular"><?php _e('You can now easily copy posts & pages in various areas:', 'copy-delete-posts'); ?></div>
  123. <div class="cdp-cf">
  124. <div class="cdp-showcase-3 cdp-left">
  125. <div class="cdp-font-title cdp-f-s-22 cdp-f-w-bold cdp-center"><?php _e('List of posts/pages', 'copy-delete-posts'); ?></div>
  126. <div class="cfg-img-sc-3 cdp-intro-image cdp-intro-img-1" alt="lists">
  127. <img src="<?php echo $cdp_plug_url; ?>/assets/imgs/intro_1.gif" class="cdp-no-vis cfg-img-sc-3" alt="lists">
  128. </div>
  129. </div>
  130. <div class="cdp-showcase-3 cdp-left">
  131. <div class="cdp-font-title cdp-f-s-22 cdp-f-w-bold cdp-center"><?php _e('Edit screen', 'copy-delete-posts'); ?></div>
  132. <div class="cfg-img-sc-3 cdp-intro-image cdp-intro-img-2" alt="edit">
  133. <img src="<?php echo $cdp_plug_url; ?>/assets/imgs/intro_2.gif" class="cdp-no-vis cfg-img-sc-3" alt="edit">
  134. </div>
  135. </div>
  136. <div class="cdp-showcase-3 cdp-left">
  137. <div class="cdp-font-title cdp-f-s-22 cdp-f-w-bold cdp-center"><?php _e('Admin bar', 'copy-delete-posts'); ?></div>
  138. <div class="cfg-img-sc-3 cdp-intro-image cdp-intro-img-3" alt="adminbar">
  139. <img src="<?php echo $cdp_plug_url; ?>/assets/imgs/intro_3.gif" class="cdp-no-vis cfg-img-sc-3 cfg-img-sc-3-special" alt="adminbar">
  140. </div>
  141. </div>
  142. </div>
  143. <div class="cdp-center cdp-font-footer"><?php _e('…and you can also <b>delete duplicate</b> posts easily, see below :)', 'copy-delete-posts'); ?></div>
  144. <div class="cdp-center cdp-intro-options">
  145. <button class="cdp-intro-button cdp-f-s-21 cdp-f-w-bold"><?php _e('Got it, close intro!', 'copy-delete-posts'); ?></button>
  146. <div class="cdp-ff-b1 cdp-checkboxes cdp-hide" style="margin-top: 5px;">
  147. <label for="cdp-never-intro">
  148. <input type="checkbox" checked id="cdp-never-intro" style="margin-top: -3px !important"/>
  149. <?php _e('Don\'t show this intro – never again!', 'copy-delete-posts'); ?>
  150. </label>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. <div class="cdp-cf cdp-profile-bar">
  156. <div class="cdp-left cdp-lh-48 cdp-f-s-20">
  157. <div class="cdp-cf">
  158. <div class="cdp-left cdp-f-w-light">
  159. <?php _e('Below are your', 'copy-delete-posts'); ?>
  160. </div>
  161. <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':''); ?>">
  162. <?php
  163. $preSelProf = get_option('_cdp_preselections')[intval(get_current_user_id())];
  164. if ($profiles != false && $areWePro) {
  165. foreach ($profiles as $profile => $vals):
  166. $isSel = ($preSelProf == $profile);
  167. ?>
  168. <option value="<?php echo htmlspecialchars($profile); ?>"<?php echo ($isSel)?' selected':''?>><?php echo ucfirst(htmlspecialchars($vals['names']['display'])); ?></option>
  169. <?php endforeach; } else { ?>
  170. <option value="default" selected><?php _e('Default', 'copy-delete-posts'); ?></option>
  171. <option value="premium" disabled><?php _e('Add new', 'copy-delete-posts'); ?></option>
  172. <?php } ?>
  173. </select>
  174. <div class="cdp-left cdp-f-w-light">
  175. <?php _e('settings', 'copy-delete-posts'); ?>
  176. </div>
  177. </div>
  178. </div>
  179. <div class="cdp-right cdp-lh-48 cdp-relative">
  180. <div>
  181. <span class="cdp-tooltip-premium" style="padding: 25px 0">
  182. <span class="cdp-manager-btns cdp-green cdp-hover cdp-pointer cdp-f-w-light cdp-f-s-16" style="padding-right: 33px;"><?php _e('+ Add / manage / import / export settings', 'copy-delete-posts'); ?></span>
  183. <span class="cdp-premium-icon cdp-big-icon" style="right: 3px;"></span>
  184. </span>
  185. </div>
  186. </div>
  187. </div>
  188. <div class="cdp-collapsibles" style="padding-top: 5px;">
  189. <!-- SETTINGS PROFILE SECTION -->
  190. <div class="cdp-collapsible" data-cdp-group="mains">
  191. <div class="cdp-collapsible-title">
  192. <div class="cdp-cf">
  193. <div class="cdp-left cdp-ff-b1"><?php _e('Which <b class="cdp-ff-b4">elements</b> shall be copied?', 'copy-delete-posts'); ?></div>
  194. <div class="cdp-right"><i class="cdp-arrow cdp-arrow-left"></i></div>
  195. </div>
  196. </div>
  197. <div class="cdp-collapsible-content cdp-nm cdp-np">
  198. <div style="overflow-x: auto; max-width: 100%;">
  199. <table class="cdp-table">
  200. <thead class="cdp-thead cdp-f-s-18">
  201. <tr>
  202. <th></th>
  203. <th><?php _e('<b>If checked</b> copies will...', 'copy-delete-posts'); ?></th>
  204. <th><?php _e('<b>If <u class="cdp-f-w-bold">un</u>checked</b> copies will...', 'copy-delete-posts'); ?></th>
  205. </tr>
  206. </thead>
  207. <tbody class="cdp-ff-b1 cdp-f-s-18 cdp-tbody-of-settings">
  208. <tr>
  209. <td><label class="cdp-relative"><input <?php echo $defaults['title']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="title" type="checkbox" /><span><?php _e('Title', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  210. <td><?php _e('…get the title as defined in the <a href="#" class="cdp-go-to-names-chapter"><span class="cdp-green">next section</span></a>.', 'copy-delete-posts'); ?></td>
  211. <td><?php _e('…be titled “Untitled”.', 'copy-delete-posts'); ?></td>
  212. </tr>
  213. <tr>
  214. <td><label class="cdp-relative"><input <?php echo $defaults['date']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="date" type="checkbox" /><span><?php _e('Date', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  215. <td><?php _e('…get the same creation date & time as the original.', 'copy-delete-posts'); ?></td>
  216. <td><?php _e('…get the date & time at time of copying. ', 'copy-delete-posts'); ?></td>
  217. </tr>
  218. <tr>
  219. <td><label class="cdp-relative"><input <?php echo $defaults['status']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="status" type="checkbox" /><span><?php _e('Status', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  220. <td><?php _e('…get status of original article (which can be “published” or “deleted” etc.)', 'copy-delete-posts'); ?></td>
  221. <td><?php _e('…get the status “Draft”.', 'copy-delete-posts'); ?></td>
  222. </tr>
  223. <tr>
  224. <td><label class="cdp-relative"><input <?php echo $defaults['slug']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="slug" type="checkbox" /><span><?php _e('Slug', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  225. <td><?php _e('…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).', 'copy-delete-posts'); ?></td>
  226. <td><?php _e('…get a blank slug, unless the page is published, then it will generate it automatically.', 'copy-delete-posts'); ?></td>
  227. </tr>
  228. <tr>
  229. <td><label class="cdp-relative"><input <?php echo $defaults['excerpt']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="excerpt" type="checkbox" /><span><?php _e('Excerpt', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  230. <td><?php _e('…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).', 'copy-delete-posts'); ?></td>
  231. <td><?php _e('…get an empty <i>custom</i> excerpt (and default to taking the first 55 words of the post).', 'copy-delete-posts'); ?></td>
  232. </tr>
  233. <tr>
  234. <td><label class="cdp-relative"><input <?php echo $defaults['content']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="content" type="checkbox" /><span><?php _e('Content', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  235. <td><?php _e('…get all the content (text, images, videos and other elements/blocks) from the original.', 'copy-delete-posts'); ?></td>
  236. <td><?php _e('…get no content (be completely blank).', 'copy-delete-posts'); ?></td>
  237. </tr>
  238. <tr>
  239. <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><?php _e('Featured image', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  240. <td><?php _e('…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.', 'copy-delete-posts'); ?></td>
  241. <td><?php _e('…get no featured image.', 'copy-delete-posts'); ?></td>
  242. </tr>
  243. <tr>
  244. <td><label class="cdp-relative"><input <?php echo $defaults['template']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="template" type="checkbox" /><span><?php _e('Template', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  245. <td><?php _e('…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.', 'copy-delete-posts'); ?></td>
  246. <td><?php _e('…get the default page template.', 'copy-delete-posts'); ?></td>
  247. </tr>
  248. <tr>
  249. <td><label class="cdp-relative"><input <?php echo $defaults['format']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="format" type="checkbox" /><span><?php _e('Format', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  250. <td><?php _e('…get the same <a href="https://wordpress.org/support/article/post-formats/" target="_blank"><span class="cdp-green">post format</span></a> as original.', 'copy-delete-posts'); ?></td>
  251. <td><?php _e('…get the standard post format.', 'copy-delete-posts'); ?></td>
  252. </tr>
  253. <tr>
  254. <td><label class="cdp-relative"><input <?php echo $defaults['author']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="author" type="checkbox" /><span><?php _e('Author', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  255. <td><?php _e('…get the same author as original.', 'copy-delete-posts'); ?></td>
  256. <td><?php _e('…get the user that is duplicating as an author.', 'copy-delete-posts'); ?></td>
  257. </tr>
  258. <tr>
  259. <td><label class="cdp-relative"><input <?php echo $defaults['password']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="password" type="checkbox" /><span><?php _e('Password', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  260. <td><?php _e('…get the same <a href="https://wordpress.org/support/article/using-password-protection/" target="_blank"><span class="cdp-green">password</span></a> as original.', 'copy-delete-posts'); ?></td>
  261. <td><?php _e('…get no password.', 'copy-delete-posts'); ?></td>
  262. </tr>
  263. <tr>
  264. <td><label class="cdp-relative"><input <?php echo $defaults['attachments']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="attachments" type="checkbox" /><span><?php _e('Attachments', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  265. <td><?php _e('…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>', 'copy-delete-posts'); ?></td>
  266. <td><?php _e('…get existing attachments from the original.', 'copy-delete-posts'); ?></td>
  267. </tr>
  268. <tr>
  269. <td><label class="cdp-relative"><input <?php echo $defaults['children']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="children" type="checkbox" /><span><?php _e('Children', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  270. <td><?php _e('…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).', 'copy-delete-posts'); ?></td>
  271. <td><?php _e('…not get their child pages copied along (if the page is a parent).', 'copy-delete-posts'); ?></td>
  272. </tr>
  273. <tr>
  274. <td><label class="cdp-relative"><input <?php echo $defaults['comments']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="comments" type="checkbox" /><span><?php _e('Comments', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  275. <td><?php _e('…get all comments from the original.', 'copy-delete-posts'); ?></td>
  276. <td><?php _e('…get no comments from the original.', 'copy-delete-posts'); ?></td>
  277. </tr>
  278. <tr>
  279. <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><?php _e('Menu order', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  280. <td><?php _e('…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.', 'copy-delete-posts'); ?></td>
  281. <td><?php _e('…get the menu order set to default (0).', 'copy-delete-posts'); ?></td>
  282. </tr>
  283. <tr>
  284. <td><label class="cdp-relative"><input <?php echo $defaults['category']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="category" type="checkbox" /><span><?php _e('Categories', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  285. <td><?php _e('…get all categories from the original post.', 'copy-delete-posts'); ?></td>
  286. <td><?php _e('…be Uncategorized, no categories will be copied.', 'copy-delete-posts'); ?></td>
  287. </tr>
  288. <tr>
  289. <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><?php _e('Tags', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  290. <td><?php _e('…get all tags of the original post.', 'copy-delete-posts'); ?></td>
  291. <td><?php _e('…be without any tags.', 'copy-delete-posts'); ?></td>
  292. </tr>
  293. <tr>
  294. <td><label class="cdp-relative"><input <?php echo $defaults['taxonomy']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="taxonomy" type="checkbox" /><span><?php _e('Taxonomies', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  295. <td><?php _e('…get all custom taxonomy from the original.', 'copy-delete-posts'); ?></td>
  296. <td><?php _e('…be without custom taxonomy.', 'copy-delete-posts'); ?></td>
  297. </tr>
  298. <tr>
  299. <td>
  300. <label>
  301. <div class="cdp-cf">
  302. <div class="cdp-left">
  303. <input <?php echo $defaults['nav_menu']=='true'?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="nav_menu" type="checkbox" />
  304. </div>
  305. <div class="cdp-left cdp-relative" style="width: calc(100% - 45px)">
  306. <span><?php _e('Navigation Menus', 'copy-delete-posts'); ?> <span class="cdp-info-icon" style="top: calc(50% + 4px) !important;"></span> </span>
  307. </div>
  308. </div>
  309. </label>
  310. </td>
  311. <td><?php _e('…get this private taxonomy from the original.', 'copy-delete-posts'); ?></td>
  312. <td><?php _e('…be without private taxonomy.', 'copy-delete-posts'); ?></td>
  313. </tr>
  314. <tr>
  315. <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><?php _e('Link categories', 'copy-delete-posts'); ?> <span class="cdp-info-icon"></span></span></label></td>
  316. <td><?php _e('…get this private taxonomy from the original.', 'copy-delete-posts'); ?></td>
  317. <td><?php _e('…be without private taxonomy.', 'copy-delete-posts'); ?></td>
  318. </tr>
  319. <?php if (false): ?>
  320. <tr>
  321. <td class="cdp-tooltip-premium">
  322. <label>
  323. <div class="cdp-cf">
  324. <div class="cdp-left">
  325. <input <?php echo (array_key_exists('all_metadata', $defaults) && $defaults['all_metadata']=='true' && $areWePro == true)?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="all_metadata" type="checkbox" />
  326. </div>
  327. <div class="cdp-left cdp-relative" style="width: calc(100% - 45px)">
  328. <span><?php _e('Other Plugin Settings', 'copy-delete-posts'); ?><span class="cdp-premium-icon cdp-big-icon" style="top: calc(50% + 2px) !important;"></span> </span>
  329. </div>
  330. </div>
  331. </label>
  332. </td>
  333. <td><?php _e('…clone all metadata tags assigned to post/page.', 'copy-delete-posts'); ?></td>
  334. <td><?php _e('…copy only required post/page metadata.', 'copy-delete-posts'); ?></td>
  335. </tr>
  336. <?php endif; ?>
  337. <tr<?php echo (!$isWoo)?' style="display: none;"':'' ?>>
  338. <td class="cdp-tooltip-premium">
  339. <label>
  340. <div class="cdp-cf">
  341. <div class="cdp-left">
  342. <input <?php echo (array_key_exists('woo', $defaults) && $defaults['woo']=='true' && $areWePro == true)?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="woo" type="checkbox" />
  343. </div>
  344. <div class="cdp-left cdp-relative" style="width: calc(100% - 45px)">
  345. <span><?php _e('WooCommerce Settings', 'copy-delete-posts'); ?><span class="cdp-premium-icon cdp-big-icon" style="top: calc(50% + 2px) !important;"></span> </span>
  346. </div>
  347. </div>
  348. </label>
  349. </td>
  350. <td><?php _e('…the same settings from the <a href="https://wordpress.org/plugins/woocommerce/" target="_blank"><span class="cdp-green">WooCommerce plugin</span></a> as the original.', 'copy-delete-posts'); ?></td>
  351. <td><?php _e('…get empty settings.', 'copy-delete-posts'); ?></td>
  352. </tr>
  353. <tr<?php echo (!$isUSM)?' style="display: none;"':'' ?>>
  354. <td class="cdp-tooltip-premium">
  355. <label>
  356. <div class="cdp-cf">
  357. <div class="cdp-left">
  358. <input <?php echo ($defaults['usmplugin']=='true' && $areWePro == true)?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="usmplugin" type="checkbox" />
  359. </div>
  360. <div class="cdp-left cdp-relative" style="width: calc(100% - 45px)">
  361. <span><?php _e('Ultimate Social Media Settings', 'copy-delete-posts'); ?><span class="cdp-premium-icon cdp-big-icon" style="top: calc(50% + 2px) !important;"></span> </span>
  362. </div>
  363. </div>
  364. </label>
  365. </td>
  366. <td><?php _e('…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.', 'copy-delete-posts'); ?></td>
  367. <td><?php _e('…get empty settings.', 'copy-delete-posts'); ?></td>
  368. </tr>
  369. <tr<?php echo (!$isYoast)?' style="display: none;"':'' ?>>
  370. <td class="cdp-tooltip-premium">
  371. <label>
  372. <div class="cdp-cf">
  373. <div class="cdp-left">
  374. <input <?php echo ($defaults['yoast']=='true' && $areWePro == true)?'checked ':''; ?>class="cdp-data-set" data-cdp-opt="yoast" type="checkbox" />
  375. </div>
  376. <div class="cdp-left cdp-relative" style="width: calc(100% - 45px)">
  377. <span><?php _e('Yoast SEO Settings', 'copy-delete-posts'); ?> <span class="cdp-premium-icon cdp-big-icon" style="top: calc(50% + 2px) !important;"></span> </span>
  378. </div>
  379. </div>
  380. </label>
  381. </td>
  382. <td><?php _e('…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.', 'copy-delete-posts'); ?></td>
  383. <td><?php _e('…get empty settings.', 'copy-delete-posts'); ?></td>
  384. </tr>
  385. </tbody>
  386. </table>
  387. <div class="cdp-pad-lin cdp-gray cdp-f-s-18 cdp-lh-24 cdp-center" style="padding-top: 40px; padding-bottom: 20px;">
  388. <i><?php _e('Do you know anything else you want to have copied (e.g. data added by a different plugin)? <br />
  389. 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! :) ', 'copy-delete-posts'); ?></i>
  390. </div>
  391. <div class="cdp-center cdp-padding cdp-p-35-b">
  392. <button class="cdp-button cdp-save-options"><?php _e('Save', 'copy-delete-posts'); ?></button>
  393. <div class="cdp-padding cdp-f-s-17">
  394. <a href="#" class="cdp-close-chapter"><?php _e('Close section', 'copy-delete-posts'); ?></a>
  395. </div>
  396. </div>
  397. </div>
  398. </div>
  399. </div>
  400. <!-- OTHER SETTINGS PROFILE SECTION -->
  401. <div class="cdp-collapsible" data-cdp-group="mains">
  402. <div class="cdp-collapsible-title cdp-name-section-cnx">
  403. <div class="cdp-cf">
  404. <div class="cdp-left cdp-ff-b1"><?php _e('What <b class="cdp-ff-b4">name(s)</b> should the copies have?', 'copy-delete-posts'); ?></div>
  405. <div class="cdp-right"><i class="cdp-arrow cdp-arrow-left"></i></div>
  406. </div>
  407. </div>
  408. <div class="cdp-collapsible-content cdp-np cdp-drags-cont">
  409. <div class="cdp-pad-lin cdp-f-s-18 cdp-f-w-light">
  410. <?php _e('Build your preferred naming logic for the copies:', 'copy-delete-posts'); ?>
  411. </div>
  412. <div class="cdp-green-bg cdp-pad-lin" style="padding-bottom: 20px;">
  413. <div class="cdp-cf cdp-center">
  414. <div class="cdp-left cdp-names-input cdp-f-s-16"><?php _e('Prefix', 'copy-delete-posts'); ?></div>
  415. <div class="cdp-left cdp-names-divider cdp-nlh"></div>
  416. <div class="cdp-left cdp-names-input cdp-f-s-16"><?php _e('Suffix', 'copy-delete-posts'); ?></div>
  417. </div>
  418. <div class="cdp-cf cdp-center">
  419. <div class="cdp-left cdp-names-input">
  420. <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">
  421. <?php echo (isset($defaults['names']) && isset($defaults['names']['prefix']))?$defaults['names']['prefix']:''; ?>
  422. </div>
  423. </div>
  424. <div class="cdp-left cdp-names-divider cdp-f-s-19 cdp-f-w-light">
  425. <span class="cdp-tooltip-top cdp-togglable-name-b" title="<?php _e('Change to blank', 'copy-delete-posts'); ?>"><?php _e('(Name of original)', 'copy-delete-posts'); ?></span>
  426. </div>
  427. <div class="cdp-left cdp-names-input">
  428. <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">
  429. <?php echo (isset($defaults['names']) && isset($defaults['names']['suffix']))?$defaults['names']['suffix']:''; ?>
  430. </div>
  431. </div>
  432. </div>
  433. <div class="cdp-curr-cont">
  434. <span class="cdp-f-s-18"><?php _e('Example based on current selections:', 'copy-delete-posts'); ?></span>
  435. <span class="cdp-f-s-16 cdp-padding-10-h">
  436. <span class="cdp-example-name cdp-f-w-bold"><?php _e('(Name of original)', 'copy-delete-posts'); ?></span>
  437. </span>
  438. </div>
  439. </div>
  440. <div class="cdp-pad-lin cdp-f-s-18">
  441. <div class="cdp-padding-23-h"><?php _e('Drag & drop the automatic elements into the Prefix/Suffix fields to add them.', 'copy-delete-posts'); ?></div>
  442. <div class="">
  443. <div class="cdp-cf cdp-padding-10-h">
  444. <div class="cdp-left">
  445. <div class="cdp-name-box cdp-drag-name cdp-name-clickable" oncontextmenu="return false;" data-cdp-val="0"><?php _e('Counter', 'copy-delete-posts'); ?></div>
  446. </div>
  447. <div class="cdp-left cdp-names-text-info"><?php _e('Adds an <b class="cdp-f-w-semi-bold">incremental counter</b> (starting with “2”)', 'copy-delete-posts'); ?></div>
  448. </div>
  449. <div class="cdp-cf cdp-padding-10-h">
  450. <div class="cdp-left" style="margin-top: 6px;">
  451. <div class="cdp-name-box cdp-drag-name cdp-name-clickable" oncontextmenu="return false;" data-cdp-val="2"><?php _e('CurrentDate', 'copy-delete-posts'); ?></div>
  452. </div>
  453. <div class="cdp-left cdp-names-text-info">
  454. <div class="cdp-cf" style="line-height: 49px !important;">
  455. <div class="cdp-left">
  456. <?php _e('Adds the <b class="cdp-f-w-semi-bold">current date</b> in', 'copy-delete-posts'); ?>
  457. </div>
  458. <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">
  459. <option value="1"<?php echo ($names_format == 1 || $names_format == false || (!$areWePro && $names_format == 3))?' selected':''; ?>><?php _e('mm/dd/yyyy', 'copy-delete-posts'); ?></option>
  460. <option value="2"<?php echo ($names_format == 2)?' selected':''; ?>><?php _e('dd/mm/yyyy', 'copy-delete-posts'); ?></option>
  461. <option value="3"<?php echo (($areWePro && $names_format == 3)?' selected':''); ?>><?php _e('Custom', 'copy-delete-posts'); ?></option>
  462. </select>
  463. <?php if ($areWePro && function_exists('cdpp_custom_date')) cdpp_custom_date($names_format, $defaults); ?>
  464. <div class="cdp-left" style="padding-left: 15px;"><?php _e('format.', 'copy-delete-posts'); ?></div>
  465. </div>
  466. <?php if ($areWePro && function_exists('cdpp_custom_date_info')) cdpp_custom_date_info(); ?>
  467. </div>
  468. </div>
  469. <div class="cdp-cf cdp-padding-10-h" style="padding-bottom: 0; margin-top: 6px;">
  470. <div class="cdp-left">
  471. <div class="cdp-name-box cdp-drag-name cdp-name-clickable" oncontextmenu="return false;" data-cdp-val="1"><?php _e('CurrentTime', 'copy-delete-posts'); ?></div>
  472. </div>
  473. <div class="cdp-left cdp-names-text-info"><?php _e('Adds the <b class="cdp-f-w-semi-bold">current time</b> in hh:mm:ss format', 'copy-delete-posts'); ?></div>
  474. </div>
  475. </div>
  476. <div class="cdp-padding-23-h">
  477. <p class="cdp-f-s-18"><?php _e('You can also type tailored text into the fields above.', 'copy-delete-posts'); ?></p>
  478. <p class="cdp-f-s-18"><?php _e('If you’re not of the drag & droppy-type, you can also enter shortcodes [Counter], [CurrentDate] and [CurrentTime].', 'copy-delete-posts'); ?></p>
  479. <p class="cdp-f-s-18"><?php _e('If you make multiple copies in one go, use the Counter-option as otherwise some copies will have the same name.', 'copy-delete-posts'); ?></p>
  480. </div>
  481. <div class="cdp-center">
  482. <button class="cdp-button cdp-save-options"><?php _e('Save', 'copy-delete-posts'); ?></button>
  483. <div class="cdp-padding cdp-f-s-17">
  484. <a href="#" class="cdp-close-chapter"><?php _e('Close section', 'copy-delete-posts'); ?></a>
  485. </div>
  486. </div>
  487. </div>
  488. </div>
  489. </div>
  490. <!-- GLOBAL SECTION -->
  491. <div class="cdp-collapsible" data-cdp-group="mains">
  492. <div class="cdp-collapsible-title">
  493. <div class="cdp-cf">
  494. <div class="cdp-left cdp-ff-b1"><?php _e('<b class="cdp-ff-b4">Other</b> options', 'copy-delete-posts'); ?></div>
  495. <div class="cdp-right"><i class="cdp-arrow cdp-arrow-left"></i></div>
  496. </div>
  497. </div>
  498. <div class="cdp-collapsible-content cdp-oth-section cdp-np cdp-special-cb-p">
  499. <div class="cdp-pad-lin">
  500. <div><h2 class="cdp-f-s-18"><b class="cdp-f-w-bold"><?php _e('Navigation after copying', 'copy-delete-posts'); ?></b></h2></div>
  501. <div class="cdp-padding-15-h">
  502. <div class="cdp-con-cen">
  503. <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">
  504. <option value="1"<?php echo ($after_copy == '1' || $after_copy == false)?' selected':''; ?>><?php _e('Leave me where I was', 'copy-delete-posts'); ?></option>
  505. <option value="2"<?php echo ($after_copy == '2')?' selected':''; ?>><?php _e('Take me to the edit-page of the created copy', 'copy-delete-posts'); ?></option>
  506. <option value="3"<?php echo ($after_copy == '3')?' selected':''; ?>><?php _e('Decide on a case-by-case basis (adds new button on copy screen)', 'copy-delete-posts'); ?></option>
  507. </select>
  508. </div>
  509. <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;"><?php _e('If you created multiple copies in one go, you’ll be taken to the first copy.', 'copy-delete-posts'); ?> </div>
  510. </div>
  511. <div>
  512. <h2>
  513. <b class="cdp-relative cdp-f-s-18 cdp-f-w-bold cdp-tooltip-premium" data-top="5" style="padding-right: 30px;"><?php _e('Pages vs. Posts converter', 'copy-delete-posts'); ?> <span class="cdp-premium-icon cdp-big-icon"></span></b>
  514. </h2>
  515. </div>
  516. <div class="cdp-f-s-18 cdp-f-w-light">
  517. <p class="cdp-f-s-18 cdp-f-w-light"><?php _e('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.', 'copy-delete-posts'); ?></p>
  518. <p class="cdp-padding-15-h cdp-f-s-18 cdp-f-w-light"><?php _e('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.', 'copy-delete-posts'); ?></p>
  519. <p class="cdp-f-s-18 cdp-f-w-light"><?php _e('However, if you want it as a <b class="cdp-f-w-bold">default setting option</b>, then please select it below: ', 'copy-delete-posts'); ?></p>
  520. </div>
  521. <div class="cdp-con-cen">
  522. <div class="cdp-tooltip-premium" style="width: 663px; margin: 0 auto; height: 60px;" data-top="-10">
  523. <select class="cdp-other-options cdp-select cdp-select-centered cdp-sel-separat cdp-select-large cdp-c-x-a-v" name="post_converter">
  524. <option value="1"<?php echo ($post_converter == '1' || $post_converter == false)?' selected':''; ?>><?php _e('Copies will be the same type as the original', 'copy-delete-posts'); ?></option>
  525. <option value="2"<?php echo ($post_converter == '2')?' selected':''; ?>><?php _e('ALWAYS change the type when copied (posts will become pages, pages will become posts)', 'copy-delete-posts'); ?></option>
  526. </select>
  527. </div>
  528. </div>
  529. <div class=""><h2><b class="cdp-f-s-18 cdp-f-w-bold"><?php _e('User level permissions', 'copy-delete-posts'); ?></b></h2></div>
  530. <div class="cdp-f-s-18 cdp-p-15-25 cdp-f-w-light"><?php _e('Which user role(s) should be able to copy & delete? <i style="color: gray">– The role also must have access to the dashboard.</i>', 'copy-delete-posts'); ?></div>
  531. <div class="cdp-p-25-40 cdp-f-s-18 cdp-f-w-light">
  532. <?php
  533. $isSaved = false;
  534. if (isset($globals)) $isSaved = true;
  535. foreach ($roles as $role => $value) {
  536. $checked = '';
  537. $rn = sanitize_text_field($role);
  538. $role = sanitize_text_field($value['name']);
  539. $d = ($role == 'Administrator')?' disabled checked="checked"':'';
  540. if ($isSaved && $role != 'Administrator')
  541. if (isset($globals['roles'][$rn]) && $globals['roles'][$rn] == 'true')
  542. $checked = ' checked';
  543. echo('<label for="cdp-roles-'.$rn.'"><input class="cdp-other-roles" id="cdp-roles-'.$rn.'"'.$checked.' type="checkbox"'.$d.' name="'.$rn.'">'.$role.'</label>');
  544. }
  545. ?>
  546. </div>
  547. <div class=""><h2><b class="cdp-f-s-18 cdp-f-w-bold"><?php _e('Content types which can be copied', 'copy-delete-posts'); ?></b></h2></div>
  548. <div class="cdp-p-25-40 cdp-f-s-18 cdp-f-w-light">
  549. <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"><?php _e('Pages', 'copy-delete-posts'); ?></label>
  550. <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"><?php _e('Posts', 'copy-delete-posts'); ?></label>
  551. <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"><?php _e('Custom posts types', 'copy-delete-posts'); ?></label>
  552. </div>
  553. <div class=""><h2><b class="cdp-f-s-18 cdp-f-w-bold"><?php _e('Display copy option on...', 'copy-delete-posts'); ?></b></h2></div>
  554. <div class="cdp-p-25-40 cdp-f-s-18 cdp-f-w-light">
  555. <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"><?php _e('Posts/pages lists', 'copy-delete-posts'); ?></label>
  556. <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"><?php _e('Edit screens', 'copy-delete-posts'); ?></label>
  557. <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"><?php _e('Admin bar', 'copy-delete-posts'); ?></label>
  558. <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"><?php _e('Bulk actions menu', 'copy-delete-posts'); ?></label>
  559. <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"><?php _e('Gutenberg editor', 'copy-delete-posts'); ?></label>
  560. </div>
  561. <div class=""><h2><b class="cdp-f-s-18 cdp-f-w-bold"><?php _e('Show reference to original item?', 'copy-delete-posts'); ?></b></h2></div>
  562. <div class="cdp-f-s-18 cdp-f-w-light cdp-p-15-25"><?php _e('If checked, you will see a reference to the original post/page (on the copied version).', 'copy-delete-posts'); ?></div>
  563. <div class="cdp-p-25-40 cdp-f-s-18 cdp-f-w-light">
  564. <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"><?php _e('Posts/pages lists', 'copy-delete-posts'); ?></label>
  565. <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"><?php _e('Edit screens', 'copy-delete-posts'); ?></label>
  566. </div>
  567. <div><h2><b class="cdp-f-s-18 cdp-f-w-bold"><?php _e('Additional features', 'copy-delete-posts'); ?></b></h2></div>
  568. <div class="cdp-p-25-40 cdp-f-s-18 cdp-f-w-light">
  569. <label for="cdp-o-premium-hide-tooltip">
  570. <?php if (!isset($gos['cdp-premium-hide-tooltip'])) $gos['cdp-premium-hide-tooltip'] = false; ?>
  571. <input id="cdp-o-premium-hide-tooltip"<?php echo ((!$areWePro)?' disabled="true"':''); ?> <?php echo ($areWePro && $gos['cdp-premium-hide-tooltip'] == 'true')?'checked ':''; ?> type="checkbox" class="cdp-other-inputs" name="cdp-premium-hide-tooltip" />
  572. <span class="cdp-relative cdp-tooltip-premium" data-top="5"><?php _e('Hide copy tooltip on hover and only show the button', 'copy-delete-posts'); ?> <span class="cdp-premium-icon cdp-big-icon" style="right: -30px"></span></span>
  573. </label>
  574. <label for="cdp-o-premium-import">
  575. <?php if (!isset($gos['cdp-premium-import'])) $gos['cdp-premium-import'] = false; ?>
  576. <input id="cdp-o-premium-import"<?php echo ((!$areWePro)?' disabled="true"':''); ?> <?php echo ($areWePro && $gos['cdp-premium-import'] == 'true')?'checked ':''; ?> type="checkbox" class="cdp-other-inputs" name="cdp-premium-import" />
  577. <span class="cdp-relative cdp-tooltip-premium" data-top="5"><?php _e('Show post export & import buttons', 'copy-delete-posts'); ?> <span class="cdp-premium-icon cdp-big-icon" style="right: -30px"></span></span>
  578. </label>
  579. <label for="cdp-o-menu-in-settings">
  580. <input <?php echo (isset($gos['cdp-menu-in-settings']) && $gos['cdp-menu-in-settings'] == 'true')?'checked ':''; ?>id="cdp-o-menu-in-settings" type="checkbox" class="cdp-other-inputs" name="cdp-menu-in-settings">
  581. <?php _e('Hide Copy & Delete Posts Menu under <b>Tools</b> dropdown', 'copy-delete-posts'); ?>
  582. </label>
  583. </div>
  584. <div class="cdp-center cdp-padding-15-h">
  585. <button class="cdp-button cdp-save-options"><?php _e('Save', 'copy-delete-posts'); ?></button>
  586. <div class="cdp-padding cdp-f-s-17">
  587. <a href="#" class="cdp-close-chapter"><?php _e('Close section', 'copy-delete-posts'); ?></a>
  588. </div>
  589. </div>
  590. </div>
  591. </div>
  592. </div>
  593. <div class="cdp-f-s-20 cdp-p-hh">
  594. <?php _e('...and after your copy frenzy, you may need to…', 'copy-delete-posts'); ?>
  595. </div>
  596. <!-- DELETE SECTION -->
  597. <div class="cdp-collapsible" data-cdp-group="mains">
  598. <div class="cdp-d-xclicked cdp-collapsible-title">
  599. <div class="cdp-cf">
  600. <div class="cdp-left cdp-ff-b1"><b class="cdp-ff-b4"><?php _e('Delete duplicate posts/pages', 'copy-delete-posts'); ?></b></div>
  601. <div class="cdp-right"><i class="cdp-arrow cdp-arrow-left"></i></div>
  602. </div>
  603. </div>
  604. <div class="cdp-collapsible-content cdp-d-section cdp-np">
  605. <div class="cdp-padding">
  606. <div class="cdp-backup-alert cdp-f-s-20 cdp-f-w-light">
  607. <?php _e('Before you delete anything here (which cannot be undone!) we <b class="cdp-f-w-bold">strongly suggest</b><br />
  608. that you create a backup, for example with <a href="https://wordpress.org/plugins/wp-clone-by-wp-academy/" target="_blank">this plugin</a>', 'copy-delete-posts'); ?>
  609. </div>
  610. <div class="cdp-cf cdp-tab-list">
  611. <div class="cdp-left cdp-tab-element cdp-tab-active" data-box="cdp-tabox-manual">
  612. <span><?php _e('Manual Cleanup', 'copy-delete-posts'); ?></span>
  613. </div>
  614. <div class="cdp-left cdp-tab-element cdp-tooltip-premium" data-top="-4" data-box="cdp-tabox-automatic"<?php echo ((!$areWePro)?' data-disabled="true"':''); ?>>
  615. <span class="cdp-relative"><?php _e('Automatic Cleanup', 'copy-delete-posts'); ?> <span class="cdp-premium-icon cdp-big-icon"></span></span>
  616. </div>
  617. <div class="cdp-left cdp-tab-element" data-box="cdp-tabox-redirects">
  618. <span class="cdp-relative"><?php _e('Redirection', 'copy-delete-posts'); ?> <span class="cdp-premium-icon cdp-big-icon"></span></span>
  619. </div>
  620. </div>
  621. <div class="cdp-cont-d-box-tabed" id="cdp-tabox-redirects">
  622. <?php if ($areWePro && function_exists('cdpp_automated_redirects')) { ?>
  623. <?php cdpp_automated_redirects($cdp_plug_url); ?>
  624. <?php } else { ?>
  625. <div class="cdp-con-cen">
  626. <div class="cdp-center cdp-padding" style="padding-top: 50px; padding-bottom: 30px;">
  627. <img src="<?php echo $cdp_plug_url; ?>/assets/imgs/redirections.png" alt="">
  628. </div>
  629. <div class="cdp-lh-24 cdp-black-all" style="max-width: 82%; margin: 0 auto;">
  630. <div class="cdp-f-s-19 cdp-f-w-regular cdp-padding">
  631. <?php _e('As part of the <span class="cdp-green">premium plugin</span> you can enable redirects, so that the URLs of your deleted posts/pages automatically take visitors to the version which you decided to keep.', 'copy-delete-posts'); ?>
  632. </div>
  633. <div class="cdp-f-s-19 cdp-f-w-regular cdp-padding">
  634. <?php _e('This isn’t just good for your visitors, but also for SEO: the “link juice” from your old (deleted) articles will be forwarded to the versions you keep, helping you to rank higher in search engines.', 'copy-delete-posts'); ?>
  635. </div>
  636. <div class="cdp-f-s-19 cdp-f-w-regular cdp-padding">
  637. <?php _e('And: you can also use this feature for any other redirections you may need
  638. (not only redirects from deleted posts/pages)!', 'copy-delete-posts'); ?>
  639. </div>
  640. </div>
  641. <br />
  642. <div class="cdp-center cdp-padding-15-h" style="padding-bottom: 60px;">
  643. <a href="https://sellcodes.com/CylMIdJD" target="_blank">
  644. <button class="cdp-button cdp-f-s-21 cdp-f-w-medium" style="width: 465px; height: 70px; border-radius: 35px;"><?php _e('Go premium now', 'copy-delete-posts'); ?></button>
  645. </a>
  646. </div>
  647. </div>
  648. <?php } ?>
  649. </div>
  650. <div class="cdp-cont-d-box-tabed" id="cdp-tabox-automatic">
  651. <?php if ($areWePro && function_exists('cdpp_automated_deletion')) { ?>
  652. <?php cdpp_automated_deletion($cdp_plug_url); ?>
  653. <?php } ?>
  654. </div>
  655. <div class="cdp-cont-d-box-tabed" id="cdp-tabox-manual">
  656. <!-- ABOVE DELETION TABLE -->
  657. <div class="cdp-d-pad-sp" style="padding-top: 20px">
  658. <div class="cdp-special-cb-p">
  659. <div class="cdp-d-header cdp-f-s-19">
  660. <?php _e('Scan for duplicates in...', 'copy-delete-posts'); ?>
  661. </div>
  662. <div class="cdp-p-25-40 cdp-f-s-18">
  663. <label><input type="checkbox" name="cdp-d-a-posts" checked class="cdp-d-option cdp-d-first-chapter-cb" /><?php _e('Posts', 'copy-delete-posts'); ?></label>
  664. <label><input type="checkbox" name="cdp-d-a-pages" checked class="cdp-d-option cdp-d-first-chapter-cb" /><?php _e('Pages', 'copy-delete-posts'); ?></label>
  665. <label><input type="checkbox" name="cdp-d-a-customs" checked class="cdp-d-option cdp-d-first-chapter-cb" /><?php _e('Custom posts', 'copy-delete-posts'); ?></label>
  666. </div>
  667. </div>
  668. <div class="cdp-special-cb-p">
  669. <div class="cdp-d-header cdp-f-s-19">
  670. <?php _e('Count them as duplicates if they are identical with respect to <u class="cdp-f-w-bold">all</u> of the below...', 'copy-delete-posts'); ?>
  671. </div>
  672. <div>
  673. <div class="cdp-p-25-t cdp-cf">
  674. <div class="cdp-left cdp-f-s-18">
  675. <label style="margin-right: 5px;"><input type="checkbox" checked name="cdp-d-b-title" class="cdp-d-option"/><?php _e('Title', 'copy-delete-posts'); ?></label>
  676. </div>
  677. <div class="cdp-left" style="margin-top: 1px; margin-left: 5px; font-size: 13px;">
  678. <a href="#" class="cdp-show-more-d-title cdp-f-s-16" style="line-height: 43px;"><?php _e('(show more options)', 'copy-delete-posts'); ?></a>
  679. </div>
  680. <div class="cdp-left cdp-f-s-18" style="margin-left: 50px;">
  681. <label><input type="checkbox" name="cdp-d-b-slug" class="cdp-d-option" /><?php _e('Similar slug', 'copy-delete-posts'); ?> <span class="cdp-tooltip-top" title="<?php _e('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).', 'copy-delete-posts'); ?>">(x ≥ 85%)</span></label>
  682. </div>
  683. </div>
  684. <div class="cdp-p-20-h cdp-more-d-title" style="display: none; padding-left: 37px;">
  685. <div class="cdp-f-s-17 cdp-p-20-b cdp-lh-24">
  686. <?php _e('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?', 'copy-delete-posts'); ?>
  687. </div>
  688. <div class="cdp-cf">
  689. <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><?php _e('No', 'copy-delete-posts'); ?></label>
  690. <label class="cdp-left cdp-f-s-18"><input type="radio" class="cdp-d-option cdp-radio" value="1" name="cdp-radio-btn-dtitles"><?php _e('Yes', 'copy-delete-posts'); ?></label>
  691. <span class="cdp-green cdp-f-s-17 cdp-tooltip-top cdp-left" title="<?php _e('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 section</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.', 'copy-delete-posts'); ?>" style="line-height: 44px;"><?php _e('When does “yes” make sense here?', 'copy-delete-posts'); ?></span>
  692. </div>
  693. </div>
  694. <!-- <div class="cdp-padding-15-h cdp-f-s-18">
  695. </div> -->
  696. <div class="cdp-cf cdp-p-40-b">
  697. <label class="cdp-left cdp-f-s-18" style="margin-right: 21px;">
  698. <input type="checkbox" name="cdp-d-c-excerpt" class="cdp-d-option" /><?php _e('Excerpt (<span class="cdp-no-empty-text"><b>including</b> empty</span>)', 'copy-delete-posts'); ?>
  699. </label>
  700. <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"/><?php _e('Word count', 'copy-delete-posts'); ?></label>
  701. <div class="cdp-left cdp-f-s-17" style="line-height: 43px;">
  702. <?php _e('...need others? <a href="mailto:hi@copy-delete-posts.com" target="_blank">Suggest them!</a>', 'copy-delete-posts'); ?>
  703. </div>
  704. </div>
  705. </div>
  706. <div class="cdp-d-option-select-parent cdp-padding-15-h cdp-center cdp-ntp">
  707. <div class="cdp-inline cdp-cf">
  708. <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">
  709. <option value="1"><?php _e('Only count pages/posts of the same type as duplicates', 'copy-delete-posts'); ?></option>
  710. <option value="2"><?php _e('Also count pages/posts of different types as duplicates', 'copy-delete-posts'); ?></option>
  711. </select>
  712. <span class="cdp-left cdp-green">
  713. <div style="margin-left: 15px; line-height: 51px;">
  714. <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.'><?php _e('Huh?', 'copy-delete-posts'); ?></span>
  715. </div>
  716. </span>
  717. </div>
  718. </div>
  719. </div>
  720. <div class="">
  721. <div class="cdp-d-header cdp-f-s-19">
  722. <?php _e('Which version do you want to keep?', 'copy-delete-posts'); ?>
  723. </div>
  724. <div class="cdp-p-30-h cdp-center">
  725. <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">
  726. <option value="1"><?php _e('Keep the oldest duplicate (typically the original)', 'copy-delete-posts'); ?></option>
  727. <option value="2"><?php _e('Keep the newest duplicate (typically the last copy you made)', 'copy-delete-posts'); ?></option>
  728. <option value="3"><?php _e('Delete ALL duplicates, don’t keep any (Be careful!)', 'copy-delete-posts'); ?></option>
  729. </select>
  730. </div>
  731. </div>
  732. <div class="cdp-relative cdp-f-s-19">
  733. <span class="cdp-tooltip-premium" data-top="0">
  734. <?php _e('<b>Filter results (optional)</b>: Only list them, if they<span id="cdpp-switch-mf"> […]</span>', 'copy-delete-posts'); ?> <span class="cdp-premium-icon cdp-big-icon"></span>
  735. </span>
  736. </div>
  737. <?php if ($areWePro && function_exists('cdpp_more_filters')) cdpp_more_filters(); ?>
  738. <br />
  739. <div class="cdp-center cdp-p-30-h">
  740. <button class="cdp-button cdp-delete-btn cdp-d-search cdp-rl-round cdp-f-w-bold" type="button" name="button"><?php _e('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>', 'copy-delete-posts'); ?></button>
  741. </div>
  742. </div>
  743. <div class="cdp-padding-15-h">
  744. <div class="cdp-cf cdp-d-pad-sp cdp-not-yet-search" style="display: none; padding-bottom: 30px;">
  745. <div class="cdp-left cdp-f-s-19 cdp-f-w-bold" style="line-height: 41px;">
  746. <?php _e('Scan has found [<span id="cdp-d-table-pagi-ilosc-wynikow" class="cdp-f-w-bold"></span>] duplicates', 'copy-delete-posts'); ?>
  747. </div>
  748. <div class="cdp-right">
  749. <input type="text" class="cdp-d-searchbox-c" name="cdp-d-searchbox" placeholder="Search...">
  750. </div>
  751. <div class="cdp-right cdp-f-s-19" style="padding-right: 45px;">
  752. <div class="cdp-cf" style="line-height: 41px;">
  753. <div class="cdp-left">
  754. <?php _e('Show', 'copy-delete-posts'); ?>
  755. </div>
  756. <select class="cdp-left cdp-select cdp-ow-border cdp-per-page-select-show cdp-width-166">
  757. <option value="5">5</option>
  758. <option value="10">10</option>
  759. <option value="25" selected>25</option>
  760. <option value="40">40</option>
  761. <option value="50">50</option>
  762. <option value="60">60</option>
  763. <option value="75">75</option>
  764. <option value="100">100</option>
  765. </select>
  766. <div class="cdp-left">
  767. <?php _e('per page', 'copy-delete-posts'); ?>
  768. </div>
  769. </div>
  770. </div>
  771. </div>
  772. <!-- DELETION TABLE -->
  773. <div class="cdp-table-cont cdp-not-yet-search" style="display: none;">
  774. <table id="cdp-d-table" class="cdp-delete-table">
  775. <thead>
  776. <tr class="cdp-f-s-19 cdp-f-w-medium">
  777. <th><label><input type="checkbox" class="cdp-d-checkbox-all"/></label></th>
  778. <th><?php _e('Title', 'copy-delete-posts'); ?></th>
  779. <th><?php _e('Slug/URL', 'copy-delete-posts'); ?></th>
  780. <th><?php _e('Type', 'copy-delete-posts'); ?></th>
  781. <th><?php _e('Date created', 'copy-delete-posts'); ?></th>
  782. <th><?php _e('# of words', 'copy-delete-posts'); ?></th>
  783. </tr>
  784. </thead>
  785. <thead>
  786. <tr data-ignore="true"><td class="cdp-h-tbe" colspan="6"></td></tr>
  787. </thead>
  788. <tbody id="cdp-d-table-tbody"></tbody>
  789. <tfoot>
  790. <tr data-ignore="true"><td class="cdp-h-tbe" colspan="6"></td></tr>
  791. </tfoot>
  792. </table>
  793. </div>
  794. <!-- BELOW DELETION TABLE -->
  795. <div class="cdp-d-pad-sp">
  796. <div class="cdp-cf cdp-not-yet-search" style="display: none;">
  797. <div class="cdp-d-sel-all-con cdp-left cdp-f-w-light cdp-f-s-17">
  798. <?php _e('<u class="cdp-d-select-all cdp-f-w-light">Select all</u> (also from other pages)', 'copy-delete-posts'); ?>
  799. </div>
  800. <div class="cdp-center cdp-d-pagi-cent cdp-left">
  801. <div id="cdp-d-table-pagi" class="cdp-pagination"></div>
  802. </div>
  803. </div>
  804. <div class="cdp-center cdp-p-10-h cdp-not-yet-search" style="display: none;">
  805. <div class="cdp-delete-info cdp-f-w-light cdp-f-s-19">
  806. <?php _e('You selected <b class="cdp-t-d-ct cdp-f-w-light">0</b> pages/posts to be deleted', 'copy-delete-posts'); ?>
  807. </div>
  808. </div>
  809. <div class="cdp-p-10-h cdp-not-yet-search" style="display: none;">
  810. <div class="cdp-d-header-2 cdp-f-s-19 cdp-f-w-light">
  811. <?php _e('Steps to deletion:', 'copy-delete-posts'); ?>
  812. </div>
  813. <div class="cdp-margin-left cdp-f-s-19">
  814. <div class="cdp-p-10-h">
  815. <div class="cdp-cf cdp-low-margin-bot" style="line-height: 28px;">
  816. <div class="cdp-left cdp-blue-circle">1</div>
  817. <div class="cdp-left">&nbsp;<?php _e('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>.', 'copy-delete-posts'); ?></div>
  818. </div>
  819. <div class="cdp-cf cdp-low-margin-bot" style="line-height: 28px;">
  820. <div class="cdp-left cdp-blue-circle">2</div>
  821. <div class="cdp-left">&nbsp;<?php _e('Select all the posts & pages which should be deleted (by ticking the checkboxes in the table above).', 'copy-delete-posts'); ?></div>
  822. </div>
  823. <div class="cdp-cf cdp-low-margin-bot" style="line-height: 28px;">
  824. <div class="cdp-left cdp-blue-circle">3</div>
  825. <div class="cdp-left">&nbsp;<?php _e('Check if you need these features (optional):', 'copy-delete-posts'); ?></div>
  826. </div>
  827. </div>
  828. <div class="cdp-margin-left-25 cdp-p-20-h cdp-nbp" style="padding-top: 0px">
  829. <table>
  830. <tbody>
  831. <tr>
  832. <td class="cdp-vtop-pad"><?php _e('Automatic redirection', 'copy-delete-posts'); ?></td>
  833. <td>
  834. <div class="cdp-relative">
  835. <span class="cdp-tooltip-premium" style="padding: 25px 0;">
  836. <select class="cdp-p-redirections cdp-select cdp-ow-border cdp-dis-en-opt" name="cdp-redirections">
  837. <option value="0"><?php _e('Disabled', 'copy-delete-posts'); ?></option>
  838. <option value="1"><?php _e('Enabled', 'copy-delete-posts'); ?></option>
  839. </select>
  840. </span>
  841. <div class="cdp-premium-icon cdp-big-icon" style="margin-left: 17px;"></div>
  842. </div>
  843. <div class="cdp-d-tp-pad cdp-f-s-17 cdp-lh-24"><?php _e('Enable this if you want to redirect the urls from your deleted posts/pages to the main one you decided to keep.', 'copy-delete-posts'); ?></div>
  844. </td>
  845. </tr>
  846. <tr>
  847. <td class="cdp-vtop-pad"><?php _e('Deletion throttling', 'copy-delete-posts'); ?></td>
  848. <td>
  849. <div class="cdp-cf">
  850. <select class="cdp-left cdp-d-throttling cdp-select cdp-ow-border cdp-dis-en-opt" name="cdp-throttling">
  851. <option value="0"><?php _e('Disabled', 'copy-delete-posts'); ?></option>
  852. <option value="1"><?php _e('Enabled', 'copy-delete-posts'); ?></option>
  853. </select>
  854. <div class="cdp-left cdp-inline cdp-cf cdp-d-throttling-count-p" style="display: none; line-height: 41px;">
  855. <div class="cdp-left">
  856. <span style="padding: 0px 15px;"><?php _e('Delete', 'copy-delete-posts'); ?></span>
  857. </div>
  858. <div class="cdp-left">
  859. <input type="number" class="cdp-d-throttling-count cdp-number-field-styled" name="cdp-throttling-count" min="1" max="10240" placeholder="50">
  860. </div>
  861. <div class="cdp-left">
  862. <span style="padding: 0px 15px;"><?php _e('per minute', 'copy-delete-posts'); ?></span>
  863. </div>
  864. </div>
  865. </div>
  866. <div class="cdp-d-tp-pad cdp-f-s-17 cdp-lh-24">
  867. <?php _e('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 />', 'copy-delete-posts'); ?>
  868. <span class="cdp-even-more-th-info" style="display: none">
  869. <?php _e('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.', 'copy-delete-posts'); ?>
  870. </span>
  871. </div>
  872. </td>
  873. </tr>
  874. <tr>
  875. <td class="cdp-vtop-pad" style="padding-top: 4px"><?php _e('Move post(s) to trash?', 'copy-delete-posts'); ?></td>
  876. <td>
  877. <div class="">
  878. <span class="cdp-tooltip-premium" style="padding: 25px 0">
  879. <label class="cdp-relative" style="padding-right: 25px;"><input type="checkbox" class="cdp-p-just-trash-them" /> <?php _e('Yes, keep deleted posts in trash!', 'copy-delete-posts'); ?> <span class="cdp-premium-icon cdp-big-icon"></span></label>
  880. </span>
  881. <div class="cdp-d-tp-pad cdp-f-s-17 cdp-lh-24"><?php _e('Select this option to move deleted posts to trash (instead of deleting them permanently right away).', 'copy-delete-posts'); ?></div>
  882. </div>
  883. </td>
  884. </tr>
  885. </tbody>
  886. </table>
  887. </div>
  888. </div>
  889. </div>
  890. <div class="">
  891. <div class="cdp-not-yet-search" style="display: none;">
  892. <hr class="cdp-hr">
  893. <div class="cdp-center cdp-padding-15-h cdp-f-s-19">
  894. <label><input type="checkbox" class="cdp-d-just-check-it"> <?php _e('I completed <u>all</u> steps, it’s ok!', 'copy-delete-posts'); ?></label>
  895. </div>
  896. <div class="cdp-center cdp-p-10-h">
  897. <button type="button" class="cdp-button cdp-red-bg cdp-d-real-delete cdp-f-s-19" name="button"><?php _e('Delete selected pages/posts!', 'copy-delete-posts'); ?></button>
  898. </div>
  899. <div class="cdp-center cdp-padding-15-h cdp-f-s-19">
  900. <?php _e('You will be notified when the deletion process ends via <span class="cdp-green">Admin Bar Menu</span>.', 'copy-delete-posts'); ?>
  901. </div>
  902. </div>
  903. <div class="cdp-padding cdp-f-s-17 cdp-center">
  904. <a href="#" class="cdp-close-chapter"><?php _e('Close section', 'copy-delete-posts'); ?></a>
  905. </div>
  906. </div>
  907. </div>
  908. </div>
  909. </div>
  910. </div>
  911. </div>
  912. </div>
  913. <?php if (function_exists('cdpp_license_status')) cdpp_license_status(); ?>
  914. <?php if (function_exists('cdpp_license')) cdpp_license(); ?>
  915. </div>
  916. <div class="cdp-f-s-20 cdp-p-hh cdp-center cdp-relative">
  917. <?php _e('<b>Questions?</b> We\'re happy to help in the <a href="https://wordpress.org/support/plugin/copy-delete-posts/#new-topic-0" target="_blank" style="text-decoration: none;">Support Forum</a>.', 'copy-delete-posts'); ?> <span class="cdp-info-icon cdp-tooltip-top" title="<?php _e('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 here. It only takes a minute :) Thank you!', 'copy-delete-posts'); ?>"></span>
  918. </div>
  919. <jdiv class="label_e50 _bottom_ea7 notranslate" id="cdp_jvlabelWrap-fake" style="background: linear-gradient(95deg, rgb(47, 50, 74) 20%, rgb(66, 72, 103) 80%);right: 30px;bottom: 0px;width: 310px;">
  920. <jdiv class="hoverl_bc6"></jdiv>
  921. <jdiv class="text_468 _noAd_b4d contentTransitionWrap_c73" style="font-size: 15px;font-family: Arial, Arial;font-style: normal;color: rgb(240, 241, 241);position: absolute;top: 8px;line-height: 13px;">
  922. <span><?php _e('Connect with support (click to load)', 'copy-delete-posts'); ?></span><br>
  923. <span style="color: #eee;font-size: 10px;">
  924. <?php _e('This will establish connection to the chat servers', 'copy-delete-posts'); ?>
  925. </span>
  926. </jdiv>
  927. <jdiv class="leafCont_180">
  928. <jdiv class="leaf_2cc _bottom_afb">
  929. <jdiv class="cssLeaf_464"></jdiv>
  930. </jdiv>
  931. </jdiv>
  932. </jdiv>
  933. </div>
  934. </div>
  935. <?php
  936. }
  937. /** –– **/
  938. /** –– **\
  939. * This function will convert bytes to human readable
  940. * @return void
  941. */
  942. function cdp_human_readable_bytes($bytes) {
  943. $label = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
  944. for ($i = 0; $bytes >= 1024 && $i < (count($label) - 1); $bytes /= 1024, $i++);
  945. return (round($bytes, 2) . " " . $label[$i]);
  946. }
  947. /** –– * */
  948. /** –– **\
  949. * Notice about performance.
  950. * @since 1.0.9
  951. */
  952. function cdp_render_performance_notice() {
  953. global $wp_version;
  954. global $wpdb;
  955. $mysqlVersion = $wpdb->db_version();
  956. $cdp_notice2 = __('%b_start%Please%b_end% copy & paste the following log %a_start%into the forum%a_end% so that we can make the plugin better. Thank you!', 'copy-delete-posts');
  957. $cdp_notice2 = str_replace('%a_start%', '<a target="_blank" href="https://wordpress.org/support/plugin/copy-delete-posts/#new-topic-0">', $cdp_notice2);
  958. $cdp_notice2 = str_replace('%a_end%', '</a>', $cdp_notice2);
  959. $cdp_notice2 = str_replace('%b_start%', '<b class="cdp-please-big">', $cdp_notice2);
  960. $cdp_notice2 = str_replace('%b_end%', '</b>', $cdp_notice2);
  961. $logs = get_option('cdp_copy_logs_times', array());
  962. $theLog = '';
  963. $theLog .= 'The OS: ' . PHP_OS . "\n";
  964. $theLog .= 'PHP Version: ' . PHP_VERSION . "\n";
  965. $theLog .= 'WP Version: ' . $wp_version . "\n";
  966. $theLog .= 'MySQL Version: ' . $mysqlVersion . "\n";
  967. $theLog .= 'Directory Separator: ' . DIRECTORY_SEPARATOR . "\n\n";
  968. $theLog .= 'Copy logs:' . "\n";
  969. foreach ($logs as $key => $value) {
  970. $amount = isset($value['amount']) ? $value['amount'] : 1;
  971. $time = $value['time'];
  972. $perOne = $value['perOne'];
  973. $data = date('d-m-Y H:i:s', $value['data']);
  974. $memory = cdp_human_readable_bytes(intval($value['memory']));
  975. $peak = cdp_human_readable_bytes(intval($value['peak']));
  976. $theLog .= $data . ' - ' . $amount . 'x, [total: ' . $time . ', avg: ' . $perOne . '] (mem: ' . $memory . ' - ' . $value['memory'] . ', peak: ' . $peak . ' - ' . $value['peak'] . ')' . "\n";
  977. }
  978. ?>
  979. <div id="cdp_notice_error">
  980. <div class="cdp-cf cdp_notice_heading">
  981. <div class="cdp-left cdp_warning_icon"></div>
  982. <div class="cdp-left cdp_notice_content">
  983. <?php _e('The plugin works, however we noticed some optimization potential on your site.', 'copy-delete-posts'); ?><br>
  984. <?php echo $cdp_notice2; ?>
  985. </div>
  986. <div class="cdp-left cdp_notice_perf_close cdp-tooltip-top" title="<?php _e('Dismiss forever', 'copy-delete-posts'); ?>">&times;</div>
  987. </div>
  988. <div class="cdp-textarea-wr-notice">
  989. <textarea readonly class="cdp_notice_logs"><?php echo $theLog ?></textarea>
  990. <div class="cdp-copy-notice-logs"><?php _e('Copy logs', 'copy-delete-posts'); ?></div>
  991. </div>
  992. </div>
  993. <?php
  994. }
  995. /** –– **/