PluginProbe
Quill Forms | Conversational Multi Step Forms, Surveys & quizzes / 5.5.0
Quill Forms | Conversational Multi Step Forms, Surveys & quizzes v5.5.0
5.7.3 5.7.2 5.7.1 1.8.1 1.8.10 1.8.11 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 2.0.0 2.1.0 2.10.0 2.11.0 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 All 146 releases
quillforms / quillforms.php

quillforms.php in Quill Forms | Conversational Multi Step Forms, Surveys & quizzes 5.5.0, at quillforms.php

147 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Quill Forms
4 * Plugin URI: https://www.quillforms.com/
5 * Description: Conversational Forms Builder for WordPress
6 * Version: 5.5.0
7 * Author: quillforms.com
8 * Author URI: http://www.quillforms.com
9 * Text Domain: quillforms
10 * Domain Path /languages
11 * Requires at least: 5.4
12 * Tested up to: 6.9
13 * Requires PHP: 7.1
14 *
15 * @package QuillForms
16 */
17
18 defined( 'ABSPATH' ) || exit;
19
20 // Plugin file.
21 if ( ! defined( 'QUILLFORMS_PLUGIN_FILE' ) ) {
22 define( 'QUILLFORMS_PLUGIN_FILE', __FILE__ );
23 }
24
25 // Plugin version.
26 if ( ! defined( 'QUILLFORMS_VERSION' ) ) {
27 define( 'QUILLFORMS_VERSION', '5.5.0' );
28 }
29
30 // Plugin Folder Path.
31 if ( ! defined( 'QUILLFORMS_PLUGIN_DIR' ) ) {
32 define( 'QUILLFORMS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
33 }
34
35 // Plugin Folder URL.
36 if ( ! defined( 'QUILLFORMS_PLUGIN_URL' ) ) {
37 define( 'QUILLFORMS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
38 }
39
40 // Define minimum WP version.
41 define( 'QUILLFORMS_MIN_WP_VERSION', '5.4' );
42
43 // Define minimun php version.
44 define( 'QUILLFORMS_MIN_PHP_VERSION', '7.1' );
45
46 // Require dependencies.
47 require_once QUILLFORMS_PLUGIN_DIR . 'dependencies/libraries/load.php';
48 require_once QUILLFORMS_PLUGIN_DIR . 'dependencies/vendor/autoload.php';
49
50 // Do version checks early
51 quillforms_pre_init();
52
53 // Suppress the WordPress 6.7+ notice and load textdomain immediately
54 add_filter( 'doing_it_wrong_trigger_error', 'quillforms_suppress_translation_notice', 10, 2 );
55
56 // Load textdomain immediately before QuillForms initializes
57 quillforms_load_textdomain_early();
58
59 // Initialize QuillForms on plugins_loaded as normal
60 add_action( 'plugins_loaded', 'quillforms_initialize_main' );
61
62 /**
63 * Verify that we can initialize QuillForms , then load it.
64 *
65 * @since 1.0.0
66 */
67 function quillforms_pre_init() {
68 global $wp_version;
69
70 // Get unmodified $wp_version.
71 include ABSPATH . WPINC . '/version.php';
72
73 // Strip '-src' from the version string. Messes up version_compare().
74 $version = str_replace( '-src', '', $wp_version );
75
76 // Check for minimum WordPress version.
77 if ( version_compare( $version, QUILLFORMS_MIN_WP_VERSION, '<' ) ) {
78 add_action( 'admin_notices', 'quillforms_wordpress_version_notice' );
79 return;
80 }
81
82 // Check for minimum PHP version.
83 if ( version_compare( phpversion(), QUILLFORMS_MIN_PHP_VERSION, '<' ) ) {
84 add_action( 'admin_notices', 'quillforms_php_version_notice' );
85 return;
86 }
87 }
88
89 /**
90 * Suppress WordPress 6.7+ translation timing notice
91 */
92 function quillforms_suppress_translation_notice( $trigger, $function ) {
93 if ( '_load_textdomain_just_in_time' === $function ) {
94 return false;
95 }
96 return $trigger;
97 }
98
99 /**
100 * Load textdomain early (before QuillForms initializes)
101 */
102 function quillforms_load_textdomain_early() {
103 load_plugin_textdomain(
104 'quillforms',
105 false,
106 dirname( plugin_basename( __FILE__ ) ) . '/languages'
107 );
108 }
109
110 /**
111 * Initialize QuillForms after textdomain is ready
112 */
113 function quillforms_initialize_main() {
114 // QuillForms initialization
115 require_once QUILLFORMS_PLUGIN_DIR . 'includes/autoload.php';
116 QuillForms\QuillForms::instance();
117
118 register_activation_hook( QUILLFORMS_PLUGIN_FILE, array( QuillForms\Install::class, 'install' ) );
119
120 do_action( 'quillforms_loaded' );
121 }
122
123 /**
124 * Display a WordPress version notice and deactivate QuillForms plugin.
125 *
126 * @since 1.0.0
127 */
128 function quillforms_wordpress_version_notice() {
129 echo '<div class="error"><p>';
130 echo 'QuillForms requires WordPress ' . QUILLFORMS_MIN_WP_VERSION . ' or later to function properly. Please upgrade WordPress before activating QuillForms.';
131 echo '</p></div>';
132
133 deactivate_plugins( 'quillforms/quillforms.php' );
134 }
135
136 /**
137 * Display a PHP version notice and deactivate QuillForms plugin.
138 *
139 * @since 1.0.0
140 */
141 function quillforms_php_version_notice() {
142 echo '<div class="error"><p>';
143 echo 'QuillForms requires PHP ' . QUILLFORMS_MIN_PHP_VERSION . ' or later to function properly. Please upgrade your PHP version before activating QuillForms.';
144 echo '</p></div>';
145
146 deactivate_plugins( 'quillforms/quillforms.php' );
147 }