WP Meta SEO - Version 3.5.0

Version Description

  • Fix : Check content of page builders: Visual composer, DIVI Builder, Beaver Builder, ACF, Site Origine, Themify builder, Live composer, Elementor plugins
  • Add : Generate rich snippet breadcrumb shortcode and PHP code
  • Fix : Redesign the image edition window
Download this release

Release Info

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

Code changes from version 3.4.1 to 3.5.0

css/metaseo_admin.css CHANGED
@@ -586,7 +586,7 @@ strong {
586
  .metaseo-img-lb{
587
  float:left;
588
  width: 70px;
589
- line-height: 25px;
590
  }
591
 
592
  #jutranslation{
@@ -677,4 +677,12 @@ span.wpms-seoImgRemove{
677
  .image_scan_meta{
678
  width: 100% !important;
679
  margin-left: 0 !important;
 
 
 
 
 
 
 
 
680
  }
586
  .metaseo-img-lb{
587
  float:left;
588
  width: 70px;
589
+ line-height: 30px;
590
  }
591
 
592
  #jutranslation{
677
  .image_scan_meta{
678
  width: 100% !important;
679
  margin-left: 0 !important;
680
+ }
681
+
682
+ .tr_home_text.show{
683
+ display: table-row;
684
+ }
685
+
686
+ .tr_home_text.hide{
687
+ display: none;
688
  }
css/style.css CHANGED
@@ -109,6 +109,14 @@ td.metaseo-action{
109
  clear:left;
110
  padding:5px;
111
  }
 
 
 
 
 
 
 
 
112
  .metaseo-img-wrapper div.dimension{
113
  display:inline-block;padding:5px;
114
  font-size:12px;color:#555;
@@ -148,15 +156,8 @@ table.metaseo_images td input{
148
  max-width:100%;
149
  }
150
 
151
- a.button.meta-default{
152
  float: left;
153
- border: #CCC 1px solid;
154
- color: #018601;
155
- width: 70px;
156
- font-weight: bold;
157
- text-align: center;
158
- padding-top: 4px;
159
- line-height: 16px;
160
  }
161
 
162
  a.button.meta-default img {
109
  clear:left;
110
  padding:5px;
111
  }
112
+
113
+ .metaseo-img-wrapper .metaseo-fix-meta{
114
+ height: 30px;
115
+ }
116
+
117
+ .metaseo-img-wrapper .spinner{
118
+ float: left;
119
+ }
120
  .metaseo-img-wrapper div.dimension{
121
  display:inline-block;padding:5px;
122
  font-size:12px;color:#555;
156
  max-width:100%;
157
  }
158
 
159
+ .meta-default{
160
  float: left;
 
 
 
 
 
 
 
161
  }
162
 
163
  a.button.meta-default img {
inc/breadcrumb/class.metaseo-breadcrumb.php ADDED
@@ -0,0 +1,514 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MetaSeo_Breadcrumb
4
+ {
5
+ public $breadcrumbs = array();
6
+ public $breadcrumb_settings = array();
7
+ public $template_no_anchor;
8
+
9
+ function __construct()
10
+ {
11
+ $home_title = get_the_title( get_option('page_on_front') );
12
+ if(empty($home_title)) $home_title = get_bloginfo('title');
13
+ $this->breadcrumb_settings = array(
14
+ 'separator' => ' &gt; ',
15
+ 'include_home' => 1,
16
+ 'home_text_default' => 0,
17
+ 'home_text' => $home_title,
18
+ 'clickable' => 1,
19
+ 'apost_post_root' => get_option('page_for_posts'),
20
+ 'apost_page_root' => get_option('page_on_front')
21
+ );
22
+ $breadcrumb_settings = get_option('_metaseo_breadcrumbs');
23
+ if (is_array($breadcrumb_settings)) {
24
+ $this->breadcrumb_settings = array_merge($this->breadcrumb_settings, $breadcrumb_settings);
25
+ }
26
+ }
27
+
28
+ public function wpms_check_posts()
29
+ {
30
+ global $wp_query;
31
+ //For the front page, as it may also validate as a page, do it first
32
+ if (is_front_page()) {
33
+ global $current_site;
34
+ $site_name = get_option('blogname');
35
+ $this->wpms_add_breadcrumb($site_name, WPMSEO_TEMPLATE_BREADCRUMB, array('home', 'current-item'));
36
+ if (!is_main_site()) {
37
+ $site_name = get_site_option('site_name');
38
+ $template = __('<span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Go to %title%." href="%link%" class="%type%"><span property="name">%htitle%</span></a><meta property="position" content="%position%"></span>', 'wp-meta-seo');
39
+ $this->wpms_add_breadcrumb($site_name, $template, array('main-home'), get_home_url($current_site->blog_id));
40
+ }
41
+ } else if (is_singular()) {
42
+
43
+ if (is_attachment()) {
44
+ // attachments
45
+ $this->wpms_attachment();
46
+ } else {
47
+ // other post types
48
+ $this->wpms_post(get_post());
49
+ }
50
+ } else if (is_search()) {
51
+ $this->wpms_search();
52
+ } else if (is_author()) {
53
+ $this->wpms_author();
54
+ } else if (is_archive()) {
55
+ $type = $wp_query->get_queried_object();
56
+ $type_str = get_query_var('post_type');
57
+ if (is_array($type_str)) {
58
+ $type_str = reset($type_str);
59
+ }
60
+ //For date based archives
61
+ if (is_date()) {
62
+ $this->wpms_archive_by_date($this->wpms_get_type());
63
+ } else if (is_post_type_archive() && !isset($type->taxonomy) && (!is_numeric($this->breadcrumb_settings['apost_' . $type_str . '_root']))) {
64
+ $this->wpms_archive_by_post_type();
65
+ } else if (is_category() || is_tag() || is_tax()) {
66
+ $this->wpms_archive_by_term();
67
+ }
68
+ } else if (is_404()) {
69
+ $this->wpms_add_breadcrumb('404', WPMSEO_TEMPLATE_BREADCRUMB, array('404', 'current-item'));
70
+ } else {
71
+ $type = $wp_query->get_queried_object();
72
+ if (isset($type->taxonomy)) {
73
+ $this->wpms_archive_by_term();
74
+ }
75
+ }
76
+ // home
77
+ if (!is_front_page()) {
78
+ if(!empty($this->breadcrumb_settings['include_home'])){
79
+ $this->wpms_home();
80
+ }
81
+ }
82
+ }
83
+
84
+ public function wpms_breadcrumb_display($return = false, $reverse = false)
85
+ {
86
+ // order breadcrumb
87
+ if ($reverse) {
88
+ ksort($this->breadcrumbs);
89
+ } else {
90
+ krsort($this->breadcrumbs);
91
+ }
92
+
93
+ $html = '';
94
+ $position = 1;
95
+ //The main compiling loop
96
+ foreach ($this->breadcrumbs as $key => $breadcrumb) {
97
+ // for reverse has true
98
+ if ($reverse) {
99
+ if ($key > 0) {
100
+ $html .= $this->breadcrumb_settings['separator'];
101
+ }
102
+ } else {
103
+ if ($position > 1) {
104
+ $html .= $this->breadcrumb_settings['separator'];
105
+ }
106
+ }
107
+
108
+ $html .= $this->wpms_breadcrumb_createhtml($breadcrumb,$position);
109
+ $position++;
110
+ }
111
+
112
+ if ($return) {
113
+ return $html; // for return has true
114
+ } else {
115
+ echo $html; // for return has false
116
+ }
117
+ }
118
+
119
+ /**
120
+ * create html string
121
+ */
122
+ public function wpms_breadcrumb_createhtml($breadcrumb, $position)
123
+ {
124
+ $params = array(
125
+ '%title%' => esc_attr(strip_tags($breadcrumb['name'])),
126
+ '%link%' => esc_url($breadcrumb['url']),
127
+ '%htitle%' => $breadcrumb['name'],
128
+ '%type%' => $breadcrumb['type'],
129
+ '%ftitle%' => esc_attr(strip_tags($breadcrumb['name'])),
130
+ '%fhtitle%' => $breadcrumb['name'],
131
+ '%position%' => $position
132
+ );
133
+ //The type may be an array, implode it if that is the case
134
+ if (is_array($params['%type%'])) {
135
+ $params['%type%'] = implode(' ', $params['%type%']);
136
+ }
137
+
138
+ if(empty($this->breadcrumb_settings['clickable'])){
139
+ return str_replace(array_keys($params), $params, $this->template_no_anchor);
140
+ }else{
141
+ if ($breadcrumb['click']) {
142
+ //Return template
143
+ return str_replace(array_keys($params), $params, $breadcrumb['template']);
144
+ } else {
145
+ //Return template
146
+ return str_replace(array_keys($params), $params, $this->template_no_anchor);
147
+ }
148
+ }
149
+
150
+
151
+ }
152
+
153
+ /**
154
+ * breadcrumb for front page
155
+ */
156
+ public function wpms_front_page()
157
+ {
158
+ global $current_site;
159
+ $site_name = get_option('blogname');
160
+ $this->wpms_add_breadcrumb($site_name, WPMSEO_TEMPLATE_BREADCRUMB, array('home', 'current-item'));
161
+ if (!is_main_site()) {
162
+ $site_name = get_site_option('site_name');
163
+ // Add to breadcrumbs list
164
+ $template = __('<span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Go to %title%." href="%link%" class="%type%"><span property="name">%htitle%</span></a><meta property="position" content="%position%"></span>', 'wp-meta-seo');
165
+ $this->wpms_add_breadcrumb($site_name, $template, array('main-home'), get_home_url($current_site->blog_id));
166
+ }
167
+ }
168
+
169
+ /**
170
+ * breadcrumb for posts
171
+ */
172
+ public function wpms_post($post)
173
+ {
174
+ if (!($post instanceof WP_Post)) {
175
+ return;
176
+ }
177
+
178
+ $arrays = array(
179
+ 'name' => get_the_title($post),
180
+ 'template' => WPMSEO_TEMPLATE_BREADCRUMB,
181
+ 'type' => array('post', 'post-' . $post->post_type, 'current-item'),
182
+ 'url' => NULL,
183
+ 'id' => $post->ID,
184
+ 'click' => false
185
+ );
186
+
187
+ if (is_attachment()) {
188
+ $template = __('<span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Go to %title%." href="%link%" class="%type%"><span property="name">%htitle%</span></a><meta property="position" content="%position%"></span>', 'wp-meta-seo');
189
+ $arrays['template'] = $template;
190
+ $arrays['url'] = get_permalink($post);
191
+ $arrays['click'] = true;
192
+ }
193
+ $this->breadcrumbs[] = $arrays;
194
+ if ($post->post_type === 'page') {
195
+ $frontpage = get_option('page_on_front');
196
+ if ($post->post_parent && $post->ID != $post->post_parent && $frontpage != $post->post_parent) {
197
+
198
+ $this->wpms_post_parents($post->post_parent, $frontpage);
199
+ }
200
+ } else {
201
+ $this->wpms_post_hierarchy($post->ID);
202
+ }
203
+ }
204
+
205
+ /*
206
+ * find breadcrumb of parent
207
+ */
208
+ public function wpms_post_parents($id, $frontpage)
209
+ {
210
+ $parent = get_post($id);
211
+ // Add to breadcrumbs list
212
+ $template = __('<span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Go to %title%." href="%link%" class="%type%"><span property="name">%htitle%</span></a><meta property="position" content="%position%"></span>', 'wp-meta-seo');
213
+ $this->wpms_add_breadcrumb(get_the_title($id), $template, array('post', 'post-' . $parent->post_type), get_permalink($id), $id);
214
+ if($parent->post_parent >= 0 && $parent->post_parent != false && $id != $parent->post_parent && $frontpage != $parent->post_parent)
215
+ {
216
+ //If valid call this function
217
+ $parent = $this->wpms_post_parents($parent->post_parent, $frontpage);
218
+ }
219
+ return $parent;
220
+ }
221
+
222
+ /**
223
+ * breadcrumb for an attachment page.
224
+ */
225
+ public function wpms_attachment()
226
+ {
227
+ $post = get_post();
228
+ // Add to breadcrumbs list
229
+ $this->wpms_add_breadcrumb(get_the_title(), WPMSEO_TEMPLATE_BREADCRUMB, array('post', 'post-attachment', 'current-item'), NULL, $post->ID);
230
+ //Done with the current item, now on to the parents
231
+ $frontpage = get_option('page_on_front');
232
+ if ($post->post_parent >= 0 && $post->post_parent != false && $post->ID != $post->post_parent && $frontpage != $post->post_parent) {
233
+ $parent = get_post($post->post_parent);
234
+ //set the parent's breadcrumb
235
+ $this->wpms_post($parent);
236
+ }
237
+ }
238
+
239
+ /**
240
+ * breadcrumb for search
241
+ */
242
+ public function wpms_search()
243
+ {
244
+ $template = __('<span property="itemListElement" typeof="ListItem"><span property="name">Search results for &#39;%htitle%&#39;</span><meta property="position" content="%position%"></span>', 'wp-meta-seo');
245
+ $this->wpms_add_breadcrumb(get_search_query(), $template, array('search', 'current-item'));
246
+ }
247
+
248
+ /**
249
+ * breadcrumb for author
250
+ */
251
+ public function wpms_author()
252
+ {
253
+ if (get_query_var('author_name')) {
254
+ $author = get_user_by('slug', get_query_var('author_name'));
255
+ } else {
256
+ $author = get_userdata(get_query_var('author'));
257
+ }
258
+ // array author_name values
259
+ $author_name = array('display_name', 'nickname', 'first_name', 'last_name');
260
+ if (in_array('display_name', $author_name)) {
261
+ // Add to breadcrumbs list
262
+ $template = __('<span property="itemListElement" typeof="ListItem"><span property="name">Articles by: %htitle%</span><meta property="position" content="%position%"></span>', 'wp-meta-seo');
263
+ $this->wpms_add_breadcrumb(get_the_author_meta('display_name', $author->ID), $template, array('author', 'current-item'), NULL, $author->ID);
264
+ }
265
+ }
266
+
267
+ /**
268
+ * breadcrumb for an archive by post_type.
269
+ */
270
+ public function wpms_archive_by_post_type()
271
+ {
272
+ $type = $this->wpms_get_type();
273
+ // Add to breadcrumbs list
274
+ $this->wpms_add_breadcrumb(post_type_archive_title('', false), WPMSEO_TEMPLATE_BREADCRUMB, array('archive', 'post-' . $type . '-archive', 'current-item'));
275
+ }
276
+
277
+ /**
278
+ * breadcrumb for date
279
+ */
280
+ public function wpms_archive_by_date($type)
281
+ {
282
+ global $wp_query;
283
+ $date_template = __('<span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Go to the %title% archives." href="%link%" class="%type%"><span property="name">%htitle%</span></a><meta property="position" content="%position%"></span>', 'wp-meta-seo');
284
+ if (is_day() || is_single()) {
285
+ $arrays = array(
286
+ 'name' => get_the_time(_x('d', 'day archive breadcrumb date format', 'wp-meta-seo')),
287
+ 'template' => WPMSEO_TEMPLATE_BREADCRUMB,
288
+ 'type' => array('archive', 'date-day'),
289
+ );
290
+
291
+ if (is_day()) {
292
+ $arrays['type'] = 'current-item';
293
+ $arrays['url'] = NULL;
294
+ $arrays['click'] = false;
295
+ }
296
+ // if is single
297
+ if (is_single()) {
298
+ $arrays['template'] = $date_template;
299
+ $url = get_day_link(get_the_time('Y'), get_the_time('m'), get_the_time('d'));
300
+ $url = $this->wpms_add_post_type_arg($url, $type);
301
+ $arrays['url'] = $url;
302
+ $arrays['click'] = true;
303
+ }
304
+
305
+ $this->breadcrumbs[] = $arrays;
306
+ }
307
+
308
+ //Now deal with the month breadcrumb
309
+ if (is_month() || is_day() || is_single()) {
310
+ $arrays = array(
311
+ 'name' => get_the_time(_x('F', 'month archive breadcrumb date format', 'wp-meta-seo')),
312
+ 'template' => WPMSEO_TEMPLATE_BREADCRUMB,
313
+ 'type' => array('archive', 'date-month'),
314
+ );
315
+
316
+ if (is_month()) {
317
+ $arrays['type'] = 'current-item';
318
+ $arrays['url'] = NULL;
319
+ $arrays['click'] = false;
320
+ }
321
+
322
+ if (is_day() || is_single()) {
323
+ $arrays['template'] = $date_template;
324
+ $url = get_month_link(get_the_time('Y'), get_the_time('m'));
325
+ $url = $this->wpms_add_post_type_arg($url, $type);
326
+ $arrays['url'] = $url;
327
+ $arrays['click'] = true;
328
+ }
329
+
330
+ $this->breadcrumbs[] = $arrays;
331
+ }
332
+
333
+
334
+ $arrays = array(
335
+ 'name' => get_the_time(_x('Y', 'year archive breadcrumb date format', 'wp-meta-seo')),
336
+ 'template' => WPMSEO_TEMPLATE_BREADCRUMB,
337
+ 'type' => array('archive', 'date-year'),
338
+ );
339
+
340
+ //If this is a year archive, add current-item type
341
+ if (is_year()) {
342
+ $arrays['type'] = 'current-item';
343
+ $arrays['url'] = NULL;
344
+ $arrays['click'] = false;
345
+ }
346
+ // day or month or single
347
+ if (is_day() || is_month() || is_single()) {
348
+ //We're linking, so set the linked template
349
+ $arrays['template'] = $date_template;
350
+ $url = get_year_link(get_the_time('Y'));
351
+ $url = $this->wpms_add_post_type_arg($url, $type);
352
+ $arrays['url'] = $url;
353
+ $arrays['click'] = true;
354
+ }
355
+
356
+ $this->breadcrumbs[] = $arrays;
357
+ }
358
+
359
+ public function wpms_archive_by_term()
360
+ {
361
+ global $wp_query;
362
+ $term = $wp_query->get_queried_object();
363
+ // Add to breadcrumbs list
364
+ $template = __('<span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Go to the %title% category archives." href="%link%" class="%type%"><span property="name">%htitle%</span></a><meta property="position" content="%position%"></span>', 'wp-meta-seo');
365
+ $this->wpms_add_breadcrumb($term->name, $template, array('archive', 'taxonomy', $term->taxonomy, 'current-item'), NULL, $term->term_id);
366
+ //Get parents of current term
367
+ if ($term->parent) {
368
+ $this->term_parents($term->parent, $term->taxonomy);
369
+ }
370
+ }
371
+
372
+ public function term_parents($id, $taxonomy)
373
+ {
374
+ //Get the current category
375
+ $term = get_term($id, $taxonomy);
376
+ // Add to breadcrumbs list
377
+ $template = __('<span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Go to the %title% category archives." href="%link%" class="%type%"><span property="name">%htitle%</span></a><meta property="position" content="%position%"></span>', 'wp-meta-seo');
378
+ $this->wpms_add_breadcrumb($term->name, $template, array('taxonomy', $taxonomy), $this->wpms_add_post_type_arg(get_term_link($term), NULL, $taxonomy), $id);
379
+ if ($term->parent && $term->parent != $id) {
380
+ $term = $this->term_parents($term->parent, $taxonomy);
381
+ }
382
+ return $term;
383
+ }
384
+
385
+ /*
386
+ * add a enlement to lists
387
+ */
388
+ public function wpms_add_breadcrumb($name = '', $template = '', array $type = array(), $url = '', $id = NULL , $click = true)
389
+ {
390
+ $allowed_html = wp_kses_allowed_html('post');
391
+ $tmp = __('<span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Go to %title%." href="%link%" class="%type%"><span property="name">%htitle%</span></a><meta property="position" content="%position%"></span>', 'wp-meta-seo');
392
+ $this->template_no_anchor = WPMSEO_TEMPLATE_BREADCRUMB;
393
+ if ($template == NULL) {
394
+ $template = wp_kses($tmp,$allowed_html);
395
+ } else {
396
+ //Loose comparison, evaluates to true if URL is '' or NULL
397
+ if ($url == NULL) {
398
+ $this->template_no_anchor = wp_kses($template, $allowed_html);
399
+ $template = wp_kses($tmp,$allowed_html);
400
+ } else {
401
+ $template = wp_kses($template,$allowed_html);
402
+ }
403
+ }
404
+
405
+ // check click or not
406
+ if(empty($this->breadcrumb_settings['clickable'])){
407
+ $click = false;
408
+ }else{
409
+ if ($url == NULL) {
410
+ $click = false;
411
+ } else {
412
+ $click = true;
413
+ }
414
+ }
415
+
416
+ // add to array
417
+ $this->breadcrumbs[] = array(
418
+ 'name' => $name,
419
+ 'template' => $template,
420
+ 'type' => $type,
421
+ 'url' => $url,
422
+ 'id' => $id,
423
+ 'click' => $click
424
+ );
425
+ }
426
+
427
+ public function wpms_post_hierarchy($id)
428
+ {
429
+ $taxonomy = 'category';
430
+ if (is_taxonomy_hierarchical($taxonomy)) {
431
+ // Get all term of object
432
+ $wpms_object = get_the_terms($id, $taxonomy);
433
+ $potential_parent = 0;
434
+ $term = false;
435
+ // check array
436
+ if (is_array($wpms_object)) {
437
+ $wpms_use_term = key($wpms_object);
438
+ foreach ($wpms_object as $key => $object) {
439
+ if ($object->parent > 0 && ($potential_parent === 0 || $object->parent === $potential_parent)) {
440
+ $wpms_use_term = $key;
441
+ $potential_parent = $object->term_id;
442
+ }
443
+ }
444
+ $term = $wpms_object[$wpms_use_term];
445
+ }
446
+
447
+ if ($term instanceof WP_Term) {
448
+ //Fill out the term hiearchy
449
+ $parent = $this->term_parents($term->term_id, $taxonomy);
450
+ }
451
+ } else {
452
+ $this->post_terms($id, $taxonomy);
453
+ }
454
+ }
455
+
456
+ /**
457
+ * Add post type argument to the URL
458
+ */
459
+ public function wpms_add_post_type_arg($url, $type = NULL, $taxonomy = NULL)
460
+ {
461
+ global $wp_taxonomies;
462
+ if ($type == NULL) {
463
+ $type = $this->wpms_get_type();
464
+ }
465
+
466
+ // add post_type to url
467
+ $query_arg = (!($taxonomy && $type === $wp_taxonomies[$taxonomy]->object_type[0]) && $type !== 'post');
468
+ if ($query_arg) {
469
+ $url = add_query_arg(array('post_type' => $type), $url);
470
+ }
471
+ return $url;
472
+ }
473
+
474
+ /**
475
+ * get post type
476
+ */
477
+ public function wpms_get_type($default = 'post')
478
+ {
479
+ $type = get_query_var('post_type', $default);
480
+ if ($type === '' || is_array($type)) {
481
+ $post = get_post();
482
+ if ($post instanceof WP_Post) {
483
+ $type = $post->post_type;
484
+ } else {
485
+ $type = $default;
486
+ }
487
+ }
488
+ return esc_attr($type);
489
+ }
490
+
491
+ /**
492
+ * breadcrumb for the home page.
493
+ */
494
+ public function wpms_home()
495
+ {
496
+ global $current_site;
497
+ //Get the site name
498
+ $site_name = get_option('blogname');
499
+ $template = __('<span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Go to %title%." href="%link%" class="%type%"><span property="name">%htitle%</span></a><meta property="position" content="%position%"></span>', 'wp-meta-seo');
500
+
501
+ if(!empty($this->breadcrumb_settings['home_text_default'])){
502
+ $title = $this->breadcrumb_settings['home_text'];
503
+ }else{
504
+ $title = $site_name;
505
+ }
506
+ $this->wpms_add_breadcrumb($title, $template, array('home'), get_home_url());
507
+ if (!is_main_site()) {
508
+ //Get the site name
509
+ $site_name = get_site_option('site_name');
510
+ // Add to breadcrumbs list
511
+ $this->wpms_add_breadcrumb($site_name, $template, array('main-home'), get_home_url($current_site->blog_id));
512
+ }
513
+ }
514
+ }
inc/class.image-helper.php CHANGED
@@ -356,9 +356,11 @@ class ImageHelper {
356
  $list_thum_url = array();
357
  $imageUrl = wp_get_attachment_url($idPost);
358
  $list_thum_url[] = $imageUrl;
359
- foreach ($sizes as $key => $size){
360
- $thum_url = wp_get_attachment_image_src($idPost,$key);
361
- $list_thum_url[] = $thum_url[0];
 
 
362
  }
363
 
364
  $msg = array();
@@ -441,7 +443,7 @@ class ImageHelper {
441
  }
442
 
443
  $msg[$iID]['imNotGood']['warning'] = true;
444
- $msg[$iID]['imNotGood']['button'] = '<a href="javascript:void(0);" class=" fix-metas wpmsbtn wpmsbtn_small" data-img-name="' . $_imgs[$iID] . '" data-post-id="' . $iID . '" data-opt-key="fix_metas" onclick="showPostsList(this)">' . __('Fix info in content', 'wp-meta-seo') . '<span class="spinner-light"></span></a>';
445
 
446
 
447
  update_post_meta($iID, '_metaseo_fix_metas_counter', count($post_group));
@@ -450,7 +452,7 @@ class ImageHelper {
450
 
451
  if ($results['imNotGoodTotal'][$iID]['alt'] == 0 && $results['imNotGoodTotal'][$iID]['title'] == 0) {
452
  if ($results['iNotGoodTotal'][$iID] != -1) {
453
- $msg[$iID]['imNotGood']['button'] = '<a href="javascript:void(0);" class=" fix-metas wpmsbtn wpmsbtn_small wpmsbtn_secondary" data-img-name="' . $_imgs[$iID] . '" data-post-id="' . $iID . '" data-opt-key="fix_metas" onclick="showPostsList(this)">' . __('Edit information', 'wp-meta-seo') . '<span class="spinner-light"></span></a>';
454
  } else {
455
  $msg[$iID]['imNotGood']['button'] = '';
456
  }
356
  $list_thum_url = array();
357
  $imageUrl = wp_get_attachment_url($idPost);
358
  $list_thum_url[] = $imageUrl;
359
+ if(!empty($sizes)){
360
+ foreach ($sizes as $key => $size){
361
+ $thum_url = wp_get_attachment_image_src($idPost,$key);
362
+ $list_thum_url[] = $thum_url[0];
363
+ }
364
  }
365
 
366
  $msg = array();
443
  }
444
 
445
  $msg[$iID]['imNotGood']['warning'] = true;
446
+ $msg[$iID]['imNotGood']['button'] = '<a href="javascript:void(0);" class=" fix-metas wpmsbtn wpmsbtn_small" data-img-name="' . $_imgs[$iID] . '" data-post-id="' . $iID . '" data-opt-key="fix_metas" onclick="showPostsList(this)" alt="'.__('This image has been detected in your content, edit information here…','wp-meta-seo').'">' . __('Edit meta in content', 'wp-meta-seo') . '<span class="spinner-light"></span></a>';
447
 
448
 
449
  update_post_meta($iID, '_metaseo_fix_metas_counter', count($post_group));
452
 
453
  if ($results['imNotGoodTotal'][$iID]['alt'] == 0 && $results['imNotGoodTotal'][$iID]['title'] == 0) {
454
  if ($results['iNotGoodTotal'][$iID] != -1) {
455
+ $msg[$iID]['imNotGood']['button'] = '<a href="javascript:void(0);" class=" fix-metas wpmsbtn wpmsbtn_small wpmsbtn_secondary" data-img-name="' . $_imgs[$iID] . '" data-post-id="' . $iID . '" data-opt-key="fix_metas" onclick="showPostsList(this)" alt="'.__('This image has been detected in your content, edit information here…','wp-meta-seo').'">' . __('Edit meta', 'wp-meta-seo') . '<span class="spinner-light"></span></a>';
456
  } else {
457
  $msg[$iID]['imNotGood']['button'] = '';
458
  }
inc/class.metaseo-admin.php CHANGED
@@ -358,6 +358,9 @@ class MetaSeo_Admin {
358
  * Update option wpms_set_ignore
359
  */
360
  function wpms_set_ignore() {
 
 
 
361
  update_option('wpms_set_ignore', 0);
362
  wp_send_json(true);
363
  }
@@ -415,6 +418,9 @@ class MetaSeo_Admin {
415
  * Ajax load page analysis
416
  */
417
  function metaseo_reload_analysis() {
 
 
 
418
  $tooltip_page = array();
419
  $tooltip_page['title_in_heading'] = __('Check if a word of this content title is also in a title heading (h1, h2...)', 'wp-meta-seo');
420
  $tooltip_page['title_in_content'] = __('Check if a word of this content title is also in the text', 'wp-meta-seo');
@@ -441,7 +447,8 @@ class MetaSeo_Admin {
441
  } else {
442
  $dom = new DOMDocument;
443
  libxml_use_internal_errors(true);
444
- if ($dom->loadHTML('<div>' . html_entity_decode(stripcslashes($_POST['datas']['content'])) . '</div>')) {
 
445
  // Extracting the specified elements from the web page
446
  $tags_h1 = $dom->getElementsByTagName('h1');
447
  $tags_h2 = $dom->getElementsByTagName('h2');
@@ -551,8 +558,9 @@ class MetaSeo_Admin {
551
  }
552
 
553
  // title content
 
554
  $words_title = preg_split('/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/', strtolower($_POST['datas']['title']), -1, PREG_SPLIT_NO_EMPTY);
555
- $words_post_content = preg_split('/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/', strtolower(strip_tags($_POST['datas']['content'])), -1, PREG_SPLIT_NO_EMPTY);
556
 
557
  $test1 = false;
558
  if (is_array($words_title) && is_array($words_post_content)) {
@@ -606,7 +614,8 @@ class MetaSeo_Admin {
606
  } else {
607
  $dom = new DOMDocument;
608
  libxml_use_internal_errors(true);
609
- if ($dom->loadHTML('<div>' . html_entity_decode(stripcslashes($_POST['datas']['content'])) . '</div>')) {
 
610
  // Extracting the specified elements from the web page
611
  $tags = $dom->getElementsByTagName('img');
612
  $img_wrong = false;
@@ -657,6 +666,9 @@ class MetaSeo_Admin {
657
  * validate propertyin page optimization
658
  */
659
  function metaseo_validate_analysis() {
 
 
 
660
  $post_id = $_POST['post_id'];
661
  $key = 'wpms_validate_analysis';
662
  $analysis = get_post_meta($post_id, $key, true);
@@ -673,6 +685,9 @@ class MetaSeo_Admin {
673
  * Ajax update link meta title and content editor
674
  */
675
  function metaseo_update_link() {
 
 
 
676
  if (isset($_POST['link_id'])) {
677
  global $wpdb;
678
  $sql = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "wpms_links WHERE id=%d", array($_POST['link_id']));
@@ -706,6 +721,9 @@ class MetaSeo_Admin {
706
  * Ajax update meta index for page
707
  */
708
  function metaseo_update_pageindex() {
 
 
 
709
  if (isset($_POST['page_id']) && isset($_POST['index'])) {
710
  update_post_meta($_POST['page_id'], '_metaseo_metaindex', $_POST['index']);
711
  wp_send_json(array('status' => true));
@@ -717,6 +735,9 @@ class MetaSeo_Admin {
717
  * Ajax update meta follow for page
718
  */
719
  function metaseo_update_pagefollow() {
 
 
 
720
  if (isset($_POST['page_id']) && isset($_POST['follow'])) {
721
  update_post_meta($_POST['page_id'], '_metaseo_metafollow', $_POST['follow']);
722
  wp_send_json(array('status' => true));
@@ -728,6 +749,9 @@ class MetaSeo_Admin {
728
  * Ajax update meta follow for link
729
  */
730
  function metaseo_update_follow() {
 
 
 
731
  if (isset($_POST['link_id'])) {
732
  $this->update_follow($_POST['link_id'], $_POST['follow']);
733
  wp_send_json(array('status' => true));
@@ -739,6 +763,9 @@ class MetaSeo_Admin {
739
  * Ajax update multitle meta follow for link
740
  */
741
  function metaseo_update_multiplefollow() {
 
 
 
742
  global $wpdb;
743
  $follow_value = $_POST['follow_value'];
744
  $limit = 20;
@@ -852,6 +879,10 @@ class MetaSeo_Admin {
852
  * Update option wpms_settings_404
853
  */
854
  function wpms_save_settings404() {
 
 
 
 
855
  if (isset($_POST['wpms_redirect'])) {
856
  update_option('wpms_settings_404', $_POST['wpms_redirect']);
857
 
@@ -875,6 +906,26 @@ class MetaSeo_Admin {
875
  wp_send_json(true);
876
  }
877
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
878
  /*
879
  * Add a new field to a section of a settings page
880
  */
@@ -1112,6 +1163,9 @@ class MetaSeo_Admin {
1112
  * Update meta title , meta description , meta keyword for content
1113
  */
1114
  function updateContentMeta_callback() {
 
 
 
1115
  global $wpdb;
1116
  $_POST = stripslashes_deep($_POST);
1117
  $response = new stdClass();
@@ -1720,6 +1774,31 @@ class MetaSeo_Admin {
1720
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/pages/metaseo-broken-link.php' );
1721
  break;
1722
  case 'metaseo_settings':
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1723
  // email settings
1724
  $email_settings = array(
1725
  "enable" => 0,
@@ -2024,6 +2103,7 @@ class MetaSeo_Admin {
2024
  add_action('wp_ajax_metaseo_validate_analysis', array($this, 'metaseo_validate_analysis'));
2025
  add_action('wp_ajax_metaseo_update_link', array($this, 'metaseo_update_link'));
2026
  add_action('wp_ajax_wpms_save_settings404', array($this, 'wpms_save_settings404'));
 
2027
  add_action('wp_ajax_wpms_update_link', array('MetaSeo_Broken_Link_Table', 'wpms_update_link'));
2028
  add_action('wp_ajax_wpms_add_custom_redirect', array('MetaSeo_Broken_Link_Table', 'wpms_add_custom_redirect'));
2029
  add_action('wp_ajax_wpms_unlink', array('MetaSeo_Broken_Link_Table', 'wpms_unlink'));
358
  * Update option wpms_set_ignore
359
  */
360
  function wpms_set_ignore() {
361
+ if (!current_user_can('manage_options')) {
362
+ wp_send_json(false);
363
+ }
364
  update_option('wpms_set_ignore', 0);
365
  wp_send_json(true);
366
  }
418
  * Ajax load page analysis
419
  */
420
  function metaseo_reload_analysis() {
421
+ if (!current_user_can('manage_options')) {
422
+ wp_send_json(array('status' => false));
423
+ }
424
  $tooltip_page = array();
425
  $tooltip_page['title_in_heading'] = __('Check if a word of this content title is also in a title heading (h1, h2...)', 'wp-meta-seo');
426
  $tooltip_page['title_in_content'] = __('Check if a word of this content title is also in the text', 'wp-meta-seo');
447
  } else {
448
  $dom = new DOMDocument;
449
  libxml_use_internal_errors(true);
450
+ $content = apply_filters('the_content', '<div>' . html_entity_decode(stripcslashes($_POST['datas']['content'])) . '</div>');
451
+ if ($dom->loadHTML($content)) {
452
  // Extracting the specified elements from the web page
453
  $tags_h1 = $dom->getElementsByTagName('h1');
454
  $tags_h2 = $dom->getElementsByTagName('h2');
558
  }
559
 
560
  // title content
561
+ $content = apply_filters('the_content', html_entity_decode(stripcslashes($_POST['datas']['content'])));
562
  $words_title = preg_split('/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/', strtolower($_POST['datas']['title']), -1, PREG_SPLIT_NO_EMPTY);
563
+ $words_post_content = preg_split('/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/', strtolower(strip_tags($content)), -1, PREG_SPLIT_NO_EMPTY);
564
 
565
  $test1 = false;
566
  if (is_array($words_title) && is_array($words_post_content)) {
614
  } else {
615
  $dom = new DOMDocument;
616
  libxml_use_internal_errors(true);
617
+ $content = apply_filters('the_content', html_entity_decode(stripcslashes($_POST['datas']['content'])));
618
+ if ($dom->loadHTML($content)) {
619
  // Extracting the specified elements from the web page
620
  $tags = $dom->getElementsByTagName('img');
621
  $img_wrong = false;
666
  * validate propertyin page optimization
667
  */
668
  function metaseo_validate_analysis() {
669
+ if (!current_user_can('manage_options')) {
670
+ wp_send_json(false);
671
+ }
672
  $post_id = $_POST['post_id'];
673
  $key = 'wpms_validate_analysis';
674
  $analysis = get_post_meta($post_id, $key, true);
685
  * Ajax update link meta title and content editor
686
  */
687
  function metaseo_update_link() {
688
+ if (!current_user_can('manage_options')) {
689
+ wp_send_json(false);
690
+ }
691
  if (isset($_POST['link_id'])) {
692
  global $wpdb;
693
  $sql = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "wpms_links WHERE id=%d", array($_POST['link_id']));
721
  * Ajax update meta index for page
722
  */
723
  function metaseo_update_pageindex() {
724
+ if (!current_user_can('manage_options')) {
725
+ wp_send_json(array('status' => false));
726
+ }
727
  if (isset($_POST['page_id']) && isset($_POST['index'])) {
728
  update_post_meta($_POST['page_id'], '_metaseo_metaindex', $_POST['index']);
729
  wp_send_json(array('status' => true));
735
  * Ajax update meta follow for page
736
  */
737
  function metaseo_update_pagefollow() {
738
+ if (!current_user_can('manage_options')) {
739
+ wp_send_json(array('status' => false));
740
+ }
741
  if (isset($_POST['page_id']) && isset($_POST['follow'])) {
742
  update_post_meta($_POST['page_id'], '_metaseo_metafollow', $_POST['follow']);
743
  wp_send_json(array('status' => true));
749
  * Ajax update meta follow for link
750
  */
751
  function metaseo_update_follow() {
752
+ if (!current_user_can('manage_options')) {
753
+ wp_send_json(array('status' => false));
754
+ }
755
  if (isset($_POST['link_id'])) {
756
  $this->update_follow($_POST['link_id'], $_POST['follow']);
757
  wp_send_json(array('status' => true));
763
  * Ajax update multitle meta follow for link
764
  */
765
  function metaseo_update_multiplefollow() {
766
+ if (!current_user_can('manage_options')) {
767
+ wp_send_json(array('status' => false));
768
+ }
769
  global $wpdb;
770
  $follow_value = $_POST['follow_value'];
771
  $limit = 20;
879
  * Update option wpms_settings_404
880
  */
881
  function wpms_save_settings404() {
882
+ if (!current_user_can('manage_options')) {
883
+ wp_send_json(false);
884
+ }
885
+
886
  if (isset($_POST['wpms_redirect'])) {
887
  update_option('wpms_settings_404', $_POST['wpms_redirect']);
888
 
906
  wp_send_json(true);
907
  }
908
 
909
+ /*
910
+ * Update breadcrumb settings
911
+ */
912
+ function wpms_save_settings_breadcrumb() {
913
+ if (!current_user_can('manage_options')) {
914
+ wp_send_json(false);
915
+ }
916
+
917
+ $params = array('separator','include_home','home_text','clickable','home_text_default');
918
+ $settinglink = array();
919
+ foreach ($params as $param){
920
+ if(isset($_POST[$param])){
921
+ $settinglink[$param] = $_POST[$param];
922
+ }
923
+ }
924
+
925
+ update_option('_metaseo_breadcrumbs',$settinglink);
926
+ wp_send_json(true);
927
+ }
928
+
929
  /*
930
  * Add a new field to a section of a settings page
931
  */
1163
  * Update meta title , meta description , meta keyword for content
1164
  */
1165
  function updateContentMeta_callback() {
1166
+ if (!current_user_can('manage_options')) {
1167
+ wp_send_json(array('status' => false));
1168
+ }
1169
  global $wpdb;
1170
  $_POST = stripslashes_deep($_POST);
1171
  $response = new stdClass();
1774
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/pages/metaseo-broken-link.php' );
1775
  break;
1776
  case 'metaseo_settings':
1777
+ $posts = get_posts(array('post_type' => 'page', 'posts_per_page' => -1, 'numberposts' => -1));
1778
+ $types_404 = array('none' => 'None', 'wp-meta-seo-page' => __('WP Meta SEO page', 'wp-meta-seo'), 'custom_page' => __('Custom page', 'wp-meta-seo'));
1779
+
1780
+ // get settings 404
1781
+ $defaul_settings_404 = array('wpms_redirect_homepage' => 0, 'wpms_type_404' => 'none', 'wpms_page_redirected' => 'none');
1782
+ $wpms_settings_404 = get_option('wpms_settings_404');
1783
+ if (is_array($wpms_settings_404)) {
1784
+ $defaul_settings_404 = array_merge($defaul_settings_404, $wpms_settings_404);
1785
+ }
1786
+
1787
+ // get settings breadcrumb
1788
+ $home_title = get_the_title( get_option('page_on_front') );
1789
+ if(empty($home_title)) $home_title = get_bloginfo('title');
1790
+ $breadcrumbs = array(
1791
+ 'separator' => ' &gt; ',
1792
+ 'include_home' => 1,
1793
+ 'home_text' => $home_title,
1794
+ 'home_text_default' => 0,
1795
+ 'clickable' => 1
1796
+ );
1797
+ $breadcrumb_settings = get_option('_metaseo_breadcrumbs');
1798
+ if (is_array($breadcrumb_settings)) {
1799
+ $breadcrumbs = array_merge($breadcrumbs, $breadcrumb_settings);
1800
+ }
1801
+
1802
  // email settings
1803
  $email_settings = array(
1804
  "enable" => 0,
2103
  add_action('wp_ajax_metaseo_validate_analysis', array($this, 'metaseo_validate_analysis'));
2104
  add_action('wp_ajax_metaseo_update_link', array($this, 'metaseo_update_link'));
2105
  add_action('wp_ajax_wpms_save_settings404', array($this, 'wpms_save_settings404'));
2106
+ add_action('wp_ajax_wpms_save_settings_breadcrumb', array($this, 'wpms_save_settings_breadcrumb'));
2107
  add_action('wp_ajax_wpms_update_link', array('MetaSeo_Broken_Link_Table', 'wpms_update_link'));
2108
  add_action('wp_ajax_wpms_add_custom_redirect', array('MetaSeo_Broken_Link_Table', 'wpms_add_custom_redirect'));
2109
  add_action('wp_ajax_wpms_unlink', array('MetaSeo_Broken_Link_Table', 'wpms_unlink'));
inc/class.metaseo-content-list-table.php CHANGED
@@ -425,7 +425,7 @@ class MetaSeo_Content_List_Table extends WP_List_Table {
425
 
426
  echo '<p id="snippet_desc' . $rec->ID . '" class="snippet_metades">' . $rec->metadesc . '</p></div>';
427
  echo '<img class="wpms_loader' . $rec->ID . ' wpms_content_loader" src=' . WPMETASEO_PLUGIN_URL . 'img/update_loading.gif>';
428
- echo '<span id="savedInfo' . $rec->ID . '" style="position: relative; display: block;float:right" class="saved-info metaseo-msg-success"><span style="position:absolute; float:right" class="meta-update"></span></span>';
429
  echo '</div></td>';
430
  break;
431
  case 'col_page_slug':
425
 
426
  echo '<p id="snippet_desc' . $rec->ID . '" class="snippet_metades">' . $rec->metadesc . '</p></div>';
427
  echo '<img class="wpms_loader' . $rec->ID . ' wpms_content_loader" src=' . WPMETASEO_PLUGIN_URL . 'img/update_loading.gif>';
428
+ echo '<span id="savedInfo' . $rec->ID . '" style="position: relative; display: block;float:right" class="saved-info metaseo-msg-success"><span style="position:absolute; float:right" class="spinner"></span></span>';
429
  echo '</div></td>';
430
  break;
431
  case 'col_page_slug':
inc/class.metaseo-image-list-table.php CHANGED
@@ -553,7 +553,7 @@ class MetaSeo_Image_List_Table extends WP_List_Table {
553
  $info .= '<p>' . $img_width . 'x' . $img_height . '</p>';
554
  $info .= '<p>' . $img_date . '</p>';
555
  $info .= '<span class="saved-info" style="position:relative">
556
- <span class="meta-update" style="position:absolute"></span>
557
  </span>';
558
  $info .= '</div>';
559
  echo sprintf('<td %2$s colspan="4">%1$s</td>', $info, $attributes);
@@ -578,7 +578,7 @@ class MetaSeo_Image_List_Table extends WP_List_Table {
578
  case 'col_image_alternative':
579
  $input = ("<textarea name='img_alternative[$rec->ID]' class='metaseo-img-meta' data-meta-type='alt_text' id='img-alt-$rec->ID' data-post-id='$rec->ID' rows='2'>" . esc_attr($rec->alt) . "</textarea>");
580
  $input .= ('<span class="saved-info" style="position:relative">
581
- <span class="meta-update" style="position:absolute"></span>
582
  </span>');
583
  echo sprintf('<td %2$s colspan="3">%1$s</td>', $input, $attributes);
584
  break;
@@ -586,7 +586,7 @@ class MetaSeo_Image_List_Table extends WP_List_Table {
586
  case 'col_image_title':
587
  $input = ("<textarea name='img_title[$rec->ID]' class='metaseo-img-meta' data-meta-type='image_title' id='img-title-$rec->ID' data-post-id='$rec->ID' rows='2'>" . esc_attr($rec->title) . "</textarea>");
588
  $input .= ('<span class="saved-info" style="position:relative">
589
- <span class="meta-update" style="position:absolute"></span>
590
  </span>');
591
  echo sprintf('<td %2$s colspan="3">%1$s</td>', $input, $attributes);
592
  break;
@@ -594,7 +594,7 @@ class MetaSeo_Image_List_Table extends WP_List_Table {
594
  case 'col_image_legend':
595
  $input = ("<textarea name='img_legend[$rec->ID]' class='metaseo-img-meta' data-meta-type='image_caption' id='img-legend-$rec->ID' data-post-id='$rec->ID' rows='2'>" . esc_attr($rec->legend) . "</textarea>");
596
  $input .= ('<span class="saved-info" style="position:relative">
597
- <span class="meta-update" style="position:absolute"></span>
598
  </span>');
599
  echo sprintf('<td %2$s colspan="3">%1$s</td>', $input, $attributes);
600
  break;
@@ -602,7 +602,7 @@ class MetaSeo_Image_List_Table extends WP_List_Table {
602
  case 'col_image_desc':
603
  $input = ("<textarea name='img_desc[$rec->ID]' class='metaseo-img-meta' data-meta-type='image_description' id='img-desc-$rec->ID' data-post-id='$rec->ID' rows='2'>" . esc_attr($rec->des) . "</textarea>");
604
  $input .= ('<span class="saved-info" style="position:relative">
605
- <span class="meta-update" style="position:absolute"></span>
606
  </span>');
607
  echo sprintf('<td %2$s colspan="3">%1$s</td>', $input, $attributes);
608
  break;
@@ -736,11 +736,11 @@ class MetaSeo_Image_List_Table extends WP_List_Table {
736
  <input type="text" value="<?php echo esc_attr($value) ?>" id="metaseo-img-<?php echo $type . '-' . $post['ID'] ?>" class="metaseo-fix-meta metaseo-img-<?php echo $type ?>" data-meta-key="_metaseo_fix_metas" data-post-id="<?php echo $post['ID'] ?>" data-img-post-id="<?php echo $img_post_id ?>" data-meta-type="<?php echo $type ?>" data-meta-order="<?php echo $k ?>" data-file-name="<?php echo $file_name; ?>" placeholder="<?php echo ($value == '' ? __(ucfirst($type) . ' is empty', 'wp-meta-seo') : '') ?>" onfocus="metaseo_fix_meta(this);" onblur="updateInputBlur(this)" onkeydown="return checkeyCode(event, this)" />
737
  </div>
738
 
739
- <span class="meta-update"></span>
740
  <?php if (trim($$type) != '' && trim($$type) != $value): ?>
741
- <a class="button meta-default" href="#" data-default-value="<?php echo esc_attr($$type) ?>" title="Add to input box" onclick="add_meta_default(this)"> <?php echo '<img src= "' . WPMETASEO_PLUGIN_URL . 'img/img-arrow.png" />' ?> Copy </a>
742
  <span class="img_seo_type"><?php echo $$type; ?></span>
743
  <?php endif ?>
 
744
  </div>
745
  <?php endforeach ?>
746
  <span class="saved-info"></span>
@@ -762,7 +762,7 @@ class MetaSeo_Image_List_Table extends WP_List_Table {
762
  */
763
  private static function display_resize_image_list($img_post_id, $posts, $img_counter, $p, $im) {
764
 
765
- $header = sprintf(__('We found %s which needed to optimize', 'wp-meta-seo'), $img_counter . $im . $p);
766
  ?>
767
  <h3 class="content-header"><?php echo $header ?></h3>
768
  <div class="content-box">
@@ -792,7 +792,11 @@ class MetaSeo_Image_List_Table extends WP_List_Table {
792
  <div class="metaseo-img">
793
  <img width="<?php echo @$src['width']; ?>" height="<?php #echo @$src['height'] ; ?>" src="<?php echo $src['src'] ?>" />
794
  <div class="img-choosen">
795
- <input type="checkbox" checked="true" class="metaseo-checkin checkin-<?php echo $post['ID'] ?>" value="<?php echo $key ?>" id="checkin-<?php echo $post['ID'] . '-' . $key ?>" onclick="uncheck(this)" />
 
 
 
 
796
  </div>
797
  <p class="metaseo-msg"></p>
798
  </div>
@@ -805,7 +809,7 @@ class MetaSeo_Image_List_Table extends WP_List_Table {
805
  <?php endforeach ?>
806
  </td>
807
  <td colspan="2" class="metaseo-action">
808
- <a href="javascript:void(0);" class="metaseo-optimize button" data-img-post-id="<?php echo $img_post_id ?>" data-post-id="<?php echo $post['ID'] ?>" onclick="optimize_imgs(this)"><?php echo __('Replace?', 'wp-meta-seo') ?></a>
809
  <span class="optimizing spinner"></span>
810
  </td>
811
  <td colspan="4">
@@ -828,7 +832,7 @@ class MetaSeo_Image_List_Table extends WP_List_Table {
828
  <tr class="metaseo-border-top">
829
  <td colspan="8"></td>
830
  <td colspan="2">
831
- <a href="javascript:void(0);" id="metaseo-replace-all" class="button button-primary" onclick="optimize_imgs_group(this)">
832
  <?php echo __('Replace All', 'wp-meta-seo') ?>
833
  </a>
834
  <span class="optimizing spinner"></span>
@@ -1696,11 +1700,13 @@ class MetaSeo_Image_List_Table extends WP_List_Table {
1696
  if ( $query->have_posts() ) {
1697
  foreach ( $query->posts as $post_id ) {
1698
  $meta = wp_get_attachment_metadata( $post_id );
1699
- $original_file = basename( $meta['file'] );
1700
- $cropped_image_files = wp_list_pluck( $meta['sizes'], 'file' );
1701
- if ( $original_file === $file || in_array( $file, $cropped_image_files ) ) {
1702
- $attachment_id = $post_id;
1703
- break;
 
 
1704
  }
1705
  }
1706
  }
553
  $info .= '<p>' . $img_width . 'x' . $img_height . '</p>';
554
  $info .= '<p>' . $img_date . '</p>';
555
  $info .= '<span class="saved-info" style="position:relative">
556
+ <span class="spinner"></span>
557
  </span>';
558
  $info .= '</div>';
559
  echo sprintf('<td %2$s colspan="4">%1$s</td>', $info, $attributes);
578
  case 'col_image_alternative':
579
  $input = ("<textarea name='img_alternative[$rec->ID]' class='metaseo-img-meta' data-meta-type='alt_text' id='img-alt-$rec->ID' data-post-id='$rec->ID' rows='2'>" . esc_attr($rec->alt) . "</textarea>");
580
  $input .= ('<span class="saved-info" style="position:relative">
581
+ <span class="spinner"></span>
582
  </span>');
583
  echo sprintf('<td %2$s colspan="3">%1$s</td>', $input, $attributes);
584
  break;
586
  case 'col_image_title':
587
  $input = ("<textarea name='img_title[$rec->ID]' class='metaseo-img-meta' data-meta-type='image_title' id='img-title-$rec->ID' data-post-id='$rec->ID' rows='2'>" . esc_attr($rec->title) . "</textarea>");
588
  $input .= ('<span class="saved-info" style="position:relative">
589
+ <span class="spinner"></span>
590
  </span>');
591
  echo sprintf('<td %2$s colspan="3">%1$s</td>', $input, $attributes);
592
  break;
594
  case 'col_image_legend':
595
  $input = ("<textarea name='img_legend[$rec->ID]' class='metaseo-img-meta' data-meta-type='image_caption' id='img-legend-$rec->ID' data-post-id='$rec->ID' rows='2'>" . esc_attr($rec->legend) . "</textarea>");
596
  $input .= ('<span class="saved-info" style="position:relative">
597
+ <span class="spinner"></span>
598
  </span>');
599
  echo sprintf('<td %2$s colspan="3">%1$s</td>', $input, $attributes);
600
  break;
602
  case 'col_image_desc':
603
  $input = ("<textarea name='img_desc[$rec->ID]' class='metaseo-img-meta' data-meta-type='image_description' id='img-desc-$rec->ID' data-post-id='$rec->ID' rows='2'>" . esc_attr($rec->des) . "</textarea>");
604
  $input .= ('<span class="saved-info" style="position:relative">
605
+ <span class="spinner"></span>
606
  </span>');
607
  echo sprintf('<td %2$s colspan="3">%1$s</td>', $input, $attributes);
608
  break;
736
  <input type="text" value="<?php echo esc_attr($value) ?>" id="metaseo-img-<?php echo $type . '-' . $post['ID'] ?>" class="metaseo-fix-meta metaseo-img-<?php echo $type ?>" data-meta-key="_metaseo_fix_metas" data-post-id="<?php echo $post['ID'] ?>" data-img-post-id="<?php echo $img_post_id ?>" data-meta-type="<?php echo $type ?>" data-meta-order="<?php echo $k ?>" data-file-name="<?php echo $file_name; ?>" placeholder="<?php echo ($value == '' ? __(ucfirst($type) . ' is empty', 'wp-meta-seo') : '') ?>" onfocus="metaseo_fix_meta(this);" onblur="updateInputBlur(this)" onkeydown="return checkeyCode(event, this)" />
737
  </div>
738
 
 
739
  <?php if (trim($$type) != '' && trim($$type) != $value): ?>
740
+ <a class="meta-default wpmsbtn wpmsbtn_small" href="#" data-default-value="<?php echo esc_attr($$type) ?>" title="Add to input box" onclick="add_meta_default(this)"><?php _e('Copy ','wp-meta-seo'); echo $lb ?></a>
741
  <span class="img_seo_type"><?php echo $$type; ?></span>
742
  <?php endif ?>
743
+ <span class="spinner"></span>
744
  </div>
745
  <?php endforeach ?>
746
  <span class="saved-info"></span>
762
  */
763
  private static function display_resize_image_list($img_post_id, $posts, $img_counter, $p, $im) {
764
 
765
+ $header = __('We found some images you can resize...', 'wp-meta-seo');
766
  ?>
767
  <h3 class="content-header"><?php echo $header ?></h3>
768
  <div class="content-box">
792
  <div class="metaseo-img">
793
  <img width="<?php echo @$src['width']; ?>" height="<?php #echo @$src['height'] ; ?>" src="<?php echo $src['src'] ?>" />
794
  <div class="img-choosen">
795
+
796
+ <div class="pure-checkbox">
797
+ <input id="checkin-<?php echo $post['ID'] ?>" checked type="checkbox" class="metaseo-checkin checkin-<?php echo $post['ID'] ?>" value="<?php echo $key ?>" id="checkin-<?php echo $post['ID'] . '-' . $key ?>" onclick="uncheck(this)">
798
+ <label for="checkin-<?php echo $post['ID'] ?>"></label>
799
+ </div>
800
  </div>
801
  <p class="metaseo-msg"></p>
802
  </div>
809
  <?php endforeach ?>
810
  </td>
811
  <td colspan="2" class="metaseo-action">
812
+ <a href="javascript:void(0);" class="metaseo-optimize wpmsbtn wpmsbtn_small wpmsbtn_secondary" data-img-post-id="<?php echo $img_post_id ?>" data-post-id="<?php echo $post['ID'] ?>" onclick="optimize_imgs(this)"><?php echo __('Replace?', 'wp-meta-seo') ?></a>
813
  <span class="optimizing spinner"></span>
814
  </td>
815
  <td colspan="4">
832
  <tr class="metaseo-border-top">
833
  <td colspan="8"></td>
834
  <td colspan="2">
835
+ <a href="javascript:void(0);" id="metaseo-replace-all" class="wpmsbtn wpmsbtn_small" onclick="optimize_imgs_group(this)">
836
  <?php echo __('Replace All', 'wp-meta-seo') ?>
837
  </a>
838
  <span class="optimizing spinner"></span>
1700
  if ( $query->have_posts() ) {
1701
  foreach ( $query->posts as $post_id ) {
1702
  $meta = wp_get_attachment_metadata( $post_id );
1703
+ if(!empty($meta['file']) && !empty($meta['sizes'])){
1704
+ $original_file = basename( $meta['file'] );
1705
+ $cropped_image_files = wp_list_pluck( $meta['sizes'], 'file' );
1706
+ if ( $original_file === $file || in_array( $file, $cropped_image_files ) ) {
1707
+ $attachment_id = $post_id;
1708
+ break;
1709
+ }
1710
  }
1711
  }
1712
  }
inc/class.metaseo-metabox.php CHANGED
@@ -422,7 +422,8 @@ class WPMSEO_Metabox extends WPMSEO_Meta {
422
  }
423
  $dom = new DOMDocument;
424
  libxml_use_internal_errors(true);
425
- if ($dom->loadHTML($post->post_content)) {
 
426
  // Extracting the specified elements from the web page
427
  $tags_h1 = $dom->getElementsByTagName('h1');
428
  $tags_h2 = $dom->getElementsByTagName('h2');
@@ -547,8 +548,9 @@ class WPMSEO_Metabox extends WPMSEO_Meta {
547
 
548
  /* load param word content */
549
  function metaseo_check_content($post, $tooltip_page, $meta_analysis) {
 
550
  $words_meta_title = preg_split('/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/', strtolower($post->post_title), -1, PREG_SPLIT_NO_EMPTY);
551
- $words_post_content = preg_split('/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/', strtolower(strip_tags($post->post_content)), -1, PREG_SPLIT_NO_EMPTY);
552
  $test1 = false;
553
  if (is_array($words_meta_title) && is_array($words_post_content)) {
554
  foreach ($words_meta_title as $mtitle) {
@@ -623,6 +625,7 @@ class WPMSEO_Metabox extends WPMSEO_Meta {
623
  }
624
  $dom = new DOMDocument;
625
  libxml_use_internal_errors(true);
 
626
  if ($dom->loadHTML($content)) {
627
  // Extracting the specified elements from the web page
628
  $tags = $dom->getElementsByTagName('img');
422
  }
423
  $dom = new DOMDocument;
424
  libxml_use_internal_errors(true);
425
+ $content = apply_filters('the_content', $post->post_content);
426
+ if ($dom->loadHTML($content)) {
427
  // Extracting the specified elements from the web page
428
  $tags_h1 = $dom->getElementsByTagName('h1');
429
  $tags_h2 = $dom->getElementsByTagName('h2');
548
 
549
  /* load param word content */
550
  function metaseo_check_content($post, $tooltip_page, $meta_analysis) {
551
+ $content = apply_filters('the_content', $post->post_content);
552
  $words_meta_title = preg_split('/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/', strtolower($post->post_title), -1, PREG_SPLIT_NO_EMPTY);
553
+ $words_post_content = preg_split('/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/', strtolower(strip_tags($content)), -1, PREG_SPLIT_NO_EMPTY);
554
  $test1 = false;
555
  if (is_array($words_meta_title) && is_array($words_post_content)) {
556
  foreach ($words_meta_title as $mtitle) {
625
  }
626
  $dom = new DOMDocument;
627
  libxml_use_internal_errors(true);
628
+ $content = apply_filters('the_content', $content);
629
  if ($dom->loadHTML($content)) {
630
  // Extracting the specified elements from the web page
631
  $tags = $dom->getElementsByTagName('img');
inc/pages/settings.php CHANGED
@@ -1,14 +1,6 @@
1
  <?php
2
  wp_enqueue_style('m-style-qtip');
3
  wp_enqueue_script('jquery-qtip');
4
- $posts = get_posts(array('post_type' => 'page', 'posts_per_page' => -1, 'numberposts' => -1));
5
- $types_404 = array('none' => 'None', 'wp-meta-seo-page' => __('WP Meta SEO page', 'wp-meta-seo'), 'custom_page' => __('Custom page', 'wp-meta-seo'));
6
-
7
- $defaul_settings_404 = array('wpms_redirect_homepage' => 0, 'wpms_type_404' => 'none', 'wpms_page_redirected' => 'none');
8
- $wpms_settings_404 = get_option('wpms_settings_404');
9
- if (is_array($wpms_settings_404)) {
10
- $defaul_settings_404 = array_merge($defaul_settings_404, $wpms_settings_404);
11
- }
12
  ?>
13
  <div class="wrap wrap_wpms_settings">
14
  <h1><?php _e('WP Meta SEO global settings', 'wp-meta-seo') ?></h1>
@@ -16,6 +8,7 @@ if (is_array($wpms_settings_404)) {
16
  <ul class="tabs wpmstabs">
17
  <li class="tab wpmstab col active"><a href="#wpms-global"><?php _e('Global','wp-meta-seo') ?></a></li>
18
  <li class="tab wpmstab col"><a href="#wpms-redirection"><?php _e('Redirections and 404','wp-meta-seo') ?></a></li>
 
19
  <?php
20
  if(is_plugin_active(WPMSEO_ADDON_FILENAME)):
21
  ?>
@@ -81,6 +74,125 @@ if (is_array($wpms_settings_404)) {
81
  <span class="message_saved"><?php _e('Saved', 'wp-meta-seo') ?></span>
82
  </div>
83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  <div id="wpms-jutranslation" class="content-box">
85
  <?php echo \Joomunited\WPMetaSEO\Jutranslation\Jutranslation::getInput(); ?>
86
  </div>
@@ -118,6 +230,49 @@ if (is_array($wpms_settings_404)) {
118
 
119
  });
120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  $('.wpms_save_settings404').on('click', function () {
122
  var home_redirected = $('.wpms_redirect_homepage').val();
123
  var type_404 = $('.wpms_type_404').val();
1
  <?php
2
  wp_enqueue_style('m-style-qtip');
3
  wp_enqueue_script('jquery-qtip');
 
 
 
 
 
 
 
 
4
  ?>
5
  <div class="wrap wrap_wpms_settings">
6
  <h1><?php _e('WP Meta SEO global settings', 'wp-meta-seo') ?></h1>
8
  <ul class="tabs wpmstabs">
9
  <li class="tab wpmstab col active"><a href="#wpms-global"><?php _e('Global','wp-meta-seo') ?></a></li>
10
  <li class="tab wpmstab col"><a href="#wpms-redirection"><?php _e('Redirections and 404','wp-meta-seo') ?></a></li>
11
+ <li class="tab wpmstab col"><a href="#wpms-breadcrumb"><?php _e('Breadcrumb','wp-meta-seo') ?></a></li>
12
  <?php
13
  if(is_plugin_active(WPMSEO_ADDON_FILENAME)):
14
  ?>
74
  <span class="message_saved"><?php _e('Saved', 'wp-meta-seo') ?></span>
75
  </div>
76
 
77
+ <div id="wpms-breadcrumb" class="content-box">
78
+ <table class="form-table">
79
+ <tbody>
80
+ <tr>
81
+ <th scope="row">
82
+ <label for="<?php _e('The separator that materialize the breadcrumb levels','wp-meta-seo') ?>">
83
+ <?php _e('Breadcrumb separator','wp-meta-seo') ?>
84
+ </label>
85
+ </th>
86
+ <td>
87
+ <input id="breadcrumbs_separator" name="_metaseo_breadcrumbs[separator]" type="text" value="<?php echo htmlentities($breadcrumbs['separator']) ?>" size="50">
88
+ </td>
89
+ </tr>
90
+
91
+ <tr>
92
+ <th scope="row">
93
+ <label for="<?php _e('Include the Home element in the breadcrumb','wp-meta-seo') ?>"><?php _e('Include Home','wp-meta-seo') ?></label>
94
+ </th>
95
+ <td>
96
+ <input name="_metaseo_breadcrumbs[include_home]" type="hidden" value="0">
97
+ <div class="switch-optimization">
98
+ <label class="switch switch-optimization">
99
+ <input type="checkbox" id="include_home"
100
+ name="_metaseo_breadcrumbs[include_home]" value="1" <?php checked($breadcrumbs['include_home'],1) ?>>
101
+ <div class="slider round"></div>
102
+ </label>
103
+ </div>
104
+ </td>
105
+ </tr>
106
+
107
+ <tr>
108
+ <th scope="row">
109
+ <label for="<?php _e('If home is included, you may want to force a text. By default it’s the content title','wp-meta-seo') ?>">
110
+ <?php _e('Home text','wp-meta-seo') ?>
111
+ </label>
112
+ </th>
113
+ <td>
114
+ <input name="_metaseo_breadcrumbs[home_text_default]" type="hidden" value="0">
115
+ <div class="switch-optimization">
116
+ <label class="switch switch-optimization">
117
+ <input type="checkbox" id="home_text_default"
118
+ name="_metaseo_breadcrumbs[home_text_default]" value="1" <?php checked($breadcrumbs['home_text_default'],1) ?>>
119
+ <div class="slider round"></div>
120
+ </label>
121
+ </div>
122
+ </td>
123
+ </tr>
124
+
125
+ <?php
126
+ if($breadcrumbs['home_text_default'] == 0){
127
+ $class = 'hide';
128
+ }else{
129
+ $class = 'show';
130
+ }
131
+ ?>
132
+ <tr class="tr_home_text <?php echo $class ?>">
133
+ <th scope="row">
134
+ <label></label>
135
+ </th>
136
+ <td>
137
+ <input id="breadcrumbs_home_text" name="_metaseo_breadcrumbs[home_text]" type="text" value="<?php echo $breadcrumbs['home_text'] ?>" size="50">
138
+ </td>
139
+ </tr>
140
+ <tr>
141
+ <th scope="row">
142
+ <label for="<?php _e('The breadcrumb element can be clickable or not','wp-meta-seo') ?>"><?php _e('Clickable breadcrumb','wp-meta-seo') ?></label>
143
+ </th>
144
+ <td>
145
+ <input name="_metaseo_breadcrumbs[clickable]" type="hidden" value="0">
146
+ <div class="switch-optimization">
147
+ <label class="switch switch-optimization">
148
+ <input type="checkbox" id="clickable"
149
+ name="_metaseo_breadcrumbs[clickable]" value="1" <?php checked($breadcrumbs['clickable'],1) ?>>
150
+ <div class="slider round"></div>
151
+ </label>
152
+ </div>
153
+ </td>
154
+ </tr>
155
+
156
+ <tr>
157
+ <th scope="row">
158
+ <label for="<?php _e('Generate a breadcrumb navigation based on your categories or page levels. The shortcode can be included in theme layouts','wp-meta-seo') ?>">
159
+ <?php _e('PHP Shortcode','wp-meta-seo') ?>
160
+ </label>
161
+ </th>
162
+ <td>
163
+
164
+ <textarea style="width: 700px;height:200px;resize:both" readonly>
165
+ /**
166
+ * @param bool $return Whether to return or echo the trail. (optional)
167
+ * @param bool $reverse Whether to reverse the output or not. (optional)
168
+ */
169
+ if(function_exists('wpms_breadcrumb')){
170
+ $return = false;
171
+ $reverse = false;
172
+ echo '<div class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/">';
173
+ wpms_breadcrumb($return,$reverse);
174
+ echo '</div>';
175
+ }
176
+ </textarea>
177
+ </td>
178
+ </tr>
179
+
180
+ <tr>
181
+ <th scope="row">
182
+ <label for="<?php _e('Generate a breadcrumb navigation based on your categories or page levels. The WordPress shortcode can be called anywhere in your content','wp-meta-seo') ?>">
183
+ <?php _e('WordPress Shortcode','wp-meta-seo') ?>
184
+ </label>
185
+ </th>
186
+ <td>
187
+ <input type="text" size="50" readonly value="[wpms_breadcrumb reverse=”0″]">
188
+ </td>
189
+ </tr>
190
+ </tbody>
191
+ </table>
192
+ <div class="button wpms_save_settings_breadcrumb"><?php _e('Save', 'wp-meta-seo') ?></div>
193
+ <span class="message_saved"><?php _e('Saved', 'wp-meta-seo') ?></span>
194
+ </div>
195
+
196
  <div id="wpms-jutranslation" class="content-box">
197
  <?php echo \Joomunited\WPMetaSEO\Jutranslation\Jutranslation::getInput(); ?>
198
  </div>
230
 
231
  });
232
 
233
+ $('.wpms_save_settings_breadcrumb').on('click', function () {
234
+ var separator = $('#breadcrumbs_separator').val();
235
+ var home_text = $('#breadcrumbs_home_text').val();
236
+ if($('#include_home').is(":checked")){
237
+ var include_home = 1;
238
+ }else{
239
+ var include_home = 0;
240
+ }
241
+
242
+ if($('#clickable').is(":checked")){
243
+ var clickable = 1;
244
+ }else{
245
+ var clickable = 0;
246
+ }
247
+
248
+ if($('#home_text_default').is(":checked")){
249
+ var home_text_default = 1;
250
+ }else{
251
+ var home_text_default = 0;
252
+ }
253
+
254
+ $.ajax({
255
+ url: ajaxurl,
256
+ method: 'POST',
257
+ dataType: 'json',
258
+ data: {
259
+ 'action': 'wpms_save_settings_breadcrumb',
260
+ 'separator': separator,
261
+ 'home_text': home_text,
262
+ 'include_home': include_home,
263
+ 'clickable': clickable,
264
+ 'home_text_default': home_text_default
265
+ },
266
+ success: function (res) {
267
+ if (res == true) {
268
+ $('.message_saved').fadeIn(10).delay(2000).fadeOut(2000);
269
+ } else {
270
+ alert('Save errors !')
271
+ }
272
+ }
273
+ });
274
+ });
275
+
276
  $('.wpms_save_settings404').on('click', function () {
277
  var home_redirected = $('.wpms_redirect_homepage').val();
278
  var type_404 = $('.wpms_type_404').val();
js/metaseo_admin.js CHANGED
@@ -389,8 +389,12 @@ function saveChanges(element_id, post_id, meta_type, meta_value) {
389
  data: postData,
390
  dataType: 'json',
391
  beforeSend: function () {
392
- savedInfo.empty().append('<span style="position:absolute" class="meta-update"></span>');
393
- element.parent().find('span.meta-update').addClass('update-loader').fadeIn(300);
 
 
 
 
394
  },
395
  success: function (response) {
396
  if (response == 0) {
@@ -401,12 +405,18 @@ function saveChanges(element_id, post_id, meta_type, meta_value) {
401
 
402
  if (updated == true) {
403
  autosaveNotification = setTimeout(function () {
404
- element.parent().find('span.meta-update').removeClass('update-loader');
 
 
 
 
 
 
405
  savedInfo.removeClass('metaseo-msg-warning').addClass('metaseo-msg-success')
406
  .text(response.msg).fadeIn(200);
407
 
408
  setTimeout(function () {
409
- savedInfo.empty().append('<span class="meta-update" style="position:absolute"></span>');
410
  }, 3000);
411
 
412
  }, 200);
@@ -529,6 +539,27 @@ function _metaSeoScanImages(imgs) {
529
  uncheck(input);
530
  });
531
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
532
  },
533
  error: function () {
534
  // alert('Errors occured while scanning posts for optimization');
@@ -869,6 +900,14 @@ function wpms_image_scan_meta($this) {
869
  }
870
 
871
  jQuery(document).ready(function ($) {
 
 
 
 
 
 
 
 
872
  $('.image_scan_meta').on('click', function () {
873
  wpms_image_scan_meta($(this));
874
  });
@@ -1005,7 +1044,7 @@ jQuery(document).ready(function ($) {
1005
  $('.metaseo-img-meta').change(function () {
1006
  if (jQuery(this).val() == '') {
1007
  jQuery(this).val(metaseoValueHolder[this.id + '_prev']);
1008
- $(this).parent().find('span.saved-info').empty().append('<span style="position:absolute" class="meta-update"></span>');
1009
  }
1010
  if (checkspecial(this) === true) {
1011
  updateInputBlur(this);
389
  data: postData,
390
  dataType: 'json',
391
  beforeSend: function () {
392
+ savedInfo.empty().append('<span class="spinner"></span>');
393
+ if(element.hasClass('metaseo-fix-meta')){
394
+ element.closest('.metaseo-img-wrapper').find('.spinner').css('visibility','visible').show();
395
+ }else{
396
+ element.parent().find('.spinner').css('visibility','visible').show();
397
+ }
398
  },
399
  success: function (response) {
400
  if (response == 0) {
405
 
406
  if (updated == true) {
407
  autosaveNotification = setTimeout(function () {
408
+
409
+ if(element.hasClass('metaseo-fix-meta')){
410
+ element.closest('.metaseo-img-wrapper').find('.spinner').hide();
411
+ }else{
412
+ element.parent().find('.spinner').hide();
413
+ }
414
+
415
  savedInfo.removeClass('metaseo-msg-warning').addClass('metaseo-msg-success')
416
  .text(response.msg).fadeIn(200);
417
 
418
  setTimeout(function () {
419
+ savedInfo.empty().append('<span class="spinner"></span>');
420
  }, 3000);
421
 
422
  }, 200);
539
  uncheck(input);
540
  });
541
  }
542
+
543
+ jQuery('.fix-metas').qtip({
544
+ content: {
545
+ attr: 'alt'
546
+ },
547
+ position: {
548
+ my: 'bottom center',
549
+ at: 'top center'
550
+ },
551
+ style: {
552
+ tip: {
553
+ corner: true,
554
+ },
555
+ classes: 'wpms-widgets-qtip_show_arow'
556
+ },
557
+ show: 'hover',
558
+ hide: {
559
+ fixed: true,
560
+ delay: 10
561
+ }
562
+ });
563
  },
564
  error: function () {
565
  // alert('Errors occured while scanning posts for optimization');
900
  }
901
 
902
  jQuery(document).ready(function ($) {
903
+ $('#home_text_default').on('change', function () {
904
+ if($(this).is(':checked')){
905
+ $('.tr_home_text').addClass('show').removeClass('hide');
906
+ }else{
907
+ $('.tr_home_text').addClass('hide').removeClass('show');
908
+ }
909
+ });
910
+
911
  $('.image_scan_meta').on('click', function () {
912
  wpms_image_scan_meta($(this));
913
  });
1044
  $('.metaseo-img-meta').change(function () {
1045
  if (jQuery(this).val() == '') {
1046
  jQuery(this).val(metaseoValueHolder[this.id + '_prev']);
1047
+ $(this).parent().find('span.saved-info').empty().append('<span class="spinner"></span>');
1048
  }
1049
  if (checkspecial(this) === true) {
1050
  updateInputBlur(this);
languages/wp-meta-seo-en_US.mo CHANGED
Binary file
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  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.0
5
- Tested up to: 4.8.0
6
- Stable tag: 3.4.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -11,17 +11,18 @@ WP Meta SEO gives you the control over all your meta content and images. Bulk SE
11
 
12
  == Description ==
13
 
14
- = WP meta SEO got 8 major functionalities: =
15
 
16
  * Bulk edit all website meta on a single view
17
  * Edit meta in content with live SEO analysis
18
- * Fix HTML image resizing
19
  * Bulk edit image file name and meta
20
  * Bulk edit SEO link title
21
  * 404 errors redirect and internal broken link checker
22
  * Add Google Analytics tracking information and display statistics in WordPress
23
  * Generate XML and HTML sitemaps
24
  * Facebook and Twitter social sharing custom elements per content
 
25
 
26
  > <strong>Features included in WP Meta SEO Addon</strong><br>
27
  > * Google Search Console keyword suggestion in content
@@ -72,6 +73,8 @@ WP Meta SEO also include this feature in the bulk edition view, you are notified
72
  * Check: Meta description filled
73
  * Check: Wrong image resizing
74
  * Check: Image meta title or alt
 
 
75
 
76
  = 404 and redirect manager =
77
 
@@ -108,8 +111,14 @@ The redirect manager will help you to fix all types of 404 errors you can encoun
108
  * Setup update frequency and priority for each sitemap link
109
  * Crawl all sitemap URL for errors
110
 
 
111
 
112
- **More details here:** <a href="http://www.joomunited.com/wordpress-products/wp-meta-seo" rel="friend">http://www.joomunited.com/wordpress-products/wp-meta-seo</a>
 
 
 
 
 
113
 
114
  = Video demo: =
115
  [vimeo https://vimeo.com/113695156]
@@ -261,6 +270,11 @@ It could be! if you have a lot of pages that need to be indexed with no specific
261
 
262
  == Changelog ==
263
 
 
 
 
 
 
264
  = 3.4.1 =
265
  * Add : Meta keywords field in category meta edition
266
  * Add : Update dashboard description and image compression layout
@@ -474,4 +488,4 @@ Site-wide SEO: it's more about your whole site and structure between multiple ar
474
 
475
  And... don't forget to check each month your SEO dashboard :)
476
 
477
- PHP 5.3+, WP 4.3+
2
  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.0
5
+ Tested up to: 4.8.1
6
+ Stable tag: 3.5.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
11
 
12
  == Description ==
13
 
14
+ = WP meta SEO got 9 major functionalities: =
15
 
16
  * Bulk edit all website meta on a single view
17
  * Edit meta in content with live SEO analysis
18
+ * Fix HTML image resizing in content
19
  * Bulk edit image file name and meta
20
  * Bulk edit SEO link title
21
  * 404 errors redirect and internal broken link checker
22
  * Add Google Analytics tracking information and display statistics in WordPress
23
  * Generate XML and HTML sitemaps
24
  * Facebook and Twitter social sharing custom elements per content
25
+ * Breadcrumb generator
26
 
27
  > <strong>Features included in WP Meta SEO Addon</strong><br>
28
  > * Google Search Console keyword suggestion in content
73
  * Check: Meta description filled
74
  * Check: Wrong image resizing
75
  * Check: Image meta title or alt
76
+ * Check the Page builders content (Text, HTML, Heading content):
77
+ Visual composer, DIVI Builder, Beaver Builder, ACF, Site Origine, Themify builder, Live composer, Elementor
78
 
79
  = 404 and redirect manager =
80
 
111
  * Setup update frequency and priority for each sitemap link
112
  * Crawl all sitemap URL for errors
113
 
114
+ = Breadcrumb generator =
115
 
116
+ * Rich snippet breadcrumb
117
+ * Control breadcrumb separator, links and display
118
+ * Generate breadcrumb shortcode
119
+ * Generate breadcrumb PHP shortcode
120
+
121
+ **More details here:** <a href="https://www.joomunited.com/wordpress-products/wp-meta-seo" rel="friend">http://www.joomunited.com/wordpress-products/wp-meta-seo</a>
122
 
123
  = Video demo: =
124
  [vimeo https://vimeo.com/113695156]
270
 
271
  == Changelog ==
272
 
273
+ = 3.5.0 =
274
+ * Fix : Check content of page builders: Visual composer, DIVI Builder, Beaver Builder, ACF, Site Origine, Themify builder, Live composer, Elementor plugins
275
+ * Add : Generate rich snippet breadcrumb shortcode and PHP code
276
+ * Fix : Redesign the image edition window
277
+
278
  = 3.4.1 =
279
  * Add : Meta keywords field in category meta edition
280
  * Add : Update dashboard description and image compression layout
488
 
489
  And... don't forget to check each month your SEO dashboard :)
490
 
491
+ PHP 5.3+, WP 4.3+
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: 3.4.1
8
  * Text Domain: wp-meta-seo
9
  * Domain Path: /languages
10
  * Author: JoomUnited
@@ -75,7 +75,7 @@ if (!defined('URL'))
75
  define('URL', get_site_url());
76
 
77
  if (!defined('WPMSEO_VERSION')) {
78
- define('WPMSEO_VERSION', '3.4.1');
79
  }
80
 
81
  if (!defined('WPMS_CLIENTID')) {
@@ -104,6 +104,10 @@ if (!defined('WPMSEO_FILE'))
104
  if (!defined('WPMSEO_ADDON_FILENAME')) {
105
  define('WPMSEO_ADDON_FILENAME', 'wp-meta-seo-addon/wp-meta-seo-addon.php');
106
  }
 
 
 
 
107
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
108
  register_activation_hook(__FILE__, array('WpMetaSeo', 'plugin_activation'));
109
 
@@ -129,8 +133,40 @@ if (is_admin()) {
129
  $contactusers['mfacebook'] = __('Facebook profile URL', 'wp-meta-seo');
130
  return $contactusers;
131
  }
132
-
133
  } else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  /******** Check again and modify title, meta title, meta description before output ********/
135
  if(is_plugin_active('divi_layout_injector/divi_layout_injector.php')){
136
  add_action('get_header', 'buffer_start');
@@ -696,9 +732,4 @@ function wpms_template_redirect() {
696
  }
697
  }
698
 
699
- }
700
-
701
-
702
- if(is_admin()){
703
- include_once ( WPMETASEO_PLUGIN_DIR . 'inc/google_analytics/wpmsga.php' );
704
- }
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: 3.5.0
8
  * Text Domain: wp-meta-seo
9
  * Domain Path: /languages
10
  * Author: JoomUnited
75
  define('URL', get_site_url());
76
 
77
  if (!defined('WPMSEO_VERSION')) {
78
+ define('WPMSEO_VERSION', '3.5.0');
79
  }
80
 
81
  if (!defined('WPMS_CLIENTID')) {
104
  if (!defined('WPMSEO_ADDON_FILENAME')) {
105
  define('WPMSEO_ADDON_FILENAME', 'wp-meta-seo-addon/wp-meta-seo-addon.php');
106
  }
107
+
108
+ if (!defined('WPMSEO_TEMPLATE_BREADCRUMB')) {
109
+ define('WPMSEO_TEMPLATE_BREADCRUMB', '<span property="itemListElement" typeof="ListItem"><span property="name">%htitle%</span><meta property="position" content="%position%"></span>');
110
+ }
111
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
112
  register_activation_hook(__FILE__, array('WpMetaSeo', 'plugin_activation'));
113
 
133
  $contactusers['mfacebook'] = __('Facebook profile URL', 'wp-meta-seo');
134
  return $contactusers;
135
  }
136
+ include_once ( WPMETASEO_PLUGIN_DIR . 'inc/google_analytics/wpmsga.php' );
137
  } else {
138
+ /**
139
+ * Outputs the breadcrumb
140
+ * @param bool $return Whether to return or echo the trail. (optional)
141
+ * @param bool $reverse Whether to reverse the output or not. (optional)
142
+ */
143
+ function wpms_breadcrumb($return = false, $reverse = false)
144
+ {
145
+ require_once( WPMETASEO_PLUGIN_DIR . 'inc/breadcrumb/class.metaseo-breadcrumb.php' );
146
+ $breadcrumb = new MetaSeo_Breadcrumb;
147
+ if($breadcrumb !== null)
148
+ {
149
+ $breadcrumb->wpms_check_posts();
150
+ return $breadcrumb->wpms_breadcrumb_display($return, $reverse);
151
+ }
152
+ }
153
+
154
+ /*
155
+ * shortcode for breadcrumb
156
+ */
157
+ add_shortcode('wpms_breadcrumb', 'wpms_breadcrumb_shortcode');
158
+ function wpms_breadcrumb_shortcode($params) {
159
+ if(function_exists('wpms_breadcrumb_shortcode')){
160
+ echo '<div class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/">';
161
+ if(isset($params['reverse']) && $params['reverse'] == 1){
162
+ return wpms_breadcrumb(true, true);
163
+ }else{
164
+ return wpms_breadcrumb(true, false);
165
+ }
166
+ echo '</div>';
167
+ }
168
+ }
169
+
170
  /******** Check again and modify title, meta title, meta description before output ********/
171
  if(is_plugin_active('divi_layout_injector/divi_layout_injector.php')){
172
  add_action('get_header', 'buffer_start');
732
  }
733
  }
734
 
735
+ }