-
Notifications
You must be signed in to change notification settings - Fork 0
/
spromoter.php
59 lines (52 loc) · 1.9 KB
/
spromoter.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* SPromoter Social Reviews for WooCommerce
*
* @package SPromoter
* @author SPromoter Social Reviews for WooCommerce
* @copyright 2024 SPromoter
* @license GPL-2.0-or-later
*
* @wordpress-plugin
* Plugin Name: SPromoter Social Reviews for WooCommerce
* Plugin URI: https://reviews.spromoter.com/integrations/woocommerce
* Description: SPromoter Social Reviews for WooCommerce helps you to collect and display reviews from your customers on your WooCommerce store.
* Version: 1.0.11
* Requires at least: 5.3
* Requires PHP: 7.4
* Author: SPromoter
* Author URI: https://spromoter.com
* Text Domain: spromoter-social-reviews-for-woocommerce
* Domain Path: /languages
* License: GPL v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
defined('ABSPATH') || exit;
if (!defined('SPROMOTER_PLUGIN_FILE')) {
define('SPROMOTER_PLUGIN_FILE', __FILE__);
}
require_once plugin_dir_path(__FILE__) . 'includes/plugin.php';
/**
* Load and init plugin's instance
*/
function spromoter_social_reviews_for_woocommerce() {
if (!defined('WC_VERSION')) {
// Show admin notice if WooCommerce is not installed.
add_action('admin_notices', 'spromoter_missing_woocommerce_notice');
return false;
}
return KinDigi\SPromoter\Plugin::instance();
}
add_action('plugins_loaded', 'spromoter_social_reviews_for_woocommerce');
/**
* Display an admin notice if WooCommerce is not installed
*/
function spromoter_missing_woocommerce_notice() {
if (current_user_can('activate_plugins')) {
?>
<div class="notice notice-error">
<p><?php esc_html_e('SPromoter Social Reviews for WooCommerce requires WooCommerce to be installed and active.', 'spromoter-social-reviews-for-woocommerce'); ?></p>
</div>
<?php
}
}