PHP Classes

File: includes/admin/views/html-admin-missing-dependencies.php

Recommend this page to a friend!
  Classes of Julio Cezar Kronbauer  >  PHP WooCommerce Correios  >  includes/admin/views/html-admin-missing-dependencies.php  >  Download  
File: includes/admin/views/html-admin-missing-dependencies.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP WooCommerce Correios
Woocommerce plugin for shipping via Correios
Author: By
Last change:
Date: 5 years ago
Size: 1,374 bytes
 

Contents

Class file image Download
<?php
/**
 * Missing dependencies notice.
 *
 * @package WooCommerce_Correios/Admin/Notices
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

$is_installed = false;

if (
function_exists( 'get_plugins' ) ) {
   
$all_plugins = get_plugins();
   
$is_installed = ! empty( $all_plugins['woocommerce/woocommerce.php'] );
}

?>

<div class="error">
    <p><strong><?php esc_html_e( 'WooCommerce Correios', 'woocommerce-correios' ); ?></strong> <?php esc_html_e( 'depends on the last version of WooCommerce to work!', 'woocommerce-correios' ); ?></p>

    <?php if ( $is_installed && current_user_can( 'install_plugins' ) ) : ?>
<p><a href="<?php echo esc_url( wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=woocommerce/woocommerce.php&plugin_status=active' ), 'activate-plugin_woocommerce/woocommerce.php' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Active WooCommerce', 'woocommerce-correios' ); ?></a></p>
    <?php else : ?>
<?php
   
if ( current_user_can( 'install_plugins' ) ) {
       
$url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=woocommerce' ), 'install-plugin_woocommerce' );
    } else {
       
$url = 'http://wordpress.org/plugins/woocommerce/';
    }
   
?>
<p><a href="<?php echo esc_url( $url ); ?>" class="button button-primary"><?php esc_html_e( 'Install WooCommerce', 'woocommerce-correios' ); ?></a></p>
    <?php endif; ?>
</div>

For more information send a message to info at phpclasses dot org.