PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.11
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.11
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / boot / app.php

app.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.2.11, at boot/app.php

124 lines 5.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined('ABSPATH') or die;
4
5 use FluentForm\Framework\Foundation\Application;
6 use FluentForm\App\Hooks\Handlers\ActivationHandler;
7 use FluentForm\App\Hooks\Handlers\DeactivationHandler;
8 use FluentForm\App\Services\Migrator\Bootstrap as FormsMigrator;
9 use FluentForm\App\Services\FluentConversational\Classes\Form as FluentConversational;
10 use FluentForm\Database\Migrations\LegacyManagerScopes;
11 use FluentForm\App\Helpers\Helper;
12
13 return function ($file) {
14 add_action('plugins_loaded', function () {
15 $isNotCompatible = defined('FLUENTFORMPRO')
16 && version_compare(FLUENTFORMPRO_VERSION, '6.2.0', '<');
17 if ($isNotCompatible) {
18 add_action('admin_init', function () {
19 $message = '<b>' . __('Action Required: ', 'fluentform') . '</b>'
20 . __('Fluent Forms Pro is not compatible with this version of Fluent Forms. Please update Fluent Forms Pro to version ', 'fluentform')
21 . '6.2.0' . __(' or later.', 'fluentform')
22 . ' <a href="' . admin_url('plugins.php?s=fluentformpro&plugin_status=all&force-check=1') . '">'
23 . __('Update Now', 'fluentform') . '</a>';
24 $renderNotice = function () use ($message) {
25 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Admin notice with HTML links
26 printf('<div class="fluentform-admin-notice notice notice-error"><div style="padding: 15px 10px;">%1$s</div></div>', $message);
27 };
28 add_action('fluentform/global_menu', $renderNotice);
29 add_action('fluentform/after_form_menu', $renderNotice);
30 });
31 }
32
33 fluentform_maybe_disable_contaminated_pro();
34 });
35
36 $app = new Application($file);
37
38 register_activation_hook($file, function ($network_wide) use ($app) {
39 ($app->make(ActivationHandler::class))->handle($network_wide);
40 });
41
42 $initializeNewSite = function ($blogId) use ($app) {
43 if (!is_plugin_active_for_network('fluentform/fluentform.php')) {
44 return;
45 }
46
47 switch_to_blog($blogId);
48 ($app->make(ActivationHandler::class))->handle(false);
49 restore_current_blog();
50 };
51
52 if (function_exists('wp_initialize_site')) {
53 add_action('wp_initialize_site', function ($newSite) use ($initializeNewSite) {
54 $initializeNewSite($newSite->id);
55 }, 20, 1);
56 } else {
57 add_action('wpmu_new_blog', function ($blogId) use ($initializeNewSite) {
58 $initializeNewSite($blogId);
59 }, 10, 1);
60 }
61
62 register_deactivation_hook($file, function () use ($app) {
63 ($app->make(DeactivationHandler::class))->handle();
64 });
65
66 add_action('admin_init', function () {
67 if (!wp_doing_ajax()) {
68 LegacyManagerScopes::migrate();
69 }
70 });
71
72 add_action('plugins_loaded', function () use ($app) {
73 do_action_deprecated(
74 'fluentform_loaded',
75 [
76 $app
77 ],
78 FLUENTFORM_FRAMEWORK_UPGRADE,
79 'fluentform/loaded',
80 'Use fluentform/loaded instead of fluentform_loaded.'
81 );
82
83 do_action_deprecated(
84 'fluentform-loaded',
85 [
86 $app
87 ],
88 FLUENTFORM_FRAMEWORK_UPGRADE,
89 'fluentform/loaded',
90 'Use fluentform/loaded instead of fluentform-loaded.'
91 );
92 do_action('fluentform/loaded', $app);
93
94 });
95
96 fluentformLoadFile('Services/FluentConversational/plugin.php');
97 fluentformLoadFile('Services/Libraries/action-scheduler/action-scheduler.php');
98
99 (new FluentConversational)->boot();
100 (new FormsMigrator())->boot();
101
102 /* Plugin Meta Links — registered on init to avoid early textdomain loading (WP 6.7+) */
103
104 add_action('init', function () {
105 add_filter('plugin_row_meta', 'fluentform_plugin_row_meta', 10, 2);
106 });
107
108 function fluentform_plugin_row_meta($links, $file)
109 {
110 if ('fluentform/fluentform.php' == $file) {
111 $row_meta = [
112 'docs' => '<a rel="noopener" href="https://fluentforms.com/docs" style="color: #197efb;font-weight: 600;" aria-label="' . esc_attr__('View FluentForms Documentation', 'fluentform') . '" target="_blank">' . esc_html__('Docs', 'fluentform') . '</a>',
113 'support' => '<a rel="noopener" href="https://wpmanageninja.com/support-tickets/#/" style="color: #197efb;font-weight: 600;" aria-label="' . esc_attr__('Get Support', 'fluentform') . '" target="_blank">' . esc_html__('Support', 'fluentform') . '</a>',
114 'developer_docs' => '<a rel="noopener" href="https://developers.fluentforms.com" style="color: #197efb;font-weight: 600;" aria-label="' . esc_attr__('Developer Docs', 'fluentform') . '" target="_blank">' . esc_html__('Developer Docs', 'fluentform') . '</a>',
115 ];
116 if (!defined('FLUENTFORMPRO')) {
117 $row_meta['pro'] = '<a rel="noopener" href="' . esc_url(fluentform_upgrade_url('plugin_row_meta')) . '" style="color: #7742e6;font-weight: bold;" aria-label="' . esc_attr__('Upgrade to Pro', 'fluentform') . '" target="_blank">' . esc_html__('Upgrade to Pro', 'fluentform') . '</a>';
118 }
119 return array_merge($links, $row_meta);
120 }
121 return (array)$links;
122 }
123 };
124