Version Description
- Support for WordPress 5.9.
- Minor bug fixes.
Download this release
Release Info
Developer | looswebstudio |
Plugin | SEO SIMPLE PACK |
Version | 2.2.9 |
Comparing to | |
See all releases |
Code changes from version 2.2.8 to 2.2.9
- class/output.php +37 -20
- class/trait/output_helper.php +4 -6
- readme.txt +5 -1
- seo-simple-pack.php +1 -1
class/output.php
CHANGED
@@ -207,10 +207,14 @@ class SSP_Output {
|
|
207 |
|
208 |
$settings = SSP_Data::$settings;
|
209 |
|
|
|
|
|
210 |
switch ( true ) {
|
|
|
211 |
case is_front_page():
|
212 |
$title = $settings['home_title'];
|
213 |
break;
|
|
|
214 |
case is_singular():
|
215 |
case is_home():
|
216 |
if ( ! isset( self::$obj->ID ) ) break;
|
@@ -224,6 +228,10 @@ class SSP_Output {
|
|
224 |
}
|
225 |
break;
|
226 |
|
|
|
|
|
|
|
|
|
227 |
case is_category():
|
228 |
if ( ! isset( self::$obj->term_id ) ) break;
|
229 |
|
@@ -258,16 +266,11 @@ class SSP_Output {
|
|
258 |
$title = $settings['date_title'];
|
259 |
break;
|
260 |
|
261 |
-
case is_search():
|
262 |
-
$title = $settings['search_title'];
|
263 |
-
break;
|
264 |
-
|
265 |
case is_404():
|
266 |
$title = $settings['404_title'];
|
267 |
break;
|
268 |
|
269 |
default:
|
270 |
-
$title = SSP_Data::$site_title;
|
271 |
break;
|
272 |
}
|
273 |
|
@@ -284,6 +287,8 @@ class SSP_Output {
|
|
284 |
|
285 |
$settings = SSP_Data::$settings;
|
286 |
|
|
|
|
|
287 |
switch ( true ) {
|
288 |
|
289 |
case is_front_page():
|
@@ -304,6 +309,10 @@ class SSP_Output {
|
|
304 |
}
|
305 |
break;
|
306 |
|
|
|
|
|
|
|
|
|
307 |
case is_category():
|
308 |
if ( ! isset( self::$obj->term_id ) ) break;
|
309 |
|
@@ -336,6 +345,8 @@ class SSP_Output {
|
|
336 |
if ( $meta_robots ) {
|
337 |
$robots = $meta_robots;
|
338 |
} else {
|
|
|
|
|
339 |
$term = self::$obj->taxonomy;
|
340 |
$is_noindex = $settings[ $term . '_noindex' ];
|
341 |
$robots = $is_noindex ? 'noindex' : '';
|
@@ -357,16 +368,11 @@ class SSP_Output {
|
|
357 |
$robots = $is_noindex ? 'noindex' : '';
|
358 |
break;
|
359 |
|
360 |
-
case is_search():
|
361 |
-
$robots = 'noindex';
|
362 |
-
break;
|
363 |
-
|
364 |
case is_404():
|
365 |
$robots = 'noindex';
|
366 |
break;
|
367 |
|
368 |
default:
|
369 |
-
$robots = '';
|
370 |
break;
|
371 |
}
|
372 |
|
@@ -380,12 +386,11 @@ class SSP_Output {
|
|
380 |
*/
|
381 |
private static function generate_keyword() {
|
382 |
|
|
|
383 |
$keyword = '';
|
384 |
|
385 |
if ( is_front_page() ) {
|
386 |
-
|
387 |
$keyword = SSP_Data::$settings['home_keyword'];
|
388 |
-
|
389 |
} else {
|
390 |
if ( is_singular() || ( ! is_front_page() && is_home() ) ) {
|
391 |
|
@@ -416,7 +421,11 @@ class SSP_Output {
|
|
416 |
|
417 |
$settings = SSP_Data::$settings;
|
418 |
|
|
|
|
|
|
|
419 |
switch ( true ) {
|
|
|
420 |
case is_front_page():
|
421 |
$description = $settings['home_desc'] ?: '%_tagline_%';
|
422 |
break;
|
@@ -436,6 +445,9 @@ class SSP_Output {
|
|
436 |
}
|
437 |
break;
|
438 |
|
|
|
|
|
|
|
439 |
case is_category():
|
440 |
if ( ! isset( self::$obj->term_id ) ) break;
|
441 |
|
@@ -470,7 +482,6 @@ class SSP_Output {
|
|
470 |
break;
|
471 |
|
472 |
default:
|
473 |
-
$description = $settings['home_desc'];
|
474 |
break;
|
475 |
}
|
476 |
|
@@ -510,6 +521,7 @@ class SSP_Output {
|
|
510 |
*/
|
511 |
private static function generate_canonical() {
|
512 |
|
|
|
513 |
$canonical = '';
|
514 |
|
515 |
switch ( true ) {
|
@@ -524,6 +536,10 @@ class SSP_Output {
|
|
524 |
$canonical = $meta_canonical ?: get_permalink();
|
525 |
break;
|
526 |
|
|
|
|
|
|
|
|
|
527 |
case is_tax() || is_tag() || is_category():
|
528 |
$term = self::$obj;
|
529 |
if ( ! isset( $term->term_id ) ) break;
|
@@ -535,7 +551,6 @@ class SSP_Output {
|
|
535 |
if ( is_wp_error( $canonical ) ) {
|
536 |
$canonical = '';
|
537 |
}
|
538 |
-
|
539 |
break;
|
540 |
|
541 |
case is_post_type_archive():
|
@@ -558,10 +573,6 @@ class SSP_Output {
|
|
558 |
}
|
559 |
break;
|
560 |
|
561 |
-
case is_search():
|
562 |
-
$canonical = get_search_link();
|
563 |
-
break;
|
564 |
-
|
565 |
case is_404():
|
566 |
$canonical = home_url( '/404' );
|
567 |
break;
|
@@ -602,9 +613,11 @@ class SSP_Output {
|
|
602 |
*/
|
603 |
private static function generate_og_image() {
|
604 |
|
605 |
-
$og_image = ''; // 返す値
|
606 |
$basic_ogimg = SSP_Data::$ogp['og_image'];
|
607 |
|
|
|
|
|
|
|
608 |
switch ( true ) {
|
609 |
case is_attachment():
|
610 |
if ( ! isset( self::$obj->guid ) ) break;
|
@@ -632,14 +645,18 @@ class SSP_Output {
|
|
632 |
// metaもアイキャッチもない時
|
633 |
$og_image = $basic_ogimg;
|
634 |
break;
|
|
|
|
|
|
|
|
|
635 |
case is_tax() || is_tag() || is_category():
|
636 |
if ( ! isset( self::$obj->term_id ) ) break;
|
637 |
|
638 |
$meta_image = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['image'], true );
|
639 |
$og_image = $meta_image ?: $basic_ogimg;
|
640 |
break;
|
|
|
641 |
default:
|
642 |
-
$og_image = $basic_ogimg;
|
643 |
break;
|
644 |
}
|
645 |
|
207 |
|
208 |
$settings = SSP_Data::$settings;
|
209 |
|
210 |
+
// default
|
211 |
+
$title = SSP_Data::$site_title;
|
212 |
switch ( true ) {
|
213 |
+
|
214 |
case is_front_page():
|
215 |
$title = $settings['home_title'];
|
216 |
break;
|
217 |
+
|
218 |
case is_singular():
|
219 |
case is_home():
|
220 |
if ( ! isset( self::$obj->ID ) ) break;
|
228 |
}
|
229 |
break;
|
230 |
|
231 |
+
case is_search():
|
232 |
+
$title = $settings['search_title'];
|
233 |
+
break;
|
234 |
+
|
235 |
case is_category():
|
236 |
if ( ! isset( self::$obj->term_id ) ) break;
|
237 |
|
266 |
$title = $settings['date_title'];
|
267 |
break;
|
268 |
|
|
|
|
|
|
|
|
|
269 |
case is_404():
|
270 |
$title = $settings['404_title'];
|
271 |
break;
|
272 |
|
273 |
default:
|
|
|
274 |
break;
|
275 |
}
|
276 |
|
287 |
|
288 |
$settings = SSP_Data::$settings;
|
289 |
|
290 |
+
// default
|
291 |
+
$robots = '';
|
292 |
switch ( true ) {
|
293 |
|
294 |
case is_front_page():
|
309 |
}
|
310 |
break;
|
311 |
|
312 |
+
case is_search():
|
313 |
+
$robots = 'noindex';
|
314 |
+
break;
|
315 |
+
|
316 |
case is_category():
|
317 |
if ( ! isset( self::$obj->term_id ) ) break;
|
318 |
|
345 |
if ( $meta_robots ) {
|
346 |
$robots = $meta_robots;
|
347 |
} else {
|
348 |
+
if ( ! isset( self::$obj->taxonomy ) ) break;
|
349 |
+
|
350 |
$term = self::$obj->taxonomy;
|
351 |
$is_noindex = $settings[ $term . '_noindex' ];
|
352 |
$robots = $is_noindex ? 'noindex' : '';
|
368 |
$robots = $is_noindex ? 'noindex' : '';
|
369 |
break;
|
370 |
|
|
|
|
|
|
|
|
|
371 |
case is_404():
|
372 |
$robots = 'noindex';
|
373 |
break;
|
374 |
|
375 |
default:
|
|
|
376 |
break;
|
377 |
}
|
378 |
|
386 |
*/
|
387 |
private static function generate_keyword() {
|
388 |
|
389 |
+
// default
|
390 |
$keyword = '';
|
391 |
|
392 |
if ( is_front_page() ) {
|
|
|
393 |
$keyword = SSP_Data::$settings['home_keyword'];
|
|
|
394 |
} else {
|
395 |
if ( is_singular() || ( ! is_front_page() && is_home() ) ) {
|
396 |
|
421 |
|
422 |
$settings = SSP_Data::$settings;
|
423 |
|
424 |
+
// default
|
425 |
+
$description = $settings['home_desc'];
|
426 |
+
|
427 |
switch ( true ) {
|
428 |
+
|
429 |
case is_front_page():
|
430 |
$description = $settings['home_desc'] ?: '%_tagline_%';
|
431 |
break;
|
445 |
}
|
446 |
break;
|
447 |
|
448 |
+
case is_search():
|
449 |
+
break;
|
450 |
+
|
451 |
case is_category():
|
452 |
if ( ! isset( self::$obj->term_id ) ) break;
|
453 |
|
482 |
break;
|
483 |
|
484 |
default:
|
|
|
485 |
break;
|
486 |
}
|
487 |
|
521 |
*/
|
522 |
private static function generate_canonical() {
|
523 |
|
524 |
+
// default
|
525 |
$canonical = '';
|
526 |
|
527 |
switch ( true ) {
|
536 |
$canonical = $meta_canonical ?: get_permalink();
|
537 |
break;
|
538 |
|
539 |
+
case is_search():
|
540 |
+
$canonical = get_search_link();
|
541 |
+
break;
|
542 |
+
|
543 |
case is_tax() || is_tag() || is_category():
|
544 |
$term = self::$obj;
|
545 |
if ( ! isset( $term->term_id ) ) break;
|
551 |
if ( is_wp_error( $canonical ) ) {
|
552 |
$canonical = '';
|
553 |
}
|
|
|
554 |
break;
|
555 |
|
556 |
case is_post_type_archive():
|
573 |
}
|
574 |
break;
|
575 |
|
|
|
|
|
|
|
|
|
576 |
case is_404():
|
577 |
$canonical = home_url( '/404' );
|
578 |
break;
|
613 |
*/
|
614 |
private static function generate_og_image() {
|
615 |
|
|
|
616 |
$basic_ogimg = SSP_Data::$ogp['og_image'];
|
617 |
|
618 |
+
// default
|
619 |
+
$og_image = $basic_ogimg;
|
620 |
+
|
621 |
switch ( true ) {
|
622 |
case is_attachment():
|
623 |
if ( ! isset( self::$obj->guid ) ) break;
|
645 |
// metaもアイキャッチもない時
|
646 |
$og_image = $basic_ogimg;
|
647 |
break;
|
648 |
+
|
649 |
+
case is_search():
|
650 |
+
break;
|
651 |
+
|
652 |
case is_tax() || is_tag() || is_category():
|
653 |
if ( ! isset( self::$obj->term_id ) ) break;
|
654 |
|
655 |
$meta_image = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['image'], true );
|
656 |
$og_image = $meta_image ?: $basic_ogimg;
|
657 |
break;
|
658 |
+
|
659 |
default:
|
|
|
660 |
break;
|
661 |
}
|
662 |
|
class/trait/output_helper.php
CHANGED
@@ -250,6 +250,10 @@ trait Output_Helper {
|
|
250 |
$content = mb_substr( $content, 0, $word_count );
|
251 |
$str = str_replace( '%_page_contents_%', $content, $str );
|
252 |
}
|
|
|
|
|
|
|
|
|
253 |
} elseif ( is_category() || is_tag() || is_tax() ) {
|
254 |
|
255 |
// title
|
@@ -305,12 +309,6 @@ trait Output_Helper {
|
|
305 |
$str = str_replace( '%_author_name_%', get_user_meta( $obj->ID, 'nickname', true ), $str );
|
306 |
|
307 |
}
|
308 |
-
|
309 |
-
if ( false !== strpos( $str, '%_search_phrase_%' ) ) {
|
310 |
-
|
311 |
-
$str = str_replace( '%_search_phrase_%', get_search_query(), $str );
|
312 |
-
|
313 |
-
}
|
314 |
}
|
315 |
|
316 |
if ( false !== strpos( $str, '%_sep_%' ) ) {
|
250 |
$content = mb_substr( $content, 0, $word_count );
|
251 |
$str = str_replace( '%_page_contents_%', $content, $str );
|
252 |
}
|
253 |
+
} elseif ( is_search() ) {
|
254 |
+
if ( false !== strpos( $str, '%_search_phrase_%' ) ) {
|
255 |
+
$str = str_replace( '%_search_phrase_%', get_search_query(), $str );
|
256 |
+
}
|
257 |
} elseif ( is_category() || is_tag() || is_tax() ) {
|
258 |
|
259 |
// title
|
309 |
$str = str_replace( '%_author_name_%', get_user_meta( $obj->ID, 'nickname', true ), $str );
|
310 |
|
311 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
}
|
313 |
|
314 |
if ( false !== strpos( $str, '%_sep_%' ) ) {
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://loos-web-studio.com/
|
|
4 |
Tags: SEO, meta, analytics, webmaster, simple, japan, meta tag
|
5 |
Requires at least: 4.9
|
6 |
Tested up to: 5.8
|
7 |
-
Stable tag: 2.2.
|
8 |
Requires PHP: 7.0
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
@@ -121,6 +121,10 @@ The following hooks are available.
|
|
121 |
|
122 |
== Changelog ==
|
123 |
|
|
|
|
|
|
|
|
|
124 |
= 2.2.8 =
|
125 |
- Fixed og:type on front page.
|
126 |
- Fixed to not save empty custom fields.
|
4 |
Tags: SEO, meta, analytics, webmaster, simple, japan, meta tag
|
5 |
Requires at least: 4.9
|
6 |
Tested up to: 5.8
|
7 |
+
Stable tag: 2.2.9
|
8 |
Requires PHP: 7.0
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
121 |
|
122 |
== Changelog ==
|
123 |
|
124 |
+
= 2.2.9 =
|
125 |
+
- Support for WordPress 5.9.
|
126 |
+
- Minor bug fixes.
|
127 |
+
|
128 |
= 2.2.8 =
|
129 |
- Fixed og:type on front page.
|
130 |
- Fixed to not save empty custom fields.
|
seo-simple-pack.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: SEO SIMPLE PACK
|
4 |
* Plugin URI: https://wemo.tech/1670
|
5 |
* Description: A very simple SEO plugin. You can easily set and customize meta tags and OGP tags for each page.
|
6 |
-
* Version: 2.2.
|
7 |
* Author: LOOS,Inc.
|
8 |
* Author URI: https://loos-web-studio.com/
|
9 |
* License: GPL2 or later
|
3 |
* Plugin Name: SEO SIMPLE PACK
|
4 |
* Plugin URI: https://wemo.tech/1670
|
5 |
* Description: A very simple SEO plugin. You can easily set and customize meta tags and OGP tags for each page.
|
6 |
+
* Version: 2.2.9
|
7 |
* Author: LOOS,Inc.
|
8 |
* Author URI: https://loos-web-studio.com/
|
9 |
* License: GPL2 or later
|