PluginProbe ʕ •ᴥ•ʔ
Hostinger Reach – AI-Powered Email Marketing for WordPress / 1.7.0
Hostinger Reach – AI-Powered Email Marketing for WordPress v1.7.0
1.7.2 1.7.1 1.7.0 1.6.0 1.5.9 1.5.8 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 trunk 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6
hostinger-reach / vendor / woocommerce / action-scheduler / classes / ActionScheduler_SystemInformation.php
hostinger-reach / vendor / woocommerce / action-scheduler / classes Last commit date
WP_CLI 9 months ago abstracts 9 months ago actions 9 months ago data-stores 9 months ago migration 9 months ago schedules 9 months ago schema 9 months ago ActionScheduler_ActionClaim.php 9 months ago ActionScheduler_ActionFactory.php 9 months ago ActionScheduler_AdminView.php 9 months ago ActionScheduler_AsyncRequest_QueueRunner.php 9 months ago ActionScheduler_Compatibility.php 9 months ago ActionScheduler_DataController.php 9 months ago ActionScheduler_DateTime.php 9 months ago ActionScheduler_Exception.php 9 months ago ActionScheduler_FatalErrorMonitor.php 9 months ago ActionScheduler_InvalidActionException.php 9 months ago ActionScheduler_ListTable.php 9 months ago ActionScheduler_LogEntry.php 9 months ago ActionScheduler_NullLogEntry.php 9 months ago ActionScheduler_OptionLock.php 9 months ago ActionScheduler_QueueCleaner.php 9 months ago ActionScheduler_QueueRunner.php 9 months ago ActionScheduler_RecurringActionScheduler.php 9 months ago ActionScheduler_SystemInformation.php 9 months ago ActionScheduler_Versions.php 9 months ago ActionScheduler_WPCommentCleaner.php 9 months ago ActionScheduler_wcSystemStatus.php 9 months ago
ActionScheduler_SystemInformation.php
94 lines
1 <?php
2
3 /**
4 * Provides information about active and registered instances of Action Scheduler.
5 */
6 class ActionScheduler_SystemInformation {
7 /**
8 * Returns information about the plugin or theme which contains the current active version
9 * of Action Scheduler.
10 *
11 * If this cannot be determined, or if Action Scheduler is being loaded via some other
12 * method, then it will return an empty array. Otherwise, if populated, the array will
13 * look like the following:
14 *
15 * [
16 * 'type' => 'plugin', # or 'theme'
17 * 'name' => 'Name',
18 * ]
19 *
20 * @return array
21 */
22 public static function active_source(): array {
23 $plugins = get_plugins();
24 $plugin_files = array_keys( $plugins );
25
26 foreach ( $plugin_files as $plugin_file ) {
27 $plugin_path = trailingslashit( WP_PLUGIN_DIR ) . dirname( $plugin_file );
28 $plugin_file = trailingslashit( WP_PLUGIN_DIR ) . $plugin_file;
29
30 if ( 0 !== strpos( dirname( __DIR__ ), $plugin_path ) ) {
31 continue;
32 }
33
34 $plugin_data = get_plugin_data( $plugin_file );
35
36 if ( ! is_array( $plugin_data ) || empty( $plugin_data['Name'] ) ) {
37 continue;
38 }
39
40 return array(
41 'type' => 'plugin',
42 'name' => $plugin_data['Name'],
43 );
44 }
45
46 $themes = (array) search_theme_directories();
47
48 foreach ( $themes as $slug => $data ) {
49 $needle = trailingslashit( $data['theme_root'] ) . $slug . '/';
50
51 if ( 0 !== strpos( __FILE__, $needle ) ) {
52 continue;
53 }
54
55 $theme = wp_get_theme( $slug );
56
57 if ( ! is_object( $theme ) || ! is_a( $theme, \WP_Theme::class ) ) {
58 continue;
59 }
60
61 return array(
62 'type' => 'theme',
63 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
64 'name' => $theme->Name,
65 );
66 }
67
68 return array();
69 }
70
71 /**
72 * Returns the directory path for the currently active installation of Action Scheduler.
73 *
74 * @return string
75 */
76 public static function active_source_path(): string {
77 return trailingslashit( dirname( __DIR__ ) );
78 }
79
80 /**
81 * Get registered sources.
82 *
83 * It is not always possible to obtain this information. For instance, if earlier versions (<=3.9.0) of
84 * Action Scheduler register themselves first, then the necessary data about registered sources will
85 * not be available.
86 *
87 * @return array<string, string>
88 */
89 public static function get_sources() {
90 $versions = ActionScheduler_Versions::instance();
91 return method_exists( $versions, 'get_sources' ) ? $versions->get_sources() : array();
92 }
93 }
94