| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /* |
| 3 | 3 | Plugin Name: codoc |
| 4 | 4 | Plugin URI: https://plugins.svn.wordpress.org/codoc/ |
| 5 | -Description: A WordPress plugin for monetizing websites by enabling paid articles, subscriptions(memberships), and tipping. | |
| 5 | +Description: plugin for codoc paywall service. | |
| 6 | 6 | Author: codoc.jp |
| 7 | 7 | Author URI: https://codoc.jp |
| 8 | -Version: 0.9.60 | |
| 8 | +Version: 0.1 | |
| 9 | 9 | License: GPLv2 |
| 10 | 10 | License URI: http://www.gnu.org/licenses/gpl-2.0.html |
| 11 | 11 | Text Domain: codoc |
| 12 | 12 | */ |
| @@ -12,28 +12,25 @@ | ||
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | defined( 'ABSPATH' ) || exit; |
| 15 | 15 | |
| 16 | -const CODOC_PLUGIN_VERSION = '0.9.60'; | |
| 17 | -const CODOC_URL = 'https://codoc.jp'; | |
| 18 | -const CODOC_USERCODE_OPTION_NAME = 'codoc_usercode'; | |
| 19 | -const CODOC_AUTHINFO_OPTION_NAME = 'codoc_authinfo';//認証時データ | |
| 20 | -const CODOC_TOKEN_OPTION_NAME = 'codoc_token'; //API用トークン | |
| 21 | -const CODOC_SETTINGS_OPTION_NAME = 'codoc_settings';//その他設定値(JSON) | |
| 22 | -const CODOC_SDK_PATH = '/sdk/js/sdk.v1'; | |
| 23 | -const CODOC_SUPPORT_ENTRYCODE_OPTION_NAME = 'codoc_support_entrycode'; | |
| 16 | +const CODOC_URL = 'https://codoc.jp'; | |
| 17 | +const CODOC_USERCODE_OPTION_NAME = 'codoc_usercode'; | |
| 18 | +const CODOC_SETTINGS_OPTION_NAME = 'codoc_settings'; | |
| 24 | 19 | |
| 25 | -// API側のバリデーションと合わせる文字数上限 (codocブロックが存在する記事にのみ適用) | |
| 26 | -const CODOC_MAX_TITLE_LENGTH = 100; | |
| 27 | -const CODOC_MAX_BODY_FREE_LENGTH = 1000000; | |
| 28 | -const CODOC_MAX_BODY_PAYWALLED_LENGTH = 1000000; | |
| 29 | -const CODOC_MAX_BODY_LENGTH = 1500000; | |
| 30 | -const CODOC_MAX_BINDED_URL_LENGTH = 255; | |
| 31 | - | |
| 32 | 20 | if ( version_compare( PHP_VERSION, '5.4', '<' ) ) |
| 33 | 21 | { |
| 34 | 22 | exit( sprintf( 'The codoc Paywall plugin requires PHP 5.4 or higher. You’re using %s.', PHP_VERSION ) ); |
| 35 | 23 | } |
| 36 | 24 | |
| 37 | -require_once(plugin_dir_path( __FILE__ ) .'class-codoc.php'); | |
| 38 | -// グローバル変数 | |
| 39 | -$_CODOC = new Codoc; | |
| 25 | + | |
| 26 | +require 'class-codoc.php'; | |
| 27 | +$codoc = ( new Codoc )->register(); | |
| 28 | + | |
| 29 | +if ( is_admin() ) { | |
| 30 | + // setting | |
| 31 | + $codoc->add_settings(); | |
| 32 | + // gutenberg | |
| 33 | + require_once 'src/init.php'; | |
| 34 | + // tinymce | |
| 35 | + $codoc->add_mce(); | |
| 36 | +} | |