Version Description
Bug fixes
Download this release
Release Info
Developer | looswebstudio |
Plugin | SEO SIMPLE PACK |
Version | 2.1.1 |
Comparing to | |
See all releases |
Code changes from version 2.1.0 to 2.1.1
- class/metabox.php +1 -1
- class/output.php +42 -12
- readme.txt +4 -1
- seo-simple-pack.php +2 -2
- src/js/mediauploader.js +1 -1
class/metabox.php
CHANGED
@@ -162,7 +162,7 @@ class SSP_MetaBox {
|
|
162 |
),
|
163 |
], $val_keyword );
|
164 |
?>
|
165 |
-
|
166 |
<?php
|
167 |
// Set nonce field
|
168 |
wp_nonce_field( SSP_Data::NONCE_ACTION, SSP_Data::NONCE_NAME );
|
162 |
),
|
163 |
], $val_keyword );
|
164 |
?>
|
165 |
+
</div>
|
166 |
<?php
|
167 |
// Set nonce field
|
168 |
wp_nonce_field( SSP_Data::NONCE_ACTION, SSP_Data::NONCE_NAME );
|
class/output.php
CHANGED
@@ -213,26 +213,34 @@ class SSP_Output {
|
|
213 |
break;
|
214 |
case is_singular():
|
215 |
case is_home():
|
|
|
|
|
216 |
$meta_title = get_post_meta( self::$obj->ID, SSP_MetaBox::POST_META_KEYS['title'], true );
|
217 |
if ( $meta_title ) {
|
218 |
$title = $meta_title;
|
219 |
} else {
|
220 |
-
$pt = self::$obj->post_type;
|
221 |
-
$title = $settings[ $pt . '_title' ];
|
222 |
}
|
223 |
break;
|
224 |
|
225 |
case is_category():
|
|
|
|
|
226 |
$meta_title = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['title'], true );
|
227 |
$title = $meta_title ?: $settings['cat_title'];
|
228 |
break;
|
229 |
|
230 |
case is_tag():
|
|
|
|
|
231 |
$meta_title = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['title'], true );
|
232 |
$title = $meta_title ?: $settings['tag_title'];
|
233 |
break;
|
234 |
|
235 |
case is_tax():
|
|
|
|
|
236 |
$meta_title = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['title'], true );
|
237 |
$term = self::$obj->taxonomy;
|
238 |
$title = $meta_title ?: $settings[ $term . '_title' ];
|
@@ -284,17 +292,21 @@ class SSP_Output {
|
|
284 |
|
285 |
case is_singular():
|
286 |
case is_home():
|
|
|
|
|
287 |
$meta_robots = get_post_meta( self::$obj->ID, SSP_MetaBox::POST_META_KEYS['robots'], true );
|
288 |
if ( $meta_robots ) {
|
289 |
$robots = $meta_robots;
|
290 |
} else {
|
291 |
-
$pt = self::$obj->post_type;
|
292 |
-
$is_noindex = $settings[ $pt . '_noindex' ];
|
293 |
$robots = $is_noindex ? 'noindex' : '';
|
294 |
}
|
295 |
break;
|
296 |
|
297 |
case is_category():
|
|
|
|
|
298 |
$meta_robots = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['robots'], true );
|
299 |
if ( $meta_robots ) {
|
300 |
$robots = $meta_robots;
|
@@ -306,6 +318,8 @@ class SSP_Output {
|
|
306 |
break;
|
307 |
|
308 |
case is_tag():
|
|
|
|
|
309 |
$meta_robots = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['robots'], true );
|
310 |
if ( $meta_robots ) {
|
311 |
$robots = $meta_robots;
|
@@ -316,6 +330,8 @@ class SSP_Output {
|
|
316 |
break;
|
317 |
|
318 |
case is_tax():
|
|
|
|
|
319 |
$meta_robots = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['robots'], true );
|
320 |
if ( $meta_robots ) {
|
321 |
$robots = $meta_robots;
|
@@ -373,11 +389,12 @@ class SSP_Output {
|
|
373 |
} elseif ( is_singular() || ( ! is_front_page() && is_home() ) ) {
|
374 |
|
375 |
// メタボックスが入力されていれば上書きする
|
376 |
-
$
|
377 |
-
|
378 |
-
|
|
|
379 |
}
|
380 |
-
}
|
381 |
|
382 |
return apply_filters( 'ssp_output_keyword', $keyword );
|
383 |
|
@@ -400,28 +417,36 @@ class SSP_Output {
|
|
400 |
|
401 |
case is_singular():
|
402 |
case is_home():
|
|
|
|
|
403 |
$metabox_desc = get_post_meta( self::$obj->ID, SSP_MetaBox::POST_META_KEYS['description'], true );
|
404 |
|
405 |
if ( '' !== $metabox_desc ) {
|
406 |
// メタボックスが入力されていれば優先
|
407 |
$description = $metabox_desc;
|
408 |
} else {
|
409 |
-
$pt = self::$obj->post_type;
|
410 |
-
$description = $settings[ $pt . '_desc' ];
|
411 |
}
|
412 |
break;
|
413 |
|
414 |
case is_category():
|
|
|
|
|
415 |
$meta_description = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['description'], true );
|
416 |
$description = $meta_description ?: $settings['cat_desc'];
|
417 |
break;
|
418 |
|
419 |
case is_tag():
|
|
|
|
|
420 |
$meta_description = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['description'], true );
|
421 |
$description = $meta_description ?: $settings['tag_desc'];
|
422 |
break;
|
423 |
|
424 |
case is_tax():
|
|
|
|
|
425 |
$meta_description = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['description'], true );
|
426 |
$description = $meta_description ?: $settings[ self::$obj->taxonomy . '_desc' ];
|
427 |
break;
|
@@ -525,8 +550,7 @@ class SSP_Output {
|
|
525 |
|
526 |
default:
|
527 |
// is_home() もここに来る。
|
528 |
-
$canonical = get_permalink(
|
529 |
-
|
530 |
break;
|
531 |
}
|
532 |
|
@@ -558,9 +582,13 @@ class SSP_Output {
|
|
558 |
|
559 |
switch ( true ) {
|
560 |
case is_attachment():
|
|
|
|
|
561 |
$og_image = self::$obj->guid ?: $basic_ogimg;
|
562 |
break;
|
563 |
case is_singular() || ( ! is_front_page() && is_home() ):
|
|
|
|
|
564 |
$the_id = self::$obj->ID; // 投稿ID
|
565 |
$meta_image = get_post_meta( $the_id, SSP_MetaBox::POST_META_KEYS['image'], true );
|
566 |
|
@@ -575,6 +603,8 @@ class SSP_Output {
|
|
575 |
}
|
576 |
break;
|
577 |
case is_tax() || is_tag() || is_category():
|
|
|
|
|
578 |
$meta_image = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['image'], true );
|
579 |
$og_image = $meta_image ?: $basic_ogimg;
|
580 |
break;
|
213 |
break;
|
214 |
case is_singular():
|
215 |
case is_home():
|
216 |
+
if ( ! isset( self::$obj->ID ) ) break;
|
217 |
+
|
218 |
$meta_title = get_post_meta( self::$obj->ID, SSP_MetaBox::POST_META_KEYS['title'], true );
|
219 |
if ( $meta_title ) {
|
220 |
$title = $meta_title;
|
221 |
} else {
|
222 |
+
$pt = isset( self::$obj->post_type ) ? self::$obj->post_type : '';
|
223 |
+
$title = isset( $settings[ $pt . '_title' ] ) ? $settings[ $pt . '_title' ] : '';
|
224 |
}
|
225 |
break;
|
226 |
|
227 |
case is_category():
|
228 |
+
if ( ! isset( self::$obj->term_id ) ) break;
|
229 |
+
|
230 |
$meta_title = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['title'], true );
|
231 |
$title = $meta_title ?: $settings['cat_title'];
|
232 |
break;
|
233 |
|
234 |
case is_tag():
|
235 |
+
if ( ! isset( self::$obj->term_id ) ) break;
|
236 |
+
|
237 |
$meta_title = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['title'], true );
|
238 |
$title = $meta_title ?: $settings['tag_title'];
|
239 |
break;
|
240 |
|
241 |
case is_tax():
|
242 |
+
if ( ! isset( self::$obj->term_id ) ) break;
|
243 |
+
|
244 |
$meta_title = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['title'], true );
|
245 |
$term = self::$obj->taxonomy;
|
246 |
$title = $meta_title ?: $settings[ $term . '_title' ];
|
292 |
|
293 |
case is_singular():
|
294 |
case is_home():
|
295 |
+
if ( ! isset( self::$obj->ID ) ) break;
|
296 |
+
|
297 |
$meta_robots = get_post_meta( self::$obj->ID, SSP_MetaBox::POST_META_KEYS['robots'], true );
|
298 |
if ( $meta_robots ) {
|
299 |
$robots = $meta_robots;
|
300 |
} else {
|
301 |
+
$pt = isset( self::$obj->post_type ) ? self::$obj->post_type : '';
|
302 |
+
$is_noindex = isset( $settings[ $pt . '_noindex' ] ) ? $settings[ $pt . '_noindex' ] : false;
|
303 |
$robots = $is_noindex ? 'noindex' : '';
|
304 |
}
|
305 |
break;
|
306 |
|
307 |
case is_category():
|
308 |
+
if ( ! isset( self::$obj->term_id ) ) break;
|
309 |
+
|
310 |
$meta_robots = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['robots'], true );
|
311 |
if ( $meta_robots ) {
|
312 |
$robots = $meta_robots;
|
318 |
break;
|
319 |
|
320 |
case is_tag():
|
321 |
+
if ( ! isset( self::$obj->term_id ) ) break;
|
322 |
+
|
323 |
$meta_robots = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['robots'], true );
|
324 |
if ( $meta_robots ) {
|
325 |
$robots = $meta_robots;
|
330 |
break;
|
331 |
|
332 |
case is_tax():
|
333 |
+
if ( ! isset( self::$obj->term_id ) ) break;
|
334 |
+
|
335 |
$meta_robots = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['robots'], true );
|
336 |
if ( $meta_robots ) {
|
337 |
$robots = $meta_robots;
|
389 |
} elseif ( is_singular() || ( ! is_front_page() && is_home() ) ) {
|
390 |
|
391 |
// メタボックスが入力されていれば上書きする
|
392 |
+
$the_id = isset( self::$obj->ID ) ? self::$obj->ID : 0;
|
393 |
+
$meta_keyword = get_post_meta( $the_id, SSP_MetaBox::POST_META_KEYS['keyword'], true );
|
394 |
+
if ( $meta_keyword ) {
|
395 |
+
$keyword = $meta_keyword;
|
396 |
}
|
397 |
+
}
|
398 |
|
399 |
return apply_filters( 'ssp_output_keyword', $keyword );
|
400 |
|
417 |
|
418 |
case is_singular():
|
419 |
case is_home():
|
420 |
+
if ( ! isset( self::$obj->ID ) ) break;
|
421 |
+
|
422 |
$metabox_desc = get_post_meta( self::$obj->ID, SSP_MetaBox::POST_META_KEYS['description'], true );
|
423 |
|
424 |
if ( '' !== $metabox_desc ) {
|
425 |
// メタボックスが入力されていれば優先
|
426 |
$description = $metabox_desc;
|
427 |
} else {
|
428 |
+
$pt = isset( self::$obj->post_type ) ? self::$obj->post_type : '';
|
429 |
+
$description = isset( $settings[ $pt . '_desc' ] ) ? $settings[ $pt . '_desc' ] : '';
|
430 |
}
|
431 |
break;
|
432 |
|
433 |
case is_category():
|
434 |
+
if ( ! isset( self::$obj->term_id ) ) break;
|
435 |
+
|
436 |
$meta_description = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['description'], true );
|
437 |
$description = $meta_description ?: $settings['cat_desc'];
|
438 |
break;
|
439 |
|
440 |
case is_tag():
|
441 |
+
if ( ! isset( self::$obj->term_id ) ) break;
|
442 |
+
|
443 |
$meta_description = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['description'], true );
|
444 |
$description = $meta_description ?: $settings['tag_desc'];
|
445 |
break;
|
446 |
|
447 |
case is_tax():
|
448 |
+
if ( ! isset( self::$obj->term_id ) ) break;
|
449 |
+
|
450 |
$meta_description = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['description'], true );
|
451 |
$description = $meta_description ?: $settings[ self::$obj->taxonomy . '_desc' ];
|
452 |
break;
|
550 |
|
551 |
default:
|
552 |
// is_home() もここに来る。
|
553 |
+
$canonical = get_permalink( get_queried_object_id() );
|
|
|
554 |
break;
|
555 |
}
|
556 |
|
582 |
|
583 |
switch ( true ) {
|
584 |
case is_attachment():
|
585 |
+
if ( ! isset( self::$obj->guid ) ) break;
|
586 |
+
|
587 |
$og_image = self::$obj->guid ?: $basic_ogimg;
|
588 |
break;
|
589 |
case is_singular() || ( ! is_front_page() && is_home() ):
|
590 |
+
if ( ! isset( self::$obj->ID ) ) break;
|
591 |
+
|
592 |
$the_id = self::$obj->ID; // 投稿ID
|
593 |
$meta_image = get_post_meta( $the_id, SSP_MetaBox::POST_META_KEYS['image'], true );
|
594 |
|
603 |
}
|
604 |
break;
|
605 |
case is_tax() || is_tag() || is_category():
|
606 |
+
if ( ! isset( self::$obj->term_id ) ) break;
|
607 |
+
|
608 |
$meta_image = get_term_meta( self::$obj->term_id, SSP_MetaBox::TERM_META_KEYS['image'], true );
|
609 |
$og_image = $meta_image ?: $basic_ogimg;
|
610 |
break;
|
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.6
|
6 |
Tested up to: 5.6
|
7 |
-
Stable tag: 2.1.
|
8 |
Requires PHP: 5.6
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
@@ -121,6 +121,9 @@ The following hooks are available.
|
|
121 |
|
122 |
== Changelog ==
|
123 |
|
|
|
|
|
|
|
124 |
= 2.1.0 =
|
125 |
Added get method: `\SSP_Output::get_meta_data( 'meta_name' )`
|
126 |
|
4 |
Tags: SEO, meta, analytics, webmaster, simple, japan, meta tag
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 5.6
|
7 |
+
Stable tag: 2.1.1
|
8 |
Requires PHP: 5.6
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
121 |
|
122 |
== Changelog ==
|
123 |
|
124 |
+
= 2.1.1 =
|
125 |
+
Bug fixes
|
126 |
+
|
127 |
= 2.1.0 =
|
128 |
Added get method: `\SSP_Output::get_meta_data( 'meta_name' )`
|
129 |
|
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.1.
|
7 |
* Author: LOOS,Inc.
|
8 |
* Author URI: https://loos-web-studio.com/
|
9 |
* License: GPL2 or later
|
@@ -17,7 +17,7 @@ defined( 'ABSPATH' ) || exit;
|
|
17 |
* 定数宣言
|
18 |
*/
|
19 |
if ( ! defined( 'SSP_VERSION' ) ) {
|
20 |
-
define( 'SSP_VERSION', ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? date_i18n( 'mdGis' ) : '2.1.
|
21 |
}
|
22 |
if ( ! defined( 'SSP_PATH' ) ) {
|
23 |
define( 'SSP_PATH', plugin_dir_path( __FILE__ ) );
|
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.1.1
|
7 |
* Author: LOOS,Inc.
|
8 |
* Author URI: https://loos-web-studio.com/
|
9 |
* License: GPL2 or later
|
17 |
* 定数宣言
|
18 |
*/
|
19 |
if ( ! defined( 'SSP_VERSION' ) ) {
|
20 |
+
define( 'SSP_VERSION', ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? date_i18n( 'mdGis' ) : '2.1.1' );
|
21 |
}
|
22 |
if ( ! defined( 'SSP_PATH' ) ) {
|
23 |
define( 'SSP_PATH', plugin_dir_path( __FILE__ ) );
|
src/js/mediauploader.js
CHANGED
@@ -18,8 +18,8 @@ console.log('Loaded media-uploader.js.');
|
|
18 |
// Create a new media frame
|
19 |
customUploader = wp.media({
|
20 |
// title: '画像を選択',
|
21 |
-
library: { type: 'image' },
|
22 |
// button: { text: '画像を選択' },
|
|
|
23 |
multiple: false,
|
24 |
});
|
25 |
|
18 |
// Create a new media frame
|
19 |
customUploader = wp.media({
|
20 |
// title: '画像を選択',
|
|
|
21 |
// button: { text: '画像を選択' },
|
22 |
+
library: { type: 'image' },
|
23 |
multiple: false,
|
24 |
});
|
25 |
|