everest-forms
Last commit date
addons
1 year ago
assets
1 year ago
bin
1 year ago
dist
1 year ago
includes
1 year ago
languages
1 year ago
src
1 year ago
templates
1 year ago
traits
1 year ago
vendor
1 year ago
composer.json
1 year ago
everest-forms.php
1 year ago
license.txt
8 years ago
readme.txt
1 year ago
uninstall.php
3 years ago
wp
1 year ago
wpml-config.xml
5 years ago
everest-forms.php
93 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin Name: Everest Forms |
| 4 | * Plugin URI: https://everestforms.net/ |
| 5 | * Description: Best WordPress Form Plugin to Create Contact Forms, Surveys, Quizzes, Payment Forms, & Custom Forms Using Drag & Drop Form Builder. |
| 6 | * Version: 3.2.0 |
| 7 | * Author: Everest Forms |
| 8 | * Author URI: https://everestforms.net/ |
| 9 | * Text Domain: everest-forms |
| 10 | * Domain Path: /languages/ |
| 11 | * |
| 12 | * @package EverestForms |
| 13 | */ |
| 14 | |
| 15 | if ( ! defined( 'ABSPATH' ) ) { |
| 16 | exit; // Exit if accessed directly. |
| 17 | } |
| 18 | |
| 19 | // Define EVF_PLUGIN_FILE. |
| 20 | if ( ! defined( 'EVF_PLUGIN_FILE' ) ) { |
| 21 | define( 'EVF_PLUGIN_FILE', __FILE__ ); |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Autoload the packages. |
| 26 | * |
| 27 | * We want to fail gracefully if `composer install` has not been executed yet, so we are checking for the autoloader. |
| 28 | * If the autoloader is not present, let's log the failure and display a nice admin notice. |
| 29 | */ |
| 30 | $autoloader = __DIR__ . '/vendor/autoload.php'; |
| 31 | if ( is_readable( $autoloader ) && version_compare( PHP_VERSION, '7.1.3', '>=' ) ) { |
| 32 | require $autoloader; |
| 33 | } else { |
| 34 | if ( version_compare( PHP_VERSION, '7.1.3', '<=' ) ) { |
| 35 | return; |
| 36 | } |
| 37 | |
| 38 | if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
| 39 | error_log( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log |
| 40 | sprintf( |
| 41 | /* translators: 1: composer command. 2: plugin directory */ |
| 42 | esc_html__( 'Your installation of the Everest Forms plugin is incomplete. Please run %1$s within the %2$s directory.', 'everest-forms' ), |
| 43 | '`composer install`', |
| 44 | '`' . esc_html( str_replace( ABSPATH, '', __DIR__ ) ) . '`' |
| 45 | ) |
| 46 | ); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Outputs an admin notice if composer install has not been ran. |
| 51 | */ |
| 52 | add_action( |
| 53 | 'admin_notices', |
| 54 | function () { |
| 55 | ?> |
| 56 | <div class="notice notice-error"> |
| 57 | <p> |
| 58 | <?php |
| 59 | printf( |
| 60 | /* translators: 1: composer command. 2: plugin directory */ |
| 61 | esc_html__( 'Your installation of the Everest Forms plugin is incomplete. Please run %1$s within the %2$s directory.', 'everest-forms' ), |
| 62 | '<code>composer install</code>', |
| 63 | '<code>' . esc_html( str_replace( ABSPATH, '', __DIR__ ) ) . '</code>' |
| 64 | ); |
| 65 | ?> |
| 66 | </p> |
| 67 | </div> |
| 68 | <?php |
| 69 | } |
| 70 | ); |
| 71 | return; |
| 72 | } |
| 73 | |
| 74 | // Include the main EverestForms class. |
| 75 | if ( ! class_exists( 'EverestForms' ) ) { |
| 76 | include_once dirname( __FILE__ ) . '/includes/class-everest-forms.php'; // phpcs:ignore |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Main instance of EverestForms. |
| 81 | * |
| 82 | * Returns the main instance of EVF to prevent the need to use globals. |
| 83 | * |
| 84 | * @since 1.0.0 |
| 85 | * @return EverestForms |
| 86 | */ |
| 87 | function evf() { |
| 88 | return EverestForms::instance(); |
| 89 | } |
| 90 | |
| 91 | // Global for backwards compatibility. |
| 92 | $GLOBALS['everest-forms'] = evf(); |
| 93 |