Version Description
- NEW XML Image Sitemap to improve ranking in Google Images (supports standard images, WP Image Galleries and WooCommerce image products)
- NEW Block SEO metaboxe to specific user roles
- NEW Block Structured Data Types metaboxe to specific user roles
- INFO Move SEO metaboxe just under the editor
- INFO Add Items count column in index XML Sitemaps
- INFO Move Structured Data Types metaboxe just under SEO metaboxe
- FIX Undefined notice phone number
- FIX Change Price input number to input text to allow decimals (Structured Data Types)
- FIX incorrect last update date in index XML Sitemaps
- FIX Admin bar is_plugin_active error
Download this release
Release Info
Developer | rainbowgeek |
Plugin | SEOPress |
Version | 1.6 |
Comparing to | |
See all releases |
Code changes from version 1.5.1 to 1.6
- inc/admin/admin-metaboxes.php +375 -347
- inc/admin/admin.php +80 -3
- inc/admin/adminbar.php +1 -0
- inc/functions/options-social.php +5 -1
- inc/functions/sitemap/template-xml-sitemaps-single.php +69 -1
- inc/functions/sitemap/template-xml-sitemaps-xsl.php +18 -4
- inc/functions/sitemap/template-xml-sitemaps.php +8 -3
- readme.txt +14 -1
- seopress.php +29 -13
inc/admin/admin-metaboxes.php
CHANGED
@@ -3,369 +3,397 @@
|
|
3 |
defined( 'ABSPATH' ) or die( 'Please don’t call the plugin directly. Thanks :)' );
|
4 |
|
5 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
6 |
-
//
|
7 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
12 |
}
|
13 |
-
add_meta_box('seopress_cpt', __('SEO','wp-seopress'), 'seopress_cpt', 'seopress_404', 'advanced');
|
14 |
}
|
15 |
|
16 |
-
|
17 |
-
global $
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
$seopress_social_fb_title = get_post_meta($post->ID,'_seopress_social_fb_title',true);
|
28 |
-
$seopress_social_fb_desc = get_post_meta($post->ID,'_seopress_social_fb_desc',true);
|
29 |
-
$seopress_social_fb_img = get_post_meta($post->ID,'_seopress_social_fb_img',true);
|
30 |
-
$seopress_social_twitter_title = get_post_meta($post->ID,'_seopress_social_twitter_title',true);
|
31 |
-
$seopress_social_twitter_desc = get_post_meta($post->ID,'_seopress_social_twitter_desc',true);
|
32 |
-
$seopress_social_twitter_img = get_post_meta($post->ID,'_seopress_social_twitter_img',true);
|
33 |
-
$seopress_redirections_enabled = get_post_meta($post->ID,'_seopress_redirections_enabled',true);
|
34 |
-
$seopress_redirections_type = get_post_meta($post->ID,'_seopress_redirections_type',true);
|
35 |
-
$seopress_redirections_value = get_post_meta($post->ID,'_seopress_redirections_value',true);
|
36 |
-
$seopress_news_disabled = get_post_meta($post->ID,'_seopress_news_disabled',true);
|
37 |
-
$seopress_news_genres = get_post_meta($post->ID,'_seopress_news_genres',true);
|
38 |
-
$seopress_news_keyboard = get_post_meta($post->ID,'_seopress_news_keyboard',true);
|
39 |
-
|
40 |
-
function seopress_titles_title($seopress_titles_title) {
|
41 |
-
if ($seopress_titles_title !='') {
|
42 |
-
return $seopress_titles_title;
|
43 |
} else {
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
$seopress_titles_single_desc_option = get_option("seopress_titles_option_name");
|
53 |
-
if ( ! empty ( $seopress_titles_single_desc_option ) ) {
|
54 |
-
foreach ($seopress_titles_single_desc_option as $key => $seopress_titles_single_desc_value)
|
55 |
-
$options[$key] = $seopress_titles_single_desc_value;
|
56 |
-
if (isset($seopress_titles_single_desc_option['seopress_titles_single_titles'][$seopress_get_current_cpt]['description'])) {
|
57 |
-
return $seopress_titles_single_desc_option['seopress_titles_single_titles'][$seopress_get_current_cpt]['description'];
|
58 |
}
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
function seopress_titles_desc($seopress_titles_desc) {
|
63 |
-
if ($seopress_titles_desc !='') {
|
64 |
-
return $seopress_titles_desc;
|
65 |
-
} else {
|
66 |
-
global $post;
|
67 |
-
if (seopress_titles_single_desc_option() !='') {
|
68 |
-
return seopress_titles_single_desc_option();
|
69 |
-
} elseif ( has_excerpt( $post->ID ) ) {
|
70 |
-
// This post has excerpt
|
71 |
-
return substr(wp_strip_all_tags($post->post_excerpt, true), 0, 160);
|
72 |
-
} else {
|
73 |
-
// This post has no excerpt
|
74 |
-
return substr(wp_strip_all_tags($post->post_content, true), 0, 160);
|
75 |
-
}
|
76 |
-
}
|
77 |
-
}
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
}
|
97 |
-
}
|
98 |
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
|
|
|
|
|
|
|
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
<li><a href="#tabs-2"><span class="dashicons dashicons-admin-generic"></span>'. __( 'Advanced', 'wp-seopress' ) .'</a></li>
|
110 |
-
<li><a href="#tabs-3"><span class="dashicons dashicons-share"></span>'. __( 'Social', 'wp-seopress' ) .'</a></li>';
|
111 |
}
|
112 |
-
|
113 |
-
|
114 |
-
if (
|
115 |
-
|
116 |
}
|
117 |
}
|
118 |
-
echo '</ul>';
|
119 |
-
|
120 |
-
if ("seopress_404" != $typenow) {
|
121 |
-
echo '<div id="tabs-1">
|
122 |
-
<div class="box-left">
|
123 |
-
<p>
|
124 |
-
<label for="seopress_titles_title_meta">'. __( 'Title', 'wp-seopress' ) .'</label>
|
125 |
-
<input id="seopress_titles_title_meta" type="text" name="seopress_titles_title" placeholder="'.__('Enter your title','wp-seopress').'" value="'.$seopress_titles_title.'" />
|
126 |
-
</p>
|
127 |
-
<div class="wrap-seopress-counters">
|
128 |
-
<div id="seopress_titles_title_counters"></div>
|
129 |
-
'.__('(maximum recommended limit)','wp-seopress').'
|
130 |
-
</div>
|
131 |
-
<p>
|
132 |
-
<label for="seopress_titles_desc_meta">'. __( 'Meta description', 'wp-seopress' ) .'</label>
|
133 |
-
<textarea id="seopress_titles_desc_meta" style="width:100%" name="seopress_titles_desc" placeholder="'.__('Enter your meta description','wp-seopress').'" value="'.$seopress_titles_desc.'">'.$seopress_titles_desc.'</textarea>
|
134 |
-
</p>
|
135 |
-
<div class="wrap-seopress-counters">
|
136 |
-
<div id="seopress_titles_desc_counters"></div>
|
137 |
-
'.__('(maximum recommended limit)','wp-seopress').'
|
138 |
-
</div>
|
139 |
-
</div>
|
140 |
-
<div class="box-right">
|
141 |
-
<div class="google-snippet-preview">
|
142 |
-
<h3>'.__('Google Snippet Preview','wp-seopress').'</h3>
|
143 |
-
<p>'.__('This is what your page will look like in Google search results','wp-seopress').'</p>
|
144 |
-
<div class="snippet-title">'.seopress_titles_title($seopress_titles_title).'</div>
|
145 |
-
<div class="snippet-title-custom" style="display:none"></div>
|
146 |
-
<div class="snippet-title-default" style="display:none">'.get_the_title().' - '.get_bloginfo('name').'</div>
|
147 |
-
<div class="snippet-permalink">'.get_permalink().'</div>';
|
148 |
-
echo seopress_display_date_snippet();
|
149 |
-
echo '<div class="snippet-description">'.seopress_titles_desc($seopress_titles_desc).'...</div>
|
150 |
-
<div class="snippet-description-custom" style="display:none"></div>
|
151 |
-
<div class="snippet-description-default" style="display:none">'.seopress_titles_desc($seopress_titles_desc).'</div>';
|
152 |
-
echo '</div>
|
153 |
-
</div>
|
154 |
-
</div>
|
155 |
-
<div id="tabs-2">
|
156 |
-
<p>
|
157 |
-
<label for="seopress_robots_index_meta">
|
158 |
-
<input type="checkbox" name="seopress_robots_index" id="seopress_robots_index_meta" value="yes" '. checked( $seopress_robots_index, 'yes', false ) .' />
|
159 |
-
'. __( 'noindex', 'wp-seopress' ) .'
|
160 |
-
</label><span class="dashicons dashicons-info" title="'.esc_html(__('Do not display all pages of the site in Google search results and do not display "Cached" links in search results.','wp-seopress')).'"></span>
|
161 |
-
</p>
|
162 |
-
<p>
|
163 |
-
<label for="seopress_robots_follow_meta">
|
164 |
-
<input type="checkbox" name="seopress_robots_follow" id="seopress_robots_follow_meta" value="yes" '. checked( $seopress_robots_follow, 'yes', false ) .' />
|
165 |
-
'. __( 'nofollow', 'wp-seopress' ) .'
|
166 |
-
</label><span class="dashicons dashicons-info" title="'.esc_html(__('Do not follow links for all pages.','wp-seopress')).'"></span>
|
167 |
-
</p>
|
168 |
-
<p>
|
169 |
-
<label for="seopress_robots_odp_meta">
|
170 |
-
<input type="checkbox" name="seopress_robots_odp" id="seopress_robots_odp_meta" value="yes" '. checked( $seopress_robots_odp, 'yes', false ) .' />
|
171 |
-
'. __( 'noodp', 'wp-seopress' ) .'
|
172 |
-
</label><span class="dashicons dashicons-info" title="'.esc_html(__('Do not use Open Directory project metadata for titles or excerpts for all pages.','wp-seopress')).'"></span>
|
173 |
-
</p>
|
174 |
-
<p>
|
175 |
-
<label for="seopress_robots_imageindex_meta">
|
176 |
-
<input type="checkbox" name="seopress_robots_imageindex" id="seopress_robots_imageindex_meta" value="yes" '. checked( $seopress_robots_imageindex, 'yes', false ) .' />
|
177 |
-
'. __( 'noimageindex', 'wp-seopress' ) .'
|
178 |
-
</label><span class="dashicons dashicons-info" title="'.esc_html(__('Do not index images from the entire site.','wp-seopress')).'"></span>
|
179 |
-
</p>
|
180 |
-
<p>
|
181 |
-
<label for="seopress_robots_archive_meta">
|
182 |
-
<input type="checkbox" name="seopress_robots_archive" id="seopress_robots_archive_meta" value="yes" '. checked( $seopress_robots_archive, 'yes', false ) .' />
|
183 |
-
'. __( 'noarchive', 'wp-seopress' ) .'
|
184 |
-
</label><span class="dashicons dashicons-info" title="'.esc_html(__('Do not display a "Cached" link in the Google search results.','wp-seopress')).'"></span>
|
185 |
-
</p>
|
186 |
-
<p>
|
187 |
-
<label for="seopress_robots_snippet_meta">
|
188 |
-
<input type="checkbox" name="seopress_robots_snippet" id="seopress_robots_snippet_meta" value="yes" '. checked( $seopress_robots_snippet, 'yes', false ) .' />
|
189 |
-
'. __( 'nosnippet', 'wp-seopress' ) .'
|
190 |
-
</label><span class="dashicons dashicons-info" title="'.esc_html(__('Do not display a description in the Google search results for all pages.','wp-seopress')).'"></span>
|
191 |
-
</p>
|
192 |
-
<p>
|
193 |
-
<label for="seopress_robots_canonical_meta">'. __( 'Canonical URL', 'wp-seopress' ) .'</label>
|
194 |
-
<input id="seopress_robots_canonical_meta" type="text" name="seopress_robots_canonical" placeholder="'.__('Default value: ','wp-seopress').get_permalink().'" value="'.$seopress_robots_canonical.'" />
|
195 |
-
</p>
|
196 |
-
</div>
|
197 |
-
<div id="tabs-3">
|
198 |
-
<span class="dashicons dashicons-facebook-alt"></span>
|
199 |
-
<p>
|
200 |
-
<label for="seopress_social_fb_title_meta">'. __( 'Facebook Title', 'wp-seopress' ) .'</label>
|
201 |
-
<input id="seopress_social_fb_title_meta" type="text" name="seopress_social_fb_title" placeholder="'.__('Enter your Facebook title','wp-seopress').'" value="'.$seopress_social_fb_title.'" />
|
202 |
-
</p>
|
203 |
-
<p>
|
204 |
-
<label for="seopress_social_fb_desc_meta">'. __( 'Facebook description', 'wp-seopress' ) .'</label>
|
205 |
-
<textarea id="seopress_social_fb_desc_meta" name="seopress_social_fb_desc" placeholder="'.__('Enter your Facebook description','wp-seopress').'" value="'.$seopress_social_fb_desc.'">'.$seopress_social_fb_desc.'</textarea>
|
206 |
-
</p>
|
207 |
-
<p>
|
208 |
-
<label for="seopress_social_fb_img_meta">'. __( 'Facebook Thumbnail', 'wp-seopress' ) .'</label>
|
209 |
-
<span class="advise">'. __('Minimum size: 200x200px', 'wp-seopress') .'</span>
|
210 |
-
<input id="seopress_social_fb_img_meta" type="text" name="seopress_social_fb_img" placeholder="'.__('Select your default thumbnail','wp-seopress').'" value="'.$seopress_social_fb_img.'" />
|
211 |
-
<input id="seopress_social_fb_img_upload" class="button" type="button" value="'.__('Upload an Image','wp-seopress').'" />
|
212 |
-
</p>
|
213 |
-
<br/>
|
214 |
-
<span class="dashicons dashicons-twitter"></span>
|
215 |
-
<p>
|
216 |
-
<label for="seopress_social_twitter_title_meta">'. __( 'Twitter Title', 'wp-seopress' ) .'</label>
|
217 |
-
<input id="seopress_social_twitter_title_meta" type="text" name="seopress_social_twitter_title" placeholder="'.__('Enter your Twitter title','wp-seopress').'" value="'.$seopress_social_twitter_title.'" />
|
218 |
-
</p>
|
219 |
-
<p>
|
220 |
-
<label for="seopress_social_twitter_desc_meta">'. __( 'Twitter description', 'wp-seopress' ) .'</label>
|
221 |
-
<textarea id="seopress_social_twitter_desc_meta" name="seopress_social_twitter_desc" placeholder="'.__('Enter your Twitter description','wp-seopress').'" value="'.$seopress_social_twitter_desc.'">'.$seopress_social_twitter_desc.'</textarea>
|
222 |
-
</p>
|
223 |
-
<p>
|
224 |
-
<label for="seopress_social_twitter_img_meta">'. __( 'Twitter Thumbnail', 'wp-seopress' ) .'</label>
|
225 |
-
<span class="advise">'. __('Minimum size: 160x160px', 'wp-seopress') .'</span>
|
226 |
-
<input id="seopress_social_twitter_img_meta" type="text" name="seopress_social_twitter_img" placeholder="'.__('Select your default thumbnail','wp-seopress').'" value="'.$seopress_social_twitter_img.'" />
|
227 |
-
<input id="seopress_social_twitter_img_upload" class="button" type="button" value="'.__('Upload an Image','wp-seopress').'" />
|
228 |
-
</p>
|
229 |
-
</div>';
|
230 |
-
}
|
231 |
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
<
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
}
|
282 |
-
}
|
283 |
-
echo '</div>
|
284 |
-
';
|
285 |
-
}
|
286 |
|
287 |
-
add_action('save_post','seopress_save_metabox');
|
288 |
-
function seopress_save_metabox($post_id){
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
|
|
|
|
|
|
368 |
}
|
369 |
-
}
|
370 |
}
|
371 |
-
?>
|
3 |
defined( 'ABSPATH' ) or die( 'Please don’t call the plugin directly. Thanks :)' );
|
4 |
|
5 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
6 |
+
//Restrict SEO metaboxes to user roles
|
7 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
function seopress_advanced_security_metaboxe_role_hook_option() {
|
9 |
+
$seopress_advanced_security_metaboxe_role_hook_option = get_option("seopress_advanced_option_name");
|
10 |
+
if ( ! empty ( $seopress_advanced_security_metaboxe_role_hook_option ) ) {
|
11 |
+
foreach ($seopress_advanced_security_metaboxe_role_hook_option as $key => $seopress_advanced_security_metaboxe_role_hook_value)
|
12 |
+
$options[$key] = $seopress_advanced_security_metaboxe_role_hook_value;
|
13 |
+
if (isset($seopress_advanced_security_metaboxe_role_hook_option['seopress_advanced_security_metaboxe_role'])) {
|
14 |
+
return $seopress_advanced_security_metaboxe_role_hook_option['seopress_advanced_security_metaboxe_role'];
|
15 |
+
}
|
16 |
}
|
|
|
17 |
}
|
18 |
|
19 |
+
if (is_user_logged_in()) {
|
20 |
+
global $wp_roles;
|
21 |
+
|
22 |
+
//Get current user role
|
23 |
+
if(isset(wp_get_current_user()->roles[0])) {
|
24 |
+
$seopress_user_role = wp_get_current_user()->roles[0];
|
25 |
+
//If current user role matchs values from Security settings then apply
|
26 |
+
if (function_exists('seopress_advanced_security_metaboxe_role_hook_option') && seopress_advanced_security_metaboxe_role_hook_option() !='') {
|
27 |
+
if( array_key_exists( $seopress_user_role, seopress_advanced_security_metaboxe_role_hook_option())) {
|
28 |
+
//do nothing
|
29 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
} else {
|
31 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////
|
32 |
+
//Display metabox in Custom Post Type
|
33 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////
|
34 |
+
add_action('add_meta_boxes','seopress_init_metabox');
|
35 |
+
function seopress_init_metabox(){
|
36 |
+
foreach (seopress_get_post_types() as $key => $value) {
|
37 |
+
add_meta_box('seopress_cpt', __('SEO','wp-seopress'), 'seopress_cpt', $key, 'normal', 'high');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
+
add_meta_box('seopress_cpt', __('SEO','wp-seopress'), 'seopress_cpt', 'seopress_404', 'normal', 'high');
|
40 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
+
function seopress_cpt($post){
|
43 |
+
global $typenow;
|
44 |
+
$seopress_titles_title = get_post_meta($post->ID,'_seopress_titles_title',true);
|
45 |
+
$seopress_titles_desc = get_post_meta($post->ID,'_seopress_titles_desc',true);
|
46 |
+
$seopress_robots_index = get_post_meta($post->ID,'_seopress_robots_index',true);
|
47 |
+
$seopress_robots_follow = get_post_meta($post->ID,'_seopress_robots_follow',true);
|
48 |
+
$seopress_robots_odp = get_post_meta($post->ID,'_seopress_robots_odp',true);
|
49 |
+
$seopress_robots_imageindex = get_post_meta($post->ID,'_seopress_robots_imageindex',true);
|
50 |
+
$seopress_robots_archive = get_post_meta($post->ID,'_seopress_robots_archive',true);
|
51 |
+
$seopress_robots_snippet = get_post_meta($post->ID,'_seopress_robots_snippet',true);
|
52 |
+
$seopress_robots_canonical = get_post_meta($post->ID,'_seopress_robots_canonical',true);
|
53 |
+
$seopress_social_fb_title = get_post_meta($post->ID,'_seopress_social_fb_title',true);
|
54 |
+
$seopress_social_fb_desc = get_post_meta($post->ID,'_seopress_social_fb_desc',true);
|
55 |
+
$seopress_social_fb_img = get_post_meta($post->ID,'_seopress_social_fb_img',true);
|
56 |
+
$seopress_social_twitter_title = get_post_meta($post->ID,'_seopress_social_twitter_title',true);
|
57 |
+
$seopress_social_twitter_desc = get_post_meta($post->ID,'_seopress_social_twitter_desc',true);
|
58 |
+
$seopress_social_twitter_img = get_post_meta($post->ID,'_seopress_social_twitter_img',true);
|
59 |
+
$seopress_redirections_enabled = get_post_meta($post->ID,'_seopress_redirections_enabled',true);
|
60 |
+
$seopress_redirections_type = get_post_meta($post->ID,'_seopress_redirections_type',true);
|
61 |
+
$seopress_redirections_value = get_post_meta($post->ID,'_seopress_redirections_value',true);
|
62 |
+
$seopress_news_disabled = get_post_meta($post->ID,'_seopress_news_disabled',true);
|
63 |
+
$seopress_news_genres = get_post_meta($post->ID,'_seopress_news_genres',true);
|
64 |
+
$seopress_news_keyboard = get_post_meta($post->ID,'_seopress_news_keyboard',true);
|
65 |
|
66 |
+
function seopress_titles_title($seopress_titles_title) {
|
67 |
+
if ($seopress_titles_title !='') {
|
68 |
+
return $seopress_titles_title;
|
69 |
+
} else {
|
70 |
+
return get_the_title().' - '.get_bloginfo('name');
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
function seopress_titles_single_desc_option() {
|
75 |
+
global $post;
|
76 |
+
$seopress_get_current_cpt = get_post_type($post);
|
77 |
+
|
78 |
+
$seopress_titles_single_desc_option = get_option("seopress_titles_option_name");
|
79 |
+
if ( ! empty ( $seopress_titles_single_desc_option ) ) {
|
80 |
+
foreach ($seopress_titles_single_desc_option as $key => $seopress_titles_single_desc_value)
|
81 |
+
$options[$key] = $seopress_titles_single_desc_value;
|
82 |
+
if (isset($seopress_titles_single_desc_option['seopress_titles_single_titles'][$seopress_get_current_cpt]['description'])) {
|
83 |
+
return $seopress_titles_single_desc_option['seopress_titles_single_titles'][$seopress_get_current_cpt]['description'];
|
84 |
+
}
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
function seopress_titles_desc($seopress_titles_desc) {
|
89 |
+
if ($seopress_titles_desc !='') {
|
90 |
+
return $seopress_titles_desc;
|
91 |
+
} else {
|
92 |
+
global $post;
|
93 |
+
if (seopress_titles_single_desc_option() !='') {
|
94 |
+
return seopress_titles_single_desc_option();
|
95 |
+
} elseif ( has_excerpt( $post->ID ) ) {
|
96 |
+
// This post has excerpt
|
97 |
+
return substr(wp_strip_all_tags($post->post_excerpt, true), 0, 160);
|
98 |
+
} else {
|
99 |
+
// This post has no excerpt
|
100 |
+
return substr(wp_strip_all_tags($post->post_content, true), 0, 160);
|
101 |
+
}
|
102 |
+
}
|
103 |
+
}
|
104 |
|
105 |
+
function seopress_titles_single_cpt_date_option() {
|
106 |
+
global $post;
|
107 |
+
$seopress_get_current_cpt = get_post_type($post);
|
|
|
|
|
108 |
|
109 |
+
$seopress_titles_single_cpt_date_option = get_option("seopress_titles_option_name");
|
110 |
+
if ( ! empty ( $seopress_titles_single_cpt_date_option ) ) {
|
111 |
+
foreach ($seopress_titles_single_cpt_date_option as $key => $seopress_titles_single_cpt_date_value)
|
112 |
+
$options[$key] = $seopress_titles_single_cpt_date_value;
|
113 |
+
if (isset($seopress_titles_single_cpt_date_option['seopress_titles_single_titles'][$seopress_get_current_cpt]['date'])) {
|
114 |
+
return $seopress_titles_single_cpt_date_option['seopress_titles_single_titles'][$seopress_get_current_cpt]['date'];
|
115 |
+
}
|
116 |
+
}
|
117 |
+
};
|
118 |
|
119 |
+
function seopress_display_date_snippet() {
|
120 |
+
if (seopress_titles_single_cpt_date_option()) {
|
121 |
+
return '<div class="snippet-date">'.get_the_date('M j, Y').' - </div>';
|
122 |
+
}
|
|
|
|
|
123 |
}
|
124 |
+
|
125 |
+
function seopress_redirections_value($seopress_redirections_value) {
|
126 |
+
if ($seopress_redirections_value !='') {
|
127 |
+
return $seopress_redirections_value;
|
128 |
}
|
129 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
|
131 |
+
echo '<div id="seopress-tabs">';
|
132 |
+
echo'<ul>';
|
133 |
+
if ("seopress_404" != $typenow) {
|
134 |
+
echo '<li><a href="#tabs-1"><span class="dashicons dashicons-editor-table"></span>'. __( 'Titles settings', 'wp-seopress' ) .'</a></li>
|
135 |
+
<li><a href="#tabs-2"><span class="dashicons dashicons-admin-generic"></span>'. __( 'Advanced', 'wp-seopress' ) .'</a></li>
|
136 |
+
<li><a href="#tabs-3"><span class="dashicons dashicons-share"></span>'. __( 'Social', 'wp-seopress' ) .'</a></li>';
|
137 |
+
}
|
138 |
+
echo '<li><a href="#tabs-4"><span class="dashicons dashicons-admin-links"></span>'. __( 'Redirections', 'wp-seopress' ) .'</a></li>';
|
139 |
+
if (is_plugin_active( 'wp-seopress-pro/seopress-pro.php' )) {
|
140 |
+
if ("seopress_404" != $typenow) {
|
141 |
+
echo '<li><a href="#tabs-5"><span class="dashicons dashicons-admin-post"></span>'. __( 'Google News', 'wp-seopress-pro' ) .'</a></li>';
|
142 |
+
}
|
143 |
+
}
|
144 |
+
echo '</ul>';
|
145 |
+
|
146 |
+
if ("seopress_404" != $typenow) {
|
147 |
+
echo '<div id="tabs-1">
|
148 |
+
<div class="box-left">
|
149 |
+
<p>
|
150 |
+
<label for="seopress_titles_title_meta">'. __( 'Title', 'wp-seopress' ) .'</label>
|
151 |
+
<input id="seopress_titles_title_meta" type="text" name="seopress_titles_title" placeholder="'.__('Enter your title','wp-seopress').'" value="'.$seopress_titles_title.'" />
|
152 |
+
</p>
|
153 |
+
<div class="wrap-seopress-counters">
|
154 |
+
<div id="seopress_titles_title_counters"></div>
|
155 |
+
'.__('(maximum recommended limit)','wp-seopress').'
|
156 |
+
</div>
|
157 |
+
<p>
|
158 |
+
<label for="seopress_titles_desc_meta">'. __( 'Meta description', 'wp-seopress' ) .'</label>
|
159 |
+
<textarea id="seopress_titles_desc_meta" style="width:100%" name="seopress_titles_desc" placeholder="'.__('Enter your meta description','wp-seopress').'" value="'.$seopress_titles_desc.'">'.$seopress_titles_desc.'</textarea>
|
160 |
+
</p>
|
161 |
+
<div class="wrap-seopress-counters">
|
162 |
+
<div id="seopress_titles_desc_counters"></div>
|
163 |
+
'.__('(maximum recommended limit)','wp-seopress').'
|
164 |
+
</div>
|
165 |
+
</div>
|
166 |
+
<div class="box-right">
|
167 |
+
<div class="google-snippet-preview">
|
168 |
+
<h3>'.__('Google Snippet Preview','wp-seopress').'</h3>
|
169 |
+
<p>'.__('This is what your page will look like in Google search results','wp-seopress').'</p>
|
170 |
+
<div class="snippet-title">'.seopress_titles_title($seopress_titles_title).'</div>
|
171 |
+
<div class="snippet-title-custom" style="display:none"></div>
|
172 |
+
<div class="snippet-title-default" style="display:none">'.get_the_title().' - '.get_bloginfo('name').'</div>
|
173 |
+
<div class="snippet-permalink">'.get_permalink().'</div>';
|
174 |
+
echo seopress_display_date_snippet();
|
175 |
+
echo '<div class="snippet-description">'.seopress_titles_desc($seopress_titles_desc).'...</div>
|
176 |
+
<div class="snippet-description-custom" style="display:none"></div>
|
177 |
+
<div class="snippet-description-default" style="display:none">'.seopress_titles_desc($seopress_titles_desc).'</div>';
|
178 |
+
echo '</div>
|
179 |
+
</div>
|
180 |
+
</div>
|
181 |
+
<div id="tabs-2">
|
182 |
+
<p>
|
183 |
+
<label for="seopress_robots_index_meta">
|
184 |
+
<input type="checkbox" name="seopress_robots_index" id="seopress_robots_index_meta" value="yes" '. checked( $seopress_robots_index, 'yes', false ) .' />
|
185 |
+
'. __( 'noindex', 'wp-seopress' ) .'
|
186 |
+
</label><span class="dashicons dashicons-info" title="'.esc_html(__('Do not display all pages of the site in Google search results and do not display "Cached" links in search results.','wp-seopress')).'"></span>
|
187 |
+
</p>
|
188 |
+
<p>
|
189 |
+
<label for="seopress_robots_follow_meta">
|
190 |
+
<input type="checkbox" name="seopress_robots_follow" id="seopress_robots_follow_meta" value="yes" '. checked( $seopress_robots_follow, 'yes', false ) .' />
|
191 |
+
'. __( 'nofollow', 'wp-seopress' ) .'
|
192 |
+
</label><span class="dashicons dashicons-info" title="'.esc_html(__('Do not follow links for all pages.','wp-seopress')).'"></span>
|
193 |
+
</p>
|
194 |
+
<p>
|
195 |
+
<label for="seopress_robots_odp_meta">
|
196 |
+
<input type="checkbox" name="seopress_robots_odp" id="seopress_robots_odp_meta" value="yes" '. checked( $seopress_robots_odp, 'yes', false ) .' />
|
197 |
+
'. __( 'noodp', 'wp-seopress' ) .'
|
198 |
+
</label><span class="dashicons dashicons-info" title="'.esc_html(__('Do not use Open Directory project metadata for titles or excerpts for all pages.','wp-seopress')).'"></span>
|
199 |
+
</p>
|
200 |
+
<p>
|
201 |
+
<label for="seopress_robots_imageindex_meta">
|
202 |
+
<input type="checkbox" name="seopress_robots_imageindex" id="seopress_robots_imageindex_meta" value="yes" '. checked( $seopress_robots_imageindex, 'yes', false ) .' />
|
203 |
+
'. __( 'noimageindex', 'wp-seopress' ) .'
|
204 |
+
</label><span class="dashicons dashicons-info" title="'.esc_html(__('Do not index images from the entire site.','wp-seopress')).'"></span>
|
205 |
+
</p>
|
206 |
+
<p>
|
207 |
+
<label for="seopress_robots_archive_meta">
|
208 |
+
<input type="checkbox" name="seopress_robots_archive" id="seopress_robots_archive_meta" value="yes" '. checked( $seopress_robots_archive, 'yes', false ) .' />
|
209 |
+
'. __( 'noarchive', 'wp-seopress' ) .'
|
210 |
+
</label><span class="dashicons dashicons-info" title="'.esc_html(__('Do not display a "Cached" link in the Google search results.','wp-seopress')).'"></span>
|
211 |
+
</p>
|
212 |
+
<p>
|
213 |
+
<label for="seopress_robots_snippet_meta">
|
214 |
+
<input type="checkbox" name="seopress_robots_snippet" id="seopress_robots_snippet_meta" value="yes" '. checked( $seopress_robots_snippet, 'yes', false ) .' />
|
215 |
+
'. __( 'nosnippet', 'wp-seopress' ) .'
|
216 |
+
</label><span class="dashicons dashicons-info" title="'.esc_html(__('Do not display a description in the Google search results for all pages.','wp-seopress')).'"></span>
|
217 |
+
</p>
|
218 |
+
<p>
|
219 |
+
<label for="seopress_robots_canonical_meta">'. __( 'Canonical URL', 'wp-seopress' ) .'</label>
|
220 |
+
<input id="seopress_robots_canonical_meta" type="text" name="seopress_robots_canonical" placeholder="'.__('Default value: ','wp-seopress').get_permalink().'" value="'.$seopress_robots_canonical.'" />
|
221 |
+
</p>
|
222 |
+
</div>
|
223 |
+
<div id="tabs-3">
|
224 |
+
<span class="dashicons dashicons-facebook-alt"></span>
|
225 |
+
<p>
|
226 |
+
<label for="seopress_social_fb_title_meta">'. __( 'Facebook Title', 'wp-seopress' ) .'</label>
|
227 |
+
<input id="seopress_social_fb_title_meta" type="text" name="seopress_social_fb_title" placeholder="'.__('Enter your Facebook title','wp-seopress').'" value="'.$seopress_social_fb_title.'" />
|
228 |
+
</p>
|
229 |
+
<p>
|
230 |
+
<label for="seopress_social_fb_desc_meta">'. __( 'Facebook description', 'wp-seopress' ) .'</label>
|
231 |
+
<textarea id="seopress_social_fb_desc_meta" name="seopress_social_fb_desc" placeholder="'.__('Enter your Facebook description','wp-seopress').'" value="'.$seopress_social_fb_desc.'">'.$seopress_social_fb_desc.'</textarea>
|
232 |
+
</p>
|
233 |
+
<p>
|
234 |
+
<label for="seopress_social_fb_img_meta">'. __( 'Facebook Thumbnail', 'wp-seopress' ) .'</label>
|
235 |
+
<span class="advise">'. __('Minimum size: 200x200px', 'wp-seopress') .'</span>
|
236 |
+
<input id="seopress_social_fb_img_meta" type="text" name="seopress_social_fb_img" placeholder="'.__('Select your default thumbnail','wp-seopress').'" value="'.$seopress_social_fb_img.'" />
|
237 |
+
<input id="seopress_social_fb_img_upload" class="button" type="button" value="'.__('Upload an Image','wp-seopress').'" />
|
238 |
+
</p>
|
239 |
+
<br/>
|
240 |
+
<span class="dashicons dashicons-twitter"></span>
|
241 |
+
<p>
|
242 |
+
<label for="seopress_social_twitter_title_meta">'. __( 'Twitter Title', 'wp-seopress' ) .'</label>
|
243 |
+
<input id="seopress_social_twitter_title_meta" type="text" name="seopress_social_twitter_title" placeholder="'.__('Enter your Twitter title','wp-seopress').'" value="'.$seopress_social_twitter_title.'" />
|
244 |
+
</p>
|
245 |
+
<p>
|
246 |
+
<label for="seopress_social_twitter_desc_meta">'. __( 'Twitter description', 'wp-seopress' ) .'</label>
|
247 |
+
<textarea id="seopress_social_twitter_desc_meta" name="seopress_social_twitter_desc" placeholder="'.__('Enter your Twitter description','wp-seopress').'" value="'.$seopress_social_twitter_desc.'">'.$seopress_social_twitter_desc.'</textarea>
|
248 |
+
</p>
|
249 |
+
<p>
|
250 |
+
<label for="seopress_social_twitter_img_meta">'. __( 'Twitter Thumbnail', 'wp-seopress' ) .'</label>
|
251 |
+
<span class="advise">'. __('Minimum size: 160x160px', 'wp-seopress') .'</span>
|
252 |
+
<input id="seopress_social_twitter_img_meta" type="text" name="seopress_social_twitter_img" placeholder="'.__('Select your default thumbnail','wp-seopress').'" value="'.$seopress_social_twitter_img.'" />
|
253 |
+
<input id="seopress_social_twitter_img_upload" class="button" type="button" value="'.__('Upload an Image','wp-seopress').'" />
|
254 |
+
</p>
|
255 |
+
</div>';
|
256 |
+
}
|
257 |
+
|
258 |
+
echo '<div id="tabs-4">
|
259 |
+
<p>
|
260 |
+
<label for="seopress_redirections_enabled_meta" id="seopress_redirections_enabled">
|
261 |
+
<input type="checkbox" name="seopress_redirections_enabled" id="seopress_redirections_enabled_meta" value="yes" '. checked( $seopress_redirections_enabled, 'yes', false ) .' />
|
262 |
+
'. __( 'Enable redirection?', 'wp-seopress' ) .'
|
263 |
+
</label>
|
264 |
+
</p>
|
265 |
+
<p>
|
266 |
+
<label for="seopress_redirections_value_meta">'. __( 'URL redirection', 'wp-seopress' ) .'</label>
|
267 |
+
<select name="seopress_redirections_type">
|
268 |
+
<option ' . selected( '301', $seopress_redirections_type, false ) . ' value="301">'. __( '301', 'wp-seopress' ) .'</option>
|
269 |
+
<option ' . selected( '302', $seopress_redirections_type, false ) . ' value="302">'. __( '302', 'wp-seopress' ) .'</option>
|
270 |
+
<option ' . selected( '307', $seopress_redirections_type, false ) . ' value="307">'. __( '307', 'wp-seopress' ) .'</option>
|
271 |
+
</select>
|
272 |
+
<input id="seopress_redirections_value_meta" type="text" name="seopress_redirections_value" placeholder="'.__('Enter your URL','wp-seopress').'" value="'.$seopress_redirections_value.'" />
|
273 |
+
<br><br>';
|
274 |
+
if ($seopress_redirections_value !='') {
|
275 |
+
echo '<a href="'.seopress_redirections_value($seopress_redirections_value).'" id="seopress_redirections_value_default" class="button" target="_blank">'.__('Test your URL','wp-seopress').'</a>';
|
276 |
+
}
|
277 |
+
echo '<a href="" id="seopress_redirections_value_live" class="button" target="_blank" style="display: none">'.__('Test your URL','wp-seopress').'</a>
|
278 |
+
</p>
|
279 |
+
</div>';
|
280 |
+
if (is_plugin_active( 'wp-seopress-pro/seopress-pro.php' )) {
|
281 |
+
if ("seopress_404" != $typenow) {
|
282 |
+
echo '<div id="tabs-5">
|
283 |
+
<p>
|
284 |
+
<label for="seopress_news_disabled_meta" id="seopress_news_disabled">
|
285 |
+
<input type="checkbox" name="seopress_news_disabled" id="seopress_news_disabled_meta" value="yes" '. checked( $seopress_news_disabled, 'yes', false ) .' />
|
286 |
+
'. __( 'Exclude this post from Google News Sitemap?', 'wp-seopress' ) .'
|
287 |
+
</label>
|
288 |
+
</p>
|
289 |
+
<p>
|
290 |
+
<label for="seopress_news_genres_meta">'. __( 'Google News Genres', 'wp-seopress' ) .'</label>
|
291 |
+
<select name="seopress_news_genres">
|
292 |
+
<option ' . selected( 'none', $seopress_news_genres, false ) . ' value="none">'. __( 'None', 'wp-seopress' ) .'</option>
|
293 |
+
<option ' . selected( 'pressrelease', $seopress_news_genres, false ) . ' value="pressrelease">'. __( 'Press Release', 'wp-seopress' ) .'</option>
|
294 |
+
<option ' . selected( 'satire', $seopress_news_genres, false ) . ' value="satire">'. __( 'Satire', 'wp-seopress' ) .'</option>
|
295 |
+
<option ' . selected( 'blog', $seopress_news_genres, false ) . ' value="blog">'. __( 'Blog', 'wp-seopress' ) .'</option>
|
296 |
+
<option ' . selected( 'oped', $seopress_news_genres, false ) . ' value="oped">'. __( 'OpEd', 'wp-seopress' ) .'</option>
|
297 |
+
<option ' . selected( 'opinion', $seopress_news_genres, false ) . ' value="opinion">'. __( 'Opinion', 'wp-seopress' ) .'</option>
|
298 |
+
<option ' . selected( 'usergenerated', $seopress_news_genres, false ) . ' value="usergenerated">'. __( 'UserGenerated', 'wp-seopress' ) .'</option>
|
299 |
+
</select>
|
300 |
+
</p>
|
301 |
+
<p>
|
302 |
+
<label for="seopress_news_keyboard_meta" id="seopress_news_keyboard">
|
303 |
+
'. __( 'Google News Keywords <em>(max recommended limit: 12)</em>', 'wp-seopress' ) .'</label>
|
304 |
+
<input id="seopress_news_keyboard_meta" type="text" name="seopress_news_keyboard" placeholder="'.__('Enter your Google News Keywords','wp-seopress').'" value="'.$seopress_news_keyboard.'" />
|
305 |
+
</p>
|
306 |
+
</div>';
|
307 |
+
}
|
308 |
+
}
|
309 |
+
echo '</div>
|
310 |
+
';
|
311 |
}
|
|
|
|
|
|
|
|
|
312 |
|
313 |
+
add_action('save_post','seopress_save_metabox');
|
314 |
+
function seopress_save_metabox($post_id){
|
315 |
+
if ( 'attachment' !== get_post_type($post_id)) {
|
316 |
+
if(isset($_POST['seopress_titles_title'])){
|
317 |
+
update_post_meta($post_id, '_seopress_titles_title', esc_html($_POST['seopress_titles_title']));
|
318 |
+
}
|
319 |
+
if(isset($_POST['seopress_titles_desc'])){
|
320 |
+
update_post_meta($post_id, '_seopress_titles_desc', esc_html($_POST['seopress_titles_desc']));
|
321 |
+
}
|
322 |
+
if( isset( $_POST[ 'seopress_robots_index' ] ) ) {
|
323 |
+
update_post_meta( $post_id, '_seopress_robots_index', 'yes' );
|
324 |
+
} else {
|
325 |
+
delete_post_meta( $post_id, '_seopress_robots_index', '' );
|
326 |
+
}
|
327 |
+
if( isset( $_POST[ 'seopress_robots_follow' ] ) ) {
|
328 |
+
update_post_meta( $post_id, '_seopress_robots_follow', 'yes' );
|
329 |
+
} else {
|
330 |
+
delete_post_meta( $post_id, '_seopress_robots_follow', '' );
|
331 |
+
}
|
332 |
+
if( isset( $_POST[ 'seopress_robots_odp' ] ) ) {
|
333 |
+
update_post_meta( $post_id, '_seopress_robots_odp', 'yes' );
|
334 |
+
} else {
|
335 |
+
delete_post_meta( $post_id, '_seopress_robots_odp', '' );
|
336 |
+
}
|
337 |
+
if( isset( $_POST[ 'seopress_robots_imageindex' ] ) ) {
|
338 |
+
update_post_meta( $post_id, '_seopress_robots_imageindex', 'yes' );
|
339 |
+
} else {
|
340 |
+
delete_post_meta( $post_id, '_seopress_robots_imageindex', '' );
|
341 |
+
}
|
342 |
+
if( isset( $_POST[ 'seopress_robots_archive' ] ) ) {
|
343 |
+
update_post_meta( $post_id, '_seopress_robots_archive', 'yes' );
|
344 |
+
} else {
|
345 |
+
delete_post_meta( $post_id, '_seopress_robots_archive', '' );
|
346 |
+
}
|
347 |
+
if( isset( $_POST[ 'seopress_robots_snippet' ] ) ) {
|
348 |
+
update_post_meta( $post_id, '_seopress_robots_snippet', 'yes' );
|
349 |
+
} else {
|
350 |
+
delete_post_meta( $post_id, '_seopress_robots_snippet', '' );
|
351 |
+
}
|
352 |
+
if(isset($_POST['seopress_robots_canonical'])){
|
353 |
+
update_post_meta($post_id, '_seopress_robots_canonical', esc_html($_POST['seopress_robots_canonical']));
|
354 |
+
}
|
355 |
+
if(isset($_POST['seopress_social_fb_title'])){
|
356 |
+
update_post_meta($post_id, '_seopress_social_fb_title', esc_html($_POST['seopress_social_fb_title']));
|
357 |
+
}
|
358 |
+
if(isset($_POST['seopress_social_fb_desc'])){
|
359 |
+
update_post_meta($post_id, '_seopress_social_fb_desc', esc_html($_POST['seopress_social_fb_desc']));
|
360 |
+
}
|
361 |
+
if(isset($_POST['seopress_social_fb_img'])){
|
362 |
+
update_post_meta($post_id, '_seopress_social_fb_img', esc_html($_POST['seopress_social_fb_img']));
|
363 |
+
}
|
364 |
+
if(isset($_POST['seopress_social_twitter_title'])){
|
365 |
+
update_post_meta($post_id, '_seopress_social_twitter_title', esc_html($_POST['seopress_social_twitter_title']));
|
366 |
+
}
|
367 |
+
if(isset($_POST['seopress_social_twitter_desc'])){
|
368 |
+
update_post_meta($post_id, '_seopress_social_twitter_desc', esc_html($_POST['seopress_social_twitter_desc']));
|
369 |
+
}
|
370 |
+
if(isset($_POST['seopress_social_twitter_img'])){
|
371 |
+
update_post_meta($post_id, '_seopress_social_twitter_img', esc_html($_POST['seopress_social_twitter_img']));
|
372 |
+
}
|
373 |
+
if(isset($_POST['seopress_redirections_type'])){
|
374 |
+
update_post_meta($post_id, '_seopress_redirections_type', $_POST['seopress_redirections_type']);
|
375 |
+
}
|
376 |
+
if(isset($_POST['seopress_redirections_value'])){
|
377 |
+
update_post_meta($post_id, '_seopress_redirections_value', esc_html($_POST['seopress_redirections_value']));
|
378 |
+
}
|
379 |
+
if( isset( $_POST[ 'seopress_redirections_enabled' ] ) ) {
|
380 |
+
update_post_meta( $post_id, '_seopress_redirections_enabled', 'yes' );
|
381 |
+
} else {
|
382 |
+
delete_post_meta( $post_id, '_seopress_redirections_enabled', '' );
|
383 |
+
}
|
384 |
+
if( isset( $_POST[ 'seopress_news_disabled' ] ) ) {
|
385 |
+
update_post_meta( $post_id, '_seopress_news_disabled', 'yes' );
|
386 |
+
} else {
|
387 |
+
delete_post_meta( $post_id, '_seopress_news_disabled', '' );
|
388 |
+
}
|
389 |
+
if(isset($_POST['seopress_news_genres'])){
|
390 |
+
update_post_meta($post_id, '_seopress_news_genres', $_POST['seopress_news_genres']);
|
391 |
+
}
|
392 |
+
if(isset($_POST['seopress_news_keyboard'])){
|
393 |
+
update_post_meta($post_id, '_seopress_news_keyboard', esc_html($_POST['seopress_news_keyboard']));
|
394 |
+
}
|
395 |
+
}
|
396 |
+
}
|
397 |
}
|
398 |
+
}
|
399 |
}
|
|
inc/admin/admin.php
CHANGED
@@ -110,6 +110,7 @@ class seopress_options
|
|
110 |
$seopress_xml_sitemap_options = get_option('seopress_xml_sitemap_option_name');
|
111 |
|
112 |
$seopress_xml_sitemap_options['seopress_xml_sitemap_general_enable'] = '1';
|
|
|
113 |
|
114 |
global $wp_post_types;
|
115 |
|
@@ -170,7 +171,7 @@ class seopress_options
|
|
170 |
{
|
171 |
add_menu_page('SEOPress Option Page', 'SEOPress', 'manage_options', 'seopress-option', array( $this, 'create_admin_page' ), 'dashicons-admin-seopress', 90);
|
172 |
$seopress_titles_help_tab = add_submenu_page('seopress-option', __('Titles & Metas','wp-seopress'), __('Titles & Metas','wp-seopress'), 'manage_options', 'seopress-titles', array( $this, 'seopress_titles_page' ));
|
173 |
-
add_submenu_page('seopress-option', __('XML / HTML Sitemap','wp-seopress'), __('XML / HTML Sitemap','wp-seopress'), 'manage_options', 'seopress-xml-sitemap', array( $this, 'seopress_xml_sitemap_page' ));
|
174 |
add_submenu_page('seopress-option', __('Social','wp-seopress'), __('Social','wp-seopress'), 'manage_options', 'seopress-social', array( $this, 'seopress_social_page' ));
|
175 |
add_submenu_page('seopress-option', __('Google Analytics','wp-seopress'), __('Google Analytics','wp-seopress'), 'manage_options', 'seopress-google-analytics', array( $this, 'seopress_google_analytics_page' ));
|
176 |
add_submenu_page('seopress-option', __('Advanced','wp-seopress'), __('Advanced','wp-seopress'), 'manage_options', 'seopress-advanced', array( $this, 'seopress_advanced_page' ));
|
@@ -417,6 +418,7 @@ class seopress_options
|
|
417 |
$plugin_settings_tabs = array(
|
418 |
'tab_seopress_advanced_advanced' => __( "Advanced", "wp-seopress" ),
|
419 |
'tab_seopress_advanced_appearance' => __( "Appearance", "wp-seopress" ),
|
|
|
420 |
);
|
421 |
|
422 |
echo '<h2 class="nav-tab-wrapper">';
|
@@ -427,6 +429,7 @@ class seopress_options
|
|
427 |
?>
|
428 |
<div class="seopress-tab <?php if ($current_tab == 'tab_seopress_advanced_advanced') { echo 'active'; } ?>" id="tab_seopress_advanced_advanced"><?php do_settings_sections( 'seopress-settings-admin-advanced-advanced' ); ?></div>
|
429 |
<div class="seopress-tab <?php if ($current_tab == 'tab_seopress_advanced_appearance') { echo 'active'; } ?>" id="tab_seopress_advanced_appearance"><?php do_settings_sections( 'seopress-settings-admin-advanced-appearance' ); ?></div>
|
|
|
430 |
</div>
|
431 |
|
432 |
<?php submit_button(); ?>
|
@@ -797,8 +800,8 @@ class seopress_options
|
|
797 |
<span class="dashicons dashicons-media-spreadsheet"></span>
|
798 |
</div>
|
799 |
<span class="inner">
|
800 |
-
<h3><?php _e('XML / HTML Sitemap','wp-seopress'); ?></h3>
|
801 |
-
<p><?php _e('Manage your XML / HTML Sitemap','wp-seopress'); ?></p>
|
802 |
<a class="button-secondary" href="<?php echo admin_url( 'admin.php?page=seopress-xml-sitemap' ); ?>"><?php _e('Manage','wp-seopress'); ?></a>
|
803 |
<?php
|
804 |
if(seopress_get_toggle_xml_sitemap_option()=='1') {
|
@@ -1445,6 +1448,14 @@ class seopress_options
|
|
1445 |
'seopress-settings-admin-xml-sitemap-general', // Page
|
1446 |
'seopress_setting_section_xml_sitemap_general' // Section
|
1447 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1448 |
|
1449 |
add_settings_field(
|
1450 |
'seopress_xml_sitemap_html_enable', // ID
|
@@ -1992,6 +2003,23 @@ class seopress_options
|
|
1992 |
'seopress-settings-admin-advanced-appearance', // Page
|
1993 |
'seopress_setting_section_advanced_appearance' // Section
|
1994 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1995 |
}
|
1996 |
|
1997 |
/**
|
@@ -2058,6 +2086,8 @@ class seopress_options
|
|
2058 |
{
|
2059 |
echo '<p>'.__('To view your sitemap, enable permalinks (not default one), and save settings to flush them.', 'wp-seopress').'</p>';
|
2060 |
echo '<p>'.__('Only the last 1000 items are listed in Sitemaps for performances issues.', 'wp-seopress').'</p>';
|
|
|
|
|
2061 |
|
2062 |
echo '<a href="'.home_url().'/sitemaps.xml" target="_blank" class="button">'.__('View your sitemap','wp-seopress').'</a>';
|
2063 |
echo ' ';
|
@@ -2126,6 +2156,11 @@ class seopress_options
|
|
2126 |
public function print_section_info_advanced_appearance()
|
2127 |
{
|
2128 |
print __('<p>Customize SEOPress to fit your needs</p>', 'wp-seopress');
|
|
|
|
|
|
|
|
|
|
|
2129 |
}
|
2130 |
|
2131 |
/**
|
@@ -2764,6 +2799,23 @@ class seopress_options
|
|
2764 |
}
|
2765 |
}
|
2766 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2767 |
public function seopress_xml_sitemap_html_enable_callback()
|
2768 |
{
|
2769 |
$options = get_option( 'seopress_xml_sitemap_option_name' );
|
@@ -3938,6 +3990,31 @@ class seopress_options
|
|
3938 |
if (isset($this->options['seopress_advanced_appearance_genesis_seo_metaboxe'])) {
|
3939 |
esc_attr( $this->options['seopress_advanced_appearance_genesis_seo_metaboxe']);
|
3940 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3941 |
}
|
3942 |
}
|
3943 |
|
110 |
$seopress_xml_sitemap_options = get_option('seopress_xml_sitemap_option_name');
|
111 |
|
112 |
$seopress_xml_sitemap_options['seopress_xml_sitemap_general_enable'] = '1';
|
113 |
+
$seopress_xml_sitemap_options['seopress_xml_sitemap_img_enable'] = '1';
|
114 |
|
115 |
global $wp_post_types;
|
116 |
|
171 |
{
|
172 |
add_menu_page('SEOPress Option Page', 'SEOPress', 'manage_options', 'seopress-option', array( $this, 'create_admin_page' ), 'dashicons-admin-seopress', 90);
|
173 |
$seopress_titles_help_tab = add_submenu_page('seopress-option', __('Titles & Metas','wp-seopress'), __('Titles & Metas','wp-seopress'), 'manage_options', 'seopress-titles', array( $this, 'seopress_titles_page' ));
|
174 |
+
add_submenu_page('seopress-option', __('XML / Image / HTML Sitemap','wp-seopress'), __('XML / HTML Sitemap','wp-seopress'), 'manage_options', 'seopress-xml-sitemap', array( $this, 'seopress_xml_sitemap_page' ));
|
175 |
add_submenu_page('seopress-option', __('Social','wp-seopress'), __('Social','wp-seopress'), 'manage_options', 'seopress-social', array( $this, 'seopress_social_page' ));
|
176 |
add_submenu_page('seopress-option', __('Google Analytics','wp-seopress'), __('Google Analytics','wp-seopress'), 'manage_options', 'seopress-google-analytics', array( $this, 'seopress_google_analytics_page' ));
|
177 |
add_submenu_page('seopress-option', __('Advanced','wp-seopress'), __('Advanced','wp-seopress'), 'manage_options', 'seopress-advanced', array( $this, 'seopress_advanced_page' ));
|
418 |
$plugin_settings_tabs = array(
|
419 |
'tab_seopress_advanced_advanced' => __( "Advanced", "wp-seopress" ),
|
420 |
'tab_seopress_advanced_appearance' => __( "Appearance", "wp-seopress" ),
|
421 |
+
'tab_seopress_advanced_security' => __( "Security", "wp-seopress" ),
|
422 |
);
|
423 |
|
424 |
echo '<h2 class="nav-tab-wrapper">';
|
429 |
?>
|
430 |
<div class="seopress-tab <?php if ($current_tab == 'tab_seopress_advanced_advanced') { echo 'active'; } ?>" id="tab_seopress_advanced_advanced"><?php do_settings_sections( 'seopress-settings-admin-advanced-advanced' ); ?></div>
|
431 |
<div class="seopress-tab <?php if ($current_tab == 'tab_seopress_advanced_appearance') { echo 'active'; } ?>" id="tab_seopress_advanced_appearance"><?php do_settings_sections( 'seopress-settings-admin-advanced-appearance' ); ?></div>
|
432 |
+
<div class="seopress-tab <?php if ($current_tab == 'tab_seopress_advanced_security') { echo 'active'; } ?>" id="tab_seopress_advanced_security"><?php do_settings_sections( 'seopress-settings-admin-advanced-security' ); ?></div>
|
433 |
</div>
|
434 |
|
435 |
<?php submit_button(); ?>
|
800 |
<span class="dashicons dashicons-media-spreadsheet"></span>
|
801 |
</div>
|
802 |
<span class="inner">
|
803 |
+
<h3><?php _e('XML / Image / HTML Sitemap','wp-seopress'); ?></h3>
|
804 |
+
<p><?php _e('Manage your XML / Image / HTML Sitemap','wp-seopress'); ?></p>
|
805 |
<a class="button-secondary" href="<?php echo admin_url( 'admin.php?page=seopress-xml-sitemap' ); ?>"><?php _e('Manage','wp-seopress'); ?></a>
|
806 |
<?php
|
807 |
if(seopress_get_toggle_xml_sitemap_option()=='1') {
|
1448 |
'seopress-settings-admin-xml-sitemap-general', // Page
|
1449 |
'seopress_setting_section_xml_sitemap_general' // Section
|
1450 |
);
|
1451 |
+
|
1452 |
+
add_settings_field(
|
1453 |
+
'seopress_xml_sitemap_img_enable', // ID
|
1454 |
+
__("Enable XML Image Sitemaps","wp-seopress"), // Title
|
1455 |
+
array( $this, 'seopress_xml_sitemap_img_enable_callback' ), // Callback
|
1456 |
+
'seopress-settings-admin-xml-sitemap-general', // Page
|
1457 |
+
'seopress_setting_section_xml_sitemap_general' // Section
|
1458 |
+
);
|
1459 |
|
1460 |
add_settings_field(
|
1461 |
'seopress_xml_sitemap_html_enable', // ID
|
2003 |
'seopress-settings-admin-advanced-appearance', // Page
|
2004 |
'seopress_setting_section_advanced_appearance' // Section
|
2005 |
);
|
2006 |
+
|
2007 |
+
//Security SECTION=======================================================================
|
2008 |
+
add_settings_section(
|
2009 |
+
'seopress_setting_section_advanced_security', // ID
|
2010 |
+
'',
|
2011 |
+
//__("Security","wp-seopress"), // Title
|
2012 |
+
array( $this, 'print_section_info_advanced_security' ), // Callback
|
2013 |
+
'seopress-settings-admin-advanced-security' // Page
|
2014 |
+
);
|
2015 |
+
|
2016 |
+
add_settings_field(
|
2017 |
+
'seopress_advanced_security_metaboxe_role', // ID
|
2018 |
+
__("Block SEO metaboxe to user roles","wp-seopress"), // Title
|
2019 |
+
array( $this, 'seopress_advanced_security_metaboxe_role_callback' ), // Callback
|
2020 |
+
'seopress-settings-admin-advanced-security', // Page
|
2021 |
+
'seopress_setting_section_advanced_security' // Section
|
2022 |
+
);
|
2023 |
}
|
2024 |
|
2025 |
/**
|
2086 |
{
|
2087 |
echo '<p>'.__('To view your sitemap, enable permalinks (not default one), and save settings to flush them.', 'wp-seopress').'</p>';
|
2088 |
echo '<p>'.__('Only the last 1000 items are listed in Sitemaps for performances issues.', 'wp-seopress').'</p>';
|
2089 |
+
|
2090 |
+
echo '<p>'.__('Noindex content will not be displayed in Sitemaps.', 'wp-seopress').'</p>';
|
2091 |
|
2092 |
echo '<a href="'.home_url().'/sitemaps.xml" target="_blank" class="button">'.__('View your sitemap','wp-seopress').'</a>';
|
2093 |
echo ' ';
|
2156 |
public function print_section_info_advanced_appearance()
|
2157 |
{
|
2158 |
print __('<p>Customize SEOPress to fit your needs</p>', 'wp-seopress');
|
2159 |
+
}
|
2160 |
+
|
2161 |
+
public function print_section_info_advanced_security()
|
2162 |
+
{
|
2163 |
+
print __('<p>Manage security</p>', 'wp-seopress');
|
2164 |
}
|
2165 |
|
2166 |
/**
|
2799 |
}
|
2800 |
}
|
2801 |
|
2802 |
+
public function seopress_xml_sitemap_img_enable_callback()
|
2803 |
+
{
|
2804 |
+
$options = get_option( 'seopress_xml_sitemap_option_name' );
|
2805 |
+
|
2806 |
+
$check = isset($options['seopress_xml_sitemap_img_enable']);
|
2807 |
+
|
2808 |
+
echo '<input id="seopress_xml_sitemap_img_enable" name="seopress_xml_sitemap_option_name[seopress_xml_sitemap_img_enable]" type="checkbox"';
|
2809 |
+
if ('1' == $check) echo 'checked="yes"';
|
2810 |
+
echo ' value="1"/>';
|
2811 |
+
|
2812 |
+
echo '<label for="seopress_xml_sitemap_img_enable">'. __( 'Enable Image Sitemaps', 'wp-seopress' ) .'</label>';
|
2813 |
+
|
2814 |
+
if (isset($this->options['seopress_xml_sitemap_img_enable'])) {
|
2815 |
+
esc_attr( $this->options['seopress_xml_sitemap_img_enable']);
|
2816 |
+
}
|
2817 |
+
}
|
2818 |
+
|
2819 |
public function seopress_xml_sitemap_html_enable_callback()
|
2820 |
{
|
2821 |
$options = get_option( 'seopress_xml_sitemap_option_name' );
|
3990 |
if (isset($this->options['seopress_advanced_appearance_genesis_seo_metaboxe'])) {
|
3991 |
esc_attr( $this->options['seopress_advanced_appearance_genesis_seo_metaboxe']);
|
3992 |
}
|
3993 |
+
}
|
3994 |
+
|
3995 |
+
public function seopress_advanced_security_metaboxe_role_callback()
|
3996 |
+
{
|
3997 |
+
$options = get_option( 'seopress_advanced_option_name' );
|
3998 |
+
|
3999 |
+
global $wp_roles;
|
4000 |
+
|
4001 |
+
if ( ! isset( $wp_roles ) )
|
4002 |
+
$wp_roles = new WP_Roles();
|
4003 |
+
|
4004 |
+
foreach ($wp_roles->get_names() as $key => $value) {
|
4005 |
+
|
4006 |
+
$check = isset($options['seopress_advanced_security_metaboxe_role'][$key]);
|
4007 |
+
|
4008 |
+
echo '<input id="seopress_advanced_security_metaboxe_role_'.$key.'" name="seopress_advanced_option_name[seopress_advanced_security_metaboxe_role]['.$key.']" type="checkbox"';
|
4009 |
+
if ('1' == $check) echo 'checked="yes"';
|
4010 |
+
echo ' value="1"/>';
|
4011 |
+
|
4012 |
+
echo '<label for="seopress_advanced_security_metaboxe_role_'.$key.'">'. $value .'</label><br/>';
|
4013 |
+
|
4014 |
+
if (isset($this->options['seopress_advanced_security_metaboxe_role'][$key])) {
|
4015 |
+
esc_attr( $this->options['seopress_advanced_security_metaboxe_role'][$key]);
|
4016 |
+
}
|
4017 |
+
}
|
4018 |
}
|
4019 |
}
|
4020 |
|
inc/admin/adminbar.php
CHANGED
@@ -52,6 +52,7 @@ function seopress_admin_bar_links() {
|
|
52 |
'title' => __( 'Import / Export / Reset', 'wp-seopress' ),
|
53 |
'href' => admin_url( 'admin.php?page=seopress-import-export' ),
|
54 |
));
|
|
|
55 |
if ( is_plugin_active( 'wp-seopress-pro/seopress-pro.php' ) ) {
|
56 |
$wp_admin_bar->add_menu( array(
|
57 |
'parent' => 'seopress_custom_top_level',
|
52 |
'title' => __( 'Import / Export / Reset', 'wp-seopress' ),
|
53 |
'href' => admin_url( 'admin.php?page=seopress-import-export' ),
|
54 |
));
|
55 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
56 |
if ( is_plugin_active( 'wp-seopress-pro/seopress-pro.php' ) ) {
|
57 |
$wp_admin_bar->add_menu( array(
|
58 |
'parent' => 'seopress_custom_top_level',
|
inc/functions/options-social.php
CHANGED
@@ -268,7 +268,11 @@ function seopress_social_accounts_jsonld_hook() {
|
|
268 |
}
|
269 |
echo '"name" : '.$seopress_social_knowledge_name_option.',"url" : '.json_encode(get_home_url());
|
270 |
|
271 |
-
if (seopress_social_knowledge_type_option() =='organization'
|
|
|
|
|
|
|
|
|
272 |
if ($seopress_social_knowledge_phone_number_option && $seopress_social_knowledge_contact_type_option && $seopress_social_knowledge_contact_option_option ) {
|
273 |
echo ',"contactPoint": [{
|
274 |
"@type": "ContactPoint",
|
268 |
}
|
269 |
echo '"name" : '.$seopress_social_knowledge_name_option.',"url" : '.json_encode(get_home_url());
|
270 |
|
271 |
+
if (seopress_social_knowledge_type_option() =='organization'
|
272 |
+
&& seopress_social_knowledge_phone_number_option() !=''
|
273 |
+
&& seopress_social_knowledge_contact_type_option() !=''
|
274 |
+
&& seopress_social_knowledge_contact_option_option() !=''
|
275 |
+
) {
|
276 |
if ($seopress_social_knowledge_phone_number_option && $seopress_social_knowledge_contact_type_option && $seopress_social_knowledge_contact_option_option ) {
|
277 |
echo ',"contactPoint": [{
|
278 |
"@type": "ContactPoint",
|
inc/functions/sitemap/template-xml-sitemaps-single.php
CHANGED
@@ -7,18 +7,30 @@ Header('Content-type: text/xml');
|
|
7 |
//Robots
|
8 |
Header("X-Robots-Tag: noindex", true);
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
function seopress_xml_sitemap_single() {
|
11 |
$path = basename(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), ".xml");
|
12 |
$seopress_sitemaps = '<?xml version="1.0" encoding="UTF-8"?>';
|
13 |
$seopress_sitemaps .='<?xml-stylesheet type="text/xsl" href="'.get_home_url().'/sitemaps_xsl.xsl"?>';
|
14 |
$seopress_sitemaps .= "\n";
|
15 |
-
$seopress_sitemaps .= '<urlset 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/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
|
16 |
$seopress_sitemaps .= "\n";
|
17 |
|
18 |
$args = array( 'posts_per_page' => 1000, 'order'=> 'DESC', 'orderby' => 'date', 'post_type' => $path, 'post_status' => 'publish', 'meta_key' => '_seopress_robots_index', 'meta_value' => 'yes', 'meta_compare' => 'NOT EXISTS', 'fields' => 'ids', 'lang' => '' );
|
19 |
$postslist = get_posts( $args );
|
20 |
foreach ( $postslist as $post ) {
|
21 |
setup_postdata( $post );
|
|
|
22 |
$seopress_sitemaps .= '<url>';
|
23 |
$seopress_sitemaps .= "\n";
|
24 |
$seopress_sitemaps .= '<loc>';
|
@@ -30,6 +42,61 @@ function seopress_xml_sitemap_single() {
|
|
30 |
$seopress_sitemaps .= '';
|
31 |
$seopress_sitemaps .= '</lastmod>';
|
32 |
$seopress_sitemaps .= "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
$seopress_sitemaps .= '</url>';
|
34 |
$seopress_sitemaps .= "\n";
|
35 |
}
|
@@ -39,4 +106,5 @@ function seopress_xml_sitemap_single() {
|
|
39 |
return $seopress_sitemaps;
|
40 |
}
|
41 |
echo seopress_xml_sitemap_single();
|
|
|
42 |
?>
|
7 |
//Robots
|
8 |
Header("X-Robots-Tag: noindex", true);
|
9 |
|
10 |
+
function seopress_xml_sitemap_img_enable_option() {
|
11 |
+
$seopress_xml_sitemap_img_enable_option = get_option("seopress_xml_sitemap_option_name");
|
12 |
+
if ( ! empty ( $seopress_xml_sitemap_img_enable_option ) ) {
|
13 |
+
foreach ($seopress_xml_sitemap_img_enable_option as $key => $seopress_xml_sitemap_img_enable_value)
|
14 |
+
$options[$key] = $seopress_xml_sitemap_img_enable_value;
|
15 |
+
if (isset($seopress_xml_sitemap_img_enable_option['seopress_xml_sitemap_img_enable'])) {
|
16 |
+
return $seopress_xml_sitemap_img_enable_option['seopress_xml_sitemap_img_enable'];
|
17 |
+
}
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
function seopress_xml_sitemap_single() {
|
22 |
$path = basename(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), ".xml");
|
23 |
$seopress_sitemaps = '<?xml version="1.0" encoding="UTF-8"?>';
|
24 |
$seopress_sitemaps .='<?xml-stylesheet type="text/xsl" href="'.get_home_url().'/sitemaps_xsl.xsl"?>';
|
25 |
$seopress_sitemaps .= "\n";
|
26 |
+
$seopress_sitemaps .= '<urlset 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/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
|
27 |
$seopress_sitemaps .= "\n";
|
28 |
|
29 |
$args = array( 'posts_per_page' => 1000, 'order'=> 'DESC', 'orderby' => 'date', 'post_type' => $path, 'post_status' => 'publish', 'meta_key' => '_seopress_robots_index', 'meta_value' => 'yes', 'meta_compare' => 'NOT EXISTS', 'fields' => 'ids', 'lang' => '' );
|
30 |
$postslist = get_posts( $args );
|
31 |
foreach ( $postslist as $post ) {
|
32 |
setup_postdata( $post );
|
33 |
+
|
34 |
$seopress_sitemaps .= '<url>';
|
35 |
$seopress_sitemaps .= "\n";
|
36 |
$seopress_sitemaps .= '<loc>';
|
42 |
$seopress_sitemaps .= '';
|
43 |
$seopress_sitemaps .= '</lastmod>';
|
44 |
$seopress_sitemaps .= "\n";
|
45 |
+
|
46 |
+
//XML Image Sitemaps
|
47 |
+
if (seopress_xml_sitemap_img_enable_option() =='1') {
|
48 |
+
|
49 |
+
//Standard images
|
50 |
+
$dom = new domDocument;
|
51 |
+
$dom->loadHTML(get_the_content($post));
|
52 |
+
$dom->preserveWhiteSpace = false;
|
53 |
+
$images = $dom->getElementsByTagName('img');
|
54 |
+
|
55 |
+
//WooCommerce
|
56 |
+
global $product;
|
57 |
+
if ($product !='') {
|
58 |
+
$product_img = $product->get_gallery_attachment_ids();
|
59 |
+
//print_r($product->get_gallery_attachment_ids());
|
60 |
+
}
|
61 |
+
|
62 |
+
//Galleries
|
63 |
+
$galleries = get_post_galleries_images($post);
|
64 |
+
|
65 |
+
if ($images->length>=1 || !empty($galleries) || !empty($product_img)) {
|
66 |
+
$seopress_sitemaps .= '<image:image>';
|
67 |
+
if ($images->length>=1) {
|
68 |
+
foreach($images as $img) {
|
69 |
+
$url = $img->getAttribute('src');
|
70 |
+
$seopress_sitemaps .= "\n";
|
71 |
+
$seopress_sitemaps .= '<image:loc>';
|
72 |
+
$seopress_sitemaps .= $url;
|
73 |
+
$seopress_sitemaps .= '</image:loc>';
|
74 |
+
}
|
75 |
+
}
|
76 |
+
if ($galleries !='') {
|
77 |
+
foreach( $galleries as $gallery ) {
|
78 |
+
foreach( $gallery as $url ) {
|
79 |
+
$seopress_sitemaps .= "\n";
|
80 |
+
$seopress_sitemaps .= '<image:loc>';
|
81 |
+
$seopress_sitemaps .= $url;
|
82 |
+
$seopress_sitemaps .= '</image:loc>';
|
83 |
+
}
|
84 |
+
}
|
85 |
+
}
|
86 |
+
if ($product_img !='') {
|
87 |
+
foreach( $product_img as $product_attachment_id ) {
|
88 |
+
$seopress_sitemaps .= "\n";
|
89 |
+
$seopress_sitemaps .= '<image:loc>';
|
90 |
+
$seopress_sitemaps .= wp_get_attachment_url( $product_attachment_id );
|
91 |
+
$seopress_sitemaps .= '</image:loc>';
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
$seopress_sitemaps .= "\n";
|
96 |
+
$seopress_sitemaps .= '</image:image>';
|
97 |
+
$seopress_sitemaps .= "\n";
|
98 |
+
}
|
99 |
+
}
|
100 |
$seopress_sitemaps .= '</url>';
|
101 |
$seopress_sitemaps .= "\n";
|
102 |
}
|
106 |
return $seopress_sitemaps;
|
107 |
}
|
108 |
echo seopress_xml_sitemap_single();
|
109 |
+
|
110 |
?>
|
inc/functions/sitemap/template-xml-sitemaps-xsl.php
CHANGED
@@ -57,7 +57,7 @@ function seopress_xml_sitemap_index_xsl() {
|
|
57 |
}
|
58 |
#main {
|
59 |
margin: 0 auto;
|
60 |
-
max-width:
|
61 |
padding: 1.5rem;
|
62 |
width: 100%;
|
63 |
}
|
@@ -68,19 +68,23 @@ function seopress_xml_sitemap_index_xsl() {
|
|
68 |
margin-top: 20px;
|
69 |
display: inline-block;
|
70 |
}
|
71 |
-
#sitemaps .loc, #sitemaps .lastmod {
|
72 |
font-weight: bold;
|
73 |
display: inline-block;
|
74 |
border-bottom: 1px solid rgba(224, 224, 224, 1);
|
75 |
padding: 15px;
|
76 |
}
|
77 |
#sitemaps .loc {
|
78 |
-
width:
|
79 |
}
|
80 |
#sitemaps .lastmod {
|
81 |
width: 30%;
|
82 |
padding-left: 0;
|
83 |
}
|
|
|
|
|
|
|
|
|
84 |
#sitemaps ul {
|
85 |
margin: 10px 0;
|
86 |
padding: 0;
|
@@ -97,7 +101,7 @@ function seopress_xml_sitemap_index_xsl() {
|
|
97 |
background:#F3F6F8;
|
98 |
}
|
99 |
#sitemaps .item-loc {
|
100 |
-
width:
|
101 |
display: inline-block;
|
102 |
}
|
103 |
#sitemaps .item-lastmod {
|
@@ -105,7 +109,13 @@ function seopress_xml_sitemap_index_xsl() {
|
|
105 |
display: inline-block;
|
106 |
padding: 0 10px;
|
107 |
}
|
|
|
|
|
|
|
|
|
|
|
108 |
</style>';
|
|
|
109 |
$seopress_sitemaps_xsl .='</head>';
|
110 |
$seopress_sitemaps_xsl .='<body>';
|
111 |
$seopress_sitemaps_xsl .='<div id="main">';
|
@@ -118,12 +128,16 @@ function seopress_xml_sitemap_index_xsl() {
|
|
118 |
$seopress_sitemaps_xsl .='<div class="lastmod">';
|
119 |
$seopress_sitemaps_xsl .='Last update';
|
120 |
$seopress_sitemaps_xsl .='</div>';
|
|
|
|
|
|
|
121 |
$seopress_sitemaps_xsl .='<ul>';
|
122 |
$seopress_sitemaps_xsl .='<xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">';
|
123 |
$seopress_sitemaps_xsl .='<li>';
|
124 |
$seopress_sitemaps_xsl .='<xsl:variable name="sitemap_loc"><xsl:value-of select="sitemap:loc"/></xsl:variable>';
|
125 |
$seopress_sitemaps_xsl .='<span class="item-loc"><a href="{$sitemap_loc}"><xsl:value-of select="sitemap:loc" /></a></span>';
|
126 |
$seopress_sitemaps_xsl .='<span class="item-lastmod"><xsl:value-of select="sitemap:lastmod" /></span>';
|
|
|
127 |
$seopress_sitemaps_xsl .='</li>';
|
128 |
$seopress_sitemaps_xsl .='</xsl:for-each>';
|
129 |
$seopress_sitemaps_xsl .='</ul>';
|
57 |
}
|
58 |
#main {
|
59 |
margin: 0 auto;
|
60 |
+
max-width: 55rem;
|
61 |
padding: 1.5rem;
|
62 |
width: 100%;
|
63 |
}
|
68 |
margin-top: 20px;
|
69 |
display: inline-block;
|
70 |
}
|
71 |
+
#sitemaps .loc, #sitemaps .lastmod, #sitemaps .count {
|
72 |
font-weight: bold;
|
73 |
display: inline-block;
|
74 |
border-bottom: 1px solid rgba(224, 224, 224, 1);
|
75 |
padding: 15px;
|
76 |
}
|
77 |
#sitemaps .loc {
|
78 |
+
width: 60%;
|
79 |
}
|
80 |
#sitemaps .lastmod {
|
81 |
width: 30%;
|
82 |
padding-left: 0;
|
83 |
}
|
84 |
+
#sitemaps .count {
|
85 |
+
width: 10%;
|
86 |
+
padding-left: 0;
|
87 |
+
}
|
88 |
#sitemaps ul {
|
89 |
margin: 10px 0;
|
90 |
padding: 0;
|
101 |
background:#F3F6F8;
|
102 |
}
|
103 |
#sitemaps .item-loc {
|
104 |
+
width: 60%;
|
105 |
display: inline-block;
|
106 |
}
|
107 |
#sitemaps .item-lastmod {
|
109 |
display: inline-block;
|
110 |
padding: 0 10px;
|
111 |
}
|
112 |
+
#sitemaps .item-count {
|
113 |
+
width: 10%;
|
114 |
+
display: inline-block;
|
115 |
+
padding: 0 10px;
|
116 |
+
}
|
117 |
</style>';
|
118 |
+
|
119 |
$seopress_sitemaps_xsl .='</head>';
|
120 |
$seopress_sitemaps_xsl .='<body>';
|
121 |
$seopress_sitemaps_xsl .='<div id="main">';
|
128 |
$seopress_sitemaps_xsl .='<div class="lastmod">';
|
129 |
$seopress_sitemaps_xsl .='Last update';
|
130 |
$seopress_sitemaps_xsl .='</div>';
|
131 |
+
$seopress_sitemaps_xsl .='<div class="count">';
|
132 |
+
$seopress_sitemaps_xsl .='Items count';
|
133 |
+
$seopress_sitemaps_xsl .='</div>';
|
134 |
$seopress_sitemaps_xsl .='<ul>';
|
135 |
$seopress_sitemaps_xsl .='<xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">';
|
136 |
$seopress_sitemaps_xsl .='<li>';
|
137 |
$seopress_sitemaps_xsl .='<xsl:variable name="sitemap_loc"><xsl:value-of select="sitemap:loc"/></xsl:variable>';
|
138 |
$seopress_sitemaps_xsl .='<span class="item-loc"><a href="{$sitemap_loc}"><xsl:value-of select="sitemap:loc" /></a></span>';
|
139 |
$seopress_sitemaps_xsl .='<span class="item-lastmod"><xsl:value-of select="sitemap:lastmod" /></span>';
|
140 |
+
$seopress_sitemaps_xsl .='<span class="item-count"><xsl:value-of select="sitemap:count" /></span>';
|
141 |
$seopress_sitemaps_xsl .='</li>';
|
142 |
$seopress_sitemaps_xsl .='</xsl:for-each>';
|
143 |
$seopress_sitemaps_xsl .='</ul>';
|
inc/functions/sitemap/template-xml-sitemaps.php
CHANGED
@@ -12,7 +12,7 @@ function seopress_xml_sitemap_index() {
|
|
12 |
$seopress_sitemaps .='<?xml-stylesheet type="text/xsl" href="'.get_home_url().'/sitemaps_xsl.xsl"?>';
|
13 |
$seopress_sitemaps .= "\n";
|
14 |
$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">';
|
15 |
-
|
16 |
//CPT
|
17 |
if (seopress_xml_sitemap_post_types_list_option() !='') {
|
18 |
foreach (seopress_xml_sitemap_post_types_list_option() as $cpt_key => $cpt_value) {
|
@@ -24,13 +24,17 @@ function seopress_xml_sitemap_index() {
|
|
24 |
$seopress_sitemaps .= '<loc>';
|
25 |
$seopress_sitemaps .= home_url().'/sitemaps/'.$cpt_key.'.xml';
|
26 |
$seopress_sitemaps .= '</loc>';
|
27 |
-
$get_latest_post = new WP_Query(array('post_type' => $cpt_key, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'posts_per_page' =>
|
28 |
if($get_latest_post->have_posts()){
|
29 |
$seopress_sitemaps .= "\n";
|
30 |
$seopress_sitemaps .= '<lastmod>';
|
31 |
$seopress_sitemaps .= date("c", strtotime($get_latest_post->posts[0]->post_date));
|
32 |
$seopress_sitemaps .= '</lastmod>';
|
33 |
$seopress_sitemaps .= "\n";
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
$seopress_sitemaps .= '</sitemap>';
|
36 |
}
|
@@ -67,7 +71,7 @@ function seopress_xml_sitemap_index() {
|
|
67 |
$seopress_sitemaps .= "\n";
|
68 |
$seopress_sitemaps .= '<lastmod>';
|
69 |
|
70 |
-
$get_latest_post = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'posts_per_page' => 1, 'orderby' => 'date', 'order' => 'DESC'));
|
71 |
if($get_latest_post->have_posts()){
|
72 |
$seopress_sitemaps .= date("c", strtotime($get_latest_post->posts[0]->post_date));
|
73 |
}
|
@@ -83,4 +87,5 @@ function seopress_xml_sitemap_index() {
|
|
83 |
return $seopress_sitemaps;
|
84 |
}
|
85 |
echo seopress_xml_sitemap_index();
|
|
|
86 |
?>
|
12 |
$seopress_sitemaps .='<?xml-stylesheet type="text/xsl" href="'.get_home_url().'/sitemaps_xsl.xsl"?>';
|
13 |
$seopress_sitemaps .= "\n";
|
14 |
$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">';
|
15 |
+
|
16 |
//CPT
|
17 |
if (seopress_xml_sitemap_post_types_list_option() !='') {
|
18 |
foreach (seopress_xml_sitemap_post_types_list_option() as $cpt_key => $cpt_value) {
|
24 |
$seopress_sitemaps .= '<loc>';
|
25 |
$seopress_sitemaps .= home_url().'/sitemaps/'.$cpt_key.'.xml';
|
26 |
$seopress_sitemaps .= '</loc>';
|
27 |
+
$get_latest_post = new WP_Query(array('post_type' => $cpt_key, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'posts_per_page' => 1000, 'meta_key' => '_seopress_robots_index', 'meta_value' => 'yes', 'meta_compare' => 'NOT EXISTS', 'order' => 'DESC', 'orderby' => 'date', 'lang' => ''));
|
28 |
if($get_latest_post->have_posts()){
|
29 |
$seopress_sitemaps .= "\n";
|
30 |
$seopress_sitemaps .= '<lastmod>';
|
31 |
$seopress_sitemaps .= date("c", strtotime($get_latest_post->posts[0]->post_date));
|
32 |
$seopress_sitemaps .= '</lastmod>';
|
33 |
$seopress_sitemaps .= "\n";
|
34 |
+
$seopress_sitemaps .= '<count>';
|
35 |
+
$seopress_sitemaps .= count($get_latest_post->posts);
|
36 |
+
$seopress_sitemaps .= '</count>';
|
37 |
+
$seopress_sitemaps .= "\n";
|
38 |
}
|
39 |
$seopress_sitemaps .= '</sitemap>';
|
40 |
}
|
71 |
$seopress_sitemaps .= "\n";
|
72 |
$seopress_sitemaps .= '<lastmod>';
|
73 |
|
74 |
+
$get_latest_post = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'posts_per_page' => 1, 'orderby' => 'date', 'meta_key' => '_seopress_robots_index', 'meta_value' => 'yes', 'meta_compare' => 'NOT EXISTS', 'order' => 'DESC'));
|
75 |
if($get_latest_post->have_posts()){
|
76 |
$seopress_sitemaps .= date("c", strtotime($get_latest_post->posts[0]->post_date));
|
77 |
}
|
87 |
return $seopress_sitemaps;
|
88 |
}
|
89 |
echo seopress_xml_sitemap_index();
|
90 |
+
|
91 |
?>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://seopress.org/
|
|
4 |
Tags: seo, search engine optimization, meta, title, description, keywords, serp, knowledge grah, schema.org, url, redirection, 301, xml sitemap, breadcrumbs, ranking, google analytics, woocommerce, dublin core, rich snippets, 404, html sitemap
|
5 |
Requires at least: 4.4+
|
6 |
Tested up to: 4.7
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -26,6 +26,7 @@ SEOPress is a powerful plugin to optimize your SEO, boost your traffic and impro
|
|
26 |
<li>Canonical URL</li>
|
27 |
<li>Meta robots (noindex, nofollow, noodp, noimageindex, noarchive, nosnippet)</li>
|
28 |
<li>Build your custom XML Sitemap to improve search indexing.</li>
|
|
|
29 |
<li>Build your custom HTML Sitemap to enhanced navigation for visitors and improve search indexing.</li>
|
30 |
<li>Link your social media accounts to your site.</li>
|
31 |
<li>Redirections in post, pages, custom post types</li>
|
@@ -109,6 +110,17 @@ SEOPress is a powerful plugin to optimize your SEO, boost your traffic and impro
|
|
109 |
30. Structured Data Types metaboxe in post, page, custom post type
|
110 |
|
111 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
= 1.5.1 =
|
113 |
* INFO Improve Breadcrumbs SEO
|
114 |
* FIX Google Analytics Fatal Error
|
@@ -122,6 +134,7 @@ SEOPress is a powerful plugin to optimize your SEO, boost your traffic and impro
|
|
122 |
= 1.5 =
|
123 |
* NEW Google Analytics Stats in Dashboard with interactive charts (SEOPress PRO only)
|
124 |
* NEW Add new advices in Notifications center
|
|
|
125 |
* NEW Add bulk actions to enable/disable noindex/nofollow/index/follow
|
126 |
* NEW Hide Genesis SEO Metaboxe (in Advanced page, appearance tab)
|
127 |
* INFO You can now reset notifications display settings in Import/Export/Reset page
|
4 |
Tags: seo, search engine optimization, meta, title, description, keywords, serp, knowledge grah, schema.org, url, redirection, 301, xml sitemap, breadcrumbs, ranking, google analytics, woocommerce, dublin core, rich snippets, 404, html sitemap
|
5 |
Requires at least: 4.4+
|
6 |
Tested up to: 4.7
|
7 |
+
Stable tag: 1.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
26 |
<li>Canonical URL</li>
|
27 |
<li>Meta robots (noindex, nofollow, noodp, noimageindex, noarchive, nosnippet)</li>
|
28 |
<li>Build your custom XML Sitemap to improve search indexing.</li>
|
29 |
+
<li>Image XML Sitemaps to improve search indexing for Google Images.</li>
|
30 |
<li>Build your custom HTML Sitemap to enhanced navigation for visitors and improve search indexing.</li>
|
31 |
<li>Link your social media accounts to your site.</li>
|
32 |
<li>Redirections in post, pages, custom post types</li>
|
110 |
30. Structured Data Types metaboxe in post, page, custom post type
|
111 |
|
112 |
== Changelog ==
|
113 |
+
= 1.6 =
|
114 |
+
* NEW XML Image Sitemap to improve ranking in Google Images (supports standard images, WP Image Galleries and WooCommerce image products)
|
115 |
+
* NEW Block SEO metaboxe to specific user roles
|
116 |
+
* NEW Block Structured Data Types metaboxe to specific user roles
|
117 |
+
* INFO Move SEO metaboxe just under the editor
|
118 |
+
* INFO Add Items count column in index XML Sitemaps
|
119 |
+
* INFO Move Structured Data Types metaboxe just under SEO metaboxe
|
120 |
+
* FIX Undefined notice phone number
|
121 |
+
* FIX Change Price input number to input text to allow decimals (Structured Data Types)
|
122 |
+
* FIX incorrect last update date in index XML Sitemaps
|
123 |
+
* FIX Admin bar is_plugin_active error
|
124 |
= 1.5.1 =
|
125 |
* INFO Improve Breadcrumbs SEO
|
126 |
* FIX Google Analytics Fatal Error
|
134 |
= 1.5 =
|
135 |
* NEW Google Analytics Stats in Dashboard with interactive charts (SEOPress PRO only)
|
136 |
* NEW Add new advices in Notifications center
|
137 |
+
* NEW Quick Edit your titles and meta descriptions from listing pages in backend
|
138 |
* NEW Add bulk actions to enable/disable noindex/nofollow/index/follow
|
139 |
* NEW Hide Genesis SEO Metaboxe (in Advanced page, appearance tab)
|
140 |
* INFO You can now reset notifications display settings in Import/Export/Reset page
|
seopress.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: SEOPress
|
5 |
Plugin URI: http://seopress.org/
|
6 |
Description: The best SEO plugin.
|
7 |
-
Version: 1.
|
8 |
Author: Benjamin DENIS
|
9 |
Author URI: http://seopress.org/
|
10 |
License: GPLv2
|
@@ -56,7 +56,7 @@ register_deactivation_hook(__FILE__, 'seopress_deactivation');
|
|
56 |
//Define
|
57 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
58 |
|
59 |
-
define( 'SEOPRESS_VERSION', '1.
|
60 |
define( 'SEOPRESS_AUTHOR', 'Benjamin Denis' );
|
61 |
|
62 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
@@ -157,20 +157,36 @@ function seopress_add_admin_options_scripts($hook) {
|
|
157 |
wp_enqueue_media();
|
158 |
}
|
159 |
|
160 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
|
162 |
-
|
163 |
-
$cpt_public_check = get_post_type_object( $post->post_type );
|
164 |
-
if ( 'attachment' !== $post->post_type ) {
|
165 |
-
wp_enqueue_script( 'seopress-cpt-tabs-js', plugins_url( 'assets/js/seopress-tabs2.js', __FILE__ ), array( 'jquery-ui-tabs' ) );
|
166 |
-
if ( 'seopress_404' !== $post->post_type ) {
|
167 |
-
if ($cpt_public_check->public =='1') {
|
168 |
-
wp_enqueue_script( 'seopress-cpt-counters-js', plugins_url( 'assets/js/seopress-counters.js', __FILE__ ), array( 'jquery' ) );
|
169 |
}
|
170 |
}
|
171 |
-
wp_enqueue_script( 'seopress-media-uploader-js', plugins_url('assets/js/seopress-media-uploader.js', __FILE__), array('jquery'), '', false );
|
172 |
-
wp_enqueue_media();
|
173 |
-
|
174 |
}
|
175 |
}
|
176 |
|
4 |
Plugin Name: SEOPress
|
5 |
Plugin URI: http://seopress.org/
|
6 |
Description: The best SEO plugin.
|
7 |
+
Version: 1.6
|
8 |
Author: Benjamin DENIS
|
9 |
Author URI: http://seopress.org/
|
10 |
License: GPLv2
|
56 |
//Define
|
57 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
58 |
|
59 |
+
define( 'SEOPRESS_VERSION', '1.6' );
|
60 |
define( 'SEOPRESS_AUTHOR', 'Benjamin Denis' );
|
61 |
|
62 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
157 |
wp_enqueue_media();
|
158 |
}
|
159 |
|
160 |
+
if (is_user_logged_in()) {
|
161 |
+
global $wp_roles;
|
162 |
+
|
163 |
+
//Get current user role
|
164 |
+
if(isset(wp_get_current_user()->roles[0])) {
|
165 |
+
$seopress_user_role = wp_get_current_user()->roles[0];
|
166 |
+
//If current user role matchs values from Security settings then apply
|
167 |
+
if (function_exists('seopress_advanced_security_metaboxe_role_hook_option') && seopress_advanced_security_metaboxe_role_hook_option() !='') {
|
168 |
+
if( array_key_exists( $seopress_user_role, seopress_advanced_security_metaboxe_role_hook_option())) {
|
169 |
+
//do nothing
|
170 |
+
}
|
171 |
+
} else {
|
172 |
+
|
173 |
+
global $post;
|
174 |
+
|
175 |
+
if ( $hook == 'post-new.php' || $hook == 'post.php') {
|
176 |
+
$cpt_public_check = get_post_type_object( $post->post_type );
|
177 |
+
if ( 'attachment' !== $post->post_type ) {
|
178 |
+
wp_enqueue_script( 'seopress-cpt-tabs-js', plugins_url( 'assets/js/seopress-tabs2.js', __FILE__ ), array( 'jquery-ui-tabs' ) );
|
179 |
+
if ( 'seopress_404' !== $post->post_type ) {
|
180 |
+
if ($cpt_public_check->public =='1') {
|
181 |
+
wp_enqueue_script( 'seopress-cpt-counters-js', plugins_url( 'assets/js/seopress-counters.js', __FILE__ ), array( 'jquery' ) );
|
182 |
+
}
|
183 |
+
}
|
184 |
+
wp_enqueue_script( 'seopress-media-uploader-js', plugins_url('assets/js/seopress-media-uploader.js', __FILE__), array('jquery'), '', false );
|
185 |
+
wp_enqueue_media();
|
186 |
|
187 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
}
|
189 |
}
|
|
|
|
|
|
|
190 |
}
|
191 |
}
|
192 |
|