Plugin Directory

Changeset 2825056

Timestamp:
11/28/2022 07:14:17 AM (21 months ago)
Author:
looswebstudio
Message:

Update to version 3.1.1 from GitHub

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  
    129129            'webmaster_baidu'          => '',
    130130            'webmaster_yandex'         => '',
    131             // 'google_analytics_type'    => 'gtag',
    132             // 'google_analytics_id'      => '',
     131            'google_analytics_type'    => 'gtag',
     132            'google_analytics_id'      => '',
    133133            'google_g_id'              => '',
    134134            'google_ua_id'             => '',
     
    208208        // 一般設定データ
    209209        $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 );
    212211
    213212        // OGP設定
    214213        $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 );
    217215    }
    218216
  • seo-simple-pack/tags/3.1.1/class/output.php

    r2825011 r2825056  
    717717        }
    718718
    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' );
    721722        if ( $g_id ) {
    722             Output_Helper::output_gtag( $g_id );
     723            ;
    723724        }
    724725
     
    726727        $ua_id = SSP_Data::get( 'settings', 'google_ua_id' );
    727728        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 );
    741733    }
    742734
  • seo-simple-pack/tags/3.1.1/class/output_helper.php

    r2825011 r2825056  
    1212     *  gtagコード出力
    1313     */
    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] : '';
    1518    ?>
    1619<!-- 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>
    1821<script>
    1922    window.dataLayer = window.dataLayer || [];
    2023    function gtag(){dataLayer.push(arguments);}
    2124    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; ?>
    2329</script>
    2430    <?php
    2531    }
     32
    2633
    2734    /**
  • seo-simple-pack/tags/3.1.1/class/update_action.php

    r2825011 r2825056  
    6363     */
    6464    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        ;
    6767
    68         if ( ! $old_type || ! $old_code ) return;
     68        ;
    6969
    70         if ( 'gtag' === $old_type ) {
     70        if ( $is_UA ) {
     71            $new_code_key = 'google_ua_id';
     72        } else {
    7173            $new_code_key = 'google_g_id';
    72         } elseif ( 'analytics' === $old_type ) {
    73             $new_code_key = 'google_ua_id';
    7474        }
    7575
    7676        self::update_data( 'settings', [
    77             "$new_code_key" => $old_code,
    78         ], [ 'google_analytics_type', 'google_analytics_id' ]);
     77            "$new_code_key" => $old_,
     78        ]);
    7979    }
    8080}
  • seo-simple-pack/tags/3.1.1/readme.txt

    r2825011 r2825056  
    55Requires at least: 4.9
    66Tested up to: 6.0
    7 Stable tag:  3.1.0
     7Stable tag:  3.1.
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    120120
    121121== Changelog ==
    122  
     122
     123= 3.1.1 =
     124- Minor bug fixes.
     125
    123126= 3.1.0 =
    124127- For Google Analytics, both GA4 and UA can now be set.
  • seo-simple-pack/tags/3.1.1/seo-simple-pack.php

    r2825011 r2825056  
    44 * Plugin URI: https://wemo.tech/1670
    55 * Description: A very simple SEO plugin. You can easily set and customize meta tags and OGP tags for each page.
    6  * Version: 3.1.0
     6 * Version: 3.1.
    77 * Author: LOOS,Inc.
    88 * Author URI: https://loos-web-studio.com/
  • seo-simple-pack/trunk/class/data.php

    r2825011 r2825056  
    129129            'webmaster_baidu'          => '',
    130130            'webmaster_yandex'         => '',
    131             // 'google_analytics_type'    => 'gtag',
    132             // 'google_analytics_id'      => '',
     131            'google_analytics_type'    => 'gtag',
     132            'google_analytics_id'      => '',
    133133            'google_g_id'              => '',
    134134            'google_ua_id'             => '',
     
    208208        // 一般設定データ
    209209        $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 );
    212211
    213212        // OGP設定
    214213        $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 );
    217215    }
    218216
  • seo-simple-pack/trunk/class/output.php

    r2825011 r2825056  
    717717        }
    718718
    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' );
    721722        if ( $g_id ) {
    722             Output_Helper::output_gtag( $g_id );
     723            ;
    723724        }
    724725
     
    726727        $ua_id = SSP_Data::get( 'settings', 'google_ua_id' );
    727728        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 );
    741733    }
    742734
  • seo-simple-pack/trunk/class/output_helper.php

    r2825011 r2825056  
    1212     *  gtagコード出力
    1313     */
    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] : '';
    1518    ?>
    1619<!-- 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>
    1821<script>
    1922    window.dataLayer = window.dataLayer || [];
    2023    function gtag(){dataLayer.push(arguments);}
    2124    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; ?>
    2329</script>
    2430    <?php
    2531    }
     32
    2633
    2734    /**
  • seo-simple-pack/trunk/class/update_action.php

    r2825011 r2825056  
    6363     */
    6464    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        ;
    6767
    68         if ( ! $old_type || ! $old_code ) return;
     68        ;
    6969
    70         if ( 'gtag' === $old_type ) {
     70        if ( $is_UA ) {
     71            $new_code_key = 'google_ua_id';
     72        } else {
    7173            $new_code_key = 'google_g_id';
    72         } elseif ( 'analytics' === $old_type ) {
    73             $new_code_key = 'google_ua_id';
    7474        }
    7575
    7676        self::update_data( 'settings', [
    77             "$new_code_key" => $old_code,
    78         ], [ 'google_analytics_type', 'google_analytics_id' ]);
     77            "$new_code_key" => $old_,
     78        ]);
    7979    }
    8080}
  • seo-simple-pack/trunk/readme.txt

    r2825011 r2825056  
    55Requires at least: 4.9
    66Tested up to: 6.0
    7 Stable tag:  3.1.0
     7Stable tag:  3.1.
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    120120
    121121== Changelog ==
    122  
     122
     123= 3.1.1 =
     124- Minor bug fixes.
     125
    123126= 3.1.0 =
    124127- For Google Analytics, both GA4 and UA can now be set.
  • seo-simple-pack/trunk/seo-simple-pack.php

    r2825011 r2825056  
    44 * Plugin URI: https://wemo.tech/1670
    55 * Description: A very simple SEO plugin. You can easily set and customize meta tags and OGP tags for each page.
    6  * Version: 3.1.0
     6 * Version: 3.1.
    77 * Author: LOOS,Inc.
    88 * Author URI: https://loos-web-studio.com/
Note: See TracChangeset for help on using the changeset viewer.