{"action":"created","comment":{"url":"https://api.github.com/repos/brainstormforce/astra/pulls/comments/333863397","pull_request_review_id":300514765,"id":333863397,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMzMzg2MzM5Nw==","diff_hunk":"@@ -0,0 +1,196 @@\n+<?php\n+/**\n+ * Theme Batch Update\n+ *\n+ * @package     Astra\n+ * @author      Astra\n+ * @copyright   Copyright (c) 2019, Astra\n+ * @link        https://wpastra.com/\n+ * @since x.x.x\n+ */\n+\n+if ( ! class_exists( 'Astra_Theme_Background_Updater' ) ) {\n+\n+\t/**\n+\t * Astra_Theme_Background_Updater Class.\n+\t */\n+\tclass Astra_Theme_Background_Updater {\n+\n+\t\t/**\n+\t\t * Background update class.\n+\t\t *\n+\t\t * @var object\n+\t\t */\n+\t\tprivate static $background_updater;\n+\n+\t\t/**\n+\t\t * DB updates and callbacks that need to be run per version.\n+\t\t *\n+\t\t * @var array\n+\t\t */\n+\t\tprivate static $db_updates = array();\n+\n+\t\t/**\n+\t\t *  Constructor\n+\t\t */\n+\t\tpublic function __construct() {\n+\n+\t\t\t// Theme Updates.\n+\t\t\tif ( is_admin() ) {\n+\t\t\t\tadd_action( 'admin_init', array( $this, 'install_actions' ) );\n+\t\t\t} else {\n+\t\t\t\tadd_action( 'wp', array( $this, 'install_actions' ) );\n+\t\t\t}\n+\n+\t\t\t// Core Helpers - Batch Processing.\n+\t\t\trequire_once ASTRA_THEME_DIR . 'inc/theme-update/batch-processing/class-wp-async-request.php';\n+\t\t\trequire_once ASTRA_THEME_DIR . 'inc/theme-update/batch-processing/class-wp-background-process.php';\n+\t\t\trequire_once ASTRA_THEME_DIR . 'inc/theme-update/batch-processing/class-wp-background-process-astra-theme.php';\n+\n+\t\t\tself::$background_updater = new WP_Background_Process_Astra_Theme();\n+\n+\t\t}\n+\n+\t\t/**\n+\t\t * Install actions when a update button is clicked within the admin area.\n+\t\t *\n+\t\t * This function is hooked into admin_init to affect admin and wp to affect the frontend.\n+\t\t */\n+\t\tpublic function install_actions() {\n+\n+\t\t\tdo_action( 'astra_update_initiated', self::$background_updater );\n+\n+\t\t\tif ( true === $this->is_new_install() ) {\n+\t\t\t\tself::update_db_version();\n+\t\t\t\treturn;\n+\t\t\t}\n+\n+\t\t\tif ( $this->needs_db_update() ) {\n+\t\t\t\t$this->update();\n+\t\t\t} else {\n+\t\t\t\tself::update_db_version();\n+\t\t\t}\n+\t\t}\n+\n+\t\t/**\n+\t\t * Is this a brand new theme install?\n+\t\t *\n+\t\t * @since x.x.x\n+\t\t * @return boolean\n+\t\t */\n+\t\tprivate function is_new_install() {","path":"inc/theme-update/class-astra-theme-background-updater.php","position":null,"original_position":81,"commit_id":"d6c6fe4972357a11d34ddcfe19a280aecc5328f3","original_commit_id":"a11d8659ffbce12e5e3e294c3fcc6ecb9b0839a1","user":{"login":"premanshup","id":36841355,"node_id":"MDQ6VXNlcjM2ODQxMzU1","avatar_url":"https://avatars3.githubusercontent.com/u/36841355?v=4","gravatar_id":"","url":"https://api.github.com/users/premanshup","html_url":"https://github.com/premanshup","followers_url":"https://api.github.com/users/premanshup/followers","following_url":"https://api.github.com/users/premanshup/following{/other_user}","gists_url":"https://api.github.com/users/premanshup/gists{/gist_id}","starred_url":"https://api.github.com/users/premanshup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/premanshup/subscriptions","organizations_url":"https://api.github.com/users/premanshup/orgs","repos_url":"https://api.github.com/users/premanshup/repos","events_url":"https://api.github.com/users/premanshup/events{/privacy}","received_events_url":"https://api.github.com/users/premanshup/received_events","type":"User","site_admin":false},"body":"As per the discussion, We won't be needing this function globally so we can keep it here only.","created_at":"2019-10-11T07:39:48Z","updated_at":"2019-10-11T07:39:56Z","html_url":"https://github.com/brainstormforce/astra/pull/1240#discussion_r333863397","pull_request_url":"https://api.github.com/repos/brainstormforce/astra/pulls/1240","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/brainstormforce/astra/pulls/comments/333863397"},"html":{"href":"https://github.com/brainstormforce/astra/pull/1240#discussion_r333863397"},"pull_request":{"href":"https://api.github.com/repos/brainstormforce/astra/pulls/1240"}},"in_reply_to_id":315038694},"pull_request":{"url":"https://api.github.com/repos/brainstormforce/astra/pulls/1240","id":291520349,"node_id":"MDExOlB1bGxSZXF1ZXN0MjkxNTIwMzQ5","html_url":"https://github.com/brainstormforce/astra/pull/1240","diff_url":"https://github.com/brainstormforce/astra/pull/1240.diff","patch_url":"https://github.com/brainstormforce/astra/pull/1240.patch","issue_url":"https://api.github.com/repos/brainstormforce/astra/issues/1240","number":1240,"state":"open","locked":false,"title":"refactor: batch processing","user":{"login":"Balachandark","id":23450451,"node_id":"MDQ6VXNlcjIzNDUwNDUx","avatar_url":"https://avatars3.githubusercontent.com/u/23450451?v=4","gravatar_id":"","url":"https://api.github.com/users/Balachandark","html_url":"https://github.com/Balachandark","followers_url":"https://api.github.com/users/Balachandark/followers","following_url":"https://api.github.com/users/Balachandark/following{/other_user}","gists_url":"https://api.github.com/users/Balachandark/gists{/gist_id}","starred_url":"https://api.github.com/users/Balachandark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Balachandark/subscriptions","organizations_url":"https://api.github.com/users/Balachandark/orgs","repos_url":"https://api.github.com/users/Balachandark/repos","events_url":"https://api.github.com/users/Balachandark/events{/privacy}","received_events_url":"https://api.github.com/users/Balachandark/received_events","type":"User","site_admin":false},"body":"* Added background updater class for processing all the future DB migrations functions in batches.","created_at":"2019-06-25T11:54:56Z","updated_at":"2019-10-11T07:39:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c700d3cb40f867ae63fe3bc3031436565dcc34c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1498504277,"node_id":"MDU6TGFiZWwxNDk4NTA0Mjc3","url":"https://api.github.com/repos/brainstormforce/astra/labels/needs-review","name":"needs-review","color":"731d99","default":false}],"milestone":{"url":"https://api.github.com/repos/brainstormforce/astra/milestones/16","html_url":"https://github.com/brainstormforce/astra/milestone/16","labels_url":"https://api.github.com/repos/brainstormforce/astra/milestones/16/labels","id":4535622,"node_id":"MDk6TWlsZXN0b25lNDUzNTYyMg==","number":16,"title":"2.2.0","description":null,"creator":{"login":"patilvikasj","id":10000232,"node_id":"MDQ6VXNlcjEwMDAwMjMy","avatar_url":"https://avatars0.githubusercontent.com/u/10000232?v=4","gravatar_id":"","url":"https://api.github.com/users/patilvikasj","html_url":"https://github.com/patilvikasj","followers_url":"https://api.github.com/users/patilvikasj/followers","following_url":"https://api.github.com/users/patilvikasj/following{/other_user}","gists_url":"https://api.github.com/users/patilvikasj/gists{/gist_id}","starred_url":"https://api.github.com/users/patilvikasj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patilvikasj/subscriptions","organizations_url":"https://api.github.com/users/patilvikasj/orgs","repos_url":"https://api.github.com/users/patilvikasj/repos","events_url":"https://api.github.com/users/patilvikasj/events{/privacy}","received_events_url":"https://api.github.com/users/patilvikasj/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":14,"state":"open","created_at":"2019-07-31T07:21:34Z","updated_at":"2019-10-11T05:16:11Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/brainstormforce/astra/pulls/1240/commits","review_comments_url":"https://api.github.com/repos/brainstormforce/astra/pulls/1240/comments","review_comment_url":"https://api.github.com/repos/brainstormforce/astra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/brainstormforce/astra/issues/1240/comments","statuses_url":"https://api.github.com/repos/brainstormforce/astra/statuses/d6c6fe4972357a11d34ddcfe19a280aecc5328f3","head":{"label":"brainstormforce:batch-processing","ref":"batch-processing","sha":"d6c6fe4972357a11d34ddcfe19a280aecc5328f3","user":{"login":"brainstormforce","id":4979824,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5Nzk4MjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/4979824?v=4","gravatar_id":"","url":"https://api.github.com/users/brainstormforce","html_url":"https://github.com/brainstormforce","followers_url":"https://api.github.com/users/brainstormforce/followers","following_url":"https://api.github.com/users/brainstormforce/following{/other_user}","gists_url":"https://api.github.com/users/brainstormforce/gists{/gist_id}","starred_url":"https://api.github.com/users/brainstormforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brainstormforce/subscriptions","organizations_url":"https://api.github.com/users/brainstormforce/orgs","repos_url":"https://api.github.com/users/brainstormforce/repos","events_url":"https://api.github.com/users/brainstormforce/events{/privacy}","received_events_url":"https://api.github.com/users/brainstormforce/received_events","type":"Organization","site_admin":false},"repo":{"id":88477815,"node_id":"MDEwOlJlcG9zaXRvcnk4ODQ3NzgxNQ==","name":"astra","full_name":"brainstormforce/astra","private":false,"owner":{"login":"brainstormforce","id":4979824,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5Nzk4MjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/4979824?v=4","gravatar_id":"","url":"https://api.github.com/users/brainstormforce","html_url":"https://github.com/brainstormforce","followers_url":"https://api.github.com/users/brainstormforce/followers","following_url":"https://api.github.com/users/brainstormforce/following{/other_user}","gists_url":"https://api.github.com/users/brainstormforce/gists{/gist_id}","starred_url":"https://api.github.com/users/brainstormforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brainstormforce/subscriptions","organizations_url":"https://api.github.com/users/brainstormforce/orgs","repos_url":"https://api.github.com/users/brainstormforce/repos","events_url":"https://api.github.com/users/brainstormforce/events{/privacy}","received_events_url":"https://api.github.com/users/brainstormforce/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/brainstormforce/astra","description":"A very lightweight and beautiful theme made to work with Page Builders.","fork":false,"url":"https://api.github.com/repos/brainstormforce/astra","forks_url":"https://api.github.com/repos/brainstormforce/astra/forks","keys_url":"https://api.github.com/repos/brainstormforce/astra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brainstormforce/astra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brainstormforce/astra/teams","hooks_url":"https://api.github.com/repos/brainstormforce/astra/hooks","issue_events_url":"https://api.github.com/repos/brainstormforce/astra/issues/events{/number}","events_url":"https://api.github.com/repos/brainstormforce/astra/events","assignees_url":"https://api.github.com/repos/brainstormforce/astra/assignees{/user}","branches_url":"https://api.github.com/repos/brainstormforce/astra/branches{/branch}","tags_url":"https://api.github.com/repos/brainstormforce/astra/tags","blobs_url":"https://api.github.com/repos/brainstormforce/astra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brainstormforce/astra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brainstormforce/astra/git/refs{/sha}","trees_url":"https://api.github.com/repos/brainstormforce/astra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brainstormforce/astra/statuses/{sha}","languages_url":"https://api.github.com/repos/brainstormforce/astra/languages","stargazers_url":"https://api.github.com/repos/brainstormforce/astra/stargazers","contributors_url":"https://api.github.com/repos/brainstormforce/astra/contributors","subscribers_url":"https://api.github.com/repos/brainstormforce/astra/subscribers","subscription_url":"https://api.github.com/repos/brainstormforce/astra/subscription","commits_url":"https://api.github.com/repos/brainstormforce/astra/commits{/sha}","git_commits_url":"https://api.github.com/repos/brainstormforce/astra/git/commits{/sha}","comments_url":"https://api.github.com/repos/brainstormforce/astra/comments{/number}","issue_comment_url":"https://api.github.com/repos/brainstormforce/astra/issues/comments{/number}","contents_url":"https://api.github.com/repos/brainstormforce/astra/contents/{+path}","compare_url":"https://api.github.com/repos/brainstormforce/astra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brainstormforce/astra/merges","archive_url":"https://api.github.com/repos/brainstormforce/astra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brainstormforce/astra/downloads","issues_url":"https://api.github.com/repos/brainstormforce/astra/issues{/number}","pulls_url":"https://api.github.com/repos/brainstormforce/astra/pulls{/number}","milestones_url":"https://api.github.com/repos/brainstormforce/astra/milestones{/number}","notifications_url":"https://api.github.com/repos/brainstormforce/astra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brainstormforce/astra/labels{/name}","releases_url":"https://api.github.com/repos/brainstormforce/astra/releases{/id}","deployments_url":"https://api.github.com/repos/brainstormforce/astra/deployments","created_at":"2017-04-17T06:16:12Z","updated_at":"2019-10-04T11:03:26Z","pushed_at":"2019-10-10T14:15:09Z","git_url":"git://github.com/brainstormforce/astra.git","ssh_url":"git@github.com:brainstormforce/astra.git","clone_url":"https://github.com/brainstormforce/astra.git","svn_url":"https://github.com/brainstormforce/astra","homepage":"https://wpastra.com/","size":13548,"stargazers_count":147,"watchers_count":147,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":49,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":85,"license":null,"forks":49,"open_issues":85,"watchers":147,"default_branch":"master"}},"base":{"label":"brainstormforce:next-release","ref":"next-release","sha":"196f2a57ffc61c303f5695159fa8334893e4e29f","user":{"login":"brainstormforce","id":4979824,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5Nzk4MjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/4979824?v=4","gravatar_id":"","url":"https://api.github.com/users/brainstormforce","html_url":"https://github.com/brainstormforce","followers_url":"https://api.github.com/users/brainstormforce/followers","following_url":"https://api.github.com/users/brainstormforce/following{/other_user}","gists_url":"https://api.github.com/users/brainstormforce/gists{/gist_id}","starred_url":"https://api.github.com/users/brainstormforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brainstormforce/subscriptions","organizations_url":"https://api.github.com/users/brainstormforce/orgs","repos_url":"https://api.github.com/users/brainstormforce/repos","events_url":"https://api.github.com/users/brainstormforce/events{/privacy}","received_events_url":"https://api.github.com/users/brainstormforce/received_events","type":"Organization","site_admin":false},"repo":{"id":88477815,"node_id":"MDEwOlJlcG9zaXRvcnk4ODQ3NzgxNQ==","name":"astra","full_name":"brainstormforce/astra","private":false,"owner":{"login":"brainstormforce","id":4979824,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5Nzk4MjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/4979824?v=4","gravatar_id":"","url":"https://api.github.com/users/brainstormforce","html_url":"https://github.com/brainstormforce","followers_url":"https://api.github.com/users/brainstormforce/followers","following_url":"https://api.github.com/users/brainstormforce/following{/other_user}","gists_url":"https://api.github.com/users/brainstormforce/gists{/gist_id}","starred_url":"https://api.github.com/users/brainstormforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brainstormforce/subscriptions","organizations_url":"https://api.github.com/users/brainstormforce/orgs","repos_url":"https://api.github.com/users/brainstormforce/repos","events_url":"https://api.github.com/users/brainstormforce/events{/privacy}","received_events_url":"https://api.github.com/users/brainstormforce/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/brainstormforce/astra","description":"A very lightweight and beautiful theme made to work with Page Builders.","fork":false,"url":"https://api.github.com/repos/brainstormforce/astra","forks_url":"https://api.github.com/repos/brainstormforce/astra/forks","keys_url":"https://api.github.com/repos/brainstormforce/astra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brainstormforce/astra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brainstormforce/astra/teams","hooks_url":"https://api.github.com/repos/brainstormforce/astra/hooks","issue_events_url":"https://api.github.com/repos/brainstormforce/astra/issues/events{/number}","events_url":"https://api.github.com/repos/brainstormforce/astra/events","assignees_url":"https://api.github.com/repos/brainstormforce/astra/assignees{/user}","branches_url":"https://api.github.com/repos/brainstormforce/astra/branches{/branch}","tags_url":"https://api.github.com/repos/brainstormforce/astra/tags","blobs_url":"https://api.github.com/repos/brainstormforce/astra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brainstormforce/astra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brainstormforce/astra/git/refs{/sha}","trees_url":"https://api.github.com/repos/brainstormforce/astra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brainstormforce/astra/statuses/{sha}","languages_url":"https://api.github.com/repos/brainstormforce/astra/languages","stargazers_url":"https://api.github.com/repos/brainstormforce/astra/stargazers","contributors_url":"https://api.github.com/repos/brainstormforce/astra/contributors","subscribers_url":"https://api.github.com/repos/brainstormforce/astra/subscribers","subscription_url":"https://api.github.com/repos/brainstormforce/astra/subscription","commits_url":"https://api.github.com/repos/brainstormforce/astra/commits{/sha}","git_commits_url":"https://api.github.com/repos/brainstormforce/astra/git/commits{/sha}","comments_url":"https://api.github.com/repos/brainstormforce/astra/comments{/number}","issue_comment_url":"https://api.github.com/repos/brainstormforce/astra/issues/comments{/number}","contents_url":"https://api.github.com/repos/brainstormforce/astra/contents/{+path}","compare_url":"https://api.github.com/repos/brainstormforce/astra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brainstormforce/astra/merges","archive_url":"https://api.github.com/repos/brainstormforce/astra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brainstormforce/astra/downloads","issues_url":"https://api.github.com/repos/brainstormforce/astra/issues{/number}","pulls_url":"https://api.github.com/repos/brainstormforce/astra/pulls{/number}","milestones_url":"https://api.github.com/repos/brainstormforce/astra/milestones{/number}","notifications_url":"https://api.github.com/repos/brainstormforce/astra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brainstormforce/astra/labels{/name}","releases_url":"https://api.github.com/repos/brainstormforce/astra/releases{/id}","deployments_url":"https://api.github.com/repos/brainstormforce/astra/deployments","created_at":"2017-04-17T06:16:12Z","updated_at":"2019-10-04T11:03:26Z","pushed_at":"2019-10-10T14:15:09Z","git_url":"git://github.com/brainstormforce/astra.git","ssh_url":"git@github.com:brainstormforce/astra.git","clone_url":"https://github.com/brainstormforce/astra.git","svn_url":"https://github.com/brainstormforce/astra","homepage":"https://wpastra.com/","size":13548,"stargazers_count":147,"watchers_count":147,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":49,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":85,"license":null,"forks":49,"open_issues":85,"watchers":147,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/brainstormforce/astra/pulls/1240"},"html":{"href":"https://github.com/brainstormforce/astra/pull/1240"},"issue":{"href":"https://api.github.com/repos/brainstormforce/astra/issues/1240"},"comments":{"href":"https://api.github.com/repos/brainstormforce/astra/issues/1240/comments"},"review_comments":{"href":"https://api.github.com/repos/brainstormforce/astra/pulls/1240/comments"},"review_comment":{"href":"https://api.github.com/repos/brainstormforce/astra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/brainstormforce/astra/pulls/1240/commits"},"statuses":{"href":"https://api.github.com/repos/brainstormforce/astra/statuses/d6c6fe4972357a11d34ddcfe19a280aecc5328f3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"premanshup"}}