{"id":97933,"date":"2019-02-14T13:07:08","date_gmt":"2019-02-14T13:07:08","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/semrush-seo-writing-assistant-custom-fields\/"},"modified":"2019-06-17T15:53:29","modified_gmt":"2019-06-17T15:53:29","slug":"seo-writing-assistant-semrush-custom-fields","status":"publish","type":"plugin","link":"https:\/\/da.wordpress.org\/plugins\/seo-writing-assistant-semrush-custom-fields\/","author":14535036,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.1.0","stable_tag":"1.1.0","tested":"5.2.24","requires":"4.4","requires_php":"5.2.4","requires_plugins":"","header_name":"SEO Writing Assistant SEMrush Custom Fields","header_author":"Enrico Sorcinelli","header_description":"A WordPress plugin that allows SEMrush SEO Writing Assistant working with custom fields","assets_banners_color":"","last_updated":"2019-06-17 15:53:29","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/enrico-sorcinelli\/seo-writing-assistant-semrush-custom-fields","header_author_uri":"https:\/\/github.com\/enrico-sorcinelli\/seo-writing-assistant-semrush-custom-fields\/graphs\/contributors","rating":0,"author_block_rating":0,"active_installs":70,"downloads":3306,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"1.1.0":"<p>Added support for Advanced Custom Fields; added autoenabling and autodiscovery field feature.<\/p>"},"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"2107487","resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"2107487","resolution":"256x256","location":"assets","locale":""}},"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.3","1.1.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"2107487","resolution":"1","location":"assets","locale":""}},"screenshots":{"1":"The Advanced Custom Fields custom setting."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[127657,5882,2010,12158,186],"plugin_category":[55],"plugin_contributors":[158160],"plugin_business_model":[],"class_list":["post-97933","plugin","type-plugin","status-publish","hentry","plugin_tags-content-analysis","plugin_tags-content-marketing","plugin_tags-custom-fields","plugin_tags-readability","plugin_tags-seo","plugin_category-seo-and-marketing","plugin_contributors-enricosorcinelli","plugin_committers-enricosorcinelli"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/seo-writing-assistant-semrush-custom-fields\/assets\/icon-128x128.png?rev=2107487","icon_2x":"https:\/\/ps.w.org\/seo-writing-assistant-semrush-custom-fields\/assets\/icon-256x256.png?rev=2107487","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/seo-writing-assistant-semrush-custom-fields\/assets\/screenshot-1.png?rev=2107487","caption":"The Advanced Custom Fields custom setting."}],"raw_content":"<!--section=description-->\n<p>The <a href=\"https:\/\/wordpress.org\/plugins\/semrush-seo-writing-assistant\/\">SEMrush SEO Writing Assistant<\/a> plugin read only from post <code>title<\/code> and post <code>content<\/code> elements for the real time check.<\/p>\n\n<p>This lightweight plugin allows you to use an arbitrary value for that check in addition to those values.<\/p>\n\n<p>So, if you are using some kind of a page builders, field managers and so on, you have only to define a constant in your <em>wp_config.php<\/em> file and eventually to write a little bit of JavaScript code in order to specify which fields.<\/p>\n\n<p>Note that the plugin don't replace <em>SEMrush SEO Writing Assistant<\/em> but is intended to be used together.<\/p>\n\n<h3>Usage<\/h3>\n\n<p>Once the plugin is activated you can configure it by defining following constants in your <em>wp-config.php<\/em>:<\/p>\n\n<ul>\n<li><code>SWA_SEMRUSH_CUSTOM_FIELDS_PLUGIN_AUTOENABLE<\/code><\/li>\n<\/ul>\n\n<p>Automatically enable use of additional text value for SEMrush check. The default value is <code>false<\/code>.\nThis is the only configuration you have to do in order to have the plugin feature working.\nFor example:<\/p>\n\n<pre><code>define( 'SWA_SEMRUSH_CUSTOM_FIELDS_PLUGIN_AUTOENABLE', true );\n<\/code><\/pre>\n\n<ul>\n<li><code>SWA_SEMRUSH_CUSTOM_FIELDS_PLUGIN_INTERVAL<\/code><\/li>\n<\/ul>\n\n<p>Allows to change the interval between automatic updates of the text used by SEMrush checks.\nThe default value is <code>5<\/code> seconds.For example:<\/p>\n\n<pre><code>define( 'SWA_SEMRUSH_CUSTOM_FIELDS_PLUGIN_INTERVAL', 10 );\n<\/code><\/pre>\n\n<p>You can alernatavely control the plugins programmatically, by using \n    semrush_seo_writing_assistant_post_types (optional) filter and <code>SeoWritingAssistantSEMrushCustomFields<\/code> JavaScript object (see below).<\/p>\n\n<h3>API<\/h3>\n\n<h4>WordPress Hooks<\/h4>\n\n<p>**<code>swa_semrush_custom_fields_settings<\/code>  **<\/p>\n\n<p>Filters plugin settings values.<\/p>\n\n<pre><code>apply_filters( 'swa_semrush_custom_fields_settings', array $settings )\n<\/code><\/pre>\n\n<p><strong><code>semrush_seo_writing_assistant_post_types<\/code><\/strong><\/p>\n\n<p>Filters post types where to enable plugin. Default to <code>array( 'post', 'page', 'product' )<\/code>.<\/p>\n\n<pre><code>apply_filters( 'semrush_seo_writing_assistant_post_types', array $post_types )\n<\/code><\/pre>\n\n<p>The filter has the same name as the one used by <em>SEMrush SEO Writing Assistant<\/em> plugin (since version 1.0.4) used for the same purpose.<\/p>\n\n<h4>JavaScript Event<\/h4>\n\n<p><strong><code>seo-writing-assistant-semrush<\/code><\/strong><\/p>\n\n<p>This event allows you to update the text for SEMrush analysis.\nThe following example will update text for SEMrush check every 5 seconds, using <code>excerpt<\/code> and <code>my_custom_fields<\/code> custom field values (working both with block and classic editors):<\/p>\n\n<pre><code>jQuery( document ).ready( function() {\n    var swa = new SeoWritingAssistantSEMrushCustomFields( { interval: 5 } );\n    jQuery( document ).on( 'seo-writing-assistant-semrush', function( event, data ) {\n        data.html += jQuery( '#excerpt' ).val() + \"\\n\"\n            + jQuery( '.editor-post-excerpt__textarea textarea').val() + \"\\n\"\n            + jQuery( '#my_custom_fields' ).val();\n    } )\n} );\n<\/code><\/pre>\n\n<p>Note that if you have previously defined constant <code>SWA_SEMRUSH_CUSTOM_FIELDS_PLUGIN_AUTOENABLE<\/code> to <code>true<\/code>, \nyou don't have to create new <code>SeoWritingAssistantSEMrushCustomFields<\/code> object.<\/p>\n\n<h4>JavaScript API<\/h4>\n\n<p><strong><code>setHtml()<\/code><\/strong><\/p>\n\n<p>The following example will update programmatically the text used by SEMrush check with an arbitrary value:<\/p>\n\n<pre><code>jQuery( document ).ready( function() {\n    var swa = new SeoWritingAssistantSEMrushCustomFields( { interval: 0 } );\n    swa.setHtml( 'foo baz bar' );\n} );\n<\/code><\/pre>\n\n<h4>Advanced Custom Fields<\/h4>\n\n<p>The plugin checks if <em>Advanced Custom Fields<\/em> is active in your WordPress instance and adds a custom setting to each field \n(only for <code>input<\/code> within <em>text<\/em>, <em>radio<\/em> and <em>checkbox<\/em> type, <code>textarea<\/code> and <code>select<\/code> elements) allowing you to add his value \nto SEMrush check without having to write any additional JavaScript code.<\/p>\n\n<h4>Autodiscovery<\/h4>\n\n<p>The plugin also automatically add to text used by SEMrush checks, the values of all HTML elements\nwith <code>swa-scf<\/code> class or <code>data-swa-scf<\/code> attribute.\nThis will applied only for <code>input<\/code> (within <em>text<\/em>, <em>radio<\/em> and <em>checkbox<\/em> type), <code>textarea<\/code>, and <code>select<\/code> elements.<\/p>\n\n<!--section=installation-->\n<p>This section describes how to install the plugin and get it working.<\/p>\n\n<ul>\n<li>Upload the plugin files to the <code>\/wp-content\/plugins\/seo-writing-assistant-semrush-custom-fields<\/code> directory, or install the plugin through the WordPress <em>Plugins<\/em> screen directly.<\/li>\n<li>Activate the plugin through the <em>Plugins<\/em> screen in WordPress.<\/li>\n<\/ul>\n\n<!--section=faq-->\n<dl>\n<dt>Does it work with Gutenberg?<\/dt>\n<dd><p>Yes.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<p>For SEO Writing Assistant SEMrush Custom Fields changelog, please see <a href=\"https:\/\/github.com\/enrico-sorcinelli\/seo-writing-assistant-semrush-custom-fields\/releases\">the Releases page on GitHub<\/a>.<\/p>","raw_excerpt":"The SEMrush SEO Writing Assistant plugin read only from post title and post content elements for the real time check.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/97933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=97933"}],"author":[{"embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/enricosorcinelli"}],"wp:attachment":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=97933"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=97933"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=97933"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=97933"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=97933"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=97933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}