WP Meta SEO - Version 4.5.0

Version Description

  • Add : SEO optimization meta block for DIVI
    • Add : New variables: %page%, %pagetotla%, %pagenumber% for blog pagination
Download this release

Release Info

Developer JoomUnited
Plugin Icon 128x128 WP Meta SEO
Version 4.5.0
Comparing to
See all releases

Code changes from version 4.4.9 to 4.5.0

assets/css/divi/style.css ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #seo_et_ignore_iframe {
2
+ position: absolute;
3
+ z-index: 1;
4
+ top: 0;
5
+ left: 0;
6
+ height: 0;
7
+ width: 0;
8
+ overflow: visible;
9
+ }
10
+ #seo_et_ignore_iframe.hidden {
11
+ display: none;
12
+ }
13
+ #seo_et_ignore_iframe .mpns-clear-float {
14
+ float: none !important;
15
+ width: 100%;
16
+ }
17
+ #seo_et_ignore_iframe .metaseo_left {
18
+ float: none !important;
19
+ width: 100% !important;
20
+ }
21
+ #seo_et_ignore_iframe .wpms-full-width {
22
+ width: 100% !important;
23
+ }
24
+ #seo_et_ignore_iframe .wpmstabs {
25
+ display: grid;
26
+ }
27
+ #seo_et_ignore_iframe .wpmstabs li {
28
+ display: block;
29
+ width: 100%;
30
+ }
31
+ #seo_et_ignore_iframe .wpmseo-metabox-tabs-div {
32
+ position: relative;
33
+ top: 35px;
34
+ left: 0;
35
+ display: block;
36
+ width: 450px;
37
+ overflow: auto;
38
+ max-height: 95vh;
39
+ }
40
+ #seo_et_ignore_iframe .wpmseo-metabox-tabs-div input, #seo_et_ignore_iframe .wpmseo-metabox-tabs-div textarea, #seo_et_ignore_iframe .wpmseo-metabox-tabs-div .container-snippet {
41
+ min-width: 300px !important;
42
+ }
43
+ #seo_et_ignore_iframe .wpms-top-h2 {
44
+ font-size: 20px !important;
45
+ font-weight: 600 !important;
46
+ font-style: normal;
47
+ font-stretch: normal;
48
+ line-height: normal !important;
49
+ letter-spacing: 1px;
50
+ color: #394857;
51
+ margin: 20px 0 !important;
52
+ }
53
+ #seo_et_ignore_iframe .reload_analysis {
54
+ float: right;
55
+ }
56
+ #seo_et_ignore_iframe .reload_analysis .spinner {
57
+ position: relative;
58
+ top: 0;
59
+ right: 0;
60
+ }
61
+ #seo_et_ignore_iframe .reload_analysis img {
62
+ max-width: 100%;
63
+ height: auto;
64
+ border: 0;
65
+ }
66
+ #seo_et_ignore_iframe #reload_analysis {
67
+ font-size: 10px;
68
+ padding: 8px 10px;
69
+ min-width: 130px;
70
+ }
71
+ #seo_et_ignore_iframe .ju-setting-label {
72
+ font-size: 14px !important;
73
+ font-weight: 600;
74
+ font-style: normal;
75
+ font-stretch: normal;
76
+ line-height: normal;
77
+ letter-spacing: 0.5px;
78
+ color: #404852;
79
+ }
80
+ #seo_et_ignore_iframe #wpmseo_general, #seo_et_ignore_iframe #wpmseo_social {
81
+ max-height: calc(100% - 300px);
82
+ overflow: auto;
83
+ margin: 0;
84
+ width: 100%;
85
+ padding: 0 10px 10px;
86
+ box-sizing: border-box;
87
+ background: #f3f6fa;
88
+ }
89
+ #seo_et_ignore_iframe #wpmseo_general .optimization-row-box, #seo_et_ignore_iframe #wpmseo_social .optimization-row-box {
90
+ width: 100% !important;
91
+ padding: 20px 15px 10px 15px;
92
+ }
93
+ #seo_et_ignore_iframe #wpmseo_general #metaseo_wpmseo_title-length, #seo_et_ignore_iframe #wpmseo_general #metaseo_wpmseo_desc-length, #seo_et_ignore_iframe #wpmseo_social #metaseo_wpmseo_title-length, #seo_et_ignore_iframe #wpmseo_social #metaseo_wpmseo_desc-length {
94
+ margin-left: 10px;
95
+ }
96
+ #seo_et_ignore_iframe #wpmseo_general .description, #seo_et_ignore_iframe #wpmseo_social .description {
97
+ font-size: 12px !important;
98
+ display: inline-block;
99
+ width: 90%;
100
+ font-weight: normal;
101
+ font-style: normal !important;
102
+ font-stretch: normal;
103
+ line-height: 1.88;
104
+ letter-spacing: 0.8px;
105
+ color: #5f879b !important;
106
+ padding-right: 20px;
107
+ margin: 10px 0 10px 15px !important;
108
+ }
109
+ #seo_et_ignore_iframe .wpms-bootstrap-tagsinput input {
110
+ min-width: unset !important;
111
+ }
112
+ #seo_et_ignore_iframe .wpms-bootstrap-tagsinput .label {
113
+ margin-top: 5px;
114
+ }
115
+ #seo_et_ignore_iframe #metaseo_wpmseo_opengraph-image, #seo_et_ignore_iframe #metaseo_wpmseo_twitter-image {
116
+ width: 75%;
117
+ }
118
+ #seo_et_ignore_iframe #metaseo_wpmseo_opengraph-image ~ button, #seo_et_ignore_iframe #metaseo_wpmseo_twitter-image ~ button {
119
+ padding: 0 !important;
120
+ margin-left: 1%;
121
+ font-size: 12px;
122
+ }
123
+
124
+ /*parent doc*/
125
+ #wpseo-settings-bar-root {
126
+ left: calc(50% - 70px);
127
+ position: absolute;
128
+ cursor: pointer;
129
+ pointer-events: auto;
130
+ }
131
+ #wpseo-settings-bar-root .dashicons-chart-area {
132
+ width: 40px;
133
+ background: #6c2eb9;
134
+ height: 40px;
135
+ border-radius: 50%;
136
+ text-align: center;
137
+ box-shadow: 0 5px 10px rgba(108, 46, 185, 0.15);
138
+ background-image: linear-gradient(45deg, #724BB7 0%, #4098D7 100%) !important;
139
+ line-height: unset;
140
+ }
141
+ #wpseo-settings-bar-root .dashicons-chart-area::before {
142
+ vertical-align: middle !important;
143
+ line-height: unset;
144
+ color: #ffffff;
145
+ margin-top: 7px;
146
+ }
147
+
148
+ .et-fb-page-settings-bar--active #wpseo-settings-bar-root {
149
+ left: -50px;
150
+ }
151
+
152
+ /*# sourceMappingURL=style.css.map */
assets/css/divi/style.css.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sourceRoot":"","sources":["style.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;;AAGF;EACE;;AAEA;EACE;EACA;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;;AACA;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGJ;EACE;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAKF;EACE;;AAGF;EACE;;AAIJ;EACE;;AAEA;EACE;EACA;EACA;;;AAKN;AACA;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;;;AAMJ;EACE","file":"style.css"}
assets/css/divi/style.scss ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #seo_et_ignore_iframe {
2
+ position: absolute;
3
+ z-index: 1;
4
+ top: 0;
5
+ left: 0;
6
+ height: 0;
7
+ width: 0;
8
+ overflow: visible;
9
+
10
+ &.hidden {
11
+ display: none;
12
+ }
13
+
14
+ .mpns-clear-float {
15
+ float: none !important;
16
+ width: 100%;
17
+ }
18
+
19
+ .metaseo_left {
20
+ float: none !important;
21
+ width: 100% !important;
22
+ }
23
+
24
+ .wpms-full-width {
25
+ width: 100% !important;
26
+ }
27
+
28
+ .wpmstabs {
29
+ display: grid;
30
+
31
+ li {
32
+ display: block;
33
+ width: 100%;
34
+ }
35
+ }
36
+
37
+ .wpmseo-metabox-tabs-div {
38
+ position: relative;
39
+ top: 35px;
40
+ left: 0;
41
+ display: block;
42
+ width: 450px;
43
+ overflow: auto;
44
+ max-height: 95vh;
45
+
46
+ input, textarea, .container-snippet {
47
+ min-width: 300px !important;
48
+ }
49
+ }
50
+
51
+ .wpms-top-h2 {
52
+ font-size: 20px !important;
53
+ font-weight: 600 !important;
54
+ font-style: normal;
55
+ font-stretch: normal;
56
+ line-height: normal !important;
57
+ letter-spacing: 1px;
58
+ color: #394857;
59
+ margin: 20px 0 !important;
60
+ }
61
+ .reload_analysis {
62
+ float: right;
63
+ .spinner {
64
+ position: relative;
65
+ top: 0;
66
+ right: 0;
67
+ }
68
+
69
+ img {
70
+ max-width: 100%;
71
+ height: auto;
72
+ border: 0;
73
+ }
74
+ }
75
+ #reload_analysis {
76
+ font-size: 10px;
77
+ padding: 8px 10px;
78
+ min-width: 130px;
79
+ }
80
+ .ju-setting-label {
81
+ font-size: 14px !important;
82
+ font-weight: 600;
83
+ font-style: normal;
84
+ font-stretch: normal;
85
+ line-height: normal;
86
+ letter-spacing: 0.5px;
87
+ color: #404852;
88
+ }
89
+
90
+ #wpmseo_general, #wpmseo_social {
91
+ max-height: calc(100% - 300px);
92
+ overflow: auto;
93
+ margin: 0;
94
+ width: 100%;
95
+ padding: 0 10px 10px;
96
+ box-sizing: border-box;
97
+ background: #f3f6fa;
98
+
99
+ .optimization-row-box {
100
+ width: 100% !important;
101
+ padding: 20px 15px 10px 15px;
102
+ }
103
+
104
+ #metaseo_wpmseo_title-length, #metaseo_wpmseo_desc-length {
105
+ margin-left: 10px;
106
+ }
107
+
108
+ .description {
109
+ font-size: 12px !important;
110
+ display: inline-block;
111
+ width: 90%;
112
+ font-weight: normal;
113
+ font-style: normal !important;
114
+ font-stretch: normal;
115
+ line-height: 1.88;
116
+ letter-spacing: 0.8px;
117
+ color: #5f879b !important;
118
+ padding-right: 20px;
119
+ margin: 10px 0 10px 15px !important;
120
+ }
121
+ }
122
+
123
+ .wpms-bootstrap-tagsinput {
124
+ input {
125
+ min-width: unset !important;
126
+ }
127
+
128
+ .label {
129
+ margin-top: 5px;
130
+ }
131
+ }
132
+
133
+ #metaseo_wpmseo_opengraph-image, #metaseo_wpmseo_twitter-image {
134
+ width: 75%;
135
+
136
+ ~ button {
137
+ padding: 0 !important;
138
+ margin-left: 1%;
139
+ font-size: 12px;
140
+ }
141
+ }
142
+ }
143
+
144
+ /*parent doc*/
145
+ #wpseo-settings-bar-root {
146
+ left: calc(50% - 70px);
147
+ position: absolute;
148
+ cursor: pointer;
149
+ pointer-events: auto;
150
+
151
+ .dashicons-chart-area {
152
+ width: 40px;
153
+ background: #6c2eb9;
154
+ height: 40px;
155
+ border-radius: 50%;
156
+ text-align: center;
157
+ box-shadow: 0 5px 10px rgb(108 46 185 / 15%);
158
+ background-image: linear-gradient(45deg, #724BB7 0%, #4098D7 100%) !important;
159
+ line-height: unset;
160
+
161
+ &::before {
162
+ vertical-align: middle !important;
163
+ line-height: unset;
164
+ color: #ffffff;
165
+ margin-top: 7px;
166
+ }
167
+ }
168
+ }
169
+
170
+ .et-fb-page-settings-bar--active {
171
+ #wpseo-settings-bar-root {
172
+ left: -50px;
173
+ }
174
+ }
assets/js/bootstrap/bootstrap-tagsinput.min.js CHANGED
@@ -3,4 +3,298 @@
3
  *
4
  */
5
 
6
- !function(a){"use strict";function b(b,c){this.isInit=!0,this.itemsArray=[],this.$element=a(b),this.$element.hide(),this.isSelect="SELECT"===b.tagName,this.multiple=this.isSelect&&b.hasAttribute("multiple"),this.objectItems=c&&c.itemValue,this.placeholderText=b.hasAttribute("placeholder")?this.$element.attr("placeholder"):"",this.inputSize=Math.max(1,this.placeholderText.length),this.$container=a('<div class="wpms-bootstrap-tagsinput"></div>'),this.$input=a('<input type="text" placeholder="'+this.placeholderText+'"/>').appendTo(this.$container),this.$element.before(this.$container),this.build(c),this.isInit=!1}function c(a,b){if("function"!=typeof a[b]){var c=a[b];a[b]=function(a){return a[c]}}}function d(a,b){if("function"!=typeof a[b]){var c=a[b];a[b]=function(){return c}}}function e(a){return a?i.text(a).html():""}function f(a){var b=0;if(document.selection){a.focus();var c=document.selection.createRange();c.moveStart("character",-a.value.length),b=c.text.length}else(a.selectionStart||"0"==a.selectionStart)&&(b=a.selectionStart);return b}function g(b,c){var d=!1;return a.each(c,function(a,c){if("number"==typeof c&&b.which===c)return d=!0,!1;if(b.which===c.which){var e=!c.hasOwnProperty("altKey")||b.altKey===c.altKey,f=!c.hasOwnProperty("shiftKey")||b.shiftKey===c.shiftKey,g=!c.hasOwnProperty("ctrlKey")||b.ctrlKey===c.ctrlKey;if(e&&f&&g)return d=!0,!1}}),d}var h={tagClass:function(a){return"label label-info"},focusClass:"focus",itemValue:function(a){return a?a.toString():a},itemText:function(a){return this.itemValue(a)},itemTitle:function(a){return null},freeInput:!0,addOnBlur:!0,maxTags:void 0,maxChars:void 0,confirmKeys:[13,44],delimiter:",",delimiterRegex:null,cancelConfirmKeysOnEmpty:!1,onTagExists:function(a,b){b.hide().fadeIn()},trimValue:!1,allowDuplicates:!1,triggerChange:!0};b.prototype={constructor:b,add:function(b,c,d){var f=this;if(!(f.options.maxTags&&f.itemsArray.length>=f.options.maxTags)&&(b===!1||b)){if("string"==typeof b&&f.options.trimValue&&(b=a.trim(b)),"object"==typeof b&&!f.objectItems)throw"Can't add objects when itemValue option is not set";if(!b.toString().match(/^\s*$/)){if(f.isSelect&&!f.multiple&&f.itemsArray.length>0&&f.remove(f.itemsArray[0]),"string"==typeof b&&"INPUT"===this.$element[0].tagName){var g=f.options.delimiterRegex?f.options.delimiterRegex:f.options.delimiter,h=b.split(g);if(h.length>1){for(var i=0;i<h.length;i++)this.add(h[i],!0);return void(c||f.pushVal(f.options.triggerChange))}}var j=f.options.itemValue(b),k=f.options.itemText(b),l=f.options.tagClass(b),m=f.options.itemTitle(b),n=a.grep(f.itemsArray,function(a){return f.options.itemValue(a)===j})[0];if(!n||f.options.allowDuplicates){if(!(f.items().toString().length+b.length+1>f.options.maxInputLength)){var o=a.Event("beforeItemAdd",{item:b,cancel:!1,options:d});if(f.$element.trigger(o),!o.cancel){f.itemsArray.push(b);var p=a('<span class="tag '+e(l)+(null!==m?'" title="'+m:"")+'">'+e(k)+'<span data-role="remove"></span></span>');p.data("item",b),f.findInputWrapper().before(p),p.after(" ");var q=a('option[value="'+encodeURIComponent(j)+'"]',f.$element).length||a('option[value="'+e(j)+'"]',f.$element).length;if(f.isSelect&&!q){var r=a("<option selected>"+e(k)+"</option>");r.data("item",b),r.attr("value",j),f.$element.append(r)}c||f.pushVal(f.options.triggerChange),(f.options.maxTags===f.itemsArray.length||f.items().toString().length===f.options.maxInputLength)&&f.$container.addClass("bootstrap-tagsinput-max"),a(".typeahead, .twitter-typeahead",f.$container).length&&f.$input.typeahead("val",""),this.isInit?f.$element.trigger(a.Event("itemAddedOnInit",{item:b,options:d})):f.$element.trigger(a.Event("itemAdded",{item:b,options:d}))}}}else if(f.options.onTagExists){var s=a(".tag",f.$container).filter(function(){return a(this).data("item")===n});f.options.onTagExists(b,s)}}}},remove:function(b,c,d){var e=this;if(e.objectItems&&(b="object"==typeof b?a.grep(e.itemsArray,function(a){return e.options.itemValue(a)==e.options.itemValue(b)}):a.grep(e.itemsArray,function(a){return e.options.itemValue(a)==b}),b=b[b.length-1]),b){var f=a.Event("beforeItemRemove",{item:b,cancel:!1,options:d});if(e.$element.trigger(f),f.cancel)return;a(".tag",e.$container).filter(function(){return a(this).data("item")===b}).remove(),a("option",e.$element).filter(function(){return a(this).data("item")===b}).remove(),-1!==a.inArray(b,e.itemsArray)&&e.itemsArray.splice(a.inArray(b,e.itemsArray),1)}c||e.pushVal(e.options.triggerChange),e.options.maxTags>e.itemsArray.length&&e.$container.removeClass("bootstrap-tagsinput-max"),e.$element.trigger(a.Event("itemRemoved",{item:b,options:d}))},removeAll:function(){var b=this;for(a(".tag",b.$container).remove(),a("option",b.$element).remove();b.itemsArray.length>0;)b.itemsArray.pop();b.pushVal(b.options.triggerChange)},refresh:function(){var b=this;a(".tag",b.$container).each(function(){var c=a(this),d=c.data("item"),f=b.options.itemValue(d),g=b.options.itemText(d),h=b.options.tagClass(d);if(c.attr("class",null),c.addClass("tag "+e(h)),c.contents().filter(function(){return 3==this.nodeType})[0].nodeValue=e(g),b.isSelect){var i=a("option",b.$element).filter(function(){return a(this).data("item")===d});i.attr("value",f)}})},items:function(){return this.itemsArray},pushVal:function(){var b=this,c=a.map(b.items(),function(a){return b.options.itemValue(a).toString()});b.$element.val(c,!0),b.options.triggerChange&&b.$element.trigger("change")},build:function(b){var e=this;if(e.options=a.extend({},h,b),e.objectItems&&(e.options.freeInput=!1),c(e.options,"itemValue"),c(e.options,"itemText"),d(e.options,"tagClass"),e.options.typeahead){var i=e.options.typeahead||{};d(i,"source"),e.$input.typeahead(a.extend({},i,{source:function(b,c){function d(a){for(var b=[],d=0;d<a.length;d++){var g=e.options.itemText(a[d]);f[g]=a[d],b.push(g)}c(b)}this.map={};var f=this.map,g=i.source(b);a.isFunction(g.success)?g.success(d):a.isFunction(g.then)?g.then(d):a.when(g).then(d)},updater:function(a){return e.add(this.map[a]),this.map[a]},matcher:function(a){return-1!==a.toLowerCase().indexOf(this.query.trim().toLowerCase())},sorter:function(a){return a.sort()},highlighter:function(a){var b=new RegExp("("+this.query+")","gi");return a.replace(b,"<strong>$1</strong>")}}))}if(e.options.typeaheadjs){var j=null,k={},l=e.options.typeaheadjs;a.isArray(l)?(j=l[0],k=l[1]):k=l,e.$input.typeahead(j,k).on("typeahead:selected",a.proxy(function(a,b){k.valueKey?e.add(b[k.valueKey]):e.add(b),e.$input.typeahead("val","")},e))}e.$container.on("click",a.proxy(function(a){e.$element.attr("disabled")||e.$input.removeAttr("disabled"),e.$input.focus()},e)),e.options.addOnBlur&&e.options.freeInput&&e.$input.on("focusout",a.proxy(function(b){0===a(".typeahead, .twitter-typeahead",e.$container).length&&(e.add(e.$input.val()),e.$input.val(""))},e)),e.$container.on({focusin:function(){e.$container.addClass(e.options.focusClass)},focusout:function(){e.$container.removeClass(e.options.focusClass)}}),e.$container.on("keydown","input",a.proxy(function(b){var c=a(b.target),d=e.findInputWrapper();if(e.$element.attr("disabled"))return void e.$input.attr("disabled","disabled");switch(b.which){case 8:if(0===f(c[0])){var g=d.prev();g.length&&e.remove(g.data("item"))}break;case 46:if(0===f(c[0])){var h=d.next();h.length&&e.remove(h.data("item"))}break;case 37:var i=d.prev();0===c.val().length&&i[0]&&(i.before(d),c.focus());break;case 39:var j=d.next();0===c.val().length&&j[0]&&(j.after(d),c.focus())}var k=c.val().length;Math.ceil(k/5);c.attr("size",Math.max(this.inputSize,c.val().length))},e)),e.$container.on("keypress","input",a.proxy(function(b){var c=a(b.target);if(e.$element.attr("disabled"))return void e.$input.attr("disabled","disabled");var d=c.val(),f=e.options.maxChars&&d.length>=e.options.maxChars;e.options.freeInput&&(g(b,e.options.confirmKeys)||f)&&(0!==d.length&&(e.add(f?d.substr(0,e.options.maxChars):d),c.val("")),e.options.cancelConfirmKeysOnEmpty===!1&&b.preventDefault());var h=c.val().length;Math.ceil(h/5);c.attr("size",Math.max(this.inputSize,c.val().length))},e)),e.$container.on("click","[data-role=remove]",a.proxy(function(b){e.$element.attr("disabled")||e.remove(a(b.target).closest(".tag").data("item"))},e)),e.options.itemValue===h.itemValue&&("INPUT"===e.$element[0].tagName?e.add(e.$element.val()):a("option",e.$element).each(function(){e.add(a(this).attr("value"),!0)}))},destroy:function(){var a=this;a.$container.off("keypress","input"),a.$container.off("click","[role=remove]"),a.$container.remove(),a.$element.removeData("tagsinput"),a.$element.show()},focus:function(){this.$input.focus()},input:function(){return this.$input},findInputWrapper:function(){for(var b=this.$input[0],c=this.$container[0];b&&b.parentNode!==c;)b=b.parentNode;return a(b)}},a.fn.tagsinput=function(c,d,e){var f=[];return this.each(function(){var g=a(this).data("tagsinput");if(g)if(c||d){if(void 0!==g[c]){if(3===g[c].length&&void 0!==e)var h=g[c](d,null,e);else var h=g[c](d);void 0!==h&&f.push(h)}}else f.push(g);else g=new b(this,c),a(this).data("tagsinput",g),f.push(g),"SELECT"===this.tagName&&a("option",a(this)).attr("selected","selected"),a(this).val(a(this).val())}),"string"==typeof c?f.length>1?f:f[0]:f},a.fn.tagsinput.Constructor=b;var i=a("<div />");a(function(){a("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput()})}(window.jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  *
4
  */
5
 
6
+ !function (a) {
7
+ "use strict";
8
+
9
+ function b(b, c) {
10
+ this.isInit = !0,
11
+ this.itemsArray = [],
12
+ this.$element = a(b),
13
+ this.$element.hide(),
14
+ this.isSelect = "SELECT" === b.tagName,
15
+ this.multiple = this.isSelect && b.hasAttribute("multiple"),
16
+ this.objectItems = c && c.itemValue,
17
+ this.placeholderText = b.hasAttribute("placeholder") ? this.$element.attr("placeholder") : "",
18
+ this.inputSize = Math.max(1, this.placeholderText.length),
19
+ this.$container = a('<div class="wpms-bootstrap-tagsinput"></div>'),
20
+ this.$input = a('<input type="text" placeholder="' + this.placeholderText + '"/>').appendTo(this.$container),
21
+ this.$element.before(this.$container),
22
+ this.build(c),
23
+ this.isInit = !1
24
+ }
25
+
26
+ function c(a, b) {
27
+ if ("function" != typeof a[b]) {
28
+ var c = a[b];
29
+ a[b] = function (a) {
30
+ return a[c]
31
+ }
32
+ }
33
+ }
34
+
35
+ function d(a, b) {
36
+ if ("function" != typeof a[b]) {
37
+ var c = a[b];
38
+ a[b] = function () {
39
+ return c
40
+ }
41
+ }
42
+ }
43
+
44
+ function e(a) {
45
+ return a ? i.text(a).html() : ""
46
+ }
47
+
48
+ function f(a) {
49
+ var b = 0;
50
+ if (document.selection) {
51
+ a.focus();
52
+ var c = document.selection.createRange();
53
+ c.moveStart("character", -a.value.length), b = c.text.length
54
+ } else (a.selectionStart || "0" == a.selectionStart) && (b = a.selectionStart);
55
+ return b
56
+ }
57
+
58
+ function g(b, c) {
59
+ var d = !1;
60
+ return a.each(c, function (a, c) {
61
+ if ("number" == typeof c && b.which === c) return d = !0, !1;
62
+ if (b.which === c.which) {
63
+ var e = !c.hasOwnProperty("altKey") || b.altKey === c.altKey,
64
+ f = !c.hasOwnProperty("shiftKey") || b.shiftKey === c.shiftKey,
65
+ g = !c.hasOwnProperty("ctrlKey") || b.ctrlKey === c.ctrlKey;
66
+ if (e && f && g) return d = !0, !1
67
+ }
68
+ }), d
69
+ }
70
+
71
+ var h = {
72
+ tagClass: function (a) {
73
+ return "label label-info"
74
+ },
75
+ focusClass: "focus",
76
+ itemValue: function (a) {
77
+ return a ? a.toString() : a
78
+ },
79
+ itemText: function (a) {
80
+ return this.itemValue(a)
81
+ },
82
+ itemTitle: function (a) {
83
+ return null
84
+ },
85
+ freeInput: !0,
86
+ addOnBlur: !0,
87
+ maxTags: void 0,
88
+ maxChars: void 0,
89
+ confirmKeys: [13, 44],
90
+ delimiter: ",",
91
+ delimiterRegex: null,
92
+ cancelConfirmKeysOnEmpty: !1,
93
+ onTagExists: function (a, b) {
94
+ b.hide().fadeIn()
95
+ },
96
+ trimValue: !1,
97
+ allowDuplicates: !1,
98
+ triggerChange: !0
99
+ };
100
+ b.prototype = {
101
+ constructor: b, add: function (b, c, d) {
102
+ var f = this;
103
+ if (!(f.options.maxTags && f.itemsArray.length >= f.options.maxTags) && (b === !1 || b)) {
104
+ if ("string" == typeof b && f.options.trimValue && (b = a.trim(b)), "object" == typeof b && !f.objectItems) throw"Can't add objects when itemValue option is not set";
105
+ if (!b.toString().match(/^\s*$/)) {
106
+ if (f.isSelect && !f.multiple && f.itemsArray.length > 0 && f.remove(f.itemsArray[0]), "string" == typeof b && "INPUT" === this.$element[0].tagName) {
107
+ var g = f.options.delimiterRegex ? f.options.delimiterRegex : f.options.delimiter,
108
+ h = b.split(g);
109
+ if (h.length > 1) {
110
+ for (var i = 0; i < h.length; i++) this.add(h[i], !0);
111
+ return void (c || f.pushVal(f.options.triggerChange))
112
+ }
113
+ }
114
+ var j = f.options.itemValue(b), k = f.options.itemText(b), l = f.options.tagClass(b),
115
+ m = f.options.itemTitle(b), n = a.grep(f.itemsArray, function (a) {
116
+ return f.options.itemValue(a) === j
117
+ })[0];
118
+ if (!n || f.options.allowDuplicates) {
119
+ if (!(f.items().toString().length + b.length + 1 > f.options.maxInputLength)) {
120
+ var o = a.Event("beforeItemAdd", {item: b, cancel: !1, options: d});
121
+ if (f.$element.trigger(o), !o.cancel) {
122
+ f.itemsArray.push(b);
123
+ var p = a('<span class="tag ' + e(l) + (null !== m ? '" title="' + m : "") + '">' + e(k) + '<span data-role="remove"></span></span>');
124
+ p.data("item", b), f.findInputWrapper().before(p), p.after(" ");
125
+ var q = a('option[value="' + encodeURIComponent(j) + '"]', f.$element).length || a('option[value="' + e(j) + '"]', f.$element).length;
126
+ if (f.isSelect && !q) {
127
+ var r = a("<option selected>" + e(k) + "</option>");
128
+ r.data("item", b), r.attr("value", j), f.$element.append(r)
129
+ }
130
+ c || f.pushVal(f.options.triggerChange), (f.options.maxTags === f.itemsArray.length || f.items().toString().length === f.options.maxInputLength) && f.$container.addClass("bootstrap-tagsinput-max"), a(".typeahead, .twitter-typeahead", f.$container).length && f.$input.typeahead("val", ""), this.isInit ? f.$element.trigger(a.Event("itemAddedOnInit", {
131
+ item: b,
132
+ options: d
133
+ })) : f.$element.trigger(a.Event("itemAdded", {item: b, options: d}))
134
+ }
135
+ }
136
+ } else if (f.options.onTagExists) {
137
+ var s = a(".tag", f.$container).filter(function () {
138
+ return a(this).data("item") === n
139
+ });
140
+ f.options.onTagExists(b, s)
141
+ }
142
+ }
143
+ }
144
+ }, remove: function (b, c, d) {
145
+ var e = this;
146
+ if (e.objectItems && (b = "object" == typeof b ? a.grep(e.itemsArray, function (a) {
147
+ return e.options.itemValue(a) == e.options.itemValue(b)
148
+ }) : a.grep(e.itemsArray, function (a) {
149
+ return e.options.itemValue(a) == b
150
+ }), b = b[b.length - 1]), b) {
151
+ var f = a.Event("beforeItemRemove", {item: b, cancel: !1, options: d});
152
+ if (e.$element.trigger(f), f.cancel) return;
153
+ a(".tag", e.$container).filter(function () {
154
+ return a(this).data("item") === b
155
+ }).remove(), a("option", e.$element).filter(function () {
156
+ return a(this).data("item") === b
157
+ }).remove(), -1 !== a.inArray(b, e.itemsArray) && e.itemsArray.splice(a.inArray(b, e.itemsArray), 1)
158
+ }
159
+ c || e.pushVal(e.options.triggerChange), e.options.maxTags > e.itemsArray.length && e.$container.removeClass("bootstrap-tagsinput-max"), e.$element.trigger(a.Event("itemRemoved", {
160
+ item: b,
161
+ options: d
162
+ }))
163
+ }, removeAll: function () {
164
+ var b = this;
165
+ for (a(".tag", b.$container).remove(), a("option", b.$element).remove(); b.itemsArray.length > 0;) b.itemsArray.pop();
166
+ b.pushVal(b.options.triggerChange)
167
+ }, refresh: function () {
168
+ var b = this;
169
+ a(".tag", b.$container).each(function () {
170
+ var c = a(this), d = c.data("item"), f = b.options.itemValue(d), g = b.options.itemText(d),
171
+ h = b.options.tagClass(d);
172
+ if (c.attr("class", null), c.addClass("tag " + e(h)), c.contents().filter(function () {
173
+ return 3 == this.nodeType
174
+ })[0].nodeValue = e(g), b.isSelect) {
175
+ var i = a("option", b.$element).filter(function () {
176
+ return a(this).data("item") === d
177
+ });
178
+ i.attr("value", f)
179
+ }
180
+ })
181
+ }, items: function () {
182
+ return this.itemsArray
183
+ }, pushVal: function () {
184
+ var b = this, c = a.map(b.items(), function (a) {
185
+ return b.options.itemValue(a).toString()
186
+ });
187
+ b.$element.val(c, !0), b.options.triggerChange && b.$element.trigger("change")
188
+ }, build: function (b) {
189
+ var e = this;
190
+ if (e.options = a.extend({}, h, b), e.objectItems && (e.options.freeInput = !1), c(e.options, "itemValue"), c(e.options, "itemText"), d(e.options, "tagClass"), e.options.typeahead) {
191
+ var i = e.options.typeahead || {};
192
+ d(i, "source"), e.$input.typeahead(a.extend({}, i, {
193
+ source: function (b, c) {
194
+ function d(a) {
195
+ for (var b = [], d = 0; d < a.length; d++) {
196
+ var g = e.options.itemText(a[d]);
197
+ f[g] = a[d], b.push(g)
198
+ }
199
+ c(b)
200
+ }
201
+
202
+ this.map = {};
203
+ var f = this.map, g = i.source(b);
204
+ a.isFunction(g.success) ? g.success(d) : a.isFunction(g.then) ? g.then(d) : a.when(g).then(d)
205
+ }, updater: function (a) {
206
+ return e.add(this.map[a]), this.map[a]
207
+ }, matcher: function (a) {
208
+ return -1 !== a.toLowerCase().indexOf(this.query.trim().toLowerCase())
209
+ }, sorter: function (a) {
210
+ return a.sort()
211
+ }, highlighter: function (a) {
212
+ var b = new RegExp("(" + this.query + ")", "gi");
213
+ return a.replace(b, "<strong>$1</strong>")
214
+ }
215
+ }))
216
+ }
217
+ if (e.options.typeaheadjs) {
218
+ var j = null, k = {}, l = e.options.typeaheadjs;
219
+ a.isArray(l) ? (j = l[0], k = l[1]) : k = l, e.$input.typeahead(j, k).on("typeahead:selected", a.proxy(function (a, b) {
220
+ k.valueKey ? e.add(b[k.valueKey]) : e.add(b), e.$input.typeahead("val", "")
221
+ }, e))
222
+ }
223
+ e.$container.on("click", a.proxy(function (a) {
224
+ e.$element.attr("disabled") || e.$input.removeAttr("disabled"), e.$input.focus()
225
+ }, e)), e.options.addOnBlur && e.options.freeInput && e.$input.on("focusout", a.proxy(function (b) {
226
+ 0 === a(".typeahead, .twitter-typeahead", e.$container).length && (e.add(e.$input.val()), e.$input.val(""))
227
+ }, e)), e.$container.on({
228
+ focusin: function () {
229
+ e.$container.addClass(e.options.focusClass)
230
+ }, focusout: function () {
231
+ e.$container.removeClass(e.options.focusClass)
232
+ }
233
+ }), e.$container.on("keydown", "input", a.proxy(function (b) {
234
+ var c = a(b.target), d = e.findInputWrapper();
235
+ if (e.$element.attr("disabled")) return void e.$input.attr("disabled", "disabled");
236
+ switch (b.which) {
237
+ case 8:
238
+ if (0 === f(c[0])) {
239
+ var g = d.prev();
240
+ g.length && e.remove(g.data("item"))
241
+ }
242
+ break;
243
+ case 46:
244
+ if (0 === f(c[0])) {
245
+ var h = d.next();
246
+ h.length && e.remove(h.data("item"))
247
+ }
248
+ break;
249
+ case 37:
250
+ var i = d.prev();
251
+ 0 === c.val().length && i[0] && (i.before(d), c.focus());
252
+ break;
253
+ case 39:
254
+ var j = d.next();
255
+ 0 === c.val().length && j[0] && (j.after(d), c.focus())
256
+ }
257
+ var k = c.val().length;
258
+ Math.ceil(k / 5);
259
+ c.attr("size", Math.max(this.inputSize, c.val().length))
260
+ }, e)), e.$container.on("keypress", "input", a.proxy(function (b) {
261
+ var c = a(b.target);
262
+ if (e.$element.attr("disabled")) return void e.$input.attr("disabled", "disabled");
263
+ var d = c.val(), f = e.options.maxChars && d.length >= e.options.maxChars;
264
+ e.options.freeInput && (g(b, e.options.confirmKeys) || f) && (0 !== d.length && (e.add(f ? d.substr(0, e.options.maxChars) : d), c.val("")), e.options.cancelConfirmKeysOnEmpty === !1 && b.preventDefault());
265
+ var h = c.val().length;
266
+ Math.ceil(h / 5);
267
+ c.attr("size", Math.max(this.inputSize, c.val().length))
268
+ }, e)), e.$container.on("click", "[data-role=remove]", a.proxy(function (b) {
269
+ e.$element.attr("disabled") || e.remove(a(b.target).closest(".tag").data("item"))
270
+ }, e)), e.options.itemValue === h.itemValue && ("INPUT" === e.$element[0].tagName ? e.add(e.$element.val()) : a("option", e.$element).each(function () {
271
+ e.add(a(this).attr("value"), !0)
272
+ }))
273
+ }, destroy: function () {
274
+ var a = this;
275
+ a.$container.off("keypress", "input"), a.$container.off("click", "[role=remove]"), a.$container.remove(), a.$element.removeData("tagsinput"), a.$element.show()
276
+ }, focus: function () {
277
+ this.$input.focus()
278
+ }, input: function () {
279
+ return this.$input
280
+ }, findInputWrapper: function () {
281
+ for (var b = this.$input[0], c = this.$container[0]; b && b.parentNode !== c;) b = b.parentNode;
282
+ return a(b)
283
+ }
284
+ }, a.fn.tagsinput = function (c, d, e) {
285
+ var f = [];
286
+ return this.each(function () {
287
+ var g = a(this).data("tagsinput");
288
+ if (g) if (c || d) {
289
+ if (void 0 !== g[c]) {
290
+ if (3 === g[c].length && void 0 !== e) var h = g[c](d, null, e); else var h = g[c](d);
291
+ void 0 !== h && f.push(h)
292
+ }
293
+ } else f.push(g); else g = new b(this, c), a(this).data("tagsinput", g), f.push(g), "SELECT" === this.tagName && a("option", a(this)).attr("selected", "selected"), a(this).val(a(this).val())
294
+ }), "string" == typeof c ? f.length > 1 ? f : f[0] : f
295
+ }, a.fn.tagsinput.Constructor = b;
296
+ var i = a("<div />");
297
+ a(function () {
298
+ a("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput()
299
+ })
300
+ }(window.jQuery);
assets/js/elementor/wpms-elementor.js CHANGED
@@ -378,6 +378,8 @@ jQuery(function ($) {
378
  str = str.replace(/%currentdate%/g, wpmseoMetaboxL10n.currentdate);
379
  str = str.replace(/%currentday%/g, wpmseoMetaboxL10n.currentday);
380
  str = str.replace(/%currentmonth%/g, wpmseoMetaboxL10n.currentmonth);
 
 
381
  str = str.replace(/%currentyear%/g, wpmseoMetaboxL10n.currentyear);
382
 
383
  // excerpt
378
  str = str.replace(/%currentdate%/g, wpmseoMetaboxL10n.currentdate);
379
  str = str.replace(/%currentday%/g, wpmseoMetaboxL10n.currentday);
380
  str = str.replace(/%currentmonth%/g, wpmseoMetaboxL10n.currentmonth);
381
+ str = str.replace(/%pagetotal%/g, wpmseoMetaboxL10n.pagetotal);
382
+ str = str.replace(/%pagenumber%/g, wpmseoMetaboxL10n.pagenumber);
383
  str = str.replace(/%currentyear%/g, wpmseoMetaboxL10n.currentyear);
384
 
385
  // excerpt
assets/js/elementor/wpms-seokeyword-metabox.js CHANGED
@@ -210,6 +210,8 @@ var elmTitle = '';
210
  str = str.replace(/%currentdate%/g, wpmseoMetaboxL10n.currentdate);
211
  str = str.replace(/%currentday%/g, wpmseoMetaboxL10n.currentday);
212
  str = str.replace(/%currentmonth%/g, wpmseoMetaboxL10n.currentmonth);
 
 
213
  str = str.replace(/%currentyear%/g, wpmseoMetaboxL10n.currentyear);
214
 
215
  // excerpt
210
  str = str.replace(/%currentdate%/g, wpmseoMetaboxL10n.currentdate);
211
  str = str.replace(/%currentday%/g, wpmseoMetaboxL10n.currentday);
212
  str = str.replace(/%currentmonth%/g, wpmseoMetaboxL10n.currentmonth);
213
+ str = str.replace(/%pagetotal%/g, wpmseoMetaboxL10n.pagetotal);
214
+ str = str.replace(/%pagenumber%/g, wpmseoMetaboxL10n.pagenumber);
215
  str = str.replace(/%currentyear%/g, wpmseoMetaboxL10n.currentyear);
216
 
217
  // excerpt
assets/js/wp-metaseo-metabox.js CHANGED
@@ -1,7 +1,9 @@
1
  jQuery.noConflict();
2
 
3
  jQuery(function ($) {
4
- $('.metabox-snippet-title .container-snippet .input').on('input', function () {$('.metabox-snippet-title .container-snippet .text').text($(this).val());}).trigger('input');;
 
 
5
 
6
  var input = document.getElementById('metaseo_wpmseo_desc');
7
  input.addEventListener('input', resizeInput);
@@ -32,7 +34,11 @@ function msReplaceVariables(str, callback) {
32
  return;
33
  }
34
  if (jQuery(wpmsdivtitle).length) {
35
- str = str.replace(/%title%/g, jQuery(wpmsdivtitle).text().replace(/(<([^>]+)>)/ig, ''));
 
 
 
 
36
  }
37
 
38
  // These are added in the head for performance reasons.
@@ -46,6 +52,8 @@ function msReplaceVariables(str, callback) {
46
  str = str.replace(/%currentdate%/g, wpmseoMetaboxL10n.currentdate);
47
  str = str.replace(/%currentday%/g, wpmseoMetaboxL10n.currentday);
48
  str = str.replace(/%currentmonth%/g, wpmseoMetaboxL10n.currentmonth);
 
 
49
  str = str.replace(/%currentyear%/g, wpmseoMetaboxL10n.currentyear);
50
 
51
  // excerpt
1
  jQuery.noConflict();
2
 
3
  jQuery(function ($) {
4
+ $('.metabox-snippet-title .container-snippet .input').on('input', function () {
5
+ $('.metabox-snippet-title .container-snippet .text').text($(this).val());
6
+ }).trigger('input');
7
 
8
  var input = document.getElementById('metaseo_wpmseo_desc');
9
  input.addEventListener('input', resizeInput);
34
  return;
35
  }
36
  if (jQuery(wpmsdivtitle).length) {
37
+ if (jQuery(wpmsdivtitle).text() == '' && jQuery(wpmsdivtitle).val() !== '') {
38
+ str = str.replace(/%title%/g, jQuery(wpmsdivtitle).val().replace(/(<([^>]+)>)/ig, ''));
39
+ } else {
40
+ str = str.replace(/%title%/g, jQuery(wpmsdivtitle).text().replace(/(<([^>]+)>)/ig, ''));
41
+ }
42
  }
43
 
44
  // These are added in the head for performance reasons.
52
  str = str.replace(/%currentdate%/g, wpmseoMetaboxL10n.currentdate);
53
  str = str.replace(/%currentday%/g, wpmseoMetaboxL10n.currentday);
54
  str = str.replace(/%currentmonth%/g, wpmseoMetaboxL10n.currentmonth);
55
+ str = str.replace(/%pagetotal%/g, wpmseoMetaboxL10n.pagetotal);
56
+ str = str.replace(/%pagenumber%/g, wpmseoMetaboxL10n.pagenumber);
57
  str = str.replace(/%currentyear%/g, wpmseoMetaboxL10n.currentyear);
58
 
59
  // excerpt
assets/js/wpms-seokeyword-metabox.js CHANGED
@@ -1,4 +1,5 @@
1
  (function (wpData, $) {
 
2
  const {select, subscribe} = wpData;
3
 
4
  class wpmsSpecificKeywords {
@@ -218,6 +219,8 @@
218
  str = str.replace(/%currentdate%/g, wpmseoMetaboxL10n.currentdate);
219
  str = str.replace(/%currentday%/g, wpmseoMetaboxL10n.currentday);
220
  str = str.replace(/%currentmonth%/g, wpmseoMetaboxL10n.currentmonth);
 
 
221
  str = str.replace(/%currentyear%/g, wpmseoMetaboxL10n.currentyear);
222
 
223
  // excerpt
1
  (function (wpData, $) {
2
+ console.log(wpData);
3
  const {select, subscribe} = wpData;
4
 
5
  class wpmsSpecificKeywords {
219
  str = str.replace(/%currentdate%/g, wpmseoMetaboxL10n.currentdate);
220
  str = str.replace(/%currentday%/g, wpmseoMetaboxL10n.currentday);
221
  str = str.replace(/%currentmonth%/g, wpmseoMetaboxL10n.currentmonth);
222
+ str = str.replace(/%pagetotal%/g, wpmseoMetaboxL10n.pagetotal);
223
+ str = str.replace(/%pagenumber%/g, wpmseoMetaboxL10n.pagenumber);
224
  str = str.replace(/%currentyear%/g, wpmseoMetaboxL10n.currentyear);
225
 
226
  // excerpt
inc/class.metaseo-admin.php CHANGED
@@ -108,9 +108,14 @@ class MetaSeoAdmin
108
  * Load admin js
109
  */
110
  add_action('admin_enqueue_scripts', array($this, 'loadAdminScripts'));
 
 
 
 
111
  add_action('added_post_meta', array('MetaSeoContentListTable', 'updateMetaSync'), 99, 4);
112
  add_action('updated_post_meta', array('MetaSeoContentListTable', 'updateMetaSync'), 99, 4);
113
  add_action('deleted_post_meta', array('MetaSeoContentListTable', 'deleteMetaSync'), 99, 4);
 
114
  if (!get_option('wpms_set_ignore', false)) {
115
  add_option('wpms_set_ignore', 1, '', 'yes');
116
  }
@@ -120,17 +125,26 @@ class MetaSeoAdmin
120
  add_action('admin_notices', array($this, 'publicWarning'));
121
  }
122
  add_action('wp_enqueue_editor', array($this, 'linkTitleField'), 20);
 
 
 
 
123
  add_action('post_updated', array('MetaSeoBrokenLinkTable', 'updatePost'), 10, 3);
124
  add_action('delete_post', array('MetaSeoBrokenLinkTable', 'deletePost'));
125
  add_action('edit_comment', array('MetaSeoBrokenLinkTable', 'updateComment'));
126
  add_action('deleted_comment', array('MetaSeoBrokenLinkTable', 'deletedComment'));
127
  add_action('admin_head', array('MetaSeoContentListTable', 'customStyles'));
 
128
  add_action('admin_footer', array($this, 'editorFooter'));
129
  add_action('wp_dashboard_setup', array($this, 'addDashboardWidgets'));
130
  add_action('category_add_form_fields', array($this, 'categoryField'), 10, 2);
131
  add_action('category_edit_form_fields', array($this, 'editCategoryFields'));
132
  add_action('edited_category', array($this, 'saveCategoryMeta'), 10, 2);
133
  add_action('create_category', array($this, 'saveCategoryMeta'), 10, 2);
 
 
 
 
134
  add_action('post_updated', array('MetaSeoImageListTable', 'updatePost'), 10, 3);
135
  add_action('delete_post', array('MetaSeoImageListTable', 'deletePost'));
136
 
@@ -644,14 +658,14 @@ class MetaSeoAdmin
644
  wp_localize_script('wpms-dashboard-analytics-widgets', 'wpmsDashboardAnalytics', $this->localizeDashoardWidgets());
645
 
646
  $requestDates = array(
647
- array('value' => 'today', 'html' => 'TODAY'),
648
- array('value' => 'yesterday', 'html' => 'YESTERDAY'),
649
- array('value' => '7daysAgo', 'html' => 'LAST 7 DAYS'),
650
- array('value' => '14daysAgo', 'html' => 'LAST 14 DAYS'),
651
- array('value' => '30daysAgo', 'html' => 'LAST 30 DAYS'),
652
- array('value' => '90daysAgo', 'html' => 'LAST 90 DAYS'),
653
- array('value' => '365daysAgo', 'html' => 'ONE YEAR'),
654
- array('value' => '1095daysAgo', 'html' => 'THREE YEARS'),
655
  );
656
  $requestQuery = array(
657
  array('value' => 'sessions', 'html' => 'SESSIONS'),
@@ -707,7 +721,7 @@ class MetaSeoAdmin
707
  'wpms_dashboard_analytics_widget',
708
  esc_html__('Google Analytics Overview', 'wp-meta-seo'),
709
  array(
710
- $this,
711
  'dashboardAnalyticsWidget'
712
  )
713
  );
@@ -721,17 +735,17 @@ class MetaSeoAdmin
721
  public function localizeDashoardWidgets()
722
  {
723
  return array(
724
- 'ajaxUrl' => admin_url('admin-ajax.php'),
725
- 'wpms_nonce' => wp_create_nonce('wpms_nonce'),
726
- 'wpms_security' => wp_create_nonce('dashboard_analytics_widgets_security'),
727
- 'colorVariations' => array(
728
- esc_attr('#1e73be'),
729
- esc_attr('#0459a4'),
730
- esc_attr('#378cd7'),
731
- esc_attr('#51a6f1'),
732
- esc_attr('#00408b'),
733
- esc_attr('#6abfff'),
734
- esc_attr('#002671')
735
  ),
736
  'region' => false,
737
  'language' => get_bloginfo('language'),
@@ -1634,7 +1648,18 @@ class MetaSeoAdmin
1634
  }
1635
  }
1636
 
1637
- if (!empty($mpageurl) && !empty($mtitle) && strpos(sanitize_title($mtitle), sanitize_title($mpageurl)) !== false) {
 
 
 
 
 
 
 
 
 
 
 
1638
  $output .= $this->createFieldAnalysis(
1639
  'pageurl',
1640
  $tooltip_page['page_url'],
@@ -1931,7 +1956,7 @@ class MetaSeoAdmin
1931
  } elseif (isset($attrs['text']) && !empty($attrs['text'])) {
1932
  $content = $attrs['text'];
1933
  }
1934
-
1935
  if (!empty($attrs) && isset($tag)) {
1936
  $extracted[$tag][] = array(
1937
  'tag_name' => $tag,
@@ -2701,7 +2726,8 @@ class MetaSeoAdmin
2701
  'metaseo-google-icon',
2702
  '//fonts.googleapis.com/icon?family=Material+Icons'
2703
  );
2704
- if (in_array($current_screen->base, $lists_pages)) {
 
2705
  wp_enqueue_style(
2706
  'wpms-magnific-popup-style',
2707
  plugins_url('assets/css/magnific-popup.css', dirname(__FILE__)),
@@ -2782,7 +2808,7 @@ class MetaSeoAdmin
2782
  );
2783
 
2784
  wp_localize_script('wpms-settings-script', 'wpmsSettingsL10n', array(
2785
- 'choose_image' => esc_html__('Use Image', 'wp-meta-seo')
2786
  ));
2787
  }
2788
 
@@ -2802,7 +2828,7 @@ class MetaSeoAdmin
2802
  true
2803
  );
2804
 
2805
- if (in_array($current_screen->base, $array_menu) || $pagenow === 'post.php' || $pagenow === 'post-new.php') {
2806
  wp_enqueue_style(
2807
  'wpmetaseoAdmin',
2808
  plugins_url('assets/css/metaseo_admin.css', dirname(__FILE__)),
@@ -2819,8 +2845,8 @@ class MetaSeoAdmin
2819
  wp_enqueue_style('style', plugins_url('assets/css/style.css', dirname(__FILE__)), array(), WPMSEO_VERSION);
2820
  }
2821
 
2822
- if ($current_screen->base === 'wp-meta-seo_page_metaseo_image_meta'
2823
- || $current_screen->base === 'wp-meta-seo_page_metaseo_content_meta') {
2824
  wp_enqueue_script(
2825
  'wpms-bulk',
2826
  plugins_url('assets/js/wpms-bulk-action.js', dirname(__FILE__)),
@@ -2831,7 +2857,7 @@ class MetaSeoAdmin
2831
  wp_localize_script('wpms-bulk', 'wpmseobulkL10n', $this->localizeScript());
2832
  }
2833
 
2834
- if ($current_screen->base === 'wp-meta-seo_page_metaseo_broken_link') {
2835
  wp_enqueue_style(
2836
  'wpms_brokenlink_style',
2837
  plugins_url('assets/css/broken_link.css', dirname(__FILE__)),
@@ -2862,7 +2888,7 @@ class MetaSeoAdmin
2862
  );
2863
  }
2864
 
2865
- if ($current_screen->base === 'toplevel_page_metaseo_dashboard') {
2866
  wp_enqueue_script(
2867
  'metaseo-dashboard',
2868
  plugins_url('assets/js/dashboard.js', dirname(__FILE__)),
@@ -2900,7 +2926,7 @@ class MetaSeoAdmin
2900
  }
2901
  }
2902
 
2903
- if ($current_screen->base === 'wp-meta-seo_page_metaseo_better_ranking') {
2904
  wp_enqueue_style(
2905
  'wpms-better-seo',
2906
  plugins_url('assets/css/better_seo.css', dirname(__FILE__)),
@@ -2923,7 +2949,7 @@ class MetaSeoAdmin
2923
  'wp-meta-seo_page_metaseo_broken_link',
2924
  'wp-meta-seo_page_metaseo_google_analytics'
2925
  );
2926
- if (in_array($current_screen->base, $lists_pages)) {
2927
  wp_enqueue_style(
2928
  'wpms_notification_style',
2929
  plugins_url('assets/css/notification.css', dirname(__FILE__)),
@@ -2959,7 +2985,7 @@ class MetaSeoAdmin
2959
  );
2960
 
2961
  // Enqueue for category meta page
2962
- if ($current_screen->base === 'wp-meta-seo_page_metaseo_category_meta') {
2963
  wp_enqueue_style(
2964
  'wpmsCategoryMeta',
2965
  plugins_url('assets/css/metaseo-category-meta-bulk.css', dirname(__FILE__)),
@@ -3038,7 +3064,7 @@ class MetaSeoAdmin
3038
  );
3039
 
3040
  wp_register_style('metaseo-google-icon', '//fonts.googleapis.com/icon?family=Material+Icons');
3041
- if ($current_screen->base === 'wp-meta-seo_page_metaseo_google_analytics') {
3042
  $lang = get_bloginfo('language');
3043
  $lang = explode('-', $lang);
3044
  $lang = $lang[0];
@@ -3222,7 +3248,7 @@ class MetaSeoAdmin
3222
  'wp-meta-seo_page_metaseo_google_analytics',
3223
  'wp-meta-seo_page_metaseo_sendemail'
3224
  );
3225
- if (in_array($current_screen->base, $tippy_pages)) {
3226
  wp_enqueue_style('wpms-tippy-style');
3227
  wp_enqueue_script('wpms-tippy-core');
3228
  wp_enqueue_script('wpms-tippy');
@@ -3279,12 +3305,13 @@ class MetaSeoAdmin
3279
  */
3280
  public function columnsEnqueue()
3281
  {
3282
- $screen = get_current_screen();
 
 
3283
 
3284
- $allowed_post_types = self::getAccessiblePostTypes();
3285
-
3286
- if (!in_array($screen->post_type, $allowed_post_types, true)) {
3287
- return;
3288
  }
3289
 
3290
  wp_enqueue_style(
108
  * Load admin js
109
  */
110
  add_action('admin_enqueue_scripts', array($this, 'loadAdminScripts'));
111
+
112
+ if (!class_exists('MetaSeoContentListTable')) {
113
+ require_once(WPMETASEO_PLUGIN_DIR . '/inc/class.metaseo-content-list-table.php');
114
+ }
115
  add_action('added_post_meta', array('MetaSeoContentListTable', 'updateMetaSync'), 99, 4);
116
  add_action('updated_post_meta', array('MetaSeoContentListTable', 'updateMetaSync'), 99, 4);
117
  add_action('deleted_post_meta', array('MetaSeoContentListTable', 'deleteMetaSync'), 99, 4);
118
+
119
  if (!get_option('wpms_set_ignore', false)) {
120
  add_option('wpms_set_ignore', 1, '', 'yes');
121
  }
125
  add_action('admin_notices', array($this, 'publicWarning'));
126
  }
127
  add_action('wp_enqueue_editor', array($this, 'linkTitleField'), 20);
128
+
129
+ if (!class_exists('MetaSeoBrokenLinkTable')) {
130
+ require_once(WPMETASEO_PLUGIN_DIR . '/inc/class.metaseo-broken-link-table.php');
131
+ }
132
  add_action('post_updated', array('MetaSeoBrokenLinkTable', 'updatePost'), 10, 3);
133
  add_action('delete_post', array('MetaSeoBrokenLinkTable', 'deletePost'));
134
  add_action('edit_comment', array('MetaSeoBrokenLinkTable', 'updateComment'));
135
  add_action('deleted_comment', array('MetaSeoBrokenLinkTable', 'deletedComment'));
136
  add_action('admin_head', array('MetaSeoContentListTable', 'customStyles'));
137
+
138
  add_action('admin_footer', array($this, 'editorFooter'));
139
  add_action('wp_dashboard_setup', array($this, 'addDashboardWidgets'));
140
  add_action('category_add_form_fields', array($this, 'categoryField'), 10, 2);
141
  add_action('category_edit_form_fields', array($this, 'editCategoryFields'));
142
  add_action('edited_category', array($this, 'saveCategoryMeta'), 10, 2);
143
  add_action('create_category', array($this, 'saveCategoryMeta'), 10, 2);
144
+
145
+ if (!class_exists('MetaSeoImageListTable')) {
146
+ require_once(WPMETASEO_PLUGIN_DIR . '/inc/class.metaseo-image-list-table.php');
147
+ }
148
  add_action('post_updated', array('MetaSeoImageListTable', 'updatePost'), 10, 3);
149
  add_action('delete_post', array('MetaSeoImageListTable', 'deletePost'));
150
 
658
  wp_localize_script('wpms-dashboard-analytics-widgets', 'wpmsDashboardAnalytics', $this->localizeDashoardWidgets());
659
 
660
  $requestDates = array(
661
+ array('value' => 'today', 'html' => 'TODAY'),
662
+ array('value' => 'yesterday', 'html' => 'YESTERDAY'),
663
+ array('value' => '7daysAgo', 'html' => 'LAST 7 DAYS'),
664
+ array('value' => '14daysAgo', 'html' => 'LAST 14 DAYS'),
665
+ array('value' => '30daysAgo', 'html' => 'LAST 30 DAYS'),
666
+ array('value' => '90daysAgo', 'html' => 'LAST 90 DAYS'),
667
+ array('value' => '365daysAgo', 'html' => 'ONE YEAR'),
668
+ array('value' => '1095daysAgo', 'html' => 'THREE YEARS'),
669
  );
670
  $requestQuery = array(
671
  array('value' => 'sessions', 'html' => 'SESSIONS'),
721
  'wpms_dashboard_analytics_widget',
722
  esc_html__('Google Analytics Overview', 'wp-meta-seo'),
723
  array(
724
+ $this,
725
  'dashboardAnalyticsWidget'
726
  )
727
  );
735
  public function localizeDashoardWidgets()
736
  {
737
  return array(
738
+ 'ajaxUrl' => admin_url('admin-ajax.php'),
739
+ 'wpms_nonce' => wp_create_nonce('wpms_nonce'),
740
+ 'wpms_security' => wp_create_nonce('dashboard_analytics_widgets_security'),
741
+ 'colorVariations' => array(
742
+ esc_attr('#1e73be'),
743
+ esc_attr('#0459a4'),
744
+ esc_attr('#378cd7'),
745
+ esc_attr('#51a6f1'),
746
+ esc_attr('#00408b'),
747
+ esc_attr('#6abfff'),
748
+ esc_attr('#002671')
749
  ),
750
  'region' => false,
751
  'language' => get_bloginfo('language'),
1648
  }
1649
  }
1650
 
1651
+ //check is home page
1652
+ $home_url = home_url();
1653
+ $home_url_1 = explode('//', $home_url);
1654
+ $is_home = false;
1655
+ if (!empty($home_url_1[1]) && isset($_POST['datas']['mpageurl'])) {
1656
+ $home_url_2 = explode($home_url_1[1], $_POST['datas']['mpageurl']);
1657
+ if (!isset($home_url_2[1]) || (!empty($home_url_2[1]) && $home_url_2[1] === '/')) {
1658
+ $is_home = true;
1659
+ }
1660
+ }
1661
+
1662
+ if ((isset($_POST['datas']['mpageurl']) && $is_home) || (!empty($mpageurl) && !empty($mtitle) && strpos(sanitize_title($mtitle), sanitize_title($mpageurl)) !== false)) {
1663
  $output .= $this->createFieldAnalysis(
1664
  'pageurl',
1665
  $tooltip_page['page_url'],
1956
  } elseif (isset($attrs['text']) && !empty($attrs['text'])) {
1957
  $content = $attrs['text'];
1958
  }
1959
+
1960
  if (!empty($attrs) && isset($tag)) {
1961
  $extracted[$tag][] = array(
1962
  'tag_name' => $tag,
2726
  'metaseo-google-icon',
2727
  '//fonts.googleapis.com/icon?family=Material+Icons'
2728
  );
2729
+
2730
+ if (!empty($current_screen) && in_array($current_screen->base, $lists_pages)) {
2731
  wp_enqueue_style(
2732
  'wpms-magnific-popup-style',
2733
  plugins_url('assets/css/magnific-popup.css', dirname(__FILE__)),
2808
  );
2809
 
2810
  wp_localize_script('wpms-settings-script', 'wpmsSettingsL10n', array(
2811
+ 'choose_image' => esc_html__('Use Image', 'wp-meta-seo')
2812
  ));
2813
  }
2814
 
2828
  true
2829
  );
2830
 
2831
+ if (!empty($current_screen) && (in_array($current_screen->base, $array_menu) || $pagenow === 'post.php' || $pagenow === 'post-new.php')) {
2832
  wp_enqueue_style(
2833
  'wpmetaseoAdmin',
2834
  plugins_url('assets/css/metaseo_admin.css', dirname(__FILE__)),
2845
  wp_enqueue_style('style', plugins_url('assets/css/style.css', dirname(__FILE__)), array(), WPMSEO_VERSION);
2846
  }
2847
 
2848
+ if (!empty($current_screen) && ($current_screen->base === 'wp-meta-seo_page_metaseo_image_meta'
2849
+ || $current_screen->base === 'wp-meta-seo_page_metaseo_content_meta')) {
2850
  wp_enqueue_script(
2851
  'wpms-bulk',
2852
  plugins_url('assets/js/wpms-bulk-action.js', dirname(__FILE__)),
2857
  wp_localize_script('wpms-bulk', 'wpmseobulkL10n', $this->localizeScript());
2858
  }
2859
 
2860
+ if (!empty($current_screen) && $current_screen->base === 'wp-meta-seo_page_metaseo_broken_link') {
2861
  wp_enqueue_style(
2862
  'wpms_brokenlink_style',
2863
  plugins_url('assets/css/broken_link.css', dirname(__FILE__)),
2888
  );
2889
  }
2890
 
2891
+ if (!empty($current_screen) && $current_screen->base === 'toplevel_page_metaseo_dashboard') {
2892
  wp_enqueue_script(
2893
  'metaseo-dashboard',
2894
  plugins_url('assets/js/dashboard.js', dirname(__FILE__)),
2926
  }
2927
  }
2928
 
2929
+ if (!empty($current_screen) && $current_screen->base === 'wp-meta-seo_page_metaseo_better_ranking') {
2930
  wp_enqueue_style(
2931
  'wpms-better-seo',
2932
  plugins_url('assets/css/better_seo.css', dirname(__FILE__)),
2949
  'wp-meta-seo_page_metaseo_broken_link',
2950
  'wp-meta-seo_page_metaseo_google_analytics'
2951
  );
2952
+ if (!empty($current_screen) && in_array($current_screen->base, $lists_pages)) {
2953
  wp_enqueue_style(
2954
  'wpms_notification_style',
2955
  plugins_url('assets/css/notification.css', dirname(__FILE__)),
2985
  );
2986
 
2987
  // Enqueue for category meta page
2988
+ if (!empty($current_screen) && $current_screen->base === 'wp-meta-seo_page_metaseo_category_meta') {
2989
  wp_enqueue_style(
2990
  'wpmsCategoryMeta',
2991
  plugins_url('assets/css/metaseo-category-meta-bulk.css', dirname(__FILE__)),
3064
  );
3065
 
3066
  wp_register_style('metaseo-google-icon', '//fonts.googleapis.com/icon?family=Material+Icons');
3067
+ if (!empty($current_screen) && $current_screen->base === 'wp-meta-seo_page_metaseo_google_analytics') {
3068
  $lang = get_bloginfo('language');
3069
  $lang = explode('-', $lang);
3070
  $lang = $lang[0];
3248
  'wp-meta-seo_page_metaseo_google_analytics',
3249
  'wp-meta-seo_page_metaseo_sendemail'
3250
  );
3251
+ if (!empty($current_screen) && in_array($current_screen->base, $tippy_pages)) {
3252
  wp_enqueue_style('wpms-tippy-style');
3253
  wp_enqueue_script('wpms-tippy-core');
3254
  wp_enqueue_script('wpms-tippy');
3305
  */
3306
  public function columnsEnqueue()
3307
  {
3308
+ if (function_exists('get_current_screen')) {
3309
+ $screen = get_current_screen();
3310
+ $allowed_post_types = self::getAccessiblePostTypes();
3311
 
3312
+ if (!empty($current_screen) && !in_array($screen->post_type, $allowed_post_types, true)) {
3313
+ return;
3314
+ }
 
3315
  }
3316
 
3317
  wp_enqueue_style(
inc/class.metaseo-dashboard.php CHANGED
@@ -319,6 +319,7 @@ class MetaSeoDashboard
319
  $query .= ' WHERE ' . implode(' AND ', $where);
320
  // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Variable has been prepare
321
  $wpms_posts = $wpdb->get_results($query);
 
322
  $metadesc_filled = 0;
323
  if (!empty($wpms_posts)) {
324
  foreach ($wpms_posts as $post) {
319
  $query .= ' WHERE ' . implode(' AND ', $where);
320
  // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Variable has been prepare
321
  $wpms_posts = $wpdb->get_results($query);
322
+
323
  $metadesc_filled = 0;
324
  if (!empty($wpms_posts)) {
325
  foreach ($wpms_posts as $post) {
inc/class.metaseo-metabox.php CHANGED
@@ -143,6 +143,7 @@ class WPMSEOMetabox extends WPMSEOMeta
143
  return false;
144
  }
145
  $post_id = (isset($_POST['elementorPostID'])) ? $_POST['elementorPostID'] : '';
 
146
  if (!empty($post_id)) {
147
  $data = $_POST['datas'];
148
  $meta_prefix = '_metaseo_meta';
@@ -241,7 +242,8 @@ class WPMSEOMetabox extends WPMSEOMeta
241
  'post.php',
242
  'edit.php',
243
  ), true)
244
- && apply_filters('wpmseo_always_register_metaboxes_on_admin', false) === false)
 
245
  ) {
246
  return;
247
  }
@@ -255,25 +257,27 @@ class WPMSEOMetabox extends WPMSEOMeta
255
  )
256
  );
257
  }
258
-
259
- wp_enqueue_script(
260
- 'wpms_ju_velocity_js',
261
- plugins_url('assets/wordpress-css-framework/js/velocity.min.js', dirname(__FILE__)),
262
- array(),
263
- WPMSEO_VERSION
264
- );
265
- wp_enqueue_script(
266
- 'wpms_ju_waves_js',
267
- plugins_url('assets/wordpress-css-framework/js/waves.min.js', dirname(__FILE__)),
268
- array(),
269
- WPMSEO_VERSION
270
- );
271
- wp_enqueue_script(
272
- 'wpms_ju_tabs_js',
273
- plugins_url('assets/wordpress-css-framework/js/tabs.js', dirname(__FILE__)),
274
- array(),
275
- WPMSEO_VERSION
276
- );
 
 
277
 
278
  wp_enqueue_style(
279
  'wpms_main',
@@ -281,7 +285,6 @@ class WPMSEOMetabox extends WPMSEOMeta
281
  array(),
282
  WPMSEO_VERSION
283
  );
284
-
285
  wp_enqueue_style(
286
  'm-metabox-tabs',
287
  plugins_url('assets/css/metabox-tabs.css', WPMSEO_FILE),
@@ -315,8 +318,9 @@ class WPMSEOMetabox extends WPMSEOMeta
315
  WPMSEO_VERSION,
316
  true
317
  );
 
318
  //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, no need verification
319
- if (!(isset($_GET['action']) && $_GET['action'] === 'elementor')) {
320
  wp_enqueue_script(
321
  'm-wp-seo-metabox',
322
  plugins_url('assets/js/wp-metaseo-metabox.js', WPMSEO_FILE),
@@ -344,6 +348,18 @@ class WPMSEOMetabox extends WPMSEOMeta
344
  true
345
  );
346
  }
 
 
 
 
 
 
 
 
 
 
 
 
347
  wp_enqueue_style(
348
  'm-bootstrap-tagsinput',
349
  plugins_url('assets/css/bootstrap/bootstrap.tagsinput.css', WPMSEO_FILE),
@@ -371,6 +387,9 @@ class WPMSEOMetabox extends WPMSEOMeta
371
  wp_localize_script('wpms-elementor-media', 'wpmseoMediaL10n', $localize);
372
  wp_localize_script('metaseo-cliffpyles', 'wpmscliffpyles', $localize);
373
  wp_localize_script('wpms-cliffpyles-elementor', 'wpmscliffpyles', $localize);
 
 
 
374
  }
375
  }
376
 
@@ -382,9 +401,19 @@ class WPMSEOMetabox extends WPMSEOMeta
382
  public function localizeSettingsScript()
383
  {
384
  global $post;
385
- if (!empty($post)) {
386
- $post_title = $post->post_title;
 
 
 
 
 
 
387
  $post_content = $post->post_content;
 
 
 
 
388
  $post_type = $post->post_type;
389
  } else {
390
  $post_title = '';
@@ -444,13 +473,19 @@ class WPMSEOMetabox extends WPMSEOMeta
444
  if (!$settings || !isset($settings['metaseo_metatitle_tab'])) {
445
  $settings['metaseo_metatitle_tab'] = 1;
446
  }
 
 
 
 
447
  $vars_to_cache = array(
448
  'date' => wpmsRetrieveDate($post),
 
 
449
  'id' => !(empty($post->ID)) ? $post->ID : null,
450
  'sitename' => trim(strip_tags(get_bloginfo('name'))),
451
  'sitedesc' => trim(strip_tags(get_bloginfo('description'))),
452
  'sep' => '-',
453
- 'page' => '',
454
  'currenttime' => date_i18n(get_option('time_format')),
455
  'currentdate' => date_i18n(get_option('date_format')),
456
  'currentday' => date_i18n('j'),
@@ -730,7 +765,7 @@ class WPMSEOMetabox extends WPMSEOMeta
730
  foreach ($this->getMetaFieldDefs('general', $post->post_type) as $key => $meta_field) {
731
  $content .= $this->doMetaBox($meta_field, $key);
732
  if ($key === 'title') {
733
- $snippet_more = '%date%, %id%, %sitename%, %sitedesc%, %page%, %currenttime%, %currentdate%, %currentday%, %currentmonth%, %currentyear%';
734
  $content .= '<p class="description" style="margin: 0 0 10px 32px;">' . sprintf(esc_html__('Title and description variables: %s', 'wp-meta-seo'), '%title%, <span onclick="jQuery(this).text(\'' . $snippet_more . '\').removeClass(\'snippet-more\')" class="snippet-more">more...</span>') . '</p>';
735
  }
736
  }
@@ -1008,10 +1043,20 @@ class WPMSEOMetabox extends WPMSEOMeta
1008
  //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
1009
  $post_id = (int)$_GET['post'];
1010
  $post = get_post($post_id);
 
 
 
 
 
1011
  } else {
1012
  $post = $GLOBALS['post'];
1013
  }
1014
 
 
 
 
 
 
1015
  return $post;
1016
  }
1017
 
@@ -1042,7 +1087,11 @@ class WPMSEOMetabox extends WPMSEOMeta
1042
  public function doTab($id, $content)
1043
  {
1044
  $contentTab = '';
1045
- global $post;
 
 
 
 
1046
 
1047
  $contentTab .= '<div class="' . esc_attr('wpmseotab ' . $id) . '" id="' . esc_attr($id) . '">
1048
  <div class="meta-box-top">
143
  return false;
144
  }
145
  $post_id = (isset($_POST['elementorPostID'])) ? $_POST['elementorPostID'] : '';
146
+
147
  if (!empty($post_id)) {
148
  $data = $_POST['datas'];
149
  $meta_prefix = '_metaseo_meta';
242
  'post.php',
243
  'edit.php',
244
  ), true)
245
+ //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, no need verification
246
+ && apply_filters('wpmseo_always_register_metaboxes_on_admin', false) === false) && !isset($_GET['et_fb'])
247
  ) {
248
  return;
249
  }
257
  )
258
  );
259
  }
260
+ //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, no need verification
261
+ if (!isset($_GET['et_fb'])) {
262
+ wp_enqueue_script(
263
+ 'wpms_ju_velocity_js',
264
+ plugins_url('assets/wordpress-css-framework/js/velocity.min.js', dirname(__FILE__)),
265
+ array(),
266
+ WPMSEO_VERSION
267
+ );
268
+ wp_enqueue_script(
269
+ 'wpms_ju_waves_js',
270
+ plugins_url('assets/wordpress-css-framework/js/waves.min.js', dirname(__FILE__)),
271
+ array(),
272
+ WPMSEO_VERSION
273
+ );
274
+ wp_enqueue_script(
275
+ 'wpms_ju_tabs_js',
276
+ plugins_url('assets/wordpress-css-framework/js/tabs.js', dirname(__FILE__)),
277
+ array(),
278
+ WPMSEO_VERSION
279
+ );
280
+ }
281
 
282
  wp_enqueue_style(
283
  'wpms_main',
285
  array(),
286
  WPMSEO_VERSION
287
  );
 
288
  wp_enqueue_style(
289
  'm-metabox-tabs',
290
  plugins_url('assets/css/metabox-tabs.css', WPMSEO_FILE),
318
  WPMSEO_VERSION,
319
  true
320
  );
321
+
322
  //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, no need verification
323
+ if (!isset($_GET['et_fb']) && !(isset($_GET['action']) && $_GET['action'] === 'elementor')) {
324
  wp_enqueue_script(
325
  'm-wp-seo-metabox',
326
  plugins_url('assets/js/wp-metaseo-metabox.js', WPMSEO_FILE),
348
  true
349
  );
350
  }
351
+
352
+ //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, no need verification
353
+ if (isset($_GET['et_fb'])) {//divi
354
+ wp_enqueue_script(
355
+ 'm-wp-seo-metabox',
356
+ WPMETASEO_PLUGIN_URL . 'inc/divi-seo/wp-metaseo-metabox.js',
357
+ array('jquery', 'jquery-ui-core'),
358
+ WPMSEO_VERSION,
359
+ true
360
+ );
361
+ }
362
+
363
  wp_enqueue_style(
364
  'm-bootstrap-tagsinput',
365
  plugins_url('assets/css/bootstrap/bootstrap.tagsinput.css', WPMSEO_FILE),
387
  wp_localize_script('wpms-elementor-media', 'wpmseoMediaL10n', $localize);
388
  wp_localize_script('metaseo-cliffpyles', 'wpmscliffpyles', $localize);
389
  wp_localize_script('wpms-cliffpyles-elementor', 'wpmscliffpyles', $localize);
390
+ wp_localize_script('wpseo-editor-divi', 'wpmscliffpyles', $localize);
391
+ wp_localize_script('wpseo-editor-divi', 'wpmseoMetaboxL10n', $this->localizeScript());
392
+ wp_localize_script('wpseo-editor-divi', 'wpmseoMediaL10n', $this->localizeScript());
393
  }
394
  }
395
 
401
  public function localizeSettingsScript()
402
  {
403
  global $post;
404
+ //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
405
+ if (isset($_GET['et_fb'])) {
406
+ $content_post = get_post($post->ID);
407
+ $post_content = $content_post->post_content;
408
+ $post_content = apply_filters('the_content', $post_content);
409
+ $post_content = str_replace(']]>', ']]&gt;', $post_content);
410
+ $post_title = $content_post->post_title;
411
+ } else {
412
  $post_content = $post->post_content;
413
+ $post_title = $post->post_title;
414
+ }
415
+
416
+ if (!empty($post)) {
417
  $post_type = $post->post_type;
418
  } else {
419
  $post_title = '';
473
  if (!$settings || !isset($settings['metaseo_metatitle_tab'])) {
474
  $settings['metaseo_metatitle_tab'] = 1;
475
  }
476
+
477
+ require_once(WPMETASEO_PLUGIN_DIR . 'inc/class.metaseo-opengraph.php');
478
+ $opengraph = new MetaSeoOpenGraph();
479
+ $pagetotal = $opengraph->pagetotal();
480
  $vars_to_cache = array(
481
  'date' => wpmsRetrieveDate($post),
482
+ 'pagetotal' => $pagetotal,
483
+ 'pagenumber' => '1',
484
  'id' => !(empty($post->ID)) ? $post->ID : null,
485
  'sitename' => trim(strip_tags(get_bloginfo('name'))),
486
  'sitedesc' => trim(strip_tags(get_bloginfo('description'))),
487
  'sep' => '-',
488
+ 'page' => sprintf(' ' . __('Page 1 of %1$d', 'wp-meta-seo'), $pagetotal),
489
  'currenttime' => date_i18n(get_option('time_format')),
490
  'currentdate' => date_i18n(get_option('date_format')),
491
  'currentday' => date_i18n('j'),
765
  foreach ($this->getMetaFieldDefs('general', $post->post_type) as $key => $meta_field) {
766
  $content .= $this->doMetaBox($meta_field, $key);
767
  if ($key === 'title') {
768
+ $snippet_more = '%date%, %id%, %sitename%, %sitedesc%, %pagetotal%, %pagenumber%, %page%, %currenttime%, %currentdate%, %currentday%, %currentmonth%, %currentyear%';
769
  $content .= '<p class="description" style="margin: 0 0 10px 32px;">' . sprintf(esc_html__('Title and description variables: %s', 'wp-meta-seo'), '%title%, <span onclick="jQuery(this).text(\'' . $snippet_more . '\').removeClass(\'snippet-more\')" class="snippet-more">more...</span>') . '</p>';
770
  }
771
  }
1043
  //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
1044
  $post_id = (int)$_GET['post'];
1045
  $post = get_post($post_id);
1046
+ //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
1047
+ } elseif (isset($_GET['page_id'])) {
1048
+ //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
1049
+ $post_id = (int)$_GET['page_id'];
1050
+ $post = get_post($post_id);
1051
  } else {
1052
  $post = $GLOBALS['post'];
1053
  }
1054
 
1055
+ if ($post !== null) {
1056
+ //phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- need additional data
1057
+ $GLOBALS['post'] = $post;
1058
+ }
1059
+
1060
  return $post;
1061
  }
1062
 
1087
  public function doTab($id, $content)
1088
  {
1089
  $contentTab = '';
1090
+ // global $post;
1091
+
1092
+ // if ($post === null) {
1093
+ $post = $this->getMetaboxPost();
1094
+ // }
1095
 
1096
  $contentTab .= '<div class="' . esc_attr('wpmseotab ' . $id) . '" id="' . esc_attr($id) . '">
1097
  <div class="meta-box-top">
inc/class.metaseo-opengraph.php CHANGED
@@ -59,10 +59,9 @@ class MetaSeoOpenGraph
59
 
60
  $max = $this->determinePagenumbering('max');
61
  $nr = $this->determinePagenumbering('nr');
62
- $sep = '-';
63
 
64
- if ($max > 1 && $nr > 1) {
65
- $replacement = sprintf($sep . ' ' . __('Page %1$d of %2$d', 'wp-meta-seo'), $nr, $max);
66
  }
67
 
68
  return $replacement;
@@ -85,10 +84,13 @@ class MetaSeoOpenGraph
85
 
86
  if (!is_singular()) {
87
  $page_number = get_query_var('paged');
 
88
  if ($page_number === 0 || $page_number === '') {
89
  $page_number = 1;
90
  }
91
-
 
 
92
  if (isset($wp_query->max_num_pages) && ($wp_query->max_num_pages !== '' && (int) $wp_query->max_num_pages !== 0)) {
93
  $max_num_pages = $wp_query->max_num_pages;
94
  }
@@ -117,19 +119,56 @@ class MetaSeoOpenGraph
117
  return $return;
118
  }
119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  /**
121
  * Replace Snippet
122
  *
123
  * @param string $string String
124
  * @param object $post Current post
 
125
  *
126
  * @return mixed
127
  */
128
- public function replaceSnippet($string, $post)
129
  {
130
  $vars_to_cache = array(
131
- 'title' => !(empty($post->post_title)) ? $post->post_title : null,
132
  'date' => wpmsRetrieveDate($post),
 
 
133
  'id' => !(empty($post->ID)) ? $post->ID : null,
134
  'sitename' => trim(strip_tags(get_bloginfo('name'))),
135
  'sitedesc' => trim(strip_tags(get_bloginfo('description'))),
@@ -203,6 +242,7 @@ class MetaSeoOpenGraph
203
  {
204
  global $post;
205
  $meta_desc_esc = get_post_meta($id, '_metaseo_metadesc', true);
 
206
  if ($meta_desc_esc !== maybe_unserialize($meta_desc_esc)) {
207
  $meta_desc_esc = '';
208
  }
@@ -223,6 +263,7 @@ class MetaSeoOpenGraph
223
  $meta_desc_esc = '';
224
  }
225
  }
 
226
  return esc_attr($this->replaceSnippet($meta_desc_esc, $post));
227
  }
228
 
@@ -472,6 +513,7 @@ class MetaSeoOpenGraph
472
  } elseif ($mshow_on_front === 'page') { // is page posts
473
  $title = get_post_meta($mpage_for_posts, '_metaseo_metatitle', true);
474
  $desc = get_post_meta($mpage_for_posts, '_metaseo_metadesc', true);
 
475
  $page_follow = get_post_meta($mpage_for_posts, '_metaseo_metafollow', true);
476
  $page_index = get_post_meta($mpage_for_posts, '_metaseo_metaindex', true);
477
  }
@@ -576,6 +618,8 @@ class MetaSeoOpenGraph
576
  $desc = '';
577
  }
578
 
 
 
579
  return array(
580
  'title' => esc_attr($title),
581
  'desc' => esc_attr($desc),
59
 
60
  $max = $this->determinePagenumbering('max');
61
  $nr = $this->determinePagenumbering('nr');
 
62
 
63
+ if ($max > 1 && $nr >= 1) {
64
+ $replacement = sprintf(' ' . __('Page %1$d of %2$d', 'wp-meta-seo'), $nr, $max);
65
  }
66
 
67
  return $replacement;
84
 
85
  if (!is_singular()) {
86
  $page_number = get_query_var('paged');
87
+
88
  if ($page_number === 0 || $page_number === '') {
89
  $page_number = 1;
90
  }
91
+ if (isset($post->post_content)) {
92
+ $max_num_pages = (substr_count($post->post_content, '<!--nextpage-->') + 1);
93
+ }
94
  if (isset($wp_query->max_num_pages) && ($wp_query->max_num_pages !== '' && (int) $wp_query->max_num_pages !== 0)) {
95
  $max_num_pages = $wp_query->max_num_pages;
96
  }
119
  return $return;
120
  }
121
 
122
+ /**
123
+ * Retrieve the current page number for use as replacement string.
124
+ *
125
+ * @return string|null
126
+ */
127
+ public function pagetotal()
128
+ {
129
+ $replacement = null;
130
+
131
+ $max = $this->determinePagenumbering('max');
132
+ if (isset($max) && $max > 0) {
133
+ $replacement = (string)$max;
134
+ }
135
+
136
+ return $replacement;
137
+ }
138
+
139
+ /**
140
+ * Retrieve the current page number for use as replacement string.
141
+ *
142
+ * @return string|null
143
+ */
144
+ public function retrievePagenumber()
145
+ {
146
+ $replacement = null;
147
+
148
+ $nr = $this->determinePagenumbering('nr');
149
+ if (isset($nr) && $nr > 0) {
150
+ $replacement = (string)$nr;
151
+ }
152
+
153
+ return $replacement;
154
+ }
155
+
156
  /**
157
  * Replace Snippet
158
  *
159
  * @param string $string String
160
  * @param object $post Current post
161
+ * @param object $term Current term
162
  *
163
  * @return mixed
164
  */
165
+ public function replaceSnippet($string, $post, $term = null)
166
  {
167
  $vars_to_cache = array(
168
+ 'title' => $post === null ? (!(empty($term->name)) ? $term->name : null) : (!(empty($post->post_title)) ? $post->post_title : null),
169
  'date' => wpmsRetrieveDate($post),
170
+ 'pagetotal' => $this->pagetotal(),
171
+ 'pagenumber' => $this->retrievePagenumber(),
172
  'id' => !(empty($post->ID)) ? $post->ID : null,
173
  'sitename' => trim(strip_tags(get_bloginfo('name'))),
174
  'sitedesc' => trim(strip_tags(get_bloginfo('description'))),
242
  {
243
  global $post;
244
  $meta_desc_esc = get_post_meta($id, '_metaseo_metadesc', true);
245
+
246
  if ($meta_desc_esc !== maybe_unserialize($meta_desc_esc)) {
247
  $meta_desc_esc = '';
248
  }
263
  $meta_desc_esc = '';
264
  }
265
  }
266
+
267
  return esc_attr($this->replaceSnippet($meta_desc_esc, $post));
268
  }
269
 
513
  } elseif ($mshow_on_front === 'page') { // is page posts
514
  $title = get_post_meta($mpage_for_posts, '_metaseo_metatitle', true);
515
  $desc = get_post_meta($mpage_for_posts, '_metaseo_metadesc', true);
516
+
517
  $page_follow = get_post_meta($mpage_for_posts, '_metaseo_metafollow', true);
518
  $page_index = get_post_meta($mpage_for_posts, '_metaseo_metaindex', true);
519
  }
618
  $desc = '';
619
  }
620
 
621
+ $title = $this->getMetaTitle($settings, $title);
622
+
623
  return array(
624
  'title' => esc_attr($title),
625
  'desc' => esc_attr($desc),
inc/divi-seo/cliffpyles.js ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function ($) {
2
+ console.log($(window.document).find('#wpseo-settings-bar-root'));
3
+ if ($(window.document).find('#et-fb-app-frame').length < 1) {
4
+ $parent_window = $(window.document);
5
+ console.log($parent_window, $(window.document).find('#et-fb-app-frame'));
6
+ var mcheck = 0;
7
+ if (typeof wpmscliffpyles.use_validate !== "undefined" && parseInt(wpmscliffpyles.use_validate) === 1) {
8
+ wpms_validate_analysis();
9
+ }
10
+
11
+ function reload_analysis(first_load) {
12
+ var mpageurl = '', title = '', mcontent = '', current_editor = '';
13
+ var meta_title = $parent_window.find('#metaseo_wpmseo_title').val();
14
+ var meta_desc = $parent_window.find('#metaseo_wpmseo_desc').val();
15
+ var seo_keywords = $parent_window.find("input#metaseo_wpmseo_specific_keywords").val();
16
+ mpageurl = location.protocol + $parent_window.find('#wpmseosnippet').find('a').text();
17
+
18
+ if (typeof wp.blocks !== "undefined") {
19
+ if (typeof mpageurl === 'undefined') {
20
+ mpageurl = $parent_window.find('#wp-admin-bar-view').find('a').attr('href');
21
+ }
22
+ current_editor = 'gutenberg';
23
+ if (parseInt(first_load) === 1) {
24
+ title = wpmscliffpyles.post_title;
25
+ mcontent = wpmscliffpyles.post_content;
26
+ } else {
27
+ // Core editor
28
+ if (typeof wp.data !== "undefined" && typeof wp.data.select('core/editor') !== "undefined" && wp.data.select('core/editor') !== null) {
29
+ title = $parent_window.find('.editor-post-title__input').text();
30
+ mcontent = wp.data.select('core/editor').getEditedPostContent();
31
+ } else if (typeof tinyMCE !== 'undefined') {
32
+ // WooCommerce product
33
+ title = $parent_window.find('#title').val();
34
+ if (tinyMCE.get('content') !== null) {
35
+ mcontent = tinyMCE.editors.content.getContent();
36
+ if (mcontent === '') mcontent = $parent_window.find('#content').val();
37
+ } else {
38
+ mcontent = $parent_window.find('#content').val();
39
+ }
40
+ }
41
+ }
42
+ } else {
43
+ // undefined wp.blocks
44
+ if (typeof wpmscliffpyles.post_type !== 'undefined' && wpmscliffpyles.post_type === 'attachment') {
45
+ // On media attachment page
46
+ if (typeof mpageurl === 'undefined') {
47
+ mpageurl = $parent_window.find('#sample-permalink').text().trim();
48
+ }
49
+
50
+ if (parseInt(first_load) === 1) {
51
+ title = wpmscliffpyles.post_title;
52
+ mcontent = wpmscliffpyles.post_content;
53
+ } else if (typeof wp.data !== "undefined") {
54
+ title = $parent_window.find('#title').val();
55
+ mcontent = $parent_window.find('#attachment_content').val();
56
+ }
57
+ } else {
58
+ // Something went wrong, use default
59
+ if (typeof mpageurl === 'undefined') {
60
+ mpageurl = $parent_window.find('#editable-post-name-full').text();
61
+ }
62
+ title = $parent_window.find('#title').val();
63
+ if (typeof tinyMCE !== 'undefined' && tinyMCE.get('content') !== null) {
64
+ mcontent = tinyMCE.editors.content.getContent();
65
+ if (mcontent === '') mcontent = $parent_window.find('#content').val();
66
+ } else {
67
+ mcontent = $parent_window.find('#content').val();
68
+ }
69
+ }
70
+ }
71
+
72
+ // In bad case, set empty value to avoid errors
73
+ if (typeof mcontent === 'undefined') mcontent = '';
74
+ if (typeof title === 'undefined') title = '';
75
+ if (typeof mpageurl === 'undefined') mpageurl = '';
76
+
77
+ $parent_window.find('.wpmseotab .spinner').css({'visibility': ' inherit'}).show();
78
+ $parent_window.find('.metaseo_right .panel-left, .metaseo_right .panel-right').html('');
79
+ console.log(current_editor, meta_title, meta_desc, '123', seo_keywords, mpageurl, '123', mcontent, title);
80
+ $.ajax({
81
+ dataType: 'json',
82
+ method: 'POST',
83
+ url: ajaxurl,
84
+ data: {
85
+ 'action': 'wpms',
86
+ 'task': 'reload_analysis',
87
+ 'datas': {
88
+ 'editor': current_editor,
89
+ 'first_load': first_load,
90
+ 'post_id': jQuery('.metaseo-progress-bar').data('post_id'),
91
+ 'title': title,
92
+ 'meta_title': meta_title,
93
+ 'mpageurl': mpageurl,
94
+ 'meta_desc': meta_desc,
95
+ 'content': mcontent,
96
+ 'seo_keywords': seo_keywords
97
+ },
98
+ 'wpms_nonce': wpms_localize.wpms_nonce
99
+ },
100
+ success: function (res) {
101
+ console.log(res)
102
+ if (res) {
103
+ $parent_window.find('.wpmseotab .spinner').hide();
104
+ $parent_window.find('.metaseo_right .panel-left').html(res.output);
105
+ $parent_window.find('.metaseo_right .panel-right').html(res.right_output);
106
+ mcheck = parseInt(res.check);
107
+ tippy('.metaseo_tool', {
108
+ animation: 'scale',
109
+ duration: 0,
110
+ arrow: false,
111
+ placement: 'top',
112
+ theme: 'metaseo-tippy tippy-rounded',
113
+ onShow(instance) {
114
+ instance.popper.hidden = instance.reference.dataset.tippy ? false : true;
115
+ instance.setContent(instance.reference.dataset.tippy);
116
+ }
117
+ });
118
+
119
+ drawInactive(res.circliful);
120
+
121
+ }
122
+ }
123
+ });
124
+ }
125
+
126
+ // init load analysis
127
+ reload_analysis(1);
128
+
129
+ // reload analysis
130
+ console.log($parent_window.find('#reload_analysis'));
131
+ $parent_window.find('#reload_analysis').on('click', function () {
132
+ reload_analysis(0);
133
+ });
134
+
135
+ function drawInactive(circliful) {
136
+ $parent_window.find('.metaseo-progress-bar').circleProgress({
137
+ value: circliful / 100,
138
+ size: 250,
139
+ thickness: 8,
140
+ fill: {
141
+ gradient: ["#34e0ff", "#5dadff"]
142
+ }
143
+ }).on('circle-animation-progress', function (event, progress) {
144
+ $(this).find('strong').html(Math.round(circliful) + '<i>%</i>');
145
+ });
146
+ }
147
+
148
+ function wpms_validate_analysis() {
149
+ jQuery(document).on('click', '.metaseo-dashicons.icons-mboxwarning', function () {
150
+ var seo_keywords = $parent_window.find("input#metaseo_wpmseo_specific_keywords").val();
151
+ var $this = $(this);
152
+ $this.html('done').removeClass('icons-mboxwarning').addClass('icons-mboxdone');
153
+ if (mcheck === 0) {
154
+ mcheck = jQuery('#metaseo_alanysis_ok').val();
155
+ mcheck++;
156
+ } else {
157
+ mcheck++;
158
+ }
159
+
160
+ var total = 7;
161
+ if (seo_keywords !== '') {
162
+ total++;
163
+ }
164
+
165
+ var circliful = Math.ceil((mcheck * 100) / total);
166
+ jQuery.ajax({
167
+ dataType: 'json',
168
+ method: 'POST',
169
+ url: ajaxurl,
170
+ data: {
171
+ 'action': 'wpms',
172
+ 'task': 'validate_analysis',
173
+ 'post_id': jQuery('.metaseo-progress-bar').data('post_id'),
174
+ 'field': $this.parent('.metaseo_analysis').data('title'),
175
+ 'wpms_nonce': wpms_localize.wpms_nonce
176
+ },
177
+ success: function (res) {
178
+ console.log(res);
179
+ if (res !== false) {
180
+ drawInactive(circliful);
181
+ }
182
+ }
183
+ });
184
+
185
+ });
186
+ }
187
+ }
188
+ });
inc/divi-seo/divi.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined('ABSPATH') || exit;
3
+ /**
4
+ * Class Divi
5
+ * Class that holds most of the divi functionality for Meta SEO.
6
+ */
7
+ class Divi
8
+ {
9
+ /**
10
+ * Class constructor.
11
+ */
12
+ public function __construct()
13
+ {
14
+ add_action('wp', array($this, 'init'), 10, 1);
15
+ }
16
+
17
+ /**
18
+ * Class Divi constructor.
19
+ *
20
+ * @return void
21
+ */
22
+ public function init()
23
+ {
24
+ add_action('template_redirect', array($this, 'set_window_lodash'), 0, 1);
25
+ add_action('wp_footer', array($this, 'footer_enqueue_scripts'), 11, 99);
26
+ }
27
+
28
+ /**
29
+ * Enqueue scripts.
30
+ *
31
+ * @return void
32
+ */
33
+ public function footer_enqueue_scripts()
34
+ {
35
+ /**
36
+ * Allow other plugins to enqueue/dequeue admin styles or scripts before plugin assets.
37
+ */
38
+
39
+ wp_enqueue_style('wp-components');
40
+ wp_enqueue_script('wpseo-editor-divi', WPMETASEO_PLUGIN_URL . 'inc/divi-seo/wpseo-divi.js', array(
41
+ 'wp-api-fetch',
42
+ 'wp-block-editor',
43
+ 'wp-components',
44
+ 'wp-compose',
45
+ 'wp-core-data',
46
+ 'wp-data',
47
+ 'wp-element',
48
+ 'wp-hooks',
49
+ 'wp-media-utils'
50
+ ), WPMSEO_VERSION, true);
51
+
52
+ $this->print_react_containers();
53
+
54
+ \do_action_ref_array('meta_seo/admin/editor_scripts', array());
55
+ }
56
+
57
+ /**
58
+ * Print React containers onto the screen.
59
+ *
60
+ * @return void
61
+ */
62
+ public function print_react_containers()
63
+ {
64
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required, render html and load js when open tab
65
+ if (isset($_GET['et_fb']) && is_user_logged_in()) {
66
+ require_once(WPMETASEO_PLUGIN_DIR . 'inc/class.metaseo-metabox.php');
67
+ $wpmseometabox = new WPMSEOMetabox;
68
+ $wpmseometabox::translateMetaBoxes();
69
+ $popup_divi = $wpmseometabox->wpmsMetaboxContent();
70
+
71
+ wp_enqueue_style(
72
+ 'wpms-snackbar-style',
73
+ WPMETASEO_PLUGIN_URL . 'assets/css/snackbar.css',
74
+ array(),
75
+ WPMSEO_VERSION
76
+ );
77
+ wp_enqueue_style(
78
+ 'wpms-mytippy-style',
79
+ WPMETASEO_PLUGIN_URL . 'assets/tippy/my-tippy.css',
80
+ array(),
81
+ WPMSEO_VERSION
82
+ );
83
+ wp_enqueue_style(
84
+ 'metaseo-google-icon',
85
+ '//fonts.googleapis.com/icon?family=Material+Icons'
86
+ );
87
+ wp_enqueue_style(
88
+ 'wpmsStyleOnElementor',
89
+ WPMETASEO_PLUGIN_URL . 'assets/css/elementor/wpms-elementor.css',
90
+ array(),
91
+ WPMSEO_VERSION
92
+ );
93
+ wp_enqueue_style(
94
+ 'wpmsStyleOnDivi',
95
+ WPMETASEO_PLUGIN_URL . 'assets/css/divi/style.css',
96
+ array(),
97
+ WPMSEO_VERSION
98
+ );
99
+ wp_enqueue_script('jquery');
100
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- html tag
101
+ echo '<div id="seo_et_ignore_iframe" class=" hidden">' . $popup_divi . '</div>';
102
+ echo '<div id="wpseo-settings-bar-root" class="et_fb_ignore_iframe"></div>';
103
+ }
104
+ }
105
+
106
+ /**
107
+ * Set the global lodash variable.
108
+ *
109
+ * Lodash's `noConflict` would prevent UnderscoreJS from taking over the underscore (_)
110
+ * global variable. Because Underscore.js will later also be assigned to the underscore (_)
111
+ * global this function should run as early as possible.
112
+ *
113
+ * @return void
114
+ */
115
+ public function set_window_lodash()
116
+ {
117
+ $MetaSeoAdmin = new MetaSeoAdmin;
118
+ $MetaSeoAdmin->loadAdminScripts();
119
+
120
+ wp_register_script('wpmseo-set-window-lodash', '', array('lodash'), WPMSEO_VERSION, false);
121
+ wp_enqueue_script('wpmseo-set-window-lodash');
122
+ wp_add_inline_script('wpmseo-set-window-lodash', join("\r\n ", array(
123
+ 'var ajaxurl = ' . wp_json_encode(admin_url('admin-ajax.php', 'relative')) . ';',
124
+ 'window.isLodash = function() {',
125
+ "if ( typeof window._ !== 'function' || typeof window._.forEach !== 'function' ) {",
126
+ 'return false;',
127
+ '}',
128
+ 'var isLodash = true;',
129
+ 'window._.forEach(',
130
+ "[ 'cloneDeep', 'at', 'add', 'ary', 'attempt' ],",
131
+ 'function( fn ) {',
132
+ "if ( isLodash && typeof window._[ fn ] !== 'function' ) {",
133
+ 'isLodash = false;',
134
+ '}',
135
+ '}',
136
+ ');',
137
+ 'return isLodash;',
138
+ '}',
139
+ 'if ( window.isLodash() ) { window.lodash = window._.noConflict(); }'
140
+ )));
141
+ }
142
+ }
inc/divi-seo/wp-metaseo-metabox.js ADDED
@@ -0,0 +1,691 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery.noConflict();
2
+ var $parent_window;
3
+ jQuery(function ($) {
4
+ $('.metabox-snippet-title .container-snippet .input').on('input', function () {
5
+ $('.metabox-snippet-title .container-snippet .text').text($(this).val());
6
+ }).trigger('input');
7
+
8
+ var input = document.getElementById('metaseo_wpmseo_desc');
9
+ input.addEventListener('input', resizeInput);
10
+ resizeInput.call(input);
11
+
12
+ function resizeInput() {
13
+ this.style.width = this.value.length + "ch";
14
+ }
15
+ });
16
+
17
+ function msClean(str) {
18
+ if (str === '' || typeof (str) === 'undefined') {
19
+ return '';
20
+ }
21
+
22
+ try {
23
+ str = str.replace(/<\/?[^>]+>/gi, '');
24
+ str = str.replace(/\[(.+?)](.+?\[\/\\1])?/g, '');
25
+ str = jQuery('<div/>').html(str).text();
26
+ } catch (e) {
27
+ }
28
+
29
+ return str;
30
+ }
31
+
32
+ function msReplaceVariables(str, callback) {
33
+ if (typeof str === 'undefined') {
34
+ return;
35
+ }
36
+
37
+ if (typeof ETBuilderBackendDynamic !== "undefined" && ETBuilderBackendDynamic.postTitle !== '') {
38
+ str = str.replace(/%title%/g, ETBuilderBackendDynamic.postTitle.replace(/(<([^>]+)>)/ig, ''));
39
+ } else if (jQuery(wpmsdivtitle).length) {
40
+ str = str.replace(/%title%/g, jQuery(wpmsdivtitle).text().replace(/(<([^>]+)>)/ig, ''));
41
+ }
42
+
43
+ // These are added in the head for performance reasons.
44
+ str = str.replace(/%id%/g, wpmseoMetaboxL10n.id);
45
+ str = str.replace(/%date%/g, wpmseoMetaboxL10n.date);
46
+ str = str.replace(/%sitedesc%/g, wpmseoMetaboxL10n.sitedesc);
47
+ str = str.replace(/%sitename%/g, wpmseoMetaboxL10n.sitename);
48
+ str = str.replace(/%sep%/g, wpmseoMetaboxL10n.sep);
49
+ str = str.replace(/%page%/g, wpmseoMetaboxL10n.page);
50
+ str = str.replace(/%currenttime%/g, wpmseoMetaboxL10n.currenttime);
51
+ str = str.replace(/%currentdate%/g, wpmseoMetaboxL10n.currentdate);
52
+ str = str.replace(/%currentday%/g, wpmseoMetaboxL10n.currentday);
53
+ str = str.replace(/%currentmonth%/g, wpmseoMetaboxL10n.currentmonth);
54
+ str = str.replace(/%currentyear%/g, wpmseoMetaboxL10n.currentyear);
55
+
56
+ // excerpt
57
+ var excerpt = '';
58
+ if (jQuery('#excerpt').length) {
59
+ excerpt = msClean(jQuery('#excerpt').val().replace(/(<([^>]+)>)/ig, ''));
60
+ str = str.replace(/%excerpt_only%/g, excerpt);
61
+ }
62
+ if ('' === excerpt && jQuery('#content').length) {
63
+ excerpt = jQuery('#content').val().replace(/(<([^>]+)>)/ig, '').substring(0, wpmseoMetaboxL10n.wpmseo_meta_desc_length - 1);
64
+ }
65
+ str = str.replace(/%excerpt%/g, excerpt);
66
+
67
+ // parent page
68
+ if (jQuery('#parent_id').length && jQuery('#parent_id option:selected').text() !== wpmseoMetaboxL10n.no_parent_text) {
69
+ str = str.replace(/%parent_title%/g, jQuery('#parent_id option:selected').text());
70
+ }
71
+
72
+ // remove double separators
73
+ var esc_sep = msEscapeFocusKw(wpmseoMetaboxL10n.sep);
74
+ var pattern = new RegExp(esc_sep + ' ' + esc_sep, 'g');
75
+ str = str.replace(pattern, wpmseoMetaboxL10n.sep);
76
+
77
+ if (str.indexOf('%') !== -1 && str.match(/%[a-z0-9_-]+%/i) !== null) {
78
+ var regex = /%[a-z0-9_-]+%/gi;
79
+ var matches = str.match(regex);
80
+ for (var i = 0; i < matches.length; i++) {
81
+ if (typeof (replacedVars[ matches[ i ] ]) === 'undefined') {
82
+ // str = str.replace(matches[ i ], replacedVars[ matches[ i ] ]);
83
+ } else {
84
+ var replaceableVar = matches[ i ];
85
+
86
+ // create the cache already, so we don't do the request twice.
87
+ replacedVars[ replaceableVar ] = '';
88
+ msAjaxReplaceVariables(replaceableVar, callback);
89
+ }
90
+ }
91
+ }
92
+ callback(str);
93
+ }
94
+
95
+ function msAjaxReplaceVariables(replaceableVar, callback) {
96
+ jQuery.post(ajaxurl, {
97
+ action: 'wpmseo_replace_vars',
98
+ string: replaceableVar,
99
+ post_id: jQuery('#post_ID').val(),
100
+ _wpnonce: wpmseoMetaboxL10n.wpmseo_replace_vars_nonce
101
+ }, function (data) {
102
+ if (data) {
103
+ replacedVars[ replaceableVar ] = data;
104
+ }
105
+
106
+ msReplaceVariables(replaceableVar, callback);
107
+ });
108
+ }
109
+
110
+ /*
111
+ * Change meta title in meta box
112
+ */
113
+ function msUpdateTitle(force) {
114
+ var title = '';
115
+ var titleElm = $parent_window.find('#' + wpmseoMetaboxL10n.field_prefix + 'title');
116
+ if (!titleElm.length) {
117
+ return;
118
+ }
119
+ var titleLengthError = $parent_window.find('#' + wpmseoMetaboxL10n.field_prefix + 'title-length-warning');
120
+ var divHtml = jQuery('<div />');
121
+
122
+ if (titleElm.val()) {
123
+ title = titleElm.val().replace(/(<([^>]+)>)/ig, '');
124
+ } else if (wpmseoMetaboxL10n.metatitle_tab === '1') {
125
+ title = divHtml.html(title).text();
126
+ }
127
+
128
+ if (title === '') {
129
+ var len = wpmseoMetaboxL10n.wpmseo_meta_title_length - $parent_window.find('#metaseo_snippet_title').val().length;
130
+ metaseo_status_length(len, '#' + wpmseoMetaboxL10n.field_prefix + 'title-length');
131
+
132
+ titleLengthError.hide();
133
+ //return;
134
+ }
135
+
136
+ title = msClean(title);
137
+ title = divHtml.text(title).html();
138
+
139
+ if (force) {
140
+ titleElm.val(title);
141
+ }
142
+
143
+ msReplaceVariables(title, function (title) {
144
+
145
+ title = msSanitizeTitle(title);
146
+ // do the placeholder
147
+ var placeholder_title = divHtml.html(title).text();
148
+ $parent_window.find('#metaseo_snippet_title').val(placeholder_title);
149
+ var len = wpmseoMetaboxL10n.wpmseo_meta_title_length - $parent_window.find('#metaseo_snippet_title').val().length;
150
+ metaseo_status_length(len, '#' + wpmseoMetaboxL10n.field_prefix + 'title-length');
151
+ });
152
+ }
153
+
154
+ /*
155
+ * Change meta keywords in meta box
156
+ */
157
+ function msUpdateKeywords() {
158
+ var keywordsElm = $parent_window.find('#' + wpmseoMetaboxL10n.field_prefix + 'keywords');
159
+ if (keywordsElm.val() !== '') {
160
+ var len = wpmseoMetaboxL10n.wpmseo_meta_keywords_length - keywordsElm.val().length;
161
+ metaseo_status_length(len, '#' + wpmseoMetaboxL10n.field_prefix + 'keywords-length');
162
+ $parent_window.find('#' + wpmseoMetaboxL10n.field_prefix + 'keywords-length').html(len);
163
+ } else {
164
+ $parent_window.find('#' + wpmseoMetaboxL10n.field_prefix + 'keywords-length').addClass('length-true').removeClass('length-wrong').html('<span class="good">' + wpmseoMetaboxL10n.wpmseo_meta_keywords_length + '</span>');
165
+ }
166
+ }
167
+
168
+ /*
169
+ * Clean title
170
+ */
171
+ function msSanitizeTitle(title) {
172
+ title = msClean(title);
173
+ return title;
174
+ }
175
+
176
+ /*
177
+ * Change meta description in meta box
178
+ */
179
+ function msUpdateDesc() {
180
+ var desc = (msClean($parent_window.find('#' + wpmseoMetaboxL10n.field_prefix + 'desc').val())).trim();
181
+ var divHtml = jQuery('<div />');
182
+ var snippet = $parent_window.find('#wpmseosnippet');
183
+
184
+ if (desc === '' && wpmseoMetaboxL10n.wpmseo_desc_template !== '') {
185
+ desc = wpmseoMetaboxL10n.wpmseo_desc_template;
186
+ }
187
+
188
+ if (desc !== '') {
189
+ msReplaceVariables(desc, function (desc) {
190
+ desc = divHtml.text(desc).html();
191
+ desc = msClean(desc);
192
+
193
+ var len = wpmseoMetaboxL10n.wpmseo_meta_desc_length - desc.length;
194
+ metaseo_status_length(len, '#' + wpmseoMetaboxL10n.field_prefix + 'desc-length');
195
+ desc = msSanitizeDesc(desc);
196
+
197
+ // Clear the autogen description.
198
+ snippet.find('.desc span.autogen').html('');
199
+ // Set our new one.
200
+ });
201
+ } else {
202
+ var len = wpmseoMetaboxL10n.wpmseo_meta_desc_length;
203
+ metaseo_status_length(len, '#' + wpmseoMetaboxL10n.field_prefix + 'desc-length');
204
+ }
205
+ }
206
+
207
+ /*
208
+ * Sanitize description
209
+ */
210
+ function msSanitizeDesc(desc) {
211
+ desc = msTrimDesc(desc);
212
+ return desc;
213
+ }
214
+
215
+ function msTrimDesc(desc) {
216
+ if (desc.length > wpmseoMetaboxL10n.wpmseo_meta_desc_length) {
217
+ var space;
218
+ if (desc.length > wpmseoMetaboxL10n.wpmseo_meta_desc_length) {
219
+ space = desc.lastIndexOf(' ', (wpmseoMetaboxL10n.wpmseo_meta_desc_length - 3));
220
+ } else {
221
+ space = wpmseoMetaboxL10n.wpmseo_meta_desc_length;
222
+ }
223
+ desc = desc.substring(0, space).concat(' ...');
224
+ }
225
+ return desc;
226
+ }
227
+
228
+ /*
229
+ * Update Url
230
+ */
231
+ function msUpdateURL() {
232
+ var url;
233
+ if ($parent_window.find('#editable-post-name-full').length) {
234
+ var name = $parent_window.find('#editable-post-name-full').text();
235
+ url = wpmseoMetaboxL10n.wpmseo_permalink_template.replace('%postname%', name).replace('http://', '');
236
+ }
237
+
238
+ $parent_window.find('#wpmseosnippet').find('.url').html(url);
239
+ }
240
+
241
+ function msUpdateSnippet() {
242
+ if (typeof wpmseoMetaboxL10n.show_keywords !== "undefined" && parseInt(wpmseoMetaboxL10n.show_keywords) === 1) {
243
+ msUpdateKeywords();
244
+ }
245
+ msUpdateURL();
246
+ msUpdateTitle();
247
+ msUpdateDesc();
248
+ }
249
+
250
+ function msEscapeFocusKw(str) {
251
+ return str.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
252
+ }
253
+
254
+ function metaseo_status_length(len, id, number) {
255
+ console.log(len, id);
256
+ var num = 46;
257
+ var check = 0;
258
+ var mclass = '';
259
+ if (id === '#metaseo_wpmseo_title-length') {
260
+ num = 50;
261
+ check = wpmseoMetaboxL10n.wpmseo_meta_title_length - len;
262
+ mclass = 'word-74B6FC';
263
+ } else if (id === '#metaseo_wpmseo_desc-length') {
264
+ num = 120;
265
+ check = wpmseoMetaboxL10n.wpmseo_meta_desc_length - len;
266
+ mclass = 'word-74B6FC';
267
+ } else if (id === '#metaseo_wpmseo_keywords-length') {
268
+ num = 120;
269
+ check = len;
270
+ }
271
+
272
+ if (len < 0) {
273
+ $parent_window.find(id).addClass('length-wrong').removeClass('length-true length-warn ' + mclass);
274
+ len = '<span class="wrong">' + len + '</span>';
275
+ } else if (check >= 0 && check <= num) {
276
+ $parent_window.find(id).addClass('length-warn ' + mclass).removeClass('length-true length-wrong');
277
+ len = '<span class="length-warn '+mclass+'">' + len + '</span>';
278
+ } else {
279
+ $parent_window.find(id).addClass('length-true').removeClass('length-wrong length-warn ' + mclass);
280
+ len = '<span class="good">' + len + '</span>';
281
+ }
282
+ console.log($parent_window, $parent_window.find(id).length);
283
+ $parent_window.find(id).html(len);
284
+ }
285
+
286
+ (function () {
287
+ var timer = 0;
288
+ return function (callback, ms) {
289
+ clearTimeout(timer);
290
+ timer = setTimeout(callback, ms);
291
+ };
292
+ })();
293
+
294
+ var replacedVars = []; // jshint ignore:line
295
+ var wpmsdivtitle = '';
296
+ jQuery(document).ready(function ($) {
297
+ function wpms_load_js() {
298
+ // title
299
+ if (typeof wp.blocks !== "undefined" && wp.data.select('core/editor') !== null) {
300
+ wpmsdivtitle = '.editor-post-title__input';
301
+ } else {
302
+ wpmsdivtitle = '#title';
303
+ }
304
+
305
+ $parent_window.find('.wpmseo-heading').hide();
306
+
307
+ $.fn.focusTextToEnd = function(){
308
+ this.focus();
309
+ var $thisVal = this.val();
310
+ this.val('').val($thisVal);
311
+ return this;
312
+ }
313
+
314
+ $parent_window.find('.snippet-preview').on('click', function(e){
315
+ e.preventDefault();
316
+ });
317
+
318
+ $parent_window.find('#metaseo_snippet_title').on('focus', function () {
319
+ $(this).hide();
320
+ $parent_window.find('#' + wpmseoMetaboxL10n.field_prefix + 'title').removeAttr('type').focusTextToEnd();
321
+ });
322
+
323
+ $parent_window.find('#' + wpmseoMetaboxL10n.field_prefix + 'title').on('focusout', function () {
324
+ $(this).attr('type', 'hidden');
325
+ $parent_window.find('#metaseo_snippet_title').show();
326
+ })
327
+
328
+ $parent_window.find('#' + wpmseoMetaboxL10n.field_prefix + 'title').keyup(function () {
329
+ msUpdateTitle();
330
+ });
331
+
332
+ $parent_window.find('#' + wpmseoMetaboxL10n.field_prefix + 'keywords').keyup(function () {
333
+ msUpdateKeywords();
334
+ });
335
+
336
+ $parent_window.find('body').on('keyup', wpmsdivtitle, function(event) {
337
+ if ($parent_window.find('#metaseo_wpmseo_title').data('firstcreatepost')) {
338
+ if (typeof wp.blocks !== "undefined" && wp.data.select('core/editor') !== null) {
339
+ $parent_window.find('#metaseo_wpmseo_title').val($parent_window.find(wpmsdivtitle).text().replace(/(<([^>]+)>)/ig, ''));
340
+ } else {
341
+ $parent_window.find('#metaseo_wpmseo_title').val($parent_window.find(wpmsdivtitle).val().replace(/(<([^>]+)>)/ig, ''));
342
+ }
343
+ }
344
+ msUpdateTitle();
345
+ msUpdateDesc();
346
+ });
347
+
348
+ $parent_window.find('#parent_id').change(function () {
349
+ msUpdateTitle();
350
+ msUpdateDesc();
351
+ });
352
+
353
+ // DON'T 'optimize' this to use descElm! descElm might not be defined and will cause js errors (Soliloquy issue)
354
+ $parent_window.find('#' + wpmseoMetaboxL10n.field_prefix + 'desc').keyup(function () {
355
+ msUpdateDesc();
356
+ });
357
+
358
+ $parent_window.find('.gsc_keywords_time_filter select').change(function () {
359
+ wpms_filter_search_keywords();
360
+ });
361
+
362
+ // Call ajax to search keywords
363
+ function wpms_filter_search_keywords() {
364
+ var time = $parent_window.find('select[name="gsc_keywords_time_filter_select"] option:selected').val();
365
+ var keycsl = '';
366
+ if (typeof $parent_window.find('input.wpms-search-key-csl').val() !== 'undefined') {
367
+ keycsl = $parent_window.find('input.wpms-search-key-csl').val().trim().toLocaleString();
368
+ }
369
+ var searchType = $parent_window.find('select[name="filter_type_name"] option:selected').val();
370
+ var postId = $('#post_ID').val();
371
+ var showitems = [];
372
+ $parent_window.find('input[name="filter-row-name"]:checked').each(function () {
373
+ showitems.push(this.value);
374
+ });
375
+
376
+ var sorteditem = $parent_window.find("#gsc_keywords_table label.sorted");
377
+ var dataSort = '';
378
+ if (sorteditem.length > 0) {
379
+ dataSort = JSON.stringify([sorteditem.attr('data-sort'), sorteditem.attr('data-order')]);
380
+ }
381
+
382
+ $parent_window.find('table#gsc_keywords_table tbody#the-list').html('<tr><td colspan="6" class="td-page-loader"><img class="page-loader-loadmore" src="'+wpmseoMetaboxL10n.image_loader+'"></td></tr>');
383
+
384
+ $.ajax({
385
+ url: ajaxurl,
386
+ method: 'POST',
387
+ dataType: 'json',
388
+ data: {
389
+ action: 'wpms_filter_search_keywords',
390
+ time : time,
391
+ postId: postId,
392
+ showitems : showitems,
393
+ keycsl : keycsl,
394
+ searchType : searchType,
395
+ dataSort : dataSort,
396
+ wpms_nonce: wpms_localize.wpms_nonce
397
+ },
398
+ success: function (res) {
399
+ $parent_window.find('.wpms_load_more_keyword td.td-page-loader').remove();
400
+ if(res.status){
401
+ $parent_window.find('.wpms_load_more_keyword').data('page',2);
402
+ $parent_window.find('.wpms_list_gsc_keywords tr').remove();
403
+ $parent_window.find('.wpms_list_gsc_keywords').append(res.html);
404
+ } else {
405
+ $parent_window.find('.wpms_list_gsc_keywords').html('<tr><td colspan="6">'+wpmseoMetaboxL10n.keyword_filter_return+'</td></tr>');
406
+ }
407
+ }
408
+ });
409
+ }
410
+
411
+ $parent_window.find('#wpms-csl-search-submit').on('click', function (e) {
412
+ var keycsl = $parent_window.find('.wpms-search-key-csl').val().trim().toLocaleString();
413
+
414
+ if (keycsl === '') {
415
+ $parent_window.find('#wpms-search-input-csl').focus();
416
+ }
417
+
418
+ wpms_filter_search_keywords();
419
+ });
420
+
421
+ $parent_window.find('select[name="filter_type_name"]').change(function(){
422
+ var select = $(this).val();
423
+ var placeholder = 'Add keywords like "Apple pie recipe..."';
424
+ if (select === 'page') {
425
+ placeholder = 'Paste URL to fetch the Google Search keywords';
426
+ }
427
+
428
+ $parent_window.find(".icons-key-csl-search").removeClass('obtain');
429
+ $parent_window.find("#wpms-search-input-csl").val('').attr('placeholder', placeholder).focus();
430
+ });
431
+
432
+ $parent_window.find('#wpms-search-input-csl').on('keyup', function() {
433
+ var keycsl = $(this).val();
434
+
435
+ if (keycsl === '') {
436
+ $parent_window.find(".icons-key-csl-search").removeClass('obtain');
437
+ } else {
438
+ $parent_window.find("#wpms-search-input-csl").removeClass('obtain');
439
+ $parent_window.find(".icons-key-csl-search").addClass('obtain');
440
+ }
441
+ });
442
+
443
+ // CHeck is google console connected
444
+ if (typeof wpmseoMetaboxL10n.keyword_console_connected !== "undefined" && parseInt(wpmseoMetaboxL10n.keyword_console_connected) === 1) {
445
+ addLinkToSearchBox('page-load');
446
+ }
447
+
448
+ $parent_window.find('.icons-key-csl-search').on('click', function() {
449
+ addLinkToSearchBox();
450
+ $parent_window.find("#wpms-search-input-csl").focus();
451
+ $parent_window.find('select[name="filter_type_name"]').val('page');
452
+ return false;
453
+ });
454
+
455
+ function addLinkToSearchBox(action)
456
+ {
457
+ var link = $parent_window.find('#wp-admin-bar-view .ab-item');
458
+ var prelink = $parent_window.find('#wp-admin-bar-preview .ab-item');
459
+ var newlink = $parent_window.find('.is-link');
460
+
461
+ if (link.length || prelink.length) {
462
+ if (link.length) {
463
+ $parent_window.find("#wpms-search-input-csl").val(link.attr('href'));
464
+ }
465
+
466
+ if (prelink.length) {
467
+ $parent_window.find("#wpms-search-input-csl").val(prelink.attr('href'));
468
+ }
469
+ } else {
470
+ if (newlink.length) {
471
+ $parent_window.find("#wpms-search-input-csl").val(newlink.attr('href'));
472
+ }
473
+ }
474
+
475
+ $parent_window.find(".icons-key-csl-search").addClass('obtain');
476
+
477
+ if (action) {
478
+ wpms_filter_search_keywords();
479
+ }
480
+ }
481
+
482
+ // Show filter row
483
+ $parent_window.find('.filter-row').on('click', function () {
484
+ $parent_window.find('#filter-row-list').toggle('fade');
485
+ });
486
+ // Show filter row outside
487
+ $(document).mouseup(function (e) {
488
+ var container = $parent_window.find("#filter-row-list");
489
+ // if the target of the click isn't the container nor a descendant of the container
490
+ if (!container.is(e.target) && container.has(e.target).length === 0) {
491
+ container.hide('fade');
492
+ }
493
+ });
494
+
495
+ // Set filter row
496
+ $parent_window.find('.filter-row-checkbox').on('click', function () {
497
+ var showitems = [];
498
+ $parent_window.find('input[name="filter-row-name"]:checked').each(function () {
499
+ showitems.push(this.value);
500
+ });
501
+ $parent_window.find('#gsc_keywords_table tr >th:nth-child(4),#gsc_keywords_table tr >th:nth-child(5),#gsc_keywords_table tr >td:nth-child(4), #gsc_keywords_table tr >td:nth-child(5)').hide();
502
+
503
+
504
+ if (showitems.length > 0) {
505
+ $.each(showitems, function (i, showitem) {
506
+ $parent_window.find('#gsc_keywords_table tr >th:nth-child('+showitem+'), #gsc_keywords_table tr >td:nth-child('+showitem+')').show();
507
+ });
508
+ }
509
+ });
510
+
511
+ function isGutenbergActive() {
512
+ return typeof wp !== 'undefined' && typeof wp.blocks !== 'undefined';
513
+ }
514
+
515
+ // CHeck is google console connected
516
+ if (typeof wpmseoMetaboxL10n.keyword_console_connected !== "undefined" && parseInt(wpmseoMetaboxL10n.keyword_console_connected) === 1) {
517
+ // Save post edit gutenberg
518
+ if (isGutenbergActive()) {
519
+ wp.data.subscribe(function () {
520
+ var isSavingPost = wp.data.select('core/editor').isSavingPost();
521
+ var isAutosavingPost = wp.data.select('core/editor').isAutosavingPost();
522
+
523
+ if (isSavingPost && !isAutosavingPost) {
524
+ wpms_filter_search_keywords();
525
+ }
526
+ });
527
+ }
528
+ }
529
+
530
+ // Enter action
531
+ $(document).on("keypress","#wpms-search-input-csl", function (e) {
532
+ if(e.which === 13){
533
+ e.preventDefault();
534
+ wpms_filter_search_keywords();
535
+ }
536
+ });
537
+
538
+ // Sort table
539
+ $parent_window.find('#gsc_keywords_table label.gsc-sort-by').on('click', function() {
540
+ $parent_window.find('#gsc_keywords_table label.gsc-sort-by').not($(this)).removeClass('sorted down up');
541
+
542
+ if ($(this).hasClass('down')) {
543
+ $(this).removeClass('down').addClass('sorted up').attr('data-order', 'ascending');
544
+ } else {
545
+ $(this).removeClass('up').addClass('sorted down').attr('data-order', 'descending');
546
+ }
547
+
548
+ var page = $parent_window.find('#gsc_keywords_table tfoot').data('page');
549
+ if (typeof page === 'undefined') {
550
+ page = 2;
551
+ }
552
+ wpms_filter_search_keywords_more(parseInt(page) - 1, 1);
553
+ });
554
+
555
+
556
+ $parent_window.find('#gsc_keywords_table tfoot').on('click', function () {
557
+ var page = $(this).data('page');
558
+ wpms_filter_search_keywords_more(page, 2);
559
+ });
560
+
561
+ function wpms_filter_search_keywords_more(page, type) {
562
+ if (typeof page === 'undefined') {
563
+ page = 1;
564
+ }
565
+ var $this = $parent_window.find('#gsc_keywords_table tfoot');
566
+ var time = $parent_window.find('select[name="gsc_keywords_time_filter_select"] option:selected').val();
567
+ var keycsl = $parent_window.find('input.wpms-search-key-csl').val().trim().toLocaleString();
568
+ var searchType = $parent_window.find('select[name="filter_type_name"] option:selected').val();
569
+ var postId = $('#post_ID').val();
570
+ var showitems = [];
571
+ $parent_window.find('input[name="filter-row-name"]:checked').each(function () {
572
+ showitems.push(this.value);
573
+ });
574
+
575
+ var sorteditem = $parent_window.find("#gsc_keywords_table label.sorted");
576
+ var dataSort = '';
577
+ if (sorteditem.length > 0) {
578
+ dataSort = JSON.stringify([sorteditem.attr('data-sort'), sorteditem.attr('data-order')]);
579
+ }
580
+ var loadder = '<tr><td colspan="6" class="td-page-loader"><img class="page-loader-loadmore" src="'+wpmseoMetaboxL10n.image_loader+'"></td></tr>';
581
+ if (type === 1) {
582
+ // Sort loader
583
+ $parent_window.find('table#gsc_keywords_table tbody#the-list').html(loadder);
584
+ } else {
585
+ $parent_window.find('table#gsc_keywords_table tbody#the-list').append(loadder);
586
+ }
587
+ $.ajax({
588
+ url: ajaxurl,
589
+ method: 'POST',
590
+ dataType: 'json',
591
+ data: {
592
+ action: 'wpms_filter_search_keywords',
593
+ time : time,
594
+ postId: postId,
595
+ page:page,
596
+ showitems : showitems,
597
+ keycsl : keycsl,
598
+ searchType : searchType,
599
+ dataSort : dataSort,
600
+ wpms_nonce: wpms_localize.wpms_nonce
601
+ },
602
+ success: function (res) {
603
+ if(res.status){
604
+ $this.data('page',res.page);
605
+ $parent_window.find('.wpms_list_gsc_keywords tr').remove();
606
+ $parent_window.find('.wpms_list_gsc_keywords').append(res.html);
607
+ } else {
608
+ $parent_window.find('.wpms_list_gsc_keywords').html('<tr><td colspan="6">'+wpmseoMetaboxL10n.keyword_filter_return+'</td></tr>');
609
+ }
610
+ }
611
+ });
612
+ }
613
+
614
+ // Set time out because of tinymce is initialized later then this is done
615
+ setTimeout(
616
+ function () {
617
+ msUpdateSnippet();
618
+
619
+ // Adding events to content and excerpt
620
+ if (typeof tinyMCE !== 'undefined' && tinyMCE.get('content') !== null) {
621
+ tinyMCE.get('content').on('blur', msUpdateDesc);
622
+ }
623
+
624
+ if (typeof tinyMCE !== 'undefined' && tinyMCE.get('excerpt') !== null) {
625
+ tinyMCE.get('excerpt').on('blur', msUpdateDesc);
626
+ }
627
+ },
628
+ 500
629
+ );
630
+
631
+ tippy('.metaseo_help, .metaseo_tool', {
632
+ animation: 'scale',
633
+ duration: 0,
634
+ arrow: false,
635
+ placement: 'top',
636
+ theme: 'metaseo-tippy tippy-rounded',
637
+ onShow(instance) {
638
+ instance.popper.hidden = instance.reference.dataset.tippy ? false : true;
639
+ instance.setContent(instance.reference.dataset.tippy);
640
+ }
641
+ });
642
+
643
+ $parent_window.find('#metaseo_wpmseo_title, #metaseo_wpmseo_desc, #metaseo_snippet_title').on('mouseover', function () {
644
+ $(this).addClass('wpms-mouseover-frame ');
645
+ }).on('mouseout', function () {
646
+ $(this).removeClass('wpms-mouseover-frame ');
647
+ });
648
+ }
649
+
650
+ if ($(window.document).find('#seo_et_ignore_iframe').length > 0) {
651
+ var load_only = true;
652
+ if ($(window.document).find('#et-fb-app-frame').length < 1 && $('#wpseo-settings-bar-root').length > 0) {
653
+ $parent_window = $(window.parent.document);
654
+ $parent_window.find('#wpseo-settings-bar-root').on('click', function () {
655
+ if (load_only) {
656
+ load_only = false;
657
+ wpms_load_js();
658
+ }
659
+ });
660
+ }
661
+ }
662
+ });
663
+
664
+ (function ($) {
665
+ $(document).on("click",".editor-post-permalink-editor__save", function () {
666
+ var url;
667
+ if ($('.editor-post-permalink-editor__edit').length) {
668
+ var slug = $('.editor-post-permalink-editor__edit').val();
669
+ url = wpmseoMetaboxL10n.wpmseo_permalink_template.replace('%postname%', slug).replace('http://', '');
670
+ }
671
+
672
+ $('#wpmseosnippet').find('.url').html(url);
673
+ });
674
+
675
+ $(document).on("keypress",".editor-post-permalink-editor__edit", function (e) {
676
+ if(e.which === 13){
677
+ var slug = $(this).val();
678
+ url = wpmseoMetaboxL10n.wpmseo_permalink_template.replace('%postname%', slug).replace('http://', '');
679
+ $('#wpmseosnippet').find('.url').html(url);
680
+ }
681
+ });
682
+
683
+ // Custom bootstrap tagsinput when paste value
684
+ $(document).on('paste', '.wpms-bootstrap-tagsinput > input', function(e) {
685
+ let pasteData = e.originalEvent.clipboardData.getData('text');
686
+ $(this).attr('size', pasteData.length);
687
+ })
688
+ .on('focusout', '.wpms-bootstrap-tagsinput > input', function (e) {
689
+ $(this).attr('size', 1);
690
+ });
691
+ })(jQuery);
inc/divi-seo/wpmseo-divi.css ADDED
File without changes
inc/divi-seo/wpmseo-divi.scss ADDED
File without changes
inc/divi-seo/wpseo-divi.js ADDED
@@ -0,0 +1,589 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var wpmseo_target_id;
2
+ jQuery(document).ready(function ($) {
3
+ if ($(window.parent.document).find('#et-fb-app-frame').length < 1) {
4
+ var $parent_window = $(window.parent.document);
5
+ var $reload_analysis = 0;
6
+
7
+ function get_content_and_title(first_load) {
8
+ var mpageurl = '', title = '', mcontent = '', current_editor = '';
9
+
10
+ var meta_title = $parent_window.find('#metaseo_wpmseo_title').val();
11
+ var meta_desc = $parent_window.find('#metaseo_wpmseo_desc').val();
12
+ var seo_keywords = $parent_window.find("input#metaseo_wpmseo_specific_keywords").val();
13
+ mpageurl = location.protocol + $parent_window.find('#wpmseosnippet').find('a').text();
14
+
15
+ if (typeof wp.blocks !== "undefined") {
16
+ if (typeof mpageurl === 'undefined') {
17
+ mpageurl = $parent_window.find('#wp-admin-bar-view').find('a').attr('href');
18
+ }
19
+ current_editor = 'gutenberg';
20
+ if (parseInt(first_load) === 1) {
21
+ title = wpmscliffpyles.post_title;
22
+ mcontent = wpmscliffpyles.post_content;
23
+ } else {
24
+ title = wpmscliffpyles.post_title;
25
+ // Core editor
26
+ if (typeof wp.data !== "undefined" && typeof wp.data.select('core/editor') !== "undefined" && wp.data.select('core/editor') !== null) {
27
+ mcontent = wp.data.select('core/editor').getEditedPostContent();
28
+ } else if (typeof tinyMCE !== 'undefined') {
29
+ // WooCommerce product
30
+ if (tinyMCE.get('content') !== null) {
31
+ mcontent = tinyMCE.editors.content.getContent();
32
+ if (mcontent === '') mcontent = $parent_window.find('#content').val();
33
+ } else {
34
+ var $content_window = document.getElementById("et-fb-app-frame");
35
+ mcontent = $($content_window.contentWindow.document.getElementById("main-content")).prop('outerHTML');
36
+ }
37
+ console.log(mcontent);
38
+ }
39
+ }
40
+ } else {
41
+ // undefined wp.blocks
42
+ if (typeof wpmscliffpyles.post_type !== 'undefined' && wpmscliffpyles.post_type === 'attachment') {
43
+ // On media attachment page
44
+ if (typeof mpageurl === 'undefined') {
45
+ mpageurl = $parent_window.find('#sample-permalink').text().trim();
46
+ }
47
+
48
+ if (parseInt(first_load) === 1) {
49
+ title = wpmscliffpyles.post_title;
50
+ mcontent = wpmscliffpyles.post_content;
51
+ } else if (typeof wp.data !== "undefined") {
52
+ title = $parent_window.find('#title').val();
53
+ mcontent = $parent_window.find('#attachment_content').val();
54
+ }
55
+ } else {
56
+ // Something went wrong, use default
57
+ if (typeof mpageurl === 'undefined') {
58
+ mpageurl = $parent_window.find('#editable-post-name-full').text();
59
+ }
60
+ title = $parent_window.find('#title').val();
61
+ if (typeof tinyMCE !== 'undefined' && tinyMCE.get('content') !== null) {
62
+ mcontent = tinyMCE.editors.content.getContent();
63
+ if (mcontent === '') mcontent = $parent_window.find('#content').val();
64
+ } else {
65
+ mcontent = $parent_window.find('#content').val();
66
+ }
67
+ }
68
+ }
69
+
70
+ return [mcontent, title, mpageurl, seo_keywords, meta_desc, meta_title, current_editor];
71
+ }
72
+
73
+ function wpseoEditor($seo_et_ignore_iframe, $settings_bar_root, $settings_bar) {
74
+ var wpmseo_uploader;
75
+
76
+ function innit() {
77
+ $settings_bar_root.after($seo_et_ignore_iframe);
78
+ $settings_bar.append($settings_bar_root);
79
+ $settings_bar_root.append('<div class="wp-menu-image dashicons-before dashicons-chart-area" aria-hidden="true"><br></div>');
80
+ $settings_bar.find('.et-fb-page-settings-bar__column--main').before($settings_bar_root);
81
+ }
82
+ innit();
83
+
84
+ function wpms_validate_analysis() {
85
+ jQuery(document).on('click', '.metaseo-dashicons.icons-mboxwarning', function () {
86
+ var seo_keywords = $parent_window.find("input#metaseo_wpmseo_specific_keywords").val();
87
+ var $this = $(this);
88
+ $this.html('done').removeClass('icons-mboxwarning').addClass('icons-mboxdone');
89
+ if (mcheck === 0) {
90
+ mcheck = jQuery('#metaseo_alanysis_ok').val();
91
+ mcheck++;
92
+ } else {
93
+ mcheck++;
94
+ }
95
+
96
+ var total = 7;
97
+ if (seo_keywords !== '') {
98
+ total++;
99
+ }
100
+
101
+ var circliful = Math.ceil((mcheck * 100) / total);
102
+ jQuery.ajax({
103
+ dataType: 'json',
104
+ method: 'POST',
105
+ url: ajaxurl,
106
+ data: {
107
+ 'action': 'wpms',
108
+ 'task': 'validate_analysis',
109
+ 'post_id': jQuery('.metaseo-progress-bar').data('post_id'),
110
+ 'field': $this.parent('.metaseo_analysis').data('title'),
111
+ 'wpms_nonce': wpms_localize.wpms_nonce
112
+ },
113
+ success: function (res) {
114
+ if (res !== false) {
115
+ drawInactive(circliful);
116
+ }
117
+ }
118
+ });
119
+
120
+ });
121
+ }
122
+
123
+ var mcheck = 0;
124
+ if (typeof wpmscliffpyles.use_validate !== "undefined" && parseInt(wpmscliffpyles.use_validate) === 1) {
125
+ wpms_validate_analysis();
126
+ }
127
+
128
+ function reload_analysis(first_load) {
129
+ $reload_analysis = 1;
130
+ var mpageurl = '', title = '', mcontent = '', current_editor = '';
131
+ var meta_title, meta_desc, seo_keywords;
132
+
133
+ [mcontent, title, mpageurl, seo_keywords, meta_desc, meta_title, current_editor] = get_content_and_title(first_load);
134
+
135
+ // In bad case, set empty value to avoid errors
136
+ if (typeof mcontent === 'undefined') mcontent = '';
137
+ if (typeof title === 'undefined') title = '';
138
+ if (typeof mpageurl === 'undefined') mpageurl = '';
139
+
140
+ $parent_window.find('.wpmseotab .spinner').css({'visibility': ' inherit'}).show();
141
+ $parent_window.find('.metaseo_right .panel-left, .metaseo_right .panel-right').html('');
142
+ // console.log(current_editor, meta_title, meta_desc, '123', seo_keywords, mpageurl, '123', mcontent, title);
143
+
144
+ $.ajax({
145
+ dataType: 'json',
146
+ method: 'POST',
147
+ url: ajaxurl,
148
+ data: {
149
+ 'action': 'wpms',
150
+ 'task': 'reload_analysis',
151
+ 'datas': {
152
+ 'editor': current_editor,
153
+ 'first_load': first_load,
154
+ 'post_id': jQuery('.metaseo-progress-bar').data('post_id'),
155
+ 'title': title,
156
+ 'meta_title': meta_title,
157
+ 'mpageurl': mpageurl,
158
+ 'meta_desc': meta_desc,
159
+ 'content': mcontent,
160
+ 'seo_keywords': seo_keywords
161
+ },
162
+ 'wpms_nonce': wpms_localize.wpms_nonce
163
+ },
164
+ success: function (res) {
165
+ if (res) {
166
+ $parent_window.find('.wpmseotab .spinner').hide();
167
+ $parent_window.find('.metaseo_right .panel-left').html(res.output);
168
+ $parent_window.find('.metaseo_right .panel-right').html(res.right_output);
169
+ mcheck = parseInt(res.check);
170
+ tippy('.metaseo_tool', {
171
+ animation: 'scale',
172
+ duration: 0,
173
+ arrow: false,
174
+ placement: 'top',
175
+ theme: 'metaseo-tippy tippy-rounded',
176
+ onShow(instance) {
177
+ instance.popper.hidden = instance.reference.dataset.tippy ? false : true;
178
+ instance.setContent(instance.reference.dataset.tippy);
179
+ }
180
+ });
181
+
182
+ drawInactive(res.circliful);
183
+ }
184
+ }
185
+ });
186
+ }
187
+
188
+ function drawInactive(circliful) {
189
+ $parent_window.find('.metaseo-progress-bar').circleProgress({
190
+ value: circliful / 100,
191
+ size: 250,
192
+ thickness: 8,
193
+ fill: {
194
+ gradient: ["#34e0ff", "#5dadff"]
195
+ }
196
+ }).on('circle-animation-progress', function (event, progress) {
197
+ $(this).find('strong').html(Math.round(circliful) + '<i>%</i>');
198
+ });
199
+ }
200
+
201
+ function addClassTo(that, classname) {
202
+ if (that.hasClass(classname)) {
203
+ that.removeClass(classname);
204
+
205
+ // init load analysis
206
+ if ($reload_analysis === 0) {
207
+ reload_analysis(1);
208
+ }
209
+
210
+ $parent_window.find('#reload_analysis').on('click', function () {
211
+ reload_analysis(0);
212
+ });
213
+
214
+ $('#wpmseo_social').hide();
215
+
216
+ $('#elementor-wpms-general').addClass('active');
217
+ $('#elementor-wpms-social').removeClass('active');
218
+
219
+ $('#elementor-wpms-social').on('click', function (e) {
220
+ $('#elementor-wpms-general').removeClass('active');
221
+ $('#elementor-wpms-social').addClass('active');
222
+ $('#wpmseo_general').hide();
223
+ $('#wpmseo_social').show();
224
+ $('#wpmseo_gsc_keywords').hide();
225
+ });
226
+
227
+ $('#elementor-wpms-general').on('click', function (e) {
228
+ $('#elementor-wpms-general').addClass('active');
229
+ $('#elementor-wpms-social').removeClass('active');
230
+ $('#wpmseo_general').show();
231
+ $('#wpmseo_social').hide();
232
+ $('#wpmseo_gsc_keywords').show();
233
+ });
234
+
235
+ $('.wpmseo_image_upload_button').unbind('click').on('click', function () {
236
+ wpmseo_target_id = $(this).attr('id').replace(/_button$/, '');
237
+ if (wpmseo_uploader) {
238
+ wpmseo_uploader.open();
239
+ return;
240
+ }
241
+ wpmseo_uploader = wp.media.frames.file_frame = wp.media({
242
+ title: wpmseoMediaL10n.choose_image,
243
+ button: {text: wpmseoMediaL10n.choose_image},
244
+ multiple: false
245
+ });
246
+
247
+
248
+ wpmseo_uploader.on('select', function () {
249
+ var attachment = wpmseo_uploader.state().get('selection').first().toJSON();
250
+ console.log(wpmseo_target_id);
251
+ jQuery('#' + wpmseo_target_id).val(attachment.url);
252
+ wpmseo_uploader.close();
253
+ });
254
+
255
+ wpmseo_uploader.open();
256
+ });
257
+
258
+ $(document).on('click', '.et-fb-button--publish, .et-fb-button--save-draft', function () {
259
+ const postID = parseInt(jQuery('.metaseo-progress-bar').data('post_id'));
260
+ // get data from metabox on elementor to save
261
+ let title, desc, keyword, sEKeyword, canonicalUrl, fTitle, fDesc, fImage, tTitle, tDesc,
262
+ tImage, scoreProgress;
263
+ title = $('#metaseo_wpmseo_title').val();
264
+ desc = $('#metaseo_wpmseo_desc').val();
265
+ keyword = $('#metaseo_wpmseo_specific_keywords').tagsinput('items');
266
+ keyword = keyword.join(', ');
267
+ sEKeyword = $('#metaseo_wpmseo_keywords').val();
268
+ canonicalUrl = $('#metaseo_wpmseo_metaseo_canonical').val();
269
+ fTitle = $('#metaseo_wpmseo_opengraph-title').val();
270
+ fDesc = $('#metaseo_wpmseo_opengraph-desc').val();
271
+ fImage = $('#metaseo_wpmseo_opengraph-image').val();
272
+ tTitle = $('#metaseo_wpmseo_twitter-title').val();
273
+ tDesc = $('#metaseo_wpmseo_twitter-desc').val();
274
+ tImage = $('#metaseo_wpmseo_twitter-image').val();
275
+ scoreProgress = $('#wpmetaseo_seo_keywords_result').val();
276
+ var datas = {
277
+ 'title': title,
278
+ 'desc': desc,
279
+ 'specific_keywords': keyword,
280
+ 'keywords': sEKeyword,
281
+ 'metaseo_canonical': canonicalUrl,
282
+ 'opengraph-title': fTitle,
283
+ 'opengraph-desc': fDesc,
284
+ 'opengraph-image': fImage,
285
+ 'twitter-title': tTitle,
286
+ 'twitter-desc': tDesc,
287
+ 'twitter-image': tImage,
288
+ 'wp_metaseo_seoscore': scoreProgress
289
+ };
290
+
291
+ $.ajax({
292
+ url: ajaxurl,
293
+ method: 'POST',
294
+ dataType: 'json',
295
+ data: {
296
+ action: 'wpms',
297
+ task: 'wpmsElementorSavePost',
298
+ elementorPostID: postID,
299
+ wpms_nonce: wpmseoMetaboxL10n.wpms_nonce,
300
+ datas: datas
301
+ },
302
+ success: function (res) {
303
+ },
304
+ error: function (e) {
305
+ console.log(e);
306
+ }
307
+ });
308
+ });
309
+
310
+ } else {
311
+ that.addClass(classname);
312
+ }
313
+ }
314
+
315
+ $settings_bar_root.on('click', function () {
316
+ addClassTo($seo_et_ignore_iframe, 'hidden');
317
+ });
318
+
319
+ $(document).on('click', '.et-fb-page-settings-bar__toggle-button', function () {
320
+ if ($(this).hasClass('et-fb-button--active')) {
321
+ $settings_bar_root.appendTo($(this).siblings('.et-fb-page-settings-bar__column--main'));
322
+ } else {
323
+ $(this).siblings('.et-fb-page-settings-bar__column--main').after($settings_bar_root);
324
+ }
325
+ })
326
+ }
327
+ window.addEventListener("message", (function (t) {
328
+ if ("et_builder_api_ready_wpms" === t.data.etBuilderEvent) {
329
+ var $seo_et_ignore_iframe = $(window.document).find('#et-fb-app-frame').contents().find('#seo_et_ignore_iframe'),
330
+ $settings_bar_root = $('#wpseo-settings-bar-root'),
331
+ $settings_bar = $('.et-fb-page-settings-bar');
332
+
333
+ wpseoEditor($seo_et_ignore_iframe, $settings_bar_root, $settings_bar);
334
+ }
335
+ }));
336
+
337
+ class wpmsSpecificKeywords {
338
+ constructor() {
339
+ this.title = null;
340
+ this.content = null;
341
+ this.tagsElement = $('#metaseo_wpmseo_specific_keywords');
342
+ this.metaTitleElement = $('#metaseo_wpmseo_title');
343
+ this.metaDescElement = $('#metaseo_wpmseo_desc');
344
+ this.listTags = [];
345
+ this.resultAnalytics = null;
346
+ }
347
+
348
+ init = () => {
349
+ var mpageurl = '', title = '', mcontent = '', current_editor = '';
350
+ var meta_title, meta_desc, seo_keywords;
351
+ [this.content, this.title, mpageurl, seo_keywords, meta_desc, meta_title, current_editor] = get_content_and_title(1);
352
+ // Get editor title
353
+ // if (typeof elmTitle !== 'undefined') {
354
+ // this.title = elmTitle;
355
+ // }
356
+ // Get editor content
357
+ // if (typeof elmContent !== 'undefined') {
358
+ // this.content = elmContent;
359
+ // }
360
+
361
+ this.bindEvents();
362
+ this.tagsElement.on('itemAdded itemRemoved', this.bindEvents);
363
+ this.metaTitleElement.on('keyup', this.bindEvents);
364
+ this.metaDescElement.on('keyup', this.bindEvents);
365
+ }
366
+
367
+ bindEvents = () => {
368
+ if (this.tagsElement.siblings('.wpms-bootstrap-tagsinput').length > 1) {
369
+ this.tagsElement.siblings('.wpms-bootstrap-tagsinput').remove();
370
+ }
371
+ this.listTags = this.tagsElement.tagsinput('items');
372
+ if (typeof this.listTags !== 'undefined' && typeof this.listTags.itemsArray !== 'undefined' && this.listTags.itemsArray !== '') {
373
+ this.listTags = this.listTags.itemsArray;
374
+ }
375
+
376
+ this.analytics();
377
+ }
378
+
379
+ analytics = () => {
380
+ this.resultAnalytics = {
381
+ keyInTitle: this.collectKeywordsInTitle(),
382
+ keyInContent: this.collectKeywordsInContent(),
383
+ keyInContentHeading: this.collectKeywordsInHeading(),
384
+ keyInMetaTitle: this.collectKeywordsInMetaTitle(),
385
+ keyInMetaDescription: this.collectKeywordsInMetaDesc()
386
+ }
387
+
388
+ if (this.resultAnalytics !== null) {
389
+ let discovered = false;
390
+ Object.entries(this.resultAnalytics).forEach(entry => {
391
+ const [key, value] = entry;
392
+ if (value) discovered = true;
393
+ this.changeAnalyticsInfo(key, value);
394
+ });
395
+
396
+ this.editAnalyticsInfo(discovered);
397
+ }
398
+ }
399
+
400
+ editAnalyticsInfo = (discovered) => {
401
+ const seo_keywords = $("input#metaseo_wpmseo_specific_keywords").val();
402
+ if (seo_keywords === '') {
403
+ $('div.metaseo_analysis[data-title="seokeyword"]').hide();
404
+ $('.seokeyword-information').hide();
405
+ $('input.wpms_analysis_hidden[name="wpms[seokeyword]"]').val(0);
406
+ this.reDrawInactive(7);
407
+ return false;
408
+ } else {
409
+ $('div.metaseo_analysis[data-title="seokeyword"]').show();
410
+ $('.seokeyword-information').show();
411
+ }
412
+
413
+ if (!discovered) {
414
+ $('div.metaseo_analysis[data-title="seokeyword"]').find('i').removeClass('icons-mboxdone').addClass('icons-mboxwarning').html('error_outline');
415
+ $('input.wpms_analysis_hidden[name="wpms[seokeyword]"]').val(0);
416
+ } else {
417
+ $('div.metaseo_analysis[data-title="seokeyword"]').find('i').removeClass('icons-mboxwarning').addClass('icons-mboxdone').html('done');
418
+ $('input.wpms_analysis_hidden[name="wpms[seokeyword]"]').val(1);
419
+ }
420
+
421
+ this.reDrawInactive(8);
422
+ }
423
+
424
+ reDrawInactive = (totalItems) => {
425
+ const analyticItems = $('.panel-left .wpms_analysis_hidden');
426
+ let mcheck = 0;
427
+
428
+ for (let i = 0; i < analyticItems.length; i++) {
429
+ if ($(analyticItems[i]).val() == 1) {
430
+ mcheck++;
431
+ }
432
+ }
433
+
434
+ const circliful = Math.ceil((mcheck * 100) / totalItems);
435
+
436
+ $('#wpmetaseo_seo_keywords_result').val(circliful);
437
+ $('.metaseo-progress-bar').circleProgress('value', circliful / 100).on('circle-animation-progress', function (event, progress) {
438
+ $(this).find('strong').html(circliful + '<i>%</i>');
439
+ });
440
+ }
441
+
442
+ // change material icon
443
+ changeAnalyticsInfo = (key, value) => {
444
+ if (value) {
445
+ $('div.metaseo_analysis[data-title="' + key.toLowerCase() + '"]').find('i').removeClass('icons-mboxwarning').addClass('icons-mboxdone').html('done');
446
+ $('input.wpms_analysis_hidden[name="wpms[' + key.toLowerCase() + ']"]').val(1);
447
+ } else {
448
+ $('div.metaseo_analysis[data-title="' + key.toLowerCase() + '"]').find('i').removeClass('icons-mboxdone').addClass('icons-mboxwarning').html('error_outline');
449
+ $('input.wpms_analysis_hidden[name="wpms[' + key.toLowerCase() + ']"]').val(0);
450
+ }
451
+ }
452
+
453
+ collectKeywordsInTitle = () => {
454
+ let title = {text: this.title,};
455
+ let isContain = false;
456
+ //alert(this.listTags);
457
+ if (this.listTags.length && title.text.length) {
458
+ this.listTags.forEach(function (item) {
459
+ if (title.text.toLowerCase().includes(item.toLowerCase().trim())) {
460
+ isContain = true;
461
+ return isContain;
462
+ }
463
+ });
464
+ }
465
+
466
+ return isContain;
467
+ }
468
+
469
+ collectKeywordsInContent = () => {
470
+ let content = {text: this.content};
471
+ let isContain = false;
472
+ if (this.listTags.length && content.text.length) {
473
+ this.listTags.forEach(function (item, index) {
474
+ if (content.text.toLowerCase().includes(item.toLowerCase().trim())) {
475
+ isContain = true;
476
+ return isContain;
477
+ }
478
+ });
479
+ }
480
+
481
+ return isContain;
482
+ }
483
+
484
+ collectKeywordsInHeading = () => {
485
+ let content = {text: this.content};
486
+ let isContain = false;
487
+ if (this.listTags.length && content.text.length) {
488
+ this.listTags.forEach(function (item, index) {
489
+ const regex = RegExp("<h[2-6][^>]*>.*" + item.toLowerCase().trim() + ".*</h[2-6]>", "gi");
490
+ if (content.text.toLowerCase().match(regex) != null) {
491
+ isContain = true;
492
+ return isContain;
493
+ }
494
+ });
495
+ }
496
+
497
+ return isContain;
498
+ }
499
+
500
+ collectKeywordsInMetaTitle = () => {
501
+ let metaTitle = {text: this.replaceVariables(this.metaTitleElement.val())};
502
+ let isContain = false;
503
+ if (this.listTags.length && metaTitle.text.length) {
504
+ this.listTags.forEach(function (item, index) {
505
+ if (metaTitle.text.toLowerCase().includes(item.toLowerCase().trim())) {
506
+ isContain = true;
507
+ return isContain;
508
+ }
509
+ });
510
+ }
511
+
512
+ return isContain;
513
+ }
514
+
515
+ collectKeywordsInMetaDesc = () => {
516
+ let metaDesc = {text: this.replaceVariables(this.metaDescElement.val())};
517
+ let isContain = false;
518
+ if (this.listTags.length && metaDesc.text.length) {
519
+ this.listTags.forEach(function (item, index) {
520
+ if (metaDesc.text.toLowerCase().includes(item.toLowerCase().trim())) {
521
+ isContain = true;
522
+ return isContain;
523
+ }
524
+ });
525
+ }
526
+
527
+ return isContain;
528
+ }
529
+
530
+ replaceVariables = (str) => {
531
+ if (typeof str === 'undefined') {
532
+ return;
533
+ }
534
+
535
+ if (this.title) {
536
+ str = str.replace(/%title%/g, this.title.replace(/(<([^>]+)>)/ig, ''));
537
+ }
538
+
539
+ // These are added in the head for performance reasons.
540
+ str = str.replace(/%id%/g, wpmseoMetaboxL10n.id);
541
+ str = str.replace(/%date%/g, wpmseoMetaboxL10n.date);
542
+ str = str.replace(/%sitedesc%/g, wpmseoMetaboxL10n.sitedesc);
543
+ str = str.replace(/%sitename%/g, wpmseoMetaboxL10n.sitename);
544
+ str = str.replace(/%sep%/g, wpmseoMetaboxL10n.sep);
545
+ str = str.replace(/%page%/g, wpmseoMetaboxL10n.page);
546
+ str = str.replace(/%currenttime%/g, wpmseoMetaboxL10n.currenttime);
547
+ str = str.replace(/%currentdate%/g, wpmseoMetaboxL10n.currentdate);
548
+ str = str.replace(/%currentday%/g, wpmseoMetaboxL10n.currentday);
549
+ str = str.replace(/%currentmonth%/g, wpmseoMetaboxL10n.currentmonth);
550
+ str = str.replace(/%pagetotal%/g, wpmseoMetaboxL10n.pagetotal);
551
+ str = str.replace(/%pagenumber%/g, wpmseoMetaboxL10n.pagenumber);
552
+ str = str.replace(/%currentyear%/g, wpmseoMetaboxL10n.currentyear);
553
+
554
+ // excerpt
555
+ let excerpt = '';
556
+ if (jQuery('#excerpt').length) {
557
+ excerpt = msClean(jQuery('#excerpt').val().replace(/(<([^>]+)>)/ig, ''));
558
+ str = str.replace(/%excerpt_only%/g, excerpt);
559
+ }
560
+
561
+ if ('' === excerpt && jQuery('#content').length) {
562
+ excerpt = jQuery('#content').val().replace(/(<([^>]+)>)/ig, '').substring(0, wpmseoMetaboxL10n.wpmseo_meta_desc_length - 1);
563
+ }
564
+ str = str.replace(/%excerpt%/g, excerpt);
565
+
566
+ // parent page
567
+ if (jQuery('#parent_id').length && jQuery('#parent_id option:selected').text() !== wpmseoMetaboxL10n.no_parent_text) {
568
+ str = str.replace(/%parent_title%/g, jQuery('#parent_id option:selected').text());
569
+ }
570
+
571
+ // remove double separators
572
+ const esc_sep = wpmseoMetaboxL10n.sep.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
573
+ const pattern = new RegExp(esc_sep + ' ' + esc_sep, 'g');
574
+ str = str.replace(pattern, wpmseoMetaboxL10n.sep);
575
+
576
+ return str;
577
+ }
578
+ }
579
+
580
+ $(document).ajaxComplete(function (event, request, settings) {
581
+ if (typeof settings.data !== "undefined" && settings.data.includes('action=wpms&task=reload_analysis')) {
582
+ new wpmsSpecificKeywords().init();
583
+ }
584
+ });
585
+ }
586
+ $(window).on('et_builder_api_ready', function (event) {
587
+ window.parent.postMessage({etBuilderEvent: "et_builder_api_ready_wpms"}, "*");
588
+ });
589
+ })
languages/wp-meta-seo-en_US.mo CHANGED
Binary file
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: JoomUnited
3
  Tags: google, webmaster tools, keywords, meta, meta description, meta keywords, meta title, robots meta, search engine optimization, seo, wordpress seo, yahoo, image optimization, image resize, custom post seo, redirect, redirection, 301, broken link
4
  Requires at least: 4.7
5
  Tested up to: 6.0
6
- Stable tag: 4.4.9
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -259,6 +259,10 @@ Yes WP Meta SEO is compatible with Gutenberg editor since 3.7 version.
259
 
260
  == Changelog ==
261
 
 
 
 
 
262
  = 4.4.9 =
263
  * Fix : Security issue
264
 
3
  Tags: google, webmaster tools, keywords, meta, meta description, meta keywords, meta title, robots meta, search engine optimization, seo, wordpress seo, yahoo, image optimization, image resize, custom post seo, redirect, redirection, 301, broken link
4
  Requires at least: 4.7
5
  Tested up to: 6.0
6
+ Stable tag: 4.5.0
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
259
 
260
  == Changelog ==
261
 
262
+ = 4.5.0 =
263
+ * Add : SEO optimization meta block for DIVI
264
+ * Add : New variables: %page%, %pagetotla%, %pagenumber% for blog pagination
265
+
266
  = 4.4.9 =
267
  * Fix : Security issue
268
 
wp-meta-seo.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: WP Meta SEO
5
  * Plugin URI: http://www.joomunited.com/wordpress-products/wp-meta-seo
6
  * Description: WP Meta SEO is a plugin for WordPress to fill meta for content, images and main SEO info in a single view.
7
- * Version: 4.4.9
8
  * Text Domain: wp-meta-seo
9
  * Domain Path: /languages
10
  * Author: JoomUnited
@@ -133,7 +133,7 @@ if (!defined('WPMSEO_VERSION')) {
133
  /**
134
  * Plugin version
135
  */
136
- define('WPMSEO_VERSION', '4.4.9');
137
  }
138
 
139
  if (!defined('WPMS_CLIENTID')) {
@@ -412,6 +412,7 @@ if (is_admin()) {
412
  require_once(WPMETASEO_PLUGIN_DIR . 'inc/class.metaseo-google-analytics.php');
413
  require_once(WPMETASEO_PLUGIN_DIR . 'inc/class.metaseo-admin.php');
414
  add_action('plugins_loaded', 'wpmsAdminInit', 15);
 
415
  /**
416
  * Admin init
417
  *
@@ -587,6 +588,7 @@ if (is_admin()) {
587
  $meta_desc_esc = $opengraph->getDesc($settings, $id, $content);
588
  // get meta keyword
589
  $meta_keywords_esc = $opengraph->getKeyword($settings, $id);
 
590
  $page_follow = get_post_meta($id, '_metaseo_metafollow', true);
591
  $page_index = get_post_meta($id, '_metaseo_metaindex', true);
592
  // get meta title for twitter
@@ -798,11 +800,14 @@ if (is_admin()) {
798
  } else {
799
  $meta_title = get_metadata('term', $term->term_id, 'wpms_category_metatitle', true);
800
  }
801
- $meta_title = $opengraph->replaceSnippet($meta_title, null);
 
802
  }
 
803
  if (empty($meta_title)) {
804
  $meta_title = $title;
805
  }
 
806
  return esc_html($meta_title);
807
  }
808
 
@@ -1204,3 +1209,15 @@ function wpmsTemplateRedirect()
1204
  }
1205
  }
1206
  }
 
 
 
 
 
 
 
 
 
 
 
 
4
  * Plugin Name: WP Meta SEO
5
  * Plugin URI: http://www.joomunited.com/wordpress-products/wp-meta-seo
6
  * Description: WP Meta SEO is a plugin for WordPress to fill meta for content, images and main SEO info in a single view.
7
+ * Version: 4.5.0
8
  * Text Domain: wp-meta-seo
9
  * Domain Path: /languages
10
  * Author: JoomUnited
133
  /**
134
  * Plugin version
135
  */
136
+ define('WPMSEO_VERSION', '4.5.0');
137
  }
138
 
139
  if (!defined('WPMS_CLIENTID')) {
412
  require_once(WPMETASEO_PLUGIN_DIR . 'inc/class.metaseo-google-analytics.php');
413
  require_once(WPMETASEO_PLUGIN_DIR . 'inc/class.metaseo-admin.php');
414
  add_action('plugins_loaded', 'wpmsAdminInit', 15);
415
+
416
  /**
417
  * Admin init
418
  *
588
  $meta_desc_esc = $opengraph->getDesc($settings, $id, $content);
589
  // get meta keyword
590
  $meta_keywords_esc = $opengraph->getKeyword($settings, $id);
591
+
592
  $page_follow = get_post_meta($id, '_metaseo_metafollow', true);
593
  $page_index = get_post_meta($id, '_metaseo_metaindex', true);
594
  // get meta title for twitter
800
  } else {
801
  $meta_title = get_metadata('term', $term->term_id, 'wpms_category_metatitle', true);
802
  }
803
+
804
+ $meta_title = $opengraph->replaceSnippet($meta_title, null, $term);
805
  }
806
+
807
  if (empty($meta_title)) {
808
  $meta_title = $title;
809
  }
810
+
811
  return esc_html($meta_title);
812
  }
813
 
1209
  }
1210
  }
1211
  }
1212
+
1213
+ add_action(
1214
+ 'after_setup_theme',
1215
+ function () {
1216
+ //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, no need verification
1217
+ if (defined('ET_CORE') && !empty($_GET['et_fb'])) {
1218
+ require_once(WPMETASEO_PLUGIN_DIR . 'inc/divi-seo/divi.php');
1219
+ new Divi;
1220
+ }
1221
+ },
1222
+ 11
1223
+ );