::getClassInstance(PostSaver::class, static::$postSaver);
}
/** @return UrlSaver */
public static function urlSaver(): UrlSaver {
return static::getClassInstance(UrlSaver::class, static::$urlSaver);
}
/** @return ToolsController */
public static function toolsController(): ToolsController {
return static::getClassInstance(ToolsController::class, static::$toolsController);
}
/** @return DashboardController */
public static function dashboardController(): DashboardController {
return static::getClassInstance(DashboardController::class, static::$dashboardController);
}
/** @return AssetManager */
public static function assetManager(): AssetManager {
return AssetManager::getInstance();
}
/**
* @param bool $fresh True if a fresh instance should be returned.
* @return WPTSLMClient
*/
public static function wptslmClient($fresh = false): WPTSLMClient {
if(!static::$wptslmClient || $fresh) {
$client = new WPTSLMClient(
_wpcc('Content Crawler'),
'wp-content-crawler',
'plugin',
'http://wpcontentcrawler.com/api/wptslm/v1',
Utils::getPluginFilePath(),
Environment::appDomain()
);
$client->setUrlHowToFindLicenseKey('https://help.market.envato.com/hc/en-us/articles/202822600-Where-Is-My-Purchase-Code-');
$client->setIsProductPageCallback(function() {
return Utils::isPluginPage();
});
static::$wptslmClient = $client;
}
return static::$wptslmClient;
}
/** @return Filesystem */
public static function fileSystem(): Filesystem {
return static::getClassInstance(Filesystem::class, static::$fs);
}
/**
* @return SettingRegistryService
* @since 1.9.0
*/
public static function settingRegistryService(): SettingRegistryService {
return SettingRegistryService::getInstance();
}
/**
* Create or get instance of a class. A wrapper method to work with singletons. You need to import the class
* with "use" before calling this method.
*
* @param string $className Name of the class. E.g. MyClass::class
* @param mixed $staticVar A static variable that will store the instance of the class
* @return mixed A singleton of the class
*/
private static function getClassInstance($className, &$staticVar) {
if(!$staticVar) {
$staticVar = new $className();
// var_dump("$className instance created.");
}
return $staticVar;
}
}
Fatal error: Uncaught Error: Class 'WPCCrawler\Factory' not found in /home/islamicf/public_html/wp-content/plugins/wp-content-crawler/app/WPCCrawler.php:62
Stack trace:
#0 /home/islamicf/public_html/wp-content/plugins/wp-content-crawler/app/WPCCrawler.php(44): WPCCrawler\WPCCrawler->__construct()
#1 /home/islamicf/public_html/wp-content/plugins/wp-content-crawler/wp-content-crawler.php(28): WPCCrawler\WPCCrawler::getInstance()
#2 /home/islamicf/public_html/wp-settings.php(473): include_once('/home/islamicf/...')
#3 /home/islamicf/public_html/wp-config.php(99): require_once('/home/islamicf/...')
#4 /home/islamicf/public_html/wp-load.php(50): require_once('/home/islamicf/...')
#5 /home/islamicf/public_html/wp-blog-header.php(13): require_once('/home/islamicf/...')
#6 /home/islamicf/public_html/index.php(17): require('/home/islamicf/...')
#7 {main}
thrown in /home/islamicf/public_html/wp-content/plugins/wp-content-crawler/app/WPCCrawler.php on line 62