| @@ -1,120 +1,116 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * Plugin Name: WP Coder | |
| 4 | - * Plugin URI: https://wordpress.org/plugins/wp-coder/ | |
| 5 | - * Description: Add custom CSS, HTML, JavaScript on your website page | |
| 6 | - * Version: 2.5.3 | |
| 7 | - * Author: Wow-Company | |
| 8 | - * Author URI: https://wow-estore.com/ | |
| 9 | - * License: GPL-2.0+ | |
| 10 | - * License URI: http://www.gnu.org/licenses/gpl-2.0.txt | |
| 11 | - * Text Domain: wpcoder | |
| 12 | - */ | |
| 2 | + /** | |
| 3 | + * Plugin Name: WP Coder | |
| 4 | + * Plugin URI: https://wordpress.org/plugins/wp-coder/ | |
| 5 | + * Description: Add custom CSS, HTML, JavaScript on your website page | |
| 6 | + * Version: 2.3.2 | |
| 7 | + * Author: Wow-Company | |
| 8 | + * Author URI: https://wow-estore.com/ | |
| 9 | + * License: GPL-2.0+ | |
| 10 | + * License URI: http://www.gnu.org/licenses/gpl-2.0.txt | |
| 11 | + * Text Domain: wpcoder | |
| 12 | + */ | |
| 13 | + | |
| 14 | + namespace wpcoder; | |
| 15 | + | |
| 16 | + if ( ! defined( 'ABSPATH' ) ) exit; | |
| 17 | + | |
| 18 | + | |
| 19 | + if( !class_exists( 'Wow_Plugin_Class' ) ) { | |
| 20 | + | |
| 21 | + final class Wow_Plugin_Class { | |
| 22 | + | |
| 23 | + private static $instance; | |
| 24 | + | |
| 25 | + const PREF = 'coder'; | |
| 13 | 26 | |
| 14 | -namespace wpcoder; | |
| 27 | + public static function instance() { | |
| 28 | + | |
| 29 | + if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Wow_Plugin_Class ) ) { | |
| 15 | 30 | |
| 16 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 17 | - exit; | |
| 18 | -} | |
| 19 | - | |
| 20 | - | |
| 21 | -if ( ! class_exists( 'Wow_Plugin_Class' ) ) { | |
| 22 | - | |
| 23 | - final class Wow_Plugin_Class { | |
| 24 | - | |
| 25 | - private static $instance; | |
| 26 | - | |
| 27 | - const PREF = 'coder'; | |
| 28 | - | |
| 29 | - public static function instance() { | |
| 30 | - | |
| 31 | - if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Wow_Plugin_Class ) ) { | |
| 32 | - | |
| 33 | 31 | $info = array( |
| 34 | - 'plugin_name' => 'WP Coder', | |
| 35 | - 'plugin_menu' => 'WP Coder', | |
| 36 | - 'plugin_home_url' => 'https://wordpress.org/plugins/wp-coder/', | |
| 37 | - 'plugin_version' => '2.5.3', | |
| 38 | - 'plugin_file' => basename( __FILE__ ), | |
| 39 | - 'plugin_slug' => dirname( plugin_basename( __FILE__ ) ), | |
| 40 | - 'plugin_dir' => plugin_dir_path( __FILE__ ), | |
| 41 | - 'plugin_url' => plugin_dir_url( __FILE__ ), | |
| 42 | - 'plugin_pref' => self::PREF, | |
| 43 | - 'author_url' => 'https://wow-estore.com', | |
| 44 | - 'pro_url' => 'https://wow-estore.com/item/wp-coder-extension/', | |
| 45 | - 'shortcode' => 'WP-Coder', | |
| 32 | + 'plugin_name' => 'WP Coder', | |
| 33 | + 'plugin_menu' => 'WP Coder', | |
| 34 | + 'plugin_home_url' => 'https://wordpress.org/plugins/wp-coder/', | |
| 35 | + 'plugin_version' => '2.3.2', | |
| 36 | + 'plugin_file' => basename( __FILE__ ), | |
| 37 | + 'plugin_slug' => dirname( plugin_basename( __FILE__ ) ), | |
| 38 | + 'plugin_dir' => plugin_dir_path( __FILE__ ), | |
| 39 | + 'plugin_url' => plugin_dir_url( __FILE__ ), | |
| 40 | + 'plugin_pref' => self::PREF, | |
| 41 | + 'author_url' => 'https://wow-estore.com', | |
| 42 | + 'pro_url' => 'https://wow-estore.com/item/wp-coder-extension/', | |
| 43 | + 'shortcode' => 'WP-Coder', | |
| 46 | 44 | ); |
| 47 | - | |
| 48 | - self::$instance = new Wow_Plugin_Class; | |
| 49 | - | |
| 50 | - register_activation_hook( __FILE__, array( self::$instance, 'plugin_activate' ) ); | |
| 51 | - register_deactivation_hook( __FILE__, array( self::$instance, 'plugin_deactivate' ) ); | |
| 52 | - | |
| 53 | - add_action( 'plugins_loaded', array( self::$instance, 'load_textdomain' ) ); | |
| 54 | - | |
| 55 | - add_action( 'admin_init', array( self::$instance, 'create_field' ) ); | |
| 56 | - | |
| 57 | - self::$instance->includes(); | |
| 58 | - | |
| 59 | - self::$instance->admin = new Wow_Admin_Class( $info ); | |
| 60 | - self::$instance->public = new Wow_Public_Class( $info ); | |
| 61 | - | |
| 62 | - | |
| 45 | + | |
| 46 | + self::$instance = new Wow_Plugin_Class; | |
| 47 | + | |
| 48 | + register_activation_hook( __FILE__, array( self::$instance, 'plugin_activate' ) ); | |
| 49 | + register_deactivation_hook( __FILE__, array( self::$instance, 'plugin_deactivate' ) ); | |
| 50 | + | |
| 51 | + add_action( 'plugins_loaded', array( self::$instance, 'load_textdomain' ) ); | |
| 52 | + | |
| 53 | + add_action('admin_init', array( self::$instance, 'create_field') ); | |
| 54 | + | |
| 55 | + self::$instance->includes(); | |
| 56 | + | |
| 57 | + self::$instance->admin = new Wow_Admin_Class( $info ); | |
| 58 | + self::$instance->public = new Wow_Public_Class( $info ); | |
| 59 | + | |
| 60 | + | |
| 61 | + } | |
| 62 | + return self::$instance; | |
| 63 | + } | |
| 64 | + | |
| 65 | + public function __clone() { | |
| 66 | + // Cloning instances of the class is forbidden. | |
| 67 | + _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'wpcoder' ), '1.0' ); | |
| 63 | 68 | } |
| 64 | - | |
| 65 | - return self::$instance; | |
| 66 | - } | |
| 67 | - | |
| 68 | - public function __clone() { | |
| 69 | - // Cloning instances of the class is forbidden. | |
| 70 | - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'wpcoder' ), '1.0' ); | |
| 71 | - } | |
| 72 | - | |
| 73 | - public function __wakeup() { | |
| 74 | - // Unserializing instances of the class is forbidden. | |
| 75 | - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'wpcoder' ), '1.0' ); | |
| 76 | - } | |
| 77 | - | |
| 78 | - | |
| 79 | - private function includes() { | |
| 80 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-js-packer.php'; | |
| 81 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-db-update.php'; | |
| 82 | - require_once plugin_dir_path( __FILE__ ) . 'admin/class-admin.php'; | |
| 83 | - require_once plugin_dir_path( __FILE__ ) . 'public/class-public.php'; | |
| 84 | - } | |
| 85 | - | |
| 86 | - public function plugin_activate() { | |
| 87 | - $field = dirname( plugin_basename( __FILE__ ) ); | |
| 88 | - require_once plugin_dir_path( __FILE__ ) . 'includes/activator.php'; | |
| 89 | - } | |
| 90 | - | |
| 91 | - public function plugin_deactivate() { | |
| 92 | - require_once plugin_dir_path( __FILE__ ) . 'includes/deactivator.php'; | |
| 93 | - } | |
| 94 | - | |
| 95 | - public function create_field() { | |
| 96 | - if ( get_option( 'wp_coder_create_field' ) === false ) { | |
| 97 | - $upload = wp_upload_dir(); | |
| 98 | - $field = dirname( plugin_basename( __FILE__ ) ); | |
| 99 | - $basedir = $upload['basedir'] . '/' . $field . '/'; | |
| 100 | - if ( ! file_exists( $basedir ) ) { | |
| 101 | - wp_mkdir_p( $basedir ); | |
| 69 | + | |
| 70 | + public function __wakeup() { | |
| 71 | + // Unserializing instances of the class is forbidden. | |
| 72 | + _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'wpcoder' ), '1.0' ); | |
| 73 | + } | |
| 74 | + | |
| 75 | + | |
| 76 | + private function includes() { | |
| 77 | + require_once plugin_dir_path( __FILE__ ) . 'includes/class-js-packer.php'; | |
| 78 | + require_once plugin_dir_path( __FILE__ ) . 'includes/class-db-update.php'; | |
| 79 | + require_once plugin_dir_path( __FILE__ ) . 'admin/class-admin.php'; | |
| 80 | + require_once plugin_dir_path( __FILE__ ) . 'public/class-public.php'; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public function plugin_activate() { | |
| 84 | + $field = dirname( plugin_basename( __FILE__ ) ); | |
| 85 | + require_once plugin_dir_path( __FILE__ ) . 'includes/activator.php'; | |
| 86 | + } | |
| 87 | + public function plugin_deactivate() { | |
| 88 | + require_once plugin_dir_path( __FILE__ ) . 'includes/deactivator.php'; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public function create_field() { | |
| 92 | + if( get_option( 'wp_coder_create_field') === false ) { | |
| 93 | + $upload = wp_upload_dir(); | |
| 94 | + $field = dirname( plugin_basename( __FILE__ ) ); | |
| 95 | + $basedir = $upload['basedir'] . '/' . $field . '/'; | |
| 96 | + if ( !file_exists( $basedir ) ) { | |
| 97 | + wp_mkdir_p( $basedir ); | |
| 98 | + } | |
| 99 | + update_option( 'wp_coder_create_field', '2.0' ); | |
| 102 | 100 | } |
| 103 | - update_option( 'wp_coder_create_field', '2.0' ); | |
| 104 | 101 | } |
| 102 | + | |
| 103 | + public function load_textdomain() { | |
| 104 | + load_plugin_textdomain( self::PREF, FALSE, dirname( plugin_basename(__FILE__) ).'/languages/' ); | |
| 105 | + } | |
| 106 | + | |
| 105 | 107 | } |
| 106 | - | |
| 107 | - public function load_textdomain() { | |
| 108 | - load_plugin_textdomain( self::PREF, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); | |
| 109 | - } | |
| 110 | - | |
| 108 | + | |
| 111 | 109 | } |
| 110 | + | |
| 111 | + function wow_plugin_run() { | |
| 112 | + return Wow_Plugin_Class::instance(); | |
| 113 | + } | |
| 112 | 114 | |
| 113 | -} | |
| 114 | - | |
| 115 | -function wow_plugin_run() { | |
| 116 | - return Wow_Plugin_Class::instance(); | |
| 117 | -} | |
| 118 | - | |
| 119 | -// Get Running. | |
| 120 | -wow_plugin_run(); | |
| 115 | + // Get Running. | |
| 116 | + wow_plugin_run(); | |