• Resolved thadfiebich

    (@thadfiebich)


    I created a custom plugin. When in the admin area, I click the link under the settings section, and get the following error. I have made no chmod changes anywhere. The plugin folder is 755.

    You do not have sufficient permissions to access this page.
    (This is the only thing on the page, no menus)

    file 1 (chmod 644)

    <?php
    /*
    Plugin Name: Community Profile Manager
    Plugin URI: https://www.amitx.com
    Description: Manage AMI Community Profiles
    Version: 1.0
    Author: Thad Fiebich
    Author URI: https://www.amitx.com
    */
    
    function oscimp_admin() {
        include('comm_profile_admin.php');
    }
    
    function oscimp_admin_actions() {
        add_options_page("OSCommerce Product Display", "OSCommerce Product Display", 1, "OSCommerce Product Display", "oscimp_admin");
    }   
    
    add_action('admin_menu', 'oscimp_admin_actions');
    ?>

    File 2 (chmod 644)

    <div class="wrap">
        hi
    </div>

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter thadfiebich

    (@thadfiebich)

    I also forced a database upgrade by changing wp_options db_version to 8204. It made me upgrade the database version..

    Still doesnt work.

    Thread Starter thadfiebich

    (@thadfiebich)

    I also tried the below and it didnt work

    function txfx_log($text) {
    	echo $text . '<br />';
    }
    
    switch ($_GET['step']) :
    	case "1":
    		require('wp-config.php');
    		txfx_log('WordPress loaded...');
    		require('wp-admin/upgrade-functions.php');
    		txfx_log('Upgrade functions loaded...');
    		wp_cache_flush();
    		txfx_log('Object cache flushed...');
    		make_db_current();
    		txfx_log('Database made current...');
    		upgrade_160();
    		txfx_log('Data upgraded...');
    		$wp_rewrite->flush_rules();
    		txfx_log('Rewrite rules flushed...');
    		wp_cache_flush();
    		txfx_log('Object cache flushed...');
    		txfx_log('<br />');
    		txfx_log('Hopefully that did it!  <strong>DELETE THIS FILE FROM YOUR SERVER NOW!</strong>');
    		txfx_log('And then, try to access your <code>/wp-admin/</code>');
    		break;
    	default :
    		txfx_log('This script will attempt to upgrade your database.  It is intended for users of WordPress 1.5 or later.');
    		txfx_log('<strong>You should delete this script from your server after you are done using it!</strong>');
    		txfx_log('<br />');
    		txfx_log('<a href="?step=1">Click here</a> to attempt the upgrade');
    		break;
    endswitch;
    Thread Starter thadfiebich

    (@thadfiebich)

    Got it! I was not using add_options_page right. There was something weird with my 4th parameter.

    Sorry for the late reply, but just had the same problem with that tutorial and your answer was not that helpful. So 2 more cents for clarification.

    The fourth parameter is a slug, which is letters, numbers and dashes/underscores based. The example from the tutorial has blank spaces and this is a problem since the 3rd version.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Creating plug – Admin Panel – No Permission’ is closed to new replies.