PluginProbe
OffCanvas / Drawer – add sleek slide-in panels to any page / 2.0.7
OffCanvas / Drawer – add sleek slide-in panels to any page v2.0.7
2.0.7 2.0.6 2.0.5 trunk 1.0.0 1.0.1 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4
offcanvas-block / index.php

index.php in OffCanvas / Drawer – add sleek slide-in panels to any page 2.0.7, at index.php

85 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Plugin Name: OffCanvas Block
5 * Description: Display content box from the left, right, or bottom edge of the viewport.
6 * Version: 2.0.7
7 * Author: bPlugins
8 * Author URI: http://bplugins.com
9 * License: GPLv3
10 * License URI: https://www.gnu.org/licenses/gpl-3.0.txt
11 * Text Domain: offcanvas
12 */
13 // ABS PATH
14 if ( !defined( 'ABSPATH' ) ) {
15 exit;
16 }
17 if ( function_exists( 'ob_fs' ) ) {
18 ob_fs()->set_basename( false, __FILE__ );
19 } else {
20 // Constant
21 define( 'OCB_VERSION', ( isset( $_SERVER['HTTP_HOST'] ) && 'localhost' === $_SERVER['HTTP_HOST'] ? time() : '2.0.6' ) );
22 define( 'OCB_DIR_URL', plugin_dir_url( __FILE__ ) );
23 define( 'OCB_DIR_PATH', plugin_dir_path( __FILE__ ) );
24 define( 'OCB_HAS_PRO', file_exists( OCB_DIR_PATH . 'vendor/freemius/start.php' ) );
25 if ( !function_exists( 'ob_fs' ) ) {
26 function ob_fs() {
27 global $ob_fs;
28 if ( !isset( $ob_fs ) ) {
29 $fsLitePath = OCB_DIR_PATH . 'vendor/freemius-lite/start.php';
30 $fsPath = OCB_DIR_PATH . 'vendor/freemius/start.php';
31 if ( OCB_HAS_PRO ) {
32 require_once $fsPath;
33 } else {
34 require_once $fsLitePath;
35 }
36 $config = array(
37 'id' => '21322',
38 'slug' => 'offcanvas-block',
39 'type' => 'plugin',
40 'public_key' => 'pk_2a4d09776eadeb1d9e964dff7283e',
41 'is_premium' => false,
42 'premium_suffix' => 'Pro',
43 'has_premium_version' => true,
44 'has_addons' => false,
45 'has_paid_plans' => true,
46 'menu' => array(
47 'slug' => 'edit.php?post_type=offcanvas-block',
48 'first-path' => 'edit.php?post_type=offcanvas-block&page=ocb_demo_page#/welcome',
49 ),
50 );
51 $ob_fs = ( OCB_HAS_PRO && file_exists( $fsPath ) ? fs_dynamic_init( $config ) : fs_lite_dynamic_init( $config ) );
52 }
53 return $ob_fs;
54 }
55
56 // Init Freemius.
57 ob_fs();
58 do_action( 'ob_fs_loaded' );
59 }
60 // ... Your plugin's main file logic ...
61 require_once OCB_DIR_PATH . "includes/class-obPlugin.php";
62 new OCBPlugin();
63 if ( OCB_HAS_PRO ) {
64 require_once OCB_DIR_PATH . 'includes/LicenseActivation.php';
65 }
66 if ( !function_exists( 'ocb_uninstall_cleanup' ) ) {
67 // Kept self-contained (no OB_Analytics reference): WP re-includes only this
68 // main file to run uninstall hooks, so class-obAnalytics.php isn't loaded yet.
69 function ocb_uninstall_cleanup() {
70 global $wpdb;
71 $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}ob_analytics" );
72 delete_option( 'ob_analytics_db_version' );
73 }
74
75 }
76 // Freemius intercepts plugin deletion for its own uninstall survey via register_uninstall_hook(),
77 // which WordPress ignores entirely if an uninstall.php file is present - so cleanup is wired
78 // through Freemius' own after_uninstall event instead (falling back to the core WP hook on the
79 // free/lite SDK, which doesn't expose that event).
80 if ( OCB_HAS_PRO ) {
81 ob_fs()->add_action( 'after_uninstall', 'ocb_uninstall_cleanup' );
82 } else {
83 register_uninstall_hook( __FILE__, 'ocb_uninstall_cleanup' );
84 }
85 }