{"action":"opened","issue":{"url":"https://api.github.com/repos/sybrew/the-seo-framework/issues/339","repository_url":"https://api.github.com/repos/sybrew/the-seo-framework","labels_url":"https://api.github.com/repos/sybrew/the-seo-framework/issues/339/labels{/name}","comments_url":"https://api.github.com/repos/sybrew/the-seo-framework/issues/339/comments","events_url":"https://api.github.com/repos/sybrew/the-seo-framework/issues/339/events","html_url":"https://github.com/sybrew/the-seo-framework/issues/339","id":344444032,"node_id":"MDU6SXNzdWUzNDQ0NDQwMzI=","number":339,"title":"Problems with this plugin overwriting robots.txt","user":{"login":"l3ku","id":24781811,"node_id":"MDQ6VXNlcjI0NzgxODEx","avatar_url":"https://avatars0.githubusercontent.com/u/24781811?v=4","gravatar_id":"","url":"https://api.github.com/users/l3ku","html_url":"https://github.com/l3ku","followers_url":"https://api.github.com/users/l3ku/followers","following_url":"https://api.github.com/users/l3ku/following{/other_user}","gists_url":"https://api.github.com/users/l3ku/gists{/gist_id}","starred_url":"https://api.github.com/users/l3ku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l3ku/subscriptions","organizations_url":"https://api.github.com/users/l3ku/orgs","repos_url":"https://api.github.com/users/l3ku/repos","events_url":"https://api.github.com/users/l3ku/events{/privacy}","received_events_url":"https://api.github.com/users/l3ku/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-25T13:29:24Z","updated_at":"2018-07-25T13:29:24Z","closed_at":null,"author_association":"NONE","body":"I recently discovered that using the WP core filter `robots_txt` with default parameters no longer works when using a self-made plugin after activating The Seo Framework. Here is the code I use in my own plugin:\r\n```\r\nadd_filter( 'robots_txt', array( $this, 'custom_plugin_disallow_index' ) );\r\n```\r\nI found out that the problem originates from: https://github.com/sybrew/the-seo-framework/blob/e03888baa24b08deac108dadf341ae48aada828c/inc/classes/init.class.php#L648-L654\r\nAs can be clearly seen, the robots.txt output created in the function is not appended to the existing robots.txt content passed to the function, but completely overwritten. I was able to temporarily solve this problem by using a higher hook priority (11) than the default 10 in my own plugin:\r\n```\r\nadd_filter( 'robots_txt', array( $this, 'custom_plugin_disallow_index' ), 11 );\r\n```\r\nI think that it is not good behaviour to overwrite the robots.txt content, as solving this problem required me to look through the code of this plugin to find out what exact priority this plugin uses with the WP core filter `robots_txt`. Or maybe at least provide some option to opt-out of this behaviour."}}
{"actor":{"display_login":"l3ku"}}