SEOPress - Version 4.4.0.4

Version Description

(18/02/2021) = * INFO Add "View my RSS feed" button to SEO, PRO, RSS tab * INFO Improve performance for video xml sitemap * FIX Help tabs missing * FIX Content analysis compatibility for Oxygen Page Builder * FIX Variable products for automatic schema * FIX Product currency property for automatic product schema * FIX Ecommerce tracking on purchases * FIX PHP Fatal error: Uncaught Error: Call to a member function is_type()

Download this release

Release Info

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

Code changes from version 4.4.0.3 to 4.4.0.4

inc/admin/admin-header.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- defined( 'ABSPATH' ) or die( 'Please don&rsquo;t call the plugin directly. Thanks :)' );
4
 
5
  function seopress_admin_header() { ?>
6
  <div class="wrap"><h2><!--// hack to get WP notice at the correct place //--></h2></div>
@@ -13,23 +13,23 @@ function seopress_admin_header() { ?>
13
  </style>
14
  <?php } ?>
15
  <h1>
16
- <a href="<?php echo admin_url( 'admin.php?page=seopress-option' ); ?>">
17
- <span class="screen-reader-text"><?php _e( 'SEOPress', 'wp-seopress' ); ?></span>
18
- <?php if ( is_plugin_active( 'wp-seopress-pro/seopress-pro.php' ) || is_plugin_active( 'wp-seopress-insights/seopress-insights.php' ) ) { ?>
19
  <span class="seopress-info-version">
20
  <?php if (defined('SEOPRESS_WL_ADMIN_HEADER_INFO') && SEOPRESS_WL_ADMIN_HEADER_INFO !== '') { ?>
21
  <?php echo SEOPRESS_WL_ADMIN_HEADER_INFO; ?>
22
  <?php } else { ?>
23
  <strong>
24
- <?php if ( is_plugin_active( 'wp-seopress-insights/seopress-insights.php' ) ) {
25
- _e('Insights', 'wp-seopress');
26
- }
27
- if ( is_plugin_active( 'wp-seopress-insights/seopress-insights.php' ) && is_plugin_active( 'wp-seopress-pro/seopress-pro.php' ) ) {
28
- echo ' + ';
29
- }
30
- if ( is_plugin_active( 'wp-seopress-pro/seopress-pro.php' ) ) {
31
- _e('PRO', 'wp-seopress');
32
- } ?>
33
  </strong>
34
  <?php } ?>
35
  </span>
@@ -40,203 +40,204 @@ function seopress_admin_header() { ?>
40
  <div class="seopress-quick-access">
41
  <ul>
42
  <li>
43
- <a href="<?php echo admin_url( 'admin.php?page=seopress-titles' ); ?>">
44
  <span class="dashicons dashicons-editor-table"></span>
45
- <?php _e( 'Titles & Metas', 'wp-seopress' ); ?>
46
  </a>
47
  </li>
48
  <li>
49
- <a href="<?php echo admin_url( 'admin.php?page=seopress-xml-sitemap' ); ?>">
50
  <span class="dashicons dashicons-media-spreadsheet"></span>
51
- <?php _e( 'XML / HTML Sitemap', 'wp-seopress' ); ?>
52
  </a>
53
  </li>
54
  <li>
55
- <a href="<?php echo admin_url( 'admin.php?page=seopress-social' ); ?>">
56
  <span class="dashicons dashicons-share"></span>
57
- <?php _e( 'Social Networks', 'wp-seopress' ); ?>
58
  </a>
59
  </li>
60
  <li>
61
- <a href="<?php echo admin_url( 'admin.php?page=seopress-google-analytics' ); ?>">
62
  <span class="dashicons dashicons-chart-area"></span>
63
- <?php _e( 'Analytics', 'wp-seopress' ); ?>
64
  </a>
65
  </li>
66
  <li>
67
- <a href="<?php echo admin_url( 'admin.php?page=seopress-advanced' ); ?>">
68
  <span class="dashicons dashicons-admin-tools"></span>
69
- <?php _e( 'Advanced', 'wp-seopress' ); ?>
70
  </a>
71
  </li>
72
- <?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
73
- if ( is_plugin_active( 'wp-seopress-insights/seopress-insights.php' ) ) { ?>
74
  <li>
75
- <a href="<?php echo admin_url( 'admin.php?page=seopress-insights' ); ?>">
76
  <span class="dashicons dashicons-chart-line"></span>
77
- <?php _e( 'Insights', 'wp-seopress' ); ?>
78
  </a>
79
  </li>
80
  <?php
81
- }
82
- if ( is_plugin_active( 'wp-seopress-pro/seopress-pro.php' ) ) { ?>
83
  <li>
84
- <a href="<?php echo admin_url( 'admin.php?page=seopress-pro-page#tab=tab_seopress_woocommerce' ); ?>">
85
  <span class="dashicons dashicons-cart"></span>
86
- <?php _e( 'WooCommerce', 'wp-seopress' ); ?>
87
  </a>
88
  </li>
89
  <li>
90
- <a href="<?php echo admin_url( 'admin.php?page=seopress-pro-page#tab=tab_seopress_edd' ); ?>">
91
  <span class="dashicons dashicons-cart"></span>
92
- <?php _e( 'Easy Digital Downloads', 'wp-seopress' ); ?>
93
  </a>
94
  </li>
95
  <li>
96
- <a href="<?php echo admin_url( 'admin.php?page=seopress-pro-page#tab=tab_seopress_local_business' ); ?>">
97
  <span class="dashicons dashicons-store"></span>
98
- <?php _e( 'Local Business', 'wp-seopress' ); ?>
99
  </a>
100
  </li>
101
  <li>
102
- <a href="<?php echo admin_url( 'admin.php?page=seopress-pro-page#tab=tab_seopress_dublin_core' ); ?>">
103
  <span class="dashicons dashicons-welcome-learn-more"></span>
104
- <?php _e( 'Dublin Core', 'wp-seopress' ); ?>
105
  </a>
106
  </li>
107
  <li>
108
- <a href="<?php echo admin_url( 'admin.php?page=seopress-pro-page#tab=tab_seopress_rich_snippets' ); ?>">
109
  <span class="dashicons dashicons-media-spreadsheet"></span>
110
- <?php _e( 'Structured Data Types (schema.org)', 'wp-seopress' ); ?>
111
  </a>
112
  </li>
113
  <li>
114
- <a href="<?php echo admin_url( 'admin.php?page=seopress-pro-page#tab=tab_seopress_breadcrumbs' ); ?>">
115
  <span class="dashicons dashicons-feedback"></span>
116
- <?php _e( 'Breadcrumbs', 'wp-seopress' ); ?>
117
  </a>
118
  </li>
119
  <li>
120
- <a href="<?php echo admin_url( 'admin.php?page=seopress-pro-page#tab=tab_seopress_page_speed' ); ?>">
121
  <span class="dashicons dashicons-performance"></span>
122
- <?php _e( 'Google Page Speed', 'wp-seopress' ); ?>
123
  </a>
124
  </li>
125
- <?php if (!is_multisite() || (is_multisite() && defined('SUBDOMAIN_INSTALL') && constant('SUBDOMAIN_INSTALL') === true)) { //subdomains or single site?>
126
  <li>
127
- <a href="<?php echo admin_url( 'admin.php?page=seopress-pro-page#tab=tab_seopress_robots' ); ?>">
128
  <span class="dashicons dashicons-media-text"></span>
129
- <?php _e( 'robots.txt', 'wp-seopress' ); ?>
130
  </a>
131
  </li>
132
  <?php } ?>
133
  <li>
134
- <a href="<?php echo admin_url( 'admin.php?page=seopress-pro-page#tab=tab_seopress_news' ); ?>">
135
  <span class="dashicons dashicons-admin-post"></span>
136
- <?php _e( 'Google News Sitemap', 'wp-seopress' ); ?>
137
  </a>
138
  </li>
139
  <li>
140
- <a href="<?php echo admin_url( 'admin.php?page=seopress-pro-page#tab=tab_seopress_404' ); ?>">
141
  <span class="dashicons dashicons-admin-links"></span>
142
- <?php _e( 'Redirections', 'wp-seopress' ); ?>
143
  </a>
144
  </li>
145
  <li>
146
- <a href="<?php echo admin_url( 'edit.php?post_type=seopress_bot' ); ?>">
147
  <span class="dashicons dashicons-admin-generic"></span>
148
- <?php _e( 'Broken links', 'wp-seopress' ); ?>
149
  </a>
150
  </li>
151
  <li>
152
- <a href="<?php echo admin_url( 'admin.php?page=seopress-pro-page#tab=tab_seopress_rewrite' ); ?>">
153
  <span class="dashicons dashicons-admin-links"></span>
154
- <?php _e( 'URL Rewriting', 'wp-seopress' ); ?>
155
  </a>
156
  </li>
157
- <?php if (!is_multisite()) { ?>
158
  <li>
159
- <a href="<?php echo admin_url( 'admin.php?page=seopress-pro-page#tab=tab_seopress_white_label' ); ?>">
160
  <span class="dashicons dashicons-tag"></span>
161
- <?php _e( 'White Label', 'wp-seopress' ); ?>
162
  </a>
163
  </li>
164
  <li>
165
- <a href="<?php echo admin_url( 'admin.php?page=seopress-pro-page#tab=tab_seopress_htaccess' ); ?>">
166
  <span class="dashicons dashicons-media-text"></span>
167
- <?php _e( '.htaccess', 'wp-seopress' ); ?>
168
  </a>
169
  </li>
170
  <?php } ?>
171
  <li>
172
- <a href="<?php echo admin_url( 'admin.php?page=seopress-pro-page#tab=tab_seopress_rss' ); ?>">
173
  <span class="dashicons dashicons-rss"></span>
174
- <?php _e( 'RSS', 'wp-seopress' ); ?>
175
  </a>
176
  </li>
177
  <li>
178
- <a href="<?php echo admin_url( 'admin.php?page=seopress-license' ); ?>">
179
  <span class="dashicons dashicons-admin-network"></span>
180
- <?php _e( 'License', 'wp-seopress' ); ?>
181
  </a>
182
  </li>
183
  <?php } ?>
184
  <li>
185
- <a href="<?php echo admin_url( 'admin.php?page=seopress-import-export' ); ?>">
186
  <span class="dashicons dashicons-admin-settings"></span>
187
- <?php _e( 'Tools', 'wp-seopress' ); ?>
188
  </a>
189
  </li>
190
  </ul>
191
  </div>
192
  </h1>
193
  <?php
194
- if (defined('SEOPRESS_WL_ICONS_HEADER') && SEOPRESS_WL_ICONS_HEADER === false) {
195
- //do nothing
196
- } else {
197
- if (function_exists('seopress_get_locale') && seopress_get_locale() =='fr') {
198
- $seopress_docs_link['changelog'] = 'https://www.seopress.org/fr/journal-modifications/?utm_source=plugin&utm_medium=wp-admin&utm_campaign=seopress';
199
- $seopress_docs_link['website'] = 'https://www.seopress.org/fr/?utm_source=plugin&utm_medium=wp-admin&utm_campaign=seopress';
200
- $seopress_docs_link['support'] = 'https://www.seopress.org/fr/support/?utm_source=plugin&utm_medium=wp-admin&utm_campaign=seopress';
201
- } else {
202
- $seopress_docs_link['changelog'] = 'https://www.seopress.org/changelog/?utm_source=plugin&utm_medium=wp-admin&utm_campaign=seopress';
203
- $seopress_docs_link['website'] = 'https://www.seopress.org/?utm_source=plugin&utm_medium=wp-admin&utm_campaign=seopress';
204
- $seopress_docs_link['support'] = 'https://www.seopress.org/support/?utm_source=plugin&utm_medium=wp-admin&utm_campaign=seopress';
205
- }
206
- ?>
207
  <div id="seopress-notice">
208
  <div class="small">
209
  <a href="<?php echo $seopress_docs_link['changelog']; ?>" target="_blank">
210
  <div class="dashicons dashicons-media-text"></div>
211
- <div class="tooltip"><?php _e('See the changelog','wp-seopress'); ?></div>
212
  </a>
213
  <a href="mailto:contact@seopress.org" target="_blank">
214
  <div class="dashicons dashicons-megaphone"></div>
215
- <div class="tooltip"><?php _e('Send feedback','wp-seopress'); ?></div>
216
  </a>
217
  <a href="https://www.facebook.com/groups/seopress/" target="_blank">
218
  <div class="dashicons dashicons-facebook"></div>
219
- <div class="tooltip"><?php _e('Join our Facebook Community group','wp-seopress'); ?></div>
220
  </a>
221
  <a href="https://twitter.com/wp_seopress" target="_blank">
222
  <div class="dashicons dashicons-twitter"></div>
223
- <div class="tooltip"><?php _e('Follow us on Twitter','wp-seopress'); ?></div>
224
  </a>
225
  <a href="https://www.youtube.com/SEOPress" target="_blank">
226
  <div class="dashicons dashicons-video-alt3"></div>
227
- <div class="tooltip"><?php _e('Follow us on YouTube','wp-seopress'); ?></div>
228
  </a>
229
  <a href="<?php echo $seopress_docs_link['website']; ?>" target="_blank">
230
  <div class="dashicons dashicons-info"></div>
231
- <div class="tooltip"><?php _e('Official website','wp-seopress'); ?></div>
232
  </a>
233
  <a href="<?php echo $seopress_docs_link['support']; ?>" target="_blank">
234
  <div class="dashicons dashicons-editor-help"></div>
235
- <div class="tooltip"><?php _e('Support','wp-seopress'); ?></div>
236
  </a>
237
  </div>
238
  </div>
239
- <?php } ?>
 
240
  </div>
241
  </div>
242
  </div>
1
  <?php
2
 
3
+ defined('ABSPATH') or exit('Please don&rsquo;t call the plugin directly. Thanks :)');
4
 
5
  function seopress_admin_header() { ?>
6
  <div class="wrap"><h2><!--// hack to get WP notice at the correct place //--></h2></div>
13
  </style>
14
  <?php } ?>
15
  <h1>
16
+ <a href="<?php echo admin_url('admin.php?page=seopress-option'); ?>">
17
+ <span class="screen-reader-text"><?php _e('SEOPress', 'wp-seopress'); ?></span>
18
+ <?php if (is_plugin_active('wp-seopress-pro/seopress-pro.php') || is_plugin_active('wp-seopress-insights/seopress-insights.php')) { ?>
19
  <span class="seopress-info-version">
20
  <?php if (defined('SEOPRESS_WL_ADMIN_HEADER_INFO') && SEOPRESS_WL_ADMIN_HEADER_INFO !== '') { ?>
21
  <?php echo SEOPRESS_WL_ADMIN_HEADER_INFO; ?>
22
  <?php } else { ?>
23
  <strong>
24
+ <?php if (is_plugin_active('wp-seopress-insights/seopress-insights.php')) {
25
+ _e('Insights', 'wp-seopress');
26
+ }
27
+ if (is_plugin_active('wp-seopress-insights/seopress-insights.php') && is_plugin_active('wp-seopress-pro/seopress-pro.php')) {
28
+ echo ' + ';
29
+ }
30
+ if (is_plugin_active('wp-seopress-pro/seopress-pro.php')) {
31
+ _e('PRO', 'wp-seopress');
32
+ } ?>
33
  </strong>
34
  <?php } ?>
35
  </span>
40
  <div class="seopress-quick-access">
41
  <ul>
42
  <li>
43
+ <a href="<?php echo admin_url('admin.php?page=seopress-titles'); ?>">
44
  <span class="dashicons dashicons-editor-table"></span>
45
+ <?php _e('Titles & Metas', 'wp-seopress'); ?>
46
  </a>
47
  </li>
48
  <li>
49
+ <a href="<?php echo admin_url('admin.php?page=seopress-xml-sitemap'); ?>">
50
  <span class="dashicons dashicons-media-spreadsheet"></span>
51
+ <?php _e('XML / HTML Sitemap', 'wp-seopress'); ?>
52
  </a>
53
  </li>
54
  <li>
55
+ <a href="<?php echo admin_url('admin.php?page=seopress-social'); ?>">
56
  <span class="dashicons dashicons-share"></span>
57
+ <?php _e('Social Networks', 'wp-seopress'); ?>
58
  </a>
59
  </li>
60
  <li>
61
+ <a href="<?php echo admin_url('admin.php?page=seopress-google-analytics'); ?>">
62
  <span class="dashicons dashicons-chart-area"></span>
63
+ <?php _e('Analytics', 'wp-seopress'); ?>
64
  </a>
65
  </li>
66
  <li>
67
+ <a href="<?php echo admin_url('admin.php?page=seopress-advanced'); ?>">
68
  <span class="dashicons dashicons-admin-tools"></span>
69
+ <?php _e('Advanced', 'wp-seopress'); ?>
70
  </a>
71
  </li>
72
+ <?php include_once ABSPATH . 'wp-admin/includes/plugin.php';
73
+ if (is_plugin_active('wp-seopress-insights/seopress-insights.php')) { ?>
74
  <li>
75
+ <a href="<?php echo admin_url('admin.php?page=seopress-insights'); ?>">
76
  <span class="dashicons dashicons-chart-line"></span>
77
+ <?php _e('Insights', 'wp-seopress'); ?>
78
  </a>
79
  </li>
80
  <?php
81
+ }
82
+ if (is_plugin_active('wp-seopress-pro/seopress-pro.php')) { ?>
83
  <li>
84
+ <a href="<?php echo admin_url('admin.php?page=seopress-pro-page#tab=tab_seopress_woocommerce'); ?>">
85
  <span class="dashicons dashicons-cart"></span>
86
+ <?php _e('WooCommerce', 'wp-seopress'); ?>
87
  </a>
88
  </li>
89
  <li>
90
+ <a href="<?php echo admin_url('admin.php?page=seopress-pro-page#tab=tab_seopress_edd'); ?>">
91
  <span class="dashicons dashicons-cart"></span>
92
+ <?php _e('Easy Digital Downloads', 'wp-seopress'); ?>
93
  </a>
94
  </li>
95
  <li>
96
+ <a href="<?php echo admin_url('admin.php?page=seopress-pro-page#tab=tab_seopress_local_business'); ?>">
97
  <span class="dashicons dashicons-store"></span>
98
+ <?php _e('Local Business', 'wp-seopress'); ?>
99
  </a>
100
  </li>
101
  <li>
102
+ <a href="<?php echo admin_url('admin.php?page=seopress-pro-page#tab=tab_seopress_dublin_core'); ?>">
103
  <span class="dashicons dashicons-welcome-learn-more"></span>
104
+ <?php _e('Dublin Core', 'wp-seopress'); ?>
105
  </a>
106
  </li>
107
  <li>
108
+ <a href="<?php echo admin_url('admin.php?page=seopress-pro-page#tab=tab_seopress_rich_snippets'); ?>">
109
  <span class="dashicons dashicons-media-spreadsheet"></span>
110
+ <?php _e('Structured Data Types (schema.org)', 'wp-seopress'); ?>
111
  </a>
112
  </li>
113
  <li>
114
+ <a href="<?php echo admin_url('admin.php?page=seopress-pro-page#tab=tab_seopress_breadcrumbs'); ?>">
115
  <span class="dashicons dashicons-feedback"></span>
116
+ <?php _e('Breadcrumbs', 'wp-seopress'); ?>
117
  </a>
118
  </li>
119
  <li>
120
+ <a href="<?php echo admin_url('admin.php?page=seopress-pro-page#tab=tab_seopress_page_speed'); ?>">
121
  <span class="dashicons dashicons-performance"></span>
122
+ <?php _e('Google Page Speed', 'wp-seopress'); ?>
123
  </a>
124
  </li>
125
+ <?php if ( ! is_multisite() || (is_multisite() && defined('SUBDOMAIN_INSTALL') && true === constant('SUBDOMAIN_INSTALL'))) { //subdomains or single site ?>
126
  <li>
127
+ <a href="<?php echo admin_url('admin.php?page=seopress-pro-page#tab=tab_seopress_robots'); ?>">
128
  <span class="dashicons dashicons-media-text"></span>
129
+ <?php _e('robots.txt', 'wp-seopress'); ?>
130
  </a>
131
  </li>
132
  <?php } ?>
133
  <li>
134
+ <a href="<?php echo admin_url('admin.php?page=seopress-pro-page#tab=tab_seopress_news'); ?>">
135
  <span class="dashicons dashicons-admin-post"></span>
136
+ <?php _e('Google News Sitemap', 'wp-seopress'); ?>
137
  </a>
138
  </li>
139
  <li>
140
+ <a href="<?php echo admin_url('admin.php?page=seopress-pro-page#tab=tab_seopress_404'); ?>">
141
  <span class="dashicons dashicons-admin-links"></span>
142
+ <?php _e('Redirections', 'wp-seopress'); ?>
143
  </a>
144
  </li>
145
  <li>
146
+ <a href="<?php echo admin_url('edit.php?post_type=seopress_bot'); ?>">
147
  <span class="dashicons dashicons-admin-generic"></span>
148
+ <?php _e('Broken links', 'wp-seopress'); ?>
149
  </a>
150
  </li>
151
  <li>
152
+ <a href="<?php echo admin_url('admin.php?page=seopress-pro-page#tab=tab_seopress_rewrite'); ?>">
153
  <span class="dashicons dashicons-admin-links"></span>
154
+ <?php _e('URL Rewriting', 'wp-seopress'); ?>
155
  </a>
156
  </li>
157
+ <?php if ( ! is_multisite()) { ?>
158
  <li>
159
+ <a href="<?php echo admin_url('admin.php?page=seopress-pro-page#tab=tab_seopress_white_label'); ?>">
160
  <span class="dashicons dashicons-tag"></span>
161
+ <?php _e('White Label', 'wp-seopress'); ?>
162
  </a>
163
  </li>
164
  <li>
165
+ <a href="<?php echo admin_url('admin.php?page=seopress-pro-page#tab=tab_seopress_htaccess'); ?>">
166
  <span class="dashicons dashicons-media-text"></span>
167
+ <?php _e('.htaccess', 'wp-seopress'); ?>
168
  </a>
169
  </li>
170
  <?php } ?>
171
  <li>
172
+ <a href="<?php echo admin_url('admin.php?page=seopress-pro-page#tab=tab_seopress_rss'); ?>">
173
  <span class="dashicons dashicons-rss"></span>
174
+ <?php _e('RSS', 'wp-seopress'); ?>
175
  </a>
176
  </li>
177
  <li>
178
+ <a href="<?php echo admin_url('admin.php?page=seopress-license'); ?>">
179
  <span class="dashicons dashicons-admin-network"></span>
180
+ <?php _e('License', 'wp-seopress'); ?>
181
  </a>
182
  </li>
183
  <?php } ?>
184
  <li>
185
+ <a href="<?php echo admin_url('admin.php?page=seopress-import-export'); ?>">
186
  <span class="dashicons dashicons-admin-settings"></span>
187
+ <?php _e('Tools', 'wp-seopress'); ?>
188
  </a>
189
  </li>
190
  </ul>
191
  </div>
192
  </h1>
193
  <?php
194
+
195
+ if (defined('SEOPRESS_WL_ICONS_HEADER') && SEOPRESS_WL_ICONS_HEADER === false) {
196
+ //do nothing
197
+ } else {
198
+ if (function_exists('seopress_get_locale') && 'fr' == seopress_get_locale()) {
199
+ $seopress_docs_link['changelog'] = 'https://www.seopress.org/fr/journal-modifications/?utm_source=plugin&utm_medium=wp-admin&utm_campaign=seopress';
200
+ $seopress_docs_link['website'] = 'https://www.seopress.org/fr/?utm_source=plugin&utm_medium=wp-admin&utm_campaign=seopress';
201
+ $seopress_docs_link['support'] = 'https://www.seopress.org/fr/support/?utm_source=plugin&utm_medium=wp-admin&utm_campaign=seopress';
202
+ } else {
203
+ $seopress_docs_link['changelog'] = 'https://www.seopress.org/changelog/?utm_source=plugin&utm_medium=wp-admin&utm_campaign=seopress';
204
+ $seopress_docs_link['website'] = 'https://www.seopress.org/?utm_source=plugin&utm_medium=wp-admin&utm_campaign=seopress';
205
+ $seopress_docs_link['support'] = 'https://www.seopress.org/support/?utm_source=plugin&utm_medium=wp-admin&utm_campaign=seopress';
206
+ } ?>
207
  <div id="seopress-notice">
208
  <div class="small">
209
  <a href="<?php echo $seopress_docs_link['changelog']; ?>" target="_blank">
210
  <div class="dashicons dashicons-media-text"></div>
211
+ <div class="tooltip"><?php _e('See the changelog', 'wp-seopress'); ?></div>
212
  </a>
213
  <a href="mailto:contact@seopress.org" target="_blank">
214
  <div class="dashicons dashicons-megaphone"></div>
215
+ <div class="tooltip"><?php _e('Send feedback', 'wp-seopress'); ?></div>
216
  </a>
217
  <a href="https://www.facebook.com/groups/seopress/" target="_blank">
218
  <div class="dashicons dashicons-facebook"></div>
219
+ <div class="tooltip"><?php _e('Join our Facebook Community group', 'wp-seopress'); ?></div>
220
  </a>
221
  <a href="https://twitter.com/wp_seopress" target="_blank">
222
  <div class="dashicons dashicons-twitter"></div>
223
+ <div class="tooltip"><?php _e('Follow us on Twitter', 'wp-seopress'); ?></div>
224
  </a>
225
  <a href="https://www.youtube.com/SEOPress" target="_blank">
226
  <div class="dashicons dashicons-video-alt3"></div>
227
+ <div class="tooltip"><?php _e('Follow us on YouTube', 'wp-seopress'); ?></div>
228
  </a>
229
  <a href="<?php echo $seopress_docs_link['website']; ?>" target="_blank">
230
  <div class="dashicons dashicons-info"></div>
231
+ <div class="tooltip"><?php _e('Official website', 'wp-seopress'); ?></div>
232
  </a>
233
  <a href="<?php echo $seopress_docs_link['support']; ?>" target="_blank">
234
  <div class="dashicons dashicons-editor-help"></div>
235
+ <div class="tooltip"><?php _e('Support', 'wp-seopress'); ?></div>
236
  </a>
237
  </div>
238
  </div>
239
+ <?php
240
+ } ?>
241
  </div>
242
  </div>
243
  </div>
inc/admin/admin.php CHANGED
@@ -41,180 +41,187 @@ class seopress_options {
41
  add_submenu_page('seopress-option', __('Advanced', 'wp-seopress'), __('Advanced', 'wp-seopress'), seopress_capability('manage_options', 'menu'), 'seopress-advanced', [$this, 'seopress_advanced_page']);
42
  add_submenu_page('seopress-option', __('Tools', 'wp-seopress'), __('Tools', 'wp-seopress'), seopress_capability('manage_options', 'menu'), 'seopress-import-export', [$this, 'seopress_import_export_page']);
43
 
44
- if (function_exists('seopress_white_label_help_links_option') && seopress_white_label_help_links_option() !=='1') {//If White label ON
45
- function seopress_titles_help_tab() {
46
- $screen = get_current_screen();
47
-
48
- $seopress_titles_help_tab_content = '
49
- <ul>
50
- <li><span>' . __('%%sep%%', 'wp-seopress') . '</span>' . __('Separator (eg: - )', 'wp-seopress') . '</li>
51
- <li><span>' . __('%%sitetitle%% (alias: %%sitename%%)', 'wp-seopress') . '</span>' . __('Site Title', 'wp-seopress') . '</li>
52
- <li><span>' . __('%%tagline%% (alias %%sitedesc%%)', 'wp-seopress') . '</span>' . __('Tagline', 'wp-seopress') . '</li>
53
- <li><span>' . __('%%post_title%% (alias %%title%%)', 'wp-seopress') . '</span>' . __('Post Title (post, page, custom post type)', 'wp-seopress') . '</li>
54
- <li><span>' . __('%%post_excerpt%% (alias %%excerpt%%)', 'wp-seopress') . '</span>' . __('Post excerpt', 'wp-seopress') . '</li>
55
- <li><span>' . __('%%post_content%%', 'wp-seopress') . '</span>' . __('Post content / product long description', 'wp-seopress') . '</li>
56
- <li><span>' . __('%%post_thumbnail_url%%', 'wp-seopress') . '</span>' . __('Post thumbnail URL', 'wp-seopress') . '</li>
57
- <li><span>' . __('%%post_url%%', 'wp-seopress') . '</span>' . __('Post URL (permalink)', 'wp-seopress') . '</li>
58
- <li><span>' . __('%%post_date%% (alias %%date%%)', 'wp-seopress') . '</span>' . __('Post date', 'wp-seopress') . '</li>
59
- <li><span>' . __('%%post_modified_date%%', 'wp-seopress') . '</span>' . __('Last modified post date', 'wp-seopress') . '</li>
60
- <li><span>' . __('%%post_author%%', 'wp-seopress') . '</span>' . __('Post author', 'wp-seopress') . '</li>
61
- <li><span>' . __('%%post_category%%', 'wp-seopress') . '</span>' . __('Post category', 'wp-seopress') . '</li>
62
- <li><span>' . __('%%post_tag%%', 'wp-seopress') . '</span>' . __('Post tag', 'wp-seopress') . '</li>
63
- <li><span>' . __('%%_category_title%%', 'wp-seopress') . '</span>' . __('Category title', 'wp-seopress') . '</li>
64
- <li><span>' . __('%%_category_description%%', 'wp-seopress') . '</span>' . __('Category description', 'wp-seopress') . '</li>
65
- <li><span>' . __('%%tag_title%%', 'wp-seopress') . '</span>' . __('Tag title', 'wp-seopress') . '</li>
66
- <li><span>' . __('%%tag_description%%', 'wp-seopress') . '</span>' . __('Tag description', 'wp-seopress') . '</li>
67
- <li><span>' . __('%%term_title%%', 'wp-seopress') . '</span>' . __('Term title', 'wp-seopress') . '</li>
68
- <li><span>' . __('%%term_description%%', 'wp-seopress') . '</span>' . __('Term description', 'wp-seopress') . '</li>
69
- <li><span>' . __('%%search_keywords%%', 'wp-seopress') . '</span>' . __('Search keywords', 'wp-seopress') . '</li>
70
- <li><span>' . __('%%current_pagination%%', 'wp-seopress') . '</span>' . __('Current number page', 'wp-seopress') . '</li>
71
- <li><span>' . __('%%page%%', 'wp-seopress') . '</span>' . __('Current page number with context (i.e. page 1 of 3)', 'wp-seopress') . '</li>
72
- <li><span>' . __('%%cpt_plural%%', 'wp-seopress') . '</span>' . __('Plural Post Type Archive name', 'wp-seopress') . '</li>
73
- <li><span>' . __('%%archive_title%%', 'wp-seopress') . '</span>' . __('Archive title', 'wp-seopress') . '</li>
74
- <li><span>' . __('%%archive_date%%', 'wp-seopress') . '</span>' . __('Date Archive', 'wp-seopress') . '</li>
75
- <li><span>' . __('%%archive_date_day%%', 'wp-seopress') . '</span>' . __('Day Archive date', 'wp-seopress') . '</li>
76
- <li><span>' . __('%%archive_date_month%%', 'wp-seopress') . '</span>' . __('Month Archive title', 'wp-seopress') . '</li>
77
- <li><span>' . __('%%archive_date_year%%', 'wp-seopress') . '</span>' . __('Year Archive title', 'wp-seopress') . '</li>
78
- <li><span>' . __('%%_cf_your_custom_field_name%%', 'wp-seopress') . '</span>' . __('Custom fields from post, page or post type (replace <span style="color:red;margin:0">your_custom_field_name</span> with your custom field name)', 'wp-seopress') . '</li>
79
- <li><span>' . __('%%_ct_your_custom_taxonomy_slug%%', 'wp-seopress') . '</span>' . __('Custom term taxonomy from post, page or post type (replace <span style="color:red;margin:0">your_custom_taxonomy_slug</span> with your custom taxonomy slug)', 'wp-seopress') . '</li>
80
- <li><span>' . __('%%wc_single_cat%%', 'wp-seopress') . '</span>' . __('Single product category', 'wp-seopress') . '</li>
81
- <li><span>' . __('%%wc_single_tag%%', 'wp-seopress') . '</span>' . __('Single product tag', 'wp-seopress') . '</li>
82
- <li><span>' . __('%%wc_single_short_desc%%', 'wp-seopress') . '</span>' . __('Single product short description', 'wp-seopress') . '</li>
83
- <li><span>' . __('%%wc_single_price%%', 'wp-seopress') . '</span>' . __('Single product price', 'wp-seopress') . '</li>
84
- <li><span>' . __('%%wc_single_price_exc_tax%%', 'wp-seopress') . '</span>' . __('Single product price taxes excluded', 'wp-seopress') . '</li>
85
- <li><span>' . __('%%wc_sku%%', 'wp-seopress') . '</span>' . __('Single SKU product', 'wp-seopress') . '</li>
86
- <li><span>' . __('%%currentday%%', 'wp-seopress') . '</span>' . __('Current day', 'wp-seopress') . '</li>
87
- <li><span>' . __('%%currentmonth%%', 'wp-seopress') . '</span>' . __('Current month', 'wp-seopress') . '</li>
88
- <li><span>' . __('%%currentmonth_short%%', 'wp-seopress') . '</span>' . __('Current month in 3 letters, eg: "Jan" for "January"', 'wp-seopress') . '</li>
89
- <li><span>' . __('%%currentyear%%', 'wp-seopress') . '</span>' . __('Current year', 'wp-seopress') . '</li>
90
- <li><span>' . __('%%currentdate%%', 'wp-seopress') . '</span>' . __('Current date', 'wp-seopress') . '</li>
91
- <li><span>' . __('%%currenttime%%', 'wp-seopress') . '</span>' . __('Current time', 'wp-seopress') . '</li>
92
- <li><span>' . __('%%author_bio%%', 'wp-seopress') . '</span>' . __('Author biography (description), meta desc only', 'wp-seopress') . '</li>
93
- <li><span>' . __('%%currentmonth_num%%', 'wp-seopress') . '</span>' . __('Current month in digital format', 'wp-seopress') . '</li>
94
- </ul>
95
- ' . wp_oembed_get('https://www.youtube.com/watch?v=Jretu4Gpgo8', ['width'=>530]);
96
-
97
- $seopress_titles_help_robots_tab_content = wp_oembed_get('https://www.youtube.com/watch?v=Jretu4Gpgo8', ['width'=>530]);
98
-
99
- $screen->add_help_tab([
100
- 'id' => 'seopress_titles_help_tab',
101
- 'title' => __('Templates variables', 'wp-seopress'),
102
- 'content' => $seopress_titles_help_tab_content,
103
- ]);
104
-
105
- $screen->add_help_tab([
106
- 'id' => 'seopress_titles_help_robots_tab',
107
- 'title' => __('Edit your meta robots', 'wp-seopress'),
108
- 'content' => $seopress_titles_help_robots_tab_content,
109
- ]);
110
-
111
- if (function_exists('seopress_get_locale') && 'fr' == seopress_get_locale()) {
112
- $screen->set_help_sidebar(
113
- '<ul>
114
- <li><a href="https://www.seopress.org/fr/support/guides/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Browse our guides', 'wp-seopress') . '</a></li>
115
- <li><a href="https://www.seopress.org/fr/support/faq/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our FAQ', 'wp-seopress') . '</a></li>
116
- <li><a href="https://www.seopress.org/fr/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Check our website', 'wp-seopress') . '</a></li>
117
- </ul>'
118
- );
119
- } else {
120
- $screen->set_help_sidebar(
121
- '<ul>
122
- <li><a href="https://www.seopress.org/support/guides/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Browse our guides', 'wp-seopress') . '</a></li>
123
- <li><a href="https://www.seopress.org/support/faq/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our FAQ', 'wp-seopress') . '</a></li>
124
- <li><a href="https://www.seopress.org/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Check our website', 'wp-seopress') . '</a></li>
125
- </ul>'
126
- );
127
  }
128
  }
129
- add_action('load-' . $seopress_titles_help_tab, 'seopress_titles_help_tab');
130
-
131
- function seopress_xml_sitemaps_help_tab() {
132
- $screen = get_current_screen();
133
-
134
- $seopress_xml_sitemaps_help_tab_content = '
135
- <p>' . __('Watch our video to learn how to enable XML sitemaps to improve crawling and them to Google Search Console.', 'wp-seopress') . '</p>
136
- ' . wp_oembed_get('https://www.youtube.com/watch?v=Bjfspe1nusY', ['width'=>530]);
137
-
138
- $screen->add_help_tab([
139
- 'id' => 'seopress_google_analytics_help_tab',
140
- 'title' => __('How-to', 'wp-seopress'),
141
- 'content' => $seopress_xml_sitemaps_help_tab_content,
142
- ]);
143
-
144
- if (function_exists('seopress_get_locale') && 'fr' == seopress_get_locale()) {
145
- $screen->set_help_sidebar(
146
- '<ul>
147
- <li><a href="https://www.seopress.org/fr/support/guides/activer-sitemap-xml/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our guide', 'wp-seopress') . '</a></li>
148
- </ul>'
149
- );
150
- } else {
151
- $screen->set_help_sidebar(
152
- '<ul>
153
- <li><a href="https://www.seopress.org/support/guides/enable-xml-sitemaps/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our guide', 'wp-seopress') . '</a></li>
154
- </ul>'
155
- );
156
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  }
158
- add_action('load-' . $seopress_xml_sitemaps_help_tab, 'seopress_xml_sitemaps_help_tab');
159
-
160
- function seopress_social_networks_help_tab() {
161
- $screen = get_current_screen();
162
-
163
- $seopress_social_networks_help_tab_content = '
164
- <p>' . __('Watch our video to learn how to edit your Open Graph and Twitters Cards tags to improve social sharing.', 'wp-seopress') . '</p>
165
- ' . wp_oembed_get('https://www.youtube.com/watch?v=TX3AUsI6vKk', ['width'=>530]);
166
-
167
- $screen->add_help_tab([
168
- 'id' => 'seopress_social_networks_help_tab',
169
- 'title' => __('How-to', 'wp-seopress'),
170
- 'content' => $seopress_social_networks_help_tab_content,
171
- ]);
172
-
173
- if (function_exists('seopress_get_locale') && 'fr' == seopress_get_locale()) {
174
- $screen->set_help_sidebar(
175
- '<ul>
176
- <li><a href="https://www.seopress.org/fr/support/guides/gerer-les-metas-facebook-open-graph-et-twitter-cards/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our guide', 'wp-seopress') . '</a></li>
177
- </ul>'
178
- );
179
- } else {
180
- $screen->set_help_sidebar(
181
- '<ul>
182
- <li><a href="https://www.seopress.org/support/guides/manage-facebook-open-graph-and-twitter-cards-metas/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our guide', 'wp-seopress') . '</a></li>
183
- </ul>'
184
- );
185
- }
186
  }
187
- add_action('load-' . $seopress_social_networks_help_tab, 'seopress_social_networks_help_tab');
188
-
189
- function seopress_google_analytics_help_tab() {
190
- $screen = get_current_screen();
191
-
192
- $seopress_google_analytics_help_tab_content = '
193
- <p>' . __('Watch our video to learn how to connect your WordPress site with Google Analytics and get statistics right in your dashboard (PRO only).', 'wp-seopress') . '</p>
194
- ' . wp_oembed_get('https://www.youtube.com/watch?v=2EWdogYuFgs', ['width'=>530]);
195
-
196
- $screen->add_help_tab([
197
- 'id' => 'seopress_google_analytics_help_tab',
198
- 'title' => __('How-to', 'wp-seopress'),
199
- 'content' => $seopress_google_analytics_help_tab_content,
200
- ]);
201
-
202
- if (function_exists('seopress_get_locale') && 'fr' == seopress_get_locale()) {
203
- $screen->set_help_sidebar(
204
- '<ul>
205
- <li><a href="https://www.seopress.org/fr/support/guides/connectez-site-wordpress-a-google-analytics/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our guide', 'wp-seopress') . '</a></li>
206
- </ul>'
207
- );
208
- } else {
209
- $screen->set_help_sidebar(
210
- '<ul>
211
- <li><a href="https://www.seopress.org/support/guides/connect-wordpress-site-google-analytics/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our guide', 'wp-seopress') . '</a></li>
212
- </ul>'
213
- );
214
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  }
216
- add_action('load-' . $seopress_google_analytics_help_tab, 'seopress_google_analytics_help_tab');
217
  }
 
218
  }
219
 
220
  public function seopress_titles_page() {
41
  add_submenu_page('seopress-option', __('Advanced', 'wp-seopress'), __('Advanced', 'wp-seopress'), seopress_capability('manage_options', 'menu'), 'seopress-advanced', [$this, 'seopress_advanced_page']);
42
  add_submenu_page('seopress-option', __('Tools', 'wp-seopress'), __('Tools', 'wp-seopress'), seopress_capability('manage_options', 'menu'), 'seopress-import-export', [$this, 'seopress_import_export_page']);
43
 
44
+ if (function_exists('seopress_get_toggle_white_label_option')) {
45
+ $white_label_toggle = seopress_get_toggle_white_label_option();
46
+ if ('1' === $white_label_toggle) {
47
+ if ('1' === seopress_white_label_help_links_option()) {
48
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  }
50
  }
51
+ }
52
+
53
+ function seopress_titles_help_tab() {
54
+ $screen = get_current_screen();
55
+
56
+ $seopress_titles_help_tab_content = '
57
+ <ul>
58
+ <li><span>' . __('%%sep%%', 'wp-seopress') . '</span>' . __('Separator (eg: - )', 'wp-seopress') . '</li>
59
+ <li><span>' . __('%%sitetitle%% (alias: %%sitename%%)', 'wp-seopress') . '</span>' . __('Site Title', 'wp-seopress') . '</li>
60
+ <li><span>' . __('%%tagline%% (alias %%sitedesc%%)', 'wp-seopress') . '</span>' . __('Tagline', 'wp-seopress') . '</li>
61
+ <li><span>' . __('%%post_title%% (alias %%title%%)', 'wp-seopress') . '</span>' . __('Post Title (post, page, custom post type)', 'wp-seopress') . '</li>
62
+ <li><span>' . __('%%post_excerpt%% (alias %%excerpt%%)', 'wp-seopress') . '</span>' . __('Post excerpt', 'wp-seopress') . '</li>
63
+ <li><span>' . __('%%post_content%%', 'wp-seopress') . '</span>' . __('Post content / product long description', 'wp-seopress') . '</li>
64
+ <li><span>' . __('%%post_thumbnail_url%%', 'wp-seopress') . '</span>' . __('Post thumbnail URL', 'wp-seopress') . '</li>
65
+ <li><span>' . __('%%post_url%%', 'wp-seopress') . '</span>' . __('Post URL (permalink)', 'wp-seopress') . '</li>
66
+ <li><span>' . __('%%post_date%% (alias %%date%%)', 'wp-seopress') . '</span>' . __('Post date', 'wp-seopress') . '</li>
67
+ <li><span>' . __('%%post_modified_date%%', 'wp-seopress') . '</span>' . __('Last modified post date', 'wp-seopress') . '</li>
68
+ <li><span>' . __('%%post_author%%', 'wp-seopress') . '</span>' . __('Post author', 'wp-seopress') . '</li>
69
+ <li><span>' . __('%%post_category%%', 'wp-seopress') . '</span>' . __('Post category', 'wp-seopress') . '</li>
70
+ <li><span>' . __('%%post_tag%%', 'wp-seopress') . '</span>' . __('Post tag', 'wp-seopress') . '</li>
71
+ <li><span>' . __('%%_category_title%%', 'wp-seopress') . '</span>' . __('Category title', 'wp-seopress') . '</li>
72
+ <li><span>' . __('%%_category_description%%', 'wp-seopress') . '</span>' . __('Category description', 'wp-seopress') . '</li>
73
+ <li><span>' . __('%%tag_title%%', 'wp-seopress') . '</span>' . __('Tag title', 'wp-seopress') . '</li>
74
+ <li><span>' . __('%%tag_description%%', 'wp-seopress') . '</span>' . __('Tag description', 'wp-seopress') . '</li>
75
+ <li><span>' . __('%%term_title%%', 'wp-seopress') . '</span>' . __('Term title', 'wp-seopress') . '</li>
76
+ <li><span>' . __('%%term_description%%', 'wp-seopress') . '</span>' . __('Term description', 'wp-seopress') . '</li>
77
+ <li><span>' . __('%%search_keywords%%', 'wp-seopress') . '</span>' . __('Search keywords', 'wp-seopress') . '</li>
78
+ <li><span>' . __('%%current_pagination%%', 'wp-seopress') . '</span>' . __('Current number page', 'wp-seopress') . '</li>
79
+ <li><span>' . __('%%page%%', 'wp-seopress') . '</span>' . __('Current page number with context (i.e. page 1 of 3)', 'wp-seopress') . '</li>
80
+ <li><span>' . __('%%cpt_plural%%', 'wp-seopress') . '</span>' . __('Plural Post Type Archive name', 'wp-seopress') . '</li>
81
+ <li><span>' . __('%%archive_title%%', 'wp-seopress') . '</span>' . __('Archive title', 'wp-seopress') . '</li>
82
+ <li><span>' . __('%%archive_date%%', 'wp-seopress') . '</span>' . __('Date Archive', 'wp-seopress') . '</li>
83
+ <li><span>' . __('%%archive_date_day%%', 'wp-seopress') . '</span>' . __('Day Archive date', 'wp-seopress') . '</li>
84
+ <li><span>' . __('%%archive_date_month%%', 'wp-seopress') . '</span>' . __('Month Archive title', 'wp-seopress') . '</li>
85
+ <li><span>' . __('%%archive_date_year%%', 'wp-seopress') . '</span>' . __('Year Archive title', 'wp-seopress') . '</li>
86
+ <li><span>' . __('%%_cf_your_custom_field_name%%', 'wp-seopress') . '</span>' . __('Custom fields from post, page or post type (replace <span style="color:red;margin:0">your_custom_field_name</span> with your custom field name)', 'wp-seopress') . '</li>
87
+ <li><span>' . __('%%_ct_your_custom_taxonomy_slug%%', 'wp-seopress') . '</span>' . __('Custom term taxonomy from post, page or post type (replace <span style="color:red;margin:0">your_custom_taxonomy_slug</span> with your custom taxonomy slug)', 'wp-seopress') . '</li>
88
+ <li><span>' . __('%%wc_single_cat%%', 'wp-seopress') . '</span>' . __('Single product category', 'wp-seopress') . '</li>
89
+ <li><span>' . __('%%wc_single_tag%%', 'wp-seopress') . '</span>' . __('Single product tag', 'wp-seopress') . '</li>
90
+ <li><span>' . __('%%wc_single_short_desc%%', 'wp-seopress') . '</span>' . __('Single product short description', 'wp-seopress') . '</li>
91
+ <li><span>' . __('%%wc_single_price%%', 'wp-seopress') . '</span>' . __('Single product price', 'wp-seopress') . '</li>
92
+ <li><span>' . __('%%wc_single_price_exc_tax%%', 'wp-seopress') . '</span>' . __('Single product price taxes excluded', 'wp-seopress') . '</li>
93
+ <li><span>' . __('%%wc_sku%%', 'wp-seopress') . '</span>' . __('Single SKU product', 'wp-seopress') . '</li>
94
+ <li><span>' . __('%%currentday%%', 'wp-seopress') . '</span>' . __('Current day', 'wp-seopress') . '</li>
95
+ <li><span>' . __('%%currentmonth%%', 'wp-seopress') . '</span>' . __('Current month', 'wp-seopress') . '</li>
96
+ <li><span>' . __('%%currentmonth_short%%', 'wp-seopress') . '</span>' . __('Current month in 3 letters, eg: "Jan" for "January"', 'wp-seopress') . '</li>
97
+ <li><span>' . __('%%currentyear%%', 'wp-seopress') . '</span>' . __('Current year', 'wp-seopress') . '</li>
98
+ <li><span>' . __('%%currentdate%%', 'wp-seopress') . '</span>' . __('Current date', 'wp-seopress') . '</li>
99
+ <li><span>' . __('%%currenttime%%', 'wp-seopress') . '</span>' . __('Current time', 'wp-seopress') . '</li>
100
+ <li><span>' . __('%%author_bio%%', 'wp-seopress') . '</span>' . __('Author biography (description), meta desc only', 'wp-seopress') . '</li>
101
+ <li><span>' . __('%%currentmonth_num%%', 'wp-seopress') . '</span>' . __('Current month in digital format', 'wp-seopress') . '</li>
102
+ </ul>
103
+ ' . wp_oembed_get('https://www.youtube.com/watch?v=Jretu4Gpgo8', ['width'=>530]);
104
+
105
+ $seopress_titles_help_robots_tab_content = wp_oembed_get('https://www.youtube.com/watch?v=Jretu4Gpgo8', ['width'=>530]);
106
+
107
+ $screen->add_help_tab([
108
+ 'id' => 'seopress_titles_help_tab',
109
+ 'title' => __('Templates variables', 'wp-seopress'),
110
+ 'content' => $seopress_titles_help_tab_content,
111
+ ]);
112
+
113
+ $screen->add_help_tab([
114
+ 'id' => 'seopress_titles_help_robots_tab',
115
+ 'title' => __('Edit your meta robots', 'wp-seopress'),
116
+ 'content' => $seopress_titles_help_robots_tab_content,
117
+ ]);
118
+
119
+ if (function_exists('seopress_get_locale') && 'fr' == seopress_get_locale()) {
120
+ $screen->set_help_sidebar(
121
+ '<ul>
122
+ <li><a href="https://www.seopress.org/fr/support/guides/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Browse our guides', 'wp-seopress') . '</a></li>
123
+ <li><a href="https://www.seopress.org/fr/support/faq/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our FAQ', 'wp-seopress') . '</a></li>
124
+ <li><a href="https://www.seopress.org/fr/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Check our website', 'wp-seopress') . '</a></li>
125
+ </ul>'
126
+ );
127
+ } else {
128
+ $screen->set_help_sidebar(
129
+ '<ul>
130
+ <li><a href="https://www.seopress.org/support/guides/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Browse our guides', 'wp-seopress') . '</a></li>
131
+ <li><a href="https://www.seopress.org/support/faq/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our FAQ', 'wp-seopress') . '</a></li>
132
+ <li><a href="https://www.seopress.org/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Check our website', 'wp-seopress') . '</a></li>
133
+ </ul>'
134
+ );
135
  }
136
+ }
137
+ add_action('load-' . $seopress_titles_help_tab, 'seopress_titles_help_tab');
138
+
139
+ function seopress_xml_sitemaps_help_tab() {
140
+ $screen = get_current_screen();
141
+
142
+ $seopress_xml_sitemaps_help_tab_content = '
143
+ <p>' . __('Watch our video to learn how to enable XML sitemaps to improve crawling and them to Google Search Console.', 'wp-seopress') . '</p>
144
+ ' . wp_oembed_get('https://www.youtube.com/watch?v=Bjfspe1nusY', ['width'=>530]);
145
+
146
+ $screen->add_help_tab([
147
+ 'id' => 'seopress_google_analytics_help_tab',
148
+ 'title' => __('How-to', 'wp-seopress'),
149
+ 'content' => $seopress_xml_sitemaps_help_tab_content,
150
+ ]);
151
+
152
+ if (function_exists('seopress_get_locale') && 'fr' == seopress_get_locale()) {
153
+ $screen->set_help_sidebar(
154
+ '<ul>
155
+ <li><a href="https://www.seopress.org/fr/support/guides/activer-sitemap-xml/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our guide', 'wp-seopress') . '</a></li>
156
+ </ul>'
157
+ );
158
+ } else {
159
+ $screen->set_help_sidebar(
160
+ '<ul>
161
+ <li><a href="https://www.seopress.org/support/guides/enable-xml-sitemaps/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our guide', 'wp-seopress') . '</a></li>
162
+ </ul>'
163
+ );
164
  }
165
+ }
166
+ add_action('load-' . $seopress_xml_sitemaps_help_tab, 'seopress_xml_sitemaps_help_tab');
167
+
168
+ function seopress_social_networks_help_tab() {
169
+ $screen = get_current_screen();
170
+
171
+ $seopress_social_networks_help_tab_content = '
172
+ <p>' . __('Watch our video to learn how to edit your Open Graph and Twitters Cards tags to improve social sharing.', 'wp-seopress') . '</p>
173
+ ' . wp_oembed_get('https://www.youtube.com/watch?v=TX3AUsI6vKk', ['width'=>530]);
174
+
175
+ $screen->add_help_tab([
176
+ 'id' => 'seopress_social_networks_help_tab',
177
+ 'title' => __('How-to', 'wp-seopress'),
178
+ 'content' => $seopress_social_networks_help_tab_content,
179
+ ]);
180
+
181
+ if (function_exists('seopress_get_locale') && 'fr' == seopress_get_locale()) {
182
+ $screen->set_help_sidebar(
183
+ '<ul>
184
+ <li><a href="https://www.seopress.org/fr/support/guides/gerer-les-metas-facebook-open-graph-et-twitter-cards/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our guide', 'wp-seopress') . '</a></li>
185
+ </ul>'
186
+ );
187
+ } else {
188
+ $screen->set_help_sidebar(
189
+ '<ul>
190
+ <li><a href="https://www.seopress.org/support/guides/manage-facebook-open-graph-and-twitter-cards-metas/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our guide', 'wp-seopress') . '</a></li>
191
+ </ul>'
192
+ );
193
+ }
194
+ }
195
+ add_action('load-' . $seopress_social_networks_help_tab, 'seopress_social_networks_help_tab');
196
+
197
+ function seopress_google_analytics_help_tab() {
198
+ $screen = get_current_screen();
199
+
200
+ $seopress_google_analytics_help_tab_content = '
201
+ <p>' . __('Watch our video to learn how to connect your WordPress site with Google Analytics and get statistics right in your dashboard (PRO only).', 'wp-seopress') . '</p>
202
+ ' . wp_oembed_get('https://www.youtube.com/watch?v=2EWdogYuFgs', ['width'=>530]);
203
+
204
+ $screen->add_help_tab([
205
+ 'id' => 'seopress_google_analytics_help_tab',
206
+ 'title' => __('How-to', 'wp-seopress'),
207
+ 'content' => $seopress_google_analytics_help_tab_content,
208
+ ]);
209
+
210
+ if (function_exists('seopress_get_locale') && 'fr' == seopress_get_locale()) {
211
+ $screen->set_help_sidebar(
212
+ '<ul>
213
+ <li><a href="https://www.seopress.org/fr/support/guides/connectez-site-wordpress-a-google-analytics/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our guide', 'wp-seopress') . '</a></li>
214
+ </ul>'
215
+ );
216
+ } else {
217
+ $screen->set_help_sidebar(
218
+ '<ul>
219
+ <li><a href="https://www.seopress.org/support/guides/connect-wordpress-site-google-analytics/?utm_source=plugin&utm_medium=wp-admin-help-tab&utm_campaign=seopress" target="_blank">' . __('Read our guide', 'wp-seopress') . '</a></li>
220
+ </ul>'
221
+ );
222
  }
 
223
  }
224
+ add_action('load-' . $seopress_google_analytics_help_tab, 'seopress_google_analytics_help_tab');
225
  }
226
 
227
  public function seopress_titles_page() {
inc/admin/ajax.php CHANGED
@@ -96,7 +96,10 @@ function seopress_do_real_preview() {
96
  if ('post' == $seopress_origin) { //Default: post type
97
  //Oxygen compatibility
98
  if (is_plugin_active('oxygen/functions.php') && function_exists('ct_template_output')) {
99
- $response = wp_remote_get(get_permalink((int) $seopress_get_the_id), $args);
 
 
 
100
  } else {
101
  $response = wp_remote_get(get_preview_post_link((int) $seopress_get_the_id, ['no_admin_bar' => 1]), $args);
102
  }
96
  if ('post' == $seopress_origin) { //Default: post type
97
  //Oxygen compatibility
98
  if (is_plugin_active('oxygen/functions.php') && function_exists('ct_template_output')) {
99
+ $post_url = get_permalink((int) $seopress_get_the_id);
100
+ $post_url = add_query_arg('no_admin_bar', 1, $post_url);
101
+
102
+ $response = wp_remote_get($post_url, $args);
103
  } else {
104
  $response = wp_remote_get(get_preview_post_link((int) $seopress_get_the_id, ['no_admin_bar' => 1]), $args);
105
  }
inc/functions/options-google-ecommerce.php CHANGED
@@ -2,91 +2,93 @@
2
 
3
  defined('ABSPATH') or exit('Please don&rsquo;t call the plugin directly. Thanks :)');
4
 
5
- if (apply_filters('seopress_fallback_woocommerce_analytics', false)) {
6
- if (is_plugin_active('woocommerce/woocommerce.php')) {
7
- // Measure Purchases
8
- if (seopress_google_analytics_purchases_option()) {
9
- if (function_exists('is_order_received_page') && is_order_received_page()) {
10
- global $wp;
11
- $order_id = isset($wp->query_vars['order-received']) ? $wp->query_vars['order-received'] : 0;
12
-
13
- if (0 < $order_id && 1 != get_post_meta($order_id, '_seopress_ga_tracked', true)) {
14
- $order = wc_get_order($order_id);
15
-
16
- //Check order status
17
- if (method_exists($order, 'get_status') && ('processing' === $order->get_status()) || 'completed' === $order->get_status()) {
18
- $items_purchased = [];
19
- foreach ($order->get_items() as $item) {
20
- // Get Product object
21
- $_product = wc_get_product($item->get_product_id());
22
-
23
- if ( ! is_a($_product, 'WC_Product')) {
24
- continue;
25
- }
26
 
27
- // init vars
28
- $item_id = $_product->get_id();
29
- $variation_id = 0;
30
- $variation_data = null;
31
- $categories_js = null;
32
- $categories_out = [];
33
- $variant_js = null;
34
-
35
- // Set data
36
- $items_purchased['id'] = esc_js($item_id);
37
- $items_purchased['name'] = esc_js($item->get_name());
38
- $items_purchased['quantity'] = (float) esc_js($item->get_quantity());
39
- $items_purchased['price'] = (float) esc_js($order->get_item_total($item));
40
-
41
- // Categories and Variations
42
- $categories = get_the_terms($item_id, 'product_cat');
43
- if ($item->get_variation_id()) {
44
- $variation_id = $item->get_variation_id();
45
- $variation_data = wc_get_product_variation_attributes($variation_id);
46
- }
47
 
48
- // Variations
49
- if (is_array($variation_data) && ! empty($variation_data)) {
50
- $variant_js = esc_js(wc_get_formatted_variation($variation_data, true));
51
- $categories = get_the_terms($item_id, 'product_cat');
52
- $item_id = $variation_id;
 
 
 
 
 
 
 
53
 
54
- $items_purchased['variant'] = esc_js($variant_js);
55
- }
56
- // Categories
57
- if ($categories) {
58
- foreach ($categories as $category) {
59
- $categories_out[] = $category->name;
60
- }
61
- $categories_js = esc_js(implode('/', $categories_out));
62
-
63
- $items_purchased['category'] = esc_js($categories_js);
 
 
64
  }
 
65
 
66
- $final[] = $items_purchased;
67
  }
68
 
69
- $global_purchase = [
70
- 'transaction_id' => esc_js($order_id),
71
- 'affiliation' => esc_js(get_bloginfo('name')),
72
- 'value' => (float) esc_js($order->get_total()),
73
- 'currency' => esc_js($order->get_currency()),
74
- 'tax' => (float) esc_js($order->get_total_tax()),
75
- 'shipping' => (float) esc_js($order->get_shipping_total()),
76
- 'items' => $final,
77
- ];
78
-
79
- $seopress_google_analytics_click_event['purchase_tracking'] = 'gtag(\'event\', \'purchase\',';
80
- $seopress_google_analytics_click_event['purchase_tracking'] .= json_encode($global_purchase);
81
- $seopress_google_analytics_click_event['purchase_tracking'] .= ');';
82
- $seopress_google_analytics_click_event['purchase_tracking'] = apply_filters('seopress_gtag_ec_purchases_ev', $seopress_google_analytics_click_event['purchase_tracking']);
83
-
84
- update_post_meta($order_id, '_seopress_ga_tracked', true);
85
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  }
87
  }
88
  }
 
 
89
 
 
 
90
  // ADD TO CART
91
  if (seopress_google_analytics_add_to_cart_option()) {
92
  // Listing page
2
 
3
  defined('ABSPATH') or exit('Please don&rsquo;t call the plugin directly. Thanks :)');
4
 
5
+ if (is_plugin_active('woocommerce/woocommerce.php')) {
6
+ // Measure Purchases
7
+ if (seopress_google_analytics_purchases_option()) {
8
+ if (function_exists('is_order_received_page') && is_order_received_page()) {
9
+ global $wp;
10
+ $order_id = isset($wp->query_vars['order-received']) ? $wp->query_vars['order-received'] : 0;
11
+
12
+ if (0 < $order_id && 1 != get_post_meta($order_id, '_seopress_ga_tracked', true)) {
13
+ $order = wc_get_order($order_id);
14
+
15
+ //Check order status
16
+ if (method_exists($order, 'get_status') && ('processing' === $order->get_status()) || 'completed' === $order->get_status()) {
17
+ $items_purchased = [];
18
+ foreach ($order->get_items() as $item) {
19
+ // Get Product object
20
+ $_product = wc_get_product($item->get_product_id());
21
+
22
+ if ( ! is_a($_product, 'WC_Product')) {
23
+ continue;
24
+ }
 
25
 
26
+ // init vars
27
+ $item_id = $_product->get_id();
28
+ $variation_id = 0;
29
+ $variation_data = null;
30
+ $categories_js = null;
31
+ $categories_out = [];
32
+ $variant_js = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
+ // Set data
35
+ $items_purchased['id'] = esc_js($item_id);
36
+ $items_purchased['name'] = esc_js($item->get_name());
37
+ $items_purchased['quantity'] = (float) esc_js($item->get_quantity());
38
+ $items_purchased['price'] = (float) esc_js($order->get_item_total($item));
39
+
40
+ // Categories and Variations
41
+ $categories = get_the_terms($item_id, 'product_cat');
42
+ if ($item->get_variation_id()) {
43
+ $variation_id = $item->get_variation_id();
44
+ $variation_data = wc_get_product_variation_attributes($variation_id);
45
+ }
46
 
47
+ // Variations
48
+ if (is_array($variation_data) && ! empty($variation_data)) {
49
+ $variant_js = esc_js(wc_get_formatted_variation($variation_data, true));
50
+ $categories = get_the_terms($item_id, 'product_cat');
51
+ $item_id = $variation_id;
52
+
53
+ $items_purchased['variant'] = esc_js($variant_js);
54
+ }
55
+ // Categories
56
+ if ($categories) {
57
+ foreach ($categories as $category) {
58
+ $categories_out[] = $category->name;
59
  }
60
+ $categories_js = esc_js(implode('/', $categories_out));
61
 
62
+ $items_purchased['category'] = esc_js($categories_js);
63
  }
64
 
65
+ $final[] = $items_purchased;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  }
67
+
68
+ $global_purchase = [
69
+ 'transaction_id' => esc_js($order_id),
70
+ 'affiliation' => esc_js(get_bloginfo('name')),
71
+ 'value' => (float) esc_js($order->get_total()),
72
+ 'currency' => esc_js($order->get_currency()),
73
+ 'tax' => (float) esc_js($order->get_total_tax()),
74
+ 'shipping' => (float) esc_js($order->get_shipping_total()),
75
+ 'items' => $final,
76
+ ];
77
+
78
+ $seopress_google_analytics_click_event['purchase_tracking'] = 'gtag(\'event\', \'purchase\',';
79
+ $seopress_google_analytics_click_event['purchase_tracking'] .= json_encode($global_purchase);
80
+ $seopress_google_analytics_click_event['purchase_tracking'] .= ');';
81
+ $seopress_google_analytics_click_event['purchase_tracking'] = apply_filters('seopress_gtag_ec_purchases_ev', $seopress_google_analytics_click_event['purchase_tracking']);
82
+
83
+ update_post_meta($order_id, '_seopress_ga_tracked', true);
84
  }
85
  }
86
  }
87
+ }
88
+ }
89
 
90
+ if (apply_filters('seopress_fallback_woocommerce_analytics', false)) {
91
+ if (is_plugin_active('woocommerce/woocommerce.php')) {
92
  // ADD TO CART
93
  if (seopress_google_analytics_add_to_cart_option()) {
94
  // Listing page
inc/functions/sitemap/template-xml-sitemaps.php CHANGED
@@ -1,435 +1,462 @@
1
  <?php
2
- defined( 'ABSPATH' ) or die( 'Please don&rsquo;t call the plugin directly. Thanks :)' );
 
3
 
4
  //XML Index sitemaps
5
 
6
  //Headers
7
  if (function_exists('seopress_sitemaps_headers')) {
8
- seopress_sitemaps_headers();
9
  }
10
 
11
  //WPML
12
- add_filter( 'wpml_get_home_url', 'seopress_remove_wpml_home_url_filter', 20, 5 );
13
 
14
- add_filter( 'seopress_sitemaps_index_cpt_query', function( $args ) {
15
  global $sitepress, $sitepress_settings;
16
 
17
  $sitepress_settings['auto_adjust_ids'] = 0;
18
- remove_filter( 'terms_clauses', [ $sitepress, 'terms_clauses' ] );
19
- remove_filter( 'category_link', [ $sitepress, 'category_link_adjust_id' ], 1 );
20
 
21
  return $args;
22
  });
23
 
24
- add_action( 'the_post', function( $post ) {
25
- $language = apply_filters(
26
- 'wpml_element_language_code',
27
- null,
28
- [ 'element_id' => $post->ID, 'element_type' => 'page' ]
29
- );
30
- do_action( 'wpml_switch_language', $language );
31
  });
32
 
33
  function seopress_xml_sitemap_index() {
34
- $home_url = home_url().'/';
35
-
36
- if (function_exists('pll_home_url')) {
37
- $home_url = site_url().'/';
38
- }
39
-
40
- $home_url = apply_filters( 'seopress_sitemaps_home_url', $home_url );
41
-
42
- $seopress_sitemaps ='<?xml version="1.0" encoding="UTF-8"?>';
43
- $seopress_sitemaps .='<?xml-stylesheet type="text/xsl" href="'.$home_url.'sitemaps_xsl.xsl"?>';
44
- $seopress_sitemaps .= "\n";
45
- $seopress_sitemaps .='<sitemapindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
46
-
47
- //CPT
48
- if (seopress_xml_sitemap_post_types_list_option() !='') {
49
- foreach (seopress_xml_sitemap_post_types_list_option() as $cpt_key => $cpt_value) {
50
- foreach ($cpt_value as $_cpt_key => $_cpt_value) {
51
- if($_cpt_value =='1') {
52
- $args = [
53
- 'posts_per_page' => -1,
54
- 'post_type' => $cpt_key,
55
- 'post_status' => 'publish',
56
- 'meta_query' =>
57
- [
58
- 'relation' => 'OR',
59
- [
60
- 'key' => '_seopress_robots_index',
61
- 'value' => '',
62
- 'compare' => 'NOT EXISTS'
63
- ],
64
- [
65
- 'key' => '_seopress_robots_index',
66
- 'value' => 'yes',
67
- 'compare' => '!='
68
- ],
69
- ],
70
- 'fields' => 'ids',
71
- 'lang' => '',
72
- 'has_password' => false
73
- ];
74
-
75
- $args = apply_filters('seopress_sitemaps_index_post_types_query', $args, $cpt_key);
76
-
77
- $count_posts = count(get_posts( $args ));
78
-
79
- //Max posts per paginated sitemap
80
- $max = 1000;
81
- $max = apply_filters('seopress_sitemaps_max_posts_per_sitemap', $max);
82
-
83
- if ($count_posts >= $max) {
84
- $max_loop = $count_posts / $max;
85
- } else {
86
- $max_loop = 1;
87
- }
88
-
89
- $paged ='';
90
- $i = '';
91
- for ($i=0; $i < $max_loop ; $i++) {
92
-
93
- if (isset($offset) && absint($offset) && $offset !='' && $offset !=0) {
94
- $offset = ((($i)*$max));
95
- } else {
96
- $offset = 0;
97
- }
98
-
99
- if ($i >= 1 && $i <= $max_loop) {
100
- $paged = $i+1;
101
- } else {
102
- $paged = 1;
103
- }
104
-
105
- $seopress_sitemaps .= "\n";
106
- $seopress_sitemaps .= '<sitemap>';
107
- $seopress_sitemaps .= "\n";
108
- $seopress_sitemaps .= '<loc>';
109
- $seopress_sitemaps .= $home_url.'sitemaps/'.$cpt_key.'-sitemap'.$paged.'.xml';
110
- $seopress_sitemaps .= '</loc>';
111
- $seopress_sitemaps .= "\n";
112
-
113
- //Remove lastmod column in index sitemap for lage sitemap
114
- $display_lastmod = apply_filters( 'seopress_sitemaps_index_lastmod', false );
115
-
116
- if ($display_lastmod == true) {
117
- $args = [
118
- 'post_type' => $cpt_key,
119
- 'offset' => $offset,
120
- 'post_status' => 'publish',
121
- 'ignore_sticky_posts' => true,
122
- 'posts_per_page' => 1,
123
- 'meta_query' =>
124
- [
125
- 'relation' => 'OR',
126
- [
127
- 'key' => '_seopress_robots_index',
128
- 'value' => '',
129
- 'compare' => 'NOT EXISTS'
130
- ],
131
- [
132
- 'key' => '_seopress_robots_index',
133
- 'value' => 'yes',
134
- 'compare' => '!='
135
- ],
136
- ],
137
- 'order' => 'DESC',
138
- 'orderby' => 'modified',
139
- 'lang' => '',
140
- 'has_password' => false,
141
- ];
142
-
143
- $args = apply_filters('seopress_sitemaps_index_cpt_query', $args, $cpt_key);
144
-
145
- $get_latest_post = new WP_Query($args);
146
-
147
- if($get_latest_post->have_posts()){
148
- $seopress_sitemaps .= '<lastmod>';
149
- $seopress_sitemaps .= date("c", strtotime($get_latest_post->posts[0]->post_modified));
150
- $seopress_sitemaps .= '</lastmod>';
151
- $seopress_sitemaps .= "\n";
152
- }
153
- }
154
-
155
- $seopress_sitemaps .= '</sitemap>';
156
- }
157
- }
158
- }
159
- }
160
- }
161
-
162
- //Taxonomies
163
- if (seopress_xml_sitemap_taxonomies_list_option() !='') {
164
- //Init
165
- $seopress_xml_terms_list = [];
166
- foreach (seopress_xml_sitemap_taxonomies_list_option() as $tax_key => $tax_value) {
167
- foreach ($tax_value as $_tax_key => $_tax_value) {
168
- if($_tax_value =='1') {
169
- $args = [
170
- 'taxonomy' => $tax_key,
171
- 'hide_empty' => false,
172
- 'lang' => '',
173
- 'fields' => 'ids',
174
- 'meta_query' =>
175
- [
176
- 'relation' => 'OR',
177
- [
178
- 'key' => '_seopress_robots_index',
179
- 'value' => '',
180
- 'compare' => 'NOT EXISTS'
181
- ],
182
- [
183
- 'key' => '_seopress_robots_index',
184
- 'value' => 'yes',
185
- 'compare' => '!='
186
- ],
187
- ],
188
- ];
189
-
190
- $args = apply_filters('seopress_sitemaps_index_tax_query', $args, $tax_key);
191
-
192
- $count_terms = count(get_terms( $args ));
193
-
194
- //Max terms per paginated sitemap
195
- $max = 1000;
196
- $max = apply_filters('seopress_sitemaps_max_terms_per_sitemap', $max);
197
-
198
- if ($count_terms >= $max) {
199
- $max_loop = $count_terms / $max;
200
- } else {
201
- $max_loop = 1;
202
- }
203
-
204
- $paged ='';
205
- $i = '';
206
- for ($i=0; $i < $max_loop ; $i++) {
207
-
208
- if (isset($offset) && absint($offset) && $offset !='' && $offset !=0) {
209
- $offset = ((($i)*$max));
210
- } else {
211
- $offset = 0;
212
- }
213
-
214
- if ($i >= 1 && $i <= $max_loop) {
215
- $paged = $i+1;
216
- } else {
217
- $paged = 1;
218
- }
219
-
220
- $seopress_sitemaps .= "\n";
221
- $seopress_sitemaps .= '<sitemap>';
222
- $seopress_sitemaps .= "\n";
223
- $seopress_sitemaps .= '<loc>';
224
- $seopress_sitemaps .= $home_url.'sitemaps/'.$tax_key.'-sitemap'.$paged.'.xml';
225
- $seopress_sitemaps .= '</loc>';
226
- $seopress_sitemaps .= "\n";
227
- $seopress_sitemaps .= '</sitemap>';
228
- }
229
- }
230
- }
231
- }
232
- }
233
-
234
- //Google News
235
- if (function_exists("seopress_xml_sitemap_news_enable_option") && seopress_xml_sitemap_news_enable_option() !=''
236
- && function_exists('seopress_get_toggle_option') && seopress_get_toggle_option('news') =='1') {
237
- //Include Custom Post Types
238
- function seopress_xml_sitemap_news_cpt_option() {
239
- $seopress_xml_sitemap_news_cpt_option = get_option("seopress_pro_option_name");
240
- if ( ! empty ( $seopress_xml_sitemap_news_cpt_option ) ) {
241
- foreach ($seopress_xml_sitemap_news_cpt_option as $key => $seopress_xml_sitemap_news_cpt_value)
242
- $options[$key] = $seopress_xml_sitemap_news_cpt_value;
243
- if (isset($seopress_xml_sitemap_news_cpt_option['seopress_news_name_post_types_list'])) {
244
- return $seopress_xml_sitemap_news_cpt_option['seopress_news_name_post_types_list'];
245
- }
246
- }
247
- }
248
- if (seopress_xml_sitemap_news_cpt_option() !='') {
249
- $seopress_xml_sitemap_news_cpt_array = [];
250
- foreach (seopress_xml_sitemap_news_cpt_option() as $cpt_key => $cpt_value) {
251
- foreach ($cpt_value as $_cpt_key => $_cpt_value) {
252
- if($_cpt_value =='1') {
253
- array_push($seopress_xml_sitemap_news_cpt_array, $cpt_key);
254
- }
255
- }
256
- }
257
- }
258
-
259
- $args = [
260
- 'post_type' => $seopress_xml_sitemap_news_cpt_array,
261
- 'post_status' => 'publish',
262
- 'ignore_sticky_posts' => true,
263
- 'posts_per_page' => 1,
264
- 'orderby' => 'modified',
265
- 'meta_query' => [
266
- [
267
- 'key' => '_seopress_robots_index',
268
- 'value' => 'yes',
269
- 'compare' => 'NOT EXISTS'
270
- ]
271
- ],
272
- 'order' => 'DESC',
273
- 'lang' => '',
274
- 'has_password' => false
275
- ];
276
-
277
- $args = apply_filters('seopress_sitemaps_index_gnews_query', $args);
278
-
279
- $get_latest_post = new WP_Query($args);
280
- if($get_latest_post->have_posts()){
281
- $seopress_sitemaps .= "\n";
282
- $seopress_sitemaps .= '<sitemap>';
283
- $seopress_sitemaps .= "\n";
284
- $seopress_sitemaps .= '<loc>';
285
- $seopress_sitemaps .= $home_url.'sitemaps/news.xml';
286
- $seopress_sitemaps .= '</loc>';
287
- $seopress_sitemaps .= "\n";
288
- $seopress_sitemaps .= '<lastmod>';
289
- $seopress_sitemaps .= date("c", strtotime($get_latest_post->posts[0]->post_modified));
290
- $seopress_sitemaps .= '</lastmod>';
291
- $seopress_sitemaps .= "\n";
292
- $seopress_sitemaps .= '</sitemap>';
293
- }
294
- }
295
-
296
- //Video sitemap
297
- if (function_exists("seopress_xml_sitemap_video_enable_option") && seopress_xml_sitemap_video_enable_option() !='') {
298
- if (seopress_xml_sitemap_post_types_list_option() !='') {
299
- $cpt = [];
300
- foreach (seopress_xml_sitemap_post_types_list_option() as $cpt_key => $cpt_value) {
301
- foreach ($cpt_value as $_cpt_key => $_cpt_value) {
302
- if($_cpt_value =='1') {
303
- $cpt[] = $cpt_key;
304
- }
305
- }
306
- }
307
- }
308
-
309
- $args = [
310
- 'post_type' => $cpt,
311
- 'post_status' => 'publish',
312
- 'ignore_sticky_posts' => true,
313
- 'posts_per_page' => -1,
314
- 'meta_query' => [
315
- 'relation' => 'AND',
316
- [
317
- 'relation' => 'OR',
318
- [
319
- 'key' => '_seopress_robots_index',
320
- 'value' => '',
321
- 'compare' => 'NOT EXISTS'
322
- ],
323
- [
324
- 'key' => '_seopress_robots_index',
325
- 'value' => 'yes',
326
- 'compare' => '!='
327
- ],
328
- ],
329
- [
330
- 'relation' => 'OR',
331
- [
332
- 'key' => '_seopress_video_disabled',
333
- 'value' => '',
334
- 'compare' => 'NOT EXISTS'
335
- ],
336
- [
337
- 'key' => '_seopress_video_disabled',
338
- 'value' => 'yes',
339
- 'compare' => '!='
340
- ],
341
- ],
342
- [
343
- 'key' => '_seopress_video',
344
- 'compare' => 'EXISTS'
345
- ]
346
- ],
347
- 'lang' => '',
348
- 'has_password' => false,
349
- 'fields' => 'ids',
350
- ];
351
-
352
- $args = apply_filters('seopress_sitemaps_index_video_query', $args, $cpt_key);
353
-
354
- $count_posts = count(get_posts( $args ));
355
-
356
-
357
- //Max posts per paginated sitemap
358
- $max = 1000;
359
- $max = apply_filters('seopress_sitemaps_max_videos_per_sitemap', $max);
360
-
361
- if ($count_posts >= $max) {
362
- $max_loop = $count_posts / $max;
363
- } else {
364
- $max_loop = 1;
365
- }
366
-
367
- $paged ='';
368
- $i = '';
369
- for ($i=0; $i < $max_loop ; $i++) {
370
-
371
- if (isset($offset) && absint($offset) && $offset !='' && $offset !=0) {
372
- $offset = ((($i)*$max));
373
- } else {
374
- $offset = 0;
375
- }
376
-
377
- if ($i >= 1 && $i <= $max_loop) {
378
- $paged = $i+1;
379
- } else {
380
- $paged = 1;
381
- }
382
-
383
- $seopress_sitemaps .= "\n";
384
- $seopress_sitemaps .= '<sitemap>';
385
- $seopress_sitemaps .= "\n";
386
- $seopress_sitemaps .= '<loc>';
387
- $seopress_sitemaps .= $home_url.'sitemaps/video'.$paged.'.xml';
388
- $seopress_sitemaps .= '</loc>';
389
- $seopress_sitemaps .= "\n";
390
- $seopress_sitemaps .= '</sitemap>';
391
- }
392
- }
393
-
394
- //Author sitemap
395
- if (function_exists("seopress_xml_sitemap_author_enable_option") && seopress_xml_sitemap_author_enable_option() !='') {
396
- $seopress_sitemaps .= "\n";
397
- $seopress_sitemaps .= '<sitemap>';
398
- $seopress_sitemaps .= "\n";
399
- $seopress_sitemaps .= '<loc>';
400
- $seopress_sitemaps .= $home_url.'sitemaps/author.xml';
401
- $seopress_sitemaps .= '</loc>';
402
- $seopress_sitemaps .= "\n";
403
- $seopress_sitemaps .= '</sitemap>';
404
- }
405
-
406
- //Custom sitemap
407
- $custom_sitemap = null;
408
- $custom_sitemap = apply_filters('seopress_sitemaps_external_link', $custom_sitemap);
409
- if(isset($custom_sitemap)) {
410
- foreach($custom_sitemap as $key => $sitemap) {
411
- $seopress_sitemaps .= "\n";
412
- $seopress_sitemaps .= '<sitemap>';
413
- $seopress_sitemaps .= "\n";
414
- $seopress_sitemaps .= '<loc>';
415
- $seopress_sitemaps .= $sitemap['sitemap_url'];
416
- $seopress_sitemaps .= '</loc>';
417
- if(isset($sitemap['sitemap_last_mod'])) {
418
- $seopress_sitemaps .= "\n";
419
- $seopress_sitemaps .= '<lastmod>';
420
- $seopress_sitemaps .= $sitemap['sitemap_last_mod'];
421
- $seopress_sitemaps .= '</lastmod>';
422
- }
423
- $seopress_sitemaps .= "\n";
424
- $seopress_sitemaps .= '</sitemap>';
425
- }
426
- }
427
-
428
- $seopress_sitemaps .= "\n";
429
- $seopress_sitemaps .='</sitemapindex>';
430
-
431
- $seopress_sitemaps = apply_filters( 'seopress_sitemaps_xml_index', $seopress_sitemaps );
432
-
433
- return $seopress_sitemaps;
434
- }
435
- echo seopress_xml_sitemap_index();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+
3
+ defined('ABSPATH') or exit('Please don&rsquo;t call the plugin directly. Thanks :)');
4
 
5
  //XML Index sitemaps
6
 
7
  //Headers
8
  if (function_exists('seopress_sitemaps_headers')) {
9
+ seopress_sitemaps_headers();
10
  }
11
 
12
  //WPML
13
+ add_filter('wpml_get_home_url', 'seopress_remove_wpml_home_url_filter', 20, 5);
14
 
15
+ add_filter('seopress_sitemaps_index_cpt_query', function ($args) {
16
  global $sitepress, $sitepress_settings;
17
 
18
  $sitepress_settings['auto_adjust_ids'] = 0;
19
+ remove_filter('terms_clauses', [$sitepress, 'terms_clauses']);
20
+ remove_filter('category_link', [$sitepress, 'category_link_adjust_id'], 1);
21
 
22
  return $args;
23
  });
24
 
25
+ add_action('the_post', function ($post) {
26
+ $language = apply_filters(
27
+ 'wpml_element_language_code',
28
+ null,
29
+ ['element_id' => $post->ID, 'element_type' => 'page']
30
+ );
31
+ do_action('wpml_switch_language', $language);
32
  });
33
 
34
  function seopress_xml_sitemap_index() {
35
+ $home_url = home_url() . '/';
36
+
37
+ if (function_exists('pll_home_url')) {
38
+ $home_url = site_url() . '/';
39
+ }
40
+
41
+ $home_url = apply_filters('seopress_sitemaps_home_url', $home_url);
42
+
43
+ $seopress_sitemaps ='<?xml version="1.0" encoding="UTF-8"?>';
44
+ $seopress_sitemaps .= '<?xml-stylesheet type="text/xsl" href="' . $home_url . 'sitemaps_xsl.xsl"?>';
45
+ $seopress_sitemaps .= "\n";
46
+ $seopress_sitemaps .= '<sitemapindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
47
+
48
+ //CPT
49
+ if ('' != seopress_xml_sitemap_post_types_list_option()) {
50
+ foreach (seopress_xml_sitemap_post_types_list_option() as $cpt_key => $cpt_value) {
51
+ foreach ($cpt_value as $_cpt_key => $_cpt_value) {
52
+ if ('1' == $_cpt_value) {
53
+ $args = [
54
+ 'posts_per_page' => -1,
55
+ 'post_type' => $cpt_key,
56
+ 'post_status' => 'publish',
57
+ 'meta_query' => [
58
+ 'relation' => 'OR',
59
+ [
60
+ 'key' => '_seopress_robots_index',
61
+ 'value' => '',
62
+ 'compare' => 'NOT EXISTS',
63
+ ],
64
+ [
65
+ 'key' => '_seopress_robots_index',
66
+ 'value' => 'yes',
67
+ 'compare' => '!=',
68
+ ],
69
+ ],
70
+ 'fields' => 'ids',
71
+ 'lang' => '',
72
+ 'has_password' => false,
73
+ ];
74
+
75
+ $args = apply_filters('seopress_sitemaps_index_post_types_query', $args, $cpt_key);
76
+
77
+ $count_posts = count(get_posts($args));
78
+
79
+ //Max posts per paginated sitemap
80
+ $max = 1000;
81
+ $max = apply_filters('seopress_sitemaps_max_posts_per_sitemap', $max);
82
+
83
+ if ($count_posts >= $max) {
84
+ $max_loop = $count_posts / $max;
85
+ } else {
86
+ $max_loop = 1;
87
+ }
88
+
89
+ $paged ='';
90
+ $i = '';
91
+ for ($i=0; $i < $max_loop; ++$i) {
92
+ if (isset($offset) && absint($offset) && '' != $offset && 0 != $offset) {
93
+ $offset = ((($i) * $max));
94
+ } else {
95
+ $offset = 0;
96
+ }
97
+
98
+ if ($i >= 1 && $i <= $max_loop) {
99
+ $paged = $i + 1;
100
+ } else {
101
+ $paged = 1;
102
+ }
103
+
104
+ $seopress_sitemaps .= "\n";
105
+ $seopress_sitemaps .= '<sitemap>';
106
+ $seopress_sitemaps .= "\n";
107
+ $seopress_sitemaps .= '<loc>';
108
+ $seopress_sitemaps .= $home_url . 'sitemaps/' . $cpt_key . '-sitemap' . $paged . '.xml';
109
+ $seopress_sitemaps .= '</loc>';
110
+ $seopress_sitemaps .= "\n";
111
+
112
+ //Remove lastmod column in index sitemap for lage sitemap
113
+ $display_lastmod = apply_filters('seopress_sitemaps_index_lastmod', false);
114
+
115
+ if (true == $display_lastmod) {
116
+ $args = [
117
+ 'post_type' => $cpt_key,
118
+ 'offset' => $offset,
119
+ 'post_status' => 'publish',
120
+ 'ignore_sticky_posts' => true,
121
+ 'posts_per_page' => 1,
122
+ 'meta_query' => [
123
+ 'relation' => 'OR',
124
+ [
125
+ 'key' => '_seopress_robots_index',
126
+ 'value' => '',
127
+ 'compare' => 'NOT EXISTS',
128
+ ],
129
+ [
130
+ 'key' => '_seopress_robots_index',
131
+ 'value' => 'yes',
132
+ 'compare' => '!=',
133
+ ],
134
+ ],
135
+ 'order' => 'DESC',
136
+ 'orderby' => 'modified',
137
+ 'lang' => '',
138
+ 'has_password' => false,
139
+ ];
140
+
141
+ $args = apply_filters('seopress_sitemaps_index_cpt_query', $args, $cpt_key);
142
+
143
+ $get_latest_post = new WP_Query($args);
144
+
145
+ if ($get_latest_post->have_posts()) {
146
+ $seopress_sitemaps .= '<lastmod>';
147
+ $seopress_sitemaps .= date('c', strtotime($get_latest_post->posts[0]->post_modified));
148
+ $seopress_sitemaps .= '</lastmod>';
149
+ $seopress_sitemaps .= "\n";
150
+ }
151
+ }
152
+
153
+ $seopress_sitemaps .= '</sitemap>';
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }
159
+
160
+ //Taxonomies
161
+ if ('' != seopress_xml_sitemap_taxonomies_list_option()) {
162
+ //Init
163
+ $seopress_xml_terms_list = [];
164
+ foreach (seopress_xml_sitemap_taxonomies_list_option() as $tax_key => $tax_value) {
165
+ foreach ($tax_value as $_tax_key => $_tax_value) {
166
+ if ('1' == $_tax_value) {
167
+ $args = [
168
+ 'taxonomy' => $tax_key,
169
+ 'hide_empty' => false,
170
+ 'lang' => '',
171
+ 'fields' => 'ids',
172
+ 'meta_query' => [
173
+ 'relation' => 'OR',
174
+ [
175
+ 'key' => '_seopress_robots_index',
176
+ 'value' => '',
177
+ 'compare' => 'NOT EXISTS',
178
+ ],
179
+ [
180
+ 'key' => '_seopress_robots_index',
181
+ 'value' => 'yes',
182
+ 'compare' => '!=',
183
+ ],
184
+ ],
185
+ ];
186
+
187
+ $args = apply_filters('seopress_sitemaps_index_tax_query', $args, $tax_key);
188
+
189
+ $count_terms = count(get_terms($args));
190
+
191
+ //Max terms per paginated sitemap
192
+ $max = 1000;
193
+ $max = apply_filters('seopress_sitemaps_max_terms_per_sitemap', $max);
194
+
195
+ if ($count_terms >= $max) {
196
+ $max_loop = $count_terms / $max;
197
+ } else {
198
+ $max_loop = 1;
199
+ }
200
+
201
+ $paged ='';
202
+ $i = '';
203
+ for ($i=0; $i < $max_loop; ++$i) {
204
+ if (isset($offset) && absint($offset) && '' != $offset && 0 != $offset) {
205
+ $offset = ((($i) * $max));
206
+ } else {
207
+ $offset = 0;
208
+ }
209
+
210
+ if ($i >= 1 && $i <= $max_loop) {
211
+ $paged = $i + 1;
212
+ } else {
213
+ $paged = 1;
214
+ }
215
+
216
+ $seopress_sitemaps .= "\n";
217
+ $seopress_sitemaps .= '<sitemap>';
218
+ $seopress_sitemaps .= "\n";
219
+ $seopress_sitemaps .= '<loc>';
220
+ $seopress_sitemaps .= $home_url . 'sitemaps/' . $tax_key . '-sitemap' . $paged . '.xml';
221
+ $seopress_sitemaps .= '</loc>';
222
+ $seopress_sitemaps .= "\n";
223
+ $seopress_sitemaps .= '</sitemap>';
224
+ }
225
+ }
226
+ }
227
+ }
228
+ }
229
+
230
+ //Google News
231
+ if (function_exists('seopress_xml_sitemap_news_enable_option') && '' != seopress_xml_sitemap_news_enable_option()
232
+ && function_exists('seopress_get_toggle_option') && '1' == seopress_get_toggle_option('news')) {
233
+ //Include Custom Post Types
234
+ function seopress_xml_sitemap_news_cpt_option() {
235
+ $seopress_xml_sitemap_news_cpt_option = get_option('seopress_pro_option_name');
236
+ if ( ! empty($seopress_xml_sitemap_news_cpt_option)) {
237
+ foreach ($seopress_xml_sitemap_news_cpt_option as $key => $seopress_xml_sitemap_news_cpt_value) {
238
+ $options[$key] = $seopress_xml_sitemap_news_cpt_value;
239
+ }
240
+ if (isset($seopress_xml_sitemap_news_cpt_option['seopress_news_name_post_types_list'])) {
241
+ return $seopress_xml_sitemap_news_cpt_option['seopress_news_name_post_types_list'];
242
+ }
243
+ }
244
+ }
245
+ if ('' != seopress_xml_sitemap_news_cpt_option()) {
246
+ $seopress_xml_sitemap_news_cpt_array = [];
247
+ foreach (seopress_xml_sitemap_news_cpt_option() as $cpt_key => $cpt_value) {
248
+ foreach ($cpt_value as $_cpt_key => $_cpt_value) {
249
+ if ('1' == $_cpt_value) {
250
+ array_push($seopress_xml_sitemap_news_cpt_array, $cpt_key);
251
+ }
252
+ }
253
+ }
254
+ }
255
+
256
+ $args = [
257
+ 'post_type' => $seopress_xml_sitemap_news_cpt_array,
258
+ 'post_status' => 'publish',
259
+ 'ignore_sticky_posts' => true,
260
+ 'posts_per_page' => 1,
261
+ 'orderby' => 'modified',
262
+ 'meta_query' => [
263
+ [
264
+ 'key' => '_seopress_robots_index',
265
+ 'value' => 'yes',
266
+ 'compare' => 'NOT EXISTS',
267
+ ],
268
+ ],
269
+ 'order' => 'DESC',
270
+ 'lang' => '',
271
+ 'has_password' => false,
272
+ ];
273
+
274
+ $args = apply_filters('seopress_sitemaps_index_gnews_query', $args);
275
+
276
+ $get_latest_post = new WP_Query($args);
277
+ if ($get_latest_post->have_posts()) {
278
+ $seopress_sitemaps .= "\n";
279
+ $seopress_sitemaps .= '<sitemap>';
280
+ $seopress_sitemaps .= "\n";
281
+ $seopress_sitemaps .= '<loc>';
282
+ $seopress_sitemaps .= $home_url . 'sitemaps/news.xml';
283
+ $seopress_sitemaps .= '</loc>';
284
+ $seopress_sitemaps .= "\n";
285
+ $seopress_sitemaps .= '<lastmod>';
286
+ $seopress_sitemaps .= date('c', strtotime($get_latest_post->posts[0]->post_modified));
287
+ $seopress_sitemaps .= '</lastmod>';
288
+ $seopress_sitemaps .= "\n";
289
+ $seopress_sitemaps .= '</sitemap>';
290
+ }
291
+ }
292
+
293
+ //Video sitemap
294
+ if (function_exists('seopress_xml_sitemap_video_enable_option') && '' != seopress_xml_sitemap_video_enable_option()) {
295
+ if ('' != seopress_xml_sitemap_post_types_list_option()) {
296
+ $cpt = [];
297
+ foreach (seopress_xml_sitemap_post_types_list_option() as $cpt_key => $cpt_value) {
298
+ foreach ($cpt_value as $_cpt_key => $_cpt_value) {
299
+ if ('1' == $_cpt_value) {
300
+ $cpt[] = $cpt_key;
301
+ }
302
+ }
303
+ }
304
+ }
305
+
306
+ $args = [
307
+ 'post_type' => $cpt,
308
+ 'post_status' => 'publish',
309
+ 'ignore_sticky_posts' => true,
310
+ 'posts_per_page' => -1,
311
+ 'meta_query' => [
312
+ 'relation' => 'AND',
313
+ [
314
+ 'relation' => 'OR',
315
+ [
316
+ 'key' => '_seopress_robots_index',
317
+ 'value' => '',
318
+ 'compare' => 'NOT EXISTS',
319
+ ],
320
+ [
321
+ 'key' => '_seopress_robots_index',
322
+ 'value' => 'yes',
323
+ 'compare' => '!=',
324
+ ],
325
+ ],
326
+ [
327
+ 'key' => '_seopress_video',
328
+ 'compare' => 'EXISTS',
329
+ ],
330
+ ],
331
+ 'lang' => '',
332
+ 'has_password' => false,
333
+ 'fields' => 'ids',
334
+ ];
335
+
336
+ $args = apply_filters('seopress_sitemaps_index_video_query', $args, $cpt_key);
337
+
338
+ $ids = get_posts($args);
339
+
340
+ $args = [
341
+ 'post_type' => $cpt,
342
+ 'post_status' => 'publish',
343
+ 'posts_per_page' => -1,
344
+ 'post__in' => $ids,
345
+ 'meta_query' => [
346
+ [
347
+ 'relation' => 'OR',
348
+ [
349
+ 'key' => '_seopress_video_disabled',
350
+ 'value' => '',
351
+ 'compare' => 'NOT EXISTS',
352
+ ],
353
+ [
354
+ 'key' => '_seopress_video_disabled',
355
+ 'value' => 'yes',
356
+ 'compare' => '!=',
357
+ ],
358
+ ],
359
+ ],
360
+ 'lang' => '',
361
+ 'fields' => 'ids',
362
+ ];
363
+
364
+ $posts = get_posts($args);
365
+ $count_posts = count($posts);
366
+
367
+ foreach ($posts as $key => $postID) {
368
+ $seopress_video = get_post_meta($postID, '_seopress_video', true);
369
+ if ( ! $seopress_video) {
370
+ --$count_posts;
371
+ unset($posts[$key]);
372
+ continue;
373
+ }
374
+
375
+ if (empty($seopress_video[0]['url'])) {
376
+ --$count_posts;
377
+ unset($posts[$key]);
378
+ }
379
+ }
380
+ $idsVideos = get_transient('_seopress_sitemap_ids_video');
381
+ if ( ! $idsVideos) {
382
+ set_transient('_seopress_sitemap_ids_video', $posts, 3600);
383
+ }
384
+
385
+ //Max posts per paginated sitemap
386
+ $max = 1000;
387
+ $max = apply_filters('seopress_sitemaps_max_videos_per_sitemap', $max);
388
+
389
+ if ($count_posts >= $max) {
390
+ $max_loop = $count_posts / $max;
391
+ } else {
392
+ $max_loop = 1;
393
+ }
394
+
395
+ $paged ='';
396
+ $i = '';
397
+ for ($i=0; $i < $max_loop; ++$i) {
398
+ if (isset($offset) && absint($offset) && '' != $offset && 0 != $offset) {
399
+ $offset = ((($i) * $max));
400
+ } else {
401
+ $offset = 0;
402
+ }
403
+
404
+ if ($i >= 1 && $i <= $max_loop) {
405
+ $paged = $i + 1;
406
+ } else {
407
+ $paged = 1;
408
+ }
409
+
410
+ $seopress_sitemaps .= "\n";
411
+ $seopress_sitemaps .= '<sitemap>';
412
+ $seopress_sitemaps .= "\n";
413
+ $seopress_sitemaps .= '<loc>';
414
+ $seopress_sitemaps .= $home_url . 'sitemaps/video' . $paged . '.xml';
415
+ $seopress_sitemaps .= '</loc>';
416
+ $seopress_sitemaps .= "\n";
417
+ $seopress_sitemaps .= '</sitemap>';
418
+ }
419
+ }
420
+
421
+ //Author sitemap
422
+ if (function_exists('seopress_xml_sitemap_author_enable_option') && '' != seopress_xml_sitemap_author_enable_option()) {
423
+ $seopress_sitemaps .= "\n";
424
+ $seopress_sitemaps .= '<sitemap>';
425
+ $seopress_sitemaps .= "\n";
426
+ $seopress_sitemaps .= '<loc>';
427
+ $seopress_sitemaps .= $home_url . 'sitemaps/author.xml';
428
+ $seopress_sitemaps .= '</loc>';
429
+ $seopress_sitemaps .= "\n";
430
+ $seopress_sitemaps .= '</sitemap>';
431
+ }
432
+
433
+ //Custom sitemap
434
+ $custom_sitemap = null;
435
+ $custom_sitemap = apply_filters('seopress_sitemaps_external_link', $custom_sitemap);
436
+ if (isset($custom_sitemap)) {
437
+ foreach ($custom_sitemap as $key => $sitemap) {
438
+ $seopress_sitemaps .= "\n";
439
+ $seopress_sitemaps .= '<sitemap>';
440
+ $seopress_sitemaps .= "\n";
441
+ $seopress_sitemaps .= '<loc>';
442
+ $seopress_sitemaps .= $sitemap['sitemap_url'];
443
+ $seopress_sitemaps .= '</loc>';
444
+ if (isset($sitemap['sitemap_last_mod'])) {
445
+ $seopress_sitemaps .= "\n";
446
+ $seopress_sitemaps .= '<lastmod>';
447
+ $seopress_sitemaps .= $sitemap['sitemap_last_mod'];
448
+ $seopress_sitemaps .= '</lastmod>';
449
+ }
450
+ $seopress_sitemaps .= "\n";
451
+ $seopress_sitemaps .= '</sitemap>';
452
+ }
453
+ }
454
+
455
+ $seopress_sitemaps .= "\n";
456
+ $seopress_sitemaps .= '</sitemapindex>';
457
+
458
+ $seopress_sitemaps = apply_filters('seopress_sitemaps_xml_index', $seopress_sitemaps);
459
+
460
+ return $seopress_sitemaps;
461
+ }
462
+ echo seopress_xml_sitemap_index();
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: SEO, XML sitemap, meta title, open graph, content analysis, knowledge grap
6
  Requires at least: 4.7+
7
  Tested up to: 5.6
8
  Requires PHP: 5.6
9
- Stable tag: 4.4.0.3
10
  License: GPLv2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -319,7 +319,16 @@ You're theme is probably using a deprecated function to handle the title. <a hre
319
  8. Installation Wizard
320
  9. Schemas metabox
321
 
322
- == Changelog ==
 
 
 
 
 
 
 
 
 
323
  = 4.4.0.3 (12/02/2021) =
324
  * FIX Fatal errors in posts list
325
  = 4.4.0.2 (12/02/2021) =
6
  Requires at least: 4.7+
7
  Tested up to: 5.6
8
  Requires PHP: 5.6
9
+ Stable tag: 4.4.0.4
10
  License: GPLv2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
 
319
  8. Installation Wizard
320
  9. Schemas metabox
321
 
322
+ == Changelog ==
323
+ = 4.4.0.4 (18/02/2021) =
324
+ * INFO Add "View my RSS feed" button to SEO, PRO, RSS tab
325
+ * INFO Improve performance for video xml sitemap
326
+ * FIX Help tabs missing
327
+ * FIX Content analysis compatibility for Oxygen Page Builder
328
+ * FIX Variable products for automatic schema
329
+ * FIX Product currency property for automatic product schema
330
+ * FIX Ecommerce tracking on purchases
331
+ * FIX PHP Fatal error: Uncaught Error: Call to a member function is_type()
332
  = 4.4.0.3 (12/02/2021) =
333
  * FIX Fatal errors in posts list
334
  = 4.4.0.2 (12/02/2021) =
seopress.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: SEOPress
4
  Plugin URI: https://www.seopress.org/
5
  Description: One of the best SEO plugins for WordPress.
6
  Author: SEOPress
7
- Version: 4.4.0.3
8
  Author URI: https://www.seopress.org/
9
  License: GPLv2
10
  Text Domain: wp-seopress
@@ -55,7 +55,7 @@ register_deactivation_hook(__FILE__, 'seopress_deactivation');
55
  ///////////////////////////////////////////////////////////////////////////////////////////////////
56
  //Define
57
  ///////////////////////////////////////////////////////////////////////////////////////////////////
58
- define('SEOPRESS_VERSION', '4.4.0.3');
59
  define('SEOPRESS_AUTHOR', 'Benjamin Denis');
60
  define('SEOPRESS_PLUGIN_DIR_PATH', plugin_dir_path(__FILE__));
61
  define('SEOPRESS_TEMPLATE_DIR', SEOPRESS_PLUGIN_DIR_PATH . 'templates');
4
  Plugin URI: https://www.seopress.org/
5
  Description: One of the best SEO plugins for WordPress.
6
  Author: SEOPress
7
+ Version: 4.4.0.4
8
  Author URI: https://www.seopress.org/
9
  License: GPLv2
10
  Text Domain: wp-seopress
55
  ///////////////////////////////////////////////////////////////////////////////////////////////////
56
  //Define
57
  ///////////////////////////////////////////////////////////////////////////////////////////////////
58
+ define('SEOPRESS_VERSION', '4.4.0.4');
59
  define('SEOPRESS_AUTHOR', 'Benjamin Denis');
60
  define('SEOPRESS_PLUGIN_DIR_PATH', plugin_dir_path(__FILE__));
61
  define('SEOPRESS_TEMPLATE_DIR', SEOPRESS_PLUGIN_DIR_PATH . 'templates');
src/ManualHooks/Thirds/WooCommerce/WooCommerceAnalytics.php CHANGED
@@ -21,10 +21,6 @@ class WooCommerceAnalytics {
21
  return;
22
  }
23
 
24
- if (seopress_google_analytics_purchases_option()) {
25
- $this->wooCommerceAnalytics->measurePurchase();
26
- }
27
-
28
  if (seopress_google_analytics_add_to_cart_option()) {
29
  // Listing page
30
  add_action('woocommerce_after_shop_loop_item', [$this, 'addToCart']);
21
  return;
22
  }
23
 
 
 
 
 
24
  if (seopress_google_analytics_add_to_cart_option()) {
25
  // Listing page
26
  add_action('woocommerce_after_shop_loop_item', [$this, 'addToCart']);
src/Thirds/WooCommerce/WooCommerceAnalyticsService.php CHANGED
@@ -7,94 +7,6 @@ if ( ! defined('ABSPATH')) {
7
  }
8
 
9
  class WooCommerceAnalyticsService {
10
- /**
11
- * @since 4.4.0
12
- *
13
- * @return void
14
- */
15
- public function measurePurchase() {
16
- if ( ! function_exists('is_order_received_page') || ! is_order_received_page()) {
17
- return;
18
- }
19
- global $wp;
20
- $order_id = isset($wp->query_vars['order-received']) ? $wp->query_vars['order-received'] : 0;
21
-
22
- if (0 < $order_id && 1 != get_post_meta($order_id, '_seopress_ga_tracked', true)) {
23
- $order = wc_get_order($order_id);
24
-
25
- //Check order status
26
- if (method_exists($order, 'get_status') && ('processing' === $order->get_status()) || 'completed' === $order->get_status()) {
27
- $items_purchased = [];
28
- foreach ($order->get_items() as $item) {
29
- // Get Product object
30
- $_product = wc_get_product($item->get_product_id());
31
-
32
- if ( ! is_a($_product, 'WC_Product')) {
33
- continue;
34
- }
35
-
36
- // init vars
37
- $item_id = $_product->get_id();
38
- $variation_id = 0;
39
- $variation_data = null;
40
- $categories_js = null;
41
- $categories_out = [];
42
- $variant_js = null;
43
-
44
- // Set data
45
- $items_purchased['id'] = esc_js($item_id);
46
- $items_purchased['name'] = esc_js($item->get_name());
47
- $items_purchased['quantity'] = (float) esc_js($item->get_quantity());
48
- $items_purchased['price'] = (float) esc_js($order->get_item_total($item));
49
-
50
- // Categories and Variations
51
- $categories = get_the_terms($item_id, 'product_cat');
52
- if ($item->get_variation_id()) {
53
- $variation_id = $item->get_variation_id();
54
- $variation_data = wc_get_product_variation_attributes($variation_id);
55
- }
56
-
57
- // Variations
58
- if (is_array($variation_data) && ! empty($variation_data)) {
59
- $variant_js = esc_js(wc_get_formatted_variation($variation_data, true));
60
- $categories = get_the_terms($item_id, 'product_cat');
61
- $item_id = $variation_id;
62
-
63
- $items_purchased['variant'] = esc_js($variant_js);
64
- }
65
- // Categories
66
- if ($categories) {
67
- foreach ($categories as $category) {
68
- $categories_out[] = $category->name;
69
- }
70
- $categories_js = esc_js(implode('/', $categories_out));
71
-
72
- $items_purchased['category'] = esc_js($categories_js);
73
- }
74
-
75
- $final[] = $items_purchased;
76
- }
77
-
78
- $global_purchase = [
79
- 'transaction_id' => esc_js($order_id),
80
- 'affiliation' => esc_js(get_bloginfo('name')),
81
- 'value' => (float) esc_js($order->get_total()),
82
- 'currency' => esc_js($order->get_currency()),
83
- 'tax' => (float) esc_js($order->get_total_tax()),
84
- 'shipping' => (float) esc_js($order->get_shipping_total()),
85
- 'items' => $final,
86
- ];
87
-
88
- $seopress_google_analytics_click_event['purchase_tracking'] = 'gtag(\'event\', \'purchase\',';
89
- $seopress_google_analytics_click_event['purchase_tracking'] .= json_encode($global_purchase);
90
- $seopress_google_analytics_click_event['purchase_tracking'] .= ');';
91
- $seopress_google_analytics_click_event['purchase_tracking'] = apply_filters('seopress_gtag_ec_purchases_ev', $seopress_google_analytics_click_event['purchase_tracking']);
92
-
93
- update_post_meta($order_id, '_seopress_ga_tracked', true);
94
- }
95
- }
96
- }
97
-
98
  /**
99
  * @since 4.4.0
100
  *
7
  }
8
 
9
  class WooCommerceAnalyticsService {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  /**
11
  * @since 4.4.0
12
  *
vendor/composer/InstalledVersions.php CHANGED
@@ -29,7 +29,7 @@ private static $installed = array (
29
  'aliases' =>
30
  array (
31
  ),
32
- 'reference' => '4d55ae86f2431a6e66a6d46732cf962ae15a74c1',
33
  'name' => 'wp-seopress/wp-seopress',
34
  ),
35
  'versions' =>
@@ -41,7 +41,7 @@ private static $installed = array (
41
  'aliases' =>
42
  array (
43
  ),
44
- 'reference' => '4d55ae86f2431a6e66a6d46732cf962ae15a74c1',
45
  ),
46
  ),
47
  );
29
  'aliases' =>
30
  array (
31
  ),
32
+ 'reference' => '923da49ddad43494367e847503093a9e645167f0',
33
  'name' => 'wp-seopress/wp-seopress',
34
  ),
35
  'versions' =>
41
  'aliases' =>
42
  array (
43
  ),
44
+ 'reference' => '923da49ddad43494367e847503093a9e645167f0',
45
  ),
46
  ),
47
  );
vendor/composer/installed.php CHANGED
@@ -6,7 +6,7 @@
6
  'aliases' =>
7
  array (
8
  ),
9
- 'reference' => '4d55ae86f2431a6e66a6d46732cf962ae15a74c1',
10
  'name' => 'wp-seopress/wp-seopress',
11
  ),
12
  'versions' =>
@@ -18,7 +18,7 @@
18
  'aliases' =>
19
  array (
20
  ),
21
- 'reference' => '4d55ae86f2431a6e66a6d46732cf962ae15a74c1',
22
  ),
23
  ),
24
  );
6
  'aliases' =>
7
  array (
8
  ),
9
+ 'reference' => '923da49ddad43494367e847503093a9e645167f0',
10
  'name' => 'wp-seopress/wp-seopress',
11
  ),
12
  'versions' =>
18
  'aliases' =>
19
  array (
20
  ),
21
+ 'reference' => '923da49ddad43494367e847503093a9e645167f0',
22
  ),
23
  ),
24
  );