woocommerce-multilingual
/
vendor
/
otgs
/
installer
/
includes
/
class-otgs-installer-debug-info.php
CDTClient
1 month ago
admin-notices
1 month ago
buy-url
1 month ago
debug
1 month ago
exceptions
5 years ago
instances
1 month ago
loader
5 years ago
products
1 month ago
repository
1 month ago
rest
1 month ago
site-key
1 month ago
support
1 month ago
template-service
1 month ago
upgrade
1 month ago
utilities
1 month ago
wpml-content-stats
1 month ago
class-installer-dependencies.php
1 month ago
class-installer-theme.php
1 month ago
class-installer-upgrader-skins.php
1 month ago
class-otgs-installer-autoloader.php
5 years ago
class-otgs-installer-cloned-sites-handler.php
1 month ago
class-otgs-installer-debug-info.php
1 month ago
class-otgs-installer-factory.php
1 month ago
class-otgs-installer-filename-hooks.php
1 month ago
class-otgs-installer-icons.php
1 month ago
class-otgs-installer-loader.php
10 months ago
class-otgs-installer-package-product-finder.php
1 month ago
class-otgs-installer-package-product.php
1 month ago
class-otgs-installer-package.php
5 years ago
class-otgs-installer-php-functions.php
1 month ago
class-otgs-installer-plugin-factory.php
1 month ago
class-otgs-installer-plugin-finder.php
1 month ago
class-otgs-installer-plugin.php
1 month ago
class-otgs-installer-plugins-page-notice.php
1 month ago
class-otgs-installer-plugins-update-cache-cleaner.php
5 years ago
class-otgs-installer-settings.php
1 month ago
class-otgs-installer-source-factory.php
5 years ago
class-otgs-installer-source.php
1 month ago
class-otgs-installer-subscription-factory.php
5 years ago
class-otgs-installer-subscription-warning-message.php
1 month ago
class-otgs-installer-subscription.php
1 month ago
class-otgs-installer-wp-components-hooks.php
1 month ago
class-otgs-installer-wp-components-sender.php
1 month ago
class-otgs-installer-wp-components-setting-ajax.php
1 month ago
class-otgs-installer-wp-components-setting-resources.php
1 month ago
class-otgs-installer-wp-components-storage.php
1 month ago
class-otgs-installer-wp-share-local-components-setting-hooks.php
1 month ago
class-otgs-installer-wp-share-local-components-setting.php
1 month ago
class-translation-service-info.php
1 month ago
class-wp-installer-api.php
1 month ago
class-wp-installer-channels.php
1 month ago
class-wp-installer.php
1 month ago
functions-core.php
1 month ago
functions-templates.php
1 month ago
otgs-installer-autoload-classmap.php
10 months ago
class-otgs-installer-debug-info.php
52 lines
| 1 | <?php |
| 2 | |
| 3 | class OTGS_Installer_Debug_Info { |
| 4 | private $installer; |
| 5 | |
| 6 | private $products_config_storage; |
| 7 | |
| 8 | public function __construct( WP_Installer $installer, OTGS_Products_Config_Db_Storage $products_config_storage ) { |
| 9 | $this->installer = $installer; |
| 10 | $this->products_config_storage = $products_config_storage; |
| 11 | } |
| 12 | |
| 13 | public function add_hooks() { |
| 14 | add_filter( 'icl_get_extra_debug_info', array( $this, 'add_installer_config_in_debug_information' ) ); |
| 15 | } |
| 16 | |
| 17 | public function add_installer_config_in_debug_information( $data ) { |
| 18 | global $wp_installer_instances; |
| 19 | |
| 20 | $repositories_data = array(); |
| 21 | $repositories = $this->installer->get_repositories(); |
| 22 | $repository_settings = $this->installer->get_settings(); |
| 23 | $repository_settings = $repository_settings['repositories']; |
| 24 | |
| 25 | foreach ( $repositories as $repo_id => $repository ) { |
| 26 | $repositories_data[ $repo_id ] = [ |
| 27 | 'api-url' => $repository['api-url'], |
| 28 | 'bucket-url' => $this->prepare_bucket_url( $repo_id ), |
| 29 | 'subscription' => isset( $repository_settings[ $repo_id ]['subscription'] ) ? $repository_settings[ $repo_id ]['subscription'] : '', |
| 30 | 'last-successful-subscription-fetch' => $this->prepare_last_subscription_fetch( $repository_settings, $repo_id ), |
| 31 | ]; |
| 32 | } |
| 33 | |
| 34 | $data['installer'] = array( |
| 35 | 'version' => $this->installer->version(), |
| 36 | 'repositories' => $repositories_data, |
| 37 | 'instances' => $wp_installer_instances, |
| 38 | ); |
| 39 | |
| 40 | return $data; |
| 41 | } |
| 42 | |
| 43 | private function prepare_bucket_url( $repo_id ) { |
| 44 | $bucket_url = $this->products_config_storage->get_repository_products_url( $repo_id ); |
| 45 | return $bucket_url ? $bucket_url : 'not assigned'; |
| 46 | } |
| 47 | |
| 48 | private function prepare_last_subscription_fetch( $repository_settings, $repo_id ) { |
| 49 | return isset( $repository_settings[ $repo_id ]['last_successful_subscription_fetch'] ) ? |
| 50 | date( 'Y-m-d h:i:s', $repository_settings[ $repo_id ]['last_successful_subscription_fetch'] ) : 'none'; |
| 51 | } |
| 52 | } |