Skip to content

Commit

Permalink
Merge pull request #375 from mainwp/mainwp-child-dev
Browse files Browse the repository at this point in the history
Mainwp child dev
  • Loading branch information
thanghv authored Mar 30, 2023
2 parents a9cb5bd + 0b8f66f commit ade5c5d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
24 changes: 17 additions & 7 deletions class/class-mainwp-child-jetpack-protect.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function __construct() {
if ( 'hide' === get_option( 'mainwp_child_jetpack_protect_hide_plugin' ) ) {
add_filter( 'all_plugins', array( $this, 'hook_all_plugins' ) );
add_action( 'admin_menu', array( $this, 'hook_remove_menu' ) );
add_action( 'admin_head', array( $this, 'admin_head' ) );
add_filter( 'site_transient_update_plugins', array( &$this, 'hook_remove_update_nag' ) );
add_filter( 'mainwp_child_hide_update_notice', array( &$this, 'hook_hide_update_notice' ) );
}
Expand Down Expand Up @@ -274,7 +275,7 @@ public function hook_all_plugins( $plugins ) {
}

/**
* Remove WPStaging WordPress Menu.
* Remove the plugin menu.
*/
public function hook_remove_menu() {
remove_menu_page( 'jetpack-protect' );
Expand All @@ -283,16 +284,25 @@ public function hook_remove_menu() {
wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' );
exit();
}
}

/**
* Hide plugin menus.
*/
public function admin_head() {
?>
<script type="text/javascript">
document.addEventListener( "DOMContentLoaded", function( event ) {
document.getElementById( "wp-admin-bar-jetpack-protect" ).outerHTML = '';
document.getElementById( "toplevel_page_jetpack" ).outerHTML = '';
} );
</script>
<style type="text/css">
#wp-admin-bar-jetpack-protect{
display: none !important;
}
#toplevel_page_jetpack{
display: none !important;
}
</style>
<?php
}


/**
* Hide all admin update notices.
*
Expand Down
15 changes: 7 additions & 8 deletions class/class-mainwp-child-jetpack-scan.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,9 @@ public function hook_remove_menu() {
wp_safe_redirect( admin_url( 'index.php' ) );
exit();
}
?>
<script type="text/javascript">
document.addEventListener( "DOMContentLoaded", function( event ) {
document.getElementById( "wp-admin-bar-jetpack-protect" ).outerHTML = '';
document.getElementById( "toplevel_page_jetpack" ).outerHTML = '';
} );
</script>
<?php
}


/**
* Render admin header.
*/
Expand All @@ -188,6 +181,12 @@ public function admin_head() {
div.jitm-banner {
display: none !important;
}
#wp-admin-bar-jetpack-protect{
display: none !important;
}
#toplevel_page_jetpack{
display: none !important;
}
</style>
<?php
}
Expand Down
2 changes: 1 addition & 1 deletion class/class-mainwp-child.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MainWP_Child {
*
* @var string MainWP Child plugin version.
*/
public static $version = '4.4.0.3';
public static $version = '4.4.0.4';

/**
* Private variable containing the latest MainWP Child update version.
Expand Down
2 changes: 1 addition & 1 deletion mainwp-child.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Author: MainWP
* Author URI: https://mainwp.com
* Text Domain: mainwp-child
* Version: 4.4.0.3
* Version: 4.4.0.4
* Requires at least: 5.4
* Requires PHP: 7.4
*/
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Plugin URI: https://mainwp.com
Requires at least: 5.4
Tested up to: 6.2
Requires PHP: 7.0
Stable tag: 4.4.0.3
Stable tag: 4.4.0.4
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -147,6 +147,9 @@ Sure we have a quick FAQ with a lot more questions and answers [here](https://ma

== Changelog ==

= 4.4.0.4 - 3-30-2023 =
* Fixed: JS conflict caused by the Hide Jetpack plugin feature

= 4.4.0.3 - 3-30-2023 =
* Fixed: An issue with adding sites caused by incompatible file-system
* Updated: Support for the Jetpack Scan extension
Expand Down

0 comments on commit ade5c5d

Please sign in to comment.