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

97 lines 4.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use FluentForm\Framework\Foundation\Application;
4 use FluentForm\App\Hooks\Handlers\ActivationHandler;
5 use FluentForm\App\Hooks\Handlers\DeactivationHandler;
6 use FluentForm\App\Services\Migrator\Bootstrap as FormsMigrator;
7 use FluentForm\App\Services\FluentConversational\Classes\Form as FluentConversational;
8 use FluentForm\App\Helpers\Helper;
9
10 return function ($file) {
11 add_action('plugins_loaded', function () {
12 $isNotCompatible = defined('FLUENTFORMPRO') && version_compare(FLUENTFORMPRO_VERSION, FLUENTFORM_MINIMUM_PRO_VERSION, '<');
13 $message = '<div style="padding: 15px 10px;" ><b>' . __('Heads UP: ',
14 'fluentform') . '</b>' . __('Fluent Forms Pro Plugin needs to be updated to the latest version.',
15 'fluentform') . '<a href="' . admin_url('plugins.php?s=fluentformpro&plugin_status=all&force-check=1') . '">' . __(' Please update Fluent Forms Pro to latest version.',
16 'fluentform') . '</a></div>';
17 if ($isNotCompatible) {
18 $actions = [
19 'fluentform/global_menu',
20 'fluentform/after_form_menu',
21 ];
22 foreach ($actions as $action) {
23 add_action($action, function () use ($message) {
24 printf('<div class="fluentform-admin-notice notice notice-success">%1$s</div>', $message);
25 });
26 }
27 }
28 });
29
30 $app = new Application($file);
31
32 register_activation_hook($file, function ($network_wide) use ($app) {
33 ($app->make(ActivationHandler::class))->handle($network_wide);
34 });
35
36 add_action('wp_insert_site', function ($blog) use ($app) {
37 if (is_plugin_active_for_network('fluentform/fluentform.php')) {
38 switch_to_blog($blog->blog_id);
39 ($app->make(ActivationHandler::class))->handle(false);
40 restore_current_blog();
41 }
42 });
43
44 register_deactivation_hook($file, function () use ($app) {
45 ($app->make(DeactivationHandler::class))->handle();
46 });
47
48 add_action('plugins_loaded', function () use ($app) {
49 do_action_deprecated(
50 'fluentform_loaded',
51 [
52 $app
53 ],
54 FLUENTFORM_FRAMEWORK_UPGRADE,
55 'fluentform/loaded',
56 'Use fluentform/loaded instead of fluentform_loaded.'
57 );
58
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 do_action('fluentform/loaded', $app);
69 });
70
71 fluentformLoadFile('Services/FluentConversational/plugin.php');
72 fluentformLoadFile('Services/Libraries/action-scheduler/action-scheduler.php');
73
74 (new FluentConversational)->boot();
75 (new FormsMigrator())->boot();
76
77 /* Plugin Meta Links */
78
79 add_filter('plugin_row_meta', 'fluentform_plugin_row_meta', 10, 2);
80
81 function fluentform_plugin_row_meta($links, $file)
82 {
83 if ('fluentform/fluentform.php' == $file) {
84 $row_meta = [
85 'docs' => '<a rel="noopener" href="https://wpmanageninja.com/docs/fluent-form/" style="color: #197efb;font-weight: 600;" aria-label="' . esc_attr(esc_html__('View Fluent Form Documentation', 'fluentform')) . '" target="_blank">' . esc_html__('Docs', 'fluentform') . '</a>',
86 'support' => '<a rel="noopener" href="https://wpmanageninja.com/support-tickets/#/" style="color: #197efb;font-weight: 600;" aria-label="' . esc_attr(esc_html__('Get Support', 'fluentform')) . '" target="_blank">' . esc_html__('Support', 'fluentform') . '</a>',
87 'developer_docs' => '<a rel="noopener" href="https://developers.fluentforms.com" style="color: #197efb;font-weight: 600;" aria-label="' . esc_attr(esc_html__('Developer Docs', 'fluentform')) . '" target="_blank">' . esc_html__('Developer Docs', 'fluentform') . '</a>',
88 ];
89 if (!defined('FLUENTFORMPRO')) {
90 $row_meta['pro'] = '<a rel="noopener" href="https://fluentforms.com" style="color: #7742e6;font-weight: bold;" aria-label="' . esc_attr(esc_html__('Upgrade to Pro', 'fluentform')) . '" target="_blank">' . esc_html__('Upgrade to Pro', 'fluentform') . '</a>';
91 }
92 return array_merge($links, $row_meta);
93 }
94 return (array)$links;
95 }
96 };
97