Fatal error “Call to undefined function is_plugin_active” each time the plugin is activated
Question
I try to activate an extension in WordPress, but I get an error every time I try to activate it:
Here is the problematic code:
function sta_pro_first_init(){
include dirname(__FILE__) . '/license/license.php';
if(!is_plugin_active('scroll-triggered-animations/toaststa.php')):
function sample_admin_notice__success() { ?>
<div class="notice notice-error">
<p>Scroll Triggered Animations Pro has had a major update and now requires the foundation plugin. Please download and install <a href="https://wordpress.org/plugins/scroll-triggered-animations/" target="_blank">here</a> to carry on using STA.</p>
</div>
<?php }
add_action( 'admin_notices', 'sample_admin_notice__success' );
elseif(sta_pro_license_valid()):
include dirname(__FILE__) . '/backend/init.php';
include dirname(__FILE__) . '/frontend/init.php';
require dirname(__FILE__) . '/updates/plugin-update-checker.php';
$check_for_updates = Puc_v4_Factory::buildUpdateChecker(
'https://www.toastplugins.co.uk/premium-plugins-repository/scroll-triggered-animations-staging/updates.json',
__FILE__, //Full path to the main plugin file or functions.php.
'scroll-triggered-animations'
);
endif;
}
add_action( 'init', 'sta_pro_first_init' ); ?>
It’s not a compatibility issue with other extensions and I think it’s probably a PHP version issue, what do you think?
0
2 years
2020-12-31T04:11:05-05:00
2020-12-31T04:11:05-05:00 0 Answers
3 views
0
Leave an answer