PluginProbe
Simple Accessibility Button / trunk
Simple Accessibility Button vtrunk
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.8 1.0.9 1.1.0 1.1.2 1.1.4 1.1.5 1.1.6 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 All 31 releases
yydevelopment-accessibility / include / install.php

install.php in Simple Accessibility Button trunk, at include/install.php

108 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
2 <?php
3
4 include('settings.php'); // Load the files to get the databse info
5
6 // ----------------------------------------------
7 // checking if the data existing on the db and
8 // if not we will create it with initial settings
9 // ----------------------------------------------
10
11 if( !get_option($wp_options_name) ) {
12
13 // ----------------------------------------------
14 // getting all the values and clear data
15 // ----------------------------------------------
16
17 $display_button_checkbox = 1;
18
19 $background_color = '#09547c';
20 $button_width = 45;
21 $button_height = 45;
22 $button_movment = 'fixed';
23
24 $horizontal_position = 'left';
25 $horizontal_spacing = '0px';
26 $vertical_position = 'top';
27 $vertical_spacing = '50px';
28
29 // getting the image arrow icon
30 $icon_image_url = plugin_dir_url(dirname(__FILE__)) . 'images/accessibility-icon.png';
31 $icon_svg_url = plugin_dir_url(dirname(__FILE__)) . 'images/accessibility-icon.svg';
32
33 $hide_on_mobile_checkbox = 0;
34 $hide_on_desktop_checkbox = 0;
35 $mobile_width = 960;
36 $mobile_button_position_checkbox = 0;
37 $mobile_horizontal_position = 'left';
38 $mobile_horizontal_spacing = '0px';
39 $mobile_vertical_position = 'top';
40 $mobile_vertical_spacing = '0px';
41 $accessibility_background_color = '#157cb0';
42 $accessibility_page_url = '';
43 $accessibility_page_text = __('Accessibility Statement', 'yydevelopment-accessibility');
44
45 $z_index = 99999;
46
47 $exclude_option = '';
48 $exclude_ids = '';
49
50 // ----------------------------------------------
51 // insert the data into an array
52 // ----------------------------------------------
53
54 $plugin_data_array = array(
55 'display_button_checkbox' => $display_button_checkbox,
56 'background_color' => $background_color,
57 'button_width' => $button_width,
58 'button_height' => $button_height,
59 'button_movment' => $button_movment,
60 'horizontal_position' => $horizontal_position,
61 'horizontal_spacing' => $horizontal_spacing,
62 'vertical_position' => $vertical_position,
63 'vertical_spacing' => $vertical_spacing,
64 'icon_image_url' => $icon_image_url,
65 'icon_svg_url' => $icon_svg_url,
66 'icon_type' => '',
67 'icon_width' => 0,
68 'icon_height' => 0,
69 'hide_on_mobile_checkbox' => $hide_on_mobile_checkbox,
70 'hide_on_desktop_checkbox' => $hide_on_desktop_checkbox,
71 'mobile_width' => $mobile_width,
72 'mobile_button_position_checkbox' => $mobile_button_position_checkbox,
73 'mobile_horizontal_position' => $mobile_horizontal_position,
74 'mobile_horizontal_spacing' => $mobile_horizontal_spacing,
75 'mobile_vertical_position' => $mobile_vertical_position,
76 'mobile_vertical_spacing' => $mobile_vertical_spacing,
77 'accessibility_background_color' => $accessibility_background_color,
78 'accessibility_page_url' => $accessibility_page_url,
79 'accessibility_page_text' => $accessibility_page_text,
80 'z_index' => $z_index,
81
82 'exclude_option' => $exclude_option,
83 'exclude_ids' => $exclude_ids,
84 ); // $creating_data_array = array(
85
86 // ----------------------------------------------
87 // creating a value with all the array data
88 // ----------------------------------------------
89
90 $array_key_name = "";
91 $array_item_value = "";
92
93 foreach($plugin_data_array as $key=>$item) {
94 $array_key_name .= "####" . $key;
95 $array_item_value .= "####" . $item;
96 } // foreach($medical_form_array as $key=>$item) {
97
98 // ----------------------------------------------
99 // inserting all the data to datbase
100 // ----------------------------------------------
101
102 $plugin_data = $array_key_name . "***" . $array_item_value;
103 $plugin_data = sanitize_text_field($plugin_data);
104
105 // update optuon on the database into wp_options
106 update_option($wp_options_name, $plugin_data);
107
108 } // if( !get_option($wp_options_name) ) {