Plugin Directory

Changeset 3036280


Ignore:
Timestamp:
02/15/2024 12:44:23 PM (2 years ago)
Author:
findkit
Message:

Update to version 0.5.9 from GitHub

Location:
findkit
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • findkit/tags/0.5.9/.github/workflows/test.yml

    r3008127 r3036280  
    3636        run: npm run tsc
    3737
     38      - name: Check prettier
     39        run: npm run prettier-check
     40
    3841      - name: Build assets
    3942        run: npm run build
    40 
  • findkit/tags/0.5.9/CHANGELOG.md

    r3028254 r3036280  
     1## v0.5.9
     2
     32024-02-15
     4
     5-   Ensure meta tag is rendered on all pages [e2f20ac](https://github.com/findkit/wp-findkit/commit/e2f20ac) - Esa-Matti Suuronen
     6-   check prettier in ci [efea203](https://github.com/findkit/wp-findkit/commit/efea203) - Esa-Matti Suuronen
     7
     8All changes https://github.com/findkit/wp-findkit/compare/v0.5.8...v0.5.9
     9
    110## v0.5.8
    211
  • findkit/tags/0.5.9/package.json

    r3028254 r3036280  
    1212        "zip": "./tools/zip",
    1313        "prettier-write": "prettier --write src plugin.php",
     14        "prettier-check": "prettier --check src plugin.php",
    1415        "dev": "git valu-hide-changes build && wp-scripts start src/scripts/*.ts*",
    1516        "build": "git valu-hide-changes build && wp-scripts build src/scripts/*.ts*",
  • findkit/tags/0.5.9/plugin.php

    r3028254 r3036280  
    1010 * Description: WordPress Plugin for Findkit Site Search. See findkit.com for details
    1111 * Author: Findkit Team <findkit@findkit.com>
    12  * Version: 0.5.8
     12 * Version: 0.5.9
    1313 * License: GPLv2 or later
    1414 */
  • findkit/tags/0.5.9/readme.txt

    r3028254 r3036280  
    44Requires at least: 6.0
    55Tested up to: 6.4.1
    6 Stable tag: 0.5.8
     6Stable tag: 0.5.9
    77Requires PHP: 7.2
    88Donate link: https://www.findkit.com/
  • findkit/tags/0.5.9/src/PageMeta.php

    r3011329 r3036280  
    11<?php
     2
    23declare(strict_types=1);
    34
     
    1718    function __action_wp_head()
    1819    {
    19         $post = \get_queried_object();
     20        $object = \get_queried_object();
    2021
    21         if (!($post instanceof \WP_Post)) {
    22             return;
    23         }
    24 
    25         $meta = self::get($post);
     22        $meta = self::get($object);
    2623
    2724        if (empty($meta)) {
     
    5047     * See https://docs.findkit.com/crawler/meta-tag/
    5148     */
    52     static function get(\WP_Post $post)
     49    static function get($object)
    5350    {
    54         $public = $post->post_status === 'publish';
     51        $public = true;
    5552
    56         $url_parts = parse_url(\home_url());
    57         $domain = $url_parts['host'];
     53        if ($object instanceof \WP_Post) {
     54            $public = $object->post_status === 'publish';
     55        }
    5856
    59         $domain = \apply_filters('findkit_page_meta_domain', $domain, $post);
     57        $meta = [
     58            // Do not show archive pages in search by default because commonly
     59            // they contain only a lists of posts which is already indexed as
     60            // the individual posts.
     61            'showInSearch' => \is_archive() ? false : $public,
     62        ];
     63
     64        $domain = \apply_filters(
     65            'findkit_page_meta_domain',
     66            parse_url(\home_url())['host'],
     67            $object
     68        );
    6069
    6170        $blogname_slug = \sanitize_title(self::get_blog_name());
     
    6776            'wordpress',
    6877            'domain/' . $domain . '/' . 'wordpress',
    69             'wp_post_type/' . $post->post_type,
    70             'domain/' . $domain . '/' . 'wp_post_type/' . $post->post_type,
    7178            'wp_blog_name/' . $blogname_slug,
    7279            $blog_name_tag,
     
    7481        ];
    7582
    76         $public_taxonomies = \get_taxonomies(['public' => true], 'names');
    77         $post_taxonomies = \get_the_taxonomies($post->ID);
     83        if ($object instanceof \WP_Post) {
     84            $meta['title'] = $object->post_title;
     85            $meta['created'] = \get_the_date('c', $object);
     86            $meta['modified'] = \get_the_modified_date('c', $object);
    7887
    79         foreach ($post_taxonomies as $taxonomy_key => $taxonomy_value) {
    80             // only expose public taxonomies as tags
    81             if (in_array($taxonomy_key, $public_taxonomies)) {
    82                 $terms = \get_the_terms($post, $taxonomy_key);
    83                 foreach ($terms as $term) {
    84                     array_push(
    85                         $tags,
    86                         'domain/' .
    87                             $domain .
    88                             '/' .
    89                             'wp_taxonomy/' .
    90                             $taxonomy_key .
    91                             '/' .
    92                             $term->slug
    93                     );
    94                     array_push(
    95                         $tags,
    96                         'wp_taxonomy/' . $taxonomy_key . '/' . $term->slug
    97                     );
    98                 }
     88            // Defaults to true. Only used to explicitly disable showing the page in the findkit search.
     89            if (
     90                \get_post_meta($object->ID, '_findkit_show_in_search', true) ===
     91                'no'
     92            ) {
     93                $meta['showInSearch'] = false;
    9994            }
    100         }
    10195
    102         $title = \wp_specialchars_decode(
    103             \is_archive() ? \get_the_archive_title() : $post->post_title
    104         );
     96            $tags[] = 'wp_post_type/' . $object->post_type;
     97            $tags[] =
     98                'domain/' .
     99                $domain .
     100                '/' .
     101                'wp_post_type/' .
     102                $object->post_type;
    105103
    106         $created = \get_the_date('c', $post);
    107         $modified = \get_the_modified_date('c', $post);
    108         $show_in_search = \is_archive() ? false : $public;
     104            $public_taxonomies = \get_taxonomies(['public' => true], 'names');
     105            $post_taxonomies = \get_the_taxonomies($object->ID);
    109106
    110         // Defaults to true. Only used to explicitly disable showing the page in the findkit search.
    111         if (
    112             \get_post_meta($post->ID, '_findkit_show_in_search', true) === 'no'
    113         ) {
    114             $show_in_search = false;
    115         }
    116 
    117         $meta = [
    118             'showInSearch' => $show_in_search,
    119             'title' => \html_entity_decode($title),
    120             'created' => $created,
    121             'modified' => $modified,
    122             'tags' => $tags,
    123         ];
    124 
    125         $superwords = \get_post_meta($post->ID, '_findkit_superwords', true);
    126 
    127         if ($superwords) {
    128             $superwords = trim($superwords);
    129             if (!empty($superwords)) {
    130                 $meta['superwords'] = [];
    131                 foreach (preg_split('/\s+/', $superwords) as $word) {
    132                     $word = trim($word);
    133                     if ($word) {
    134                         $meta['superwords'][] = $word;
     107            foreach ($post_taxonomies as $taxonomy_key => $taxonomy_value) {
     108                // only expose public taxonomies as tags
     109                if (in_array($taxonomy_key, $public_taxonomies)) {
     110                    $terms = \get_the_terms($object, $taxonomy_key);
     111                    foreach ($terms as $term) {
     112                        array_push(
     113                            $tags,
     114                            'domain/' .
     115                                $domain .
     116                                '/' .
     117                                'wp_taxonomy/' .
     118                                $taxonomy_key .
     119                                '/' .
     120                                $term->slug
     121                        );
     122                        array_push(
     123                            $tags,
     124                            'wp_taxonomy/' . $taxonomy_key . '/' . $term->slug
     125                        );
    135126                    }
    136127                }
    137128            }
     129
     130            $superwords = \get_post_meta(
     131                $object->ID,
     132                '_findkit_superwords',
     133                true
     134            );
     135
     136            if ($superwords) {
     137                $superwords = trim($superwords);
     138                if (!empty($superwords)) {
     139                    $meta['superwords'] = [];
     140                    foreach (preg_split('/\s+/', $superwords) as $word) {
     141                        $word = trim($word);
     142                        if ($word) {
     143                            $meta['superwords'][] = $word;
     144                        }
     145                    }
     146                }
     147            }
     148
     149            $content_no_highlight = \get_post_meta(
     150                $object->ID,
     151                '_findkit_content_no_highlight',
     152                true
     153            );
     154
     155            if ($content_no_highlight) {
     156                $content_no_highlight = trim($content_no_highlight);
     157                if (!empty($content_no_highlight)) {
     158                    $meta['contentNoHighlight'] = $content_no_highlight;
     159                }
     160            }
     161
     162            // Use the post language if using polylang instead of the blog locale.
     163            if (function_exists('\pll_get_post_language')) {
     164                $meta['language'] = \pll_get_post_language($object->ID, 'slug');
     165            }
     166        } elseif (\is_archive()) {
     167            $meta['title'] = \get_the_archive_title();
    138168        }
    139169
    140         $content_no_highlight = \get_post_meta(
    141             $post->ID,
    142             '_findkit_content_no_highlight',
    143             true
    144         );
     170        $meta['title'] ??= \get_the_title();
     171        $meta['language'] ??= substr(\get_bloginfo('language'), 0, 2);
    145172
    146         if ($content_no_highlight) {
    147             $content_no_highlight = trim($content_no_highlight);
    148             if (!empty($content_no_highlight)) {
    149                 $meta['contentNoHighlight'] = $content_no_highlight;
    150             }
    151         }
     173        $meta['title'] = \wp_specialchars_decode($meta['title']);
     174        $meta['tags'] = $tags;
    152175
    153         // Use the post language if using polylang instead of the blog locale.
    154         if (function_exists('\pll_get_post_language')) {
    155             $meta['language'] = \pll_get_post_language($post->ID, 'slug');
    156         } else {
    157             $meta['language'] = substr(\get_bloginfo('language'), 0, 2);
    158         }
    159 
    160         return apply_filters('findkit_page_meta', $meta, $post);
     176        return apply_filters('findkit_page_meta', $meta, $object);
    161177    }
    162178}
  • findkit/tags/0.5.9/vendor/composer/installed.php

    r3028254 r3036280  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => 'f0df1a718534e4b61ae70dfc5110b032626b42a3',
     6        'reference' => '2c615750627ca35925d06839acdeb8d74e679015',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => 'f0df1a718534e4b61ae70dfc5110b032626b42a3',
     16            'reference' => '2c615750627ca35925d06839acdeb8d74e679015',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • findkit/trunk/.github/workflows/test.yml

    r3008127 r3036280  
    3636        run: npm run tsc
    3737
     38      - name: Check prettier
     39        run: npm run prettier-check
     40
    3841      - name: Build assets
    3942        run: npm run build
    40 
  • findkit/trunk/CHANGELOG.md

    r3028254 r3036280  
     1## v0.5.9
     2
     32024-02-15
     4
     5-   Ensure meta tag is rendered on all pages [e2f20ac](https://github.com/findkit/wp-findkit/commit/e2f20ac) - Esa-Matti Suuronen
     6-   check prettier in ci [efea203](https://github.com/findkit/wp-findkit/commit/efea203) - Esa-Matti Suuronen
     7
     8All changes https://github.com/findkit/wp-findkit/compare/v0.5.8...v0.5.9
     9
    110## v0.5.8
    211
  • findkit/trunk/package.json

    r3028254 r3036280  
    1212        "zip": "./tools/zip",
    1313        "prettier-write": "prettier --write src plugin.php",
     14        "prettier-check": "prettier --check src plugin.php",
    1415        "dev": "git valu-hide-changes build && wp-scripts start src/scripts/*.ts*",
    1516        "build": "git valu-hide-changes build && wp-scripts build src/scripts/*.ts*",
  • findkit/trunk/plugin.php

    r3028254 r3036280  
    1010 * Description: WordPress Plugin for Findkit Site Search. See findkit.com for details
    1111 * Author: Findkit Team <findkit@findkit.com>
    12  * Version: 0.5.8
     12 * Version: 0.5.9
    1313 * License: GPLv2 or later
    1414 */
  • findkit/trunk/readme.txt

    r3028254 r3036280  
    44Requires at least: 6.0
    55Tested up to: 6.4.1
    6 Stable tag: 0.5.8
     6Stable tag: 0.5.9
    77Requires PHP: 7.2
    88Donate link: https://www.findkit.com/
  • findkit/trunk/src/PageMeta.php

    r3011329 r3036280  
    11<?php
     2
    23declare(strict_types=1);
    34
     
    1718    function __action_wp_head()
    1819    {
    19         $post = \get_queried_object();
     20        $object = \get_queried_object();
    2021
    21         if (!($post instanceof \WP_Post)) {
    22             return;
    23         }
    24 
    25         $meta = self::get($post);
     22        $meta = self::get($object);
    2623
    2724        if (empty($meta)) {
     
    5047     * See https://docs.findkit.com/crawler/meta-tag/
    5148     */
    52     static function get(\WP_Post $post)
     49    static function get($object)
    5350    {
    54         $public = $post->post_status === 'publish';
     51        $public = true;
    5552
    56         $url_parts = parse_url(\home_url());
    57         $domain = $url_parts['host'];
     53        if ($object instanceof \WP_Post) {
     54            $public = $object->post_status === 'publish';
     55        }
    5856
    59         $domain = \apply_filters('findkit_page_meta_domain', $domain, $post);
     57        $meta = [
     58            // Do not show archive pages in search by default because commonly
     59            // they contain only a lists of posts which is already indexed as
     60            // the individual posts.
     61            'showInSearch' => \is_archive() ? false : $public,
     62        ];
     63
     64        $domain = \apply_filters(
     65            'findkit_page_meta_domain',
     66            parse_url(\home_url())['host'],
     67            $object
     68        );
    6069
    6170        $blogname_slug = \sanitize_title(self::get_blog_name());
     
    6776            'wordpress',
    6877            'domain/' . $domain . '/' . 'wordpress',
    69             'wp_post_type/' . $post->post_type,
    70             'domain/' . $domain . '/' . 'wp_post_type/' . $post->post_type,
    7178            'wp_blog_name/' . $blogname_slug,
    7279            $blog_name_tag,
     
    7481        ];
    7582
    76         $public_taxonomies = \get_taxonomies(['public' => true], 'names');
    77         $post_taxonomies = \get_the_taxonomies($post->ID);
     83        if ($object instanceof \WP_Post) {
     84            $meta['title'] = $object->post_title;
     85            $meta['created'] = \get_the_date('c', $object);
     86            $meta['modified'] = \get_the_modified_date('c', $object);
    7887
    79         foreach ($post_taxonomies as $taxonomy_key => $taxonomy_value) {
    80             // only expose public taxonomies as tags
    81             if (in_array($taxonomy_key, $public_taxonomies)) {
    82                 $terms = \get_the_terms($post, $taxonomy_key);
    83                 foreach ($terms as $term) {
    84                     array_push(
    85                         $tags,
    86                         'domain/' .
    87                             $domain .
    88                             '/' .
    89                             'wp_taxonomy/' .
    90                             $taxonomy_key .
    91                             '/' .
    92                             $term->slug
    93                     );
    94                     array_push(
    95                         $tags,
    96                         'wp_taxonomy/' . $taxonomy_key . '/' . $term->slug
    97                     );
    98                 }
     88            // Defaults to true. Only used to explicitly disable showing the page in the findkit search.
     89            if (
     90                \get_post_meta($object->ID, '_findkit_show_in_search', true) ===
     91                'no'
     92            ) {
     93                $meta['showInSearch'] = false;
    9994            }
    100         }
    10195
    102         $title = \wp_specialchars_decode(
    103             \is_archive() ? \get_the_archive_title() : $post->post_title
    104         );
     96            $tags[] = 'wp_post_type/' . $object->post_type;
     97            $tags[] =
     98                'domain/' .
     99                $domain .
     100                '/' .
     101                'wp_post_type/' .
     102                $object->post_type;
    105103
    106         $created = \get_the_date('c', $post);
    107         $modified = \get_the_modified_date('c', $post);
    108         $show_in_search = \is_archive() ? false : $public;
     104            $public_taxonomies = \get_taxonomies(['public' => true], 'names');
     105            $post_taxonomies = \get_the_taxonomies($object->ID);
    109106
    110         // Defaults to true. Only used to explicitly disable showing the page in the findkit search.
    111         if (
    112             \get_post_meta($post->ID, '_findkit_show_in_search', true) === 'no'
    113         ) {
    114             $show_in_search = false;
    115         }
    116 
    117         $meta = [
    118             'showInSearch' => $show_in_search,
    119             'title' => \html_entity_decode($title),
    120             'created' => $created,
    121             'modified' => $modified,
    122             'tags' => $tags,
    123         ];
    124 
    125         $superwords = \get_post_meta($post->ID, '_findkit_superwords', true);
    126 
    127         if ($superwords) {
    128             $superwords = trim($superwords);
    129             if (!empty($superwords)) {
    130                 $meta['superwords'] = [];
    131                 foreach (preg_split('/\s+/', $superwords) as $word) {
    132                     $word = trim($word);
    133                     if ($word) {
    134                         $meta['superwords'][] = $word;
     107            foreach ($post_taxonomies as $taxonomy_key => $taxonomy_value) {
     108                // only expose public taxonomies as tags
     109                if (in_array($taxonomy_key, $public_taxonomies)) {
     110                    $terms = \get_the_terms($object, $taxonomy_key);
     111                    foreach ($terms as $term) {
     112                        array_push(
     113                            $tags,
     114                            'domain/' .
     115                                $domain .
     116                                '/' .
     117                                'wp_taxonomy/' .
     118                                $taxonomy_key .
     119                                '/' .
     120                                $term->slug
     121                        );
     122                        array_push(
     123                            $tags,
     124                            'wp_taxonomy/' . $taxonomy_key . '/' . $term->slug
     125                        );
    135126                    }
    136127                }
    137128            }
     129
     130            $superwords = \get_post_meta(
     131                $object->ID,
     132                '_findkit_superwords',
     133                true
     134            );
     135
     136            if ($superwords) {
     137                $superwords = trim($superwords);
     138                if (!empty($superwords)) {
     139                    $meta['superwords'] = [];
     140                    foreach (preg_split('/\s+/', $superwords) as $word) {
     141                        $word = trim($word);
     142                        if ($word) {
     143                            $meta['superwords'][] = $word;
     144                        }
     145                    }
     146                }
     147            }
     148
     149            $content_no_highlight = \get_post_meta(
     150                $object->ID,
     151                '_findkit_content_no_highlight',
     152                true
     153            );
     154
     155            if ($content_no_highlight) {
     156                $content_no_highlight = trim($content_no_highlight);
     157                if (!empty($content_no_highlight)) {
     158                    $meta['contentNoHighlight'] = $content_no_highlight;
     159                }
     160            }
     161
     162            // Use the post language if using polylang instead of the blog locale.
     163            if (function_exists('\pll_get_post_language')) {
     164                $meta['language'] = \pll_get_post_language($object->ID, 'slug');
     165            }
     166        } elseif (\is_archive()) {
     167            $meta['title'] = \get_the_archive_title();
    138168        }
    139169
    140         $content_no_highlight = \get_post_meta(
    141             $post->ID,
    142             '_findkit_content_no_highlight',
    143             true
    144         );
     170        $meta['title'] ??= \get_the_title();
     171        $meta['language'] ??= substr(\get_bloginfo('language'), 0, 2);
    145172
    146         if ($content_no_highlight) {
    147             $content_no_highlight = trim($content_no_highlight);
    148             if (!empty($content_no_highlight)) {
    149                 $meta['contentNoHighlight'] = $content_no_highlight;
    150             }
    151         }
     173        $meta['title'] = \wp_specialchars_decode($meta['title']);
     174        $meta['tags'] = $tags;
    152175
    153         // Use the post language if using polylang instead of the blog locale.
    154         if (function_exists('\pll_get_post_language')) {
    155             $meta['language'] = \pll_get_post_language($post->ID, 'slug');
    156         } else {
    157             $meta['language'] = substr(\get_bloginfo('language'), 0, 2);
    158         }
    159 
    160         return apply_filters('findkit_page_meta', $meta, $post);
     176        return apply_filters('findkit_page_meta', $meta, $object);
    161177    }
    162178}
  • findkit/trunk/vendor/composer/installed.php

    r3028254 r3036280  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => 'f0df1a718534e4b61ae70dfc5110b032626b42a3',
     6        'reference' => '2c615750627ca35925d06839acdeb8d74e679015',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => 'f0df1a718534e4b61ae70dfc5110b032626b42a3',
     16            'reference' => '2c615750627ca35925d06839acdeb8d74e679015',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.