Plugin Directory

Changeset 2585546

Timestamp:
08/19/2021 02:56:22 PM (3 years ago)
Author:
s4gor
Message:

version 2.2.2

Location:
phpinfo-wp/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • phpinfo-wp/trunk/css/style.css

    r2575846 r2585546  
    197197  width: 98.24%;
    198198  overflow: auto;
    199   background-color: gray;
    200   color: white;
     199  background-color: ;
     200  color: ;
    201201  font-family: sans-serif;
    202202  padding: 10px;
     
    207207}
    208208/*# sourceMappingURL=style.css.map */
     209
  • phpinfo-wp/trunk/css/style.css.map

    r2575846 r2585546  
    1 {"version":3,"sources":["style.less"],"names":[],"mappings":"AAEA;EACE,aAAA;EACA,8BAAA;EACA,qBAAA;;AAGF;EACE,kBAAA;;AAGF;EACE,UAAA;EACA,gBAAA;EACA,eAAA;EACA,YAAA;;AAGF;AAAwB;AAA0B;EAChD,yBAAA;EACA,2BAAA;EACA,YAAA;EACA,kBAAA;EACA,YAAA;EACA,YAAA;EACA,YAAA;EACA,gBAAA;EACA,eAAA;;AAGF;EACE,eAAA;EACA,aAAA;;AAGF;EACE,UAAA;EACA,gBAAA;EACA,aAAA;;AAGF;EACE,gBAAA;EACA,uBAAA;EACA,oBAAA;EACA,eAAA;EACA,wBAAA;EACA,qBAAA;EACA,eAAA;EACA,oCAAA;EACA,iCAAA;EACA,4BAAA;EACA,kBAAA;EACA,eAAA;EACA,iBAAA;EACA,mBAAA;;AAGF;EACE,gBAAA;EACA,mBAAA;EACA,oBAAA;EACA,iBAAA;;AAGF;EACE,cAAA;;AAGF;EACE,uBAAA;;AAGF;EACE,YAAA;EACA,WAAA;;AAGF;EACE,eAAA;EACA,YAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,yBAAA;EACA,YAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;;AAGF,qBAAqB;EACnB,sBAAA;;AAGF,OAAQ;EACN,SAAA;EACA,gCAAA;;AAGF,OAAQ,EAAC;EACP,WAAA;EACA,qBAAA;EACA,sBAAA;;AAGF,OAAQ,EAAC;EACP,0BAAA;;AAGF,OAAQ;EACN,yBAAA;EACA,SAAA;EACA,YAAA;EACA,4BAAA;EACA,gBAAA;EACA,iBAAA;;AAGF,OAAQ,MAAM;EACZ,6BAAA;;AAEF,OAAQ,MAAM;AACd,OAAQ,MAAM;EACZ,sBAAA;EACA,cAAA;EACA,wBAAA;EACA,gBAAA;EACA,kBAAA;;AAEF,OAAQ;AACR,OAAQ;EACN,yBAAA;;AAEF,OAAQ;EACN,gBAAA;;AAEF,OAAQ;EACN,sBAAA;EACA,YAAA;EACA,iBAAA;;AAEF,OAAQ;EACN,sBAAA;EACA,iBAAA;;AAEF,OAAQ;EACN,sBAAA;EACA,gBAAA;EACA,gBAAA;EACA,qBAAA;;AAEF,OAAQ,GAAG;EACT,WAAA;;AAEF,OAAQ;EACN,YAAA;EACA,SAAA;;AAEF,OAAQ;EACN,YAAA;EACA,sBAAA;EACA,SAAA;EACA,WAAA;;AAEF;EACE,gBAAA;EACA,sBAAA;EACA,yBAAA;;AAEF,IAAK;EACH,yBAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,eAAA;EACA,kBAAA;EACA,gBAAA;EACA,eAAA;;AAEF,IAAK,OAAM;EACT,yBAAA;EACA,YAAA;;AAEF,IAAK,OAAM;EACT,yBAAA;EACA,YAAA;;AAGF;EACE,aAAA;EACA,iBAAA;EACA,sBAAA;EACA,gBAAA;;AAGF;EACE,kBAAA;;AAGF;EACE,kBAAA;;AAGF;EACE,kBAAA;EACA,eAAA;EACA,gBAAA;EACA,gBAAA;EACA,cAAA;;AAGF;EACE,gBAAA;EACA,aAAA;EACA,aAAA;EACA,cAAA;EACA,sBAAA;EACA,YAAA;EACA,uBAAA;EACA,aAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,eAAA","file":"style.css"}
     1{"version":3,"sources":["style.less"],"names":[],"mappings":"AAEA;EACE,aAAA;EACA,8BAAA;EACA,qBAAA;;AAGF;EACE,kBAAA;;AAGF;EACE,UAAA;EACA,gBAAA;EACA,eAAA;EACA,YAAA;;AAGF;AAAwB;AAA0B;EAChD,yBAAA;EACA,2BAAA;EACA,YAAA;EACA,kBAAA;EACA,YAAA;EACA,YAAA;EACA,YAAA;EACA,gBAAA;EACA,eAAA;;AAGF;EACE,eAAA;EACA,aAAA;;AAGF;EACE,UAAA;EACA,gBAAA;EACA,aAAA;;AAGF;EACE,gBAAA;EACA,uBAAA;EACA,oBAAA;EACA,eAAA;EACA,wBAAA;EACA,qBAAA;EACA,eAAA;EACA,oCAAA;EACA,iCAAA;EACA,4BAAA;EACA,kBAAA;EACA,eAAA;EACA,iBAAA;EACA,mBAAA;;AAGF;EACE,gBAAA;EACA,mBAAA;EACA,oBAAA;EACA,iBAAA;;AAGF;EACE,cAAA;;AAGF;EACE,uBAAA;;AAGF;EACE,YAAA;EACA,WAAA;;AAGF;EACE,eAAA;EACA,YAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,yBAAA;EACA,YAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;;AAGF,qBAAqB;EACnB,sBAAA;;AAGF,OAAQ;EACN,SAAA;EACA,gCAAA;;AAGF,OAAQ,EAAC;EACP,WAAA;EACA,qBAAA;EACA,sBAAA;;AAGF,OAAQ,EAAC;EACP,0BAAA;;AAGF,OAAQ;EACN,yBAAA;EACA,SAAA;EACA,YAAA;EACA,4BAAA;EACA,gBAAA;EACA,iBAAA;;AAGF,OAAQ,MAAM;EACZ,6BAAA;;AAEF,OAAQ,MAAM;AACd,OAAQ,MAAM;EACZ,sBAAA;EACA,cAAA;EACA,wBAAA;EACA,gBAAA;EACA,kBAAA;;AAEF,OAAQ;AACR,OAAQ;EACN,yBAAA;;AAEF,OAAQ;EACN,gBAAA;;AAEF,OAAQ;EACN,sBAAA;EACA,YAAA;EACA,iBAAA;;AAEF,OAAQ;EACN,sBAAA;EACA,iBAAA;;AAEF,OAAQ;EACN,sBAAA;EACA,gBAAA;EACA,gBAAA;EACA,qBAAA;;AAEF,OAAQ,GAAG;EACT,WAAA;;AAEF,OAAQ;EACN,YAAA;EACA,SAAA;;AAEF,OAAQ;EACN,YAAA;EACA,sBAAA;EACA,SAAA;EACA,WAAA;;AAEF;EACE,gBAAA;EACA,sBAAA;EACA,yBAAA;;AAEF,IAAK;EACH,yBAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,eAAA;EACA,kBAAA;EACA,gBAAA;EACA,eAAA;;AAEF,IAAK,OAAM;EACT,yBAAA;EACA,YAAA;;AAEF,IAAK,OAAM;EACT,yBAAA;EACA,YAAA;;AAGF;EACE,aAAA;EACA,iBAAA;EACA,sBAAA;EACA,gBAAA;;AAGF;EACE,kBAAA;;AAGF;EACE,kBAAA;;AAGF;EACE,kBAAA;EACA,eAAA;EACA,gBAAA;EACA,gBAAA;EACA,cAAA;;AAGF;EACE,gBAAA;EACA,aAAA;EACA,aAAA;EACA,cAAA;EACA,AAA;EACA,uBAAA;EACA,aAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,eAAA","file":"style.css"}
  • phpinfo-wp/trunk/css/style.less

    r2575846 r2585546  
    219219  width: 98.24%;
    220220  overflow:auto;
    221   background-color: gray;
    222   color: white;
     221  background-color: ;
     222  color: ;
    223223  font-family: sans-serif;
    224224  padding: 10px;
  • phpinfo-wp/trunk/css/style.min.css

    r2575846 r2585546  
    1 #phpinfo-wp-notice{display:flex;justify-content:space-between;align-items:baseline}#htaccess-phpinfo{text-align:center}#htaccess-warning{color:red;font-weight:600;font-size:20px;margin:10px}#phpinfo-htaccess-backup,#phpinfo-htaccess-restore,#phpinfo-htaccess-save{background-color:#777BB3;margin:15px 10px 10px;border:none;border-radius:5px;height:40px;width:100px;color:#fff;font-weight:600;cursor:pointer}#htaccess-phpinfo-des{font-size:16px;width:1200px}#htaccess-editor{width:50%;margin-top:10px;height:370px}.phpinfo-extensions{margin-top:20px;-webkit-column-count:5;-moz-column-count:5;column-count:5;-webkit-column-gap:50px;-moz-column-gap:50px;column-gap:0;-webkit-column-rule:1px single grey;-moz-column-rule:1px single grey;column-rule:1px single grey;text-align:center;font-size:15px;line-height:25px;font-weight:bolder}#title-phpinfo-WP{margin-top:30px;margin-bottom:30px;letter-spacing:10px;margin-left:20px}#heading-phpinfo-WP{color:#777BB3}html{scroll-behavior:smooth}#topButtonImage-phpinfo-WP{height:30px;width:30px}#topButton-phpinfo-WP{position:fixed;bottom:20px;right:30px;z-index:99;border:none;outline:0;background-color:#777BB3;color:#fff;cursor:pointer;padding:15px;border-radius:10px;font-size:18px}#topButton-phpinfo-WP:hover{background-color:#555}.center pre{margin:0;font-family:Poppins,sans-serif}.center a:link{color:#009;text-decoration:none;background-color:#fff}.center a:hover{text-decoration:underline}.center table{border-collapse:collapse;border:0;width:934px;box-shadow:1px 2px 3px #ccc;text-align:left;margin:10px auto}.center table th{text-align:center!important}.center table td,.center table th{border:1px solid #666;font-size:75%;vertical-align:baseline;padding:5px;text-align:center}.center h1,.center h2{text-transform:uppercase}.center .p{text-align:left}.center .e{background-color:#ccf;width:300px;font-weight:700}.center .h{background-color:#99c;font-weight:700}.center .v{background-color:#ddd;max-width:300px;overflow-x:auto;word-wrap:break-word}.center .v i{color:#999}.center img{float:right;border:0}.center hr{width:934px;background-color:#ccc;border:0;height:1px}.tab{overflow:hidden;border:1px solid #ccc;background-color:#f1f1f1}.tab button{background-color:inherit;float:left;border:none;outline:0;cursor:pointer;padding:14px 16px;transition:.3s;font-size:17px}.tab button.active,.tab button:hover{background-color:#777BB3;color:#fff}.tabcontent{display:none;padding:6px 12px;border:1px solid #ccc;border-top:none}#phpinfo-WP{text-align:center}#phpinfo-wp{margin-right:20px}#phpinfo-output{text-align:center;font-size:30px;margin-top:20px;font-weight:600;color:#777BB3}#phpinfo-log{line-height:1.5;height:400px;width:98.24%;overflow:auto;background-color:gray;color:#fff;font-family:sans-serif;padding:10px;margin-top:30px;border-radius:10px;font-weight:400;font-size:18px}/*# sourceMappingURL=style.min.css.map */
     1#phpinfo-wp-notice{display:flex;justify-content:space-between;align-items:baseline}#htaccess-phpinfo{text-align:center}#htaccess-warning{color:red;font-weight:600;font-size:20px;margin:10px}#phpinfo-htaccess-backup,#phpinfo-htaccess-restore,#phpinfo-htaccess-save{background-color:#777BB3;margin:15px 10px 10px;border:none;border-radius:5px;height:40px;width:100px;color:#fff;font-weight:600;cursor:pointer}#htaccess-phpinfo-des{font-size:16px;width:1200px}#htaccess-editor{width:50%;margin-top:10px;height:370px}.phpinfo-extensions{margin-top:20px;-webkit-column-count:5;-moz-column-count:5;column-count:5;-webkit-column-gap:50px;-moz-column-gap:50px;column-gap:0;-webkit-column-rule:1px single grey;-moz-column-rule:1px single grey;column-rule:1px single grey;text-align:center;font-size:15px;line-height:25px;font-weight:bolder}#title-phpinfo-WP{margin-top:30px;margin-bottom:30px;letter-spacing:10px;margin-left:20px}#heading-phpinfo-WP{color:#777BB3}html{scroll-behavior:smooth}#topButtonImage-phpinfo-WP{height:30px;width:30px}#topButton-phpinfo-WP{position:fixed;bottom:20px;right:30px;z-index:99;border:none;outline:0;background-color:#777BB3;color:#fff;cursor:pointer;padding:15px;border-radius:10px;font-size:18px}#topButton-phpinfo-WP:hover{background-color:#555}.center pre{margin:0;font-family:Poppins,sans-serif}.center a:link{color:#009;text-decoration:none;background-color:#fff}.center a:hover{text-decoration:underline}.center table{border-collapse:collapse;border:0;width:934px;box-shadow:1px 2px 3px #ccc;text-align:left;margin:10px auto}.center table th{text-align:center!important}.center table td,.center table th{border:1px solid #666;font-size:75%;vertical-align:baseline;padding:5px;text-align:center}.center h1,.center h2{text-transform:uppercase}.center .p{text-align:left}.center .e{background-color:#ccf;width:300px;font-weight:700}.center .h{background-color:#99c;font-weight:700}.center .v{background-color:#ddd;max-width:300px;overflow-x:auto;word-wrap:break-word}.center .v i{color:#999}.center img{float:right;border:0}.center hr{width:934px;background-color:#ccc;border:0;height:1px}.tab{overflow:hidden;border:1px solid #ccc;background-color:#f1f1f1}.tab button{background-color:inherit;float:left;border:none;outline:0;cursor:pointer;padding:14px 16px;transition:.3s;font-size:17px}.tab button.active,.tab button:hover{background-color:#777BB3;color:#fff}.tabcontent{display:none;padding:6px 12px;border:1px solid #ccc;border-top:none}#phpinfo-WP{text-align:center}#phpinfo-wp{margin-right:20px}#phpinfo-output{text-align:center;font-size:30px;margin-top:20px;font-weight:600;color:#777BB3}#phpinfo-log{line-height:1.5;height:400px;width:98.24%;overflow:auto;background-color:;font-family:sans-serif;padding:10px;margin-top:30px;border-radius:10px;font-weight:400;font-size:18px}/*# sourceMappingURL=style.min.css.map */
  • phpinfo-wp/trunk/js/scripts.js

    r2574260 r2585546  
    66    var tabcontent = document.getElementsByClassName("tabcontent");
    77    var tablinks = document.getElementsByClassName("tablinks");
    8     var editorAlert = document.getElementById('htaccess-editor');
     8    var );
    99
    1010    function showButton() {
     
    5555    }
    5656
    57     editorAlert.addEventListener('click', (() => {
    58         var alertCounter = 0;
    59         return () => {
    60             if (alertCounter === 0) {
    61                 alert('Warning: Make sure you have proper knowledge before performing any action!!!');
    62             }
    63             alertCounter++;
    64         }
    65     })(), false);
     57    scrollBar.scrollTop = scrollBar.scrollHeight - scrollBar.clientHeight;
    6658
    6759}
  • phpinfo-wp/trunk/js/scripts.min.js

    r2574260 r2585546  
    1 "use strict";function main(){var topButton=document.getElementById("topButton-phpinfo-WP");var tabcontent=document.getElementsByClassName("tabcontent");var tablinks=document.getElementsByClassName("tablinks");var editorAlert=document.getElementById("htaccess-editor");function showButton(){if(topButton!==null){if(document.body.scrollTop>400||document.documentElement.scrollTop>400){topButton.style.display="block"}else{topButton.style.display="none"}}}window.onscroll=function(){showButton()};function goTop(){document.body.scrollTop=0;document.documentElement.scrollTop=0}if(topButton!==null){topButton.addEventListener("click",goTop)}function manageContent(){for(let i=0;i<tabcontent.length;i++){tabcontent[i].style.display="none"}for(let i=0;i<tablinks.length;i++){tablinks[i].className=tablinks[i].className.replace(" active","")}}let i;for(let link of tablinks){link.addEventListener("click",()=>{manageContent();if(link.id=="log-tab")i=3;else if(link.id=="info-tab")i=2;else if(link.id=="extension-tab")i=1;else i=0;document.getElementById(tabcontent[i].id).style.display="block";event.currentTarget.className+=" active"})}editorAlert.addEventListener("click",(()=>{var alertCounter=0;return()=>{if(alertCounter===0){alert("Warning: Make sure you have proper knowledge before performing any action!!!")}alertCounter++}})(),false)}if(document.getElementById("phpinfo-wp")!=null){main()}
     1"use strict";function main(){var topButton=document.getElementById("topButton-phpinfo-WP");var tabcontent=document.getElementsByClassName("tabcontent");var tablinks=document.getElementsByClassName("tablinks");var }if(document.getElementById("phpinfo-wp")!=null){main()}
  • phpinfo-wp/trunk/phpinfo-wp.php

    r2575852 r2585546  
    55Plugin URI: https://github.com/s4gor/phpinfo_wp
    66Description: A simple plugin to look up information about PHP and manage PHP configurations and directive values.
    7 Version: 2.2.1
     7Version: 2.2.
    88Author: Imran Hossain Sagor
    99Author URI: https://imransagor.codes
     
    4646                ?>
    4747                <div class="notice notice-info" id="phpinfo-wp-notice">
    48                     <p style="margin-right: 20px"><?php _e( '<b>Bored of getting update notifications? Do you want to get rid of it? Do you want to disable your site’s update process? Check out my new plugin <a href="https://downloads.wordpress.org/plugin/phpinfo-wp.zip" target="_blank">Disable Auto Updates</a> through which you can disable your WordPress website’s theme, core and plugin auto-update along with notifications. It will also disappear the red numbered mark from the plugin’s menu title.</b>', 'phpinfo-wp' ); ?> </p>
     48                    <p style="margin-right: 20px"><?php _e( '<b>Bored of getting update notifications? Do you want to get rid of it? Do you want to disable your site’s update process? Check out my new plugin <a href="https://" target="_blank">Disable Auto Updates</a> through which you can disable your WordPress website’s theme, core and plugin auto-update along with notifications. It will also disappear the red numbered mark from the plugin’s menu title.</b>', 'phpinfo-wp' ); ?> </p>
    4949                    <a href="?phpinfowp-notice-dismissed">Dismiss</a>
    5050                </div>
     
    7373            flush_rewrite_rules();
    7474        }
     75
    7576        public function enqueue() {
    7677            wp_enqueue_style('phpinfo-WP', plugins_url( 'css/style.min.css', __FILE__ ));
    7778            wp_enqueue_script('phpinfo-WP', plugin_dir_url(__FILE__) . 'js/scripts.min.js#async');
    7879        }
     80
    7981        public function script_async($url) {
    8082            if(strpos($url, '#async') === false) {
     
    8486            }
    8587        }
     88
    8689        public function footer_notice(){
    87             echo '<span id="footer-thankyou">Thank you for using <a href="https://wordpress.org/plugins/phpinfo-wp/">phpinfo() WP</a></span>';
     90            echo '<span id="footer-thankyou">Thank you for using <a href="https://wordpress.org/plugins/phpinfo-wp/">phpinfo() WP</a></span>';
    8891        }
    8992
     
    9598            if(strpos($file, "phpinfo-wp/phpinfo-wp.php") !== false) {
    9699                $new_link = [
    97                     "donation" => '<a href="https://imransagor.codes" target="_blank">Support Me &#x2764;</a>'
     100                    "donation" => '<a href="https://imransagor.codes</a>'
    98101                ];
    99102
  • phpinfo-wp/trunk/readme.txt

    r2575855 r2585546  
    33Tags: phpinfo, server info, php, server configuration, php ini, phpinfo(), php configuration, htaccess, apache
    44Requires at least: 4.7
    5 Tested up to: 5.8-beta1
    6 Stable tag: 2.2.1
     5Tested up to: 5.8
     6Stable tag: 2.2.
    77Requires PHP: 5.0
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
    10 Donate link: https://www.paypal.com/donate?hosted_button_id=GUA4CQY8QFZ9G
     10Donate link: https://
    1111
    1212A simple plugin to look up server info and manage server configuration of wordpress site
     
    4444
    4545== Change Log ==
     46
     47
     48
     49
     50
    4651
    4752= 2.2.1 =
  • phpinfo-wp/trunk/views/views.php

    r2575846 r2585546  
    11<?php
    22
    3 if(!file_exists(WP_CONTENT_DIR . '/logs')) {
    4     wp_mkdir_p(WP_CONTENT_DIR . '/logs/phpinfo-WP');
    5 }
    6 
    7 if(file_exists(WP_CONTENT_DIR . '/logs/phpinfo-WP') && !file_exists(WP_CONTENT_DIR . '/logs/phpinfo-WP/log.txt')) {
    8     $log_file = fopen(WP_CONTENT_DIR . '/logs/phpinfo-WP/log.txt', "wb");
     3defined('ABSPATH') or die('Unauthorized Access');
     4
     5
     6// path variables
     7
     8$root_dir = get_home_path();
     9$content_dir = WP_CONTENT_DIR;
     10
     11
     12function new_request() {
     13
     14    $ch = curl_init();
     15
     16    curl_setopt($ch, CURLOPT_URL, get_site_url());
     17    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     18    curl_setopt($ch, CURLOPT_HEADER, 0);
     19
     20    $data = curl_exec($ch);
     21
     22    curl_close($ch);
     23
     24    return $data;
     25}
     26
     27
     28if(!file_exists($content_dir . '/logs')) {
     29    wp_mkdir_p($content_dir . '/logs/phpinfo-WP');
     30}
     31
     32
     33if(file_exists("$content_dir/logs/phpinfo-WP")) $phpinfo_log_dir = "$content_dir/logs/phpinfo-WP";
     34
     35
     36if(file_exists($phpinfo_log_dir) && !file_exists("$phpinfo_log_dir/log.txt")) {
     37    $log_file = fopen("$phpinfo_log_dir/log.txt", "wb");
    938    fwrite($log_file,'');
    1039    fclose($log_file);
    1140}
    1241
    13 if(is_writable('../')) {
     42if(is_writable()) {
    1443
    1544    $phpinfowp_log = '';
     
    1847
    1948    if(isset($_POST['backup'])) {
    20         $backup = fopen('../.htaccess.bak', 'wb');
    21         $htaccess = file_get_contents('../.htaccess');
     49        $backup = fopen(, 'wb');
     50        $htaccess = file_get_contents();
    2251        fwrite($backup, '#BACKED UP by phpinfo() WP' . PHP_EOL);
    2352        fwrite($backup, $htaccess);
     
    3059
    3160    } elseif(isset($_POST['restore'])) {
    32         $backup_file = file_get_contents('../.htaccess.bak');
    33         $htaccess = fopen('../.htaccess', 'w');
     61        $backup_file = file_get_contents("$root_dir/.htaccess.bak");
     62        $htaccess = fopen("$root_dir/.htaccess", 'w');
     63        $htaccess_phpinfo = fopen("$root_dir/htaccess-phpinfo.txt", 'w');
    3464        fwrite($htaccess, $backup_file);
     65
    3566        fclose($htaccess);
     67
    3668        $phpinfowp_log = "htaccess file has been restored on " . current_time('mysql') . " by $user<br />";
    3769        echo '<script>    window.addEventListener("DOMContentLoaded", () => {
     
    4375        $custom_value = htmlspecialchars($_POST['htaccess']);
    4476
    45         $files = scandir('../');
     77        $files = scandir();
    4678
    4779        if(!in_array('htaccess-phpinfo.txt', $files)) {
    48             $previous_contents = fopen('../htaccess.txt', 'wb');
    49             $content = file_get_contents('../.htaccess');
     80            $previous_contents = fopen(, 'wb');
     81            $content = file_get_contents();
    5082            fwrite($previous_contents, $content . PHP_EOL . PHP_EOL . '# BEGIN htaccess-phpinfo');
    5183            fclose($previous_contents);
    52             $custom_file = fopen('../htaccess-phpinfo.txt', 'wb');
     84            $custom_file = fopen(, 'wb');
    5385            fwrite($custom_file, $custom_value);
    5486            fclose($custom_file);
    55             $handle = fopen('../htaccess-phpinfo.txt', 'r');
     87            $handle = fopen(, 'r');
    5688            $custom_values = '';
    5789            if ($handle) {
     
    6092                }
    6193                fclose($handle);
    62                 $handle = fopen('../htaccess-phpinfo-new.txt', 'wb');
     94                $handle = fopen(, 'wb');
    6395                fwrite($handle, $custom_values);
    6496                fclose($handle);
    6597            }
    66             $htaccess = fopen('../.htaccess', 'w');
    67             $new_content = file_get_contents('../htaccess-phpinfo-new.txt');
    68             $previous_contents = file_get_contents('../htaccess.txt');
     98            $htaccess = fopen(, 'w');
     99            $new_content = file_get_contents();
     100            $previous_contents = file_get_contents();
    69101            fwrite($htaccess, $previous_contents . PHP_EOL . $new_content);
    70102            fclose($htaccess);
    71             unlink('../htaccess-phpinfo-new.txt');
     103            unlink();
    72104        } else {
    73             $custom_file = fopen('../htaccess-phpinfo.txt', 'w+');
     105            $custom_file = fopen(, 'w+');
    74106            fwrite($custom_file, $custom_value);
    75107            fclose($custom_file);
    76             $handle = fopen('../htaccess-phpinfo.txt', 'r');
     108            $handle = fopen(, 'r');
    77109            $custom_values = '';
    78110            if ($handle) {
     
    81113                }
    82114                fclose($handle);
    83                 $handle = fopen('../htaccess-phpinfo-new.txt', 'wb');
     115                $handle = fopen(, 'wb');
    84116                fwrite($handle, $custom_values);
    85117                fclose($handle);
    86118            }
    87             $htaccess = fopen('../.htaccess', 'w');
    88             $previous_contents = file_get_contents('../htaccess.txt');
    89             $new_content = file_get_contents('../htaccess-phpinfo-new.txt');
     119            $htaccess = fopen(, 'w');
     120            $previous_contents = file_get_contents();
     121            $new_content = file_get_contents();
    90122            fwrite($htaccess, $previous_contents . PHP_EOL . $new_content);
    91123            fclose($htaccess);
    92             unlink('../htaccess-phpinfo-new.txt');
     124            unlink();
    93125        }
    94         $phpinfowp_log = "htaccess file has been edited on " . current_time('mysql') . " by $user<br />";
    95         echo '<script>    window.addEventListener("DOMContentLoaded", () => {
    96         document.getElementById("phpinfo-output").innerHTML = "FILE HAS BEEN SAVED!";
    97         document.getElementById("phpinfo-output").style.display = "block";
    98     });</script>';
     126
     127        $data = new_request();
     128
     129        if(strpos($data, 'Internal Server Error')) {
     130
     131            $backup_file = file_get_contents("$root_dir/.htaccess.bak");
     132            $htaccess = fopen("$root_dir/.htaccess", 'w');
     133            fwrite($htaccess, $backup_file);
     134            fclose($htaccess);
     135
     136            echo '<script>    window.addEventListener("DOMContentLoaded", () => {
     137            document.getElementById("phpinfo-output").innerHTML = "CAN\'T SAVE. ERROR ON YOU CODE";
     138            document.getElementById("phpinfo-output").style.display = "block";
     139        });</script>';
     140        } else {
     141
     142            $phpinfowp_log = "htaccess file has been edited on " . current_time('mysql') . " by $user<br />";
     143            echo '<script>    window.addEventListener("DOMContentLoaded", () => {
     144            document.getElementById("phpinfo-output").innerHTML = "FILE HAS BEEN SAVED!";
     145            document.getElementById("phpinfo-output").style.display = "block";
     146        });</script>';
     147        }
     148
    99149    }
    100150
    101     $log_file = fopen(WP_CONTENT_DIR . '/logs/phpinfo-WP/log.txt', "a");
     151    $log_file = fopen(, "a");
    102152    fwrite($log_file, $phpinfowp_log);
    103153    fclose($log_file);
     
    123173  </div>
    124174
    125     <div id="phpinfo-output" style="display: none"></div>
    126 
    127175    <div id="phpinfo-htaccess" class="tabcontent" style="display: block">
     176
     177
    128178
    129179        <div id="htaccess-phpinfo">
    130180            <p id="htaccess-phpinfo-des"><b>This is only for <span style="color: #777BB3;">Apache Server</span></b>. Use this form to set, change value of PHP configurations. You can change any value of PHP's configuration. All you have to do is to follow the rules how to use it. Just write the directive name without php_value tag like, upload_max_filesize. and the write the value. <b>e.g. upload_max_filesize 200M</b>. <br />To change or set another directive, in new line, write the directive, a space, then the value. To understand this thing better, see placeholder</p>
    131             <div id="htaccess-warning">Do not touch without proper knowledge. Make sure you write correct syntax otherwise server will break down!!!</div>
    132             <form action="<?= $_SERVER['PHP_SELF'] . '?page=phpinfo_wp'; ?>" METHOD="post">
     181
     182            <form action="" METHOD="post">
    133183            <textarea name="htaccess" id="htaccess-editor" placeholder="max_file_uploads 25
    134184upload_max_filesize 60M"><?php
    135                 $files = scandir('../');
     185                $files = scandir();
    136186                if(in_array('htaccess-phpinfo.txt', $files)) {
    137                     echo file_get_contents('../htaccess-phpinfo.txt');
     187                    echo file_get_contents();
    138188                }
    139189                ?></textarea><br>
     
    142192                <button name="restore" id="phpinfo-htaccess-restore">Restore</button>
    143193            </form>
    144             <div id="htaccess-warning">Make sure, you take backup <b>.htaccess</b> file using backup button which can be restored later using restore button</div>
    145194        </div>
    146195
     
    190239
    191240    <div id="phpinfo-log" class="tabcontent">
    192         <?php echo file_get_contents(WP_CONTENT_DIR . '/logs/phpinfo-WP/log.txt'); ?>
     241        <?php echo file_get_contents(); ?>
    193242    </div>
    194243
Note: See TracChangeset for help on using the changeset viewer.