Skip to content

Commit ca29436

Browse files
fix: uninstall fields=>ids; orchestrator getters + remove duplicate elseif
Co-authored-by: MaximillianGroup <34328348+MaximillianGroup@users.noreply.github.com> Agent-Logs-Url: https://github.com/Starisian-Technologies/sparxstar-gluon/sessions/5c0c8e14-f2cc-4b75-8698-5d469ac130c9
1 parent 394a919 commit ca29436

2 files changed

Lines changed: 43 additions & 4 deletions

File tree

src/SparxstarGluonOrchestrator.php

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@ private function gluonInitDependency( string $dependency ): void {
193193
$this->dependencies[ $dependency ] = $dependency::gluonGetInstance();
194194
} elseif ( method_exists( $dependency, 'getInstance' ) ) {
195195
$this->dependencies[ $dependency ] = $dependency::getInstance();
196-
} elseif ( method_exists( $dependency, 'getInstance' ) ) {
197-
$this->dependencies[ $dependency ] = $dependency::getInstance();
198196
} else {
199197
$this->dependencies[ $dependency ] = new $dependency();
200198
}
@@ -244,6 +242,46 @@ public static function gluonRun(): void {
244242
self::gluonGetInstance();
245243
}
246244

245+
/**
246+
* Returns the absolute path to the plugin directory.
247+
*
248+
* @since 1.0.0
249+
* @return string Plugin directory path (trailing slash included).
250+
*/
251+
public function gluonGetPluginPath(): string {
252+
return $this->pluginPath;
253+
}
254+
255+
/**
256+
* Returns the URL to the plugin directory.
257+
*
258+
* @since 1.0.0
259+
* @return string Plugin directory URL (trailing slash included).
260+
*/
261+
public function gluonGetPluginUrl(): string {
262+
return $this->pluginUrl;
263+
}
264+
265+
/**
266+
* Returns the current plugin version string.
267+
*
268+
* @since 1.0.0
269+
* @return string Plugin version (e.g. '1.0.0').
270+
*/
271+
public function gluonGetVersion(): string {
272+
return $this->version;
273+
}
274+
275+
/**
276+
* Returns the plugin display name.
277+
*
278+
* @since 1.0.0
279+
* @return string Plugin name.
280+
*/
281+
public function gluonGetPluginName(): string {
282+
return $this->pluginName;
283+
}
284+
247285
/**
248286
* Prevent cloning of the instance.
249287
*

uninstall.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@
5151
array(
5252
'number' => $batch_size,
5353
'offset' => $offset,
54+
'fields' => 'ids',
5455
)
5556
);
5657

57-
foreach ( $sites as $site ) {
58-
switch_to_blog( (int) $site->blog_id );
58+
foreach ( $sites as $site_id ) {
59+
switch_to_blog( (int) $site_id );
5960

6061
if ( SPARXSTAR_GLUON_DELETE_ON_UNINSTALL ) {
6162
delete_option( 'sparxstar_gluon_settings' );

0 commit comments

Comments
 (0)