[resolved] Jigoshop includes CSS and JS on all admin pages (4 posts)

  1. Sayontan Sinha
    Posted 4 years ago #

    This plugin is great, but there is a major issue in the back-end, interfering with the behaviour of other plugins and themes.

    When you visit different admin screens, you see these lines in the source code:

    <link rel='stylesheet' id='jigoshop_admin_styles-css'  href='.../wp-content/plugins/jigoshop/assets/css/admin.css?ver=3.3.2' type='text/css' media='all' />
    <link rel='stylesheet' id='jquery-ui-jigoshop-styles-css'  href='.../wp-content/plugins/jigoshop/assets/css/jquery-ui-1.8.16.jigoshop.css?ver=3.3.2' type='text/css' media='all' />

    These lines show up even if you are in non-Jigoshop admin screens. This causes conflicts with plugins/themes that have their own skinning included. The trouble comes from this code:

    add_action( 'admin_enqueue_scripts', 'jigoshop_admin_styles' );
    function jigoshop_admin_styles() {
    	wp_register_style('jigoshop_admin_styles', jigoshop::assets_url() . '/assets/css/admin.css');
       	wp_register_style('jquery-ui-jigoshop-styles', jigoshop::assets_url() . '/assets/css/jquery-ui-1.8.16.jigoshop.css');

    The right way to include the code would be to use the appropriate options page hook. E.g. In the file jigoshop-admin.php, the call to add_menu_page returns a page. That returned value should be stored as a global variable. The jigoshop_admin_styles takes a page hook as a parameter by default, and there should be a check before including the scripts if the global variable options page is the same as the hook being passed.


  2. colinsp
    Posted 4 years ago #

    Still no resolution to this from the Jigoshop developers.

    Pretty poor show on their part.

  3. colinsp
    Posted 4 years ago #

    Sayontan, I have just got this response from the Jigoshop developers

    admin.css holds our icon placements, so if we removed admin.css from every other menu except Jigoshop, you'd see something like this:


    So it looks to me like they are doing something different and your suggested fix may not work.

  4. Sayontan Sinha
    Posted 4 years ago #

    I did post a fix for them on my forum. Their intent of addressing the menu icons is very easily addressed without loading the stylesheet: http://aquoid.com/forum/viewtopic.php?f=2&p=38348#p38348

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Jigoshop
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic