{"action":"created","comment":{"url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/pulls/comments/85714215","pull_request_review_id":6411859,"id":85714215,"diff_hunk":"@@ -0,0 +1,305 @@\n+<?php\n+/**\n+* Plugin Name: Remove Footer Links\n+* Description: Remove Footer Links will try to remove site info and copyright info from your footer.\n+* Version:     1.0.1\n+* Runtime:     5.3+\n+* Author:      Easy Blog Networks\n+* Author URI:  www.easyblognetworks.com\n+*/\n+\n+if (version_compare(PHP_VERSION, '5.3.0', '<')) {\n+    ?>\n+    <div id=\"error-page\">\n+        <p>This plugin requires PHP 5.3.0 or higher. Please contact your hosting provider about upgrading your\n+            server software. Your PHP version is <b><?php echo PHP_VERSION; ?></b></p>\n+    </div>\n+    <?php\n+    die();\n+}\n+\n+// How do you debug your AJAX calls, how do you sleep at night?\n+function d($s, $d = 0) {\n+    $f = fopen('/tmp/yolo.txt', 'a+');\n+    if ($d) {\n+        fwrite($f, print_r($s, 1) . \"\\n\");\n+    } else {\n+        fwrite($f, $s . \"\\n\");\n+    }\n+    fclose($f);\n+}\n+\n+class FooterLinks\n+{\n+    private $themes_root = '';\n+    private $parent_dir = '';\n+    private $child_dir = '';\n+    private $child_stylesheet = '';\n+    private $child_functions = '';\n+    private $child_name = '';\n+\n+    const OptionName = 'Niteoweb.FooterLinks.Themes';\n+    const nonce = 'Niteoweb.FooterLinks.Nonce';\n+    const CheckHook = 'Niteoweb.FooterLinks.CheckHook';\n+\n+    function __construct()\n+    {\n+        if (is_admin()) {\n+            add_action('admin_notices', array(&$this, 'activatePluginNotice'));\n+            add_action('admin_menu', array(&$this, 'adminMenu'));\n+            add_action('wp_ajax_NFL-patch_theme', array(&$this, 'patchTheme'));\n+        }\n+\n+        $this->themes_root = FooterLinks::joinPaths(ABSPATH, 'wp-content', 'themes');\n+    }\n+\n+    function generateRewriteRules($wp_rewrite)\n+    {\n+        // Protect plugin from direct access\n+        $wp_rewrite->add_external_rule($this->pluginURL() . 'index.php', 'index.php%{REQUEST_URI}');\n+        $wp_rewrite->add_external_rule($this->pluginURL() . 'readme.txt', 'index.php%{REQUEST_URI}');\n+        $wp_rewrite->add_external_rule($this->pluginURL(), 'index.php%{REQUEST_URI}');\n+    }\n+\n+    /**\n+     * @codeCoverageIgnore\n+     * @return string\n+     */\n+    private function pluginURL()\n+    {\n+        $url = wp_make_link_relative(plugin_dir_url(__FILE__));\n+        $url = ltrim($url, \"/\");\n+\n+        return $url;\n+    }\n+\n+    function adminMenu()\n+    {\n+        add_management_page(\n+            'FooterLinks', 'FooterLinks', 'manage_options', 'ni_footer_links', array(\n+                &$this,\n+                'viewHandler'\n+            )\n+        );\n+    }\n+\n+    /**\n+     * @codeCoverageIgnore\n+     */\n+    function activatePluginNotice()\n+    {\n+        if (get_option('nfl_activation') != 'EXTERMINATE') { // Let's display the activation message only once\n+            add_option('nfl_activation', 'EXTERMINATE');\n+            ?>\n+            <div class=\"notice notice-success\">\n+                <p>Remove Footer Links plugin has been enabled, you can check your theme in <a\n+                        href=\"<?php echo admin_url('tools.php?page=ni_footer_links'); ?>\">Setting page</a>!</p>\n+            </div>\n+        <?php }\n+    }\n+\n+    /**\n+     * @codeCoverageIgnore\n+     */\n+    function deactivatePlugin()\n+    {\n+        delete_option('nfl_activation');\n+    }\n+\n+    /**\n+     * @codeCoverageIgnore\n+     */\n+    function activatePlugin()\n+    {\n+        if (!FooterLinks::isThemesWritable()) {\n+            $state = FooterLinks::chmodHtaccess();\n+            if (!FooterLinks::isThemesWritable() || !$state) {\n+                ?>\n+                <div id=\"error-page\">\n+                    <p>This plugin requires <b>themes directory</b> that is writable by the server. Please enable write\n+                        access for <b><?php echo $this->themes_root; ?></b>.</p>\n+                </div>\n+                <?php\n+                die();\n+            }\n+        }\n+    }\n+\n+    /**\n+     * @codeCoverageIgnore\n+     * @return bool\n+     */\n+    static function isThemesWritable()\n+    {\n+        return is_writable($$this->themes_root);\n+    }\n+\n+    /**\n+     * @codeCoverageIgnore\n+     * @return string\n+     */\n+    static function joinPaths()\n+    {\n+        $paths = array();\n+\n+        foreach (func_get_args() as $arg) {\n+            if ($arg !== '') {\n+                $paths[] = $arg;\n+            }\n+        }\n+        return preg_replace('#/+#', '/', join('/', $paths));\n+    }\n+\n+    /**\n+     * @codeCoverageIgnore\n+     *\n+     * @param int $mod octet value for chmod\n+     *\n+     * @return bool\n+     */\n+    static function chmodHtaccess($mod = 0644)\n+    {\n+        return chmod($this->themes_root, $mod);\n+    }\n+\n+    function patchTheme()","path":"src/index.php","position":165,"original_position":165,"commit_id":"d286d381a9634a16f3f431dfea7f36dc4bf3e060","original_commit_id":"d286d381a9634a16f3f431dfea7f36dc4bf3e060","user":{"login":"dz0ny","id":239513,"avatar_url":"https://avatars.githubusercontent.com/u/239513?v=3","gravatar_id":"","url":"https://api.github.com/users/dz0ny","html_url":"https://github.com/dz0ny","followers_url":"https://api.github.com/users/dz0ny/followers","following_url":"https://api.github.com/users/dz0ny/following{/other_user}","gists_url":"https://api.github.com/users/dz0ny/gists{/gist_id}","starred_url":"https://api.github.com/users/dz0ny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dz0ny/subscriptions","organizations_url":"https://api.github.com/users/dz0ny/orgs","repos_url":"https://api.github.com/users/dz0ny/repos","events_url":"https://api.github.com/users/dz0ny/events{/privacy}","received_events_url":"https://api.github.com/users/dz0ny/received_events","type":"User","site_admin":false},"body":"function docs please, and probably rewritten to support tests","created_at":"2016-10-31T10:32:12Z","updated_at":"2016-10-31T10:32:43Z","html_url":"https://github.com/niteoweb/Remove-Footer-Links/pull/1#discussion_r85714215","pull_request_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/pulls/comments/85714215"},"html":{"href":"https://github.com/niteoweb/Remove-Footer-Links/pull/1#discussion_r85714215"},"pull_request":{"href":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/pulls/1","id":91585325,"html_url":"https://github.com/niteoweb/Remove-Footer-Links/pull/1","diff_url":"https://github.com/niteoweb/Remove-Footer-Links/pull/1.diff","patch_url":"https://github.com/niteoweb/Remove-Footer-Links/pull/1.patch","issue_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/issues/1","number":1,"state":"open","locked":false,"title":"Add/initial commit","user":{"login":"dz0ny","id":239513,"avatar_url":"https://avatars.githubusercontent.com/u/239513?v=3","gravatar_id":"","url":"https://api.github.com/users/dz0ny","html_url":"https://github.com/dz0ny","followers_url":"https://api.github.com/users/dz0ny/followers","following_url":"https://api.github.com/users/dz0ny/following{/other_user}","gists_url":"https://api.github.com/users/dz0ny/gists{/gist_id}","starred_url":"https://api.github.com/users/dz0ny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dz0ny/subscriptions","organizations_url":"https://api.github.com/users/dz0ny/orgs","repos_url":"https://api.github.com/users/dz0ny/repos","events_url":"https://api.github.com/users/dz0ny/events{/privacy}","received_events_url":"https://api.github.com/users/dz0ny/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-31T10:23:33Z","updated_at":"2016-10-31T10:40:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4eda89761a54828b4a2b29ca12ef03ea046226b0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/pulls/1/commits","review_comments_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/pulls/1/comments","review_comment_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/pulls/comments{/number}","comments_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/issues/1/comments","statuses_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/statuses/d286d381a9634a16f3f431dfea7f36dc4bf3e060","head":{"label":"niteoweb:add/initial-commit","ref":"add/initial-commit","sha":"d286d381a9634a16f3f431dfea7f36dc4bf3e060","user":{"login":"niteoweb","id":1309418,"avatar_url":"https://avatars.githubusercontent.com/u/1309418?v=3","gravatar_id":"","url":"https://api.github.com/users/niteoweb","html_url":"https://github.com/niteoweb","followers_url":"https://api.github.com/users/niteoweb/followers","following_url":"https://api.github.com/users/niteoweb/following{/other_user}","gists_url":"https://api.github.com/users/niteoweb/gists{/gist_id}","starred_url":"https://api.github.com/users/niteoweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niteoweb/subscriptions","organizations_url":"https://api.github.com/users/niteoweb/orgs","repos_url":"https://api.github.com/users/niteoweb/repos","events_url":"https://api.github.com/users/niteoweb/events{/privacy}","received_events_url":"https://api.github.com/users/niteoweb/received_events","type":"Organization","site_admin":false},"repo":{"id":71980034,"name":"Remove-Footer-Links","full_name":"niteoweb/Remove-Footer-Links","owner":{"login":"niteoweb","id":1309418,"avatar_url":"https://avatars.githubusercontent.com/u/1309418?v=3","gravatar_id":"","url":"https://api.github.com/users/niteoweb","html_url":"https://github.com/niteoweb","followers_url":"https://api.github.com/users/niteoweb/followers","following_url":"https://api.github.com/users/niteoweb/following{/other_user}","gists_url":"https://api.github.com/users/niteoweb/gists{/gist_id}","starred_url":"https://api.github.com/users/niteoweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niteoweb/subscriptions","organizations_url":"https://api.github.com/users/niteoweb/orgs","repos_url":"https://api.github.com/users/niteoweb/repos","events_url":"https://api.github.com/users/niteoweb/events{/privacy}","received_events_url":"https://api.github.com/users/niteoweb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/niteoweb/Remove-Footer-Links","description":null,"fork":false,"url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links","forks_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/forks","keys_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/keys{/key_id}","collaborators_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/teams","hooks_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/hooks","issue_events_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/issues/events{/number}","events_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/events","assignees_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/assignees{/user}","branches_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/branches{/branch}","tags_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/tags","blobs_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/git/refs{/sha}","trees_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/git/trees{/sha}","statuses_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/statuses/{sha}","languages_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/languages","stargazers_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/stargazers","contributors_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/contributors","subscribers_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/subscribers","subscription_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/subscription","commits_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/commits{/sha}","git_commits_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/git/commits{/sha}","comments_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/comments{/number}","issue_comment_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/issues/comments{/number}","contents_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/contents/{+path}","compare_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/compare/{base}...{head}","merges_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/merges","archive_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/downloads","issues_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/issues{/number}","pulls_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/pulls{/number}","milestones_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/milestones{/number}","notifications_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/labels{/name}","releases_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/releases{/id}","deployments_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/deployments","created_at":"2016-10-26T08:00:39Z","updated_at":"2016-10-26T08:35:14Z","pushed_at":"2016-10-31T10:23:34Z","git_url":"git://github.com/niteoweb/Remove-Footer-Links.git","ssh_url":"git@github.com:niteoweb/Remove-Footer-Links.git","clone_url":"https://github.com/niteoweb/Remove-Footer-Links.git","svn_url":"https://github.com/niteoweb/Remove-Footer-Links","homepage":null,"size":9,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"niteoweb:master","ref":"master","sha":"f97ebf43dde2391459197f0d60a6116b648cb700","user":{"login":"niteoweb","id":1309418,"avatar_url":"https://avatars.githubusercontent.com/u/1309418?v=3","gravatar_id":"","url":"https://api.github.com/users/niteoweb","html_url":"https://github.com/niteoweb","followers_url":"https://api.github.com/users/niteoweb/followers","following_url":"https://api.github.com/users/niteoweb/following{/other_user}","gists_url":"https://api.github.com/users/niteoweb/gists{/gist_id}","starred_url":"https://api.github.com/users/niteoweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niteoweb/subscriptions","organizations_url":"https://api.github.com/users/niteoweb/orgs","repos_url":"https://api.github.com/users/niteoweb/repos","events_url":"https://api.github.com/users/niteoweb/events{/privacy}","received_events_url":"https://api.github.com/users/niteoweb/received_events","type":"Organization","site_admin":false},"repo":{"id":71980034,"name":"Remove-Footer-Links","full_name":"niteoweb/Remove-Footer-Links","owner":{"login":"niteoweb","id":1309418,"avatar_url":"https://avatars.githubusercontent.com/u/1309418?v=3","gravatar_id":"","url":"https://api.github.com/users/niteoweb","html_url":"https://github.com/niteoweb","followers_url":"https://api.github.com/users/niteoweb/followers","following_url":"https://api.github.com/users/niteoweb/following{/other_user}","gists_url":"https://api.github.com/users/niteoweb/gists{/gist_id}","starred_url":"https://api.github.com/users/niteoweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niteoweb/subscriptions","organizations_url":"https://api.github.com/users/niteoweb/orgs","repos_url":"https://api.github.com/users/niteoweb/repos","events_url":"https://api.github.com/users/niteoweb/events{/privacy}","received_events_url":"https://api.github.com/users/niteoweb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/niteoweb/Remove-Footer-Links","description":null,"fork":false,"url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links","forks_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/forks","keys_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/keys{/key_id}","collaborators_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/teams","hooks_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/hooks","issue_events_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/issues/events{/number}","events_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/events","assignees_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/assignees{/user}","branches_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/branches{/branch}","tags_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/tags","blobs_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/git/refs{/sha}","trees_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/git/trees{/sha}","statuses_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/statuses/{sha}","languages_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/languages","stargazers_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/stargazers","contributors_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/contributors","subscribers_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/subscribers","subscription_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/subscription","commits_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/commits{/sha}","git_commits_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/git/commits{/sha}","comments_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/comments{/number}","issue_comment_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/issues/comments{/number}","contents_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/contents/{+path}","compare_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/compare/{base}...{head}","merges_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/merges","archive_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/downloads","issues_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/issues{/number}","pulls_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/pulls{/number}","milestones_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/milestones{/number}","notifications_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/labels{/name}","releases_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/releases{/id}","deployments_url":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/deployments","created_at":"2016-10-26T08:00:39Z","updated_at":"2016-10-26T08:35:14Z","pushed_at":"2016-10-31T10:23:34Z","git_url":"git://github.com/niteoweb/Remove-Footer-Links.git","ssh_url":"git@github.com:niteoweb/Remove-Footer-Links.git","clone_url":"https://github.com/niteoweb/Remove-Footer-Links.git","svn_url":"https://github.com/niteoweb/Remove-Footer-Links","homepage":null,"size":9,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/pulls/1"},"html":{"href":"https://github.com/niteoweb/Remove-Footer-Links/pull/1"},"issue":{"href":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/issues/1"},"comments":{"href":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/niteoweb/Remove-Footer-Links/statuses/d286d381a9634a16f3f431dfea7f36dc4bf3e060"}}}}
{"actor":{"display_login":"dz0ny"}}