Viewing File: /usr/local/cpanel/3rdparty/wp-toolkit/feature-showcase/WpToolkitPluginUI/META.pm

package Cpanel::Config::ConfigObj::Driver::WpToolkitPluginUI::META;

# cpanel - Cpanel/Config/ConfigObj/Driver/WpToolkitPluginUI/META.pm
# Copyright 1999-2025. WebPros International GmbH. All rights reserved.

use cPstrict;
use Cpanel::SafeRun::Simple ();

=encoding utf-8

=head1 NAME

Cpanel::Config::ConfigObj::Driver::WpToolkitPluginUI::META

=head1 DESCRIPTION

Feature Showcase metadata for WpToolkitPluginUI

=cut

use parent qw(Cpanel::Config::ConfigObj::Interface::Config::Version::v1);

our $VERSION = "1.0";

=head1 FUNCTIONS

=head2 get_driver_name()

Returns the driver name. This name is used as the filename for the touchfile
put in the C</var/cpanel/activate/features/> directory.

=cut

use constant get_driver_name => 'WpToolkitPluginUI';

=head2 get_setting()
=cut

sub get_setting ($setting) {
    my @commandArgs = ('/usr/local/bin/wp-toolkit', '--showcase-config', '-format', 'json', '-operation', 'check-availability', '-showcase-option', $setting);
    my $stdout = Cpanel::SafeRun::Simple::saferunnoerror( @commandArgs );
    return Cpanel::JSON::Load($stdout);
}

=head2 content

Defines the content used in the Feature Showcase entry

=cut

sub content ($locale) {
    my $abstract = "<p>" . join(
        "</p><p>",
        "WordPress site administrators can now install a WordPress plugin that provides direct and secure access to WP Toolkit functionality from within WordPress. This plugin also enables real-time vulnerability monitoring and application of Vulnerability Protection rules. Upcoming WP Toolkit updates will be adding more features to the plugin.",
        "This functionality can be hidden via config file modification (refer to WP Toolkit changelog for details).",
    ) . "</p>";
    return {
        'vendor' => 'WebPros, L.L.C.',
        'name'   => {
            'short'  => 'WP Toolkit Plugin UI',
            'long'   => 'WP Toolkit Plugin UI',
            'driver' => get_driver_name(),
        },
        'first_appears_in' => '1',
        'version'          => $Cpanel::Config::ConfigObj::Driver::WpToolkitPluginUI::META::VERSION,
        'readonly'         => 1,
        'abstract'         => $abstract,
    };
}

=head2 showcase()

Determine how and if an item should appear in the showcase

=cut

sub showcase {
    my $data = get_setting('integrationPluginApi');
    if (!$data->{'optionValue'}) {
        return -1;
    }

    return { 'is_recommended' => 0, 'is_spotlight_feature' => 1 };
}
1;
Back to Directory File Manager