SEOPress - Version 4.0.2

Version Description

  • FIX Elementor missing features
Download this release

Release Info

Developer rainbowgeek
Plugin Icon 128x128 SEOPress
Version 4.0.2
Comparing to
See all releases

Code changes from version 4.0.1 to 4.0.2

Files changed (150) hide show
  1. assets/css/index.php +0 -0
  2. assets/css/seopress-admin-bar.css +0 -0
  3. assets/css/seopress-admin-bar.min.css +0 -0
  4. assets/css/seopress-setup.css +0 -0
  5. assets/css/seopress-setup.min.css +0 -0
  6. assets/css/seopress.css +0 -0
  7. assets/css/tagify.min.css +1 -0
  8. assets/img/bg-hero-support.svg +0 -0
  9. assets/img/help/google-knowledge-graph-social.png +0 -0
  10. assets/img/index.php +0 -0
  11. assets/img/logo-seopress.svg +0 -0
  12. assets/index.php +0 -0
  13. assets/js/index.php +0 -0
  14. assets/js/seopress-analytics.js +0 -0
  15. assets/js/seopress-analytics.min.js +0 -0
  16. assets/js/seopress-block-editor.js +0 -0
  17. assets/js/seopress-block-editor.min.js +0 -0
  18. assets/js/seopress-cookies-ajax.js +0 -0
  19. assets/js/seopress-cookies-ajax.min.js +0 -0
  20. assets/js/seopress-cookies.js +0 -0
  21. assets/js/seopress-cookies.min.js +0 -0
  22. assets/js/seopress-counters.js +1 -1
  23. assets/js/seopress-counters.min.js +0 -0
  24. assets/js/seopress-dashboard.js +0 -0
  25. assets/js/seopress-dashboard.min.js +0 -0
  26. assets/js/seopress-media-uploader.js +0 -0
  27. assets/js/seopress-media-uploader.min.js +0 -0
  28. assets/js/seopress-migrate.js +0 -0
  29. assets/js/seopress-migrate.min.js +0 -0
  30. assets/js/seopress-network-tabs.js +0 -0
  31. assets/js/seopress-network-tabs.min.js +0 -0
  32. assets/js/seopress-quick-edit.js +0 -0
  33. assets/js/seopress-quick-edit.min.js +0 -0
  34. assets/js/seopress-sitemap-ajax.js +0 -0
  35. assets/js/seopress-sitemap-ajax.min.js +0 -0
  36. assets/js/seopress-sitemap-video.js +0 -0
  37. assets/js/seopress-sitemap-video.min.js +0 -0
  38. assets/js/seopress-tabs.js +0 -0
  39. assets/js/seopress-tabs.min.js +0 -0
  40. assets/js/seopress-tabs2.js +0 -0
  41. assets/js/seopress-tabs2.min.js +0 -0
  42. assets/js/seopress-tabs3.js +0 -0
  43. assets/js/seopress-tabs3.min.js +0 -0
  44. assets/js/seopress-tabs4.js +0 -0
  45. assets/js/seopress-tabs4.min.js +0 -0
  46. assets/js/seopress-tabs5.js +0 -0
  47. assets/js/seopress-tabs5.min.js +0 -0
  48. assets/js/seopress-tabs6.js +0 -0
  49. assets/js/seopress-tabs6.min.js +0 -0
  50. assets/js/seopress-tabs7.js +0 -0
  51. assets/js/seopress-tabs7.min.js +0 -0
  52. assets/js/seopress-tabs8.js +0 -0
  53. assets/js/seopress-tabs8.min.js +0 -0
  54. assets/js/seopress-yoast-migrate.js +132 -0
  55. assets/js/tagify.min.js +7 -0
  56. contributors.txt +1 -2
  57. inc/admin/admin-features-list.php +0 -0
  58. inc/admin/admin-get-started.php +0 -0
  59. inc/admin/admin-header.php +0 -0
  60. inc/admin/admin-metaboxes-form.php +0 -0
  61. inc/admin/admin-metaboxes-get-content-analysis.php +0 -0
  62. inc/admin/admin-metaboxes-render-content-analysis.php +0 -0
  63. inc/admin/admin-metaboxes.php +500 -500
  64. inc/admin/admin-notifications-center.php +0 -0
  65. inc/admin/admin-term-metaboxes.php +0 -0
  66. inc/admin/admin-wizard.php +0 -0
  67. inc/admin/admin.php +0 -0
  68. inc/admin/adminbar.php +0 -0
  69. inc/admin/ajax.php +3 -4
  70. inc/admin/index.php +0 -0
  71. inc/admin/page-builders/elementor/assets/css/content-analysis.css +479 -0
  72. inc/admin/page-builders/elementor/assets/css/google-suggestions.css +139 -0
  73. inc/admin/page-builders/elementor/assets/css/social-preview.css +212 -0
  74. inc/admin/page-builders/elementor/assets/css/text-letter-counter.css +86 -0
  75. inc/admin/page-builders/elementor/assets/js/base.js +242 -0
  76. inc/admin/page-builders/elementor/assets/js/content-analysis.js +15 -0
  77. inc/admin/page-builders/elementor/assets/js/google-suggestions.js +55 -0
  78. inc/admin/page-builders/elementor/assets/js/social-preview.js +135 -12
  79. inc/admin/page-builders/elementor/assets/js/text-letter-counter.js +218 -0
  80. inc/admin/page-builders/elementor/elementor-addon.php +1 -0
  81. inc/admin/page-builders/elementor/inc/admin/class-document-settings-section.php +185 -11
  82. inc/admin/page-builders/elementor/inc/admin/class-seopress-meta-helper.php +2 -0
  83. inc/admin/page-builders/elementor/inc/class-register-controls.php +5 -0
  84. inc/admin/page-builders/elementor/inc/class-singleton.php +0 -0
  85. inc/admin/page-builders/elementor/inc/controls/class-content-analysis-control.php +63 -0
  86. inc/admin/page-builders/elementor/inc/controls/class-google-suggestions-control.php +68 -0
  87. inc/admin/page-builders/elementor/inc/controls/class-social-preview-control.php +39 -4
  88. inc/admin/page-builders/elementor/inc/controls/class-text-letter-counter-control.php +79 -0
  89. inc/admin/plugin-upgrader.php +0 -0
  90. inc/functions/index.php +0 -0
  91. inc/functions/options-advanced-admin.php +183 -182
  92. inc/functions/options-advanced.php +0 -0
  93. inc/functions/options-google-analytics-checkout.php +85 -0
  94. inc/functions/options-google-analytics-order.php +55 -0
  95. inc/functions/options-google-analytics.php +0 -0
  96. inc/functions/options-google-ecommerce.php +0 -0
  97. inc/functions/options-import-export.php +0 -0
  98. inc/functions/options-matomo.php +0 -0
  99. inc/functions/options-oembed.php +0 -0
  100. inc/functions/options-redirections.php +0 -0
  101. inc/functions/options-sitemap.php +0 -0
  102. inc/functions/options-social.php +0 -0
  103. inc/functions/options-titles-metas.php +0 -0
  104. inc/functions/options.php +0 -0
  105. inc/functions/sitemap/index.php +0 -0
  106. inc/functions/sitemap/template-html-sitemap.php +0 -0
  107. inc/functions/sitemap/template-xml-sitemaps-author.php +0 -0
  108. inc/functions/sitemap/template-xml-sitemaps-single-term.php +0 -0
  109. inc/functions/sitemap/template-xml-sitemaps-single.php +0 -0
  110. inc/functions/sitemap/template-xml-sitemaps-xsl.php +0 -0
  111. inc/functions/sitemap/template-xml-sitemaps.php +0 -0
  112. inc/functions/variables/dynamic-variables.php +0 -0
  113. inc/index.php +0 -0
  114. index.php +0 -0
  115. languages/index.php +0 -0
  116. languages/wp-seopress-ar.mo +0 -0
  117. languages/wp-seopress-ar.po +0 -0
  118. languages/wp-seopress-bg_BG.po +0 -0
  119. languages/wp-seopress-da_DK.mo +0 -0
  120. languages/wp-seopress-da_DK.po +0 -0
  121. languages/wp-seopress-el.mo +0 -0
  122. languages/wp-seopress-el.po +0 -0
  123. languages/wp-seopress-fa_IR.mo +0 -0
  124. languages/wp-seopress-fa_IR.po +0 -0
  125. languages/wp-seopress-id_ID.mo +0 -0
  126. languages/wp-seopress-id_ID.po +0 -0
  127. languages/wp-seopress-it.mo +0 -0
  128. languages/wp-seopress-it.po +4973 -0
  129. languages/wp-seopress-it_IT.mo +0 -0
  130. languages/wp-seopress-it_IT.po +0 -0
  131. languages/wp-seopress-ro_RO.mo +0 -0
  132. languages/wp-seopress-ro_RO.po +0 -0
  133. languages/wp-seopress-ta_IN.mo +0 -0
  134. languages/wp-seopress-ta_IN.po +0 -0
  135. languages/wp-seopress-te.mo +0 -0
  136. languages/wp-seopress-te.po +0 -0
  137. languages/wp-seopress-tr_TR.mo +0 -0
  138. languages/wp-seopress-tr_TR.po +0 -0
  139. languages/wp-seopress-vi.mo +0 -0
  140. languages/wp-seopress-vi.po +0 -0
  141. languages/wp-seopress-zh_TW.mo +0 -0
  142. languages/wp-seopress-zh_TW.po +0 -0
  143. languages/wp-seopress.pot +0 -0
  144. languages/wp-seopress_fa_IR.mo +0 -0
  145. languages/wp-seopress_fa_IR.po +6094 -0
  146. languages/wp-seopress_tr_TR.mo +0 -0
  147. languages/wp-seopress_tr_TR.po +6161 -0
  148. readme.txt +3 -1
  149. seopress.php +2 -2
  150. wpml-config.xml +0 -0
assets/css/index.php CHANGED
File without changes
assets/css/seopress-admin-bar.css CHANGED
File without changes
assets/css/seopress-admin-bar.min.css CHANGED
File without changes
assets/css/seopress-setup.css CHANGED
File without changes
assets/css/seopress-setup.min.css CHANGED
File without changes
assets/css/seopress.css CHANGED
File without changes
assets/css/tagify.min.css ADDED
@@ -0,0 +1 @@
 
