@@ 575-588 (lines=14) @@ | ||
572 | * |
|
573 | * @return bool|int |
|
574 | */ |
|
575 | private function score_active_widgets( $path, $external_user_id, $query, $score ) { |
|
576 | if ( empty( $this->active_widgets ) ) { |
|
577 | return $score; |
|
578 | } |
|
579 | $active_widget_list = $this->get_widget_list(); |
|
580 | ||
581 | foreach ( $this->active_widgets as $active_widget ) { |
|
582 | if ( in_array( $active_widget, $active_widget_list, true ) ) { |
|
583 | return 1; |
|
584 | } |
|
585 | } |
|
586 | ||
587 | return false; |
|
588 | } |
|
589 | ||
590 | /** |
|
591 | * Score inactive widgets |
|
@@ 600-614 (lines=15) @@ | ||
597 | * |
|
598 | * @return bool|int |
|
599 | */ |
|
600 | private function score_inactive_widgets( $path, $external_user_id, $query, $score ) { |
|
601 | if ( empty( $this->inactive_widgets ) ) { |
|
602 | return $score; |
|
603 | } |
|
604 | ||
605 | $active_widget_list = $this->get_widget_list(); |
|
606 | ||
607 | foreach ( $this->inactive_widgets as $inactive_widget ) { |
|
608 | if ( in_array( $inactive_widget, $active_widget_list, true ) ) { |
|
609 | return false; |
|
610 | } |
|
611 | } |
|
612 | ||
613 | return 1; |
|
614 | } |
|
615 | ||
616 | /** |
|
617 | * Score mobile browser |