Changeset 2585546
- Timestamp:
- 08/19/2021 02:56:22 PM (3 years ago)
- Location:
- phpinfo-wp/trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
phpinfo-wp/trunk/css/style.css
r2575846 r2585546 197 197 width: 98.24%; 198 198 overflow: auto; 199 background-color: gray;200 color: white;199 background-color: ; 200 color: ; 201 201 font-family: sans-serif; 202 202 padding: 10px; … … 207 207 } 208 208 /*# 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 219 219 width: 98.24%; 220 220 overflow:auto; 221 background-color: gray;222 color: white;221 background-color: ; 222 color: ; 223 223 font-family: sans-serif; 224 224 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 6 6 var tabcontent = document.getElementsByClassName("tabcontent"); 7 7 var tablinks = document.getElementsByClassName("tablinks"); 8 var editorAlert = document.getElementById('htaccess-editor');8 var ); 9 9 10 10 function showButton() { … … 55 55 } 56 56 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; 66 58 67 59 } -
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 5 5 Plugin URI: https://github.com/s4gor/phpinfo_wp 6 6 Description: A simple plugin to look up information about PHP and manage PHP configurations and directive values. 7 Version: 2.2. 17 Version: 2.2. 8 8 Author: Imran Hossain Sagor 9 9 Author URI: https://imransagor.codes … … 46 46 ?> 47 47 <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> 49 49 <a href="?phpinfowp-notice-dismissed">Dismiss</a> 50 50 </div> … … 73 73 flush_rewrite_rules(); 74 74 } 75 75 76 public function enqueue() { 76 77 wp_enqueue_style('phpinfo-WP', plugins_url( 'css/style.min.css', __FILE__ )); 77 78 wp_enqueue_script('phpinfo-WP', plugin_dir_url(__FILE__) . 'js/scripts.min.js#async'); 78 79 } 80 79 81 public function script_async($url) { 80 82 if(strpos($url, '#async') === false) { … … 84 86 } 85 87 } 88 86 89 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>'; 88 91 } 89 92 … … 95 98 if(strpos($file, "phpinfo-wp/phpinfo-wp.php") !== false) { 96 99 $new_link = [ 97 "donation" => '<a href="https://imransagor.codes " target="_blank">Support Me ❤</a>'100 "donation" => '<a href="https://imransagor.codes</a>' 98 101 ]; 99 102 -
phpinfo-wp/trunk/readme.txt
r2575855 r2585546 3 3 Tags: phpinfo, server info, php, server configuration, php ini, phpinfo(), php configuration, htaccess, apache 4 4 Requires at least: 4.7 5 Tested up to: 5.8 -beta16 Stable tag: 2.2. 15 Tested up to: 5.8 6 Stable tag: 2.2. 7 7 Requires PHP: 5.0 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html 10 Donate link: https:// www.paypal.com/donate?hosted_button_id=GUA4CQY8QFZ9G10 Donate link: https:// 11 11 12 12 A simple plugin to look up server info and manage server configuration of wordpress site … … 44 44 45 45 == Change Log == 46 47 48 49 50 46 51 47 52 = 2.2.1 = -
phpinfo-wp/trunk/views/views.php
r2575846 r2585546 1 1 <?php 2 2 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"); 3 defined('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 12 function 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 28 if(!file_exists($content_dir . '/logs')) { 29 wp_mkdir_p($content_dir . '/logs/phpinfo-WP'); 30 } 31 32 33 if(file_exists("$content_dir/logs/phpinfo-WP")) $phpinfo_log_dir = "$content_dir/logs/phpinfo-WP"; 34 35 36 if(file_exists($phpinfo_log_dir) && !file_exists("$phpinfo_log_dir/log.txt")) { 37 $log_file = fopen("$phpinfo_log_dir/log.txt", "wb"); 9 38 fwrite($log_file,''); 10 39 fclose($log_file); 11 40 } 12 41 13 if(is_writable( '../')) {42 if(is_writable()) { 14 43 15 44 $phpinfowp_log = ''; … … 18 47 19 48 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(); 22 51 fwrite($backup, '#BACKED UP by phpinfo() WP' . PHP_EOL); 23 52 fwrite($backup, $htaccess); … … 30 59 31 60 } 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'); 34 64 fwrite($htaccess, $backup_file); 65 35 66 fclose($htaccess); 67 36 68 $phpinfowp_log = "htaccess file has been restored on " . current_time('mysql') . " by $user<br />"; 37 69 echo '<script> window.addEventListener("DOMContentLoaded", () => { … … 43 75 $custom_value = htmlspecialchars($_POST['htaccess']); 44 76 45 $files = scandir( '../');77 $files = scandir(); 46 78 47 79 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(); 50 82 fwrite($previous_contents, $content . PHP_EOL . PHP_EOL . '# BEGIN htaccess-phpinfo'); 51 83 fclose($previous_contents); 52 $custom_file = fopen( '../htaccess-phpinfo.txt', 'wb');84 $custom_file = fopen(, 'wb'); 53 85 fwrite($custom_file, $custom_value); 54 86 fclose($custom_file); 55 $handle = fopen( '../htaccess-phpinfo.txt', 'r');87 $handle = fopen(, 'r'); 56 88 $custom_values = ''; 57 89 if ($handle) { … … 60 92 } 61 93 fclose($handle); 62 $handle = fopen( '../htaccess-phpinfo-new.txt', 'wb');94 $handle = fopen(, 'wb'); 63 95 fwrite($handle, $custom_values); 64 96 fclose($handle); 65 97 } 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(); 69 101 fwrite($htaccess, $previous_contents . PHP_EOL . $new_content); 70 102 fclose($htaccess); 71 unlink( '../htaccess-phpinfo-new.txt');103 unlink(); 72 104 } else { 73 $custom_file = fopen( '../htaccess-phpinfo.txt', 'w+');105 $custom_file = fopen(, 'w+'); 74 106 fwrite($custom_file, $custom_value); 75 107 fclose($custom_file); 76 $handle = fopen( '../htaccess-phpinfo.txt', 'r');108 $handle = fopen(, 'r'); 77 109 $custom_values = ''; 78 110 if ($handle) { … … 81 113 } 82 114 fclose($handle); 83 $handle = fopen( '../htaccess-phpinfo-new.txt', 'wb');115 $handle = fopen(, 'wb'); 84 116 fwrite($handle, $custom_values); 85 117 fclose($handle); 86 118 } 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(); 90 122 fwrite($htaccess, $previous_contents . PHP_EOL . $new_content); 91 123 fclose($htaccess); 92 unlink( '../htaccess-phpinfo-new.txt');124 unlink(); 93 125 } 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 99 149 } 100 150 101 $log_file = fopen( WP_CONTENT_DIR . '/logs/phpinfo-WP/log.txt', "a");151 $log_file = fopen(, "a"); 102 152 fwrite($log_file, $phpinfowp_log); 103 153 fclose($log_file); … … 123 173 </div> 124 174 125 <div id="phpinfo-output" style="display: none"></div>126 127 175 <div id="phpinfo-htaccess" class="tabcontent" style="display: block"> 176 177 128 178 129 179 <div id="htaccess-phpinfo"> 130 180 <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"> 133 183 <textarea name="htaccess" id="htaccess-editor" placeholder="max_file_uploads 25 134 184 upload_max_filesize 60M"><?php 135 $files = scandir( '../');185 $files = scandir(); 136 186 if(in_array('htaccess-phpinfo.txt', $files)) { 137 echo file_get_contents( '../htaccess-phpinfo.txt');187 echo file_get_contents(); 138 188 } 139 189 ?></textarea><br> … … 142 192 <button name="restore" id="phpinfo-htaccess-restore">Restore</button> 143 193 </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>145 194 </div> 146 195 … … 190 239 191 240 <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(); ?> 193 242 </div> 194 243
Note: See TracChangeset
for help on using the changeset viewer.