mailpoet
/
vendor
/
woocommerce
/
action-scheduler
/
classes
/
ActionScheduler_SystemInformation.php
WP_CLI
1 year ago
abstracts
1 year ago
actions
1 year ago
data-stores
1 year ago
migration
1 year ago
schedules
1 year ago
schema
1 year ago
ActionScheduler_ActionClaim.php
1 year ago
ActionScheduler_ActionFactory.php
1 year ago
ActionScheduler_AdminView.php
1 year ago
ActionScheduler_AsyncRequest_QueueRunner.php
1 year ago
ActionScheduler_Compatibility.php
1 year ago
ActionScheduler_DataController.php
1 year ago
ActionScheduler_DateTime.php
1 year ago
ActionScheduler_Exception.php
4 years ago
ActionScheduler_FatalErrorMonitor.php
1 year ago
ActionScheduler_InvalidActionException.php
1 year ago
ActionScheduler_ListTable.php
1 year ago
ActionScheduler_LogEntry.php
1 year ago
ActionScheduler_NullLogEntry.php
1 year ago
ActionScheduler_OptionLock.php
2 years ago
ActionScheduler_QueueCleaner.php
1 year ago
ActionScheduler_QueueRunner.php
1 year ago
ActionScheduler_SystemInformation.php
1 year ago
ActionScheduler_Versions.php
1 year ago
ActionScheduler_WPCommentCleaner.php
1 year ago
ActionScheduler_wcSystemStatus.php
4 years ago
index.php
3 years ago
ActionScheduler_SystemInformation.php
48 lines
| 1 | <?php |
| 2 | if (!defined('ABSPATH')) exit; |
| 3 | class ActionScheduler_SystemInformation { |
| 4 | public static function active_source(): array { |
| 5 | $plugins = get_plugins(); |
| 6 | $plugin_files = array_keys( $plugins ); |
| 7 | foreach ( $plugin_files as $plugin_file ) { |
| 8 | $plugin_path = trailingslashit( WP_PLUGIN_DIR ) . dirname( $plugin_file ); |
| 9 | $plugin_file = trailingslashit( WP_PLUGIN_DIR ) . $plugin_file; |
| 10 | if ( 0 !== strpos( dirname( __DIR__ ), $plugin_path ) ) { |
| 11 | continue; |
| 12 | } |
| 13 | $plugin_data = get_plugin_data( $plugin_file ); |
| 14 | if ( ! is_array( $plugin_data ) || empty( $plugin_data['Name'] ) ) { |
| 15 | continue; |
| 16 | } |
| 17 | return array( |
| 18 | 'type' => 'plugin', |
| 19 | 'name' => $plugin_data['Name'], |
| 20 | ); |
| 21 | } |
| 22 | $themes = (array) search_theme_directories(); |
| 23 | foreach ( $themes as $slug => $data ) { |
| 24 | $needle = trailingslashit( $data['theme_root'] ) . $slug . '/'; |
| 25 | if ( 0 !== strpos( __FILE__, $needle ) ) { |
| 26 | continue; |
| 27 | } |
| 28 | $theme = wp_get_theme( $slug ); |
| 29 | if ( ! is_object( $theme ) || ! is_a( $theme, \WP_Theme::class ) ) { |
| 30 | continue; |
| 31 | } |
| 32 | return array( |
| 33 | 'type' => 'theme', |
| 34 | // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase |
| 35 | 'name' => $theme->Name, |
| 36 | ); |
| 37 | } |
| 38 | return array(); |
| 39 | } |
| 40 | public static function active_source_path(): string { |
| 41 | return trailingslashit( dirname( __DIR__ ) ); |
| 42 | } |
| 43 | public static function get_sources() { |
| 44 | $versions = ActionScheduler_Versions::instance(); |
| 45 | return method_exists( $versions, 'get_sources' ) ? $versions->get_sources() : array(); |
| 46 | } |
| 47 | } |
| 48 |