@@ -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>
0 commit comments