Plugin Directory

Changeset 1425926


Ignore:
Timestamp:
05/28/2016 05:40:00 AM (10 years ago)
Author:
MrFlannagan
Message:

Added email capability, send your php info to whomever you may need including tech support and server managers

Location:
wordpress-php-info/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • wordpress-php-info/trunk/css/thisismyurl-admin.css

    r1370242 r1425926  
    2020    position: relative;
    2121}
     22#email_phpinfo {
     23    width: 365px;
     24    cursor: pointer;
     25    margin: 0 auto;
     26    padding: 25px;
     27    font-size: 25px;
     28    font-weight: bold;
     29    text-align: center;
     30    background: #777BB4;
     31    color: #FFF;
     32    border-radius: 10px;
     33}
     34#bgpopup {
     35    background-color:rgba(0, 0, 0, 0.5);
     36    width: 100%;
     37    height: 100%;
     38    z-index: 99998;
     39    position: fixed;
     40    top: 0;
     41    left: 0;
     42    display: none;
     43}
     44#emailme {
     45    width: 350px;
     46    padding: 15px;
     47    background: pink;
     48    margin: 0 auto;
     49    z-index: 99999;
     50    position: fixed;
     51    top: 100px;
     52    display: none;
     53    left: 0;
     54    right: 0;
     55}
     56#emailsent {
     57    height: 30px;
     58    background: #FFF;
     59    border: solid 1px #000;
     60    padding: 15px;
     61    margin: 20px;
     62}
  • wordpress-php-info/trunk/readme.txt

    r1370242 r1425926  
    55Tags: simple, php, admin, phpinfo,debugging, configuration, server, support, troubleshooting
    66Requires at least: 3.2.0
    7 Tested up to: 4.5
    8 Stable tag: 14.2
     7Tested up to: 4.5.2
     8Stable tag: 15
    99
    1010It's important for a non technical administrator to be able to diagnose server related problems in WordPress.
  • wordpress-php-info/trunk/wordpress-php-info.php

    r1370242 r1425926  
    55Description:  This simple plugin adds an option to an adminstrator's Tools menu which displays standard phpinfo() feedback details to the user.
    66Author: Chris Flannagan
    7 Version: 14.2
     7Version: 15
    88Author URI: http://whoischris.com/
    99*/
     
    7272            wp_register_style( 'thisismyurl-wpphpinfo', plugin_dir_url( __FILE__ ) . 'css/thisismyurl-admin.css', false, '14.12' );
    7373            wp_enqueue_style( 'thisismyurl-wpphpinfo' );
     74            wp_enqueue_script( 'flannyjs', plugin_dir_url( __FILE__ ) . 'js/phpinfo-js.js', array( 'jquery' ) );
    7475
    7576        }
     
    9293
    9394    function thisismyurl_wpphpinfo_page() {
     95
     96        if( isset( $_REQUEST['sendtoemail'] ) ) {
     97            $to = $_REQUEST['sendtoemail'];
     98            $subject = 'WordPress User Submitted PHP Info()';
     99            $body = $this->phpinfo_output_noecho();
     100            $headers = array('Content-Type: text/html; charset=UTF-8');
     101
     102            wp_mail( $to, $subject, $body, $headers );
     103
     104            echo '<div id="emailsent"><h2>Email SENT! Be sure to tell receiver they may need to check their junk/spam folders for this information.</h2></div>';
     105        }
     106
    94107        ?>
     108
     109        <div id="bgpopup"></div>
     110        <div id="emailme">
     111            <form action="" method="post">
     112                <table>
     113                    <tr>
     114                        <td>Send to: </td>
     115                        <td><input type="text" name="sendtoemail" /></td>
     116                        <td><input type="submit" value="Send it!" /></td>
     117                    </tr>
     118                </table>
     119            </form>
     120            <button id="closeemail" style="font-size:20px;font-weight:bold;background:#e968ff;color:#FFF;">
     121                Close This Window
     122            </button>
     123        </div>
    95124        <div class="wrap">
    96125            <div class="thisismyurl-icon32"><br /></div>
     
    100129            <h3><?php _e( 'General Settings', 'thisismyurl_wpphpinfo' ); ?></h3>
    101130            <p><?php printf( __( 'The plugin has no settings, once activated it will work automattically. For further details, please view the <a href="%sreadme.txt">readme.txt</a> file included with this release.', 'thisismyurl_wpphpinfo' ), plugin_dir_url( __FILE__ ) ); ?></p>
     131            <p style="width: 100%;"><button id="email_phpinfo">Email This Information</button></p>
    102132            <?php $this->phpinfo_output(); ?>
    103133            <br style='clear:both;' />
     
    108138
    109139    function phpinfo_output() {
    110        
     140
    111141        ob_start();
    112142        phpinfo(-1);
     
    120150            unset( $phpinfo_array[0] );
    121151            foreach ( $phpinfo_array as $phpinfo_element ) {
    122                
     152
    123153                $phpinfo_element = str_replace( '<tr', '<tr valign="top"', $phpinfo_element );
    124154
     
    130160    }
    131161
    132  
     162    function phpinfo_output_noecho() {
     163        $myreturn = '';
     164        ob_start();
     165        phpinfo(-1);
     166        $phpinfo_content = ob_get_contents();
     167        ob_end_clean();
     168
     169        if ( ! empty( $phpinfo_content ) )
     170            $phpinfo_array = explode( '<table', $phpinfo_content );
     171
     172        if ( ! empty( $phpinfo_array ) ) {
     173            unset( $phpinfo_array[0] );
     174            foreach ( $phpinfo_array as $phpinfo_element ) {
     175
     176                $phpinfo_element = str_replace( '<tr', '<tr valign="top"', $phpinfo_element );
     177
     178                $myreturn .= '<table class="phpinfo" ' . $phpinfo_element;
     179                $myreturn .= '<div style="clear:both"></div>';
     180            }
     181
     182        }
     183        return $myreturn;
     184    }
     185
     186
     187
    133188}
    134189
Note: See TracChangeset for help on using the changeset viewer.