| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
Plugin Name: Helpie FAQ |
| 5 |
Plugin URI: http://helpiewp.com/helpie-faq/ |
| 6 |
Description: Awesome WordPress FAQ plugin |
| 7 |
Author: HelpieWP |
| 8 |
Version: 1.51 |
| 9 |
Requires at least: 6.5 |
| 10 |
Requires PHP: 7.4 |
| 11 |
Author URI: http://helpiewp.com |
| 12 |
Network: True |
| 13 |
Text Domain: helpie-faq |
| 14 |
Domain Path: /languages |
| 15 |
License: GPLv2 or later |
| 16 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html |
| 17 |
|
| 18 |
*/ |
| 19 |
|
| 20 |
if (!defined('ABSPATH')) { |
| 21 |
exit; // Exit if accessed directly. |
| 22 |
} |
| 23 |
|
| 24 |
if (function_exists('hf_fs')) { |
| 25 |
hf_fs()->set_basename(true, __FILE__); |
| 26 |
} else { |
| 27 |
if (!class_exists('Helpie_FAQ_Plugin')) { |
| 28 |
|
| 29 |
define('HELPIE_FAQ_VERSION', '1.51'); |
| 30 |
define('HELPIE_FAQ_DOMAIN', 'helpie-faq'); |
| 31 |
define('HELPIE_FAQ_POST_TYPE', 'helpie_faq'); |
| 32 |
define('HELPIE_MENU_POST_TYPE', 'helpie_menu'); |
| 33 |
define('HELPIE_FAQ__FILE__', __FILE__); |
| 34 |
define('HELPIE_FAQ_CATEGORY_TAXONOMY', 'helpie_faq_category'); |
| 35 |
define('HELPIE_FAQ_GROUP_TAXONOMY', 'helpie_faq_group'); |
| 36 |
define('HELPIE_FAQ_PLUGIN_BASE', plugin_basename(HELPIE_FAQ__FILE__)); |
| 37 |
define('HELPIE_FAQ_PATH', plugin_dir_path(HELPIE_FAQ__FILE__)); |
| 38 |
define('HELPIE_FAQ_URL', plugins_url('/', HELPIE_FAQ__FILE__)); |
| 39 |
|
| 40 |
define('HELPIE_FAQ_DEFAULT_CATEGORY_OPTION', 'helpie_faq_default_category'); |
| 41 |
define('HELPIE_FAQ_DEFAULT_CATEGORY', 'Uncategorized FAQ'); |
| 42 |
|
| 43 |
/** Storing Settings Options in Database tables feilds using CS_Framework*/ |
| 44 |
|
| 45 |
define('HELPIE_FAQ_OPTIONS', 'helpie_faq_options'); |
| 46 |
define('HELPIE_FAQ_CUSTOMIZE_OPTIONS', 'helpie_faq_customize_options'); |
| 47 |
|
| 48 |
class Helpie_FAQ_Plugin |
| 49 |
{ |
| 50 |
private static $instance; |
| 51 |
public static function get_instance() |
| 52 |
{ |
| 53 |
if (!isset(self::$instance) && !self::$instance instanceof Helpie_FAQ_Plugin) { |
| 54 |
self::$instance = new Helpie_FAQ_Plugin(); |
| 55 |
} |
| 56 |
return self::$instance; |
| 57 |
} |
| 58 |
|
| 59 |
private function __construct() |
| 60 |
{ |
| 61 |
$this->helpie_faq_activation(); |
| 62 |
} |
| 63 |
|
| 64 |
public function helpie_faq_activation() |
| 65 |
{ |
| 66 |
if (!version_compare(PHP_VERSION, '5.4', '>=')) { |
| 67 |
add_action('admin_notices', [$this, 'helpie_faq_fail_php_version']); |
| 68 |
} elseif (!version_compare(get_bloginfo('version'), '4.5', '>=')) { |
| 69 |
add_action('admin_notices', [$this, 'helpie_faq_fail_wp_version']); |
| 70 |
} else { |
| 71 |
require HELPIE_FAQ_PATH . 'includes/plugin.php'; |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
/** |
| 76 |
* Show in WP Dashboard notice about the plugin is not activated (PHP version). |
| 77 |
* @since 1.0.0 |
| 78 |
* @return void |
| 79 |
*/ |
| 80 |
public function helpie_faq_fail_php_version() |
| 81 |
{ |
| 82 |
/* translators: %s: PHP version */ |
| 83 |
$message = sprintf(esc_html__('Helpie FAQ requires PHP version %s+, plugin is currently NOT ACTIVE.', 'helpie-faq'), '5.4'); |
| 84 |
$html_message = sprintf('<div class="error">%s</div>', wpautop($message)); |
| 85 |
echo wp_kses_post($html_message); |
| 86 |
} |
| 87 |
|
| 88 |
/** |
| 89 |
* Show in WP Dashboard notice about the plugin is not activated (WP version). |
| 90 |
* @since 1.5.0 |
| 91 |
* @return void |
| 92 |
*/ |
| 93 |
public function helpie_faq_fail_wp_version() |
| 94 |
{ |
| 95 |
/* translators: %s: WP version */ |
| 96 |
$message = sprintf(esc_html__('Helpie FAQ requires WordPress version %s+. Because you are using an earlier version, the plugin is currently NOT ACTIVE.', 'helpie-faq'), '4.5'); |
| 97 |
$html_message = sprintf('<div class="error">%s</div>', wpautop($message)); |
| 98 |
echo wp_kses_post($html_message); |
| 99 |
} |
| 100 |
/** |
| 101 |
* Helpie FAQ Internalization |
| 102 |
*/ |
| 103 |
} |
| 104 |
} |
| 105 |
|
| 106 |
Helpie_FAQ_Plugin::get_instance(); |
| 107 |
} |
| 108 |
|