| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Highlighting Code Block |
| 4 |
Plugin URI: https://wemo.tech/ |
| 5 |
Description: シンタックスハイライト機能を持つコードブロックを簡単に追加できます。新旧エディタ対応。 |
| 6 |
Version: 1.0.4 |
| 7 |
Author: LOOS WEB STUDIO |
| 8 |
Author URI: https://loos-web-studio.com/ |
| 9 |
License: GPL2 |
| 10 |
|
| 11 |
/* Copyright 2018 LOOS WEB STUDIO (email : info@loos-web-studio.com) |
| 12 |
|
| 13 |
This program is free software; you can redistribute it and/or modify |
| 14 |
it under the terms of the GNU General Public License, version 2, as |
| 15 |
published by the Free Software Foundation. |
| 16 |
|
| 17 |
This program is distributed in the hope that it will be useful, |
| 18 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 |
GNU General Public License for more details. |
| 21 |
|
| 22 |
You should have received a copy of the GNU General Public License |
| 23 |
along with this program; if not, write to the Free Software |
| 24 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 25 |
*/ |
| 26 |
|
| 27 |
|
| 28 |
/** |
| 29 |
* Return 403 err if not 'add_filter'. |
| 30 |
*/ |
| 31 |
if ( ! function_exists( 'add_filter' ) ) { |
| 32 |
header( 'Status: 403 Forbidden' ); |
| 33 |
header( 'HTTP/1.1 403 Forbidden' ); |
| 34 |
exit; |
| 35 |
} |
| 36 |
|
| 37 |
|
| 38 |
/** |
| 39 |
* Be disabled ~PHP5.6. |
| 40 |
*/ |
| 41 |
$phpver = phpversion(); |
| 42 |
if ( (double) $phpver < 5.6 ) { |
| 43 |
add_action( 'admin_notices', function() { ?> |
| 44 |
<div class="notice notice-error is-dismissible"> |
| 45 |
<p> |
| 46 |
<b>[ SEO SIMPLE PACK ]</b><br> |
| 47 |
This Plugin is available in PHP since version 5.6 ! <br> (Your PHP is ver. <?php echo phpversion(); ?> ) |
| 48 |
</p> |
| 49 |
</div> <?php |
| 50 |
} ); |
| 51 |
return; |
| 52 |
} |
| 53 |
|
| 54 |
|
| 55 |
/** |
| 56 |
* Defined HCB const. |
| 57 |
*/ |
| 58 |
if ( ! defined( 'LOOS_HCB_VERSION' ) ) { |
| 59 |
define( 'LOOS_HCB_VERSION', '1.0.4' ); |
| 60 |
} |
| 61 |
if ( ! defined( 'LOOS_HCB_FILE' ) ) { |
| 62 |
define( 'LOOS_HCB_FILE', __FILE__ ); |
| 63 |
} |
| 64 |
if ( ! defined( 'LOOS_HCB_PATH' ) ) { |
| 65 |
define( 'LOOS_HCB_PATH', plugin_dir_path( __FILE__ ) ); |
| 66 |
} |
| 67 |
if ( ! defined( 'LOOS_HCB_BASENAME' ) ) { |
| 68 |
define( 'LOOS_HCB_BASENAME', plugin_basename( LOOS_HCB_FILE ) ); |
| 69 |
} |
| 70 |
if ( ! defined( 'LOOS_HCB_URL' ) ) { |
| 71 |
define( 'LOOS_HCB_URL', plugins_url( '', __FILE__ ) ); |
| 72 |
} |
| 73 |
|
| 74 |
|
| 75 |
/** |
| 76 |
* Autoload Class files. |
| 77 |
*/ |
| 78 |
spl_autoload_register( function( $classname ) { |
| 79 |
$file = LOOS_HCB_PATH . 'class/'. mb_strtolower( $classname ) . '.php'; |
| 80 |
if ( file_exists( $file ) ) { |
| 81 |
require $file; |
| 82 |
} |
| 83 |
}); |
| 84 |
|
| 85 |
|
| 86 |
/** |
| 87 |
* Activation hooks. |
| 88 |
*/ |
| 89 |
register_activation_hook( LOOS_HCB_FILE, array('LOOS_HCB_Activation', 'plugin_activate') ); |
| 90 |
register_deactivation_hook( LOOS_HCB_FILE, array('LOOS_HCB_Activation', 'plugin_deactivate') ); |
| 91 |
register_uninstall_hook( LOOS_HCB_FILE, array('LOOS_HCB_Activation', 'plugin_uninstall') ); |
| 92 |
|
| 93 |
|
| 94 |
/** |
| 95 |
* Init |
| 96 |
*/ |
| 97 |
new LOOS_HCB(); |
| 98 |
|