wordpress/wp-content/plugins/sqlite-integration/utilities/utility.php
/**
	 * Method to echo plugins info table component.
	 *
	 * @return nothing returned.
	 * @access private
	 */
Method to echo plugins info table component.
@return nothing returned.
@access private
Method to echo plugins info table component . @return nothing returned . @access private
private function show_plugins_info() {
		$domain = $this->text_domain;
		if (file_exists(SQLiteListFile)) {
			$contents = file_get_contents(SQLiteListFile);
			$plugin_info_list = json_decode($contents);
			$plugins = get_plugins();
			foreach ($plugins as $key => $data) {
				$name = '<a href="'.$data['PluginURI'].'">'.$data['Name'].'</a>';
				foreach ($plugin_info_list as $plugin_info) {
					if ($data['Name'] == $plugin_info->name) {
						$class = 'class="'.$plugin_info->class.'"';
						switch ($plugin_info->compat) {
							case 'Needs Patch':
								if (!empty($plugin_info->patch_url)) {
									$compat = '<a href="'.$plugin_info->patch_url.'">'.__('Needs Patch', $domain).'</a>';
								} else {
									$compat = __('Needs Patch', $domain);
								}
								break;
							case 'Probably No':
								$compat = __('Probably No', $domain);
								break;
							case 'Probably Yes':
								$compat = __('Probably Yes', $domain);
								break;
							case 'No':
								$compat = __('No', $domain);
								break;
							case 'Checked':
								if (!empty($plugin_info->informed) && stripos($plugin_info->informed, 'Users\' Information') !== false) {
									$compat = __('Checked*', $domain);
								} else {
								$compat = __('Checked', $domain);
								}
								break;
							default:
								$compat = __('Not Checked', $domain);
								break;
						}
						break;
					} else {
						$class = 'class="compatible"';
						$compat = __('Not Checked', $domain);
					}
				}
				if (is_plugin_active_for_network($key)) {
					echo '<tr data-table='.'\'{"name":"'.$data['Name'].'","active":"sitewide active","comp":"'.strip_tags($compat).'"}\''." $class>";
					echo sprintf('<td>%1$s</td><td>%2$s</td><td>%3$s</td>', $name,  __('Sitewide Active', $domain), $compat);
				} elseif (is_plugin_active($key)) {
					echo '<tr data-table='.'\'{"name":"'.$data['Name'].'","active":"active","comp":"'.strip_tags($compat).'"}\''." $class>";
					echo sprintf('<td>%1$s</td><td>%2$s</td><td>%3$s</td>', $name,  __('Active', $domain), $compat);
				} else {
					echo '<tr data-table='.'\'{"name":"'.$data['Name'].'","active":"inactive","comp":"'.strip_tags($compat).'"}\''." $class>";
					echo sprintf('<td>%1$s</td><td>%2$s</td><td>%3$s</td>', $name, __('Inactive', $domain), $compat);
				}
				echo '</tr>';
			}
		}
	}
private function show_plugins_info ( ) { $ domain = $ this -> text_domain ; if ( file_exists ( SQLiteListFile ) ) { $ contents = file_get_contents ( SQLiteListFile ) ; $ plugin_info_list = json_decode ( $ contents ) ; $ plugins = get_plugins ( ) ; foreach ( $ plugins as $ key => $ data ) { $ name = '<a href="' . $ data [ 'PluginURI' ] . '">' . $ data [ 'Name' ] . '</a>' ; foreach ( $ plugin_info_list as $ plugin_info ) { if ( $ data [ 'Name' ] == $ plugin_info -> name ) { $ class = 'class="' . $ plugin_info -> class . '"' ; switch ( $ plugin_info -> compat ) { case 'Needs Patch' : if ( ! empty ( $ plugin_info -> patch_url ) ) { $ compat = '<a href="' . $ plugin_info -> patch_url . '">' . __ ( 'Needs Patch' , $ domain ) . '</a>' ; } else { $ compat = __ ( 'Needs Patch' , $ domain ) ; } break ; case 'Probably No' : $ compat = __ ( 'Probably No' , $ domain ) ; break ; case 'Probably Yes' : $ compat = __ ( 'Probably Yes' , $ domain ) ; break ; case 'No' : $ compat = __ ( 'No' , $ domain ) ; break ; case 'Checked' : if ( ! empty ( $ plugin_info -> informed ) && stripos ( $ plugin_info -> informed , 'Users\' Information' ) !== false ) { $ compat = __ ( 'Checked*' , $ domain ) ; } else { $ compat = __ ( 'Checked' , $ domain ) ; } break ; default : $ compat = __ ( 'Not Checked' , $ domain ) ; break ; } break ; } else { $ class = 'class="compatible"' ; $ compat = __ ( 'Not Checked' , $ domain ) ; } } if ( is_plugin_active_for_network ( $ key ) ) { echo '<tr data-table=' . '\'{"name":"' . $ data [ 'Name' ] . '","active":"sitewide active","comp":"' . strip_tags ( $ compat ) . '"}\'' . " $ class > " ; echo sprintf ( '<td>%1$s</td><td>%2$s</td><td>%3$s</td>' , $ name , __ ( 'Sitewide Active' , $ domain ) , $ compat ) ; } elseif ( is_plugin_active ( $ key ) ) { echo '<tr data-table=' . '\'{"name":"' . $ data [ 'Name' ] . '","active":"active","comp":"' . strip_tags ( $ compat ) . '"}\'' . " $ class > " ; echo sprintf ( '<td>%1$s</td><td>%2$s</td><td>%3$s</td>' , $ name , __ ( 'Active' , $ domain ) , $ compat ) ; } else { echo '<tr data-table=' . '\'{"name":"' . $ data [ 'Name' ] . '","active":"inactive","comp":"' . strip_tags ( $ compat ) . '"}\'' . " $ class > " ; echo sprintf ( '<td>%1$s</td><td>%2$s</td><td>%3$s</td>' , $ name , __ ( 'Inactive' , $ domain ) , $ compat ) ; } echo '</tr>' ; } } }
Method to echo plugins info table component.
Method to echo plugins info table component .
// for Internationalization... it's a redundant codes, mm... // I might have made a mistake to store data in json format...