add_submenu_page causes a soft reject

One of the soft rejects I got is related with add_submenu_page in tgm-plugin activation class. When I tried to remove if/else and use only the first condition, system doesn’t work when it lists the plugins to install (as expected).

What can I do about this? How did you solve this problem? It’s impossible to use add_theme_page in the second part of the code.

if ( 'themes.php' === $this->parent_slug ) {
            $this->page_hook = call_user_func( 'add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
        } else {
            $this->page_hook = call_user_func( 'add_submenu_page', $args['parent_slug'], $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );


Try downloading the ThemeForest version on the TGM download page:

This Themeforest TGM version doesn’t work well. When you try to install plugins by choosing Appreanace->install plugins everything is fine, but when you click on the notification on the top of the page it causes “Cannot load install-required-plugins.” error (link tries to open plugins.php instead of themes.php file)