PluginProbe
Phone Button / 2.0.0
Phone Button v2.0.0
trunk 1.0.0 1.0.1 1.0.3 1.1.0 1.1.1 2.0.0 2.1.0 2.1.1 2.1.2
phone-button / include / install.php

install.php in Phone Button 2.0.0, at include/install.php

100 lines 3.7 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 $phone_number = '';
19 $button_width = 70;
20 $button_height = 70;
21 $border_radius = '50%';
22 $horizontal_position = 'right';
23 $horizontal_spacing = '30px';
24 $vertical_position = 'bottom';
25 $vertical_spacing = '30px';
26 $background_color = 'linear-gradient(180deg, #00bc3c, #008d32)';
27 $background_position = '50% 50%';
28 $button_z_index = '9999';
29 $button_border = '4px solid #fff';
30 $hide_button_on_desktop = 0;
31 $hide_button_on_mobile = 0;
32 $mobile_width = 960;
33 $mobile_button_position_checkbox = 0;
34 $mobile_horizontal_position = 'right';
35 $mobile_horizontal_spacing = '30px';
36 $mobile_vertical_position = 'bottom';
37 $mobile_vertical_spacing = '30px';
38
39 // getting the image arrow icon
40 $icon_image_url = plugin_dir_url(dirname(__FILE__)) . 'images/phone.png';
41
42 $exclude_option = '';
43 $exclude_ids = '';
44
45 // ----------------------------------------------
46 // insert the data into an array
47 // ----------------------------------------------
48
49 $plugin_data_array = array(
50 'display_button_checkbox' => $display_button_checkbox,
51 'phone_number' => $phone_number,
52 'button_width' => $button_width,
53 'button_height' => $button_height,
54 'border_radius' => $border_radius,
55 'horizontal_position' => $horizontal_position,
56 'horizontal_spacing' => $horizontal_spacing,
57 'vertical_position' => $vertical_position,
58 'vertical_spacing' => $vertical_spacing,
59 'background_color' => $background_color,
60 'background_position' => $background_position,
61 'button_z_index' => $button_z_index,
62 'button_border' => $button_border,
63 'hide_button_on_desktop' => $hide_button_on_desktop,
64 'hide_button_on_mobile' => $hide_button_on_mobile,
65 'mobile_width' => $mobile_width,
66 'mobile_button_position_checkbox' => $mobile_button_position_checkbox,
67 'mobile_horizontal_position' => $mobile_horizontal_position,
68 'mobile_horizontal_spacing' => $mobile_horizontal_spacing,
69 'mobile_vertical_position' => $mobile_vertical_position,
70 'mobile_vertical_spacing' => $mobile_vertical_spacing,
71
72 'icon_image_url' => $icon_image_url,
73
74 'exclude_option' => $exclude_option,
75 'exclude_ids' => $exclude_ids,
76 ); // $creating_data_array = array(
77
78 // ----------------------------------------------
79 // creating a value with all the array data
80 // ----------------------------------------------
81
82 $array_key_name = "";
83 $array_item_value = "";
84
85 foreach($plugin_data_array as $key=>$item) {
86 $array_key_name .= "####" . $key;
87 $array_item_value .= "####" . $item;
88 } // foreach($medical_form_array as $key=>$item) {
89
90 // ----------------------------------------------
91 // inserting all the data to datbase
92 // ----------------------------------------------
93
94 $plugin_data = $array_key_name . "***" . $array_item_value;
95 $plugin_data = yydev_phone_btn_mysql_prep($plugin_data);
96
97 // update optuon on the database into wp_options
98 update_option($wp_options_name, $plugin_data);
99
100 } // if( !get_option($wp_options_name) ) {