Plugin Directory

Changeset 3186012


Ignore:
Timestamp:
11/11/2024 08:36:06 PM (5 months ago)
Author:
emplibot
Message:

add keyword and meta description for seo plugins

Location:
emplibot/trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • emplibot/trunk/emplibot.php

    r3153973 r3186012  
    33 * Plugin Name:       Emplibot
    44 * Description:       Automated keyword research, automated blogging, with internal and external links, engaging infographics, unique featured images, and more.
    5  * Version:           1.0.0
     5 * Version:           1.0.2
    66 * Requires at least: 6.4
    77 * Requires PHP:      7.2
  • emplibot/trunk/includes/rest-api.php

    r3153973 r3186012  
    104104    $post_content = json_decode($json_data->content);
    105105    $post_title = $post_content->post_title;
     106    $post_keyword = $post_content->post_keyword;
    106107    $post_body = $post_content->post_content;
    107108    $post_meta = $post_content->post_meta;
     
    153154            do_action('wpml_set_element_language_details', $set_language_args);
    154155        }
     156
     157        if ($post_meta) {
     158            // Set for Yoast SEO
     159            if (class_exists('WPSEO_Frontend')) {
     160                update_post_meta($post_id, '_yoast_wpseo_metadesc', $post_meta);
     161            }
     162   
     163            // Set for RankMath
     164            if (class_exists('RankMath')) {
     165                update_post_meta($post_id, 'rank_math_description', $post_meta);
     166            }
     167   
     168        }
     169       
     170        if ($post_keyword) {
     171            // Set for Yoast SEO
     172            if (class_exists('WPSEO_Frontend')) {
     173                update_post_meta($post_id, '_yoast_wpseo_focuskw', $post_keyword);
     174            }
     175   
     176            // Set for RankMath
     177            if (class_exists('RankMath')) {
     178                update_post_meta($post_id, 'rank_math_focus_keyword', $post_keyword);
     179            }
     180   
     181        }
    155182    }
    156183
  • emplibot/trunk/readme.txt

    r3177934 r3186012  
    44Requires at least: 6.4
    55Tested up to: 6.7
    6 Stable tag: 1.0.1
     6Stable tag: 1.0.2
    77Requires PHP: 7.1
    88License: GPLv3 or later
     
    3434= 1.0.0 =
    3535* Release of the initial plugin.
     36
     37= 1.0.1 =
     38* Updated readme for WordPress plugin directory.
     39
     40= 1.0.2 =
     41* Blog posts meta description and keyword will be set for Yoast SEO and Rank Math from now.
Note: See TracChangeset for help on using the changeset viewer.