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

101 lines 4.6 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\App\Helpers\Helper;
11
12 return function ($file) {
13 add_action('plugins_loaded', function () {
14 $isNotCompatible = defined('FLUENTFORMPRO')
15 && version_compare(FLUENTFORMPRO_VERSION, '6.2.0', '<');
16 if ($isNotCompatible) {
17 add_action('admin_init', function () {
18 $message = '<b>' . __('Action Required: ', 'fluentform') . '</b>'
19 . __('Fluent Forms Pro is not compatible with this version of Fluent Forms. Please update Fluent Forms Pro to version ', 'fluentform')
20 . '6.2.0' . __(' or later.', 'fluentform')
21 . ' <a href="' . admin_url('plugins.php?s=fluentformpro&plugin_status=all&force-check=1') . '">'
22 . __('Update Now', 'fluentform') . '</a>';
23 $renderNotice = function () use ($message) {
24 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Admin notice with HTML links
25 printf('<div class="fluentform-admin-notice notice notice-error"><div style="padding: 15px 10px;">%1$s</div></div>', $message);
26 };
27 add_action('fluentform/global_menu', $renderNotice);
28 add_action('fluentform/after_form_menu', $renderNotice);
29 });
30 }
31 });
32
33 $app = new Application($file);
34
35 register_activation_hook($file, function ($network_wide) use ($app) {
36 ($app->make(ActivationHandler::class))->handle($network_wide);
37 });
38
39 add_action('wp_insert_site', function ($blog) use ($app) {
40 if (is_plugin_active_for_network('fluentform/fluentform.php')) {
41 switch_to_blog($blog->blog_id);
42 ($app->make(ActivationHandler::class))->handle(false);
43 restore_current_blog();
44 }
45 });
46
47 register_deactivation_hook($file, function () use ($app) {
48 ($app->make(DeactivationHandler::class))->handle();
49 });
50
51 add_action('plugins_loaded', function () use ($app) {
52 do_action_deprecated(
53 'fluentform_loaded',
54 [
55 $app
56 ],
57 FLUENTFORM_FRAMEWORK_UPGRADE,
58 'fluentform/loaded',
59 'Use fluentform/loaded instead of fluentform_loaded.'
60 );
61
62 do_action_deprecated(
63 'fluentform-loaded',
64 [
65 $app
66 ],
67 FLUENTFORM_FRAMEWORK_UPGRADE,
68 'fluentform/loaded',
69 'Use fluentform/loaded instead of fluentform-loaded.'
70 );
71 do_action('fluentform/loaded', $app);
72
73 });
74
75 fluentformLoadFile('Services/FluentConversational/plugin.php');
76 fluentformLoadFile('Services/Libraries/action-scheduler/action-scheduler.php');
77
78 (new FluentConversational)->boot();
79 (new FormsMigrator())->boot();
80
81 /* Plugin Meta Links */
82
83 add_filter('plugin_row_meta', 'fluentform_plugin_row_meta', 10, 2);
84
85 function fluentform_plugin_row_meta($links, $file)
86 {
87 if ('fluentform/fluentform.php' == $file) {
88 $row_meta = [
89 '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>',
90 '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>',
91 '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>',
92 ];
93 if (!defined('FLUENTFORMPRO')) {
94 $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>';
95 }
96 return array_merge($links, $row_meta);
97 }
98 return (array)$links;
99 }
100 };
101