Changeset 2825056
- Timestamp:
- 11/28/2022 07:14:17 AM (21 months ago)
- Location:
- seo-simple-pack
- Files:
-
- 12 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
seo-simple-pack/tags/3.1.1/class/data.php
r2825011 r2825056 129 129 'webmaster_baidu' => '', 130 130 'webmaster_yandex' => '', 131 //'google_analytics_type' => 'gtag',132 //'google_analytics_id' => '',131 'google_analytics_type' => 'gtag', 132 'google_analytics_id' => '', 133 133 'google_g_id' => '', 134 134 'google_ua_id' => '', … … 208 208 // 一般設定データ 209 209 $saved_settings = get_option( self::DB_NAME['settings'] ) ?: []; 210 self::$settings = $saved_settings; 211 // self::$settings = array_merge( self::$default_settings, $saved_settings ); 210 self::$settings = array_merge( self::$default_settings, $saved_settings ); 212 211 213 212 // OGP設定 214 213 $saved_ogp_settings = get_option( self::DB_NAME['ogp'] ) ?: []; 215 self::$ogp = $saved_ogp_settings; 216 // self::$ogp = array_merge( self::$default_ogp_settings, $saved_ogp_settings ); 214 self::$ogp = array_merge( self::$default_ogp_settings, $saved_ogp_settings ); 217 215 } 218 216 -
seo-simple-pack/tags/3.1.1/class/output.php
r2825011 r2825056 717 717 } 718 718 719 // Google analytics - GA4 720 $g_id = SSP_Data::get( 'settings', 'google_g_id' ); 719 // Google analytics 720 $ga_ids = []; 721 $g_id = SSP_Data::get( 'settings', 'google_g_id' ); 721 722 if ( $g_id ) { 722 Output_Helper::output_gtag( $g_id );723 ; 723 724 } 724 725 … … 726 727 $ua_id = SSP_Data::get( 'settings', 'google_ua_id' ); 727 728 if ( $ua_id ) { 728 Output_Helper::output_uatag( $ua_id ); 729 } 730 731 // アップデート時に無事にデータ移行できてれば不要だが、念の為残す ? 732 // $ga_id = SSP_Data::get( 'settings', 'google_analytics_id' ); 733 // if ( $ga_id ) { 734 // $ga_type = SSP_Data::get( 'settings', 'google_analytics_type' ); 735 // if ( 'gtag' === $ga_type ) { 736 // Output_Helper::output_gtag( $ga_id ); 737 // } elseif ( 'analytics' === $ga_type ) { 738 // Output_Helper::output_uatag( $ga_id ); 739 // } 740 // } 729 $ga_ids[] = $ua_id; 730 } 731 732 Output_Helper::output_gtag( $ga_ids ); 741 733 } 742 734 -
seo-simple-pack/tags/3.1.1/class/output_helper.php
r2825011 r2825056 12 12 * gtagコード出力 13 13 */ 14 public static function output_gtag( $gaid ) { 14 public static function output_gtag( $ids ) { 15 if ( empty( $ids ) ) return; 16 $id1 = $ids[0]; 17 $id2 = isset( $ids[1] ) ? $ids[1] : ''; 15 18 ?> 16 19 <!-- Google Analytics (gtag.js) --> 17 <script async src="https://www.googletagmanager.com/gtag/js?id=<?=esc_attr( $ gaid)?>"></script>20 <script async src="https://www.googletagmanager.com/gtag/js?id=<?=esc_attr( $ )?>"></script> 18 21 <script> 19 22 window.dataLayer = window.dataLayer || []; 20 23 function gtag(){dataLayer.push(arguments);} 21 24 gtag("js", new Date()); 22 gtag("config", "<?=esc_attr( $gaid )?>"); 25 gtag("config", "<?=esc_attr( $id1 )?>"); 26 <?php if ( $id2 ) : ?> 27 gtag("config", "<?=esc_attr( $id2 )?>"); 28 <?php endif; ?> 23 29 </script> 24 30 <?php 25 31 } 32 26 33 27 34 /** -
seo-simple-pack/tags/3.1.1/class/update_action.php
r2825011 r2825056 63 63 */ 64 64 public static function migrate_ga_data() { 65 $old_ type = self::get( 'settings', 'google_analytics_type' );66 $old_code = self::get( 'settings', 'google_analytics_id' );65 $old_' ); 66 ; 67 67 68 if ( ! $old_type || ! $old_code ) return;68 ; 69 69 70 if ( 'gtag' === $old_type ) { 70 if ( $is_UA ) { 71 $new_code_key = 'google_ua_id'; 72 } else { 71 73 $new_code_key = 'google_g_id'; 72 } elseif ( 'analytics' === $old_type ) {73 $new_code_key = 'google_ua_id';74 74 } 75 75 76 76 self::update_data( 'settings', [ 77 "$new_code_key" => $old_ code,78 ] , [ 'google_analytics_type', 'google_analytics_id' ]);77 "$new_code_key" => $old_, 78 ]); 79 79 } 80 80 } -
seo-simple-pack/tags/3.1.1/readme.txt
r2825011 r2825056 5 5 Requires at least: 4.9 6 6 Tested up to: 6.0 7 Stable tag: 3.1. 07 Stable tag: 3.1. 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 120 120 121 121 == Changelog == 122 122 123 = 3.1.1 = 124 - Minor bug fixes. 125 123 126 = 3.1.0 = 124 127 - For Google Analytics, both GA4 and UA can now be set. -
seo-simple-pack/tags/3.1.1/seo-simple-pack.php
r2825011 r2825056 4 4 * Plugin URI: https://wemo.tech/1670 5 5 * Description: A very simple SEO plugin. You can easily set and customize meta tags and OGP tags for each page. 6 * Version: 3.1. 06 * Version: 3.1. 7 7 * Author: LOOS,Inc. 8 8 * Author URI: https://loos-web-studio.com/ -
seo-simple-pack/trunk/class/data.php
r2825011 r2825056 129 129 'webmaster_baidu' => '', 130 130 'webmaster_yandex' => '', 131 //'google_analytics_type' => 'gtag',132 //'google_analytics_id' => '',131 'google_analytics_type' => 'gtag', 132 'google_analytics_id' => '', 133 133 'google_g_id' => '', 134 134 'google_ua_id' => '', … … 208 208 // 一般設定データ 209 209 $saved_settings = get_option( self::DB_NAME['settings'] ) ?: []; 210 self::$settings = $saved_settings; 211 // self::$settings = array_merge( self::$default_settings, $saved_settings ); 210 self::$settings = array_merge( self::$default_settings, $saved_settings ); 212 211 213 212 // OGP設定 214 213 $saved_ogp_settings = get_option( self::DB_NAME['ogp'] ) ?: []; 215 self::$ogp = $saved_ogp_settings; 216 // self::$ogp = array_merge( self::$default_ogp_settings, $saved_ogp_settings ); 214 self::$ogp = array_merge( self::$default_ogp_settings, $saved_ogp_settings ); 217 215 } 218 216 -
seo-simple-pack/trunk/class/output.php
r2825011 r2825056 717 717 } 718 718 719 // Google analytics - GA4 720 $g_id = SSP_Data::get( 'settings', 'google_g_id' ); 719 // Google analytics 720 $ga_ids = []; 721 $g_id = SSP_Data::get( 'settings', 'google_g_id' ); 721 722 if ( $g_id ) { 722 Output_Helper::output_gtag( $g_id );723 ; 723 724 } 724 725 … … 726 727 $ua_id = SSP_Data::get( 'settings', 'google_ua_id' ); 727 728 if ( $ua_id ) { 728 Output_Helper::output_uatag( $ua_id ); 729 } 730 731 // アップデート時に無事にデータ移行できてれば不要だが、念の為残す ? 732 // $ga_id = SSP_Data::get( 'settings', 'google_analytics_id' ); 733 // if ( $ga_id ) { 734 // $ga_type = SSP_Data::get( 'settings', 'google_analytics_type' ); 735 // if ( 'gtag' === $ga_type ) { 736 // Output_Helper::output_gtag( $ga_id ); 737 // } elseif ( 'analytics' === $ga_type ) { 738 // Output_Helper::output_uatag( $ga_id ); 739 // } 740 // } 729 $ga_ids[] = $ua_id; 730 } 731 732 Output_Helper::output_gtag( $ga_ids ); 741 733 } 742 734 -
seo-simple-pack/trunk/class/output_helper.php
r2825011 r2825056 12 12 * gtagコード出力 13 13 */ 14 public static function output_gtag( $gaid ) { 14 public static function output_gtag( $ids ) { 15 if ( empty( $ids ) ) return; 16 $id1 = $ids[0]; 17 $id2 = isset( $ids[1] ) ? $ids[1] : ''; 15 18 ?> 16 19 <!-- Google Analytics (gtag.js) --> 17 <script async src="https://www.googletagmanager.com/gtag/js?id=<?=esc_attr( $ gaid)?>"></script>20 <script async src="https://www.googletagmanager.com/gtag/js?id=<?=esc_attr( $ )?>"></script> 18 21 <script> 19 22 window.dataLayer = window.dataLayer || []; 20 23 function gtag(){dataLayer.push(arguments);} 21 24 gtag("js", new Date()); 22 gtag("config", "<?=esc_attr( $gaid )?>"); 25 gtag("config", "<?=esc_attr( $id1 )?>"); 26 <?php if ( $id2 ) : ?> 27 gtag("config", "<?=esc_attr( $id2 )?>"); 28 <?php endif; ?> 23 29 </script> 24 30 <?php 25 31 } 32 26 33 27 34 /** -
seo-simple-pack/trunk/class/update_action.php
r2825011 r2825056 63 63 */ 64 64 public static function migrate_ga_data() { 65 $old_ type = self::get( 'settings', 'google_analytics_type' );66 $old_code = self::get( 'settings', 'google_analytics_id' );65 $old_' ); 66 ; 67 67 68 if ( ! $old_type || ! $old_code ) return;68 ; 69 69 70 if ( 'gtag' === $old_type ) { 70 if ( $is_UA ) { 71 $new_code_key = 'google_ua_id'; 72 } else { 71 73 $new_code_key = 'google_g_id'; 72 } elseif ( 'analytics' === $old_type ) {73 $new_code_key = 'google_ua_id';74 74 } 75 75 76 76 self::update_data( 'settings', [ 77 "$new_code_key" => $old_ code,78 ] , [ 'google_analytics_type', 'google_analytics_id' ]);77 "$new_code_key" => $old_, 78 ]); 79 79 } 80 80 } -
seo-simple-pack/trunk/readme.txt
r2825011 r2825056 5 5 Requires at least: 4.9 6 6 Tested up to: 6.0 7 Stable tag: 3.1. 07 Stable tag: 3.1. 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 120 120 121 121 == Changelog == 122 122 123 = 3.1.1 = 124 - Minor bug fixes. 125 123 126 = 3.1.0 = 124 127 - For Google Analytics, both GA4 and UA can now be set. -
seo-simple-pack/trunk/seo-simple-pack.php
r2825011 r2825056 4 4 * Plugin URI: https://wemo.tech/1670 5 5 * Description: A very simple SEO plugin. You can easily set and customize meta tags and OGP tags for each page. 6 * Version: 3.1. 06 * Version: 3.1. 7 7 * Author: LOOS,Inc. 8 8 * Author URI: https://loos-web-studio.com/
Note: See TracChangeset
for help on using the changeset viewer.