Changeset 2936282
- Timestamp:
- 07/10/2023 01:28:18 AM (3 years ago)
- Location:
- cardanopress-ispo/trunk
- Files:
-
- 15 edited
-
README.md (modified) (1 diff)
-
cardanopress-ispo.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
src/Actions.php (modified) (3 diffs)
-
src/Admin.php (modified) (1 diff)
-
src/Application.php (modified) (1 diff)
-
src/Installer.php (modified) (1 diff)
-
templates/page/Dashboard.php (modified) (2 diffs)
-
vendor/cardanopress/framework/src/Clients/BlockfrostClient.php (modified) (2 diffs)
-
vendor/cardanopress/framework/src/Foundation/AbstractApplication.php (modified) (1 diff)
-
vendor/cardanopress/framework/src/Foundation/AbstractInstaller.php (modified) (1 diff)
-
vendor/composer/ClassLoader.php (modified) (4 diffs)
-
vendor/composer/autoload_real.php (modified) (2 diffs)
-
vendor/composer/installed.json (modified) (3 diffs)
-
vendor/composer/installed.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cardanopress-ispo/trunk/README.md
r2851606 r2936282 35 35 ## Example Use Cases 36 36 37 One notable project that is using the ISPO plugin is GoKey.network, who have used it to allow users calculate how many38 potential tokens they will earn in the ISPO by using their calculator.37 One notable project that is using the ISPO plugin is [GoKey.network](https://gokey.network), who have used it to allow 38 users calculate how many potential tokens they will earn in the ISPO by using their calculator. 39 39 40 40 They also use it to display the current stake pool delegation statistics and allow users to easily delegate to the ISPO 41 41 stake pool using the wallet connector within a few clicks. 42 42 43 44 45 46 ## Installation 47 48 The CardanoPress ISPO Plugin requires the parent plugin [CardanoPress](https://wordpress.org/plugins/cardanopress/). The 49 CardanoPress plugin manages the communication with the Cardano blockchain and wallet integrations. Please ensure you 50 install and configure the core CardanoPress plugin before installing the ISPO plugin. 51 52 This plugin requires your own standalone WordPress installation and access to the web server to add a line of code to your htaccess file. 53 54 1. Installing the CardanoPress ISPO Plugin 55 Find the plugin in the list at the backend and click to install it. Or, upload the ZIP file through the admin backend. Or, upload the unzipped tag-groups folder to the /wp-content/plugins/ directory. 56 57 2. Activate the plugin 58 Navigate to Plugins from the WordPress admin area and activate the CardanoPress - ISPO plugin. 59 The plugin will create the base pages for all that you need. 60 61 3. Configure the plugin 62 Navigate to the configuration screen for the plugin. Here you can configure the stake pool details and certain variables 63 around how your ISPO will work. 64 65 4. Customising the Template 66 You can now create a menu link from your website's main navigation to the ISPO dashboard page. You can also customised 67 the plugins template layout. We have create the template in a way that will allow you to override the template. 68 69 Navigate to the plugin folder in your WordPress installation and copy the template layout, 70 71 `/wp-content/plugin/plugin-ispo/templates/page/Dashboard.php` 72 73 Copy this to your child theme in the folder 74 75 `/wp-content/themes/<YOUR-THEME>/cardanopress/ispo/page/Dashboard.php` 76 77 Override and customise as needed. 78 79 For more detailed documentation and tutorials on how to use the plugin, please visit the [CardanoPress documentation website](https://cardanopress.io). 80 81 ## Follow Us 82 83 Follow us on [Twitter](https://twitter.com/cardanopress) 84 View all of our repos on [GitHub](https://github.com/CardanoPress/) 85 View all of our documentation and resources on our [website](https://cardanopress.io) 86 87 88 ## Feature Requests 89 90 Please submit an [issue](https://github.com/cardanopress/plugin-ispo/issues) on the GitHub repo to submit requests and 91 ideas for the project. 92 93 ## Support 94 95 Join us on Discord to learn more about the project and get support on integrations. 96 [https://discord.gg/CEX4aSfkXF](https://discord.gg/CEX4aSfkXF) 97 98 You can find more documentation on our main website: https://cardanopress.io 99 100 > Support the development of our plugin by delegating to our Stake pool Ticker: *ADAOZ* - [https://cardanode.com.au](https://cardanode.com.au). -
cardanopress-ispo/trunk/cardanopress-ispo.php
r2851616 r2936282 4 4 * Plugin Name: CardanoPress - ISPO 5 5 * Plugin URI: https://github.com/CardanoPress/plugin-ispo 6 * Author: CardanoPress6 * Author: Gene Alyson Fortunado Torcende 7 7 * Author URI: https://cardanopress.io 8 8 * Description: A CardanoPress extension for ISPO 9 * Version: 1. 0.09 * Version: 1.1.0 10 10 * License: GPL-2.0-only 11 11 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 12 * 13 * Text Domain: cardanopress-ispo 12 14 * 13 15 * @package ThemePlate … … 40 42 41 43 if (null === $application) { 42 if (! function_exists('get_plugins')) {43 require_once ABSPATH . 'wp-admin/includes/plugin.php';44 }45 46 44 $application = new Application(CP_ISPO_FILE); 47 45 } -
cardanopress-ispo/trunk/readme.txt
r2851606 r2936282 134 134 to the plugins. 135 135 136 = v0.7.0 Latest = 136 = 1.1.0 = 137 Official repository release (exact same version as 0.8.0) 138 139 = 0.8.0 = 140 Set and show the number of tokens allocated to the project 141 Provide helper methods for epoch conversion 142 Ready for translations 143 144 = 1.0.0 = 145 First stable release (exact same version as 0.7.0) 146 147 = v0.7.0 = 137 148 Check and clean URLs 138 149 Update all dependencies -
cardanopress-ispo/trunk/src/Actions.php
r2851606 r2936282 11 11 use CardanoPress\Helpers\WalletHelper; 12 12 use CardanoPress\Interfaces\HookInterface; 13 use DateTimeZone; 13 14 use PBWebDev\CardanoPress\Blockfrost; 14 15 use WP_User; … … 38 39 39 40 return $base[$network] . $endpoint; 41 } 42 43 public static function toUnixTimestamp(string $epoch): string 44 { 45 return $epoch * 432000 + 1506203091; 46 } 47 48 public static function toUTC(string $epoch): string 49 { 50 $format = get_option('date_format') . ' ' . get_option('time_format'); 51 52 return wp_date($format, self::toUnixTimestamp($epoch), new DateTimeZone('UTC')); 40 53 } 41 54 … … 143 156 144 157 if (! Blockfrost::isReady($queryNetwork)) { 158 /* translators: %s: cardano environment */ 145 159 wp_send_json_error(sprintf(__('Unsupported network %s', 'cardanopress-ispo'), $queryNetwork)); 146 160 } -
cardanopress-ispo/trunk/src/Admin.php
r2851606 r2936282 28 28 29 29 add_action('init', function () { 30 $this->generalSettings(); 30 31 $this->delegationSettings(); 31 32 $this->rewardsSettings(); 32 33 }); 34 } 35 36 public function generalSettings(): void 37 { 38 $this->optionFields(__('General Settings', 'cardanopress-ispo'), [ 39 'data_prefix' => '', 40 'fields' => [ 41 'allocated_tokens' => [ 42 'title' => __('Allocated Tokens', 'cardanopress-ispo'), 43 'type' => 'number', 44 'default' => '', 45 ], 46 ], 47 ]); 33 48 } 34 49 -
cardanopress-ispo/trunk/src/Application.php
r2851606 r2936282 45 45 public function init(): void 46 46 { 47 load_plugin_textdomain($this->getData('TextDomain')); 48 47 49 (new Actions())->setupHooks(); 48 50 } -
cardanopress-ispo/trunk/src/Installer.php
r2851606 r2936282 41 41 42 42 $message = sprintf( 43 '<strong>%1$s</strong> requires a delegation pool ID. %2$s', 44 $this->application->getData('Name'), 43 /* translators: 1: plugin name 2: settings link */ 44 __('%1$s requires a delegation pool ID. %2$s', 'cardanopress-ispo'), 45 '<strong>' . $this->application->getData('Name') . '</strong>', 45 46 $this->getSettingsLink(__('Please set here', 'cardanopress-ispo'), '_blank') 46 47 ); -
cardanopress-ispo/trunk/templates/page/Dashboard.php
r2851606 r2936282 18 18 $commence = cpISPO()->option('rewards_commence'); 19 19 $conclude = cpISPO()->option('rewards_conclude'); 20 $tokens = cpISPO()->option('allocated_tokens'); 20 21 $pool = cpISPO()->delegationPool(); 21 22 $network = cpISPO()->userProfile()->connectedNetwork(); … … 41 42 <p>We are currently running our ISPO to distribute the <span class="fw-bold"><?php echo esc_html($pool['ticker']); ?></span> tokens to the delegates of the project.</p> 42 43 <p>Delegate your Cardano wallet to earn your rewards.</p> 44 <p>Starts: <?php echo Actions::toUTC($commence); ?> UTC | Ends: <?php echo Actions::toUTC($conclude); ?> UTC</p> 45 <?php if ($tokens) : ?> 46 <p>Allocated Tokens: <?php echo number_format($tokens); ?></p> 47 <?php endif; ?> 43 48 <a class="btn btn-primary" href="#calculator">Calculate Rewards</a> 44 49 <a class="btn btn-secondary" href="#pool-delegate">Delegate</a> -
cardanopress-ispo/trunk/vendor/cardanopress/framework/src/Clients/BlockfrostClient.php
r2851606 r2936282 28 28 'mainnet' => 'https://cardano-mainnet.blockfrost.io/api/v0/', 29 29 'testnet' => 'https://cardano-testnet.blockfrost.io/api/v0/', 30 'preprod' => 'https://cardano-preprod.blockfrost.io/api/v0/', 31 'preview' => 'https://cardano-preview.blockfrost.io/api/v0/', 30 32 ]; 31 33 … … 33 35 * Create a new BlockfrostClient instance 34 36 */ 35 public function __construct(string $project_id , string $network = 'mainnet')37 public function __construct(string $project_id) 36 38 { 39 $network = substr($project_id, 0, 7); 40 37 41 if (! array_key_exists($network, self::ENDPOINT)) { 38 42 $network = 'mainnet'; -
cardanopress-ispo/trunk/vendor/cardanopress/framework/src/Foundation/AbstractApplication.php
r2851606 r2936282 22 22 public function __construct(string $pluginFile) 23 23 { 24 if (! function_exists('get_plugin_data')) { 25 require_once ABSPATH . 'wp-admin/includes/plugin.php'; 26 } 27 24 28 $this->pluginFile = $pluginFile; 25 29 $this->data = get_plugin_data($pluginFile); -
cardanopress-ispo/trunk/vendor/cardanopress/framework/src/Foundation/AbstractInstaller.php
r2851606 r2936282 79 79 $plugin = sprintf( 80 80 '<a href="%1$s" target="_blank">core plugin</a>', 81 'https:// github.com/CardanoPress/cardanopress'81 'https://wordpress.org/plugins/cardanopress' 82 82 ); 83 83 $message = sprintf( -
cardanopress-ispo/trunk/vendor/composer/ClassLoader.php
r2851606 r2936282 43 43 class ClassLoader 44 44 { 45 /** @var \Closure(string):void */ 46 private static $includeFile; 47 45 48 /** @var ?string */ 46 49 private $vendorDir; … … 107 110 { 108 111 $this->vendorDir = $vendorDir; 112 self::initializeIncludeClosure(); 109 113 } 110 114 … … 426 430 { 427 431 if ($file = $this->findFile($class)) { 428 includeFile($file);432 (self::$includeFile)($file); 429 433 430 434 return true; … … 556 560 return false; 557 561 } 562 563 private static function initializeIncludeClosure(): void 564 { 565 if (self::$includeFile !== null) { 566 return; 567 } 568 569 /** 570 * Scope isolated include. 571 * 572 * Prevents access to $this/self from included files. 573 * 574 * @param string $file 575 * @return void 576 */ 577 self::$includeFile = static function($file) { 578 include $file; 579 }; 580 } 558 581 } 559 560 /**561 * Scope isolated include.562 *563 * Prevents access to $this/self from included files.564 *565 * @param string $file566 * @return void567 * @private568 */569 function includeFile($file)570 {571 include $file;572 } -
cardanopress-ispo/trunk/vendor/composer/autoload_real.php
r2851606 r2936282 34 34 $loader->register(true); 35 35 36 $includeFiles = \Composer\Autoload\ComposerStaticInite45e712142ec90906103b464ad6f31ba::$files; 37 foreach ($includeFiles as $fileIdentifier => $file) { 38 composerRequiree45e712142ec90906103b464ad6f31ba($fileIdentifier, $file); 36 $filesToLoad = \Composer\Autoload\ComposerStaticInite45e712142ec90906103b464ad6f31ba::$files; 37 $requireFile = static function ($fileIdentifier, $file) { 38 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 39 $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 40 41 require $file; 42 } 43 }; 44 foreach ($filesToLoad as $fileIdentifier => $file) { 45 ($requireFile)($fileIdentifier, $file); 39 46 } 40 47 … … 42 49 } 43 50 } 44 45 /**46 * @param string $fileIdentifier47 * @param string $file48 * @return void49 */50 function composerRequiree45e712142ec90906103b464ad6f31ba($fileIdentifier, $file)51 {52 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {53 $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;54 55 require $file;56 }57 } -
cardanopress-ispo/trunk/vendor/composer/installed.json
r2851606 r2936282 3 3 { 4 4 "name": "cardanopress/framework", 5 "version": "v1. 2.1",6 "version_normalized": "1. 2.1.0",5 "version": "v1.3.0", 6 "version_normalized": "1.3.0.0", 7 7 "source": { 8 8 "type": "git", 9 9 "url": "https://github.com/CardanoPress/framework.git", 10 "reference": " 70c0e800ff833683eb5d71e058d8dd681b84fdf1"11 }, 12 "dist": { 13 "type": "zip", 14 "url": "https://api.github.com/repos/CardanoPress/framework/zipball/ 70c0e800ff833683eb5d71e058d8dd681b84fdf1",15 "reference": " 70c0e800ff833683eb5d71e058d8dd681b84fdf1",10 "reference": "d8ccc9c77e9ad2e8cfd9956cc97e1ed8ecacbef6" 11 }, 12 "dist": { 13 "type": "zip", 14 "url": "https://api.github.com/repos/CardanoPress/framework/zipball/d8ccc9c77e9ad2e8cfd9956cc97e1ed8ecacbef6", 15 "reference": "d8ccc9c77e9ad2e8cfd9956cc97e1ed8ecacbef6", 16 16 "shasum": "" 17 17 }, … … 26 26 "themeplate/settings": "^2.0" 27 27 }, 28 "time": "202 2-12-05T06:16:49+00:00",28 "time": "2023-01-16T08:08:25+00:00", 29 29 "type": "library", 30 30 "installation-source": "dist", … … 55 55 "support": { 56 56 "issues": "https://github.com/CardanoPress/framework/issues", 57 "source": "https://github.com/CardanoPress/framework/tree/v1. 2.1"57 "source": "https://github.com/CardanoPress/framework/tree/v1.3.0" 58 58 }, 59 59 "install-path": "../cardanopress/framework" -
cardanopress-ispo/trunk/vendor/composer/installed.php
r2851606 r2936282 2 2 'root' => array( 3 3 'name' => 'cardanopress/plugin-ispo', 4 'pretty_version' => 'dev- trunk',5 'version' => 'dev- trunk',6 'reference' => ' f78e167edc03c2875839c5e2a71157a6e1ec65f6',4 'pretty_version' => 'dev-main', 5 'version' => 'dev-main', 6 'reference' => 'c4fdd84811d1b843a35db4b16cfc6e1d2b5b0789', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'cardanopress/framework' => array( 14 'pretty_version' => 'v1. 2.1',15 'version' => '1. 2.1.0',16 'reference' => ' 70c0e800ff833683eb5d71e058d8dd681b84fdf1',14 'pretty_version' => 'v1.3.0', 15 'version' => '1.3.0.0', 16 'reference' => 'd8ccc9c77e9ad2e8cfd9956cc97e1ed8ecacbef6', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../cardanopress/framework', … … 21 21 ), 22 22 'cardanopress/plugin-ispo' => array( 23 'pretty_version' => 'dev- trunk',24 'version' => 'dev- trunk',25 'reference' => ' f78e167edc03c2875839c5e2a71157a6e1ec65f6',23 'pretty_version' => 'dev-main', 24 'version' => 'dev-main', 25 'reference' => 'c4fdd84811d1b843a35db4b16cfc6e1d2b5b0789', 26 26 'type' => 'wordpress-plugin', 27 27 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.