PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.1
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.1
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 3.6.66 All 195 releases
fluentform / boot / app.php

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

108 lines 4.8 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
34 $app = new Application($file);
35
36 register_activation_hook($file, function ($network_wide) use ($app) {
37 ($app->make(ActivationHandler::class))->handle($network_wide);
38 });
39
40 add_action('wp_insert_site', function ($blog) use ($app) {
41 if (is_plugin_active_for_network('fluentform/fluentform.php')) {
42 switch_to_blog($blog->blog_id);
43 ($app->make(ActivationHandler::class))->handle(false);
44 restore_current_blog();
45 }
46 });
47
48 register_deactivation_hook($file, function () use ($app) {
49 ($app->make(DeactivationHandler::class))->handle();
50 });
51
52 add_action('admin_init', function () {
53 if (!wp_doing_ajax()) {
54 LegacyManagerScopes::migrate();
55 }
56 });
57
58 add_action('plugins_loaded', function () use ($app) {
59 do_action_deprecated(
60 'fluentform_loaded',
61 [
62 $app
63 ],
64 FLUENTFORM_FRAMEWORK_UPGRADE,
65 'fluentform/loaded',
66 'Use fluentform/loaded instead of fluentform_loaded.'
67 );
68
69 do_action_deprecated(
70 'fluentform-loaded',
71 [
72 $app
73 ],
74 FLUENTFORM_FRAMEWORK_UPGRADE,
75 'fluentform/loaded',
76 'Use fluentform/loaded instead of fluentform-loaded.'
77 );
78 do_action('fluentform/loaded', $app);
79
80 });
81
82 fluentformLoadFile('Services/FluentConversational/plugin.php');
83 fluentformLoadFile('Services/Libraries/action-scheduler/action-scheduler.php');
84
85 (new FluentConversational)->boot();
86 (new FormsMigrator())->boot();
87
88 /* Plugin Meta Links */
89
90 add_filter('plugin_row_meta', 'fluentform_plugin_row_meta', 10, 2);
91
92 function fluentform_plugin_row_meta($links, $file)
93 {
94 if ('fluentform/fluentform.php' == $file) {
95 $row_meta = [
96 '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>',
97 '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>',
98 '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>',
99 ];
100 if (!defined('FLUENTFORMPRO')) {
101 $row_meta['pro'] = '<a rel="noopener" href="https://fluentforms.com" style="color: #7742e6;font-weight: bold;" aria-label="' . esc_attr__('Upgrade to Pro', 'fluentform') . '" target="_blank">' . esc_html__('Upgrade to Pro', 'fluentform') . '</a>';
102 }
103 return array_merge($links, $row_meta);
104 }
105 return (array)$links;
106 }
107 };
108