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 +30 -12 3.34.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.3
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.
@@ -112,8 +112,9 @@
112 112 * @since 1.0
113 113 */
114 114 private function includes(): void {
115 115 require_once self::dir() . 'includes/safe-mode.php';
116 + require_once self::dir() . 'includes/snippets.php';
116 117 require_once self::dir() . 'classes/Autoloader.php';
117 118 require_once self::dir() . 'includes/class-wowp-dashboard.php';
118 119 require_once self::dir() . 'includes/class-wowp-public.php';
119 120 }
@@ -127,9 +128,9 @@
127 128 * @access protected
128 129 */
129 130 public function __clone() {
130 131 // Cloning instances of the class is forbidden.
131 - _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?', 'wpcoder' ), '1.0' );
132 + _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?', 'wp-coder' ), '1.0' );
132 133 }
133 134
134 135 /**
135 136 * Disable unserializing of the class.
@@ -138,15 +139,32 @@
138 139 * @access protected
139 140 */
140 141 public function __wakeup() {
141 142 // Unserializing instances of the class is forbidden.
142 - _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?', 'wpcoder' ), '1.0' );
143 + _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?', 'wp-coder' ), '1.0' );
143 144 }
144 145
145 146 public function plugin_activate(): void {
146 - 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 );
147 165 FolderManager::create();
148 - update_option( self::PREFIX . '_db_version', '3.2' );
166 + update_option( self::PREFIX . '_db_version', '4.0' );
149 167
150 168 include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
151 169 if ( is_plugin_active( 'wp-coder-pro/wp-coder-pro.php' ) ) {
152 170 deactivate_plugins( 'wp-coder-pro/wp-coder-pro.php' );
@@ -153,9 +171,8 @@
153 171 }
154 172 if ( is_plugin_active( 'wpcoderpro/wpcoderpro.php' ) ) {
155 173 deactivate_plugins( 'wpcoderpro/wpcoderpro.php' );
156 174 }
157 -
158 175 }
159 176
160 177 /**
161 178 * Download the folder with languages.
@@ -163,11 +180,12 @@
163 180 * @access Publisher
164 181 * @return void
165 182 */
166 183 public function loaded(): void {
184 + new WPCoder_Block();
167 185 UpdateDB::init();
168 186 $languages_folder = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
169 - load_plugin_textdomain( 'wpcoder', false, $languages_folder );
187 + load_plugin_textdomain( 'wp-coder', false, $languages_folder );
170 188 }
171 189
172 190 }
173 191