Hey guys,
I’m in a dilemma and not sure how to continue on this one. I’m on my way to submit my theme and did the Envato Checks with Envato Theme Check plugin and only have these 2 errors:
The first one:
REQUIRED: Found **is_plugin_active(** in the file **includes/theme-plugins.php** . is_plugin_active() is not reliable. Use function_exists() or class_exists() instead.
Line 207: $plugins[ $slug ][ 'active' ] = $this->tgmpa->is_plugin_active( $slug );
I know perfectly well why i shouldn’t directly use is_plugin_active
, however in my case, the plugin literally checks matches of is_plugin_active
but in my code, i’m verifying with the TGMPA’s instance (eg: $this->tgmpa->is_plugin_active ), which is a library that’s loaded and in use (as well as this function). I know i can use class_exists
but for this i need to get all plugin’s classes and it just feels redundant.
Second one:
* WARNING: Found **remove_filter(** in the file **includes/theme-plugins.php** . Themes should not remove core filters. Ensure this is a valid use case.
Line 367: remove_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adj
In this case, the code looks like this (it’s based on TGMPA’s process_bulk_actions
method):
// Process the bulk installation submissions.
add_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 );
$installed = $installer->bulk_install( $sources );
remove_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1 );
In this case, again, i’m using TGMPA’s instance to make bulk plugin installs for the theme’s Install wizard which is Ajax based, but instead of reinventing the wheel, i’m simply using TGMPA library’s TGMPA_Bulk_Installer
with a custom skin (that extends Bulk_Upgrader_Skin
) to have a silent(er) process for the Ajax calls.
As the error says “Ensure this is a valid use case.”, i feel like it is a valid use case, so far i haven’t had any installation problems, but i would like to know if this would be a reason for rejecting the theme.
@StephenCronin @LoveThemes Would appreciate any input!!
Thanks!
Marius