• Resolved copyjosh

    (@copyjosh)


    I installed WP Casa, and the “Listings” admin menu option was not appearing on my dashboard. I tried refreshing caches and clearing out plugins to make sure nothing was interfering, but to no avail.

    After testing “../edit.php?post_type=listings” to come to a “cheatin’ huh? — insufficient permissions” page, (fresh install of WordPress, only one admin user!), I installed the User Role Editor plugin and tried to confirm my admin permissions. Upon install and navigation to the role editor, the “Listings” link ‘magically’ appeared. Somehow it seems the Admin permissions were not updating, and this procedure made it update.

    I thought this was weird and maybe a fluke, but I can replicate this over and over again.

    In addition, I tried installing Ninja Forms, and the other free WPCasa add-on plugins, and I am having this same issue. For all of the add-on plugins, none of the dashboard links are appearing (insufficient permission issues when going to the URL).

    I can’t seem to restore the functionality like I was able to with the ‘role editor’ for the WPCasa core issue I mentioned.

    Thanks,

    Josh

    https://www.ads-software.com/plugins/wpcasa/

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

    (@copyjosh)

    Seems like the error is coming from this situation:

    Warning: File not found: includes/class-wpsight-install.php

    Since it cannot set the administrator roles from that file.. but it’s weird that the file is decidedly not found.

    Line 104 from wpcasa.php:
    register_activation_hook( basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ), create_function( "", "include_once( 'includes/class-wpsight-install.php' );" ), 10 );

    I tried adding WPSIGHT_PLUGIN_DIR/includes/… but that didn’t resolve the issue either…

    Any ideas still?

    Thanks,

    Josh

    Thread Starter copyjosh

    (@copyjosh)

    My mistake.. should have used __DIR__ I suppose..
    Error resolved by changing the line to this:

    create_function( “”, “include_once( ‘” . __DIR__ . “/includes/class-wpsight-install.php’ );” )

    Now when I activate the plugin, it behaves appropriately and I can see the “Listings” admin menu on the left side, as such, the function in that file was run which added the Administrator role privileges that were previously missing.

    But now I get a stack overflow error:

    Fatal error: Stack overflow in /var/www/html/kscapital/wp-content/plugins/wpcasa/includes/class-wpsight-post-types.php on line 490

    .

    Line 489: // Delete old listing previews if desired
    Line 490: if ( apply_filters( ‘wpsight_delete_listing_previews’, true ) )
    wpsight_delete_listing_previews();

    Thread Starter copyjosh

    (@copyjosh)

    The cron function wasn’t hooked into an action, but was calling a method function directly. So the cron “job” was running continuously until it threw a stack overflow error… I added a ‘_cron’ suffix* to the scheduler name as depicted below. And then in the next code block, hooked the function call (“the job”) into the scheduler.

    `/**
    * cron()
    *
    * Setup custom cron jobs
    *
    * @uses wp_clear_scheduled_hook()
    * @uses wp_schedule_event()
    *
    * @since 1.0.0
    */
    public function cron() {

    // Handle delete previews cron
    wp_clear_scheduled_hook( ‘wpsight_delete_listing_previews_cron’ );
    wp_schedule_event( time(), ‘daily’, ‘wpsight_delete_listing_previews_cron’ );

    }`

    `function wpsight_delete_listing_previews( $days = ” ) {
    return WPSight_Listings::delete_listing_previews( $days );
    }
    add_action(‘wpsight_delete_listing_previews_cron’, ‘wpsight_delete_listing_previews’);
    `

    This eliminated the stack overflow / infinite cron call / error….

    Unfortunately still have to figure out why the other plugins aren’t setting admin privileges.

    Plugin Author WPSight

    (@wpsight)

    We’ve posted our answer on the issue you filed on Github.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Insufficient Admin Permissions on Activate’ is closed to new replies.