Support Forum

Google Analytics and AG Custom Admin causing errors?

25 Answers

New Answer

MF Marcos Figueroa
Marcos Figueroa
Member

OK… You helped me isolate the ‘plugin’ that was throwing that error.  It was one designed to allow a person to log in with their email called WP Email Login.  I deactivated it and verified that that error is gone.  Since the benefit outweighs the non-destructive error…I will probably reactivate it.

 

Now…the other plugin…  AG Custom Admin…  This plugin is designed to allow me to “white label” the wordpress site.  It’s supposed to allow me to customize what is available in the “backend” to my “customer” who will need to make posts and such.

 

There is another plugin…more limited though…that will “white label” as well, but the customization is less.

 

I definitely prefer AG Custom Admin – unless there’s one I’m unfamiliar with….  since I can actually “hide” certain fields within the post creation area… so they don’t inadvertently click check marks they shouldn’t…

 

But…when AG Custom Admin is active…the login button (in SP) is dead…

 

Thanks so much!

YS Yellow Swordfish
Yellow Swordfish
Member

The important question is – why is something pertaining to the admin being loaded on the public facing side of the site? This just suggests to me that it is badly written.

MF Marcos Figueroa
Marcos Figueroa
Member

Yea, or I think it does a lot more than just the backend.  It also customizes the user bar on the front end, login screens and such.  I assume that something it does with log in is causing the conflict…

It does a lot and probably lots that I don’t know…  🙂

this is it:  http://wordpress.org/extend/plugins/ag-custom-admin/

I’m going to reactivate it so maybe we can isolate the conflict.

Thank you so much for your help.

Marcos

MF Marcos Figueroa
Marcos Figueroa
Member

OK, here is my feeble attempt to try and figure it out.  I’ve looked and since I really don’t know anything about coding …. I’m guessing that when AG Custom Admin is active…It “loads” an old version of jQuery.  Shooting in the wind….  Since, when it’s not active… there are no “Superfish” issues or…..  I’ll continue to look for an answer….

Am I getting close?  🙂

MF Marcos Figueroa
Marcos Figueroa
Member

I also put in a request for help at the AG Custom Admin site and this was his response:

Hi Marcos,

Not many clues on first sight. There are no JavaScript errors, thus it is difficult to debug. This requires advanced debugging including both plugins. I am not very familiar with other plugin, and problem is that this looks good without any errors. You could try to exclude jQuery script includes in AGCA or other plugin, there could be conflict with that.

Good luck,
Argonius

and then he came back with:

OK, I think I found something. Go to other plugin and find this somewhere:

<a onclick="jQuery(document).ready(function() { spjToggleLayer("spLoginForm"); });" href="javascript:void(0);" title="Log in and log out" id="spLogInOutButton" class="spButton spRight vtip" style="text-shadow: none;"><img alt="" src="http://keepourforestopen.org/wp-content/sp-resources/forum-themes/default/images/sp_LogInOut.png" class="spIcon">Log In</a>

change onclick atribute from:

onclick="jQuery(document).ready(function() { spjToggleLayer("spLoginForm"); });"

to

onclick="spjToggleLayer("spLoginForm");"

Hope it helps.

Argonius

 
I’m going to attempt this and see if that works.  I would love your input!  I don’t want to do anything that will cause problems later…
 
I figure that collective knowledge is better than….  well….  MINE!!!  smile
 
Thanks so much!
MF Marcos Figueroa
Marcos Figueroa
Member

Holy Cow…You have no idea how proud of myself I am!!  🙂  haha

Okay…I found and changed this:

In sp-common-view-functions.php:

} else {
 //$out.= "href='javascript:void(0);' onclick='jQuery(document).ready(function() { spjToggleLayer("spLoginForm"); });'>";
 $out.= "href='javascript:void(0);' onclick='spjToggleLayer("spLoginForm");'>";
 }

 

I commented out the original code and changed it below it.  Is this ok.  Is this a good change?  IT DID WORK!  I need to know if this is something that is beneficial or will break something else.  If it’s good, would it warrant a change permanently?

I just want to correct it right, so that when an update is made…either it’s in there or ????  I don’t want to lose the fix?

 

exclaimInput please! exclaim

 

OH, I just thought of something (going to check…..)…  It did correct it, for now… but the errors are still there.  I’m thinking that this might not be a permanent fix.  🙁

Maybe I’ll try and figure out how to exclude the jQuery script that comes with AGCA….  eek  I don’t have the foggiest idea how to do that!  question  …but I will…eventually!  laugh

Thanks so much!!

Marcos 

MP Mr Papa
Mr Papa
Member

Just landed at airport halfway home so be this evening before I can look into further. I but I see no problem trying his suggestion. On Jul 26, 2012 11:27 AM, “Simple:Press Support” wrote:

> > >

MF Marcos Figueroa
Marcos Figueroa
Member

You are totally amazing!  Now that’s what I call support!!  Checking in at the airport!  🙂

Thanks so much!

It did work, however…there are still errors on the page that disappear when AGCA is deactivated.  I’m thinking that his suggestion to exclude jQuery script includes in AGCA might be worth a try.

I think somewhere in his code…I saw something about google jQuery….”something”… so that might be causing a conflict.  I just am not sure how to Exclude his jQuery script and whether or not that will cause problems with that plugin.

Have a safe trip and again THANK YOU!!

Marcos

MP Mr Papa
Mr Papa
Member

thanks for the code change, have noted it and will research if further to see if something we want to incorporated…  not sure why it was tied to document.ready there…

as to jquery, I got the impression he meant he had an option in his plugin settings somewhere…

if not, you will need to locate within the pluign where he loads jquery – search the files for jquery… once found, we can help with how…

MF Marcos Figueroa
Marcos Figueroa
Member

Hey Mr. Papa,

If that code is beneficial, I can’t take credit for it…that was totally Argonius from the AG Custom Admin plugin.

There isn’t a setting to turn off his jQuery, but there is an advanced tab that allows me to insert custom CSS and custom Javascript.  I don’t know if that’s a place to make any corrections…..

I have found however…  in the actual plugin.php (AGCA):

<script type="text/javascript"> 
 var wpversion = "<?php echo $wpversion; ?>";
 var agca_version = "<?php echo $this->agca_version; ?>";
 var jQueryScriptOutputted = false;
 var agca_context = "page";
 function initJQuery() {
 //if the jQuery object isn't available
 if (typeof(jQuery) == 'undefined') {
 if (! jQueryScriptOutputted) {
 //only output the script once..
 jQueryScriptOutputted = true;
 //output the script (load it from google api)
 document.write("<scr" + "ipt type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></scr" + "ipt>"); 
 }
 setTimeout("initJQuery()", 50);
 } else {
 jQuery(function() { 
 try
 { 
 <?php if(get_option('agca_header')!=true){ ?>
 jQuery('#wpadminbar').show();
 <?php } ?>
 
 <?php $this->print_admin_bar_scripts(); ?>
 }catch(ex){}
 }); 
 }
 }
 initJQuery(); 
 </script>

It looks like to me that there is a call to google jQuery…  but, I don’t have the foggiest idea how to “exclude” it.  I’ve tried commenting out various parts, but that doesn’t seem to do it…I’m sure its a little more detailed than that.

 

Thanks,

Marcos

MP Mr Papa
Mr Papa
Member

well, easiest thing then is to just replace

http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js

with

http://yoursite.com/wp-includes/js/jquery/jquery.js

and load the wp version…  really it should be enqueued, but he is doing the checking and loading in js vs php and dont know enough about what is around the code…