Skip to content

Commit 864dc98

Browse files
committed
Removed Github auto-updater. Updates are now handled via Spellbook!
1 parent f4d7ea3 commit 864dc98

3 files changed

Lines changed: 2 additions & 135 deletions

File tree

class-gwiz-gf-code-chest.php

Lines changed: 1 addition & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
GFForms::include_feed_addon_framework();
1212

1313
class GWiz_GF_Code_Chest extends GFFeedAddOn {
14-
/**
15-
* @var Inc2734\WP_GitHub_Plugin_Updater\Bootstrap The updater instance.
16-
*/
17-
public $updater;
18-
1914
/**
2015
* @var null|GWiz_GF_Code_Chest
2116
*/
@@ -109,98 +104,18 @@ public function minimum_requirements() {
109104
}
110105

111106
/**
112-
* Load dependencies and initialize auto-updater
107+
* Load dependencies
113108
*/
114109
public function pre_init() {
115110
parent::pre_init();
116111

117-
$this->init_auto_updater();
118-
119112
/**
120113
* Hooks for exporting and importing feeds with forms.
121114
*/
122115
add_filter( 'gform_export_form', array( $this, 'export_feeds_with_form' ) );
123116
add_action( 'gform_forms_post_import', array( $this, 'import_feeds_with_form' ) );
124117
}
125118

126-
/**
127-
* Initialize the auto-updater.
128-
*/
129-
public function init_auto_updater() {
130-
// Initialize GitHub auto-updater
131-
add_filter(
132-
'inc2734_github_plugin_updater_plugins_api_gravitywiz/gf-code-chest',
133-
array( $this, 'filter_auto_updater_response' ), 10, 2
134-
);
135-
136-
$this->updater = new Inc2734\WP_GitHub_Plugin_Updater\Bootstrap(
137-
plugin_basename( plugin_dir_path( __FILE__ ) . 'gf-code-chest.php' ),
138-
'gravitywiz',
139-
'gf-code-chest',
140-
array(
141-
'description_url' => 'https://raw.githubusercontent.com/gravitywiz/gf-code-chest/main/readme.md',
142-
'changelog_url' => 'https://raw.githubusercontent.com/gravitywiz/gf-code-chest/main/changelog.txt',
143-
'icons' => array(
144-
'svg' => 'https://raw.githubusercontent.com/gravitywiz/gf-code-chest/main/assets/images/icon.svg',
145-
'1x' => 'https://raw.githubusercontent.com/gravitywiz/gf-code-chest/main/assets/images/icon-1x.png',
146-
'2x' => 'https://raw.githubusercontent.com/gravitywiz/gf-code-chest/main/assets/images/icon-2x.png',
147-
),
148-
'banners' => array(
149-
'low' => 'https://raw.githubusercontent.com/gravitywiz/gf-code-chest/main/assets/images/banner-low.png',
150-
'high' => 'https://raw.githubusercontent.com/gravitywiz/gf-code-chest/main/assets/images/banner-high.png',
151-
),
152-
'requires_php' => '5.6.0',
153-
)
154-
);
155-
}
156-
157-
/**
158-
* Filter the GitHub auto-updater response to remove sections we don't need and update various fields.
159-
*
160-
* @param stdClass $obj
161-
* @param stdClass $response
162-
*
163-
* @return stdClass
164-
*/
165-
public function filter_auto_updater_response( $obj, $response ) {
166-
$remove_sections = array(
167-
'installation',
168-
'faq',
169-
'screenshots',
170-
'reviews',
171-
'other_notes',
172-
);
173-
174-
foreach ( $remove_sections as $section ) {
175-
if ( isset( $obj->sections[ $section ] ) ) {
176-
unset( $obj->sections[ $section ] );
177-
}
178-
}
179-
180-
if ( isset( $obj->active_installs ) ) {
181-
unset( $obj->active_installs );
182-
}
183-
184-
$obj->homepage = 'https://gravitywiz.com/gf-code-chest/';
185-
$obj->author = '<a href="https://gravitywiz.com/" target="_blank">Gravity Wiz</a>';
186-
187-
$parsedown = new Parsedown();
188-
$changelog = trim( $obj->sections['changelog'] );
189-
190-
// Remove the "Changelog" h1.
191-
$changelog = preg_replace( '/^# Changelog/m', '', $changelog );
192-
193-
// Remove the tab before the list item so it's not treated as code.
194-
$changelog = preg_replace( '/^\t- /m', '- ', $changelog );
195-
196-
// Convert h2 to h4 to avoid weird styles that add a lot of whitespace.
197-
$changelog = preg_replace( '/^## /m', '#### ', $changelog );
198-
199-
$obj->sections['changelog'] = $parsedown->text( $changelog );
200-
201-
return $obj;
202-
}
203-
204119
/**
205120
* Initialize the add-on. Similar to construct, but done later.
206121
*

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"require": {
88
"automattic/jetpack-autoloader": "^5.0.16",
99
"erusev/parsedown": "^1.7",
10-
"inc2734/wp-github-plugin-updater": "^3.0",
1110
"gravitywiz/spellbook-bootstrap": "^0.0.5"
1211
},
1312
"scripts": {

composer.lock

Lines changed: 1 addition & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)