Prepare for release version 1.4.0
- Update: Changed e-Mail support address to the WordPress support forum - Update: Language EN and DE - Add: Tab for Plugin Diagnostics - Add: Donate link to the installed Plugin overview page - Add: Donate button to the "HowTo" tab git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@983360 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
77dc194a51
commit
1f5e0ed500
11 changed files with 290 additions and 33 deletions
|
@ -63,6 +63,9 @@ class MCI_Footnotes_Admin {
|
|||
// load tab 'how to'
|
||||
require_once(dirname( __FILE__ ) . "/tab_howto.php");
|
||||
new MCI_Footnotes_Tab_HowTo($this->a_arr_SettingsTabs);
|
||||
// load tab 'diagnostics'
|
||||
require_once(dirname( __FILE__ ) . "/tab_diagnostics.php");
|
||||
new MCI_Footnotes_Tab_Diagnostics($this->a_arr_SettingsTabs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -116,7 +119,7 @@ class MCI_Footnotes_Admin {
|
|||
do_settings_sections(self::$a_str_ActiveTab);
|
||||
do_meta_boxes(self::$a_str_ActiveTab, 'main', NULL);
|
||||
// adds a submit button to the current page
|
||||
if (self::$a_str_ActiveTab != FOOTNOTES_SETTINGS_TAB_HOWTO) {
|
||||
if (self::$a_str_ActiveTab != FOOTNOTES_SETTINGS_TAB_HOWTO && self::$a_str_ActiveTab != FOOTNOTES_SETTINGS_TAB_DIAGNOSTICS) {
|
||||
submit_button();
|
||||
}
|
||||
echo '</form>';
|
||||
|
|
119
classes/tab_diagnostics.php
Normal file
119
classes/tab_diagnostics.php
Normal file
|
@ -0,0 +1,119 @@
|
|||
<?php
|
||||
/**
|
||||
* Created by Stefan Herndler.
|
||||
* User: Stefan
|
||||
* Date: 07.09.14 02:53
|
||||
* Since: 1.4.0
|
||||
*/
|
||||
|
||||
|
||||
// define class only once
|
||||
if (!class_exists("MCI_Footnotes_Tab_Diagnostics")) :
|
||||
|
||||
/**
|
||||
* Class MCI_Footnotes_Tab_Diagnostics
|
||||
* @since 1.4.0
|
||||
*/
|
||||
class MCI_Footnotes_Tab_Diagnostics extends MCI_Footnotes_Admin {
|
||||
|
||||
/**
|
||||
* register the meta boxes for the tab
|
||||
* @constructor
|
||||
* @since 1.4.0
|
||||
* @param array $p_arr_Tabs
|
||||
*/
|
||||
public function __construct(&$p_arr_Tabs) {
|
||||
// add tab to the tab array
|
||||
$p_arr_Tabs[FOOTNOTES_SETTINGS_TAB_DIAGNOSTICS] = __("Diagnostics", FOOTNOTES_PLUGIN_NAME);
|
||||
// register settings tab
|
||||
add_settings_section(
|
||||
"MCI_Footnotes_Settings_Section_Diagnostics",
|
||||
" ",
|
||||
array($this, 'Description'),
|
||||
FOOTNOTES_SETTINGS_TAB_DIAGNOSTICS
|
||||
);
|
||||
// help
|
||||
add_meta_box(
|
||||
'MCI_Footnotes_Tab_Diagnostics_Display',
|
||||
__("Displays information about the web server, PHP and WordPress.", FOOTNOTES_PLUGIN_NAME),
|
||||
array($this, 'Display'),
|
||||
FOOTNOTES_SETTINGS_TAB_DIAGNOSTICS,
|
||||
'main'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* output a description for the tab
|
||||
* @since 1.4.0
|
||||
*/
|
||||
public function Description() {
|
||||
// unused
|
||||
}
|
||||
|
||||
/**
|
||||
* outputs the diagnostics
|
||||
* @since 1.4.0
|
||||
*/
|
||||
public function Display() {
|
||||
global $wp_version;
|
||||
|
||||
echo '<table style="width: 100%;">';
|
||||
echo '<tbody>';
|
||||
|
||||
// website
|
||||
echo '<tr>';
|
||||
echo '<td style="vertical-align:top; width: 20%;">' . $this->Highlight(__('Server name', FOOTNOTES_PLUGIN_NAME)) . '</td>';
|
||||
echo '<td>' . $_SERVER["SERVER_NAME"] . '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
// PHP version
|
||||
echo '<tr>';
|
||||
echo '<td>' . $this->Highlight(__('PHP version', FOOTNOTES_PLUGIN_NAME)) . '</td>';
|
||||
echo '<td>' . phpversion() . '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
// max. execution time
|
||||
echo '<tr>';
|
||||
echo '<td>' . $this->Highlight(__('Max execution time', FOOTNOTES_PLUGIN_NAME)) . '</td>';
|
||||
echo '<td>' . ini_get('max_execution_time') . ' ' . __('seconds', FOOTNOTES_PLUGIN_NAME) . '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
// memory limit
|
||||
echo '<tr>';
|
||||
echo '<td>' . $this->Highlight(__('Memory limit', FOOTNOTES_PLUGIN_NAME)) . '</td>';
|
||||
echo '<td>' . ini_get('memory_limit') . '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
// PHP extensions
|
||||
echo '<tr>';
|
||||
echo '<td>' . $this->Highlight(__('PHP extensions', FOOTNOTES_PLUGIN_NAME)) . '</td>';
|
||||
echo '<td>';
|
||||
foreach (get_loaded_extensions() as $l_int_Index => $l_str_Extension) {
|
||||
if ($l_int_Index > 0) {
|
||||
echo ' | ';
|
||||
}
|
||||
echo $l_str_Extension . ' ' . phpversion($l_str_Extension);
|
||||
}
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
// WordPress version
|
||||
echo '<tr>';
|
||||
echo '<td>' . $this->Highlight(__('WordPress version', FOOTNOTES_PLUGIN_NAME)) . '</td>';
|
||||
echo '<td>' . $wp_version . '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
// WordPress Plugins installed
|
||||
foreach (get_plugins() as $l_arr_Plugin) {
|
||||
echo '<tr>';
|
||||
echo '<td>' . $this->Highlight($l_arr_Plugin["Name"]) . '</td>';
|
||||
echo '<td>' . $l_arr_Plugin["Version"] . ' [' . $l_arr_Plugin["PluginURI"] . ']' . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
}
|
||||
} // class MCI_Footnotes_Tab_Diagnostics
|
||||
|
||||
endif;
|
|
@ -41,6 +41,14 @@ class MCI_Footnotes_Tab_HowTo extends MCI_Footnotes_Admin {
|
|||
FOOTNOTES_SETTINGS_TAB_HOWTO,
|
||||
'main'
|
||||
);
|
||||
// donate
|
||||
add_meta_box(
|
||||
'MCI_Footnotes_Tab_HowTo_Donate',
|
||||
__("Help us to improve our Plugin.", FOOTNOTES_PLUGIN_NAME),
|
||||
array($this, 'Donate'),
|
||||
FOOTNOTES_SETTINGS_TAB_HOWTO,
|
||||
'main'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -91,12 +99,21 @@ class MCI_Footnotes_Tab_HowTo extends MCI_Footnotes_Admin {
|
|||
</p>
|
||||
</div>
|
||||
<p>
|
||||
<?php echo sprintf(__("If you have any questions, please don't hesitate to %se-mail%s us.", FOOTNOTES_PLUGIN_NAME), '<a href="mailto:mci@cheret.co.uk" class="footnote_plugin">', '</a>'); ?>
|
||||
<?php echo sprintf(__("For further information please check out our %ssupport forum%s on WordPress.org.", FOOTNOTES_PLUGIN_NAME), '<a href="http://wordpress.org/support/plugin/footnotes" target="_blank" class="footnote_plugin">', '</a>'); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* outputs the diagnostics
|
||||
* @since 1.4.0
|
||||
*/
|
||||
public function Donate() {
|
||||
$l_str_Url = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6Z6CZDW8PPBBJ";
|
||||
echo '<input type="button" class="button button-primary" value="'.__('Donate now',FOOTNOTES_PLUGIN_NAME).'" onclick="window.open(\''.$l_str_Url.'\');" />';
|
||||
}
|
||||
} // class MCI_Footnotes_Tab_HowTo
|
||||
|
||||
endif;
|
Reference in a new issue