PluginProbe
Button Generator – Easily Create Custom Buttons with Icons and Analytics / 2.3.8
Button Generator – Easily Create Custom Buttons with Icons and Analytics v2.3.8
trunk 1.1.1 2.0 2.1 2.2 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 3.0 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.2 3.1.3 3.2 3.2.1 3.2.2 3.2.3 All 28 releases
button-generation / button-generation.php

button-generation.php in Button Generator – Easily Create Custom Buttons with Icons and Analytics 2.3.8, at button-generation.php

199 lines 5.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Button Generator
4 * Plugin URI: https://wordpress.org/plugins/button-generation/
5 * Description: Easy generation of custom buttons.
6 * Version: 2.3.8
7 * Author: Wow-Company
8 * Author URI: https://wow-estore.com/
9 * License: GPL-2.0+
10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
11 * Text Domain: button_generator
12 * Domain Path: /languages
13 *
14 * PHP version 5.3.0
15 *
16 * @category Wordpress_Plugin
17 * @package Wow_Plugin
18 * @author Wow-Company <yoda@wow-company.com>
19 * @copyright 2019 Wow-Company
20 * @license GNU Public License
21 * @version 1.0
22 */
23
24 // Required set the namespace for plugin.
25 namespace button_generator;
26
27 if ( ! defined( 'ABSPATH' ) ) {
28 exit;
29 }
30
31
32 if ( ! class_exists( 'Wow_Plugin' ) ) :
33
34 /**
35 * Main Wow_Plugin Class.
36 *
37 * @since 1.0
38 */
39 final class Wow_Plugin {
40
41 private static $_instance;
42
43 // Set the database name.
44 const PREF = 'button_generator';
45 /**
46 * @var Wow_Plugin_Admin
47 */
48 private $admin;
49 /**
50 * @var Wow_Plugin_Public
51 */
52 private $public;
53
54 /**
55 * Main Wow_Plugin Instance.
56 *
57 * Insures that only one instance of Wow_Plugin exists in memory at any one
58 * time. Also prevents needing to define globals all over the place.
59 *
60 * @return object|Wow_Plugin The one true Wow_Plugin for Current plugin
61 *
62 * @uses Wow_Plugin::_includes() Include the required files.
63 * @uses Wow_Plugin::text_domain() load the language files.
64 * @since 1.0
65 * @static
66 * @staticvar array $instance
67 */
68 public static function instance() {
69
70 if ( ! isset( self::$_instance ) && ! ( self::$_instance instanceof Wow_Plugin ) ) {
71
72 $info = array(
73 'plugin' => array(
74 'name' => esc_attr__( 'Button Generator', 'button_generator' ), // Plugin name
75 'menu' => esc_attr__( 'Button Generator', 'button_generator' ), // Plugin name in menu
76 'author' => 'Wow-Company', // Author
77 'prefix' => self::PREF, // Prefix for database
78 'text' => 'button_generator', // Text domain for translate files
79 'version' => '2.3.8', // Current version of the plugin
80 'file' => __FILE__, // Main file of the plugin
81 'slug' => dirname( plugin_basename( __FILE__ ) ), // Name of the plugin folder
82 'url' => plugin_dir_url( __FILE__ ), // filesystem directory path for the plugin
83 'dir' => plugin_dir_path( __FILE__ ), // URL directory path for the plugin
84 'shortcode' => 'Button',
85
86 ),
87 'url' => array(
88 'author' => 'https://wow-estore.com/',
89 'pro' => 'https://wow-estore.com/item/button-generator-pro/',
90 'home' => 'https://wordpress.org/plugins/button-generation/',
91 'support' => 'https://wordpress.org/support/plugin/button-generation/',
92 'facebook' => 'https://www.facebook.com/wowaffect/',
93 ),
94 'rating' => array(
95 'website' => esc_attr__( 'WordPress', 'button_generator' ), // Name site for rating plugin
96 'url' => 'https://wordpress.org/support/plugin/button-generation/reviews/?filter=5',
97 'wp_url' => 'https://wordpress.org/support/plugin/button-generation/reviews/#new-post',
98 'wp_home' => 'https://wordpress.org/plugins/button-generation/',
99 'wp_title' => 'Button Generator – easily Button Builder',
100 ),
101 );
102
103 self::$_instance = new Wow_Plugin;
104
105 register_activation_hook( __FILE__, array( self::$_instance, 'plugin_activate' ) );
106 add_action( 'plugins_loaded', array( self::$_instance, 'text_domain' ) );
107
108 self::$_instance->_includes();
109 self::$_instance->admin = new Wow_Plugin_Admin( $info );
110 self::$_instance->public = new Wow_Plugin_Public( $info );
111 }
112
113 return self::$_instance;
114 }
115
116 /**
117 * Throw error on object clone.
118 * The whole idea of the singleton design pattern is that there is a single
119 * object therefore, we don't want the object to be cloned.
120 *
121 * @return void
122 * @since 1.0
123 * @access protected
124 */
125 public function __clone() {
126 // Cloning instances of the class is forbidden.
127 _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'button_generator' ), '0.1' );
128 }
129
130 /**
131 * Disable unserializing of the class.
132 *
133 * @return void
134 * @since 1.0
135 * @access protected
136 */
137 public function __wakeup() {
138 // Unserializing instances of the class is forbidden.
139 _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'button_generator' ), '0.1' );
140 }
141
142
143 /**
144 * Include required files.
145 *
146 * @access private
147 * @return void
148 * @since 1.0
149 */
150 private function _includes() {
151 if ( ! class_exists( 'Wow_Company' ) ) {
152 include_once 'includes/class-wow-company.php';
153 }
154 include_once 'includes/class-db.php';
155 include_once 'admin/class-admin.php';
156 include_once 'public/class-public.php';
157 }
158
159 /**
160 * Activate the plugin.
161 * create the database
162 * create the folder in wp-upload
163 *
164 * @access public
165 * @return void
166 * @since 1.0
167 */
168 public function plugin_activate() {
169 update_option( 'wow_' . self::PREF . '_notice_action', 'read' );
170 include_once 'includes/plugin-activation.php';
171 }
172
173 /**
174 * Download the folder with languages.
175 *
176 * @access public
177 * @return void
178 * @since 1.0
179 */
180 public function text_domain() {
181 $languages_folder = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
182 load_plugin_textdomain( 'button_generator', false, $languages_folder );
183 }
184 }
185
186 endif; // End if class_exists check.
187
188 /**
189 * The main function for that returns Wow_Plugin
190 *
191 * @since 1.0
192 */
193 function Wow_Plugin_run() {
194 return Wow_Plugin::instance();
195 }
196
197 // Get Running.
198 Wow_Plugin_run();
199