Plugin Directory

Changeset 2936282


Ignore:
Timestamp:
07/10/2023 01:28:18 AM (3 years ago)
Author:
pbwebdev
Message:

update to 1.1.0

Location:
cardanopress-ispo/trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • cardanopress-ispo/trunk/README.md

    r2851606 r2936282  
    3535## Example Use Cases
    3636
    37 One notable project that is using the ISPO plugin is GoKey.network, who have used it to allow users calculate how many
    38 potential tokens they will earn in the ISPO by using their calculator.
     37One notable project that is using the ISPO plugin is [GoKey.network](https://gokey.network), who have used it to allow
     38users calculate how many potential tokens they will earn in the ISPO by using their calculator.
    3939
    4040They also use it to display the current stake pool delegation statistics and allow users to easily delegate to the ISPO
    4141stake pool using the wallet connector within a few clicks.
    4242
     43
     44
     45
     46## Installation
     47
     48The CardanoPress ISPO Plugin requires the parent plugin [CardanoPress](https://wordpress.org/plugins/cardanopress/). The
     49CardanoPress plugin manages the communication with the Cardano blockchain and wallet integrations. Please ensure you
     50install and configure the core CardanoPress plugin before installing the ISPO plugin.
     51
     52This plugin requires your own standalone WordPress installation and access to the web server to add a line of code to your htaccess file.
     53
     541. 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
     572. 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
     613. 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
     654. 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
     69Navigate 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
     73Copy this to your child theme in the folder
     74
     75`/wp-content/themes/<YOUR-THEME>/cardanopress/ispo/page/Dashboard.php`
     76
     77Override and customise as needed.
     78
     79For 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
     83Follow us on [Twitter](https://twitter.com/cardanopress)
     84View all of our repos on [GitHub](https://github.com/CardanoPress/)
     85View all of our documentation and resources on our [website](https://cardanopress.io)
     86
     87
     88## Feature Requests
     89
     90Please submit an [issue](https://github.com/cardanopress/plugin-ispo/issues) on the GitHub repo to submit requests and
     91ideas for the project.
     92
     93## Support
     94
     95Join us on Discord to learn more about the project and get support on integrations.
     96[https://discord.gg/CEX4aSfkXF](https://discord.gg/CEX4aSfkXF)
     97
     98You 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  
    44 * Plugin Name: CardanoPress - ISPO
    55 * Plugin URI:  https://github.com/CardanoPress/plugin-ispo
    6  * Author:      CardanoPress
     6 * Author:      Gene Alyson Fortunado Torcende
    77 * Author URI:  https://cardanopress.io
    88 * Description: A CardanoPress extension for ISPO
    9  * Version:     1.0.0
     9 * Version:     1.1.0
    1010 * License:     GPL-2.0-only
    1111 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
     12 *
     13 * Text Domain: cardanopress-ispo
    1214 *
    1315 * @package ThemePlate
     
    4042
    4143    if (null === $application) {
    42         if (! function_exists('get_plugins')) {
    43             require_once ABSPATH . 'wp-admin/includes/plugin.php';
    44         }
    45 
    4644        $application = new Application(CP_ISPO_FILE);
    4745    }
  • cardanopress-ispo/trunk/readme.txt

    r2851606 r2936282  
    134134to the plugins.
    135135
    136 = v0.7.0 Latest =
     136= 1.1.0 =
     137Official repository release (exact same version as 0.8.0)
     138
     139= 0.8.0 =
     140Set and show the number of tokens allocated to the project
     141Provide helper methods for epoch conversion
     142Ready for translations
     143
     144= 1.0.0 =
     145First stable release (exact same version as 0.7.0)
     146
     147= v0.7.0 =
    137148Check and clean URLs
    138149Update all dependencies
  • cardanopress-ispo/trunk/src/Actions.php

    r2851606 r2936282  
    1111use CardanoPress\Helpers\WalletHelper;
    1212use CardanoPress\Interfaces\HookInterface;
     13use DateTimeZone;
    1314use PBWebDev\CardanoPress\Blockfrost;
    1415use WP_User;
     
    3839
    3940        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'));
    4053    }
    4154
     
    143156
    144157            if (! Blockfrost::isReady($queryNetwork)) {
     158                /* translators: %s: cardano environment */
    145159                wp_send_json_error(sprintf(__('Unsupported network %s', 'cardanopress-ispo'), $queryNetwork));
    146160            }
  • cardanopress-ispo/trunk/src/Admin.php

    r2851606 r2936282  
    2828
    2929        add_action('init', function () {
     30            $this->generalSettings();
    3031            $this->delegationSettings();
    3132            $this->rewardsSettings();
    3233        });
     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        ]);
    3348    }
    3449
  • cardanopress-ispo/trunk/src/Application.php

    r2851606 r2936282  
    4545    public function init(): void
    4646    {
     47        load_plugin_textdomain($this->getData('TextDomain'));
     48
    4749        (new Actions())->setupHooks();
    4850    }
  • cardanopress-ispo/trunk/src/Installer.php

    r2851606 r2936282  
    4141
    4242        $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>',
    4546            $this->getSettingsLink(__('Please set here', 'cardanopress-ispo'), '_blank')
    4647        );
  • cardanopress-ispo/trunk/templates/page/Dashboard.php

    r2851606 r2936282  
    1818$commence = cpISPO()->option('rewards_commence');
    1919$conclude = cpISPO()->option('rewards_conclude');
     20$tokens = cpISPO()->option('allocated_tokens');
    2021$pool = cpISPO()->delegationPool();
    2122$network = cpISPO()->userProfile()->connectedNetwork();
     
    4142                    <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>
    4243                    <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; ?>
    4348                    <a class="btn btn-primary" href="#calculator">Calculate Rewards</a>
    4449                    <a class="btn btn-secondary" href="#pool-delegate">Delegate</a>
  • cardanopress-ispo/trunk/vendor/cardanopress/framework/src/Clients/BlockfrostClient.php

    r2851606 r2936282  
    2828        'mainnet' => 'https://cardano-mainnet.blockfrost.io/api/v0/',
    2929        '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/',
    3032    ];
    3133
     
    3335     * Create a new BlockfrostClient instance
    3436     */
    35     public function __construct(string $project_id, string $network = 'mainnet')
     37    public function __construct(string $project_id)
    3638    {
     39        $network = substr($project_id, 0, 7);
     40
    3741        if (! array_key_exists($network, self::ENDPOINT)) {
    3842            $network = 'mainnet';
  • cardanopress-ispo/trunk/vendor/cardanopress/framework/src/Foundation/AbstractApplication.php

    r2851606 r2936282  
    2222    public function __construct(string $pluginFile)
    2323    {
     24        if (! function_exists('get_plugin_data')) {
     25            require_once ABSPATH . 'wp-admin/includes/plugin.php';
     26        }
     27
    2428        $this->pluginFile = $pluginFile;
    2529        $this->data = get_plugin_data($pluginFile);
  • cardanopress-ispo/trunk/vendor/cardanopress/framework/src/Foundation/AbstractInstaller.php

    r2851606 r2936282  
    7979        $plugin  = sprintf(
    8080            '<a href="%1$s" target="_blank">core plugin</a>',
    81             'https://github.com/CardanoPress/cardanopress'
     81            'https://wordpress.org/plugins/cardanopress'
    8282        );
    8383        $message = sprintf(
  • cardanopress-ispo/trunk/vendor/composer/ClassLoader.php

    r2851606 r2936282  
    4343class ClassLoader
    4444{
     45    /** @var \Closure(string):void */
     46    private static $includeFile;
     47
    4548    /** @var ?string */
    4649    private $vendorDir;
     
    107110    {
    108111        $this->vendorDir = $vendorDir;
     112        self::initializeIncludeClosure();
    109113    }
    110114
     
    426430    {
    427431        if ($file = $this->findFile($class)) {
    428             includeFile($file);
     432            (self::$includeFile)($file);
    429433
    430434            return true;
     
    556560        return false;
    557561    }
     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    }
    558581}
    559 
    560 /**
    561  * Scope isolated include.
    562  *
    563  * Prevents access to $this/self from included files.
    564  *
    565  * @param  string $file
    566  * @return void
    567  * @private
    568  */
    569 function includeFile($file)
    570 {
    571     include $file;
    572 }
  • cardanopress-ispo/trunk/vendor/composer/autoload_real.php

    r2851606 r2936282  
    3434        $loader->register(true);
    3535
    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);
    3946        }
    4047
     
    4249    }
    4350}
    44 
    45 /**
    46  * @param string $fileIdentifier
    47  * @param string $file
    48  * @return void
    49  */
    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  
    33        {
    44            "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",
    77            "source": {
    88                "type": "git",
    99                "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",
    1616                "shasum": ""
    1717            },
     
    2626                "themeplate/settings": "^2.0"
    2727            },
    28             "time": "2022-12-05T06:16:49+00:00",
     28            "time": "2023-01-16T08:08:25+00:00",
    2929            "type": "library",
    3030            "installation-source": "dist",
     
    5555            "support": {
    5656                "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"
    5858            },
    5959            "install-path": "../cardanopress/framework"
  • cardanopress-ispo/trunk/vendor/composer/installed.php

    r2851606 r2936282  
    22    'root' => array(
    33        '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',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        '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',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../cardanopress/framework',
     
    2121        ),
    2222        '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',
    2626            'type' => 'wordpress-plugin',
    2727            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.