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="/" 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(
'.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?