mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-09-05 09:19:53 +08:00
Merge with branch01
This commit is contained in:
parent
f586639d8b
commit
c232857821
9 changed files with 516 additions and 488 deletions
|
@ -132,7 +132,10 @@ class MainWP_Child_Pagespeed {
|
|||
|
||||
function save_settings() {
|
||||
$current_values = get_option( 'gpagespeedi_options' );
|
||||
if ( is_array( $current_values ) && false === $current_values['last_run_finished'] ) {
|
||||
require_once GPI_DIRECTORY . '/core/core.php';
|
||||
$googlePagespeedInsights = new googlePagespeedInsights( $current_values );
|
||||
$worker_status = $googlePagespeedInsights->google_pagespeed_insights_Check_Status();
|
||||
if ( $worker_status ) {
|
||||
return array( 'result' => 'RUNNING' );
|
||||
}
|
||||
|
||||
|
@ -229,13 +232,13 @@ class MainWP_Child_Pagespeed {
|
|||
|
||||
function do_check_pages($forceRecheck = false) {
|
||||
if ( defined( 'GPI_DIRECTORY' ) ) {
|
||||
$options = get_option( 'gpagespeedi_options' );
|
||||
require_once GPI_DIRECTORY . '/core/core.php';
|
||||
$googlePagespeedInsights = new googlePagespeedInsights( $options );
|
||||
if ( $googlePagespeedInsights ) {
|
||||
$googlePagespeedInsights->googlepagespeedinsightsworker( array(), true, $forceRecheck );
|
||||
return true;
|
||||
}
|
||||
$options = get_option( 'gpagespeedi_options' );
|
||||
require_once GPI_DIRECTORY . '/core/core.php';
|
||||
$googlePagespeedInsights = new googlePagespeedInsights( $options );
|
||||
if ( $googlePagespeedInsights ) {
|
||||
$googlePagespeedInsights->googlepagespeedinsightsworker( array(), true, $forceRecheck );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -244,9 +247,12 @@ class MainWP_Child_Pagespeed {
|
|||
if ( empty( $strategy ) ) {
|
||||
$strategy = 'both';
|
||||
}
|
||||
$current_values = get_option( 'gpagespeedi_options' );
|
||||
|
||||
if ( is_array( $current_values ) && false === $current_values['last_run_finished'] ) {
|
||||
$current_values = get_option( 'gpagespeedi_options' );
|
||||
require_once GPI_DIRECTORY . '/core/core.php';
|
||||
$googlePagespeedInsights = new googlePagespeedInsights( $current_values );
|
||||
$worker_status = $googlePagespeedInsights->google_pagespeed_insights_Check_Status();
|
||||
if ( $worker_status ) {
|
||||
return array( 'result' => 'RUNNING' );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue