Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
horike
committed
Jan 16, 2015
0 parents
commit b3bc6db
Showing
10 changed files
with
1,588 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# simple-ga-ranking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
<?php | ||
|
||
add_action( 'admin_menu', 'sga_ranking_admin_menu' ); | ||
|
||
function sga_ranking_admin_menu() { | ||
add_options_page( __( 'Simple GA Ranking', SGA_RANKING_DOMAIN ), __( 'Simple GA Ranking', SGA_RANKING_DOMAIN ), 'manage_options', 'sga_ranking', 'sga_ranking_options_page'); | ||
} | ||
|
||
function sga_ranking_options_page() { | ||
?> | ||
<div class="wrap"> | ||
<?php screen_icon(); ?> | ||
|
||
<h2><?php _e( 'Simple GA Ranking', SGA_RANKING_DOMAIN ); ?></h2> | ||
|
||
<form action="options.php" method="post"> | ||
<?php settings_fields( 'sga_ranking_options' ); ?> | ||
<?php do_settings_sections( 'sga_ranking' ); ?> | ||
|
||
<p class="submit"><input name="Submit" type="submit" value="<?php _e( 'save', SGA_RANKING_DOMAIN ) ?>" class="button-primary" /></p> | ||
</form> | ||
|
||
</div> | ||
<?php | ||
} | ||
|
||
add_action( 'admin_init', 'sga_ranking_admin_init' ); | ||
|
||
function sga_ranking_admin_init() { | ||
register_setting( 'sga_ranking_options', 'sga_ranking_options', 'sga_ranking_options_validate' ); | ||
|
||
add_settings_section( 'sga_ranking_main', __( 'Configuration', SGA_RANKING_DOMAIN ), 'sga_ranking_section_text', 'sga_ranking' ); | ||
|
||
add_settings_field( 'sga_ranking_email', __( 'E-Mail', SGA_RANKING_DOMAIN ), 'sga_ranking_setting_email', | ||
'sga_ranking', 'sga_ranking_main' ); | ||
|
||
add_settings_field( 'sga_ranking_pass', __( 'Password', SGA_RANKING_DOMAIN ), 'sga_ranking_setting_pass', | ||
'sga_ranking', 'sga_ranking_main' ); | ||
|
||
add_settings_field( 'sga_ranking_profile_id', __( 'Profile ID', SGA_RANKING_DOMAIN ), 'sga_ranking_setting_profile_id', | ||
'sga_ranking', 'sga_ranking_main' ); | ||
|
||
// add_settings_field( 'sga_ranking_start_date', __( 'Start Date', SGA_RANKING_DOMAIN ), 'sga_ranking_setting_start_date', | ||
// 'sga_ranking', 'sga_ranking_main' ); | ||
|
||
// add_settings_field( 'sga_ranking_end_date', __( 'End Date', SGA_RANKING_DOMAIN ), 'sga_ranking_setting_end_date', | ||
// 'sga_ranking', 'sga_ranking_main' ); | ||
|
||
// add_settings_field( 'sga_ranking_domain', __( 'Domain', SGA_RANKING_DOMAIN ), 'sga_ranking_setting_domain', | ||
// 'sga_ranking', 'sga_ranking_main' ); | ||
|
||
// add_settings_field( 'sga_ranking_pagePath', __( 'pagePath', SGA_RANKING_DOMAIN ), 'sga_ranking_setting_pagePath', | ||
// 'sga_ranking', 'sga_ranking_main' ); | ||
|
||
add_settings_field( 'sga_ranking_period', __( 'Period to get the ranking from today', SGA_RANKING_DOMAIN ), 'sga_ranking_setting_period', | ||
'sga_ranking', 'sga_ranking_main' ); | ||
|
||
add_settings_field( 'sga_ranking_display_count', __( 'Display Count', SGA_RANKING_DOMAIN ), 'sga_ranking_setting_display_count', | ||
'sga_ranking', 'sga_ranking_main' ); | ||
|
||
add_settings_field( 'sga_ranking_debug_mode', __( 'Debug Mode', SGA_RANKING_DOMAIN ), 'sga_ranking_setting_debug_mode', | ||
'sga_ranking', 'sga_ranking_main' ); | ||
|
||
} | ||
|
||
function sga_ranking_section_text() { | ||
} | ||
|
||
function sga_ranking_setting_email() { | ||
$options = get_option( 'sga_ranking_options' ); | ||
|
||
echo '<input id="sga_ranking_email" name="sga_ranking_options[email]" size="40" type="text" value="' . esc_attr( $options['email'] ) . '" />'; | ||
} | ||
|
||
function sga_ranking_setting_pass() { | ||
$options = get_option( 'sga_ranking_options' ); | ||
|
||
echo '<input id="sga_ranking_pass" name="sga_ranking_options[pass]" size="40" type="password" value="' . esc_attr( $options['pass'] ) . '" />'; | ||
} | ||
|
||
function sga_ranking_setting_profile_id() { | ||
$options = get_option( 'sga_ranking_options' ); | ||
|
||
echo '<input id="sga_ranking_user_profile_id" name="sga_ranking_options[profile_id]" size="40" type="text" value="' . esc_attr( $options['profile_id'] ) . '" />'; | ||
} | ||
|
||
function sga_ranking_setting_start_date() { | ||
$options = get_option( 'sga_ranking_options' ); | ||
|
||
echo '<input id="sga_ranking_start_date" name="sga_ranking_options[start_date]" size="40" type="text" value="' . esc_attr( $options['start_date'] ) . '" /> (YYYY-MM-DD)'; | ||
} | ||
|
||
function sga_ranking_setting_end_date() { | ||
$options = get_option( 'sga_ranking_options' ); | ||
|
||
echo '<input id="sga_ranking_end_date" name="sga_ranking_options[end_date]" size="40 type="text" value="' . esc_attr( $options['end_date'] ) . '" /> (YYYY-MM-DD)'; | ||
} | ||
|
||
function sga_ranking_setting_domain() { | ||
$options = get_option( 'sga_ranking_options' ); | ||
|
||
echo 'http://<input id="sga_ranking_domain" name="sga_ranking_options[domain]" size="40" type="text" value="' . esc_attr( $options['domain'] ) . '" />'; | ||
} | ||
|
||
function sga_ranking_setting_pagePath() { | ||
$options = get_option( 'sga_ranking_options' ); | ||
|
||
echo '<input id="sga_ranking_pagePath" name="sga_ranking_options[pagePath]" size="40" type="text" value="' . esc_attr( $options['pagePath'] ) . '" />'; | ||
} | ||
|
||
function sga_ranking_setting_period() { | ||
$options = get_option( 'sga_ranking_options' ); | ||
|
||
echo '<input id="sga_ranking_period" name="sga_ranking_options[period]" size="4" type="text" value="' . esc_attr( $options['period'] ) . '" /> ' . __( 'day', SGA_RANKING_DOMAIN ); | ||
} | ||
|
||
function sga_ranking_setting_display_count() { | ||
$options = get_option( 'sga_ranking_options' ); | ||
|
||
echo '<input id="sga_ranking_display_count" name="sga_ranking_options[display_count]" size="4" type="text" value="' . esc_attr( $options['display_count'] ) . '" />'; | ||
} | ||
|
||
function sga_ranking_setting_debug_mode() { | ||
$options = get_option( 'sga_ranking_options' ); | ||
|
||
echo '<input id="sga_ranking_debug_mode" name="sga_ranking_options[debug_mode]" size="4" type="checkbox" value="1" ' . checked( $options['debug_mode'], 1 , false ) . '" />'; | ||
} | ||
|
||
function sga_ranking_options_validate( $input ) { | ||
$newinput['email'] = trim( $input['email'] ); | ||
$newinput['pass'] = trim( $input['pass'] ); | ||
$newinput['profile_id'] = trim( $input['profile_id'] ); | ||
$newinput['start_date'] = trim( $input['start_date'] ); | ||
$newinput['end_date'] = trim( $input['end_date'] ); | ||
$newinput['domain'] = trim( $input['domain'] ); | ||
$newinput['pagePath'] = trim( $input['pagePath'] ); | ||
$newinput['period'] = absint( $input['period'] ); | ||
$newinput['display_count'] = absint( $input['display_count'] ); | ||
$newinput['debug_mode'] = absint( $input['debug_mode'] ); | ||
|
||
return $newinput; | ||
} | ||
|
||
?> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: \n" | ||
"POT-Creation-Date: \n" | ||
"PO-Revision-Date: \n" | ||
"Last-Translator: horike takahiro <horike37@gmail.com>\n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Generator: Poedit 1.5.4\n" | ||
|
||
msgid "Simple GA Ranking" | ||
msgstr "" | ||
|
||
msgid "save" | ||
msgstr "保存" | ||
|
||
msgid "Configuration" | ||
msgstr "設定" | ||
|
||
msgid "E-Mail" | ||
msgstr "メールアドレス" | ||
|
||
msgid "Password" | ||
msgstr "パスワード" | ||
|
||
msgid "Profile ID" | ||
msgstr "プロファイル ID" | ||
|
||
msgid "Period to get the ranking from today" | ||
msgstr "本日から何日前までのランキングを表示させるか" | ||
|
||
msgid "Display Count" | ||
msgstr "表示数" | ||
|
||
msgid "day" | ||
msgstr "日" | ||
|
||
msgid "Show ranking the data from Google Analytics" | ||
msgstr "Google Analyticsのデータを元にランキングを表示する" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: \n" | ||
"POT-Creation-Date: \n" | ||
"PO-Revision-Date: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Generator: Poedit 1.5.7\n" | ||
|
||
msgid "Simple GA Ranking" | ||
msgstr "Simple GA Ranking" | ||
|
||
msgid "save" | ||
msgstr "บันทึก" | ||
|
||
msgid "Configuration" | ||
msgstr "การตั้งค่า" | ||
|
||
msgid "E-Mail" | ||
msgstr "อีเมล์" | ||
|
||
msgid "Password" | ||
msgstr "รหัสผ่าน" | ||
|
||
msgid "Profile ID" | ||
msgstr "รหัสข้อมูลพร็อพเพอร์ตี้" | ||
|
||
msgid "Period to get the ranking from today" | ||
msgstr "ระยะเวลาที่จะได้รับการจัดอันดับ นับจากวันนี้" | ||
|
||
msgid "Display Count" | ||
msgstr "จำนวนการแสดงผล" | ||
|
||
msgid "day" | ||
msgstr "วัน" | ||
|
||
msgid "Show ranking the data from Google Analytics" | ||
msgstr "แสดงข้อมูลการจัดอันดับจาก Google Analytics" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"Project-Id-Version: Simple GA Ranking\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2013-02-19 22:01+0900\n" | ||
"PO-Revision-Date: 2013-02-19 22:01+0900\n" | ||
"Last-Translator: Horike Takahiro <horike37@gmail.com>\n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Poedit-SourceCharset: utf-8\n" | ||
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_c\n" | ||
"X-Poedit-Basepath: ../..\n" | ||
"Plural-Forms: nplurals=1; plural=0;\n" | ||
"X-Poedit-SearchPath-0: sga-ranking\n" | ||
|
||
msgid "Simple GA Ranking" | ||
msgstr "" | ||
|
||
msgid "save" | ||
msgstr "" | ||
|
||
msgid "Configuration" | ||
msgstr "" | ||
|
||
msgid "E-Mail" | ||
msgstr "" | ||
|
||
msgid "Password" | ||
msgstr "" | ||
|
||
msgid "Profile ID" | ||
msgstr "" | ||
|
||
msgid "Period to get the ranking from today" | ||
msgstr "" | ||
|
||
msgid "Display Count" | ||
msgstr "" | ||
|
||
msgid "day" | ||
msgstr "" | ||
|
||
msgid "Show ranking the data from Google Analytics" | ||
msgstr "" |
Oops, something went wrong.