PluginProbe
WPInterface Add-ons / 1.0.1
WPInterface Add-ons v1.0.1
1.0.3 trunk 1.0.1 1.0.2
wpinterface-add-ons / wpinterface-add-ons.php

wpinterface-add-ons.php in WPInterface Add-ons 1.0.1, at wpinterface-add-ons.php

98 lines 3.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: WPInterface Add-ons
4 * Requires Plugins: one-click-demo-import
5 * Author: WPInterface
6 * Author URI: https://www.wpinterface.com
7 * Version: 1.0.1
8 * Description: WPInterface Add-ons enhances user-friendliness and simplifies the website-building process by allowing users to import demo data with a single click, creating a website identical to the demo effortlessly.
9 * Text Domain: wpinterface-add-ons
10 * Domain Path: /languages
11 * Requires at least: 5.6
12 * Requires PHP: 5.2
13 * Tested up to: 6.6
14 * License: GPLv2 or later
15 * License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
16 *
17 *
18 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
19 * General Public License version 2, as published by the Free Software Foundation. You may NOT assume
20 * that you can use any other version of the GPL.
21 *
22 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
23 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 */
25 if (!defined('ABSPATH')) {
26 exit;
27 }
28
29 define('WPINTEERFACE_FILE', __FILE__);
30 define('WPINTEERFACE_ROOT', dirname(plugin_basename(WPINTEERFACE_FILE)));
31 define('WPINTEERFACE_PLUGIN_NAME', 'wpinterface-add-ons');
32 define('WPINTEERFACE_PLUGIN_SHORT_NAME', 'wpinterface-add-ons');
33 define('WPINTEERFACE_IC_URL', plugin_dir_url(__FILE__));
34 define('WPINTEERFACE_IC_DIR', plugin_dir_path(__FILE__));
35
36
37 if (!version_compare(PHP_VERSION, '5.6', '>=')) {
38 add_action('admin_notices', 'wpinterface_add_ons_php_version_check');
39 } elseif (!version_compare(get_bloginfo('version'), '4.7', '>=')) {
40 add_action('admin_notices', 'wpinterface_add_ons_wp_version_check');
41 } else {
42 if (!function_exists('is_plugin_active')) {
43 include_once(ABSPATH . 'wp-admin/includes/plugin.php');
44 }
45 if (!is_plugin_active('one-click-demo-import/one-click-demo-import.php')) {
46 add_action('admin_notices', 'wpinterface_add_ons_ocdi_check');
47 } else {
48 require_once 'classes/class-wpintf-demo-import.php';
49 }
50 }
51
52 /**
53 *
54 * Warning when the site doesn't have the minimum required PHP version.
55 *
56 * @return void
57 * @since 1.0.0
58 *
59 */
60 function wpinterface_add_ons_php_version_check()
61 {
62 /* translators: %s: PHP version */
63 $message = sprintf(esc_html__('WPInterface Add-ons requires PHP version %s+, plugin is currently NOT RUNNING.', 'wpinterface-add-ons'), '5.6');
64 $html_message = sprintf('<div class="error">%s</div>', wpautop($message));
65 echo wp_kses_post($html_message);
66 }
67
68 /**
69 *
70 * Warning when the site doesn't have the minimum required WordPress version.
71 *
72 * @return void
73 * @since 1.0.0
74 *
75 */
76 function wpinterface_add_ons_wp_version_check()
77 {
78 /* translators: %s: WordPress version */
79 $message = sprintf(esc_html__('WPInterface Add-ons requires WordPress version %s+. Because you are using an earlier version, the plugin is currently NOT RUNNING.', 'wpinterface-add-ons'), '4.7');
80 $html_message = sprintf('<div class="error">%s</div>', wpautop($message));
81 echo wp_kses_post($html_message);
82 }
83
84 /**
85 *
86 * Warning when the site doesn't have the minimum required WordPress version.
87 *
88 * @return void
89 * @since 1.0.0
90 *
91 */
92 function wpinterface_add_ons_ocdi_check() {
93 $plugin_name = '<a href="' . esc_url( admin_url( 'plugin-install.php?s=One%20Click%20Demo%20Import&tab=search&type=term' ) ) . '" target="_blank">One Click Demo Import</a>';
94 /* translators: %s: One Click Demo Import plugin link */
95 $message = sprintf( esc_html__( 'WPInterface Add-ons is currently inactive. Please install and activate the %s plugin to proceed.', 'wpinterface-add-ons' ), $plugin_name );
96 $html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
97 echo wp_kses_post( $html_message );
98 }