PluginProbe
Floating Button – Easily Create Sticky, Fixed & Floating Buttons / 5.0
Floating Button – Easily Create Sticky, Fixed & Floating Buttons v5.0
trunk 2.0.2 3.0 4.0 4.1.2 4.3 5.0 5.0.1 5.1 5.1.1 5.2 5.3 5.3.1 6.0 6.0.1 6.0.10 6.0.11 6.0.12 6.0.13 6.0.2 6.0.3 6.0.4 6.0.5 6.0.6 6.0.7 All 31 releases
floating-button / admin / page-main.php

page-main.php in Floating Button – Easily Create Sticky, Fixed & Floating Buttons 5.0, at admin/page-main.php

97 lines 4.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin main page
4 *
5 * @package Wow_Plugin
6 * @subpackage Admin/Main_page
7 * @author Wow-Company <helper@wow-company.com>
8 * @copyright 2019 Wow-Company
9 * @license GNU Public License
10 * @version 1.0
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 global $wpdb;
18 $data = $wpdb->prefix . 'wow_' . $this->plugin['prefix'];
19 $info = ( isset( $_REQUEST['info'] ) ) ? sanitize_text_field( $_REQUEST['info'] ) : '';
20 if ( $info == 'saved' ) {
21 echo '<div class="updated" id="message"><p><strong>' . esc_attr__( 'Item Added', 'floating-button' ) . '</strong>.</p></div>';
22 } elseif ( $info == 'update' ) {
23 echo '<div class="updated" id="message"><p><strong>' . esc_attr__( 'Item Updated', 'floating-button' ) . '</strong>.</p></div>';
24 } elseif ( $info == 'delete' ) {
25 $delid = absint( $_GET['did'] );
26 $wpdb->delete( $data, [ 'id' => $delid ], [ '%d' ] );
27 echo '<div class="updated" id="message"><p><strong>' . esc_attr__( 'Item Deleted', 'floating-button' ) . '</strong>.</p></div>';
28 }
29
30 $current_tab = ( isset( $_REQUEST["tab"] ) ) ? sanitize_text_field( $_REQUEST["tab"] ) : 'list';
31
32 $tabs = apply_filters( $this->plugin['slug'] . '_tab_menu', array(
33 'list' => esc_attr__( 'List', 'floating-button' ),
34 'settings' => esc_attr__( 'Add new', 'floating-button' ),
35 'extension' => esc_attr__( 'Pro Features', 'side-menu' ),
36 'support' => esc_attr__( 'Support', 'floating-button' ),
37 'rate' => esc_attr__( 'Rate', 'floating-button' ),
38 ) );
39
40 $rating = 'https://wordpress.org/support/plugin/floating-button/reviews/#new-post';
41 ?>
42
43 <div class="wrap">
44 <h1 class="wp-heading-inline"><?php echo esc_attr( $this->plugin['name'] ); ?>
45 v. <?php echo esc_attr( $this->plugin['version'] ); ?></h1>
46 <a href="?page=<?php echo esc_attr( $this->plugin['slug'] ); ?>&tab=settings" class="page-title-action">
47 <?php esc_attr_e( 'Add New', 'floating-button' ); ?></a>
48 <hr class="wp-header-end">
49 <?php if ( get_option( 'wow_' . $this->plugin['prefix'] . '_message' ) != 'read' ) : ?>
50 <div class="notice notice-info is-dismissible wow-plugin-message">
51 <p class="ideas">
52 <i class="fas fa-bullhorn"></i>We are constantly trying to improve the plugin and add more useful
53 features to it. Your support and your ideas for improving the plugin are very important to us. <br/>
54 <i class="fas fa-star"></i>If you like the plugin, please <a
55 href="<?php echo esc_url( $rating ); ?>" target="_blank">leave a review</a> about it at
56 WordPress.org.
57
58 </p>
59 </div>
60 <?php endif; ?>
61
62 <div id="wow-message"></div>
63
64 <?php
65 echo '<h2 class="nav-tab-wrapper">';
66 foreach ( $tabs as $tab => $name ) {
67 $class = ( $tab === $current_tab ) ? ' nav-tab-active' : '';
68 if ( $tab === 'options' ) {
69 $action = ( isset( $_REQUEST["act"] ) ) ? sanitize_text_field( $_REQUEST["act"] ) : '';
70 if ( ! empty( $action ) && $action == 'update' ) {
71 echo '<a class="nav-tab' . esc_attr( $class ) . '" href="?page=' . esc_attr( $this->plugin['slug'] ) . '&tab=' .
72 esc_attr( $tab ) . '">' . esc_attr__( 'Update', $this->plugin['prefix'] ) . ' #' .
73 absint( $_REQUEST["id"] ) . '</a>';
74 } else {
75 echo '<a class="nav-tab' . esc_attr( $class ) . '" href="?page=' . esc_attr( $this->plugin['slug'] ) . '&tab=' .
76 esc_attr( $tab ) . '">' . esc_attr( $name ) . '</a>';
77 }
78 } elseif ( $tab === 'extension' ) {
79 echo '<a class="nav-tab' . esc_attr( $class ) . '" href="?page=' . esc_attr( $this->plugin['slug'] ) . '&tab='
80 . esc_attr( $tab ) . '"><span class="dashicons dashicons-yes" style="color:#00d1b2;"></span> ' . esc_attr( $name ) . '</a>';
81 }
82 elseif ( $tab === 'rate' ) {
83 echo '<a class="nav-tab' . esc_attr( $class ) . '" href="' . esc_url( $rating ) . '" target="_blank"><span class="dashicons dashicons-star-filled" style="color:#ffcc01;"></span> ' . esc_attr( $name ) . '</a>';
84
85 } else {
86 echo '<a class="nav-tab' . esc_attr( $class ) . '" href="?page=' . esc_attr( $this->plugin['slug'] ) . '&tab=' .
87 esc_attr( $tab ) . '">' . esc_attr( $name ) . '</a>';
88 }
89
90 }
91 echo '</h2>';
92 $current_tab = array_key_exists( $current_tab, $tabs ) ? 'page-' . $current_tab : 'page-list';
93 include_once( $current_tab . '.php' );
94 ?>
95 </div>
96 <?php
97