• Resolved DowntownRob

    (@downtownrob)


    Using the latest version of the popular X theme, when I try installing plugins by clicking on the Install Plugins on the WP Core settings page, it gives a insifficient permissions error.

    I saw the other thread about the theme using the same class or something, can you make your class unique so it doesn’t conflict with themes?

    https://wordpress.org/plugins/wpcore/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author stueynet

    (@stueynet)

    Which version of wpcore are you using? The TGM activation plugin was updated and I pushed an update to that in the plugin. The TGM class is built to allow for multiple appearances of it. Do you know what version the TGM plugin of x-theme uses?

    Plugin Author stueynet

    (@stueynet)

    Actually nevermind. I have purchased it in the past. Here is a note from within the framework:

    /**
    * NOTE: X uses a customized version of the TGM Plugin Activation class
    * We are aware of the potential add_query_arg vulnerability and have
    * updated the file taken precautions against this. There is no true
    * risk either way, as everything in here requires administrator privledges.
    */

    This might have something to do with it. I will have to take a look and see if I can figure this out.

    Sorry for the error you are getting.

    Plugin Author stueynet

    (@stueynet)

    Found the issue:

    In X Theme. In the file framework/functions/global/admin/tmg/registration.php is the following:

    // Remove "Install Plugins" Submenu Item
    // =============================================================================
    
    if ( ! function_exists( 'x_remove_tgm_install_menu_item' ) ) :
      function x_remove_tgm_install_menu_item() {
    
        remove_submenu_page( 'themes.php', 'install-required-plugins' );
    
      }
      add_action( 'admin_menu', 'x_remove_tgm_install_menu_item', 9999 );
    endif;

    What this does is force remove the default plugin install page for the TGM activation class. This is what causes the problem. I will do some more testing but I believe that any other theme or plugin using TGM will likely run into similar issues.

    However I will keep looking into it.

    Plugin Author stueynet

    (@stueynet)

    Even stranger, in the same file on line 130, the theme declares the exact slug which it later removes.

    'default_path'     => 'tgmpa-install-plugins',
          'parent_menu_slug' => 'themes.php',
          'parent_url_slug'  => 'themes.php',
          'menu'             => 'install-required-plugins',

    The ‘menu’ key sets the key there. Thats not even the key used at wpcore.

    I also just removed wpcore completely in a test and I still don’t get the plugin activation suggestions that should be coming through X theme.

    Plugin Author stueynet

    (@stueynet)

    Ok even more testing. So any plugin that makes use of the TGM Class will not work with X Theme. The issue is that they declare the ‘menu’ key and then remove that exact key from the admin. This is because the framework is using the TGM class as the basis for a very customized addons installer.

    This is not a nice way to play. The simple fix in x theme is to not do the above. Aside from that there is really nothing I can do to fix it short of rewriting and using a customized version of TGM. But that would not play nice with others either.

    Se currently, aside form x theme, if you have a site that has a theme, and plugins using the TGM class simultaneously they all just work together. The plugin list just grows to include recommended plugins from all. Its really sweet and happy.

    But if someone goes and removes the menu slug, then everyone loses. But what do I know anyway? They’re the millionaires.

    Plugin Author stueynet

    (@stueynet)

    Marking this a resolved since it appears to be an issue with X theme.

    Thread Starter DowntownRob

    (@downtownrob)

    Gotcha, ok thanks so much, good to know about the X theme.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Insufficient Permissions Error’ is closed to new replies.