1
+ :root{--tagify-dd-color-primary:rgb(53,149,246);--tagify-dd-bg-color:white}.tagify{--tags-border-color:#DDD;--tag-bg:#E5E5E5;--tag-hover:#D3E2E2;--tag-text-color:black;--tag-text-color--edit:black;--tag-pad:0.3em 0.5em;--tag-inset-shadow-size:1.1em;--tag-invalid-color:#D39494;--tag-invalid-bg:rgba(211, 148, 148, 0.5);--tag-remove-bg:rgba(211, 148, 148, 0.3);--tag-remove-btn-bg:none;--tag-remove-btn-bg--hover:#c77777;--tag--min-width:1ch;--tag--max-width:auto;--tag-hide-transition:.3s;--loader-size:.8em;display:flex;align-items:flex-start;flex-wrap:wrap;border:1px solid #ddd;border:1px solid var(--tags-border-color);padding:0;line-height:1.1;cursor:text;outline:0;position:relative;transition:.1s}@keyframes tags--bump{30%{transform:scale(1.2)}}@keyframes rotateLoader{to{transform:rotate(1turn)}}.tagify:hover{border-color:#ccc}.tagify.tagify--focus{transition:0s;border-color:#3595f6}.tagify[readonly]{cursor:default}.tagify[readonly]>.tagify__input{visibility:hidden;width:0;margin:5px 0}.tagify[readonly] .tagify__tag__removeBtn{display:none}.tagify[readonly] .tagify__tag>div{padding:.3em .5em;padding:var(--tag-pad)}.tagify[readonly] .tagify__tag>div::before{background:linear-gradient(45deg,var(--tag-bg) 25%,transparent 25%,transparent 50%,var(--tag-bg) 50%,var(--tag-bg) 75%,transparent 75%,transparent) 0/5px 5px;box-shadow:none;filter:brightness(.95)}.tagify--loading .tagify__input::before{content:none}.tagify--loading .tagify__input::after{content:'';vertical-align:middle;margin:-2px 0 -2px .5em;opacity:1;width:.7em;height:.7em;width:var(--loader-size);height:var(--loader-size);border:3px solid;border-color:#eee #bbb #888 transparent;border-radius:50%;animation:rotateLoader .4s infinite linear}.tagify--loading .tagify__input:empty::after{margin-left:0}.tagify+input,.tagify+textarea{display:none!important}.tagify__tag{display:inline-flex;align-items:center;margin:5px 0 5px 5px;position:relative;z-index:1;outline:0;cursor:default;transition:.13s ease-out}.tagify__tag>div{vertical-align:top;box-sizing:border-box;max-width:100%;padding:.3em .5em;padding:var(--tag-pad);color:#000;color:var(--tag-text-color);line-height:inherit;border-radius:3px;-webkit-user-select:none;user-select:none;transition:.13s ease-out}.tagify__tag>div>*{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;vertical-align:top;min-width:var(--tag--min-width);max-width:var(--tag--max-width);transition:.8s ease,.1s color}.tagify__tag>div>[contenteditable]{outline:0;-webkit-user-select:text;user-select:text;cursor:text;margin:-2px;padding:2px;max-width:350px}.tagify__tag>div::before{content:'';position:absolute;border-radius:inherit;left:0;top:0;right:0;bottom:0;z-index:-1;pointer-events:none;transition:120ms ease;animation:tags--bump .3s ease-out 1;box-shadow:0 0 0 1.1em #e5e5e5 inset;box-shadow:0 0 0 calc(var(--tag-inset-shadow-size)) var(--tag-bg) inset}.tagify__tag:hover:not([readonly]) div::before{top:-2px;right:-2px;bottom:-2px;left:-2px;box-shadow:0 0 0 1.1em #d3e2e2 inset;box-shadow:0 0 0 var(--tag-inset-shadow-size) var(--tag-hover) inset}.tagify__tag.tagify--noAnim{animation:none}.tagify__tag.tagify--hide{width:0!important;padding-left:0;padding-right:0;margin-left:0;margin-right:0;opacity:0;transform:scale(0);transition:.3s;transition:var(--tag-hide-transition);pointer-events:none}.tagify__tag.tagify--mark div::before{animation:none}.tagify__tag.tagify--notAllowed div>span{opacity:.5}.tagify__tag.tagify--notAllowed div::before{box-shadow:0 0 0 1.1em rgba(211,148,148,.5) inset!important;box-shadow:0 0 0 var(--tag-inset-shadow-size) var(--tag-invalid-bg) inset!important;transition:.2s}.tagify__tag[readonly] .tagify__tag__removeBtn{display:none}.tagify__tag[readonly]>div::before{background:linear-gradient(45deg,var(--tag-bg) 25%,transparent 25%,transparent 50%,var(--tag-bg) 50%,var(--tag-bg) 75%,transparent 75%,transparent) 0/5px 5px;box-shadow:none;filter:brightness(.95)}.tagify__tag--editable>div{color:#000;color:var(--tag-text-color--edit)}.tagify__tag--editable>div::before{box-shadow:0 0 0 2px #d3e2e2 inset!important;box-shadow:0 0 0 2px var(--tag-hover) inset!important}.tagify__tag--editable.tagify--invalid>div::before{box-shadow:0 0 0 2px #d39494 inset!important;box-shadow:0 0 0 2px var(--tag-invalid-color) inset!important}.tagify__tag__removeBtn{order:5;display:inline-flex;align-items:center;justify-content:center;border-radius:50px;cursor:pointer;font:14px Serif;background:0 0;background:var(--tag-remove-btn-bg);color:#000;color:var(--tag-text-color);width:14px;height:14px;margin-right:4.66667px;margin-left:-4.66667px;transition:.2s ease-out}.tagify__tag__removeBtn::after{content:"\00D7"}.tagify__tag__removeBtn:hover{color:#fff;background:#c77777;background:var(--tag-remove-btn-bg--hover)}.tagify__tag__removeBtn:hover+div>span{opacity:.5}.tagify__tag__removeBtn:hover+div::before{box-shadow:0 0 0 1.1em rgba(211,148,148,.3) inset!important;box-shadow:0 0 0 var(--tag-inset-shadow-size) var(--tag-remove-bg) inset!important;transition:.2s}.tagify:not(.tagify--mix) .tagify__input br{display:none}.tagify:not(.tagify--mix) .tagify__input *{display:inline;white-space:nowrap}.tagify__input{display:block;min-width:110px;margin:5px;padding:.3em .5em;padding:var(--tag-pad,.3em .5em);line-height:inherit;position:relative;white-space:pre-line}.tagify__input::before{display:inline-block;width:0}.tagify__input:empty::before{transition:.2s ease-out;opacity:.5;transform:none;width:auto}.tagify__input:focus{outline:0}.tagify__input:focus::before{transition:.2s ease-out;opacity:0;transform:translatex(6px)}@supports (-moz-appearance:none){.tagify__input:focus::before{display:none}}.tagify__input:focus:empty::before{transition:.2s ease-out;opacity:.3;transform:none}@supports (-moz-appearance:none){.tagify__input:focus:empty::before{display:inline-block}}.tagify__input::before{content:attr(data-placeholder);line-height:1.8;position:absolute;top:0;z-index:1;color:#000;white-space:nowrap;pointer-events:none;opacity:0}.tagify--mix .tagify__input::before{position:static;line-height:inherit}@supports (-moz-appearance:none){.tagify__input::before{line-height:inherit;position:relative}}.tagify__input::after{content:attr(data-suggest);display:inline-block;white-space:pre;color:#000;opacity:.3;pointer-events:none;max-width:100px}.tagify__input .tagify__tag{margin:0}.tagify__input .tagify__tag>div{padding-top:0;padding-bottom:0}.tagify--mix{line-height:1.7}.tagify--mix .tagify__input{padding:5px;margin:0;width:100%;height:100%;line-height:inherit}.tagify--mix .tagify__input::after{content:none}.tagify--select::after{content:'>';opacity:.5;position:absolute;top:50%;right:0;bottom:0;font:16px monospace;line-height:8px;height:8px;pointer-events:none;transform:translate(-150%,-50%) scaleX(1.2) rotate(90deg);transition:.2s ease-in-out}.tagify--select[aria-expanded=true]::after{transform:translate(-150%,-50%) rotate(270deg) scaleY(1.2)}.tagify--select .tagify__tag{position:absolute;top:0;right:1.8em;bottom:0}.tagify--select .tagify__tag div{display:none}.tagify--select .tagify__input{width:100%}.tagify--invalid{--tags-border-color:#D39494}.tagify__dropdown{position:absolute;z-index:9999;transform:translateY(1px);overflow:hidden}.tagify__dropdown[placement=top]{margin-top:0;transform:translateY(-2px)}.tagify__dropdown[placement=top] .tagify__dropdown__wrapper{border-top-width:1px;border-bottom-width:0}.tagify__dropdown--text{box-shadow:0 0 0 3px rgba(var(--tagify-dd-color-primary),.1);font-size:.9em}.tagify__dropdown--text .tagify__dropdown__wrapper{border-width:1px}.tagify__dropdown__wrapper{max-height:300px;overflow:hidden;background:#fff;background:var(--tagify-dd-bg-color);border:1px solid #3595f6;border-color:var(--tagify-dd-color-primary);border-top-width:0;box-shadow:0 2px 4px -2px rgba(0,0,0,.2);transition:.25s cubic-bezier(0,1,.5,1)}.tagify__dropdown__wrapper:hover{overflow:auto}.tagify__dropdown--initial .tagify__dropdown__wrapper{max-height:20px;transform:translateY(-1em)}.tagify__dropdown--initial[placement=top] .tagify__dropdown__wrapper{transform:translateY(2em)}.tagify__dropdown__item{box-sizing:inherit;padding:.3em .5em;margin:1px;cursor:pointer;border-radius:2px;position:relative;outline:0}.tagify__dropdown__item--active{background:#3595f6;background:var(--tagify-dd-color-primary);color:#fff}.tagify__dropdown__item:active{filter:brightness(105%)}
assets/img/bg-hero-support.svg CHANGED
File without changes
assets/img/help/google-knowledge-graph-social.png ADDED
Binary file
assets/img/index.php CHANGED
File without changes
assets/img/logo-seopress.svg CHANGED
File without changes
assets/index.php CHANGED
File without changes
assets/js/index.php CHANGED
File without changes
assets/js/seopress-analytics.js CHANGED
File without changes
assets/js/seopress-analytics.min.js CHANGED
File without changes
assets/js/seopress-block-editor.js CHANGED
File without changes
assets/js/seopress-block-editor.min.js CHANGED
File without changes
assets/js/seopress-cookies-ajax.js CHANGED
File without changes
assets/js/seopress-cookies-ajax.min.js CHANGED
File without changes
assets/js/seopress-cookies.js CHANGED
File without changes
assets/js/seopress-cookies.min.js CHANGED
File without changes
assets/js/seopress-counters.js CHANGED
@@ -446,7 +446,7 @@ jQuery(document).ready(function(e) {
446
  e("#seopress_cpt #seopress_robots_canonical_meta").attr("placeholder", s.data.canonical),
447
 
448
  e("#seopress-analysis-tabs").load(" #seopress-analysis-tabs-1", '', sp_ca_toggle),
449
- e(".analysis-score p").removeClass('loading'),
450
 
451
  e(" #seopress_titles_title_counters_val").remove(),
452
  e(" #seopress_titles_desc_counters_val").remove(),
446
  e("#seopress_cpt #seopress_robots_canonical_meta").attr("placeholder", s.data.canonical),
447
 
448
  e("#seopress-analysis-tabs").load(" #seopress-analysis-tabs-1", '', sp_ca_toggle),
449
+ e(".analysis-score p").removeClass('loading'),
450
 
451
  e(" #seopress_titles_title_counters_val").remove(),
452
  e(" #seopress_titles_desc_counters_val").remove(),
assets/js/seopress-counters.min.js CHANGED
File without changes
assets/js/seopress-dashboard.js CHANGED
File without changes
assets/js/seopress-dashboard.min.js CHANGED
File without changes
assets/js/seopress-media-uploader.js CHANGED
File without changes
assets/js/seopress-media-uploader.min.js CHANGED
File without changes
assets/js/seopress-migrate.js CHANGED
File without changes
assets/js/seopress-migrate.min.js CHANGED
File without changes
assets/js/seopress-network-tabs.js CHANGED
File without changes
assets/js/seopress-network-tabs.min.js CHANGED
File without changes
assets/js/seopress-quick-edit.js CHANGED
File without changes
assets/js/seopress-quick-edit.min.js CHANGED
File without changes
assets/js/seopress-sitemap-ajax.js CHANGED
File without changes
assets/js/seopress-sitemap-ajax.min.js CHANGED
File without changes
assets/js/seopress-sitemap-video.js CHANGED
File without changes
assets/js/seopress-sitemap-video.min.js CHANGED
File without changes
assets/js/seopress-tabs.js CHANGED
File without changes
assets/js/seopress-tabs.min.js CHANGED
File without changes
assets/js/seopress-tabs2.js CHANGED
File without changes
assets/js/seopress-tabs2.min.js CHANGED
File without changes
assets/js/seopress-tabs3.js CHANGED
File without changes
assets/js/seopress-tabs3.min.js CHANGED
File without changes
assets/js/seopress-tabs4.js CHANGED
File without changes
assets/js/seopress-tabs4.min.js CHANGED
File without changes
assets/js/seopress-tabs5.js CHANGED
File without changes
assets/js/seopress-tabs5.min.js CHANGED
File without changes
assets/js/seopress-tabs6.js CHANGED
File without changes
assets/js/seopress-tabs6.min.js CHANGED
File without changes
assets/js/seopress-tabs7.js CHANGED
File without changes
assets/js/seopress-tabs7.min.js CHANGED
File without changes
assets/js/seopress-tabs8.js CHANGED
File without changes
assets/js/seopress-tabs8.min.js CHANGED
File without changes
assets/js/seopress-yoast-migrate.js ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($) {
2
+ //Yoast SEO
3
+ $('#seopress-yoast-migrate').on('click', function(e) {
4
+ e.preventDefault();
5
+ self.process_offset( 0, self );
6
+ });
7
+ process_offset = function( offset, self ) {
8
+ $.ajax({
9
+ method : 'POST',
10
+ url : seopressAjaxMigrate.seopress_yoast_migrate.seopress_yoast_migration,
11
+ data : {
12
+ action: 'seopress_yoast_migration',
13
+ offset: offset,
14
+ _ajax_nonce: seopressAjaxMigrate.seopress_yoast_migrate.seopress_nonce,
15
+ },
16
+ success : function( data ) {
17
+ if( 'done' == data.data.offset ) {
18
+ $('#seopress-yoast-migrate').removeAttr("disabled");
19
+ $( '.spinner' ).css( "visibility", "hidden" );
20
+ $( '#yoast-migration-tool .log' ).html(seopressAjaxMigrate.i18n);
21
+ } else {
22
+ self.process_offset( parseInt( data.data.offset ), self );
23
+ }
24
+ },
25
+ });
26
+ };
27
+ $('#seopress-yoast-migrate').on('click', function() {
28
+ $(this).attr("disabled", "disabled");
29
+ $( '#yoast-migration-tool .spinner' ).css( "visibility", "visible" );
30
+ $( '#yoast-migration-tool .spinner' ).css( "float", "none" );
31
+ $( '#yoast-migration-tool .log' ).html('');
32
+ });
33
+
34
+ //All In One
35
+ $('#seopress-aio-migrate').on('click', function(e2) {
36
+ e2.preventDefault();
37
+ self.process_offset2( 0, self );
38
+ });
39
+ process_offset2 = function( offset2, self ) {
40
+ $.ajax({
41
+ method : 'POST',
42
+ url : seopressAjaxMigrate.seopress_aio_migrate.seopress_aio_migration,
43
+ data : {
44
+ action: 'seopress_aio_migration',
45
+ offset2: offset2,
46
+ _ajax_nonce: seopressAjaxMigrate.seopress_aio_migrate.seopress_nonce,
47
+ },
48
+ success : function( data ) {
49
+ if( 'done' == data.data.offset2 ) {
50
+ $('#seopress-aio-migrate').removeAttr("disabled");
51
+ $( '.spinner' ).css( "visibility", "hidden" );
52
+ $( '#aio-migration-tool .log' ).html(seopressAjaxMigrate.i18n);
53
+ } else {
54
+ self.process_offset2( parseInt( data.data.offset2 ), self );
55
+ }
56
+ },
57
+ });
58
+ };
59
+
60
+ $('#seopress-aio-migrate').on('click', function() {
61
+ $(this).attr("disabled", "disabled");
62
+ $( '#aio-migration-tool .spinner' ).css( "visibility", "visible" );
63
+ $( '#aio-migration-tool .spinner' ).css( "float", "none" );
64
+ $( '#aio-migration-tool .log' ).html('');
65
+ });
66
+
67
+ //SEO Framework
68
+ $('#seopress-seo-framework-migrate').on('click', function(e3) {
69
+ e3.preventDefault();
70
+ self.process_offset3( 0, self );
71
+ });
72
+ process_offset3 = function( offset3, self ) {
73
+ $.ajax({
74
+ method : 'POST',
75
+ url : seopressAjaxMigrate.seopress_seo_framework_migrate.seopress_seo_framework_migration,
76
+ data : {
77
+ action: 'seopress_seo_framework_migration',
78
+ offset3: offset3,
79
+ _ajax_nonce: seopressAjaxMigrate.seopress_seo_framework_migrate.seopress_nonce,
80
+ },
81
+ success : function( data ) {
82
+ if( 'done' == data.data.offset3 ) {
83
+ $('#seopress-seo-framework-migrate').removeAttr("disabled");
84
+ $( '.spinner' ).css( "visibility", "hidden" );
85
+ $( '#seo-framework-migration-tool .log' ).html(seopressAjaxMigrate.i18n);
86
+ } else {
87
+ self.process_offset3( parseInt( data.data.offset3 ), self );
88
+ }
89
+ },
90
+ });
91
+ };
92
+
93
+ $('#seopress-seo-framework-migrate').on('click', function() {
94
+ $(this).attr("disabled", "disabled");
95
+ $( '#seo-framework-migration-tool .spinner' ).css( "visibility", "visible" );
96
+ $( '#seo-framework-migration-tool .spinner' ).css( "float", "none" );
97
+ $( '#seo-framework-migration-tool .log' ).html('');
98
+ });
99
+
100
+ //RK
101
+ $('#seopress-rk-migrate').on('click', function(e4) {
102
+ e4.preventDefault();
103
+ self.process_offset4( 0, self );
104
+ });
105
+ process_offset4 = function( offset4, self ) {
106
+ $.ajax({
107
+ method : 'POST',
108
+ url : seopressAjaxMigrate.seopress_rk_migrate.seopress_rk_migration,
109
+ data : {
110
+ action: 'seopress_rk_migration',
111
+ offset4: offset4,
112
+ _ajax_nonce: seopressAjaxMigrate.seopress_rk_migrate.seopress_nonce,
113
+ },
114
+ success : function( data ) {
115
+ if( 'done' == data.data.offset4 ) {
116
+ $('#seopress-rk-migrate').removeAttr("disabled");
117
+ $( '.spinner' ).css( "visibility", "hidden" );
118
+ $( '#rk-migration-tool .log' ).html(seopressAjaxMigrate.i18n);
119
+ } else {
120
+ self.process_offset4( parseInt( data.data.offset4 ), self );
121
+ }
122
+ },
123
+ });
124
+ };
125
+
126
+ $('#seopress-rk-migrate').on('click', function() {
127
+ $(this).attr("disabled", "disabled");
128
+ $( '#rk-migration-tool .spinner' ).css( "visibility", "visible" );
129
+ $( '#rk-migration-tool .spinner' ).css( "float", "none" );
130
+ $( '#rk-migration-tool .log' ).html('');
131
+ });
132
+ });
assets/js/tagify.min.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /**
2
+ * Tagify (v 3.2.6)- tags input component
3
+ * By Yair Even-Or
4
+ * Don't sell this code. (c)
5
+ * https://github.com/yairEO/tagify
6
+ */
7
+ !function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.Tagify=e()}(this,function(){"use strict";function u(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,s)}return i}function g(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?s(i,!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):s(i).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function n(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function t(t,e){if(!t)return console.warn("Tagify: ","invalid input element ",t),this;this.applySettings(t,e||{}),this.state={editing:{},actions:{},dropdown:{}},this.value=[],this.listeners={},this.DOM={},this.extend(this,new this.EventDispatcher(this)),this.build(t),this.getCSSVars(),this.loadOriginalValues(),this.events.customBinding.call(this),this.events.binding.call(this),t.autofocus&&this.DOM.input.focus()}return t.prototype={isIE:window.document.documentMode,TEXTS:{empty:"empty",exceed:"number of tags exceeded",pattern:"pattern mismatch",duplicate:"already exists",notAllowed:"not allowed"},DEFAULTS:{delimiters:",",pattern:null,maxTags:1/0,callbacks:{},addTagOnBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,keepInvalidTags:!1,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,editTags:2,transformTag:function(){},autoComplete:{enabled:!0,rightKey:!1},dropdown:{classname:"",enabled:2,maxItems:10,searchKeys:[],fuzzySearch:!0,highlightFirst:!1,closeOnSelect:!0,position:"all"}},templates:{wrapper:function(t,e){return'<tags class="tagify '.concat(e.mode?"tagify--"+e.mode:""," ").concat(t.className,'"\n ').concat(e.readonly?'readonly aria-readonly="true"':'aria-haspopup="listbox" aria-expanded="false"','\n role="tagslist"\n tabIndex="-1">\n <span contenteditable data-placeholder="').concat(e.placeholder||"&#8203;",'" aria-placeholder="').concat(e.placeholder||"",'"\n class="tagify__input"\n role="textbox"\n aria-controls="dropdown"\n aria-autocomplete="both"\n aria-multiline="').concat("mix"==e.mode,'"></span>\n </tags>')},tag:function(t,e){return"<tag title='".concat(e.title||t,"'\n contenteditable='false'\n spellcheck='false'\n tabIndex=\"-1\"\n class='tagify__tag ").concat(e.class?e.class:"","'\n ").concat(this.getAttributes(e),">\n <x title='' class='tagify__tag__removeBtn' role='button' aria-label='remove tag'></x>\n <div>\n <span class='tagify__tag-text'>").concat(t,"</span>\n </div>\n </tag>")},dropdownItem:function(t){var e=this.settings.dropdown.mapValueTo,i=((e?"function"==typeof e?e(t):t[e]:t.value)||t.value||t).replace(/`|'/g,"&#39;");return"<div ".concat(this.getAttributes(t),"\n class='tagify__dropdown__item ").concat(t.class?t.class:"",'\'\n tabindex="0"\n role="option"\n aria-labelledby="dropdown-label">').concat(i,"</div>")}},customEventsList:["add","remove","invalid","input","click","keydown","focus","blur","edit:input","edit:updated","edit:start","edit:keydown","dropdown:show","dropdown:hide","dropdown:select"],applySettings:function(i,t){var s=this;if(this.DEFAULTS.templates=this.templates,this.settings=this.extend({},this.DEFAULTS,t),this.settings.readonly=i.hasAttribute("readonly"),this.settings.placeholder=i.getAttribute("placeholder")||this.settings.placeholder||"",this.isIE&&(this.settings.autoComplete=!1),["whitelist","blacklist"].forEach(function(t){var e=i.getAttribute("data-"+t);e&&(e=e.split(s.settings.delimiters))instanceof Array&&(s.settings[t]=e)}),"autoComplete"in t&&!this.isObject(t.autoComplete)&&(this.settings.autoComplete=this.DEFAULTS.autoComplete,this.settings.autoComplete.enabled=t.autoComplete),i.pattern)try{this.settings.pattern=new RegExp(i.pattern)}catch(t){}if(this.settings.delimiters)try{this.settings.delimiters=new RegExp(this.settings.delimiters,"g")}catch(t){}"select"==this.settings.mode&&(this.settings.dropdown.enabled=0),"mix"==this.settings.mode&&(this.settings.autoComplete.rightKey=!0)},getAttributes:function(t){if("[object Object]"!=Object.prototype.toString.call(t))return"";var e,i,s=Object.keys(t),n="";for(i=s.length;i--;)"class"!=(e=s[i])&&t.hasOwnProperty(e)&&t[e]&&(n+=" "+e+(t[e]?'="'.concat(t[e],'"'):""));return n},parseHTML:function(t){return(new DOMParser).parseFromString(t.trim(),"text/html").body.firstElementChild},escapeHTML:function(t){var e=document.createTextNode(t),i=document.createElement("p");return i.appendChild(e),i.innerHTML},getCaretGlobalPosition:function(){var t=document.getSelection();if(t.rangeCount){var e,i,s=t.getRangeAt(0),n=s.startContainer,a=s.startOffset;if(0<a)return(i=document.createRange()).setStart(n,a-1),i.setEnd(n,a),{left:(e=i.getBoundingClientRect()).right,top:e.top,bottom:e.bottom}}return{left:-9999,top:-9999}},getCSSVars:function(){var t,e,i,s=getComputedStyle(this.DOM.scope,null);this.CSSVars={tagHideTransition:(t=function(t){if(!t)return{};var e=(t=t.trim().split(" ")[0]).split(/\d+/g).filter(function(t){return t}).pop().trim();return{value:+t.split(e).filter(function(t){return t})[0].trim(),unit:e}}((i="tag-hide-transition",s.getPropertyValue("--"+i))),e=t.value,"s"==t.unit?1e3*e:e)}},build:function(t){var e=this.DOM,i=this.settings.templates.wrapper(t,this.settings);e.originalInput=t,e.scope=this.parseHTML(i),e.input=e.scope.querySelector("[contenteditable]"),t.parentNode.insertBefore(e.scope,t),0<=this.settings.dropdown.enabled&&this.dropdown.init.call(this)},destroy:function(){this.DOM.scope.parentNode.removeChild(this.DOM.scope),this.dropdown.hide.call(this,!0)},loadOriginalValues:function(t){if(t=t||this.DOM.originalInput.value)if(this.removeAllTags(),"mix"==this.settings.mode)this.parseMixTags(t.trim());else{try{"string"!=typeof JSON.parse(t)&&(t=JSON.parse(t))}catch(t){}this.addTags(t).forEach(function(t){return t&&t.classList.add("tagify--noAnim")})}},isObject:function(t){var e=Object.prototype.toString.call(t).split(" ")[1].slice(0,-1);return t===Object(t)&&"Array"!=e&&"Function"!=e&&"RegExp"!=e&&"HTMLUnknownElement"!=e},extend:function(t,e,i){var s=this;function n(t,e){for(var i in e)e.hasOwnProperty(i)&&(s.isObject(e[i])?s.isObject(t[i])?n(t[i],e[i]):t[i]=Object.assign({},e[i]):t[i]=e[i])}return t instanceof Object||(t={}),n(t,e),i&&n(t,i),t},cloneEvent:function(t){var e={};for(var i in t)e[i]=t[i];return e},EventDispatcher:function(s){var n=document.createTextNode("");function i(e,t,i){i&&t.split(/\s+/g).forEach(function(t){return n[e+"EventListener"].call(n,t,i)})}this.off=function(t,e){return i("remove",t,e),this},this.on=function(t,e){return e&&"function"==typeof e&&i("add",t,e),this},this.trigger=function(t,e){var i;if(t)if(s.settings.isJQueryPlugin)"remove"==t&&(t="removeTag"),jQuery(s.DOM.originalInput).triggerHandler(t,[e]);else{try{i=new CustomEvent(t,{detail:this.extend({},e,{tagify:this})})}catch(t){console.warn(t)}n.dispatchEvent(i)}}},loading:function(t){return this.DOM.scope.classList[t?"add":"remove"]("tagify--loading"),this},toggleFocusClass:function(t){this.DOM.scope.classList.toggle("tagify--focus",!!t)},events:{customBinding:function(){var e=this;this.customEventsList.forEach(function(t){e.on(t,e.settings.callbacks[t])})},binding:function(t){var e,i=!(0<arguments.length&&void 0!==t)||t,s=this.events.callbacks,n=i?"addEventListener":"removeEventListener";if(!this.state.mainEvents||!i)for(var a in(this.state.mainEvents=i)&&!this.listeners.main&&(this.DOM.input.addEventListener(this.isIE?"keydown":"input",s[this.isIE?"onInputIE":"onInput"].bind(this)),this.settings.isJQueryPlugin&&jQuery(this.DOM.originalInput).on("tagify.removeAllTags",this.removeAllTags.bind(this))),e=this.listeners.main=this.listeners.main||{focus:["input",s.onFocusBlur.bind(this)],blur:["input",s.onFocusBlur.bind(this)],keydown:["input",s.onKeydown.bind(this)],click:["scope",s.onClickScope.bind(this)],dblclick:["scope",s.onDoubleClickScope.bind(this)]}){if("blur"==a&&!i)return;this.DOM[e[a][0]][n](a,e[a][1])}},callbacks:{onFocusBlur:function(t){var e=t.target?t.target.textContent.trim():"",i=this.settings,s=t.type;if(!(t.relatedTarget&&t.relatedTarget.classList.contains("tagify__tag")&&this.DOM.scope.contains(t.relatedTarget))){if("blur"==s&&t.relatedTarget===this.DOM.scope)return this.dropdown.hide.call(this),void this.DOM.input.focus();if(!this.state.actions.selectOption||!i.dropdown.enabled&&i.dropdown.closeOnSelect)if(this.state.hasFocus="focus"==s&&+new Date,this.toggleFocusClass(this.state.hasFocus),this.setRangeAtStartEnd(!1),"mix"!=i.mode){if("focus"==s)return this.trigger("focus",{relatedTarget:t.relatedTarget}),void(0===i.dropdown.enabled&&"select"!=i.mode&&this.dropdown.show.call(this));"blur"==s&&(this.trigger("blur",{relatedTarget:t.relatedTarget}),this.loading(!1),e&&!this.state.actions.selectOption&&i.addTagOnBlur&&this.addTags(e,!0)),this.DOM.input.removeAttribute("style"),this.dropdown.hide.call(this)}else"blur"==t.type&&this.dropdown.hide.call(this)}},onKeydown:function(t){var e,i=this,s=t.target.textContent.trim();if(this.trigger("keydown",{originalEvent:this.cloneEvent(t)}),"mix"==this.settings.mode){switch(t.key){case"Left":case"ArrowLeft":this.state.actions.ArrowLeft=!0;break;case"Delete":case"Backspace":var n=document.getSelection();!!navigator.userAgent.match(/firefox/i)&&n&&0==n.anchorOffset&&this.removeTag(n.anchorNode.previousSibling);var a=[];e=this.DOM.input.children,setTimeout(function(){[].forEach.call(e,function(t){return a.push(t.getAttribute("value"))}),i.value=i.value.filter(function(t){return-1!=a.indexOf(t.value)})})}return!0}switch(t.key){case"Backspace":""!=s&&8203!=s.charCodeAt(0)||(!0===this.settings.backspace?this.removeTag():"edit"==this.settings.backspace&&setTimeout(this.editTag.bind(this),0));break;case"Esc":case"Escape":if(this.state.dropdown.visible)return;t.target.blur();break;case"Down":case"ArrowDown":this.state.dropdown.visible||this.dropdown.show.call(this);break;case"ArrowRight":var o=this.state.inputSuggestion||this.state.ddItemData;if(o&&this.settings.autoComplete.rightKey)return void this.addTags([o],!0);break;case"Tab":if(!s)return!0;case"Enter":t.preventDefault(),setTimeout(function(){i.state.actions.selectOption||i.addTags(s,!0)})}},onInput:function(t){var e="mix"==this.settings.mode?this.DOM.input.textContent:this.input.normalize.call(this),i=e.length>=this.settings.dropdown.enabled,s={value:e,inputElm:this.DOM.input};if("mix"==this.settings.mode)return this.events.callbacks.onMixTagsInput.call(this,t);e?this.input.value!=e&&(s.isValid=this.validateTag(e),this.trigger("input",s),this.input.set.call(this,e,!1),-1!=e.search(this.settings.delimiters)?this.addTags(e)&&this.input.set.call(this):0<=this.settings.dropdown.enabled&&this.dropdown[i?"show":"hide"].call(this,e)):this.input.set.call(this,"")},onMixTagsInput:function(){var t,e,i,s,n,a=this,o=this.settings;if(this.hasMaxTags())return!0;window.getSelection&&0<(t=window.getSelection()).rangeCount&&((e=t.getRangeAt(0).cloneRange()).collapse(!0),e.setStart(window.getSelection().focusNode,0),(s=(i=e.toString().split(o.mixTagsAllowedAfter))[i.length-1].match(o.pattern))&&(this.state.actions.ArrowLeft=!1,this.state.tag={prefix:s[0],value:s.input.split(s[0])[1]},n=this.state.tag.value.length>=o.dropdown.enabled)),this.update(),setTimeout(function(){a.trigger("input",a.extend({},a.state.tag,{textContent:a.DOM.input.textContent})),a.state.tag&&a.dropdown[n?"show":"hide"].call(a,a.state.tag.value)},10)},onInputIE:function(t){var e=this;setTimeout(function(){e.events.callbacks.onInput.call(e,t)})},onClickScope:function(t){var e,i=t.target.closest(".tagify__tag"),s=this.settings,n=new Date-this.state.hasFocus;if(t.target!=this.DOM.scope){if(!t.target.classList.contains("tagify__tag__removeBtn"))return i?(e=this.getNodeIndex(i),this.trigger("click",{tag:i,index:e,data:this.value[e],originalEvent:this.cloneEvent(t)}),void(1==this.settings.editTags&&this.events.callbacks.onDoubleClickScope.call(this,t))):void(t.target==this.DOM.input&&500<n?this.state.dropdown.visible?this.dropdown.hide.call(this):0===s.dropdown.enabled&&"mix"!=s.mode&&this.dropdown.show.call(this):"select"==s.mode&&(this.state.dropdown.visible||this.dropdown.show.call(this)));this.removeTag(t.target.parentNode)}else this.DOM.input.focus()},onEditTagInput:function(t,e){var i=t.closest("tag"),s=this.getNodeIndex(i),n=this.input.normalize.call(this,t),a=n.toLowerCase()==t.originalValue.toLowerCase()||this.validateTag(n);i.classList.toggle("tagify--invalid",!0!==a),i.isValid=a,n.length>=this.settings.dropdown.enabled&&(this.state.editing.value=n,this.dropdown.show.call(this,n)),this.trigger("edit:input",{tag:i,index:s,data:this.extend({},this.value[s],{newValue:n}),originalEvent:this.cloneEvent(e)})},onEditTagBlur:function(t){if(this.state.hasFocus||this.toggleFocusClass(),this.DOM.scope.contains(t)){var e=t.closest(".tagify__tag"),i=this.getNodeIndex(e),s=this.input.normalize.call(this,t),n=s||t.originalValue,a=n!=t.originalValue,o=e.isValid,r=g({},this.value[i],{value:n});s?a?(this.settings.transformTag.call(this,r),void 0!==(o=this.validateTag(r.value))&&!0!==o||this.onEditTagDone(e,r)):this.onEditTagDone(e):this.removeTag(e)}},onEditTagkeydown:function(t){switch(this.trigger("edit:keydown",{originalEvent:this.cloneEvent(t)}),t.key){case"Esc":case"Escape":t.target.textContent=t.target.originalValue;case"Enter":case"Tab":t.preventDefault(),t.target.blur()}},onDoubleClickScope:function(t){var e,i,s=t.target.closest("tag"),n=this.settings;s&&(e=s.classList.contains("tagify__tag--editable"),i=s.hasAttribute("readonly"),"select"==n.mode||n.readonly||e||i||!this.settings.editTags||this.editTag(s),this.toggleFocusClass(!0))}}},editTag:function(t){var e=this,i=0<arguments.length&&void 0!==t?t:this.getLastTag(),s=i.querySelector(".tagify__tag-text"),n=this.getNodeIndex(i),a=this.value[n],o=this.events.callbacks,r=this;if(s){if(!("editable"in a)||a.editable)return i.classList.add("tagify__tag--editable"),s.originalValue=s.textContent,s.setAttribute("contenteditable",!0),s.addEventListener("blur",function(){setTimeout(o.onEditTagBlur.bind(r),0,s)}),s.addEventListener("input",o.onEditTagInput.bind(this,s)),s.addEventListener("keydown",function(t){return o.onEditTagkeydown.call(e,t)}),s.focus(),this.setRangeAtStartEnd(!1,s),this.state.editing={scope:i,input:i.querySelector("[contenteditable]")},this.trigger("edit:start",{tag:i,index:n,data:a}),this}else console.warn("Cannot find element in Tag template: ",".tagify__tag-text")},onEditTagDone:function(t,e){var i={tag:t,index:this.getNodeIndex(t),data:e};this.trigger("edit:beforeUpdate",i),this.replaceTag(t,e),this.trigger("edit:updated",i)},replaceTag:function(t,e){var i=this,s=t.querySelector(".tagify__tag-text"),n=s.cloneNode(!0),a=this.getNodeIndex(t);this.state.editing.locked||(this.state.editing={locked:!0},setTimeout(function(){return delete i.state.editing.locked},500),n.removeAttribute("contenteditable"),t.classList.remove("tagify__tag--editable"),s.parentNode.replaceChild(n,s),e&&(n.innerHTML=e.value,n.title=e.value,this.value[a]=e,this.update()))},setRangeAtStartEnd:function(e,i){i=(i=i||this.DOM.input).lastChild||i;var s=document.getSelection();s.rangeCount&&["Start","End"].forEach(function(t){return s.getRangeAt(0)["set"+t](i,e?0:i.length)})},input:{value:"",set:function(t,e){var i=0<arguments.length&&void 0!==t?t:"",s=!(1<arguments.length&&void 0!==e)||e,n=this.settings.dropdown.closeOnSelect;this.input.value=i,s&&(this.DOM.input.innerHTML=i),!i&&n&&setTimeout(this.dropdown.hide.bind(this),20),this.input.autocomplete.suggest.call(this),this.input.validate.call(this)},validate:function(){var t=!this.input.value||this.validateTag(this.input.value);"select"==this.settings.mode?this.DOM.scope.classList.toggle("tagify--invalid",!0!==t):this.DOM.input.classList.toggle("tagify__input--invalid",!0!==t)},normalize:function(t){var e=t||this.DOM.input,i=[];e.childNodes.forEach(function(t){return 3==t.nodeType&&i.push(t.nodeValue)}),i=i.join("\n");try{i=i.replace(/(?:\r\n|\r|\n)/g,this.settings.delimiters.source.charAt(0))}catch(t){}return i=i.replace(/\s/g," ").replace(/^\s+/,"")},autocomplete:{suggest:function(t){if(this.settings.autoComplete.enabled){"string"==typeof(t=t||{})&&(t={value:t});var e=t.value||"",i=e.substr(0,this.input.value.length).toLowerCase(),s=e.substring(this.input.value.length);e&&this.input.value&&i==this.input.value.toLowerCase()?(this.DOM.input.setAttribute("data-suggest",s),this.state.inputSuggestion=t):(this.DOM.input.removeAttribute("data-suggest"),delete this.state.inputSuggestion)}},set:function(t){var e=this.DOM.input.getAttribute("data-suggest"),i=t||(e?this.input.value+e:null);return!!i&&("mix"==this.settings.mode?this.replaceTextWithNode(document.createTextNode(this.state.tag.prefix+i)):(this.input.set.call(this,i),this.setRangeAtStartEnd()),this.input.autocomplete.suggest.call(this),this.dropdown.hide.call(this),!0)}}},getNodeIndex:function(t){var e=0;if(t)for(;t=t.previousElementSibling;)e++;return e},getTagElms:function(){return this.DOM.scope.querySelectorAll(".tagify__tag")},getLastTag:function(){var t=this.DOM.scope.querySelectorAll("tag:not(.tagify--hide):not([readonly])");return t[t.length-1]},isTagDuplicate:function(e){var i=this;return"select"!=this.settings.mode&&this.value.some(function(t){return i.isObject(e)?JSON.stringify(t).toLowerCase()===JSON.stringify(e).toLowerCase():e.trim().toLowerCase()===t.value.toLowerCase()})},getTagIndexByValue:function(i){var s=[];return this.getTagElms().forEach(function(t,e){t.textContent.trim().toLowerCase()==i.toLowerCase()&&s.push(e)}),s},getTagElmByValue:function(t){var e=this.getTagIndexByValue(t)[0];return this.getTagElms()[e]},markTagByValue:function(t,e){return!!(e=e||this.getTagElmByValue(t))&&(e.classList.add("tagify--mark"),e)},isTagBlacklisted:function(e){return e=e.toLowerCase().trim(),this.settings.blacklist.filter(function(t){return e==t.toLowerCase()}).length},isTagWhitelisted:function(e){return this.settings.whitelist.some(function(t){return"string"==typeof e?e.trim().toLowerCase()===(t.value||t).toLowerCase():JSON.stringify(t).toLowerCase()===JSON.stringify(e).toLowerCase()})},validateTag:function(t){var e=t.trim(),i=this.settings,s=!0;return e?i.pattern&&!i.pattern.test(e)?s=this.TEXTS.pattern:!i.duplicates&&this.isTagDuplicate(e)?s=this.TEXTS.duplicate:(this.isTagBlacklisted(e)||i.enforceWhitelist&&!this.isTagWhitelisted(e))&&(s=this.TEXTS.notAllowed):s=this.TEXTS.empty,s},hasMaxTags:function(){return this.value.length>=this.settings.maxTags&&this.TEXTS.exceed},normalizeTags:function(t){function i(t){return t.split(a).filter(function(t){return t}).map(function(t){return{value:t.trim()}})}var e,s=this.settings,n=s.whitelist,a=s.delimiters,o=s.mode,r=!!n&&n[0]instanceof Object,l=t instanceof Array,d=l&&t[0]instanceof Object&&"value"in t[0],c=[];if(d)return t=(e=[]).concat.apply(e,u(t.map(function(e){return i(e.value).map(function(t){return g({},e,{},t)})})));if("number"==typeof t&&(t=t.toString()),"string"==typeof t){if(!t.trim())return[];t=i(t)}else if(l){var h;t=(h=[]).concat.apply(h,u(t.map(function(t){return i(t)})))}return r&&(t.forEach(function(e){var t=n.filter(function(t){return t.value.toLowerCase()==e.value.toLowerCase()});t[0]?c.push(t[0]):"mix"!=o&&c.push(e)}),t=c),t},parseMixTags:function(t){var o=this,e=this.settings,r=e.mixTagsInterpolator,l=e.duplicates,d=e.transformTag,c=e.enforceWhitelist;return t=t.split(r[0]).map(function(t,e){var i,s,n=t.split(r[1]),a=n[0];try{i=JSON.parse(a)}catch(t){i=o.normalizeTags(a)[0]}if(!(1<n.length)||c&&!o.isTagWhitelisted(i.value)||!l&&o.isTagDuplicate(i)){if(t)return e?r[0]+t:t}else d.call(o,i),s=o.createTagElem(i),n[0]=s.outerHTML,o.value.push(i);return n.join("")}).join(""),this.DOM.input.innerHTML=t,this.DOM.input.appendChild(document.createTextNode("")),this.update(),t},replaceTextWithNode:function(t,e){if(this.state.tag||e){e=e||this.state.tag.prefix+this.state.tag.value;var i,s,n=window.getSelection(),a=n.anchorNode;return a.splitText(n.anchorOffset),i=a.nodeValue.lastIndexOf(e),(s=a.splitText(i)).nodeValue=s.nodeValue.replace(e,""),a.parentNode.insertBefore(t,s),this.DOM.input.normalize(),s}},selectTag:function(t,e){return this.input.set.call(this,e.value,!0),setTimeout(this.setRangeAtStartEnd.bind(this)),this.getLastTag()?this.replaceTag(this.getLastTag(),e):this.appendTag(t),this.value[0]=e,this.trigger("add",{tag:t,data:e}),this.update(),[t]},addEmptyTag:function(){var t={value:""},e=this.createTagElem(t);this.appendTag(e),this.value.push(t),this.update(),this.editTag(e)},addTags:function(t,e,i){var s,n=this,a=2<arguments.length&&void 0!==i?i:this.settings.skipInvalid,o=[],r=this.settings;return t&&0!=t.length?(t=this.normalizeTags(t),this.state.editing.scope?this.onEditTagDone(this.state.editing.scope,t[0]):"mix"==r.mode?(r.transformTag.call(this,t[0]),s=this.createTagElem(t[0]),this.replaceTextWithNode(s)||this.DOM.input.appendChild(s),this.DOM.input.appendChild(document.createTextNode("")),t[0].prefix=t[0].prefix||this.state.tag?this.state.tag.prefix:(r.pattern.source||r.pattern)[0],this.value.push(t[0]),this.update(),this.state.tag=null,this.trigger("add",this.extend({},{tag:s},{data:t[0]})),this.DOM.input.appendChild(document.createTextNode("")),s):("select"==r.mode&&(e=!1),this.DOM.input.removeAttribute("style"),t.forEach(function(t){var e,i,s={};if(t=Object.assign({},t),r.transformTag.call(n,t),!0!==(e=n.hasMaxTags()||n.validateTag(t.value))){if(a)return;s["aria-invalid"]=!0,s.class=(t.class||"")+" tagify--notAllowed",s.title=e,n.markTagByValue(t.value)}if(s.role="tag",t.readonly&&(s["aria-readonly"]=!0),i=n.createTagElem(n.extend({},t,s)),o.push(i),"select"==r.mode)return n.selectTag(i,t);n.appendTag(i),!0===e?(n.value.push(t),n.update(),n.trigger("add",{tag:i,index:n.value.length-1,data:t})):(n.trigger("invalid",{data:t,index:n.value.length,tag:i,message:e}),r.keepInvalidTags||setTimeout(function(){return n.removeTag(i,!0)},1e3)),n.dropdown.position.call(n)}),t.length&&e&&this.input.set.call(this),this.dropdown.refilter.call(this),o)):("select"==r.mode&&this.removeAllTags(),o)},appendTag:function(t){var e=this.DOM.scope.lastElementChild;e===this.DOM.input?this.DOM.scope.insertBefore(t,e):this.DOM.scope.appendChild(t)},minify:function(t){return t?t.replace(/\>[\r\n ]+\</g,"><").replace(/(<.*?>)|\s+/g,function(t,e){return e||" "}):""},createTagElem:function(t){var e=this.escapeHTML(t.value),i=this.settings.templates.tag.call(this,e,t);return this.settings.readonly&&(t.readonly=!0),i=this.minify(i),this.parseHTML(i)},removeTag:function(t,e,i){if(t=t||this.getLastTag(),i=i||this.CSSVars.tagHideTransition,"string"==typeof t&&(t=this.getTagElmByValue(t)),t instanceof HTMLElement){var s,n=this,a=this.getNodeIndex(t);"select"==this.settings.mode&&(i=0,this.input.set.call(this)),t.classList.contains("tagify--notAllowed")&&(e=!0),i&&10<i?(t.style.width=parseFloat(window.getComputedStyle(t).width)+"px",document.body.clientTop,t.classList.add("tagify--hide"),setTimeout(o,i)):o()}function o(){t.parentNode&&(t.parentNode.removeChild(t),e?n.settings.keepInvalidTags&&n.trigger("remove",{tag:t,index:a}):(s=n.value.splice(a,1)[0],n.update(),n.trigger("remove",{tag:t,index:a,data:s}),n.dropdown.refilter.call(n),n.dropdown.position.call(n)))}},removeAllTags:function(){this.value=[],this.update(),Array.prototype.slice.call(this.getTagElms()).forEach(function(t){return t.parentNode.removeChild(t)}),this.dropdown.position.call(this),"select"==this.settings.mode&&this.input.set.call(this)},preUpdate:function(){this.DOM.scope.classList.toggle("tagify--hasMaxTags",this.value.length>=this.settings.maxTags),this.DOM.scope.classList.toggle("tagify--noTags",!this.value.length)},update:function(){this.preUpdate(),this.DOM.originalInput.value="mix"==this.settings.mode?this.getMixedTagsAsString():this.value.length?JSON.stringify(this.value):""},getMixedTagsAsString:function(){var e=this,i="",s=0,n=this.settings.mixTagsInterpolator;return this.DOM.input.childNodes.forEach(function(t){1==t.nodeType&&t.classList.contains("tagify__tag")?i+=n[0]+JSON.stringify(e.value[s++])+n[1]:i+=t.textContent}),i},getNodeHeight:function(t){var e,i=t.cloneNode(!0);return i.style.cssText="position:fixed; top:-9999px; opacity:0",document.body.appendChild(i),e=i.clientHeight,i.parentNode.removeChild(i),e},dropdown:{init:function(){this.DOM.dropdown=this.dropdown.build.call(this),this.DOM.dropdown.content=this.DOM.dropdown.querySelector(".tagify__dropdown__wrapper")},build:function(){var t=this.settings.dropdown,e=t.position,i=t.classname,s="".concat("manual"==e?"":"tagify__dropdown tagify__dropdown--".concat(e)," ").concat(i).trim();return this.parseHTML('<div class="'.concat(s,'" role="listbox" aria-labelledby="dropdown">\n <div class="tagify__dropdown__wrapper"></div>\n </div>'))},show:function(t){var e,i,s,n,a=this,o=this.settings,r="manual"==o.dropdown.position;if(o.whitelist&&o.whitelist.length&&!1!==o.dropdown.enable){if(this.suggestedListItems=this.dropdown.filterListItems.call(this,t),!this.suggestedListItems.length)return this.input.autocomplete.suggest.call(this),void this.dropdown.hide.call(this);s=(i=this.suggestedListItems[0]).value||i,o.autoComplete&&0==s.indexOf(t)&&this.input.autocomplete.suggest.call(this,i),e=this.dropdown.createListHTML.call(this,this.suggestedListItems),this.DOM.dropdown.content.innerHTML=this.minify(e),(o.enforceWhitelist&&!r||o.dropdown.highlightFirst)&&this.dropdown.highlightOption.call(this,this.DOM.dropdown.content.children[0]),this.DOM.scope.setAttribute("aria-expanded",!0),this.trigger("dropdown:show",this.DOM.dropdown),this.state.dropdown.visible=t||!0,this.dropdown.position.call(this),document.body.contains(this.DOM.dropdown)||(r||(this.events.binding.call(this,!1),n=this.getNodeHeight(this.DOM.dropdown),this.DOM.dropdown.classList.add("tagify__dropdown--initial"),this.dropdown.position.call(this,n),document.body.appendChild(this.DOM.dropdown),setTimeout(function(){return a.DOM.dropdown.classList.remove("tagify__dropdown--initial")})),setTimeout(this.dropdown.events.binding.bind(this)))}},hide:function(t){var e=this.DOM,i=e.scope,s=e.dropdown,n="manual"==this.settings.dropdown.position&&!t;s&&document.body.contains(s)&&!n&&(window.removeEventListener("resize",this.dropdown.position),this.dropdown.events.binding.call(this,!1),setTimeout(this.events.binding.bind(this),250),i.setAttribute("aria-expanded",!1),s.parentNode.removeChild(s),this.state.dropdown.visible=!1,this.state.ddItemData=null,this.state.ddItemElm=null,this.trigger("dropdown:hide",s))},refilter:function(){this.suggestedListItems=this.dropdown.filterListItems.call(this,"");var t=this.dropdown.createListHTML.call(this,this.suggestedListItems);this.DOM.dropdown.content.innerHTML=this.minify(t)},position:function(t){var e,i,s,n,a,o,r=this.DOM.dropdown;this.state.dropdown.visible&&(o="text"==this.settings.dropdown.position?(n=(i=this.getCaretGlobalPosition()).bottom,s=i.top,a=i.left,"auto"):(s=(i=this.DOM.scope.getBoundingClientRect()).top,n=i.bottom-1,a=i.left,i.width+"px"),s=Math.floor(s),n=Math.ceil(n),e=document.documentElement.clientHeight-n<(t||r.clientHeight),r.style.cssText="left:"+(a+window.pageXOffset)+"px; width:"+o+";"+(e?"bottom:"+(document.documentElement.clientHeight-s-window.pageYOffset-2)+"px;":"top: "+(n+window.pageYOffset)+"px"),r.setAttribute("placement",e?"top":"bottom"))},events:{binding:function(t){var e=!(0<arguments.length&&void 0!==t)||t,i=this.dropdown.events.callbacks,s=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this),onKeyDown:i.onKeyDown.bind(this),onMouseOver:i.onMouseOver.bind(this),onMouseLeave:i.onMouseLeave.bind(this),onClick:i.onClick.bind(this)},n=e?"addEventListener":"removeEventListener";"manual"!=this.settings.dropdown.position&&(window[n]("resize",s.position),window[n]("keydown",s.onKeyDown)),this.DOM.dropdown[n]("mouseover",s.onMouseOver),this.DOM.dropdown[n]("mouseleave",s.onMouseLeave),this.DOM.dropdown[n]("mousedown",s.onClick),this.DOM[this.listeners.main.click[0]][n]("click",this.listeners.main.click[1])},callbacks:{onKeyDown:function(t){var e=this.DOM.dropdown.querySelector("[class$='--active']"),i=e;switch(t.key){case"ArrowDown":case"ArrowUp":case"Down":case"Up":var s;t.preventDefault(),i=(i=i&&i[("ArrowUp"==t.key||"Up"==t.key?"previous":"next")+"ElementSibling"])||(s=this.DOM.dropdown.content.children)["ArrowUp"==t.key||"Up"==t.key?s.length-1:0],this.dropdown.highlightOption.call(this,i,!0);break;case"Escape":case"Esc":this.dropdown.hide.call(this);break;case"ArrowRight":if(this.state.actions.ArrowLeft)return;case"Tab":if(t.preventDefault(),"mix"!=this.settings.mode&&!this.settings.autoComplete.rightKey){try{var n=i?i.textContent:this.suggestedListItems[0].value;this.input.autocomplete.set.call(this,n)}catch(t){}return!1}case"Enter":t.preventDefault(),this.dropdown.selectOption.call(this,e);break;case"Backspace":if("mix"==this.settings.mode||this.state.editing.scope)return;var a=this.input.value.trim();""!=a&&8203!=a.charCodeAt(0)||(!0===this.settings.backspace?this.removeTag():"edit"==this.settings.backspace&&setTimeout(this.editTag.bind(this),0))}},onMouseOver:function(t){var e=t.target.closest(".tagify__dropdown__item");e&&this.dropdown.highlightOption.call(this,e)},onMouseLeave:function(){this.dropdown.highlightOption.call(this)},onClick:function(t){if(0==t.button&&t.target!=this.DOM.dropdown){var e=t.target.closest(".tagify__dropdown__item");this.dropdown.selectOption.call(this,e)}}}},highlightOption:function(t,e){var i,s="tagify__dropdown__item--active";if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(s),this.state.ddItemElm.removeAttribute("aria-selected")),!t)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);i=this.suggestedListItems[this.getNodeIndex(t)],this.state.ddItemData=i,(this.state.ddItemElm=t).classList.add(s),t.setAttribute("aria-selected",!0),e&&(t.parentNode.scrollTop=t.clientHeight+t.offsetTop-t.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,i),"manual"!=this.settings.dropdown.position&&this.dropdown.position.call(this))},selectOption:function(t){var e=this;if(t){this.state.actions.selectOption=!0,setTimeout(function(){return e.state.actions.selectOption=!1},50);var i=this.settings.dropdown.closeOnSelect,s=this.suggestedListItems[this.getNodeIndex(t)]||this.input.value;this.trigger("dropdown:select",s),this.addTags([s],!0),setTimeout(function(){e.DOM.input.focus(),e.toggleFocusClass(!0)}),i&&this.dropdown.hide.call(this)}},filterListItems:function(t){var i,e,s,n,a=this,o=this.settings,r=[],l=o.whitelist,d=o.dropdown.maxItems||1/0,c=o.dropdown.searchKeys.concat(["searchBy","value"]),h=0;if(!t)return(o.duplicates?l:l.filter(function(t){return!a.isTagDuplicate(t.value||t)})).slice(0,d);for(;h<l.length&&(i=l[h]instanceof Object?l[h]:{value:l[h]},s=c.reduce(function(t,e){return t+" "+(i[e]||"")},"").toLowerCase().indexOf(t.toLowerCase()),e=o.dropdown.fuzzySearch?0<=s:0==s,n=!o.duplicates&&this.isTagDuplicate(i.value),e&&!n&&d--&&r.push(i),0!=d);h++);return r},createListHTML:function(t){var e=this.settings.templates.dropdownItem.bind(this);return this.minify(t.map(e).join(""))}}},t});
contributors.txt CHANGED
@@ -1,8 +1,7 @@
1
- Great people who contributed to this plugin:
2
 
3
  Developers:
4
  - Benjamin Denis: contact@seopress.org / @wp_seopress
5
- - Thomas Deneulin: @tdeneulin
6
  - Julio Potier: @juliobox
7
  - Mickael Gris: @mgris
8
 
1
+ Great people who contributed to this plugin :
2
 
3
  Developers:
4
  - Benjamin Denis: contact@seopress.org / @wp_seopress
 
5
  - Julio Potier: @juliobox
6
  - Mickael Gris: @mgris
7
 
inc/admin/admin-features-list.php CHANGED
File without changes
inc/admin/admin-get-started.php CHANGED
File without changes
inc/admin/admin-header.php CHANGED
File without changes
inc/admin/admin-metaboxes-form.php CHANGED
File without changes
inc/admin/admin-metaboxes-get-content-analysis.php CHANGED
File without changes
inc/admin/admin-metaboxes-render-content-analysis.php CHANGED
File without changes
inc/admin/admin-metaboxes.php CHANGED
@@ -6,546 +6,546 @@ defined( 'ABSPATH' ) or die( 'Please don&rsquo;t call the plugin directly. Thank
6
  //Restrict SEO metaboxes to user roles
7
  ///////////////////////////////////////////////////////////////////////////////////////////////////
8
  function seopress_advanced_security_metaboxe_role_hook_option() {
9
- $seopress_advanced_security_metaboxe_role_hook_option = get_option("seopress_advanced_option_name");
10
- if ( ! empty ( $seopress_advanced_security_metaboxe_role_hook_option ) ) {
11
- foreach ($seopress_advanced_security_metaboxe_role_hook_option as $key => $seopress_advanced_security_metaboxe_role_hook_value)
12
- $options[$key] = $seopress_advanced_security_metaboxe_role_hook_value;
13
- if (isset($seopress_advanced_security_metaboxe_role_hook_option['seopress_advanced_security_metaboxe_role'])) {
14
- return $seopress_advanced_security_metaboxe_role_hook_option['seopress_advanced_security_metaboxe_role'];
15
- }
16
- }
17
  }
18
 
19
  function seopress_advanced_security_metaboxe_ca_role_hook_option() {
20
- $seopress_advanced_security_metaboxe_ca_role_hook_option = get_option("seopress_advanced_option_name");
21
- if ( ! empty ( $seopress_advanced_security_metaboxe_ca_role_hook_option ) ) {
22
- foreach ($seopress_advanced_security_metaboxe_ca_role_hook_option as $key => $seopress_advanced_security_metaboxe_ca_role_hook_value)
23
- $options[$key] = $seopress_advanced_security_metaboxe_ca_role_hook_value;
24
- if (isset($seopress_advanced_security_metaboxe_ca_role_hook_option['seopress_advanced_security_metaboxe_ca_role'])) {
25
- return $seopress_advanced_security_metaboxe_ca_role_hook_option['seopress_advanced_security_metaboxe_ca_role'];
26
- }
27
- }
28
  }
29
 
30
  ///////////////////////////////////////////////////////////////////////////////////////////////////
31
  //Check global settings
32
  ///////////////////////////////////////////////////////////////////////////////////////////////////
33
  if (!function_exists('seopress_titles_single_cpt_noindex_option')) {
34
- function seopress_titles_single_cpt_noindex_option() {
35
- global $post;
36
- $seopress_get_current_cpt = get_post_type($post);
37
-
38
- $seopress_titles_single_cpt_noindex_option = get_option("seopress_titles_option_name");
39
- if ( ! empty ( $seopress_titles_single_cpt_noindex_option ) ) {
40
- foreach ($seopress_titles_single_cpt_noindex_option as $key => $seopress_titles_single_cpt_noindex_value)
41
- $options[$key] = $seopress_titles_single_cpt_noindex_value;
42
- if (isset($seopress_titles_single_cpt_noindex_option['seopress_titles_single_titles'][$seopress_get_current_cpt]['noindex'])) {
43
- return $seopress_titles_single_cpt_noindex_option['seopress_titles_single_titles'][$seopress_get_current_cpt]['noindex'];
44
- }
45
- }
46
- }
47
  }
48
 
49
  if (!function_exists('seopress_titles_noindex_option')) {
50
- function seopress_titles_noindex_option() {
51
- $seopress_titles_noindex_option = get_option("seopress_titles_option_name");
52
- if ( ! empty ( $seopress_titles_noindex_option ) ) {
53
- foreach ($seopress_titles_noindex_option as $key => $seopress_titles_noindex_value)
54
- $options[$key] = $seopress_titles_noindex_value;
55
- if (isset($seopress_titles_noindex_option['seopress_titles_noindex'])) {
56
- return $seopress_titles_noindex_option['seopress_titles_noindex'];
57
- }
58
- }
59
- }
60
  }
61
 
62
  if (!function_exists('seopress_titles_single_cpt_nofollow_option')) {
63
- function seopress_titles_single_cpt_nofollow_option() {
64
- global $post;
65
- $seopress_get_current_cpt = get_post_type($post);
66
-
67
- $seopress_titles_single_cpt_nofollow_option = get_option("seopress_titles_option_name");
68
- if ( ! empty ( $seopress_titles_single_cpt_nofollow_option ) ) {
69
- foreach ($seopress_titles_single_cpt_nofollow_option as $key => $seopress_titles_single_cpt_nofollow_value)
70
- $options[$key] = $seopress_titles_single_cpt_nofollow_value;
71
- if (isset($seopress_titles_single_cpt_nofollow_option['seopress_titles_single_titles'][$seopress_get_current_cpt]['nofollow'])) {
72
- return $seopress_titles_single_cpt_nofollow_option['seopress_titles_single_titles'][$seopress_get_current_cpt]['nofollow'];
73
- }
74
- }
75
- }
76
  }
77
 
78
  if (!function_exists('seopress_titles_nofollow_option')) {
79
- function seopress_titles_nofollow_option() {
80
- $seopress_titles_nofollow_option = get_option("seopress_titles_option_name");
81
- if ( ! empty ( $seopress_titles_nofollow_option ) ) {
82
- foreach ($seopress_titles_nofollow_option as $key => $seopress_titles_nofollow_value)
83
- $options[$key] = $seopress_titles_nofollow_value;
84
- if (isset($seopress_titles_nofollow_option['seopress_titles_nofollow'])) {
85
- return $seopress_titles_nofollow_option['seopress_titles_nofollow'];
86
- }
87
- }
88
- }
89
  }
90
 
91
  if (!function_exists('seopress_titles_noodp_option')) {
92
- function seopress_titles_noodp_option() {
93
- $seopress_titles_noodp_option = get_option("seopress_titles_option_name");
94
- if ( ! empty ( $seopress_titles_noodp_option ) ) {
95
- foreach ($seopress_titles_noodp_option as $key => $seopress_titles_noodp_value)
96
- $options[$key] = $seopress_titles_noodp_value;
97
- if (isset($seopress_titles_noodp_option['seopress_titles_noodp'])) {
98
- return $seopress_titles_noodp_option['seopress_titles_noodp'];
99
- }
100
- }
101
- }
102
  }
103
 
104
  if (!function_exists('seopress_titles_noarchive_option')) {
105
- function seopress_titles_noarchive_option() {
106
- $seopress_titles_noarchive_option = get_option("seopress_titles_option_name");
107
- if ( ! empty ( $seopress_titles_noarchive_option ) ) {
108
- foreach ($seopress_titles_noarchive_option as $key => $seopress_titles_noarchive_value)
109
- $options[$key] = $seopress_titles_noarchive_value;
110
- if (isset($seopress_titles_noarchive_option['seopress_titles_noarchive'])) {
111
- return $seopress_titles_noarchive_option['seopress_titles_noarchive'];
112
- }
113
- }
114
- }
115
  }
116
 
117
  if (!function_exists('seopress_titles_nosnippet_option')) {
118
- function seopress_titles_nosnippet_option() {
119
- $seopress_titles_nosnippet_option = get_option("seopress_titles_option_name");
120
- if ( ! empty ( $seopress_titles_nosnippet_option ) ) {
121
- foreach ($seopress_titles_nosnippet_option as $key => $seopress_titles_nosnippet_value)
122
- $options[$key] = $seopress_titles_nosnippet_value;
123
- if (isset($seopress_titles_nosnippet_option['seopress_titles_nosnippet'])) {
124
- return $seopress_titles_nosnippet_option['seopress_titles_nosnippet'];
125
- }
126
- }
127
- }
128
  }
129
 
130
  if (!function_exists('seopress_titles_noimageindex_option')) {
131
- function seopress_titles_noimageindex_option() {
132
- $seopress_titles_noimageindex_option = get_option("seopress_titles_option_name");
133
- if ( ! empty ( $seopress_titles_noimageindex_option ) ) {
134
- foreach ($seopress_titles_noimageindex_option as $key => $seopress_titles_noimageindex_value)
135
- $options[$key] = $seopress_titles_noimageindex_value;
136
- if (isset($seopress_titles_noimageindex_option['seopress_titles_noimageindex'])) {
137
- return $seopress_titles_noimageindex_option['seopress_titles_noimageindex'];
138
- }
139
- }
140
- }
141
  }
142
 
143
  ///////////////////////////////////////////////////////////////////////////////////////////////////
144
  //Display metabox in Custom Post Type
145
  ///////////////////////////////////////////////////////////////////////////////////////////////////
146
  function seopress_display_seo_metaboxe() {
147
- add_action('add_meta_boxes','seopress_init_metabox');
148
- function seopress_init_metabox(){
149
- if (function_exists('seopress_advanced_appearance_metaboxe_position_option')) {
150
- $seopress_advanced_appearance_metaboxe_position_option = seopress_advanced_appearance_metaboxe_position_option();
151
- } else {
152
- $seopress_advanced_appearance_metaboxe_position_option = 'default';
153
- }
154
-
155
- if (function_exists('seopress_get_post_types')) {
156
-
157
- $seopress_get_post_types = seopress_get_post_types();
158
-
159
- $seopress_get_post_types = apply_filters('seopress_metaboxe_seo', $seopress_get_post_types);
160
-
161
- if (!empty($seopress_get_post_types)) {
162
- foreach ($seopress_get_post_types as $key => $value) {
163
- add_meta_box('seopress_cpt', __('SEO','wp-seopress'), 'seopress_cpt', $key, 'normal', $seopress_advanced_appearance_metaboxe_position_option);
164
- }
165
- }
166
- add_meta_box('seopress_cpt', __('SEO','wp-seopress'), 'seopress_cpt', 'seopress_404', 'normal', $seopress_advanced_appearance_metaboxe_position_option);
167
- }
168
- }
169
-
170
- function seopress_cpt( $post ){
171
- global $typenow;
172
- $prefix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
173
- wp_nonce_field( plugin_basename( __FILE__ ), 'seopress_cpt_nonce' );
174
-
175
- //init
176
- $disabled = array();
177
-
178
- wp_enqueue_script( 'seopress-cpt-tabs-js', plugins_url( 'assets/js/seopress-tabs2' . $prefix . '.js', dirname( dirname( __FILE__ ) ) ), [ 'jquery-ui-tabs' ], SEOPRESS_VERSION );
179
-
180
- if ("seopress_404" != $typenow) {
181
- wp_enqueue_script('jquery-ui-accordion');
182
-
183
- //Register Google Snippet Preview / Content Analysis JS
184
- wp_enqueue_script( 'seopress-cpt-counters-js', plugins_url( 'assets/js/seopress-counters' . $prefix . '.js', dirname( dirname( __FILE__ ) ) ), [ 'jquery', 'jquery-ui-tabs', 'jquery-ui-accordion' ], SEOPRESS_VERSION, true );
185
-
186
- //If Gutenberg ON
187
- if ( function_exists( 'get_current_screen' ) ) {
188
- $get_current_screen = get_current_screen();
189
- if ( isset( $get_current_screen->is_block_editor ) ) {
190
- if ( $get_current_screen->is_block_editor ) {
191
- wp_enqueue_script( 'seopress-block-editor-js', plugins_url( 'assets/js/seopress-block-editor' . $prefix . '.js', dirname( dirname( __FILE__ ) ) ), [ 'jquery' ], SEOPRESS_VERSION, true );
192
- }
193
- }
194
- }
195
-
196
- wp_enqueue_script( 'seopress-cpt-video-sitemap-js', plugins_url( 'assets/js/seopress-sitemap-video' . $prefix . '.js', dirname(dirname( __FILE__ ))), [ 'jquery', 'jquery-ui-accordion' ], SEOPRESS_VERSION );
197
-
198
- $seopress_real_preview = array(
199
- 'seopress_nonce' => wp_create_nonce('seopress_real_preview_nonce'),
200
- 'seopress_real_preview' => admin_url('admin-ajax.php'),
201
- 'i18n' => [ 'progress' => __( 'Analysis in progress...', 'wp-seopress' ) ]
202
- );
203
- wp_localize_script( 'seopress-cpt-counters-js', 'seopressAjaxRealPreview', $seopress_real_preview );
204
-
205
- wp_enqueue_script( 'seopress-media-uploader-js', plugins_url('assets/js/seopress-media-uploader' . $prefix . '.js', dirname( dirname( __FILE__ ) ) ), [ 'jquery' ], SEOPRESS_VERSION, false );
206
- wp_enqueue_media();
207
- }
208
-
209
- $seopress_titles_title = get_post_meta($post->ID,'_seopress_titles_title',true);
210
- $seopress_titles_desc = get_post_meta($post->ID,'_seopress_titles_desc',true);
211
-
212
- $disabled['robots_index'] ='';
213
- if (seopress_titles_single_cpt_noindex_option() || seopress_titles_noindex_option() || post_password_required($post->ID) ===true) {
214
- $seopress_robots_index = 'yes';
215
- $disabled['robots_index'] = 'disabled';
216
- } else {
217
- $seopress_robots_index = get_post_meta($post->ID,'_seopress_robots_index',true);
218
-
219
- }
220
-
221
- $disabled['robots_follow'] ='';
222
- if (seopress_titles_single_cpt_nofollow_option() || seopress_titles_nofollow_option()) {
223
- $seopress_robots_follow = 'yes';
224
- $disabled['robots_follow'] = 'disabled';
225
- } else {
226
- $seopress_robots_follow = get_post_meta($post->ID,'_seopress_robots_follow',true);
227
- }
228
-
229
- $disabled['robots_odp'] ='';
230
- if (seopress_titles_noodp_option()) {
231
- $seopress_robots_odp = 'yes';
232
- $disabled['robots_odp'] = 'disabled';
233
- } else {
234
- $seopress_robots_odp = get_post_meta($post->ID,'_seopress_robots_odp',true);
235
- }
236
-
237
- $disabled['archive'] ='';
238
- if (seopress_titles_noarchive_option()) {
239
- $seopress_robots_archive = 'yes';
240
- $disabled['archive'] = 'disabled';
241
- } else {
242
- $seopress_robots_archive = get_post_meta($post->ID,'_seopress_robots_archive',true);
243
- }
244
-
245
- $disabled['snippet'] ='';
246
- if (seopress_titles_nosnippet_option()) {
247
- $seopress_robots_snippet = 'yes';
248
- $disabled['snippet'] = 'disabled';
249
- } else {
250
- $seopress_robots_snippet = get_post_meta($post->ID,'_seopress_robots_snippet',true);
251
- }
252
-
253
- $disabled['imageindex'] ='';
254
- if (seopress_titles_noimageindex_option()) {
255
- $seopress_robots_imageindex = 'yes';
256
- $disabled['imageindex'] = 'disabled';
257
- } else {
258
- $seopress_robots_imageindex = get_post_meta($post->ID,'_seopress_robots_imageindex',true);
259
- }
260
-
261
- $seopress_robots_canonical = get_post_meta($post->ID,'_seopress_robots_canonical',true);
262
- $seopress_robots_primary_cat = get_post_meta($post->ID,'_seopress_robots_primary_cat',true);
263
- if (is_plugin_active('wp-seopress-pro/seopress-pro.php')) {
264
- $seopress_robots_breadcrumbs = get_post_meta($post->ID,'_seopress_robots_breadcrumbs',true);
265
- }
266
- $seopress_social_fb_title = get_post_meta($post->ID,'_seopress_social_fb_title',true);
267
- $seopress_social_fb_desc = get_post_meta($post->ID,'_seopress_social_fb_desc',true);
268
- $seopress_social_fb_img = get_post_meta($post->ID,'_seopress_social_fb_img',true);
269
- $seopress_social_twitter_title = get_post_meta($post->ID,'_seopress_social_twitter_title',true);
270
- $seopress_social_twitter_desc = get_post_meta($post->ID,'_seopress_social_twitter_desc',true);
271
- $seopress_social_twitter_img = get_post_meta($post->ID,'_seopress_social_twitter_img',true);
272
- $seopress_redirections_enabled = get_post_meta($post->ID,'_seopress_redirections_enabled',true);
273
- $seopress_redirections_type = get_post_meta($post->ID,'_seopress_redirections_type',true);
274
- $seopress_redirections_value = get_post_meta($post->ID,'_seopress_redirections_value',true);
275
- $seopress_redirections_param = get_post_meta($post->ID,'_seopress_redirections_param',true);
276
- if (is_plugin_active('wp-seopress-pro/seopress-pro.php')) {
277
- $seopress_news_disabled = get_post_meta($post->ID,'_seopress_news_disabled',true);
278
- $seopress_video_disabled = get_post_meta($post->ID,'_seopress_video_disabled',true);
279
- $seopress_video = get_post_meta($post->ID,'_seopress_video');
280
- }
281
-
282
- require_once ( dirname( __FILE__ ) . '/admin-metaboxes-form.php'); //Metaboxe HTML
283
- }
284
-
285
- add_action('save_post','seopress_save_metabox', 10, 2);
286
- function seopress_save_metabox($post_id, $post){
287
- //Nonce
288
- if ( !isset( $_POST['seopress_cpt_nonce'] ) || !wp_verify_nonce( $_POST['seopress_cpt_nonce'], plugin_basename( __FILE__ ) ) )
289
- return $post_id;
290
-
291
- //Post type object
292
- $post_type = get_post_type_object( $post->post_type );
293
-
294
- //Check permission
295
- if ( !current_user_can( $post_type->cap->edit_post, $post_id ) )
296
- return $post_id;
297
-
298
- if ( 'attachment' !== get_post_type($post_id)) {
299
- $seo_tabs = array();
300
- $seo_tabs = json_decode(stripslashes(htmlspecialchars_decode($_POST['seo_tabs'])));
301
-
302
- if (in_array('title-tab', $seo_tabs)) {
303
- if(isset($_POST['seopress_titles_title'])){
304
- update_post_meta($post_id, '_seopress_titles_title', esc_html($_POST['seopress_titles_title']));
305
- }
306
- if(isset($_POST['seopress_titles_desc'])){
307
- update_post_meta($post_id, '_seopress_titles_desc', esc_html($_POST['seopress_titles_desc']));
308
- }
309
- }
310
- if (in_array('advanced-tab', $seo_tabs)) {
311
- if( isset( $_POST[ 'seopress_robots_index' ] ) ) {
312
- update_post_meta( $post_id, '_seopress_robots_index', 'yes' );
313
- } else {
314
- delete_post_meta( $post_id, '_seopress_robots_index', '' );
315
- }
316
- if( isset( $_POST[ 'seopress_robots_follow' ] ) ) {
317
- update_post_meta( $post_id, '_seopress_robots_follow', 'yes' );
318
- } else {
319
- delete_post_meta( $post_id, '_seopress_robots_follow', '' );
320
- }
321
- if( isset( $_POST[ 'seopress_robots_odp' ] ) ) {
322
- update_post_meta( $post_id, '_seopress_robots_odp', 'yes' );
323
- } else {
324
- delete_post_meta( $post_id, '_seopress_robots_odp', '' );
325
- }
326
- if( isset( $_POST[ 'seopress_robots_imageindex' ] ) ) {
327
- update_post_meta( $post_id, '_seopress_robots_imageindex', 'yes' );
328
- } else {
329
- delete_post_meta( $post_id, '_seopress_robots_imageindex', '' );
330
- }
331
- if( isset( $_POST[ 'seopress_robots_archive' ] ) ) {
332
- update_post_meta( $post_id, '_seopress_robots_archive', 'yes' );
333
- } else {
334
- delete_post_meta( $post_id, '_seopress_robots_archive', '' );
335
- }
336
- if( isset( $_POST[ 'seopress_robots_snippet' ] ) ) {
337
- update_post_meta( $post_id, '_seopress_robots_snippet', 'yes' );
338
- } else {
339
- delete_post_meta( $post_id, '_seopress_robots_snippet', '' );
340
- }
341
- if(isset($_POST['seopress_robots_canonical'])){
342
- update_post_meta($post_id, '_seopress_robots_canonical', esc_html($_POST['seopress_robots_canonical']));
343
- }
344
- if(isset($_POST['seopress_robots_primary_cat'])){
345
- update_post_meta($post_id, '_seopress_robots_primary_cat', esc_html($_POST['seopress_robots_primary_cat']));
346
- }
347
- if (is_plugin_active('wp-seopress-pro/seopress-pro.php')) {
348
- if(isset($_POST['seopress_robots_breadcrumbs'])){
349
- update_post_meta($post_id, '_seopress_robots_breadcrumbs', esc_html($_POST['seopress_robots_breadcrumbs']));
350
- }
351
- }
352
- }
353
- if (in_array('social-tab', $seo_tabs)) {
354
- if(isset($_POST['seopress_social_fb_title'])){
355
- update_post_meta($post_id, '_seopress_social_fb_title', esc_html($_POST['seopress_social_fb_title']));
356
- }
357
- if(isset($_POST['seopress_social_fb_desc'])){
358
- update_post_meta($post_id, '_seopress_social_fb_desc', esc_html($_POST['seopress_social_fb_desc']));
359
- }
360
- if(isset($_POST['seopress_social_fb_img'])){
361
- update_post_meta($post_id, '_seopress_social_fb_img', esc_html($_POST['seopress_social_fb_img']));
362
- }
363
- if(isset($_POST['seopress_social_twitter_title'])){
364
- update_post_meta($post_id, '_seopress_social_twitter_title', esc_html($_POST['seopress_social_twitter_title']));
365
- }
366
- if(isset($_POST['seopress_social_twitter_desc'])){
367
- update_post_meta($post_id, '_seopress_social_twitter_desc', esc_html($_POST['seopress_social_twitter_desc']));
368
- }
369
- if(isset($_POST['seopress_social_twitter_img'])){
370
- update_post_meta($post_id, '_seopress_social_twitter_img', esc_html($_POST['seopress_social_twitter_img']));
371
- }
372
- }
373
- if (in_array('redirect-tab', $seo_tabs)) {
374
- if(isset($_POST['seopress_redirections_type'])){
375
- update_post_meta($post_id, '_seopress_redirections_type', $_POST['seopress_redirections_type']);
376
- }
377
- if(isset($_POST['seopress_redirections_value'])){
378
- update_post_meta($post_id, '_seopress_redirections_value', esc_html($_POST['seopress_redirections_value']));
379
- }
380
- if(isset($_POST['seopress_redirections_param'])){
381
- update_post_meta($post_id, '_seopress_redirections_param', esc_html($_POST['seopress_redirections_param']));
382
- }
383
- if( isset( $_POST[ 'seopress_redirections_enabled' ] ) ) {
384
- update_post_meta( $post_id, '_seopress_redirections_enabled', 'yes' );
385
- } else {
386
- delete_post_meta( $post_id, '_seopress_redirections_enabled', '' );
387
- }
388
- }
389
- if (is_plugin_active('wp-seopress-pro/seopress-pro.php')) {
390
- if (in_array('news-tab', $seo_tabs)) {
391
- if( isset( $_POST[ 'seopress_news_disabled' ] ) ) {
392
- update_post_meta( $post_id, '_seopress_news_disabled', 'yes' );
393
- } else {
394
- delete_post_meta( $post_id, '_seopress_news_disabled', '' );
395
- }
396
- }
397
- if (in_array('video-tab', $seo_tabs)) {
398
- if( isset( $_POST[ 'seopress_video_disabled' ] ) ) {
399
- update_post_meta( $post_id, '_seopress_video_disabled', 'yes' );
400
- } else {
401
- delete_post_meta( $post_id, '_seopress_video_disabled', '' );
402
- }
403
- if(isset($_POST['seopress_video'])){
404
- update_post_meta($post_id, '_seopress_video', $_POST['seopress_video']);
405
- }
406
- }
407
- }
408
- }
409
- }
410
  }
411
 
412
  function seopress_display_ca_metaboxe() {
413
- add_action('add_meta_boxes','seopress_init_ca_metabox');
414
- function seopress_init_ca_metabox(){
415
- if (function_exists('seopress_advanced_appearance_metaboxe_position_option')) {
416
- $seopress_advanced_appearance_metaboxe_position_option = seopress_advanced_appearance_metaboxe_position_option();
417
- } else {
418
- $seopress_advanced_appearance_metaboxe_position_option = 'default';
419
- }
420
- if (function_exists('seopress_get_post_types')) {
421
-
422
- $seopress_get_post_types = seopress_get_post_types();
423
-
424
- $seopress_get_post_types = apply_filters('seopress_metaboxe_content_analysis', $seopress_get_post_types);
425
-
426
- if (!empty($seopress_get_post_types)) {
427
- foreach ($seopress_get_post_types as $key => $value) {
428
- add_meta_box('seopress_content_analysis', __('Content analysis','wp-seopress'), 'seopress_content_analysis', $key, 'normal', $seopress_advanced_appearance_metaboxe_position_option);
429
- }
430
- }
431
- }
432
- }
433
-
434
- function seopress_content_analysis($post) {
435
- $prefix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
436
- wp_nonce_field( plugin_basename( __FILE__ ), 'seopress_content_analysis_nonce' );
437
-
438
- wp_enqueue_script( 'seopress-cpt-counters-js', plugins_url( 'assets/js/seopress-counters' . $prefix . '.js', dirname(dirname( __FILE__ ))), array( 'jquery', 'jquery-ui-tabs', 'jquery-ui-accordion' ), SEOPRESS_VERSION );
439
- $seopress_real_preview = array(
440
- 'seopress_nonce' => wp_create_nonce('seopress_real_preview_nonce'),
441
- 'seopress_real_preview' => admin_url('admin-ajax.php'),
442
- 'i18n' => array('progress' => __('Analysis in progress...','wp-seopress'))
443
- );
444
- wp_localize_script( 'seopress-cpt-counters-js', 'seopressAjaxRealPreview', $seopress_real_preview );
445
-
446
- $seopress_analysis_target_kw = get_post_meta($post->ID,'_seopress_analysis_target_kw',true);
447
- $seopress_analysis_data = get_post_meta($post->ID,'_seopress_analysis_data', true);
448
- $seopress_titles_title = get_post_meta($post->ID,'_seopress_titles_title',true);
449
- $seopress_titles_desc = get_post_meta($post->ID,'_seopress_titles_desc',true);
450
-
451
- if (seopress_titles_single_cpt_noindex_option() || seopress_titles_noindex_option() || post_password_required($post->ID) ===true) {
452
- $seopress_robots_index = 'yes';
453
- } else {
454
- $seopress_robots_index = get_post_meta($post->ID,'_seopress_robots_index',true);
455
- }
456
-
457
- if (seopress_titles_single_cpt_nofollow_option() || seopress_titles_nofollow_option()) {
458
- $seopress_robots_follow = 'yes';
459
- } else {
460
- $seopress_robots_follow = get_post_meta($post->ID,'_seopress_robots_follow',true);
461
- }
462
-
463
- if (seopress_titles_noodp_option()) {
464
- $seopress_robots_odp = 'yes';
465
- } else {
466
- $seopress_robots_odp = get_post_meta($post->ID,'_seopress_robots_odp',true);
467
- }
468
-
469
- if (seopress_titles_noarchive_option()) {
470
- $seopress_robots_archive = 'yes';
471
- } else {
472
- $seopress_robots_archive = get_post_meta($post->ID,'_seopress_robots_archive',true);
473
- }
474
-
475
- if (seopress_titles_nosnippet_option()) {
476
- $seopress_robots_snippet = 'yes';
477
- } else {
478
- $seopress_robots_snippet = get_post_meta($post->ID,'_seopress_robots_snippet',true);
479
- }
480
-
481
- if (seopress_titles_noimageindex_option()) {
482
- $seopress_robots_imageindex = 'yes';
483
- } else {
484
- $seopress_robots_imageindex = get_post_meta($post->ID,'_seopress_robots_imageindex',true);
485
- }
486
-
487
- require_once ( dirname( __FILE__ ) . '/admin-metaboxes-content-analysis-form.php'); //Metaboxe HTML
488
- }
489
-
490
- add_action('save_post','seopress_save_ca_metabox', 10, 2);
491
- function seopress_save_ca_metabox($post_id, $post){
492
- //Nonce
493
- if ( !isset( $_POST['seopress_content_analysis_nonce'] ) || !wp_verify_nonce( $_POST['seopress_content_analysis_nonce'], plugin_basename( __FILE__ ) ) )
494
- return $post_id;
495
-
496
- //Post type object
497
- $post_type = get_post_type_object( $post->post_type );
498
-
499
- //Check permission
500
- if ( !current_user_can( $post_type->cap->edit_post, $post_id ) )
501
- return $post_id;
502
-
503
- if ( 'attachment' !== get_post_type($post_id)) {
504
- if(isset($_POST['seopress_analysis_target_kw'])){
505
- update_post_meta($post_id, '_seopress_analysis_target_kw', esc_html($_POST['seopress_analysis_target_kw']));
506
- }
507
- }
508
- }
509
-
510
- //Save metabox values in elementor
511
- add_action('save_post', 'seopress_update_elementor_fields', 999, 2);
512
- function seopress_update_elementor_fields( $post_id, $post ) {
513
- do_action( 'seopress/page-builders/elementor/save_meta', $post_id );
514
- }
515
  }
516
 
517
  if (is_user_logged_in()) {
518
- if(is_super_admin()) {
519
- echo seopress_display_seo_metaboxe();
520
- echo seopress_display_ca_metaboxe();
521
- } else {
522
- global $wp_roles;
523
-
524
- //Get current user role
525
- if(isset(wp_get_current_user()->roles[0])) {
526
- $seopress_user_role = wp_get_current_user()->roles[0];
527
-
528
- //If current user role matchs values from Security settings then apply -- SEO Metaboxe
529
- if (function_exists('seopress_advanced_security_metaboxe_role_hook_option') && seopress_advanced_security_metaboxe_role_hook_option() !='') {
530
- if( array_key_exists( $seopress_user_role, seopress_advanced_security_metaboxe_role_hook_option())) {
531
- //do nothing
532
- } else {
533
- echo seopress_display_seo_metaboxe();
534
- }
535
- } else {
536
- echo seopress_display_seo_metaboxe();
537
- }
538
-
539
- //If current user role matchs values from Security settings then apply -- SEO Content Analysis
540
- if (function_exists('seopress_advanced_security_metaboxe_ca_role_hook_option') && seopress_advanced_security_metaboxe_ca_role_hook_option() !='') {
541
- if( array_key_exists( $seopress_user_role, seopress_advanced_security_metaboxe_ca_role_hook_option())) {
542
- //do nothing
543
- } else {
544
- echo seopress_display_ca_metaboxe();
545
- }
546
- } else {
547
- echo seopress_display_ca_metaboxe();
548
- }
549
- }
550
- }
551
  }
6
  //Restrict SEO metaboxes to user roles
7
  ///////////////////////////////////////////////////////////////////////////////////////////////////
8
  function seopress_advanced_security_metaboxe_role_hook_option() {
9
+ $seopress_advanced_security_metaboxe_role_hook_option = get_option("seopress_advanced_option_name");
10
+ if ( ! empty ( $seopress_advanced_security_metaboxe_role_hook_option ) ) {
11
+ foreach ($seopress_advanced_security_metaboxe_role_hook_option as $key => $seopress_advanced_security_metaboxe_role_hook_value)
12
+ $options[$key] = $seopress_advanced_security_metaboxe_role_hook_value;
13
+ if (isset($seopress_advanced_security_metaboxe_role_hook_option['seopress_advanced_security_metaboxe_role'])) {
14
+ return $seopress_advanced_security_metaboxe_role_hook_option['seopress_advanced_security_metaboxe_role'];
15
+ }
16
+ }
17
  }
18
 
19
  function seopress_advanced_security_metaboxe_ca_role_hook_option() {
20
+ $seopress_advanced_security_metaboxe_ca_role_hook_option = get_option("seopress_advanced_option_name");
21
+ if ( ! empty ( $seopress_advanced_security_metaboxe_ca_role_hook_option ) ) {
22
+ foreach ($seopress_advanced_security_metaboxe_ca_role_hook_option as $key => $seopress_advanced_security_metaboxe_ca_role_hook_value)
23
+ $options[$key] = $seopress_advanced_security_metaboxe_ca_role_hook_value;
24
+ if (isset($seopress_advanced_security_metaboxe_ca_role_hook_option['seopress_advanced_security_metaboxe_ca_role'])) {
25
+ return $seopress_advanced_security_metaboxe_ca_role_hook_option['seopress_advanced_security_metaboxe_ca_role'];
26
+ }
27
+ }
28
  }
29
 
30
  ///////////////////////////////////////////////////////////////////////////////////////////////////
31
  //Check global settings
32
  ///////////////////////////////////////////////////////////////////////////////////////////////////
33
  if (!function_exists('seopress_titles_single_cpt_noindex_option')) {
34
+ function seopress_titles_single_cpt_noindex_option() {
35
+ global $post;
36
+ $seopress_get_current_cpt = get_post_type($post);
37
+
38
+ $seopress_titles_single_cpt_noindex_option = get_option("seopress_titles_option_name");
39
+ if ( ! empty ( $seopress_titles_single_cpt_noindex_option ) ) {
40
+ foreach ($seopress_titles_single_cpt_noindex_option as $key => $seopress_titles_single_cpt_noindex_value)
41
+ $options[$key] = $seopress_titles_single_cpt_noindex_value;
42
+ if (isset($seopress_titles_single_cpt_noindex_option['seopress_titles_single_titles'][$seopress_get_current_cpt]['noindex'])) {
43
+ return $seopress_titles_single_cpt_noindex_option['seopress_titles_single_titles'][$seopress_get_current_cpt]['noindex'];
44
+ }
45
+ }
46
+ }
47
  }
48
 
49
  if (!function_exists('seopress_titles_noindex_option')) {
50
+ function seopress_titles_noindex_option() {
51
+ $seopress_titles_noindex_option = get_option("seopress_titles_option_name");
52
+ if ( ! empty ( $seopress_titles_noindex_option ) ) {
53
+ foreach ($seopress_titles_noindex_option as $key => $seopress_titles_noindex_value)
54
+ $options[$key] = $seopress_titles_noindex_value;
55
+ if (isset($seopress_titles_noindex_option['seopress_titles_noindex'])) {
56
+ return $seopress_titles_noindex_option['seopress_titles_noindex'];
57
+ }
58
+ }
59
+ }
60
  }
61
 
62
  if (!function_exists('seopress_titles_single_cpt_nofollow_option')) {
63
+ function seopress_titles_single_cpt_nofollow_option() {
64
+ global $post;
65
+ $seopress_get_current_cpt = get_post_type($post);
66
+
67
+ $seopress_titles_single_cpt_nofollow_option = get_option("seopress_titles_option_name");
68
+ if ( ! empty ( $seopress_titles_single_cpt_nofollow_option ) ) {
69
+ foreach ($seopress_titles_single_cpt_nofollow_option as $key => $seopress_titles_single_cpt_nofollow_value)
70
+ $options[$key] = $seopress_titles_single_cpt_nofollow_value;
71
+ if (isset($seopress_titles_single_cpt_nofollow_option['seopress_titles_single_titles'][$seopress_get_current_cpt]['nofollow'])) {
72
+ return $seopress_titles_single_cpt_nofollow_option['seopress_titles_single_titles'][$seopress_get_current_cpt]['nofollow'];
73
+ }
74
+ }
75
+ }
76
  }
77
 
78
  if (!function_exists('seopress_titles_nofollow_option')) {
79
+ function seopress_titles_nofollow_option() {
80
+ $seopress_titles_nofollow_option = get_option("seopress_titles_option_name");
81
+ if ( ! empty ( $seopress_titles_nofollow_option ) ) {
82
+ foreach ($seopress_titles_nofollow_option as $key => $seopress_titles_nofollow_value)
83
+ $options[$key] = $seopress_titles_nofollow_value;
84
+ if (isset($seopress_titles_nofollow_option['seopress_titles_nofollow'])) {
85
+ return $seopress_titles_nofollow_option['seopress_titles_nofollow'];
86
+ }
87
+ }
88
+ }
89
  }
90
 
91
  if (!function_exists('seopress_titles_noodp_option')) {
92
+ function seopress_titles_noodp_option() {
93
+ $seopress_titles_noodp_option = get_option("seopress_titles_option_name");
94
+ if ( ! empty ( $seopress_titles_noodp_option ) ) {
95
+ foreach ($seopress_titles_noodp_option as $key => $seopress_titles_noodp_value)
96
+ $options[$key] = $seopress_titles_noodp_value;
97
+ if (isset($seopress_titles_noodp_option['seopress_titles_noodp'])) {
98
+ return $seopress_titles_noodp_option['seopress_titles_noodp'];
99
+ }
100
+ }
101
+ }
102
  }
103
 
104
  if (!function_exists('seopress_titles_noarchive_option')) {
105
+ function seopress_titles_noarchive_option() {
106
+ $seopress_titles_noarchive_option = get_option("seopress_titles_option_name");
107
+ if ( ! empty ( $seopress_titles_noarchive_option ) ) {
108
+ foreach ($seopress_titles_noarchive_option as $key => $seopress_titles_noarchive_value)
109
+ $options[$key] = $seopress_titles_noarchive_value;
110
+ if (isset($seopress_titles_noarchive_option['seopress_titles_noarchive'])) {
111
+ return $seopress_titles_noarchive_option['seopress_titles_noarchive'];
112
+ }
113
+ }
114
+ }
115
  }
116
 
117
  if (!function_exists('seopress_titles_nosnippet_option')) {
118
+ function seopress_titles_nosnippet_option() {
119
+ $seopress_titles_nosnippet_option = get_option("seopress_titles_option_name");
120
+ if ( ! empty ( $seopress_titles_nosnippet_option ) ) {
121
+ foreach ($seopress_titles_nosnippet_option as $key => $seopress_titles_nosnippet_value)
122
+ $options[$key] = $seopress_titles_nosnippet_value;
123
+ if (isset($seopress_titles_nosnippet_option['seopress_titles_nosnippet'])) {
124
+ return $seopress_titles_nosnippet_option['seopress_titles_nosnippet'];
125
+ }
126
+ }
127
+ }
128
  }
129
 
130
  if (!function_exists('seopress_titles_noimageindex_option')) {
131
+ function seopress_titles_noimageindex_option() {
132
+ $seopress_titles_noimageindex_option = get_option("seopress_titles_option_name");
133
+ if ( ! empty ( $seopress_titles_noimageindex_option ) ) {
134
+ foreach ($seopress_titles_noimageindex_option as $key => $seopress_titles_noimageindex_value)
135
+ $options[$key] = $seopress_titles_noimageindex_value;
136
+ if (isset($seopress_titles_noimageindex_option['seopress_titles_noimageindex'])) {
137
+ return $seopress_titles_noimageindex_option['seopress_titles_noimageindex'];
138
+ }
139
+ }
140
+ }
141
  }
142
 
143
  ///////////////////////////////////////////////////////////////////////////////////////////////////
144
  //Display metabox in Custom Post Type
145
  ///////////////////////////////////////////////////////////////////////////////////////////////////
146
  function seopress_display_seo_metaboxe() {
147
+ add_action('add_meta_boxes','seopress_init_metabox');
148
+ function seopress_init_metabox(){
149
+ if (function_exists('seopress_advanced_appearance_metaboxe_position_option')) {
150
+ $seopress_advanced_appearance_metaboxe_position_option = seopress_advanced_appearance_metaboxe_position_option();
151
+ } else {
152
+ $seopress_advanced_appearance_metaboxe_position_option = 'default';
153
+ }
154
+
155
+ if (function_exists('seopress_get_post_types')) {
156
+
157
+ $seopress_get_post_types = seopress_get_post_types();
158
+
159
+ $seopress_get_post_types = apply_filters('seopress_metaboxe_seo', $seopress_get_post_types);
160
+
161
+ if (!empty($seopress_get_post_types)) {
162
+ foreach ($seopress_get_post_types as $key => $value) {
163
+ add_meta_box('seopress_cpt', __('SEO','wp-seopress'), 'seopress_cpt', $key, 'normal', $seopress_advanced_appearance_metaboxe_position_option);
164
+ }
165
+ }
166
+ add_meta_box('seopress_cpt', __('SEO','wp-seopress'), 'seopress_cpt', 'seopress_404', 'normal', $seopress_advanced_appearance_metaboxe_position_option);
167
+ }
168
+ }
169
+
170
+ function seopress_cpt( $post ){
171
+ global $typenow;
172
+ $prefix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
173
+ wp_nonce_field( plugin_basename( __FILE__ ), 'seopress_cpt_nonce' );
174
+
175
+ //init
176
+ $disabled = array();
177
+
178
+ wp_enqueue_script( 'seopress-cpt-tabs-js', plugins_url( 'assets/js/seopress-tabs2' . $prefix . '.js', dirname( dirname( __FILE__ ) ) ), [ 'jquery-ui-tabs' ], SEOPRESS_VERSION );
179
+
180
+ if ("seopress_404" != $typenow) {
181
+ wp_enqueue_script('jquery-ui-accordion');
182
+
183
+ //Register Google Snippet Preview / Content Analysis JS
184
+ wp_enqueue_script( 'seopress-cpt-counters-js', plugins_url( 'assets/js/seopress-counters' . $prefix . '.js', dirname( dirname( __FILE__ ) ) ), [ 'jquery', 'jquery-ui-tabs', 'jquery-ui-accordion' ], SEOPRESS_VERSION, true );
185
+
186
+ //If Gutenberg ON
187
+ if ( function_exists( 'get_current_screen' ) ) {
188
+ $get_current_screen = get_current_screen();
189
+ if ( isset( $get_current_screen->is_block_editor ) ) {
190
+ if ( $get_current_screen->is_block_editor ) {
191
+ wp_enqueue_script( 'seopress-block-editor-js', plugins_url( 'assets/js/seopress-block-editor' . $prefix . '.js', dirname( dirname( __FILE__ ) ) ), [ 'jquery' ], SEOPRESS_VERSION, true );
192
+ }
193
+ }
194
+ }
195
+
196
+ wp_enqueue_script( 'seopress-cpt-video-sitemap-js', plugins_url( 'assets/js/seopress-sitemap-video' . $prefix . '.js', dirname(dirname( __FILE__ ))), [ 'jquery', 'jquery-ui-accordion' ], SEOPRESS_VERSION );
197
+
198
+ $seopress_real_preview = array(
199
+ 'seopress_nonce' => wp_create_nonce('seopress_real_preview_nonce'),
200
+ 'seopress_real_preview' => admin_url('admin-ajax.php'),
201
+ 'i18n' => [ 'progress' => __( 'Analysis in progress...', 'wp-seopress' ) ]
202
+ );
203
+ wp_localize_script( 'seopress-cpt-counters-js', 'seopressAjaxRealPreview', $seopress_real_preview );
204
+
205
+ wp_enqueue_script( 'seopress-media-uploader-js', plugins_url('assets/js/seopress-media-uploader' . $prefix . '.js', dirname( dirname( __FILE__ ) ) ), [ 'jquery' ], SEOPRESS_VERSION, false );
206
+ wp_enqueue_media();
207
+ }
208
+
209
+ $seopress_titles_title = get_post_meta($post->ID,'_seopress_titles_title',true);
210
+ $seopress_titles_desc = get_post_meta($post->ID,'_seopress_titles_desc',true);
211
+
212
+ $disabled['robots_index'] ='';
213
+ if (seopress_titles_single_cpt_noindex_option() || seopress_titles_noindex_option() || post_password_required($post->ID) ===true) {
214
+ $seopress_robots_index = 'yes';
215
+ $disabled['robots_index'] = 'disabled';
216
+ } else {
217
+ $seopress_robots_index = get_post_meta($post->ID,'_seopress_robots_index',true);
218
+
219
+ }
220
+
221
+ $disabled['robots_follow'] ='';
222
+ if (seopress_titles_single_cpt_nofollow_option() || seopress_titles_nofollow_option()) {
223
+ $seopress_robots_follow = 'yes';
224
+ $disabled['robots_follow'] = 'disabled';
225
+ } else {
226
+ $seopress_robots_follow = get_post_meta($post->ID,'_seopress_robots_follow',true);
227
+ }
228
+
229
+ $disabled['robots_odp'] ='';
230
+ if (seopress_titles_noodp_option()) {
231
+ $seopress_robots_odp = 'yes';
232
+ $disabled['robots_odp'] = 'disabled';
233
+ } else {
234
+ $seopress_robots_odp = get_post_meta($post->ID,'_seopress_robots_odp',true);
235
+ }
236
+
237
+ $disabled['archive'] ='';
238
+ if (seopress_titles_noarchive_option()) {
239
+ $seopress_robots_archive = 'yes';
240
+ $disabled['archive'] = 'disabled';
241
+ } else {
242
+ $seopress_robots_archive = get_post_meta($post->ID,'_seopress_robots_archive',true);
243
+ }
244
+
245
+ $disabled['snippet'] ='';
246
+ if (seopress_titles_nosnippet_option()) {
247
+ $seopress_robots_snippet = 'yes';
248
+ $disabled['snippet'] = 'disabled';
249
+ } else {
250
+ $seopress_robots_snippet = get_post_meta($post->ID,'_seopress_robots_snippet',true);
251
+ }
252
+
253
+ $disabled['imageindex'] ='';
254
+ if (seopress_titles_noimageindex_option()) {
255
+ $seopress_robots_imageindex = 'yes';
256
+ $disabled['imageindex'] = 'disabled';
257
+ } else {
258
+ $seopress_robots_imageindex = get_post_meta($post->ID,'_seopress_robots_imageindex',true);
259
+ }
260
+
261
+ $seopress_robots_canonical = get_post_meta($post->ID,'_seopress_robots_canonical',true);
262
+ $seopress_robots_primary_cat = get_post_meta($post->ID,'_seopress_robots_primary_cat',true);
263
+ if (is_plugin_active('wp-seopress-pro/seopress-pro.php')) {
264
+ $seopress_robots_breadcrumbs = get_post_meta($post->ID,'_seopress_robots_breadcrumbs',true);
265
+ }
266
+ $seopress_social_fb_title = get_post_meta($post->ID,'_seopress_social_fb_title',true);
267
+ $seopress_social_fb_desc = get_post_meta($post->ID,'_seopress_social_fb_desc',true);
268
+ $seopress_social_fb_img = get_post_meta($post->ID,'_seopress_social_fb_img',true);
269
+ $seopress_social_twitter_title = get_post_meta($post->ID,'_seopress_social_twitter_title',true);
270
+ $seopress_social_twitter_desc = get_post_meta($post->ID,'_seopress_social_twitter_desc',true);
271
+ $seopress_social_twitter_img = get_post_meta($post->ID,'_seopress_social_twitter_img',true);
272
+ $seopress_redirections_enabled = get_post_meta($post->ID,'_seopress_redirections_enabled',true);
273
+ $seopress_redirections_type = get_post_meta($post->ID,'_seopress_redirections_type',true);
274
+ $seopress_redirections_value = get_post_meta($post->ID,'_seopress_redirections_value',true);
275
+ $seopress_redirections_param = get_post_meta($post->ID,'_seopress_redirections_param',true);
276
+ if (is_plugin_active('wp-seopress-pro/seopress-pro.php')) {
277
+ $seopress_news_disabled = get_post_meta($post->ID,'_seopress_news_disabled',true);
278
+ $seopress_video_disabled = get_post_meta($post->ID,'_seopress_video_disabled',true);
279
+ $seopress_video = get_post_meta($post->ID,'_seopress_video');
280
+ }
281
+
282
+ require_once ( dirname( __FILE__ ) . '/admin-metaboxes-form.php'); //Metaboxe HTML
283
+ }
284
+
285
+ add_action('save_post','seopress_save_metabox', 10, 2);
286
+ function seopress_save_metabox($post_id, $post){
287
+ //Nonce
288
+ if ( !isset( $_POST['seopress_cpt_nonce'] ) || !wp_verify_nonce( $_POST['seopress_cpt_nonce'], plugin_basename( __FILE__ ) ) )
289
+ return $post_id;
290
+
291
+ //Post type object
292
+ $post_type = get_post_type_object( $post->post_type );
293
+
294
+ //Check permission
295
+ if ( !current_user_can( $post_type->cap->edit_post, $post_id ) )
296
+ return $post_id;
297
+
298
+ if ( 'attachment' !== get_post_type($post_id)) {
299
+ $seo_tabs = array();
300
+ $seo_tabs = json_decode(stripslashes(htmlspecialchars_decode($_POST['seo_tabs'])));
301
+
302
+ if (in_array('title-tab', $seo_tabs)) {
303
+ if(isset($_POST['seopress_titles_title'])){
304
+ update_post_meta($post_id, '_seopress_titles_title', esc_html($_POST['seopress_titles_title']));
305
+ }
306
+ if(isset($_POST['seopress_titles_desc'])){
307
+ update_post_meta($post_id, '_seopress_titles_desc', esc_html($_POST['seopress_titles_desc']));
308
+ }
309
+ }
310
+ if (in_array('advanced-tab', $seo_tabs)) {
311
+ if( isset( $_POST[ 'seopress_robots_index' ] ) ) {
312
+ update_post_meta( $post_id, '_seopress_robots_index', 'yes' );
313
+ } else {
314
+ delete_post_meta( $post_id, '_seopress_robots_index', '' );
315
+ }
316
+ if( isset( $_POST[ 'seopress_robots_follow' ] ) ) {
317
+ update_post_meta( $post_id, '_seopress_robots_follow', 'yes' );
318
+ } else {
319
+ delete_post_meta( $post_id, '_seopress_robots_follow', '' );
320
+ }
321
+ if( isset( $_POST[ 'seopress_robots_odp' ] ) ) {
322
+ update_post_meta( $post_id, '_seopress_robots_odp', 'yes' );
323
+ } else {
324
+ delete_post_meta( $post_id, '_seopress_robots_odp', '' );
325
+ }
326
+ if( isset( $_POST[ 'seopress_robots_imageindex' ] ) ) {
327
+ update_post_meta( $post_id, '_seopress_robots_imageindex', 'yes' );
328
+ } else {
329
+ delete_post_meta( $post_id, '_seopress_robots_imageindex', '' );
330
+ }
331
+ if( isset( $_POST[ 'seopress_robots_archive' ] ) ) {
332
+ update_post_meta( $post_id, '_seopress_robots_archive', 'yes' );
333
+ } else {
334
+ delete_post_meta( $post_id, '_seopress_robots_archive', '' );
335
+ }
336
+ if( isset( $_POST[ 'seopress_robots_snippet' ] ) ) {
337
+ update_post_meta( $post_id, '_seopress_robots_snippet', 'yes' );
338
+ } else {
339
+ delete_post_meta( $post_id, '_seopress_robots_snippet', '' );
340
+ }
341
+ if(isset($_POST['seopress_robots_canonical'])){
342
+ update_post_meta($post_id, '_seopress_robots_canonical', esc_html($_POST['seopress_robots_canonical']));
343
+ }
344
+ if(isset($_POST['seopress_robots_primary_cat'])){
345
+ update_post_meta($post_id, '_seopress_robots_primary_cat', esc_html($_POST['seopress_robots_primary_cat']));
346
+ }
347
+ if (is_plugin_active('wp-seopress-pro/seopress-pro.php')) {
348
+ if(isset($_POST['seopress_robots_breadcrumbs'])){
349
+ update_post_meta($post_id, '_seopress_robots_breadcrumbs', esc_html($_POST['seopress_robots_breadcrumbs']));
350
+ }
351
+ }
352
+ }
353
+ if (in_array('social-tab', $seo_tabs)) {
354
+ if(isset($_POST['seopress_social_fb_title'])){
355
+ update_post_meta($post_id, '_seopress_social_fb_title', esc_html($_POST['seopress_social_fb_title']));
356
+ }
357
+ if(isset($_POST['seopress_social_fb_desc'])){
358
+ update_post_meta($post_id, '_seopress_social_fb_desc', esc_html($_POST['seopress_social_fb_desc']));
359
+ }
360
+ if(isset($_POST['seopress_social_fb_img'])){
361
+ update_post_meta($post_id, '_seopress_social_fb_img', esc_html($_POST['seopress_social_fb_img']));
362
+ }
363
+ if(isset($_POST['seopress_social_twitter_title'])){
364
+ update_post_meta($post_id, '_seopress_social_twitter_title', esc_html($_POST['seopress_social_twitter_title']));
365
+ }
366
+ if(isset($_POST['seopress_social_twitter_desc'])){
367
+ update_post_meta($post_id, '_seopress_social_twitter_desc', esc_html($_POST['seopress_social_twitter_desc']));
368
+ }
369
+ if(isset($_POST['seopress_social_twitter_img'])){
370
+ update_post_meta($post_id, '_seopress_social_twitter_img', esc_html($_POST['seopress_social_twitter_img']));
371
+ }
372
+ }
373
+ if (in_array('redirect-tab', $seo_tabs)) {
374
+ if(isset($_POST['seopress_redirections_type'])){
375
+ update_post_meta($post_id, '_seopress_redirections_type', $_POST['seopress_redirections_type']);
376
+ }
377
+ if(isset($_POST['seopress_redirections_value'])){
378
+ update_post_meta($post_id, '_seopress_redirections_value', esc_html($_POST['seopress_redirections_value']));
379
+ }
380
+ if(isset($_POST['seopress_redirections_param'])){
381
+ update_post_meta($post_id, '_seopress_redirections_param', esc_html($_POST['seopress_redirections_param']));
382
+ }
383
+ if( isset( $_POST[ 'seopress_redirections_enabled' ] ) ) {
384
+ update_post_meta( $post_id, '_seopress_redirections_enabled', 'yes' );
385
+ } else {
386
+ delete_post_meta( $post_id, '_seopress_redirections_enabled', '' );
387
+ }
388
+ }
389
+ if (is_plugin_active('wp-seopress-pro/seopress-pro.php')) {
390
+ if (in_array('news-tab', $seo_tabs)) {
391
+ if( isset( $_POST[ 'seopress_news_disabled' ] ) ) {
392
+ update_post_meta( $post_id, '_seopress_news_disabled', 'yes' );
393
+ } else {
394
+ delete_post_meta( $post_id, '_seopress_news_disabled', '' );
395
+ }
396
+ }
397
+ if (in_array('video-tab', $seo_tabs)) {
398
+ if( isset( $_POST[ 'seopress_video_disabled' ] ) ) {
399
+ update_post_meta( $post_id, '_seopress_video_disabled', 'yes' );
400
+ } else {
401
+ delete_post_meta( $post_id, '_seopress_video_disabled', '' );
402
+ }
403
+ if(isset($_POST['seopress_video'])){
404
+ update_post_meta($post_id, '_seopress_video', $_POST['seopress_video']);
405
+ }
406
+ }
407
+ }
408
+ }
409
+ }
410
  }
411
 
412
  function seopress_display_ca_metaboxe() {
413
+ add_action('add_meta_boxes','seopress_init_ca_metabox');
414
+ function seopress_init_ca_metabox(){
415
+ if (function_exists('seopress_advanced_appearance_metaboxe_position_option')) {
416
+ $seopress_advanced_appearance_metaboxe_position_option = seopress_advanced_appearance_metaboxe_position_option();
417
+ } else {
418
+ $seopress_advanced_appearance_metaboxe_position_option = 'default';
419
+ }
420
+ if (function_exists('seopress_get_post_types')) {
421
+
422
+ $seopress_get_post_types = seopress_get_post_types();
423
+
424
+ $seopress_get_post_types = apply_filters('seopress_metaboxe_content_analysis', $seopress_get_post_types);
425
+
426
+ if (!empty($seopress_get_post_types)) {
427
+ foreach ($seopress_get_post_types as $key => $value) {
428
+ add_meta_box('seopress_content_analysis', __('Content analysis','wp-seopress'), 'seopress_content_analysis', $key, 'normal', $seopress_advanced_appearance_metaboxe_position_option);
429
+ }
430
+ }
431
+ }
432
+ }
433
+
434
+ function seopress_content_analysis($post) {
435
+ $prefix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
436
+ wp_nonce_field( plugin_basename( __FILE__ ), 'seopress_content_analysis_nonce' );
437
+
438
+ wp_enqueue_script( 'seopress-cpt-counters-js', plugins_url( 'assets/js/seopress-counters' . $prefix . '.js', dirname(dirname( __FILE__ ))), array( 'jquery', 'jquery-ui-tabs', 'jquery-ui-accordion' ), SEOPRESS_VERSION );
439
+ $seopress_real_preview = array(
440
+ 'seopress_nonce' => wp_create_nonce('seopress_real_preview_nonce'),
441
+ 'seopress_real_preview' => admin_url('admin-ajax.php'),
442
+ 'i18n' => array('progress' => __('Analysis in progress...','wp-seopress'))
443
+ );
444
+ wp_localize_script( 'seopress-cpt-counters-js', 'seopressAjaxRealPreview', $seopress_real_preview );
445
+
446
+ $seopress_analysis_target_kw = get_post_meta($post->ID,'_seopress_analysis_target_kw',true);
447
+ $seopress_analysis_data = get_post_meta($post->ID,'_seopress_analysis_data', true);
448
+ $seopress_titles_title = get_post_meta($post->ID,'_seopress_titles_title',true);
449
+ $seopress_titles_desc = get_post_meta($post->ID,'_seopress_titles_desc',true);
450
+
451
+ if (seopress_titles_single_cpt_noindex_option() || seopress_titles_noindex_option() || post_password_required($post->ID) ===true) {
452
+ $seopress_robots_index = 'yes';
453
+ } else {
454
+ $seopress_robots_index = get_post_meta($post->ID,'_seopress_robots_index',true);
455
+ }
456
+
457
+ if (seopress_titles_single_cpt_nofollow_option() || seopress_titles_nofollow_option()) {
458
+ $seopress_robots_follow = 'yes';
459
+ } else {
460
+ $seopress_robots_follow = get_post_meta($post->ID,'_seopress_robots_follow',true);
461
+ }
462
+
463
+ if (seopress_titles_noodp_option()) {
464
+ $seopress_robots_odp = 'yes';
465
+ } else {
466
+ $seopress_robots_odp = get_post_meta($post->ID,'_seopress_robots_odp',true);
467
+ }
468
+
469
+ if (seopress_titles_noarchive_option()) {
470
+ $seopress_robots_archive = 'yes';
471
+ } else {
472
+ $seopress_robots_archive = get_post_meta($post->ID,'_seopress_robots_archive',true);
473
+ }
474
+
475
+ if (seopress_titles_nosnippet_option()) {
476
+ $seopress_robots_snippet = 'yes';
477
+ } else {
478
+ $seopress_robots_snippet = get_post_meta($post->ID,'_seopress_robots_snippet',true);
479
+ }
480
+
481
+ if (seopress_titles_noimageindex_option()) {
482
+ $seopress_robots_imageindex = 'yes';
483
+ } else {
484
+ $seopress_robots_imageindex = get_post_meta($post->ID,'_seopress_robots_imageindex',true);
485
+ }
486
+
487
+ require_once ( dirname( __FILE__ ) . '/admin-metaboxes-content-analysis-form.php'); //Metaboxe HTML
488
+ }
489
+
490
+ add_action('save_post','seopress_save_ca_metabox', 10, 2);
491
+ function seopress_save_ca_metabox($post_id, $post){
492
+ //Nonce
493
+ if ( !isset( $_POST['seopress_content_analysis_nonce'] ) || !wp_verify_nonce( $_POST['seopress_content_analysis_nonce'], plugin_basename( __FILE__ ) ) )
494
+ return $post_id;
495
+
496
+ //Post type object
497
+ $post_type = get_post_type_object( $post->post_type );
498
+
499
+ //Check permission
500
+ if ( !current_user_can( $post_type->cap->edit_post, $post_id ) )
501
+ return $post_id;
502
+
503
+ if ( 'attachment' !== get_post_type($post_id)) {
504
+ if(isset($_POST['seopress_analysis_target_kw'])){
505
+ update_post_meta($post_id, '_seopress_analysis_target_kw', esc_html($_POST['seopress_analysis_target_kw']));
506
+ }
507
+ }
508
+ }
509
+
510
+ //Save metabox values in elementor
511
+ add_action('save_post', 'seopress_update_elementor_fields', 999, 2);
512
+ function seopress_update_elementor_fields( $post_id, $post ) {
513
+ do_action( 'seopress/page-builders/elementor/save_meta', $post_id );
514
+ }
515
  }
516
 
517
  if (is_user_logged_in()) {
518
+ if(is_super_admin()) {
519
+ echo seopress_display_seo_metaboxe();
520
+ echo seopress_display_ca_metaboxe();
521
+ } else {
522
+ global $wp_roles;
523
+
524
+ //Get current user role
525
+ if(isset(wp_get_current_user()->roles[0])) {
526
+ $seopress_user_role = wp_get_current_user()->roles[0];
527
+
528
+ //If current user role matchs values from Security settings then apply -- SEO Metaboxe
529
+ if (function_exists('seopress_advanced_security_metaboxe_role_hook_option') && seopress_advanced_security_metaboxe_role_hook_option() !='') {
530
+ if( array_key_exists( $seopress_user_role, seopress_advanced_security_metaboxe_role_hook_option())) {
531
+ //do nothing
532
+ } else {
533
+ echo seopress_display_seo_metaboxe();
534
+ }
535
+ } else {
536
+ echo seopress_display_seo_metaboxe();
537
+ }
538
+
539
+ //If current user role matchs values from Security settings then apply -- SEO Content Analysis
540
+ if (function_exists('seopress_advanced_security_metaboxe_ca_role_hook_option') && seopress_advanced_security_metaboxe_ca_role_hook_option() !='') {
541
+ if( array_key_exists( $seopress_user_role, seopress_advanced_security_metaboxe_ca_role_hook_option())) {
542
+ //do nothing
543
+ } else {
544
+ echo seopress_display_ca_metaboxe();
545
+ }
546
+ } else {
547
+ echo seopress_display_ca_metaboxe();
548
+ }
549
+ }
550
+ }
551
  }
inc/admin/admin-notifications-center.php CHANGED
File without changes
inc/admin/admin-term-metaboxes.php CHANGED
File without changes
inc/admin/admin-wizard.php CHANGED
File without changes
inc/admin/admin.php CHANGED
File without changes
inc/admin/adminbar.php CHANGED
File without changes
inc/admin/ajax.php CHANGED
@@ -50,7 +50,7 @@ function seopress_do_real_preview() {
50
  if ( isset( $_GET['origin'] ) ) {
51
  $seopress_origin = $_GET['origin'];
52
  }
53
-
54
  //Tax name
55
  if ( isset( $_GET['tax_name'] ) ) {
56
  $seopress_tax_name = $_GET['tax_name'];
@@ -82,11 +82,10 @@ function seopress_do_real_preview() {
82
  if (isset($cookies) && !empty($cookies)) {
83
  $args['cookies'] = $cookies;
84
  }
85
-
86
  $args = apply_filters('seopress_real_preview_remote', $args);
87
-
88
  $data['title'] = $cookies;
89
-
90
  if ($seopress_origin =='post') { //Default: post type
91
  $response = wp_remote_get(get_preview_post_link((int)$seopress_get_the_id,array('no_admin_bar' => 1)), $args);
92
  } else { //Term taxonomy
50
  if ( isset( $_GET['origin'] ) ) {
51
  $seopress_origin = $_GET['origin'];
52
  }
53
+
54
  //Tax name
55
  if ( isset( $_GET['tax_name'] ) ) {
56
  $seopress_tax_name = $_GET['tax_name'];
82
  if (isset($cookies) && !empty($cookies)) {
83
  $args['cookies'] = $cookies;
84
  }
 
85
  $args = apply_filters('seopress_real_preview_remote', $args);
86
+
87
  $data['title'] = $cookies;
88
+
89
  if ($seopress_origin =='post') { //Default: post type
90
  $response = wp_remote_get(get_preview_post_link((int)$seopress_get_the_id,array('no_admin_bar' => 1)), $args);
91
  } else { //Term taxonomy
inc/admin/index.php CHANGED
File without changes
inc/admin/page-builders/elementor/assets/css/content-analysis.css ADDED
@@ -0,0 +1,479 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .elementor-control-field.seopress-content-analyses .sp-tooltip {
2
+ position: relative;
3
+ margin-left: 5px;
4
+ display: inline-block;
5
+ cursor: help;
6
+ vertical-align: bottom;
7
+ text-align: left;
8
+ background: none;
9
+ border: none;
10
+ padding: 0;
11
+ }
12
+
13
+ .elementor-control-field.seopress-content-analyses .sp-tooltip .dashicons {
14
+ color: #666;
15
+ }
16
+
17
+ .elementor-control-field.seopress-content-analyses .sp-tooltip .sp-tooltiptext {
18
+ visibility: hidden;
19
+ position: absolute;
20
+ z-index: 999999999;
21
+ width: 300px;
22
+ right: -260px;
23
+ padding: 20px;
24
+ top: 25px;
25
+ font-weight: 400;
26
+ box-shadow: 0 3px 30px rgba(25, 30, 35, 0.1);
27
+ border: 1px solid #e2e4e7;
28
+ background: #fff;
29
+ word-break: break-word;
30
+ text-transform: none;
31
+ }
32
+
33
+ .elementor-control-field.seopress-content-analyses .sp-tooltip .sp-tooltiptext::before {
34
+ border: 8px solid #e2e4e7;
35
+ top: -8px;
36
+ }
37
+
38
+ .elementor-control-field.seopress-content-analyses .sp-tooltip .sp-tooltiptext::after {
39
+ border: 8px solid #fff;
40
+ top: -6px;
41
+ }
42
+
43
+ .elementor-control-field.seopress-content-analyses .sp-tooltip .sp-tooltiptext::after,
44
+ .elementor-control-field.seopress-content-analyses .sp-tooltip .sp-tooltiptext::before {
45
+ border-bottom-style: solid;
46
+ border-left-color: transparent;
47
+ border-right-color: transparent;
48
+ border-top: none;
49
+ margin-left: -10px;
50
+ content: "";
51
+ position: absolute;
52
+ height: 0;
53
+ width: 0;
54
+ line-height: 0;
55
+ left: 30px;
56
+ }
57
+
58
+ .elementor-control-field.seopress-content-analyses .sp-tooltip .sp-tooltiptext::before, .sp-tooltip .sp-tooltiptext::after {
59
+ border-bottom-style: solid;
60
+ border-left-color: transparent;
61
+ border-right-color: transparent;
62
+ border-top: none;
63
+ margin-left: -10px;
64
+ content: "";
65
+ position: absolute;
66
+ height: 0;
67
+ width: 0;
68
+ line-height: 0;
69
+ left: 30px;
70
+ }
71
+
72
+ .elementor-control-field.seopress-content-analyses .sp-tooltip:hover .sp-tooltiptext,