PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.2
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.2
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.2, at boot/app.php

120 lines 5.1 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 $initializeNewSite = function ($blogId) use ($app) {
41 if (!is_plugin_active_for_network('fluentform/fluentform.php')) {
42 return;
43 }
44
45 switch_to_blog($blogId);
46 ($app->make(ActivationHandler::class))->handle(false);
47 restore_current_blog();
48 };
49
50 if (function_exists('wp_initialize_site')) {
51 add_action('wp_initialize_site', function ($newSite) use ($initializeNewSite) {
52 $initializeNewSite($newSite->id);
53 }, 20, 1);
54 } else {
55 add_action('wpmu_new_blog', function ($blogId) use ($initializeNewSite) {
56 $initializeNewSite($blogId);
57 }, 10, 1);
58 }
59
60 register_deactivation_hook($file, function () use ($app) {
61 ($app->make(DeactivationHandler::class))->handle();
62 });
63
64 add_action('admin_init', function () {
65 if (!wp_doing_ajax()) {
66 LegacyManagerScopes::migrate();
67 }
68 });
69
70 add_action('plugins_loaded', function () use ($app) {
71 do_action_deprecated(
72 'fluentform_loaded',
73 [
74 $app
75 ],
76 FLUENTFORM_FRAMEWORK_UPGRADE,
77 'fluentform/loaded',
78 'Use fluentform/loaded instead of fluentform_loaded.'
79 );
80
81 do_action_deprecated(
82 'fluentform-loaded',
83 [
84 $app
85 ],
86 FLUENTFORM_FRAMEWORK_UPGRADE,
87 'fluentform/loaded',
88 'Use fluentform/loaded instead of fluentform-loaded.'
89 );
90 do_action('fluentform/loaded', $app);
91
92 });
93
94 fluentformLoadFile('Services/FluentConversational/plugin.php');
95 fluentformLoadFile('Services/Libraries/action-scheduler/action-scheduler.php');
96
97 (new FluentConversational)->boot();
98 (new FormsMigrator())->boot();
99
100 /* Plugin Meta Links */
101
102 add_filter('plugin_row_meta', 'fluentform_plugin_row_meta', 10, 2);
103
104 function fluentform_plugin_row_meta($links, $file)
105 {
106 if ('fluentform/fluentform.php' == $file) {
107 $row_meta = [
108 '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>',
109 '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>',
110 '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>',
111 ];
112 if (!defined('FLUENTFORMPRO')) {
113 $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>';
114 }
115 return array_merge($links, $row_meta);
116 }
117 return (array)$links;
118 }
119 };
120