| 1 |
<?php |
| 2 |
defined('ABSPATH') or die; |
| 3 |
|
| 4 |
/* |
| 5 |
Plugin Name: FluentComments |
| 6 |
Plugin URI: https://github.com/WPManageNinja/fluent-comments |
| 7 |
Description: AJAX comments with layered spam protection and no CAPTCHA, plus a full email notification system. |
| 8 |
Version: 2.1.1 |
| 9 |
Author: WPManageNinja Team |
| 10 |
Author URI: https://wpmanageninja.com |
| 11 |
License: GPLv2 or later |
| 12 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 13 |
Text Domain: fluent-comments |
| 14 |
Domain Path: /languages |
| 15 |
Requires at least: 6.5 |
| 16 |
Requires PHP: 7.4 |
| 17 |
*/ |
| 18 |
|
| 19 |
define('FLUENT_COMMENTS_PLUGIN_PATH', plugin_dir_path(__FILE__)); |
| 20 |
define('FLUENT_COMMENTS_PLUGIN_URL', plugin_dir_url(__FILE__)); |
| 21 |
define('FLUENT_COMMENTS_VERSION', '2.1.1'); |
| 22 |
|
| 23 |
class FluentCommentsPlugin |
| 24 |
{ |
| 25 |
|
| 26 |
public function boot() |
| 27 |
{ |
| 28 |
$this->registerTextDomain(); |
| 29 |
$this->registerAutoLoad(); |
| 30 |
} |
| 31 |
|
| 32 |
/** |
| 33 |
* Translations that ship inside the plugin's own languages/ directory. |
| 34 |
* |
| 35 |
* Without this, only the translations WordPress.org installs into |
| 36 |
* WP_LANG_DIR/plugins load: the just-in-time loader knows nothing about |
| 37 |
* a plugin's own folder unless the plugin registers it. Our JS |
| 38 |
* translations already point at that folder - wp_set_script_translations() |
| 39 |
* in BlockHandler is handed the path outright - so leaving this out made |
| 40 |
* a bundled .mo work for the block and not for anything in PHP. |
| 41 |
* |
| 42 |
* On init, not on plugins_loaded: loading a text domain before init is |
| 43 |
* deprecated as of WordPress 6.7 and notices on every request. |
| 44 |
*/ |
| 45 |
private function registerTextDomain() |
| 46 |
{ |
| 47 |
add_action('init', function () { |
| 48 |
load_plugin_textdomain( |
| 49 |
'fluent-comments', |
| 50 |
false, |
| 51 |
dirname(plugin_basename(__FILE__)) . '/languages' |
| 52 |
); |
| 53 |
}); |
| 54 |
} |
| 55 |
|
| 56 |
private function registerAutoLoad() |
| 57 |
{ |
| 58 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Helpers/Arr.php'; |
| 59 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Services/Helper.php'; |
| 60 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Services/SpamGuard.php'; |
| 61 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Services/CommentsRepository.php'; |
| 62 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Services/CommentSubmission.php'; |
| 63 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Services/Frontend.php'; |
| 64 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Services/Mailer.php'; |
| 65 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Services/SmartCodeParser.php'; |
| 66 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Services/EmailService.php'; |
| 67 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Services/TemplateScanner.php'; |
| 68 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Services/DiscussionSettings.php'; |
| 69 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Hooks/Handlers/AdminSettingsHandler.php'; |
| 70 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Hooks/Handlers/EmailSettingsHandler.php'; |
| 71 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Hooks/Handlers/CommentsHandler.php'; |
| 72 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Hooks/Handlers/CommentNotificationHandler.php'; |
| 73 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Hooks/Handlers/CoreEmailHandler.php'; |
| 74 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Hooks/Handlers/BlockHandler.php'; |
| 75 |
|
| 76 |
require_once FLUENT_COMMENTS_PLUGIN_PATH . 'app/Hooks/hooks.php'; |
| 77 |
} |
| 78 |
} |
| 79 |
|
| 80 |
|
| 81 |
add_action('plugins_loaded', function () { |
| 82 |
(new FluentCommentsPlugin())->boot(); |
| 83 |
}); |
| 84 |
|