[ 'default' => '', 'required' => true, 'placeholder' => 'eg.: 478dcc2136263f2b3a3726ff', 'name' => 'Trustindex Widget ID', 'help' => null, 'help-icon' => '' ], ]; private $errors = array(); public function __construct() { parent::__construct( 'trustindex_google_widget', 'Review Widgets for Google', [ 'classname' => 'trustindex-widget', 'description' => 'Embed Google reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Google reviews.' ] ); } function widget($args, $instance) { global $wpdb; global $trustindex_pm_google; $pluginManager = 'TrustindexPlugin_google'; $pluginManagerInstance = $trustindex_pm_google; if ($pluginManagerInstance->is_enabled()) { extract($args); echo wp_kses_post($before_widget); $wasError = false; foreach ($this->widget_fields as $fname => $fparams) { if ($fparams['required'] && (!isset($instance[ $fname ]) || $instance[ $fname ] == "")) { $wasError = true; break; } } if (!$wasError && $instance['ti-widget-ID']) { echo wp_kses($pluginManagerInstance->renderWidgetFrontend($instance['ti-widget-ID']), $pluginManager::$allowedAttributesForWidget); } else if ($pluginManagerInstance->is_noreg_linked()) { $html = preg_replace('/'; } } else { /* translators: %s: URL */ echo wp_kses_post($pluginManagerInstance->frontEndErrorForAdmins(sprintf(__("Please fill out all the required fields in the widget settings page", 'wp-reviews-plugin-for-google'), admin_url('admin.php?page='.$pluginManagerInstance->get_plugin_slug().'/settings.php')))); } echo wp_kses_post($after_widget); } else { } } function form($instance) { global $wp_version; global $trustindex_pm_google; $pluginManager = 'TrustindexPlugin_google'; $pluginManagerInstance = $trustindex_pm_google; $tiWidgets = $pluginManagerInstance->get_trustindex_widgets(); $selectedWidgetId = isset($instance['ti-widget-ID']) ? esc_attr($instance['ti-widget-ID']) : $this->widget_fields['ti-widget-ID']['default']; ?>