• Hi, I have a custom plugin that was working. I changed somethings around the wp site. The next day I realized that the plugin wasn’t working. I deleted it and re-installed but it doesn’t show up on the site. The plugin in is a custom search field that shows up on the site.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Shaylee

    (@shayleehansen30)

    Do you remember what you changed around the WP site? Did you do any major updates? Sometimes that can cause weird issues.

    Could you post a copy of the search plugin file? There might be something missing information you need for it to show up.

    Thread Starter joseph_wordp

    (@joseph_wordp)

    Hello Shaylee,
    Thank you for your response. I will post the code below if that will do?
    The plugin was showing up on one tab. The site had two tabs. I wanted only one tab on the site. So tried deleting the home. I couldn’t so I tried making the plugin appear on the home page. I was able to accomplish this. But then, later, I realized that the search itself wasn’t working. It could find any file even if I gave it the correct or incorrect file name. If I gave it the wrong file name, it would loop to the default home page (ie Hello World).

    File: search
    <?php
    /*
    Plugin Name: Search
    */

    defined( ‘ABSPATH’ ) or die( ‘No script kiddies please!’ );

    /** Step 2 (from text above). */
    add_action( ‘admin_menu’, ‘my_plugin_menu’ );

    /** Step 1. */
    function my_plugin_menu() {
    add_options_page( ‘Search File’, ‘Search’, ‘manage_options’, ‘searchmenu’, ‘my_plugin_options’ );
    }

    /** Step 3. */
    function my_plugin_options() {
    if ( !current_user_can( ‘manage_options’ ) ) {
    wp_die( __( ‘You do not have sufficient permissions to access this page.’ ) );
    }

    ?>
    Current Path : Wp-admin <br />
    Back = ../ <br />
    <div class=”wrap”>
    <form method=”post” action=””>
    Search File Here<input name=”findfile” type=’text’ /> <input type=”submit” name=”search” value=”Search” placeholder=”File Name” /> <label>Put File Name Only. It will for every type of file</label>
    </form>
    </div>

    <?php
    if(!empty($_POST)){
    $filename = $_POST[‘findfile’];
    $list = glob(“{$filename}.*”);
    echo “Total “.count($list).” founds <br />”;
    foreach ( $list as $filename) {
    echo “$filename size ” . filesize($filename) . “<br />”;
    }
    }
    }
    =========================
    File: Search-ext
    <?php
    /*
    Template Name: My Search Ext
    */
    get_header();
    //echo ABSPATH;
    ?>

    <div class=”contents”>

    <div class=”wrap”>

    <form method=”post” action=””>
    Search File Here<input name=”findfile” type=’text’ /> <input type=”submit” name=”search” value=”Search” placeholder=”File Name” /> <label>Put File Name Only. It will for every type of file</label>
    </form>

    <?php
    if(!empty($_POST)){
    $filename = $_POST[‘findfile’];
    $list = glob(ABSPATH.”/pdffiles/{$filename}.*”);
    echo “Total “.count($list).” founds <br />”;
    foreach ( $list as $filename) {
    echo “Name: “.end(explode(“/”,$filename)). ” size ” . filesize($filename) . “<br />”;
    }
    }

    ?>
    </div>
    </div>
    <?php get_footer();

    Thread Starter joseph_wordp

    (@joseph_wordp)

    Anyone?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Pluggin not showing up on site page’ is closed to new replies.