diff --git a/classes/ActionScheduler_AdminView.php b/classes/ActionScheduler_AdminView.php index 0d715f5b..053e7dab 100644 --- a/classes/ActionScheduler_AdminView.php +++ b/classes/ActionScheduler_AdminView.php @@ -250,20 +250,7 @@ public function add_help_tabs() { return; } - $as_version = ActionScheduler_Versions::instance()->latest_version(); - $as_source = ActionScheduler_Versions::instance()->active_source(); - $as_source_path = ActionScheduler_Versions::instance()->active_source_path(); - $as_source_markup = sprintf( '%s', esc_html( $as_source_path ) ); - - if ( ! empty( $as_source ) ) { - $as_source_markup = sprintf( - '%s: %s', - ucfirst( $as_source['type'] ), - esc_attr( $as_source_path ), - esc_html( $as_source['name'] ) - ); - } - + $as_version = ActionScheduler_Versions::instance()->latest_version(); $screen->add_help_tab( array( 'id' => 'action_scheduler_about', @@ -274,11 +261,6 @@ public function add_help_tabs() { '

' . __( 'Action Scheduler is a scalable, traceable job queue for background processing large sets of actions. Action Scheduler works by triggering an action hook to run at some time in the future. Scheduled actions can also be scheduled to run on a recurring schedule.', 'action-scheduler' ) . '

' . - '

' . esc_html__( 'Source', 'action-scheduler' ) . '

' . - '

' . - esc_html__( 'Action Scheduler is currently being loaded from the following location. This can be useful when debugging, or if requested by the support team.', 'action-scheduler' ) . - '

' . - '

' . $as_source_markup . '

' . '

' . esc_html__( 'WP CLI', 'action-scheduler' ) . '

' . '

' . sprintf( diff --git a/classes/ActionScheduler_Versions.php b/classes/ActionScheduler_Versions.php index 3c7bd268..57f4022e 100644 --- a/classes/ActionScheduler_Versions.php +++ b/classes/ActionScheduler_Versions.php @@ -108,79 +108,4 @@ public static function initialize_latest_version() { $self = self::instance(); call_user_func( $self->latest_version_callback() ); } - - /** - * Returns information about the plugin or theme which contains the current active version - * of Action Scheduler. - * - * If this cannot be determined, or if Action Scheduler is being loaded via some other - * method, then it will return an empty array. Otherwise, if populated, the array will - * look like the following: - * - * [ - * 'type' => 'plugin', # or 'theme' - * 'name' => 'Name', - * ] - * - * @return array - */ - public function active_source(): array { - $file = __FILE__; - $dir = __DIR__; - $plugins = get_plugins(); - $plugin_files = array_keys( $plugins ); - - foreach ( $plugin_files as $plugin_file ) { - $plugin_path = trailingslashit( WP_PLUGIN_DIR ) . dirname( $plugin_file ); - $plugin_file = trailingslashit( WP_PLUGIN_DIR ) . $plugin_file; - - if ( 0 !== strpos( dirname( $dir ), $plugin_path ) ) { - continue; - } - - $plugin_data = get_plugin_data( $plugin_file ); - - if ( ! is_array( $plugin_data ) || empty( $plugin_data['Name'] ) ) { - continue; - } - - return array( - 'type' => 'plugin', - 'name' => $plugin_data['Name'], - ); - } - - $themes = (array) search_theme_directories(); - - foreach ( $themes as $slug => $data ) { - $needle = trailingslashit( $data['theme_root'] ) . $slug . '/'; - - if ( 0 !== strpos( $file, $needle ) ) { - continue; - } - - $theme = wp_get_theme( $slug ); - - if ( ! is_object( $theme ) || ! is_a( $theme, \WP_Theme::class ) ) { - continue; - } - - return array( - 'type' => 'theme', - // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase - 'name' => $theme->Name, - ); - } - - return array(); - } - - /** - * Returns the directory path for the currently active installation of Action Scheduler. - * - * @return string - */ - public function active_source_path(): string { - return trailingslashit( dirname( __DIR__ ) ); - } }