PluginProbe
WP Coder – Insert & Manage Code Snippets / 4.5
WP Coder – Insert & Manage Code Snippets v4.5
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 +29 -12 3.44.5 View file →
@@ -2,15 +2,15 @@
2 2 /**
3 3 * Plugin Name: WP Coder
4 4 * Plugin URI: https://wordpress.org/plugins/wp-coder/
5 5 * Description: Adding custom HTML, CSS, JavaScript and PHP code to your WordPress site.
6 - * Version: 3.4
6 + * Version: 4.5
7 7 * Author: WPCoder
8 8 * Author URI: https://wpcoder.pro
9 - * Author Email: dev@wpcoder.pro
9 + * Author Email: hey@wow-company.com
10 10 * License: GPL-2.0+
11 11 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
12 - * Text Domain: wpcoder
12 + * Text Domain: wp-coder
13 13 * Requires at least: 5.4
14 14 * Requires PHP: 7.4
15 15 */
16 16
@@ -16,8 +16,9 @@
16 16
17 17 namespace WPCoder;
18 18
19 19 // Exit if accessed directly.
20 +use WPCoder\Block\WPCoder_Block;
20 21 use WPCoder\Dashboard\DBManager;
21 22 use WPCoder\Dashboard\FolderManager;
22 23 use WPCoder\Update\UpdateDB;
23 24
@@ -22,9 +23,9 @@
22 23 use WPCoder\Update\UpdateDB;
23 24
24 25 defined( 'ABSPATH' ) || exit;
25 26
26 -if ( ! class_exists( 'WPCoder' ) ) :
27 +if ( ! class_exists( 'wpcoder' ) ) :
27 28
28 29 final class WPCoder {
29 30
30 31 // Plugin slug
@@ -59,9 +60,8 @@
59 60 self::$instance->autoloader = new Autoloader( 'WPCoder' );
60 61 self::$instance->dashboard = new WOWP_Dashboard();
61 62 self::$instance->public = new WOWP_Public();
62 63
63 -
64 64 register_activation_hook( __FILE__, [ self::$instance, 'plugin_activate' ] );
65 65 add_action( 'plugins_loaded', [ self::$instance, 'loaded' ] );
66 66 }
67 67
@@ -99,11 +99,11 @@
99 99 'author' => 'Author',
100 100 'email' => 'Author Email',
101 101 ];
102 102 $plugin_data = get_file_data( __FILE__, $data, false );
103 + $plugin_data['data'] = str_replace( ' ', '-', $plugin_data['name'] );
103 104
104 105 return $plugin_data[ $show ] ?? '';
105 -
106 106 }
107 107
108 108 /**
109 109 * Include required files.
@@ -128,9 +128,9 @@
128 128 * @access protected
129 129 */
130 130 public function __clone() {
131 131 // Cloning instances of the class is forbidden.
132 - _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?', 'wpcoder' ), '1.0' );
132 + _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?', 'wp-coder' ), '1.0' );
133 133 }
134 134
135 135 /**
136 136 * Disable unserializing of the class.
@@ -139,15 +139,32 @@
139 139 * @access protected
140 140 */
141 141 public function __wakeup() {
142 142 // Unserializing instances of the class is forbidden.
143 - _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?', 'wpcoder' ), '1.0' );
143 + _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?', 'wp-coder' ), '1.0' );
144 144 }
145 145
146 146 public function plugin_activate(): void {
147 - DBManager::create();
147 + $columns = "
148 + id mediumint(9) NOT NULL AUTO_INCREMENT,
149 + title VARCHAR(200) NOT NULL,
150 + html_code LONGTEXT,
151 + css_code LONGTEXT,
152 + js_code LONGTEXT,
153 + php_code LONGTEXT,
154 + param LONGTEXT,
155 + status BOOLEAN,
156 + mode BOOLEAN,
157 + tag TEXT,
158 + php_include int(11) NOT NULL DEFAULT '0',
159 + UNIQUE KEY id (id),
160 + INDEX id_index (id)
161 + ";
162 +
163 +
164 + DBManager::create( $columns );
148 165 FolderManager::create();
149 - update_option( self::PREFIX . '_db_version', '3.2' );
166 + update_option( self::PREFIX . '_db_version', '4.0' );
150 167
151 168 include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
152 169 if ( is_plugin_active( 'wp-coder-pro/wp-coder-pro.php' ) ) {
153 170 deactivate_plugins( 'wp-coder-pro/wp-coder-pro.php' );
@@ -154,9 +171,8 @@
154 171 }
155 172 if ( is_plugin_active( 'wpcoderpro/wpcoderpro.php' ) ) {
156 173 deactivate_plugins( 'wpcoderpro/wpcoderpro.php' );
157 174 }
158 -
159 175 }
160 176
161 177 /**
162 178 * Download the folder with languages.
@@ -164,11 +180,12 @@
164 180 * @access Publisher
165 181 * @return void
166 182 */
167 183 public function loaded(): void {
184 + new WPCoder_Block();
168 185 UpdateDB::init();
169 186 $languages_folder = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
170 - load_plugin_textdomain( 'wpcoder', false, $languages_folder );
187 + load_plugin_textdomain( 'wp-coder', false, $languages_folder );
171 188 }
172 189
173 190 }
174 191