From 596c878c6a743a4af3274040e32ed5a40afb17f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogdan=20Rapai=C4=87?= Date: Fri, 17 Apr 2020 14:36:36 +0200 Subject: [PATCH] Fixed: CodeFactor issues --- class/class-mainwp-child-pagespeed.php | 134 ++++++++++--------------- 1 file changed, 51 insertions(+), 83 deletions(-) diff --git a/class/class-mainwp-child-pagespeed.php b/class/class-mainwp-child-pagespeed.php index 31901d5..ca434ea 100644 --- a/class/class-mainwp-child-pagespeed.php +++ b/class/class-mainwp-child-pagespeed.php @@ -1,26 +1,23 @@ init_cron(); } public function init_cron() { add_action( 'mainwp_child_pagespeed_cron_check', array( 'MainWP_Child_Pagespeed', 'pagespeed_cron_check' ) ); - if ( false === ( $sched = wp_next_scheduled( 'mainwp_child_pagespeed_cron_check' ) ) ) { + $sched = wp_next_scheduled( 'mainwp_child_pagespeed_cron_check' ); + if ( false === $sched ) { wp_schedule_event( time(), 'daily', 'mainwp_child_pagespeed_cron_check' ); } } @@ -127,17 +126,17 @@ class MainWP_Child_Pagespeed { public function hide_menu() { global $submenu; - if ( isset($submenu['tools.php']) ) { + if ( isset( $submenu['tools.php'] ) ) { foreach ( $submenu['tools.php'] as $key => $menu ) { - if ( $menu[2] == 'google-pagespeed-insights' ) { - unset($submenu['tools.php'][ $key ]); + if ( 'google-pagespeed-insights' == $menu[2] ) { + unset( $submenu['tools.php'][ $key ] ); break; } } } } - function update_footer( $text ) { + public function update_footer( $text ) { ?>