PluginProbe
WP Coder – Insert & Manage Code Snippets / 3.3
WP Coder – Insert & Manage Code Snippets v3.3
4.5.1 1.1 2.3.1 2.3.2 2.4.1 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1 3.1.1 3.2 3.2.1 3.3 3.4 3.5 3.5.1 All 39 releases
← All changes | wp-coder.php +39 -36 3.0.23.3 View file →
@@ -1,12 +1,13 @@
1 1 <?php
2 2 /**
3 3 * Plugin Name: WP Coder
4 4 * Plugin URI: https://wordpress.org/plugins/wp-coder/
5 - * Description: Adding custom HTML, CSS, and JavaScript code to your WordPress site.
6 - * Version: 3.0.2
7 - * Author: Wow-Company
8 - * Author URI: https://wow-estore.com/
5 + * Description: Adding custom HTML, CSS, JavaScript and PHP code to your WordPress site.
6 + * Version: 3.3
7 + * Author: WPCoder
8 + * Author URI: https://wpcoder.pro
9 + * Author Email: dev@wpcoder.pro
9 10 * License: GPL-2.0+
10 11 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
11 12 * Text Domain: wpcoder
12 13 * Requires at least: 5.4
@@ -21,19 +22,12 @@
21 22 use WPCoder\Update\UpdateDB;
22 23
23 24 defined( 'ABSPATH' ) || exit;
24 25
25 -if ( ! class_exists( 'WOW_Plugin' ) ) :
26 +if ( ! class_exists( 'WPCoder' ) ) :
26 27
27 - final class WOW_Plugin {
28 + final class WPCoder {
28 29
29 - public const EMAIl = 'yoda@wow-company.com';
30 - // Plugin name
31 - public const NAME = 'WP Coder';
32 -
33 - // Plugin version
34 - public const VERSION = '3.0.2';
35 -
36 30 // Plugin slug
37 31 public const SLUG = 'wp-coder';
38 32
39 33 // Plugin prefix
@@ -40,9 +34,9 @@
40 34 public const PREFIX = 'wow_coder';
41 35
42 36 public const FOLDER = 'wp-coder';
43 37
44 - public const SHORTCODE = 'WP-Coder';
38 + public const SHORTCODE = 'wp_code';
45 39
46 40 // Plugin ULR
47 41 public const PluginURL = 'https://wordpress.org/plugins/wp-coder/';
48 42
@@ -54,11 +48,12 @@
54 48 /**
55 49 * @var Wow_Dashboard
56 50 */
57 51 private $dashboard;
52 + private $public;
58 53
59 - public static function instance(): WOW_Plugin {
60 - if ( ! isset( self::$instance ) && ! ( self::$instance instanceof WOW_Plugin ) ) {
54 + public static function instance(): WPCoder {
55 + if ( ! isset( self::$instance ) && ! ( self::$instance instanceof WPCoder ) ) {
61 56 self::$instance = new self;
62 57
63 58 self::$instance->includes();
64 59 self::$instance->autoloader = new Autoloader( 'WPCoder' );
@@ -64,8 +59,9 @@
64 59 self::$instance->autoloader = new Autoloader( 'WPCoder' );
65 60 self::$instance->dashboard = new WOWP_Dashboard();
66 61 self::$instance->public = new WOWP_Public();
67 62
63 +
68 64 register_activation_hook( __FILE__, [ self::$instance, 'plugin_activate' ] );
69 65 add_action( 'plugins_loaded', [ self::$instance, 'loaded' ] );
70 66 }
71 67
@@ -92,8 +88,24 @@
92 88 public static function url(): string {
93 89 return plugin_dir_url( __FILE__ );
94 90 }
95 91
92 +
93 + // Get Plugin Info
94 + public static function info( $show = '' ): string {
95 + $data = [
96 + 'name' => 'Plugin Name',
97 + 'version' => 'Version',
98 + 'url' => 'Plugin URI',
99 + 'author' => 'Author',
100 + 'email' => 'Author Email',
101 + ];
102 + $plugin_data = get_file_data( __FILE__, $data, false );
103 +
104 + return $plugin_data[ $show ] ?? '';
105 +
106 + }
107 +
96 108 /**
97 109 * Include required files.
98 110 *
99 111 * @access private
@@ -99,12 +111,9 @@
99 111 * @access private
100 112 * @since 1.0
101 113 */
102 114 private function includes(): void {
103 - if ( ! class_exists( 'Wow_Company' ) ) {
104 - require_once self::dir() . 'includes/class-wow-company.php';
105 - }
106 -
115 + require_once self::dir() . 'includes/safe-mode.php';
107 116 require_once self::dir() . 'classes/Autoloader.php';
108 117 require_once self::dir() . 'includes/class-wowp-dashboard.php';
109 118 require_once self::dir() . 'includes/class-wowp-public.php';
110 119 }
@@ -133,27 +142,20 @@
133 142 _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'wpcoder' ), '1.0' );
134 143 }
135 144
136 145 public function plugin_activate(): void {
137 - $columns = "
138 - id mediumint(9) NOT NULL AUTO_INCREMENT,
139 - title VARCHAR(200) NOT NULL,
140 - html_code LONGTEXT,
141 - css_code LONGTEXT,
142 - js_code LONGTEXT,
143 - param LONGTEXT,
144 - status BOOLEAN,
145 - mode BOOLEAN,
146 - tag TEXT,
147 - UNIQUE KEY id (id)
148 - ";
149 - DBManager::create( $columns );
146 + DBManager::create();
150 147 FolderManager::create();
148 + update_option( self::PREFIX . '_db_version', '3.2' );
151 149
152 150 include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
153 151 if ( is_plugin_active( 'wp-coder-pro/wp-coder-pro.php' ) ) {
154 152 deactivate_plugins( 'wp-coder-pro/wp-coder-pro.php' );
155 153 }
154 + if ( is_plugin_active( 'wpcoderpro/wpcoderpro.php' ) ) {
155 + deactivate_plugins( 'wpcoderpro/wpcoderpro.php' );
156 + }
157 +
156 158 }
157 159
158 160 /**
159 161 * Download the folder with languages.
@@ -165,13 +167,14 @@
165 167 UpdateDB::init();
166 168 $languages_folder = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
167 169 load_plugin_textdomain( 'wpcoder', false, $languages_folder );
168 170 }
171 +
169 172 }
170 173
171 174 endif;
172 175
173 -function wow_plugin_run() {
174 - return WOW_Plugin::instance();
176 +function wp_coder_run() {
177 + return WPCoder::instance();
175 178 }
176 179
177 -wow_plugin_run();
180 +wp_coder_run();