| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | Plugin Name: HTML Forms |
|---|
| 4 | Plugin URI: https://htmlformsplugin.com/ |
|---|
| 5 | Description: A simpler, faster, and smarter WordPress forms plugin. |
|---|
| 6 | Version: 1.6.1 |
|---|
| 7 | Author: HTML Forms |
|---|
| 8 | Author URI: https://htmlformsplugin.com/ |
|---|
| 9 | License: GPL v3 |
|---|
| 10 | Text Domain: html-forms |
|---|
| 11 | |
|---|
| 12 | HTML Forms |
|---|
| 13 | Copyright (C) 2017-2024, Link Software LLC <support@linksoftwarellc.com> |
|---|
| 14 | |
|---|
| 15 | This program is free software: you can redistribute it and/or modify |
|---|
| 16 | it under the terms of the GNU General Public License as published by |
|---|
| 17 | the Free Software Foundation, either version 3 of the License, or |
|---|
| 18 | (at your option) any later version. |
|---|
| 19 | |
|---|
| 20 | This program is distributed in the hope that it will be useful, |
|---|
| 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 23 | GNU General Public License for more details. |
|---|
| 24 | |
|---|
| 25 | You should have received a copy of the GNU General Public License |
|---|
| 26 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 27 | */ |
|---|
| 28 | |
|---|
| 29 | namespace HTML_Forms; |
|---|
| 30 | |
|---|
| 31 | function _bootstrap() { |
|---|
| 32 | $settings = hf_get_settings(); |
|---|
| 33 | |
|---|
| 34 | $forms = new Forms( __FILE__, $settings ); |
|---|
| 35 | $forms->hook(); |
|---|
| 36 | |
|---|
| 37 | if( is_admin() ) { |
|---|
| 38 | if( ! \defined( 'DOING_AJAX' ) || ! DOING_AJAX ) { |
|---|
| 39 | $admin = new Admin\Admin( __FILE__ ); |
|---|
| 40 | $admin->hook(); |
|---|
| 41 | } |
|---|
| 42 | |
|---|
| 43 | $gdpr = new Admin\GDPR(); |
|---|
| 44 | $gdpr->hook(); |
|---|
| 45 | |
|---|
| 46 | if( function_exists('hcaptcha') ) { |
|---|
| 47 | $hcaptcha = new Admin\Hcaptcha(); |
|---|
| 48 | $hcaptcha->hook(); |
|---|
| 49 | } |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | // Initialize Google reCAPTCHA v3 (needs to run on both frontend and backend) |
|---|
| 53 | if( \class_exists( 'HTML_Forms\Admin\Recaptcha' ) ) { |
|---|
| 54 | $recaptcha = new Admin\Recaptcha(); |
|---|
| 55 | $recaptcha->hook(); |
|---|
| 56 | } |
|---|
| 57 | } |
|---|
| 58 | |
|---|
| 59 | function _hf_actions() { |
|---|
| 60 | $email_action = new Actions\Email(); |
|---|
| 61 | $email_action->hook(); |
|---|
| 62 | |
|---|
| 63 | if( \class_exists( 'MC4WP_MailChimp' ) ) { |
|---|
| 64 | $mailchimp_action = new Actions\MailChimp(); |
|---|
| 65 | $mailchimp_action->hook(); |
|---|
| 66 | } |
|---|
| 67 | } |
|---|
| 68 | |
|---|
| 69 | define('HTML_FORMS_VERSION', '1.6.1'); |
|---|
| 70 | |
|---|
| 71 | if( ! function_exists( 'hf_get_form' ) ) { |
|---|
| 72 | require __DIR__ . '/vendor/autoload.php'; |
|---|
| 73 | } |
|---|
| 74 | |
|---|
| 75 | add_action( 'plugins_loaded', 'HTML_Forms\\_bootstrap', 10 ); |
|---|
| 76 | add_action( 'init', 'HTML_Forms\\_hf_actions', 10 ); |
|---|
| 77 | |
|---|
| 78 | register_activation_hook( __FILE__, '_hf_on_plugin_activation'); |
|---|
| 79 | |
|---|
| 80 | // add cap to site admin after being added to blog |
|---|
| 81 | add_action('add_user_to_blog', '_hf_on_add_user_to_blog', 10, 3); |
|---|
| 82 | |
|---|
| 83 | // install db table for newly added sites |
|---|
| 84 | add_action('wp_insert_site', '_hf_on_wp_insert_site'); |
|---|