Exemple #1
0
function pgc_logEvent($message, $showMessage = false)
{
    include ABSPATH . 'wp-includes/version.php';
    $fileName = PGC_PLUGIN_DIR . '/plugins-garbage-collector.log';
    $fh = fopen($fileName, 'a');
    $cr = "\n";
    $s = $cr . date("d-m-Y H:i:s") . $cr . 'WordPress version: ' . $wp_version . ', PHP version: ' . phpversion() . ', MySQL version: ' . mysql_get_server_info() . $cr;
    fwrite($fh, $s);
    fwrite($fh, $message . $cr);
    fclose($fh);
    if ($showMessage) {
        pgc_showMessage('Error is occur. Please check the log file.');
    }
}
Exemple #2
0
if (!defined('PGC_PLUGIN_URL')) {
    die;
    // Silence is golden, direct call is prohibited
}
require_once 'pgc-lib.php';
$shinephpFavIcon = PGC_PLUGIN_URL . '/images/vladimir.png';
$mess = '';
if (isset($_POST['deleteTableAction'])) {
    $mess = pgc_deleteUnusedTablesFromDB();
} else {
    if (isset($_POST['deleteExtraColumnsAction'])) {
        $mess = pgc_deleteExtraColumnsFromWPTables();
    }
}
// options page display part
pgc_showMessage($mess);
?>
  <form method="post" action="tools.php?page=plugins-garbage-collector.php" onsubmit="return pgc_onSubmit();">
<?php 
settings_fields('pgc-options');
?>
				<div id="poststuff" class="metabox-holder">					
					<div class="has-sidebar" >
						<div id="post-body-content" class="has-sidebar-content">
<script language="javascript" type="text/javascript">
  function pgc_Actions(action) {
    if (action=='scan') {
      if (document.getElementById('search_nonewp_tables').checked) {
        searchNoneWpTables = 1;
      } else {
        searchNoneWpTables = 0;