Skip to content

Commit 49968f5

Browse files
committed
plugin update from github on process
1 parent 50ff9bb commit 49968f5

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

cbxcareertoolkit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
*
1010
* @wordpress-plugin
1111
* Plugin Name: CBX career Toolkit
12-
* Plugin URI: https://codeboxr.com/product/cbxjob-proaddon-for-wordpress/
12+
* Plugin URI: https://github.com/codeboxrcodehub/cbxcareertoolkit/
1313
* Description: Making Test Case For Development!
14-
* Version: v1.0.0
14+
* Version: 1.0.0
1515
* Author: Codeboxr
1616
* Author URI: https://codeboxr.com
1717
* License: GPL-2.0+

includes/PDUpdater.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private function get_repository_info()
6666
]);
6767

6868
$response = curl_exec($curl);
69-
69+
//write_log($response);
7070
// print_r($response);
7171
// exit;
7272

@@ -112,6 +112,8 @@ public function modify_transient($transient)
112112
'package' => $new_files,
113113
'new_version' => $this->github_response['tag_name']
114114
];
115+
write_log($plugin);
116+
write_log($this->plugin);
115117

116118
$transient->response[$this->basename] = (object) $plugin;
117119
}
@@ -123,32 +125,34 @@ public function modify_transient($transient)
123125

124126
public function plugin_popup($result, $action, $args)
125127
{
128+
write_log("called");
126129
if ($action !== 'plugin_information') {
127130
return false;
128131
}
129-
130132
if (!empty($args->slug)) {
131133
if ($args->slug == current(explode('/', $this->basename))) {
132134
$this->get_repository_info();
133-
135+
$slug = current(explode('/', $this->basename));
134136
$plugin = [
135-
'name' => $this->plugin['Name'],
136-
'slug' => $this->basename,
137+
'name' => isset($this->plugin['Name']) ? $this->plugin['Name'] : '',
138+
'slug' => $slug,
137139
'requires' => '5.3',
138140
'tested' => '5.4',
139141
'version' => $this->github_response['tag_name'],
140-
'author' => $this->plugin['AuthorName'],
142+
'author' => $this->plugin['Author'],
141143
'author_profile' => $this->plugin['AuthorURI'],
142144
'last_updated' => $this->github_response['published_at'],
143145
'homepage' => $this->plugin['PluginURI'],
144-
'short_description' => $this->plugin['Description'],
146+
'short_description' => isset($this->plugin['Description']) ? $this->plugin['Description'] : '',
145147
'sections' => [
146-
'Description' => $this->plugin['Description'],
147-
'Updates' => $this->github_response['body'],
148+
'Description' => isset($this->plugin['Description']) ? $this->plugin['Description'] : '',
149+
'Updates' => isset($this->github_response['body']) ? $this->github_response['body'] : '',
148150
],
149151
'download_link' => $this->github_response['zipball_url']
150152
];
151153

154+
write_log($plugin);
155+
152156
return (object) $plugin;
153157
}
154158
}

0 commit comments

Comments
 (0)