| @@ -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.2 | |
| 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,9 +139,9 @@ | ||
| 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 | 147 | $columns = " |
| @@ -153,13 +154,17 @@ | ||
| 153 | 154 | param LONGTEXT, |
| 154 | 155 | status BOOLEAN, |
| 155 | 156 | mode BOOLEAN, |
| 156 | 157 | tag TEXT, |
| 157 | - UNIQUE KEY id (id) | |
| 158 | + php_include int(11) NOT NULL DEFAULT '0', | |
| 159 | + UNIQUE KEY id (id), | |
| 160 | + INDEX id_index (id) | |
| 158 | 161 | "; |
| 162 | + | |
| 163 | + | |
| 159 | 164 | DBManager::create( $columns ); |
| 160 | 165 | FolderManager::create(); |
| 161 | - update_option( self::PREFIX . '_db_version', '3.2' ); | |
| 166 | + update_option( self::PREFIX . '_db_version', '4.0' ); | |
| 162 | 167 | |
| 163 | 168 | include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 164 | 169 | if ( is_plugin_active( 'wp-coder-pro/wp-coder-pro.php' ) ) { |
| 165 | 170 | deactivate_plugins( 'wp-coder-pro/wp-coder-pro.php' ); |
| @@ -166,9 +171,8 @@ | ||
| 166 | 171 | } |
| 167 | 172 | if ( is_plugin_active( 'wpcoderpro/wpcoderpro.php' ) ) { |
| 168 | 173 | deactivate_plugins( 'wpcoderpro/wpcoderpro.php' ); |
| 169 | 174 | } |
| 170 | - | |
| 171 | 175 | } |
| 172 | 176 | |
| 173 | 177 | /** |
| 174 | 178 | * Download the folder with languages. |
| @@ -176,11 +180,12 @@ | ||
| 176 | 180 | * @access Publisher |
| 177 | 181 | * @return void |
| 178 | 182 | */ |
| 179 | 183 | public function loaded(): void { |
| 184 | + new WPCoder_Block(); | |
| 180 | 185 | UpdateDB::init(); |
| 181 | 186 | $languages_folder = dirname( plugin_basename( __FILE__ ) ) . '/languages/'; |
| 182 | - load_plugin_textdomain( 'wpcoder', false, $languages_folder ); | |
| 187 | + load_plugin_textdomain( 'wp-coder', false, $languages_folder ); | |
| 183 | 188 | } |
| 184 | 189 | |
| 185 | 190 | } |
| 186 | 191 | |