最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Fatal error "Call to undefined function is_plugin_active" each time the plugin is activated

programmeradmin1浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论