Created
June 24, 2013 15:41
-
-
Save simonwheatley/5850989 to your computer and use it in GitHub Desktop.
Google Analytics Dashboard patches…
Fix unused `$gauth` notice cause by trying to pass it when it's not been set, two possible options:
`patch-1.diff` – Creates the `$gauth` object within the method using it
`patch-2.diff` – Removes the conditional check re CAPTCHA completely, as it's not currently ever entered because `$gauth` is never set
This file contains hidden or 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
diff --git a/gad-admin-options-ui.php b/gad-admin-options-ui.php | |
index 4ceae90..dc91950 100644 | |
--- a/gad-admin-options-ui.php | |
+++ b/gad-admin-options-ui.php | |
@@ -191,8 +191,9 @@ class GADAdminOptionsUI | |
<?php | |
} | |
- function display_admin_handle_login_options($gauth) | |
+ function display_admin_handle_login_options() | |
{ | |
+ $gauth = new GAuthLib('wpga-display-1.0'); | |
?> | |
<div class="wrap" style="padding-top: 50px;"> | |
diff --git a/gad-admin-options.php b/gad-admin-options.php | |
index e6afefb..6f98a5c 100644 | |
--- a/gad-admin-options.php | |
+++ b/gad-admin-options.php | |
@@ -276,7 +276,7 @@ class GADAdminOptions | |
} | |
} | |
- $ui->display_admin_handle_login_options($gauth); | |
+ $ui->display_admin_handle_login_options(); | |
} | |
function admin_handle_clientlogin_login_options(&$ui, $info_message = '') |
This file contains hidden or 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
diff --git a/gad-admin-options-ui.php b/gad-admin-options-ui.php | |
index 4ceae90..ba8c7ee 100644 | |
--- a/gad-admin-options-ui.php | |
+++ b/gad-admin-options-ui.php | |
@@ -191,7 +191,7 @@ class GADAdminOptionsUI | |
<?php | |
} | |
- function display_admin_handle_login_options($gauth) | |
+ function display_admin_handle_login_options() | |
{ | |
?> | |
@@ -243,17 +243,6 @@ class GADAdminOptionsUI | |
<td><input name="ga_pass" type="password" size="15" id="ga_pass" class="regular-text" value="" /></td> | |
</tr> | |
- <?php if( isset($gauth) && $gauth->requiresCaptcha() ) : ?> | |
- <tr valign="top"> | |
- <th scope="row"><label for="ga_captcha">Google CAPTCHA</label></th> | |
- <td> | |
- <img src="<?php echo $gauth->getCaptchaImageURL(); ?>"/><br/><br/> | |
- <input name="ga_captcha" type="text" size="10" id="ga_captcha" class="regular-text" value="" /> | |
- <input type="hidden" name="ga_captcha_token" value="<?php echo $gauth->getCaptchaToken(); ?>"/> | |
- </td> | |
- </tr> | |
- <?php endif; ?> | |
- | |
<tr valign="top"> | |
<th scope="row"><label for="ga_save_pass">Save Password</label></th> | |
<td><input name="ga_save_pass" type="checkbox" id="ga_save_pass" value="ga_save_pass" <?php if(isset($_POST['ga_save_pass']) || get_option('gad_login_pass') !== false) echo 'checked'; ?> /></td> | |
diff --git a/gad-admin-options.php b/gad-admin-options.php | |
index e6afefb..6f98a5c 100644 | |
--- a/gad-admin-options.php | |
+++ b/gad-admin-options.php | |
@@ -276,7 +276,7 @@ class GADAdminOptions | |
} | |
} | |
- $ui->display_admin_handle_login_options($gauth); | |
+ $ui->display_admin_handle_login_options(); | |
} | |
function admin_handle_clientlogin_login_options(&$ui, $info_message = '') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment