Changeset 3405600
- Timestamp:
- 11/29/2025 04:57:44 AM (3 months ago)
- Location:
- codoc
- Files:
-
- 6 added
- 4 edited
- 60 copied
-
tags/0.9.57 (copied) (copied from codoc/trunk)
-
tags/0.9.57/class-codoc-util.php (copied) (copied from codoc/trunk/class-codoc-util.php)
-
tags/0.9.57/class-codoc.php (copied) (copied from codoc/trunk/class-codoc.php) (1 diff)
-
tags/0.9.57/codoc.php (copied) (copied from codoc/trunk/codoc.php) (2 diffs)
-
tags/0.9.57/css (copied) (copied from codoc/trunk/css)
-
tags/0.9.57/css/codoc-options.css (copied) (copied from codoc/trunk/css/codoc-options.css)
-
tags/0.9.57/dist (copied) (copied from codoc/trunk/dist)
-
tags/0.9.57/dist/blocks.build.js (copied) (copied from codoc/trunk/dist/blocks.build.js)
-
tags/0.9.57/dist/blocks.editor.build.css (copied) (copied from codoc/trunk/dist/blocks.editor.build.css)
-
tags/0.9.57/dist/blocks.style.build.css (copied) (copied from codoc/trunk/dist/blocks.style.build.css)
-
tags/0.9.57/languages (copied) (copied from codoc/trunk/languages)
-
tags/0.9.57/languages/codoc-ja-codoc-block-js.json (copied) (copied from codoc/trunk/languages/codoc-ja-codoc-block-js.json)
-
tags/0.9.57/languages/codoc-ja.mo (copied) (copied from codoc/trunk/languages/codoc-ja.mo)
-
tags/0.9.57/languages/codoc-ja.po (copied) (copied from codoc/trunk/languages/codoc-ja.po)
-
tags/0.9.57/languages/codoc.pot (copied) (copied from codoc/trunk/languages/codoc.pot)
-
tags/0.9.57/package.json (copied) (copied from codoc/trunk/package.json)
-
tags/0.9.57/readme.txt (copied) (copied from codoc/trunk/readme.txt) (6 diffs)
-
tags/0.9.57/src (copied) (copied from codoc/trunk/src)
-
tags/0.9.57/src/block/block.js (copied) (copied from codoc/trunk/src/block/block.js)
-
tags/0.9.57/src/block/editor.scss (copied) (copied from codoc/trunk/src/block/editor.scss)
-
tags/0.9.57/src/block/icon.js (copied) (copied from codoc/trunk/src/block/icon.js)
-
tags/0.9.57/src/init.php (copied) (copied from codoc/trunk/src/init.php) (4 diffs)
-
tags/0.9.57/src_mce (copied) (copied from codoc/trunk/src_mce)
-
tags/0.9.57/src_mce/codoc-admin.css (copied) (copied from codoc/trunk/src_mce/codoc-admin.css)
-
tags/0.9.57/src_mce/codoc-editor-onload.js (copied) (copied from codoc/trunk/src_mce/codoc-editor-onload.js)
-
tags/0.9.57/src_mce/codoc-editor.js (copied) (copied from codoc/trunk/src_mce/codoc-editor.js)
-
tags/0.9.57/src_mce/more.png (copied) (copied from codoc/trunk/src_mce/more.png)
-
tags/0.9.57/src_mce/v_black.svg (copied) (copied from codoc/trunk/src_mce/v_black.svg)
-
tags/0.9.57/trunk (copied) (copied from codoc/trunk)
-
tags/0.9.57/trunk/class-codoc-util.php (copied) (copied from codoc/trunk/class-codoc-util.php)
-
tags/0.9.57/trunk/class-codoc.php (copied) (copied from codoc/trunk/class-codoc.php) (1 diff)
-
tags/0.9.57/trunk/codoc.php (copied) (copied from codoc/trunk/codoc.php) (2 diffs)
-
tags/0.9.57/trunk/css (copied) (copied from codoc/trunk/css)
-
tags/0.9.57/trunk/css/codoc-options.css (copied) (copied from codoc/trunk/css/codoc-options.css)
-
tags/0.9.57/trunk/dist (copied) (copied from codoc/trunk/dist)
-
tags/0.9.57/trunk/dist/blocks.build.js (copied) (copied from codoc/trunk/dist/blocks.build.js)
-
tags/0.9.57/trunk/dist/blocks.editor.build.css (copied) (copied from codoc/trunk/dist/blocks.editor.build.css)
-
tags/0.9.57/trunk/dist/blocks.style.build.css (copied) (copied from codoc/trunk/dist/blocks.style.build.css)
-
tags/0.9.57/trunk/languages (copied) (copied from codoc/trunk/languages)
-
tags/0.9.57/trunk/languages/codoc-ja-codoc-block-js.json (copied) (copied from codoc/trunk/languages/codoc-ja-codoc-block-js.json)
-
tags/0.9.57/trunk/languages/codoc-ja.mo (copied) (copied from codoc/trunk/languages/codoc-ja.mo)
-
tags/0.9.57/trunk/languages/codoc-ja.po (copied) (copied from codoc/trunk/languages/codoc-ja.po)
-
tags/0.9.57/trunk/languages/codoc.pot (copied) (copied from codoc/trunk/languages/codoc.pot)
-
tags/0.9.57/trunk/package.json (copied) (copied from codoc/trunk/package.json)
-
tags/0.9.57/trunk/readme.txt (copied) (copied from codoc/trunk/readme.txt) (6 diffs)
-
tags/0.9.57/trunk/src (copied) (copied from codoc/trunk/src)
-
tags/0.9.57/trunk/src/block/block.js (copied) (copied from codoc/trunk/src/block/block.js)
-
tags/0.9.57/trunk/src/block/editor.scss (copied) (copied from codoc/trunk/src/block/editor.scss)
-
tags/0.9.57/trunk/src/block/icon.js (copied) (copied from codoc/trunk/src/block/icon.js)
-
tags/0.9.57/trunk/src/init.php (copied) (copied from codoc/trunk/src/init.php) (4 diffs)
-
tags/0.9.57/trunk/src/node-sass-compat (added)
-
tags/0.9.57/trunk/src/node-sass-compat/index.js (added)
-
tags/0.9.57/trunk/src/node-sass-compat/package.json (added)
-
tags/0.9.57/trunk/src_mce (copied) (copied from codoc/trunk/src_mce)
-
tags/0.9.57/trunk/src_mce/codoc-admin.css (copied) (copied from codoc/trunk/src_mce/codoc-admin.css)
-
tags/0.9.57/trunk/src_mce/codoc-editor-onload.js (copied) (copied from codoc/trunk/src_mce/codoc-editor-onload.js)
-
tags/0.9.57/trunk/src_mce/codoc-editor.js (copied) (copied from codoc/trunk/src_mce/codoc-editor.js)
-
tags/0.9.57/trunk/src_mce/more.png (copied) (copied from codoc/trunk/src_mce/more.png)
-
tags/0.9.57/trunk/src_mce/v_black.svg (copied) (copied from codoc/trunk/src_mce/v_black.svg)
-
tags/0.9.57/trunk/views (copied) (copied from codoc/trunk/views)
-
tags/0.9.57/trunk/views/codoc-injector.php (copied) (copied from codoc/trunk/views/codoc-injector.php)
-
tags/0.9.57/views (copied) (copied from codoc/trunk/views)
-
tags/0.9.57/views/codoc-injector.php (copied) (copied from codoc/trunk/views/codoc-injector.php)
-
trunk/class-codoc.php (modified) (1 diff)
-
trunk/codoc.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (6 diffs)
-
trunk/src/init.php (modified) (4 diffs)
-
trunk/src/node-sass-compat (added)
-
trunk/src/node-sass-compat/index.js (added)
-
trunk/src/node-sass-compat/package.json (added)
Legend:
- Unmodified
- Added
- Removed
-
codoc/tags/0.9.57/class-codoc.php
r3404641 r3405600 50 50 // Gutenberg のサポートがない場合は何もしない 51 51 if ( function_exists( 'register_block_type' ) ) { 52 // WPに登録ブロックとして認識させる(cgbは登録しないっぽい) 53 \WP_Block_Type_Registry::get_instance()->register('codoc/codoc-block'); 54 // gutenberg 52 // gutenberg - init.php handles all block registration and script enqueuing 55 53 require_once 'src/init.php'; 56 add_action('wp_loaded', function() {57 $auth_info = get_option(CODOC_AUTHINFO_OPTION_NAME);58 wp_localize_script('codoc-block-js', 'OPTIONS', array(59 'codoc_url' => $this->get_codoc_url(),60 'codoc_usercode' => get_option(CODOC_USERCODE_OPTION_NAME),61 'codoc_plugin_version' => CODOC_PLUGIN_VERSION,62 'codoc_sdk_path' => CODOC_SDK_PATH,63 'codoc_account_is_pro' => isset($auth_info['account_is_pro']) ? $auth_info['account_is_pro'] : 0,64 'codoc_currency_code' => isset($auth_info['currency_code']) ? $auth_info['currency_code'] : 'yen',65 'codoc_currency_decimal_places' => isset($auth_info['currency_decimal_places']) ? $auth_info['currency_decimal_places'] : 0,66 ));67 wp_set_script_translations('codoc-block-js', 'codoc',plugin_dir_path( __FILE__ ) . 'languages');68 });69 54 } 70 55 // tinymce -
codoc/tags/0.9.57/codoc.php
r3405195 r3405600 6 6 Author: codoc.jp 7 7 Author URI: https://codoc.jp 8 Version: 0.9.5 6.58 Version: 0.9.57 9 9 License: GPLv2 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 14 14 defined( 'ABSPATH' ) || exit; 15 15 16 const CODOC_PLUGIN_VERSION = '0.9.5 6.5';16 const CODOC_PLUGIN_VERSION = '0.9.57'; 17 17 const CODOC_URL = 'https://codoc.jp'; 18 18 const CODOC_USERCODE_OPTION_NAME = 'codoc_usercode'; -
codoc/tags/0.9.57/readme.txt
r3405195 r3405600 5 5 Requires at least: 4.6 6 6 Tested up to: 6.8.2 7 Stable tag: 0.9.5 6.57 Stable tag: 0.9.57 8 8 Requires PHP: 5.4 9 9 License: GPLv2 or later … … 14 14 == Description == 15 15 16 [codoc](https://codoc.jp) is a simple and powerful WordPress paywall plugin that enables creators to sell paid articles, offer **Reader Plans (Subscription / Membership)**, and accept tips.16 [codoc](https://codoc.jp) is a simple and powerful WordPress paywall plugin that enables creators to sell paid articles, offer Reader Plans (Subscription / Membership), and accept tips. 17 17 18 18 Originally built for Japanese creators, codoc is also fully compatible with users in the US/EU. 19 Payment is processed via Stripe, and buyers worldwide can purchase using a valid credit card (currency: USD/EUR).20 21 After setup, the plugin adds a **codoc block※**to the post editor.19 Payment is processed via Stripe, and buyers worldwide can purchase using a valid credit card (currency: JPY/USD/EUR). 20 21 After setup, the plugin adds a codoc block※ to the post editor. 22 22 ※Compatible with both Gutenberg and the Classic Editor (TinyMCE). 23 23 … … 42 42 - Article paywall 43 43 - One-time purchases 44 - **Reader Plans (Subscription / Membership)**44 - Reader Plans (Subscription / Membership) 45 45 - Tipping support 46 46 - Stripe payments (Credit card / Apple Pay / Google Pay / BNPL) … … 67 67 68 68 = What are the requirements for creators to use codoc? = 69 Creators must have a residence and bank account in **Japan or the United States**.70 71 = Can users outside Japanpurchase content? =69 Creators must reside in **Japan, the United States, or the EU** and have a bank account in each country. 70 71 = Can users outside Supported coutry purchase content? = 72 72 Yes. Anyone with a valid credit card can purchase. 73 Transactions are processed in **JPY **.73 Transactions are processed in **JPY, USD or EUR** . 74 74 75 75 = Where are article contents stored? = … … 85 85 86 86 = How can I preview the article as buyers/non-buyers? = 87 - As buyer: Click **" Already purchased, log in"** and authenticate with your codoc account.87 - As buyer: Click **"Sign in to restore purchase"** and authenticate with your codoc account. 88 88 - As non-buyer: Log out and view the article normally. 89 89 … … 120 120 = Do script tags work? = 121 121 Yes. 122 External script tags have been supported since April 22, 2020(Twitter/Instagram embeds, etc.)122 External script tags have been supported. (Twitter/Instagram embeds, etc.) 123 123 124 124 = I want to add buttons at the end of the article = -
codoc/tags/0.9.57/src/init.php
r2923260 r3405600 15 15 16 16 /** 17 * Enqueue Gutenberg block assets for both frontend + backend. 18 * 19 * Assets enqueued: 20 * 1. blocks.style.build.css - Frontend + Backend. 21 * 2. blocks.build.js - Backend. 22 * 3. blocks.editor.build.css - Backend. 17 * Enqueue Gutenberg block assets for backend editor. 23 18 * 24 19 * @uses {wp-blocks} for block type registration & related functions. … … 28 23 * @since 1.0.0 29 24 */ 30 function wordpress_cgb_block_assets() { // phpcs:ignore 31 // Register block styles for both frontend + backend. 32 wp_register_style( 33 'codoc-style-css', // Handle. 34 plugins_url( 'dist/blocks.style.build.css?ver=' . CODOC_PLUGIN_VERSION, dirname( __FILE__ ) ), // Block style CSS. 35 array( 'wp-editor' ), // Dependency to include the CSS after it. 36 null // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time. 37 ); 38 39 // Register block editor script for backend. 40 wp_register_script( 25 function wordpress_cgb_block_editor_assets() { // phpcs:ignore 26 // Scripts and styles for editor only 27 wp_enqueue_script( 41 28 'codoc-block-js', // Handle. 42 29 plugins_url( '/dist/blocks.build.js?ver=' . CODOC_PLUGIN_VERSION, dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. … … 45 32 true // Enqueue the script in the footer. 46 33 ); 47 48 // Register block editor styles for backend. 49 wp_register_style( 34 35 // Pass necessary options to JavaScript 36 global $_CODOC; 37 $auth_info = get_option(CODOC_AUTHINFO_OPTION_NAME); 38 39 wp_localize_script('codoc-block-js', 'OPTIONS', array( 40 'codoc_url' => $_CODOC->get_codoc_url(), 41 'codoc_usercode' => get_option(CODOC_USERCODE_OPTION_NAME), 42 'codoc_plugin_version' => CODOC_PLUGIN_VERSION, 43 'codoc_sdk_path' => defined('CODOC_SDK_PATH') ? CODOC_SDK_PATH : '/sdk/js/sdk.v1.js', 44 'codoc_account_is_pro' => isset($auth_info['account_is_pro']) ? $auth_info['account_is_pro'] : 0, 45 'codoc_currency_code' => isset($auth_info['currency_code']) ? $auth_info['currency_code'] : 'yen', 46 'codoc_currency_decimal_places' => isset($auth_info['currency_decimal_places']) ? $auth_info['currency_decimal_places'] : 0, 47 )); 48 49 // Set script translations 50 wp_set_script_translations('codoc-block-js', 'codoc', plugin_dir_path( dirname(__FILE__) ) . 'languages'); 51 52 // Styles for editor only 53 wp_enqueue_style( 50 54 'codoc-block-editor-css', // Handle. 51 55 plugins_url( 'dist/blocks.editor.build.css?ver=' . CODOC_PLUGIN_VERSION, dirname( __FILE__ ) ), // Block editor CSS. … … 53 57 null // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. 54 58 ); 59 } 55 60 56 /** 57 * Register Gutenberg block on server-side. 58 * 59 * Register the block on server-side to ensure that the block 60 * scripts and styles for both frontend and backend are 61 * enqueued when the editor loads. 62 * 63 * @link https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type#enqueuing-block-scripts 64 * @since 1.16.0 65 */ 66 register_block_type( 67 'cgb/block-wordpress', array( 68 // Enqueue blocks.style.build.css on both frontend & backend. 69 'style' => 'codoc-style-css', 70 // Enqueue blocks.build.js in the editor only. 71 'editor_script' => 'codoc-block-js', 72 // Enqueue blocks.editor.build.css in the editor only. 73 'editor_style' => 'codoc-block-editor-css', 74 ) 61 // Hook: Editor assets. 62 add_action( 'enqueue_block_editor_assets', 'wordpress_cgb_block_editor_assets' ); 63 64 /** 65 * Enqueue Gutenberg block assets for frontend. 66 * 67 * @since 1.0.0 68 */ 69 function wordpress_cgb_block_frontend_assets() { // phpcs:ignore 70 // Styles for frontend 71 wp_enqueue_style( 72 'codoc-style-css', // Handle. 73 plugins_url( 'dist/blocks.style.build.css?ver=' . CODOC_PLUGIN_VERSION, dirname( __FILE__ ) ), // Block style CSS. 74 array( 'wp-editor' ), // Dependency to include the CSS after it. 75 null // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time. 75 76 ); 76 77 } 77 78 78 // Hook: Blockassets.79 add_action( ' init', 'wordpress_cgb_block_assets' );79 // Hook: Frontend assets. 80 add_action( 'enqueue_block_assets', 'wordpress_cgb_block_frontend_assets' ); -
codoc/tags/0.9.57/trunk/class-codoc.php
r3404641 r3405600 50 50 // Gutenberg のサポートがない場合は何もしない 51 51 if ( function_exists( 'register_block_type' ) ) { 52 // WPに登録ブロックとして認識させる(cgbは登録しないっぽい) 53 \WP_Block_Type_Registry::get_instance()->register('codoc/codoc-block'); 54 // gutenberg 52 // gutenberg - init.php handles all block registration and script enqueuing 55 53 require_once 'src/init.php'; 56 add_action('wp_loaded', function() {57 $auth_info = get_option(CODOC_AUTHINFO_OPTION_NAME);58 wp_localize_script('codoc-block-js', 'OPTIONS', array(59 'codoc_url' => $this->get_codoc_url(),60 'codoc_usercode' => get_option(CODOC_USERCODE_OPTION_NAME),61 'codoc_plugin_version' => CODOC_PLUGIN_VERSION,62 'codoc_sdk_path' => CODOC_SDK_PATH,63 'codoc_account_is_pro' => isset($auth_info['account_is_pro']) ? $auth_info['account_is_pro'] : 0,64 'codoc_currency_code' => isset($auth_info['currency_code']) ? $auth_info['currency_code'] : 'yen',65 'codoc_currency_decimal_places' => isset($auth_info['currency_decimal_places']) ? $auth_info['currency_decimal_places'] : 0,66 ));67 wp_set_script_translations('codoc-block-js', 'codoc',plugin_dir_path( __FILE__ ) . 'languages');68 });69 54 } 70 55 // tinymce -
codoc/tags/0.9.57/trunk/codoc.php
r3405195 r3405600 6 6 Author: codoc.jp 7 7 Author URI: https://codoc.jp 8 Version: 0.9.5 6.58 Version: 0.9.57 9 9 License: GPLv2 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 14 14 defined( 'ABSPATH' ) || exit; 15 15 16 const CODOC_PLUGIN_VERSION = '0.9.5 6.5';16 const CODOC_PLUGIN_VERSION = '0.9.57'; 17 17 const CODOC_URL = 'https://codoc.jp'; 18 18 const CODOC_USERCODE_OPTION_NAME = 'codoc_usercode'; -
codoc/tags/0.9.57/trunk/readme.txt
r3405195 r3405600 5 5 Requires at least: 4.6 6 6 Tested up to: 6.8.2 7 Stable tag: 0.9.5 6.57 Stable tag: 0.9.57 8 8 Requires PHP: 5.4 9 9 License: GPLv2 or later … … 14 14 == Description == 15 15 16 [codoc](https://codoc.jp) is a simple and powerful WordPress paywall plugin that enables creators to sell paid articles, offer **Reader Plans (Subscription / Membership)**, and accept tips.16 [codoc](https://codoc.jp) is a simple and powerful WordPress paywall plugin that enables creators to sell paid articles, offer Reader Plans (Subscription / Membership), and accept tips. 17 17 18 18 Originally built for Japanese creators, codoc is also fully compatible with users in the US/EU. 19 Payment is processed via Stripe, and buyers worldwide can purchase using a valid credit card (currency: USD/EUR).20 21 After setup, the plugin adds a **codoc block※**to the post editor.19 Payment is processed via Stripe, and buyers worldwide can purchase using a valid credit card (currency: JPY/USD/EUR). 20 21 After setup, the plugin adds a codoc block※ to the post editor. 22 22 ※Compatible with both Gutenberg and the Classic Editor (TinyMCE). 23 23 … … 42 42 - Article paywall 43 43 - One-time purchases 44 - **Reader Plans (Subscription / Membership)**44 - Reader Plans (Subscription / Membership) 45 45 - Tipping support 46 46 - Stripe payments (Credit card / Apple Pay / Google Pay / BNPL) … … 67 67 68 68 = What are the requirements for creators to use codoc? = 69 Creators must have a residence and bank account in **Japan or the United States**.70 71 = Can users outside Japanpurchase content? =69 Creators must reside in **Japan, the United States, or the EU** and have a bank account in each country. 70 71 = Can users outside Supported coutry purchase content? = 72 72 Yes. Anyone with a valid credit card can purchase. 73 Transactions are processed in **JPY **.73 Transactions are processed in **JPY, USD or EUR** . 74 74 75 75 = Where are article contents stored? = … … 85 85 86 86 = How can I preview the article as buyers/non-buyers? = 87 - As buyer: Click **" Already purchased, log in"** and authenticate with your codoc account.87 - As buyer: Click **"Sign in to restore purchase"** and authenticate with your codoc account. 88 88 - As non-buyer: Log out and view the article normally. 89 89 … … 120 120 = Do script tags work? = 121 121 Yes. 122 External script tags have been supported since April 22, 2020(Twitter/Instagram embeds, etc.)122 External script tags have been supported. (Twitter/Instagram embeds, etc.) 123 123 124 124 = I want to add buttons at the end of the article = -
codoc/tags/0.9.57/trunk/src/init.php
r2923260 r3405600 15 15 16 16 /** 17 * Enqueue Gutenberg block assets for both frontend + backend. 18 * 19 * Assets enqueued: 20 * 1. blocks.style.build.css - Frontend + Backend. 21 * 2. blocks.build.js - Backend. 22 * 3. blocks.editor.build.css - Backend. 17 * Enqueue Gutenberg block assets for backend editor. 23 18 * 24 19 * @uses {wp-blocks} for block type registration & related functions. … … 28 23 * @since 1.0.0 29 24 */ 30 function wordpress_cgb_block_assets() { // phpcs:ignore 31 // Register block styles for both frontend + backend. 32 wp_register_style( 33 'codoc-style-css', // Handle. 34 plugins_url( 'dist/blocks.style.build.css?ver=' . CODOC_PLUGIN_VERSION, dirname( __FILE__ ) ), // Block style CSS. 35 array( 'wp-editor' ), // Dependency to include the CSS after it. 36 null // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time. 37 ); 38 39 // Register block editor script for backend. 40 wp_register_script( 25 function wordpress_cgb_block_editor_assets() { // phpcs:ignore 26 // Scripts and styles for editor only 27 wp_enqueue_script( 41 28 'codoc-block-js', // Handle. 42 29 plugins_url( '/dist/blocks.build.js?ver=' . CODOC_PLUGIN_VERSION, dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. … … 45 32 true // Enqueue the script in the footer. 46 33 ); 47 48 // Register block editor styles for backend. 49 wp_register_style( 34 35 // Pass necessary options to JavaScript 36 global $_CODOC; 37 $auth_info = get_option(CODOC_AUTHINFO_OPTION_NAME); 38 39 wp_localize_script('codoc-block-js', 'OPTIONS', array( 40 'codoc_url' => $_CODOC->get_codoc_url(), 41 'codoc_usercode' => get_option(CODOC_USERCODE_OPTION_NAME), 42 'codoc_plugin_version' => CODOC_PLUGIN_VERSION, 43 'codoc_sdk_path' => defined('CODOC_SDK_PATH') ? CODOC_SDK_PATH : '/sdk/js/sdk.v1.js', 44 'codoc_account_is_pro' => isset($auth_info['account_is_pro']) ? $auth_info['account_is_pro'] : 0, 45 'codoc_currency_code' => isset($auth_info['currency_code']) ? $auth_info['currency_code'] : 'yen', 46 'codoc_currency_decimal_places' => isset($auth_info['currency_decimal_places']) ? $auth_info['currency_decimal_places'] : 0, 47 )); 48 49 // Set script translations 50 wp_set_script_translations('codoc-block-js', 'codoc', plugin_dir_path( dirname(__FILE__) ) . 'languages'); 51 52 // Styles for editor only 53 wp_enqueue_style( 50 54 'codoc-block-editor-css', // Handle. 51 55 plugins_url( 'dist/blocks.editor.build.css?ver=' . CODOC_PLUGIN_VERSION, dirname( __FILE__ ) ), // Block editor CSS. … … 53 57 null // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. 54 58 ); 59 } 55 60 56 /** 57 * Register Gutenberg block on server-side. 58 * 59 * Register the block on server-side to ensure that the block 60 * scripts and styles for both frontend and backend are 61 * enqueued when the editor loads. 62 * 63 * @link https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type#enqueuing-block-scripts 64 * @since 1.16.0 65 */ 66 register_block_type( 67 'cgb/block-wordpress', array( 68 // Enqueue blocks.style.build.css on both frontend & backend. 69 'style' => 'codoc-style-css', 70 // Enqueue blocks.build.js in the editor only. 71 'editor_script' => 'codoc-block-js', 72 // Enqueue blocks.editor.build.css in the editor only. 73 'editor_style' => 'codoc-block-editor-css', 74 ) 61 // Hook: Editor assets. 62 add_action( 'enqueue_block_editor_assets', 'wordpress_cgb_block_editor_assets' ); 63 64 /** 65 * Enqueue Gutenberg block assets for frontend. 66 * 67 * @since 1.0.0 68 */ 69 function wordpress_cgb_block_frontend_assets() { // phpcs:ignore 70 // Styles for frontend 71 wp_enqueue_style( 72 'codoc-style-css', // Handle. 73 plugins_url( 'dist/blocks.style.build.css?ver=' . CODOC_PLUGIN_VERSION, dirname( __FILE__ ) ), // Block style CSS. 74 array( 'wp-editor' ), // Dependency to include the CSS after it. 75 null // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time. 75 76 ); 76 77 } 77 78 78 // Hook: Blockassets.79 add_action( ' init', 'wordpress_cgb_block_assets' );79 // Hook: Frontend assets. 80 add_action( 'enqueue_block_assets', 'wordpress_cgb_block_frontend_assets' ); -
codoc/trunk/class-codoc.php
r3404641 r3405600 50 50 // Gutenberg のサポートがない場合は何もしない 51 51 if ( function_exists( 'register_block_type' ) ) { 52 // WPに登録ブロックとして認識させる(cgbは登録しないっぽい) 53 \WP_Block_Type_Registry::get_instance()->register('codoc/codoc-block'); 54 // gutenberg 52 // gutenberg - init.php handles all block registration and script enqueuing 55 53 require_once 'src/init.php'; 56 add_action('wp_loaded', function() {57 $auth_info = get_option(CODOC_AUTHINFO_OPTION_NAME);58 wp_localize_script('codoc-block-js', 'OPTIONS', array(59 'codoc_url' => $this->get_codoc_url(),60 'codoc_usercode' => get_option(CODOC_USERCODE_OPTION_NAME),61 'codoc_plugin_version' => CODOC_PLUGIN_VERSION,62 'codoc_sdk_path' => CODOC_SDK_PATH,63 'codoc_account_is_pro' => isset($auth_info['account_is_pro']) ? $auth_info['account_is_pro'] : 0,64 'codoc_currency_code' => isset($auth_info['currency_code']) ? $auth_info['currency_code'] : 'yen',65 'codoc_currency_decimal_places' => isset($auth_info['currency_decimal_places']) ? $auth_info['currency_decimal_places'] : 0,66 ));67 wp_set_script_translations('codoc-block-js', 'codoc',plugin_dir_path( __FILE__ ) . 'languages');68 });69 54 } 70 55 // tinymce -
codoc/trunk/codoc.php
r3405195 r3405600 6 6 Author: codoc.jp 7 7 Author URI: https://codoc.jp 8 Version: 0.9.5 6.58 Version: 0.9.57 9 9 License: GPLv2 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 14 14 defined( 'ABSPATH' ) || exit; 15 15 16 const CODOC_PLUGIN_VERSION = '0.9.5 6.5';16 const CODOC_PLUGIN_VERSION = '0.9.57'; 17 17 const CODOC_URL = 'https://codoc.jp'; 18 18 const CODOC_USERCODE_OPTION_NAME = 'codoc_usercode'; -
codoc/trunk/readme.txt
r3405195 r3405600 5 5 Requires at least: 4.6 6 6 Tested up to: 6.8.2 7 Stable tag: 0.9.5 6.57 Stable tag: 0.9.57 8 8 Requires PHP: 5.4 9 9 License: GPLv2 or later … … 14 14 == Description == 15 15 16 [codoc](https://codoc.jp) is a simple and powerful WordPress paywall plugin that enables creators to sell paid articles, offer **Reader Plans (Subscription / Membership)**, and accept tips.16 [codoc](https://codoc.jp) is a simple and powerful WordPress paywall plugin that enables creators to sell paid articles, offer Reader Plans (Subscription / Membership), and accept tips. 17 17 18 18 Originally built for Japanese creators, codoc is also fully compatible with users in the US/EU. 19 Payment is processed via Stripe, and buyers worldwide can purchase using a valid credit card (currency: USD/EUR).20 21 After setup, the plugin adds a **codoc block※**to the post editor.19 Payment is processed via Stripe, and buyers worldwide can purchase using a valid credit card (currency: JPY/USD/EUR). 20 21 After setup, the plugin adds a codoc block※ to the post editor. 22 22 ※Compatible with both Gutenberg and the Classic Editor (TinyMCE). 23 23 … … 42 42 - Article paywall 43 43 - One-time purchases 44 - **Reader Plans (Subscription / Membership)**44 - Reader Plans (Subscription / Membership) 45 45 - Tipping support 46 46 - Stripe payments (Credit card / Apple Pay / Google Pay / BNPL) … … 67 67 68 68 = What are the requirements for creators to use codoc? = 69 Creators must have a residence and bank account in **Japan or the United States**.70 71 = Can users outside Japanpurchase content? =69 Creators must reside in **Japan, the United States, or the EU** and have a bank account in each country. 70 71 = Can users outside Supported coutry purchase content? = 72 72 Yes. Anyone with a valid credit card can purchase. 73 Transactions are processed in **JPY **.73 Transactions are processed in **JPY, USD or EUR** . 74 74 75 75 = Where are article contents stored? = … … 85 85 86 86 = How can I preview the article as buyers/non-buyers? = 87 - As buyer: Click **" Already purchased, log in"** and authenticate with your codoc account.87 - As buyer: Click **"Sign in to restore purchase"** and authenticate with your codoc account. 88 88 - As non-buyer: Log out and view the article normally. 89 89 … … 120 120 = Do script tags work? = 121 121 Yes. 122 External script tags have been supported since April 22, 2020(Twitter/Instagram embeds, etc.)122 External script tags have been supported. (Twitter/Instagram embeds, etc.) 123 123 124 124 = I want to add buttons at the end of the article = -
codoc/trunk/src/init.php
r2923260 r3405600 15 15 16 16 /** 17 * Enqueue Gutenberg block assets for both frontend + backend. 18 * 19 * Assets enqueued: 20 * 1. blocks.style.build.css - Frontend + Backend. 21 * 2. blocks.build.js - Backend. 22 * 3. blocks.editor.build.css - Backend. 17 * Enqueue Gutenberg block assets for backend editor. 23 18 * 24 19 * @uses {wp-blocks} for block type registration & related functions. … … 28 23 * @since 1.0.0 29 24 */ 30 function wordpress_cgb_block_assets() { // phpcs:ignore 31 // Register block styles for both frontend + backend. 32 wp_register_style( 33 'codoc-style-css', // Handle. 34 plugins_url( 'dist/blocks.style.build.css?ver=' . CODOC_PLUGIN_VERSION, dirname( __FILE__ ) ), // Block style CSS. 35 array( 'wp-editor' ), // Dependency to include the CSS after it. 36 null // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time. 37 ); 38 39 // Register block editor script for backend. 40 wp_register_script( 25 function wordpress_cgb_block_editor_assets() { // phpcs:ignore 26 // Scripts and styles for editor only 27 wp_enqueue_script( 41 28 'codoc-block-js', // Handle. 42 29 plugins_url( '/dist/blocks.build.js?ver=' . CODOC_PLUGIN_VERSION, dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. … … 45 32 true // Enqueue the script in the footer. 46 33 ); 47 48 // Register block editor styles for backend. 49 wp_register_style( 34 35 // Pass necessary options to JavaScript 36 global $_CODOC; 37 $auth_info = get_option(CODOC_AUTHINFO_OPTION_NAME); 38 39 wp_localize_script('codoc-block-js', 'OPTIONS', array( 40 'codoc_url' => $_CODOC->get_codoc_url(), 41 'codoc_usercode' => get_option(CODOC_USERCODE_OPTION_NAME), 42 'codoc_plugin_version' => CODOC_PLUGIN_VERSION, 43 'codoc_sdk_path' => defined('CODOC_SDK_PATH') ? CODOC_SDK_PATH : '/sdk/js/sdk.v1.js', 44 'codoc_account_is_pro' => isset($auth_info['account_is_pro']) ? $auth_info['account_is_pro'] : 0, 45 'codoc_currency_code' => isset($auth_info['currency_code']) ? $auth_info['currency_code'] : 'yen', 46 'codoc_currency_decimal_places' => isset($auth_info['currency_decimal_places']) ? $auth_info['currency_decimal_places'] : 0, 47 )); 48 49 // Set script translations 50 wp_set_script_translations('codoc-block-js', 'codoc', plugin_dir_path( dirname(__FILE__) ) . 'languages'); 51 52 // Styles for editor only 53 wp_enqueue_style( 50 54 'codoc-block-editor-css', // Handle. 51 55 plugins_url( 'dist/blocks.editor.build.css?ver=' . CODOC_PLUGIN_VERSION, dirname( __FILE__ ) ), // Block editor CSS. … … 53 57 null // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. 54 58 ); 59 } 55 60 56 /** 57 * Register Gutenberg block on server-side. 58 * 59 * Register the block on server-side to ensure that the block 60 * scripts and styles for both frontend and backend are 61 * enqueued when the editor loads. 62 * 63 * @link https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type#enqueuing-block-scripts 64 * @since 1.16.0 65 */ 66 register_block_type( 67 'cgb/block-wordpress', array( 68 // Enqueue blocks.style.build.css on both frontend & backend. 69 'style' => 'codoc-style-css', 70 // Enqueue blocks.build.js in the editor only. 71 'editor_script' => 'codoc-block-js', 72 // Enqueue blocks.editor.build.css in the editor only. 73 'editor_style' => 'codoc-block-editor-css', 74 ) 61 // Hook: Editor assets. 62 add_action( 'enqueue_block_editor_assets', 'wordpress_cgb_block_editor_assets' ); 63 64 /** 65 * Enqueue Gutenberg block assets for frontend. 66 * 67 * @since 1.0.0 68 */ 69 function wordpress_cgb_block_frontend_assets() { // phpcs:ignore 70 // Styles for frontend 71 wp_enqueue_style( 72 'codoc-style-css', // Handle. 73 plugins_url( 'dist/blocks.style.build.css?ver=' . CODOC_PLUGIN_VERSION, dirname( __FILE__ ) ), // Block style CSS. 74 array( 'wp-editor' ), // Dependency to include the CSS after it. 75 null // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time. 75 76 ); 76 77 } 77 78 78 // Hook: Blockassets.79 add_action( ' init', 'wordpress_cgb_block_assets' );79 // Hook: Frontend assets. 80 add_action( 'enqueue_block_assets', 'wordpress_cgb_block_frontend_assets' );
Note: See TracChangeset
for help on using the changeset viewer.