__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace WPForms\Pro\Admin;
/**
* PluginListDisabler class.
*
* @since 1.9.5
*/
class PluginListDisabler {
/**
* Whether the license is valid.
*
* @since 1.9.5
*
* @var bool
*/
private $is_valid_license;
/**
* Init.
*
* @since 1.9.5
*
* @param bool $is_valid_license Whether the license is valid.
*/
public function init( bool $is_valid_license ): void {
$this->is_valid_license = $is_valid_license;
$this->hooks();
}
/**
* Hooks.
*
* @since 1.9.5
*/
private function hooks(): void {
global $pagenow;
if ( $this->is_valid_license ) {
return;
}
if (
empty( $pagenow ) ||
! in_array( $pagenow, [ 'plugins.php', 'update-core.php', 'plugin-install.php' ], true ) ) {
return;
}
add_action( 'admin_print_footer_scripts', [ $this, 'hide_update_now_button' ] );
add_action( 'admin_footer-plugins.php', [ $this, 'disable_plugin_checkbox' ] );
add_action( 'admin_footer-update-core.php', [ $this, 'disable_plugin_checkbox' ] );
}
/**
* Disable addons checkboxes if the license is not valid.
*
* @since 1.9.5
*/
public function disable_plugin_checkbox(): void {
?>
<script type="text/javascript">
jQuery(document).ready(function($){
// Disable checkbox on the Plugins and the Updates page.
$('tr.update[data-slug^="wpforms-"] .check-column input[type="checkbox"], #update-plugins-table .check-column input[type="checkbox"][value^="wpforms-"]')
.prop('disabled', true)
.attr('title', '<?php esc_html_e( 'WPForms license is not valid.', 'wpforms' ); ?>');
});
</script>
<?php
}
/**
* Hide update now button in the plugin info modal.
*
* @since 1.9.5
*/
public function hide_update_now_button(): void {
?>
<script type="text/javascript">
jQuery( '#plugin_install_from_iframe[data-slug*="wpforms"]' ).hide();
</script>
<?php
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Addons | Folder | 0750 |
|
|
| Builder | Folder | 0750 |
|
|
| Education | Folder | 0750 |
|
|
| Entries | Folder | 0750 |
|
|
| Pages | Folder | 0750 |
|
|
| Settings | Folder | 0750 |
|
|
| AdminBarMenu.php | File | 2.26 KB | 0640 |
|
| CoreInfoCache.php | File | 2.04 KB | 0640 |
|
| DashboardWidget.php | File | 31.6 KB | 0640 |
|
| PluginList.php | File | 26.46 KB | 0640 |
|
| PluginListDisabler.php | File | 1.83 KB | 0640 |
|
| SiteHealth.php | File | 4.31 KB | 0640 |
|