| @@ -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: 4.5.1 | |
| 6 | + * Version: 3.1.1 | |
| 7 | 7 | * Author: WPCoder |
| 8 | 8 | * Author URI: https://wpcoder.pro |
| 9 | - * Author Email: hey@wow-company.com | |
| 9 | + * Author Email: dev@wpcoder.pro | |
| 10 | 10 | * License: GPL-2.0+ |
| 11 | 11 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 12 | - * Text Domain: wp-coder | |
| 12 | + * Text Domain: wpcoder | |
| 13 | 13 | * Requires at least: 5.4 |
| 14 | 14 | * Requires PHP: 7.4 |
| 15 | 15 | */ |
| 16 | 16 | |
| @@ -16,9 +16,8 @@ | ||
| 16 | 16 | |
| 17 | 17 | namespace WPCoder; |
| 18 | 18 | |
| 19 | 19 | // Exit if accessed directly. |
| 20 | -use WPCoder\Block\WPCoder_Block; | |
| 21 | 20 | use WPCoder\Dashboard\DBManager; |
| 22 | 21 | use WPCoder\Dashboard\FolderManager; |
| 23 | 22 | use WPCoder\Update\UpdateDB; |
| 24 | 23 | |
| @@ -23,9 +22,9 @@ | ||
| 23 | 22 | use WPCoder\Update\UpdateDB; |
| 24 | 23 | |
| 25 | 24 | defined( 'ABSPATH' ) || exit; |
| 26 | 25 | |
| 27 | -if ( ! class_exists( 'wpcoder' ) ) : | |
| 26 | +if ( ! class_exists( 'WPCoder' ) ) : | |
| 28 | 27 | |
| 29 | 28 | final class WPCoder { |
| 30 | 29 | |
| 31 | 30 | // Plugin slug |
| @@ -60,8 +59,9 @@ | ||
| 60 | 59 | self::$instance->autoloader = new Autoloader( 'WPCoder' ); |
| 61 | 60 | self::$instance->dashboard = new WOWP_Dashboard(); |
| 62 | 61 | self::$instance->public = new WOWP_Public(); |
| 63 | 62 | |
| 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'] ); | |
| 104 | 103 | |
| 105 | 104 | return $plugin_data[ $show ] ?? ''; |
| 105 | + | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /** |
| 109 | 109 | * Include required files. |
| @@ -112,9 +112,8 @@ | ||
| 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'; | |
| 117 | 116 | require_once self::dir() . 'classes/Autoloader.php'; |
| 118 | 117 | require_once self::dir() . 'includes/class-wowp-dashboard.php'; |
| 119 | 118 | require_once self::dir() . 'includes/class-wowp-public.php'; |
| 120 | 119 | } |
| @@ -128,9 +127,9 @@ | ||
| 128 | 127 | * @access protected |
| 129 | 128 | */ |
| 130 | 129 | public function __clone() { |
| 131 | 130 | // Cloning instances of the class is forbidden. |
| 132 | - _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?', 'wp-coder' ), '1.0' ); | |
| 131 | + _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?', 'wpcoder' ), '1.0' ); | |
| 133 | 132 | } |
| 134 | 133 | |
| 135 | 134 | /** |
| 136 | 135 | * Disable unserializing of the class. |
| @@ -139,9 +138,9 @@ | ||
| 139 | 138 | * @access protected |
| 140 | 139 | */ |
| 141 | 140 | public function __wakeup() { |
| 142 | 141 | // Unserializing instances of the class is forbidden. |
| 143 | - _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?', 'wp-coder' ), '1.0' ); | |
| 142 | + _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?', 'wpcoder' ), '1.0' ); | |
| 144 | 143 | } |
| 145 | 144 | |
| 146 | 145 | public function plugin_activate(): void { |
| 147 | 146 | $columns = " |
| @@ -154,17 +153,12 @@ | ||
| 154 | 153 | param LONGTEXT, |
| 155 | 154 | status BOOLEAN, |
| 156 | 155 | mode BOOLEAN, |
| 157 | 156 | tag TEXT, |
| 158 | - php_include int(11) NOT NULL DEFAULT '0', | |
| 159 | - UNIQUE KEY id (id), | |
| 160 | - INDEX id_index (id) | |
| 157 | + UNIQUE KEY id (id) | |
| 161 | 158 | "; |
| 162 | - | |
| 163 | - | |
| 164 | 159 | DBManager::create( $columns ); |
| 165 | 160 | FolderManager::create(); |
| 166 | - update_option( self::PREFIX . '_db_version', '4.0' ); | |
| 167 | 161 | |
| 168 | 162 | include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 169 | 163 | if ( is_plugin_active( 'wp-coder-pro/wp-coder-pro.php' ) ) { |
| 170 | 164 | deactivate_plugins( 'wp-coder-pro/wp-coder-pro.php' ); |
| @@ -171,8 +165,9 @@ | ||
| 171 | 165 | } |
| 172 | 166 | if ( is_plugin_active( 'wpcoderpro/wpcoderpro.php' ) ) { |
| 173 | 167 | deactivate_plugins( 'wpcoderpro/wpcoderpro.php' ); |
| 174 | 168 | } |
| 169 | + | |
| 175 | 170 | } |
| 176 | 171 | |
| 177 | 172 | /** |
| 178 | 173 | * Download the folder with languages. |
| @@ -180,12 +175,11 @@ | ||
| 180 | 175 | * @access Publisher |
| 181 | 176 | * @return void |
| 182 | 177 | */ |
| 183 | 178 | public function loaded(): void { |
| 184 | - new WPCoder_Block(); | |
| 185 | 179 | UpdateDB::init(); |
| 186 | 180 | $languages_folder = dirname( plugin_basename( __FILE__ ) ) . '/languages/'; |
| 187 | - load_plugin_textdomain( 'wp-coder', false, $languages_folder ); | |
| 181 | + load_plugin_textdomain( 'wpcoder', false, $languages_folder ); | |
| 188 | 182 | } |
| 189 | 183 | |
| 190 | 184 | } |
| 191 | 185 | |