Plugin Directory

Changeset 3021816


Ignore:
Timestamp:
01/15/2024 10:16:20 AM (2 years ago)
Author:
seokey
Message:

1.8.1

Location:
seo-key/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • seo-key/trunk/admin/assets/js/build/bloc-faq/import/seokey-blocks-faq-import.asset.php

    r3011832 r3021816  
    1 <?php return array('dependencies' => array(), 'version' => '15c4f4e7c0a0b28780a1');
     1<?php return array('dependencies' => array(), 'version' => '599edf6d5293cb3cc71f');
  • seo-key/trunk/admin/assets/js/build/bloc-faq/import/seokey-blocks-faq-import.js

    r3011832 r3021816  
    1 !function(t){const{__:__}=wp.i18n;var e={init:function(){!0===document.body.classList.contains("block-editor-page")&&this.getContent()},getContent:function(){t(".wp-block-yoast-faq-block").each((function(){const e='<span class="block-editor-warning__action"><button type="button" class="components-button is-primary seokey-button-block-replacement">'+__("Replace this block with SEOKEY block","seo-key")+"</button></span>";t(this).parent().siblings("div").find(".block-editor-warning__actions").prepend(e)})),t("button.seokey-button-block-replacement").click((function(){var e=t(this).parents('div[data-type="core/missing"]')[0].id;e=e.replace("block-","");var o=wp.data.select("core/block-editor").getBlockAttributes(e);if("yoast/faq-block"===o.originalName){var n=t(t.parseHTML(o.originalUndelimitedContent)),i=[];n.find(".schema-faq-section").each((function(){i.push({question:t(this).find(".schema-faq-question").text(),response:t(this).find(".schema-faq-answer").html()})})),wp.data.dispatch("core/block-editor").replaceBlock(e,wp.blocks.createBlock("seokey/faq-block",{faq:i}))}else alert(__("This block is not regonised!","seo-key"))}))}};t(window).on("load",(function(){setTimeout((function(){e.init()}),3e3)}))}(jQuery);
     1!function(t){const{__:__}=wp.i18n;var e={init:function(){!0===document.body.classList.contains("block-editor-page")&&this.getContent()},getContent:function(){t(".wp-block-yoast-faq-block").each((function(){const e='<span class="block-editor-warning__action"><button type="button" class="components-button is-primary seokey-button-block-replacement">'+__("Replace this block with SEOKEY block","seo-key")+"</button></span>";t(this).parent().siblings("div").find(".block-editor-warning__actions").prepend(e)})),t("button.seokey-button-block-replacement").click((function(){var e=t(this).parents('div[data-type="core/missing"]')[0].id;e=e.replace("block-","");var o=wp.data.select("core/block-editor").getBlockAttributes(e);if("yoast/faq-block"===o.originalName){var n=t(t.parseHTML(o.originalUndelimitedContent)),i=[];n.find(".schema-faq-section").each((function(){i.push({question:t(this).find(".schema-faq-question").text(),response:t(this).find(".schema-faq-answer").html()})})),wp.data.dispatch("core/block-editor").replaceBlock(e,wp.blocks.createBlock("seokey/faq-block",{faq:i}))}else alert(__("This block is not recognised!","seo-key"))}))}};t(window).on("load",(function(){setTimeout((function(){e.init()}),3e3)}))}(jQuery);
  • seo-key/trunk/admin/assets/js/build/bloc-faq/seokey-blocks-faq.asset.php

    r3011832 r3021816  
    1 <?php return array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => '6d17083857e48b4cfdc88f32b3966b59');
     1<?php return array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => 'b0727e6ecf32803b20d97b682a6783b3');
  • seo-key/trunk/admin/assets/js/seokey-blocks-faq-import.js

    r3011832 r3021816  
    1414            }
    1515        },
     16
    1617        /**
    1718         * Get content form current editor
     
    4849                        break;
    4950                    default:
    50                         alert( __( 'This block is not regonised!', 'seo-key' ) )
     51                        alert( __( 'This block is not recognised!', 'seo-key' ) )
    5152                        break;
    5253                }
     
    5455        },
    5556    }
     57
    5658    /**
    5759     * Wait page loaded status
  • seo-key/trunk/admin/modules/audit/audit-single-content.php

    r2974175 r3021816  
    6666        wp_send_json_error("No valid post");
    6767    }
     68}
     69
     70add_action( 'save_post', 'seokey_save_keyword_on_post_save', 10, 3 );
     71/**
     72 * Save SEOKEY keyword on currently saved post
     73 *
     74 * @author  Arthur Leveque
     75 * @since   1.8.1
     76 */
     77function seokey_save_keyword_on_post_save( $post_id, $post, $update ) {
     78    if ( !is_admin() ) {
     79        return;
     80    }
     81    if ( !current_user_can( seokey_helper_user_get_capability( 'contributor' ) ) ) {
     82        return;
     83    }
     84    // Do nothing if it's not an editor and this is not your post
     85    $current_user = wp_get_current_user();
     86    if( ! current_user_can( seokey_helper_user_get_capability( 'editor' ) ) && $post->post_author !== $current_user->ID ) {
     87        return;
     88    }
     89    // Exclude adding keyword to secupress logs
     90    if ( $post_id > 0 && $post->post_type !== 'secupress_log_action' ) {
     91        $keyword = ( isset( $_POST['seokey_audit_content_main_keyword'] ) ) ? sanitize_text_field( $_POST['seokey_audit_content_main_keyword'] ) : '';
     92        // Do we have a keyword ?
     93        if ( !empty ( $keyword ) ) {
     94            // Update post meta
     95            if ( ! add_post_meta( $post_id, 'seokey-main-keyword', $keyword, true ) ) {
     96                update_post_meta ( $post_id, 'seokey-main-keyword', $keyword );
     97            }
     98            // We need to add our keyword in our specific table
     99            // Get Database Object
     100            global $wpdb;
     101            $table = $wpdb->prefix . 'seokey_keywords';
     102            // only delete old values if we are updating and not creating the current post
     103            if ( $update ) {
     104                $wpdb->delete( $table, array(
     105                    'content_id' => $post_id
     106                ), array( '%d' ) );
     107            }
     108            // Prepare data in order to add this keyword to our list
     109            $post_url      = get_permalink( $post_id );
     110            $request_datas = [
     111                'keyword'      => $keyword,
     112                'content_url'  => $post_url,
     113                'content_type' => $post->post_type,
     114                'content_id'   => $post_id,
     115            ];
     116            // Date format
     117            $format = ['%s', '%s', '%s', '%d'];
     118            // Save data
     119            $wpdb->insert( $table, $request_datas, $format );
     120        }
     121    }
    68122}
    69123
  • seo-key/trunk/admin/modules/medias-library.php

    r2922339 r3021816  
    738738        elseif ('without_alt' === $param) {
    739739            $query->query_vars['meta_query'] = array(
    740                 array(
    741                     'key' => '_wp_attachment_image_alt',
    742                     'compare' => 'NOT EXISTS'
     740                'relation' => 'OR',
     741                array (
     742                    'key'     => '_wp_attachment_image_alt',
     743                    'value'     => '',
     744                    'compare'   => '=',
    743745                ),
     746                array (
     747                    'key'     => '_wp_attachment_image_alt',
     748                    'compare' => 'NOT EXISTS',
     749                )
    744750            );
    745751            $query->query_vars['post_mime_type'] = "image";
  • seo-key/trunk/admin/modules/sitemap/sitemaps.php

    r3011832 r3021816  
    107107    update_option( 'seokey_sitemap_creation', 'running', true );
    108108}
     109
     110add_action( 'template_redirect', 'seokey_redirect_404_sitemaps' );
     111/**
     112 * Redirect on sitemaps index if the sitemap we are currently heading to is disabled or deleted
     113 *
     114 * @since  1.8.1
     115 * @author Arthur Leveque
     116 *
     117 * @hook   template_redirect
     118 **/
     119function seokey_redirect_404_sitemaps() {
     120    // If we are on a 404 page
     121    if( is_404() ) {
     122        // If we are on a sitemap page continue, else ignore
     123        if ( seokey_helpers_is_sitemaps_page() ) {
     124            // If we have a multilingual site, check for language of sitemap, else just redirect to sitemaps index
     125            if ( isset( seokey_helper_cache_data('languages')['lang'] ) ) {
     126                // Get language from URL by getting the last 7 letters (ex : FRA.xml) and getting only the language code
     127                $language = substr( esc_url( seokey_helper_url_get_current() ), -7, 3);
     128                // Redirect to the sitemaps index of the language we have in the URL
     129                wp_redirect( rtrim( get_home_url(), '/' ) . seokey_helpers_get_sitemap_base_url() . 'sitemap-index-' . $language . '.xml', 301 );
     130            } else {
     131                wp_redirect( rtrim( get_home_url(), '/' ) . seokey_helpers_get_sitemap_base_url(), 301 );
     132            }
     133            exit; // Always exit after wp_redirect()
     134        }
     135    }
     136}
  • seo-key/trunk/common/seo-key-helpers.php

    r3011832 r3021816  
    13481348}
    13491349
     1350/**
     1351 * Check if we are curently on a sitemaps page
     1352 *
     1353 * @return  boolean
     1354 * @author  Arthur Leveque
     1355 *
     1356 * @since   1.8.1
     1357 */
     1358function seokey_helpers_is_sitemaps_page(){
     1359    $sitemaps_url = seokey_helpers_get_sitemap_base_url(); // get SeoKey's sitemaps URL to compare
     1360    // Check if in current requested URL, we have the SeoKey's sitemaps URL
     1361    return str_contains( esc_url( seokey_helper_url_get_current() ), $sitemaps_url );
     1362}
     1363
    13501364// TODO Comment
    13511365function seokey_helpers_get_parent_key( $array, $search_value, $key ) {
  • seo-key/trunk/public/assets/languages/seo-key-fr_FR-seokey-blocks-faq-import.json

    r3011832 r3021816  
    1212        },
    1313        "Replace this block with SEOKEY block":["Remplacer ce bloc avec le bloc SEOKEY"],
    14         "This block is not regonised!":["Ce bloc n'est pas reconnu !"]
     14        "This block is not recognised!":["Ce bloc n'est pas reconnu !"]
    1515      }
    1616    }
  • seo-key/trunk/public/assets/languages/seo-key-fr_FR.po

    r3011832 r3021816  
    33"Project-Id-Version: SEOKEY Pro\n"
    44"POT-Creation-Date: 2023-12-18 10:30+0100\n"
    5 "PO-Revision-Date: 2023-12-18 10:34+0100\n"
     5"PO-Revision-Date: 2024-01-09 14:18+0100\n"
    66"Last-Translator: \n"
    77"Language-Team: \n"
     
    14121412"(Schema.org markup)"
    14131413msgstr ""
    1414 "Vos réglages \" \"Qui êtes-vous ?\" ne sont pas renseignés. <a "
     1414"Vos réglages \"Qui êtes-vous ?\" ne sont pas renseignés. <a "
    14151415"href=\"%s\">Remplissez les informations vous concernant</a> pour améliorer "
    14161416"votre crédibilité auprès de Google (balisage Schema.org)."
     
    14231423"Google (Schema.org markup)."
    14241424msgstr ""
    1425 "Vos réglages \" \"Qui êtes-vous ?\" ne sont pas entièrement configurés. <a "
     1425"Vos réglages \"Qui êtes-vous ?\" ne sont pas entièrement configurés. <a "
    14261426"href=\"%s\">Remplissez les informations vous concernant</a> pour améliorer "
    14271427"votre crédibilité auprès de Google (balisage Schema.org)."
     
    18671867#: admin/modules/audit/tasks/content_author_incomplete_infos.php:91
    18681868msgid "Author have incomplete data"
    1869 msgstr "Auteur sans informations complète"
     1869msgstr "Auteur sans informations complètes"
    18701870
    18711871#: admin/modules/audit/tasks/technical_incomplete_who_are_you.php:79
  • seo-key/trunk/readme.txt

    r3011866 r3021816  
    77Tested up to: 6.4.2
    88Requires PHP: 7.2
    9 Stable tag: 1.8.0
     9Stable tag: 1.8.1
    1010License: GPLv2 or later
    1111License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    192192== Changelog ==
    193193Public roadmap is here: https://trello.com/b/jauwlc3J/seokey-pro-public-roadmap
     194
     195= 1.8.1
     196* Improvement: keywords are now correctly saved when you create or save a post
     197* Improvement: a disabled content (a Post Type or a Taxonomy) does no longer return a 404 error, they are now automatically redirected
     198* Fixed: sometimes, empty ALT images were not shown in the SEOKEY ALT editor
     199* Fixed: translations fixes
    194200
    195201= 1.8.0
  • seo-key/trunk/seo-key.php

    r3011832 r3021816  
    99 * Text Domain: seo-key
    1010 * Domain Path: /public/assets/languages/
    11  * Version: 1.8.0
     11 * Version: 1.8.1
    1212 * Requires at least: 5.5
    1313 * Tested up to: 6.4.2
     
    4343define( 'SEOKEY_PHP_MIN',               '7.2' );                                                // PHP Minimum Version
    4444define( 'SEOKEY_WP_MIN',                '5.5' );                                                // WP Minimum Version
    45 define( 'SEOKEY_VERSION',               '1.8.0' );                                              // SEOKEY actual version
     45define( 'SEOKEY_VERSION',               '1.8.1' );                                              // SEOKEY actual version
    4646// Static Constants
    4747define( 'SEOKEY_SETTINGS_SLUG',         'seokey-settings' );                                    // SEOKEY Settings Slug in options table
Note: See TracChangeset for help on using the changeset viewer.