Plugin Directory

Changeset 3131933


Ignore:
Timestamp:
08/07/2024 05:57:18 AM (20 months ago)
Author:
gaft
Message:

Update to version 1.19.0

Location:
cardanopress
Files:
26 deleted
7 edited
213 copied

Legend:

Unmodified
Added
Removed
  • cardanopress/tags/1.19.0/cardanopress.php

    r3128598 r3131933  
    77 * Author URI:  https://cardanopress.io
    88 * Description: Core plugin for the suite of CardanoPress plugins
    9  * Version:     1.18.0
     9 * Version:     1.19.0
    1010 * License:     GPL-2.0-only
    1111 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • cardanopress/tags/1.19.0/readme.txt

    r3128598 r3131933  
    55Requires at least: 5.9
    66Tested up to: 6.6.99
    7 Stable tag: 1.18.0
     7Stable tag: 1.19.0
    88Requires PHP: 7.4
    99License: GPLv3
     
    137137You can follow our [GitHub release](https://github.com/CardanoPress/cardanopress/releases) for full details on updates to the plugins.
    138138
     139= 1.19.0 =
     140- Use WP core polyfilled function
     141- Revamp compatibility check notices
     142- Ensure correct scripts loading order
     143
    139144= 1.18.0 =
    140145- Remove server support check for WASM
  • cardanopress/tags/1.19.0/src/Collection.php

    r2985983 r3131933  
    9393    private function getImageSrc(string $link, bool $base64 = false): string
    9494    {
    95         if ($this->startsWith("https://", $link)) {
     95        if (str_starts_with($link, "https://")) {
    9696            return $link;
    9797        }
    9898
    99         if ($this->startsWith("ipfs://", $link)) {
     99        if (str_starts_with($link, "ipfs://")) {
    100100            return str_replace(
    101101                'ipfs:/',
     
    106106
    107107        if (
    108             ($this->startsWith("Qm", $link) && 46 === strlen($link)) ||
    109             ($this->startsWith("baf", $link) && 59 === strlen($link))
     108            (str_starts_with($link, "Qm") && 46 === strlen($link)) ||
     109            (str_starts_with($link, "baf") && 59 === strlen($link))
    110110        ) {
    111111            return self::ASSETS_URL . $link;
     
    116116        }
    117117
    118         if ($this->startsWith("data:image", $link)) {
     118        if (str_starts_with($link, "data:image")) {
    119119            return $link;
    120120        }
     
    122122        return '';
    123123    }
    124 
    125     private function startsWith(string $query, string $string): bool
    126     {
    127         return 0 === strpos($string, $query);
    128     }
    129124}
  • cardanopress/tags/1.19.0/src/Compatibility.php

    r3128598 r3131933  
    2626        $this->issues = $this->getIssues(true);
    2727        $this->messages = [
     28            'missed' => __('Unable to complete the compatibility check run.', 'cardanopress'),
    2829            'theme' => __('Incomplete template injections in front-end.', 'cardanopress'),
    2930            'classic' => __('Activated theme does not support the `wp_body_open` hook.', 'cardanopress'),
     
    4748    protected function theme(): bool
    4849    {
    49         $url = home_url();
     50        $url = add_query_arg(['cardanopress' => time()], home_url());
    5051        $args = [
    5152            'timeout' => apply_filters('http_request_timeout', MINUTE_IN_SECONDS, $url),
     
    108109        }
    109110
     111        $this->setStatus(empty($issues) ? 'normal' : 'issue');
     112
    110113        return update_option(static::DATA_PREFIX . 'issues', $issues, false);
    111114    }
     
    125128            $this->log($this->message($issue), 'warning');
    126129        }
    127 
    128         $this->setStatus(empty($this->getIssues()) ? 'normal' : 'issue');
    129130    }
    130131}
  • cardanopress/tags/1.19.0/src/Installer.php

    r3108395 r3131933  
    124124    public function noticePossibleIssues(): void
    125125    {
    126         if (! $this->shouldNotice('issues') || 'issue' !== $this->compatibility->getStatus()) {
    127             return;
     126        if (! $this->shouldNotice('issues')) {
     127            return;
     128        }
     129
     130        if ('activated' === $this->compatibility->getStatus()) {
     131            $this->compatibility->addIssue('missed');
    128132        }
    129133
     
    255259        }
    256260
     261        $this->compatibility->saveIssues(true);
    257262        $this->compatibility->setStatus('activated');
    258         $this->compatibility->saveIssues(true);
    259263        $this->application->userProfile()->dismissNotice('issues', true);
    260264
  • cardanopress/tags/1.19.0/src/Manifest.php

    r3128598 r3131933  
    8080            $type = 'js' === $parts[1] ? 'script' : 'style';
    8181            $func = 'wp_dequeue_' . $type;
    82             $handle = $this->vite->$type($entry);
     82            $handle = $this->vite->$type(
     83                $entry,
     84                ('script' === $type && 'script' !== $entry) ? [static::HANDLE_PREFIX . 'script'] : [],
     85                'js' === $parts[1] ? ['in_footer' => true] : ['media' => 'all']
     86            );
    8387
    8488            $func($handle);
     89        }
     90
     91        if (apply_filters('cardanopress_alpinejs_cdn', false)) {
     92            wp_register_script(
     93                self::HANDLE_PREFIX . 'alpinejs',
     94                'https://unpkg.com/alpinejs',
     95                [self::HANDLE_PREFIX . 'script', self::HANDLE_PREFIX . 'notification'],
     96                'latest',
     97                true
     98            );
     99        } else {
     100            wp_register_script(
     101                self::HANDLE_PREFIX . 'alpinejs',
     102                plugin_dir_url($this->path) . 'vendor/alpinejs.min.js',
     103                [self::HANDLE_PREFIX . 'script', self::HANDLE_PREFIX . 'notification'],
     104                '3.14.1',
     105                true
     106            );
    85107        }
    86108
     
    178200        wp_enqueue_script(self::HANDLE_PREFIX . 'script');
    179201        wp_enqueue_script(self::HANDLE_PREFIX . 'notification');
    180 
    181         if (apply_filters('cardanopress_alpinejs_cdn', false)) {
    182             wp_enqueue_script(
    183                 self::HANDLE_PREFIX . 'alpinejs',
    184                 'https://unpkg.com/alpinejs',
    185                 [self::HANDLE_PREFIX . 'script'],
    186                 'latest',
    187                 true
    188             );
    189         } else {
    190             wp_enqueue_script(
    191                 self::HANDLE_PREFIX . 'alpinejs',
    192                 plugin_dir_url($this->path) . 'vendor/alpinejs.min.js',
    193                 [self::HANDLE_PREFIX . 'script'],
    194                 '3.14.1',
    195                 true
    196             );
    197         }
     202        wp_enqueue_script(self::HANDLE_PREFIX . 'alpinejs');
    198203
    199204        self::injectDataProvider();
  • cardanopress/trunk/cardanopress.php

    r3128598 r3131933  
    77 * Author URI:  https://cardanopress.io
    88 * Description: Core plugin for the suite of CardanoPress plugins
    9  * Version:     1.18.0
     9 * Version:     1.19.0
    1010 * License:     GPL-2.0-only
    1111 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • cardanopress/trunk/readme.txt

    r3128598 r3131933  
    55Requires at least: 5.9
    66Tested up to: 6.6.99
    7 Stable tag: 1.18.0
     7Stable tag: 1.19.0
    88Requires PHP: 7.4
    99License: GPLv3
     
    137137You can follow our [GitHub release](https://github.com/CardanoPress/cardanopress/releases) for full details on updates to the plugins.
    138138
     139= 1.19.0 =
     140- Use WP core polyfilled function
     141- Revamp compatibility check notices
     142- Ensure correct scripts loading order
     143
    139144= 1.18.0 =
    140145- Remove server support check for WASM
  • cardanopress/trunk/src/Collection.php

    r2985983 r3131933  
    9393    private function getImageSrc(string $link, bool $base64 = false): string
    9494    {
    95         if ($this->startsWith("https://", $link)) {
     95        if (str_starts_with($link, "https://")) {
    9696            return $link;
    9797        }
    9898
    99         if ($this->startsWith("ipfs://", $link)) {
     99        if (str_starts_with($link, "ipfs://")) {
    100100            return str_replace(
    101101                'ipfs:/',
     
    106106
    107107        if (
    108             ($this->startsWith("Qm", $link) && 46 === strlen($link)) ||
    109             ($this->startsWith("baf", $link) && 59 === strlen($link))
     108            (str_starts_with($link, "Qm") && 46 === strlen($link)) ||
     109            (str_starts_with($link, "baf") && 59 === strlen($link))
    110110        ) {
    111111            return self::ASSETS_URL . $link;
     
    116116        }
    117117
    118         if ($this->startsWith("data:image", $link)) {
     118        if (str_starts_with($link, "data:image")) {
    119119            return $link;
    120120        }
     
    122122        return '';
    123123    }
    124 
    125     private function startsWith(string $query, string $string): bool
    126     {
    127         return 0 === strpos($string, $query);
    128     }
    129124}
  • cardanopress/trunk/src/Compatibility.php

    r3128598 r3131933  
    2626        $this->issues = $this->getIssues(true);
    2727        $this->messages = [
     28            'missed' => __('Unable to complete the compatibility check run.', 'cardanopress'),
    2829            'theme' => __('Incomplete template injections in front-end.', 'cardanopress'),
    2930            'classic' => __('Activated theme does not support the `wp_body_open` hook.', 'cardanopress'),
     
    4748    protected function theme(): bool
    4849    {
    49         $url = home_url();
     50        $url = add_query_arg(['cardanopress' => time()], home_url());
    5051        $args = [
    5152            'timeout' => apply_filters('http_request_timeout', MINUTE_IN_SECONDS, $url),
     
    108109        }
    109110
     111        $this->setStatus(empty($issues) ? 'normal' : 'issue');
     112
    110113        return update_option(static::DATA_PREFIX . 'issues', $issues, false);
    111114    }
     
    125128            $this->log($this->message($issue), 'warning');
    126129        }
    127 
    128         $this->setStatus(empty($this->getIssues()) ? 'normal' : 'issue');
    129130    }
    130131}
  • cardanopress/trunk/src/Installer.php

    r3108395 r3131933  
    124124    public function noticePossibleIssues(): void
    125125    {
    126         if (! $this->shouldNotice('issues') || 'issue' !== $this->compatibility->getStatus()) {
    127             return;
     126        if (! $this->shouldNotice('issues')) {
     127            return;
     128        }
     129
     130        if ('activated' === $this->compatibility->getStatus()) {
     131            $this->compatibility->addIssue('missed');
    128132        }
    129133
     
    255259        }
    256260
     261        $this->compatibility->saveIssues(true);
    257262        $this->compatibility->setStatus('activated');
    258         $this->compatibility->saveIssues(true);
    259263        $this->application->userProfile()->dismissNotice('issues', true);
    260264
  • cardanopress/trunk/src/Manifest.php

    r3128598 r3131933  
    8080            $type = 'js' === $parts[1] ? 'script' : 'style';
    8181            $func = 'wp_dequeue_' . $type;
    82             $handle = $this->vite->$type($entry);
     82            $handle = $this->vite->$type(
     83                $entry,
     84                ('script' === $type && 'script' !== $entry) ? [static::HANDLE_PREFIX . 'script'] : [],
     85                'js' === $parts[1] ? ['in_footer' => true] : ['media' => 'all']
     86            );
    8387
    8488            $func($handle);
     89        }
     90
     91        if (apply_filters('cardanopress_alpinejs_cdn', false)) {
     92            wp_register_script(
     93                self::HANDLE_PREFIX . 'alpinejs',
     94                'https://unpkg.com/alpinejs',
     95                [self::HANDLE_PREFIX . 'script', self::HANDLE_PREFIX . 'notification'],
     96                'latest',
     97                true
     98            );
     99        } else {
     100            wp_register_script(
     101                self::HANDLE_PREFIX . 'alpinejs',
     102                plugin_dir_url($this->path) . 'vendor/alpinejs.min.js',
     103                [self::HANDLE_PREFIX . 'script', self::HANDLE_PREFIX . 'notification'],
     104                '3.14.1',
     105                true
     106            );
    85107        }
    86108
     
    178200        wp_enqueue_script(self::HANDLE_PREFIX . 'script');
    179201        wp_enqueue_script(self::HANDLE_PREFIX . 'notification');
    180 
    181         if (apply_filters('cardanopress_alpinejs_cdn', false)) {
    182             wp_enqueue_script(
    183                 self::HANDLE_PREFIX . 'alpinejs',
    184                 'https://unpkg.com/alpinejs',
    185                 [self::HANDLE_PREFIX . 'script'],
    186                 'latest',
    187                 true
    188             );
    189         } else {
    190             wp_enqueue_script(
    191                 self::HANDLE_PREFIX . 'alpinejs',
    192                 plugin_dir_url($this->path) . 'vendor/alpinejs.min.js',
    193                 [self::HANDLE_PREFIX . 'script'],
    194                 '3.14.1',
    195                 true
    196             );
    197         }
     202        wp_enqueue_script(self::HANDLE_PREFIX . 'alpinejs');
    198203
    199204        self::injectDataProvider();
Note: See TracChangeset for help on using the changeset viewer.