updated plugin Menu Icons
version 0.12.8
This commit is contained in:
@ -37,14 +37,14 @@ abstract class Abstract_Module {
|
||||
*
|
||||
* @return bool Should load module?
|
||||
*/
|
||||
public abstract function can_load( $product );
|
||||
abstract public function can_load( $product );
|
||||
|
||||
/**
|
||||
* Bootstrap the module.
|
||||
*
|
||||
* @param Product $product Product object.
|
||||
*/
|
||||
public abstract function load( $product );
|
||||
abstract public function load( $product );
|
||||
|
||||
/**
|
||||
* Check if the product is from partner.
|
||||
@ -63,4 +63,21 @@ abstract class Abstract_Module {
|
||||
|
||||
return array_key_exists( $product->get_slug(), Module_Factory::$slugs );
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for wp_remote_get on VIP environments.
|
||||
*
|
||||
* @param string $url Url to check.
|
||||
* @param array $args Option params.
|
||||
*
|
||||
* @return array|\WP_Error
|
||||
*/
|
||||
public function safe_get( $url, $args = array() ) {
|
||||
return function_exists( 'vip_safe_wp_remote_get' )
|
||||
? vip_safe_wp_remote_get( $url )
|
||||
: wp_remote_get( //phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get, Already used.
|
||||
$url,
|
||||
$args
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ class Module_Factory {
|
||||
*
|
||||
* @var Abstract_Module $module_object Module instance.
|
||||
*/
|
||||
$module_object = new $class( $product );
|
||||
$module_object = new $class( $product );
|
||||
|
||||
if ( ! $module_object->can_load( $product ) ) {
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user