Skip to content

Commit 603cba8

Browse files
committed
Bug Fixed
1 parent 9de6924 commit 603cba8

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/Load.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ public function admin_notices()
7777
return;
7878
}
7979

80-
foreach ($this->plugins as $plugin) {
80+
foreach ($this->plugins as $plugin_data) {
8181

82-
if (!isset($plugin['slug'], $plugin['name'])) {
82+
if (!isset($plugin_data['slug'], $plugin_data['name'])) {
8383
continue;
8484
}
8585

86-
$plugin = Plugin::get_instance($plugin['slug'], $plugin['name']);
86+
$plugin = Plugin::get_instance($plugin_data['slug'], $plugin_data['name']);
8787

88-
$notice = $this->add_notice($plugin);
88+
$notice = $this->add_notice($plugin, $plugin_data);
8989

9090
/**
9191
* If notice is added then return.
@@ -104,7 +104,7 @@ public function admin_notices()
104104
*
105105
* @return bool
106106
*/
107-
private function add_notice(Plugin $plugin)
107+
private function add_notice(Plugin $plugin, $plugin_data)
108108
{
109109

110110
if ($plugin->is_plugin_activated()) {
@@ -119,7 +119,7 @@ private function add_notice(Plugin $plugin)
119119
?>
120120
<div class="error">
121121
<p>
122-
<?php if (!array_key_exists('server_url', $this->plugins)) { ?>
122+
<?php if (!array_key_exists('server_url', $plugin_data)) { ?>
123123
<a href="<?php echo esc_url($plugin->get_plugin_activate_link()); ?>" class='button button-secondary'><?php printf(esc_html__('Activate % s', 'twz-wp-notice-plugin-required'), esc_html($plugin->get_plugin_name())); ?></a>
124124
<?php } else { ?>
125125
<a href="#" class='button button-secondary activate'><?php printf(esc_html__('Activate % s', 'twz-wp-notice-plugin-required'), esc_html($plugin->get_plugin_name())); ?></a>
@@ -138,7 +138,7 @@ private function add_notice(Plugin $plugin)
138138
?>
139139
<div class="error">
140140
<p>
141-
<?php if (!array_key_exists('server_url', $this->plugins)) { ?>
141+
<?php if (!array_key_exists('server_url', $plugin_data)) { ?>
142142
<a href="<?php echo esc_url($plugin->get_plugin_install_link()); ?>" class='button button-secondary'><?php printf(esc_html__('Install % s', 'twz-wp-notice-plugin-required'), esc_html($plugin->get_plugin_name())); ?></a>
143143
<?php } else { ?>
144144
<a href="#" class='button button-secondary install'><?php printf(esc_html__('Install % s', 'twz-wp-notice-plugin-required'), esc_html($plugin->get_plugin_name())); ?></a>

src/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Plugin {
4242
* @param string $plugin_slug Required Plugin slug.
4343
* @param string $plugin_name Required Plugin name.
4444
*/
45-
private function __construct( $plugin_slug, $plugin_name ) {
45+
private function __construct( $plugin_slug, $plugin_name) {
4646
if ( ! function_exists( 'is_plugin_active' ) ) {
4747
require_once ABSPATH . 'wp-admin/includes/plugin.php';
4848
}

0 commit comments

Comments
 (0)