• Resolved jonga1306

    (@jonga1306)


    I’m using Prof99’s fork 4.2 (latest) version with WP 3.5.1 including some additional code updates as discussed in the following thread:

    Thread Here

    However, I am trying to submit a post with a featured image and get the ‘Cheating’ message come up after Submitting.

    I would guess this is to do with permissions but I am logged in as admin trying to submit.

    I’ve been having problems with the plugin since WordPress 3.5 (and the new media manager). I’ve had error messages trying to upload new attachments or inline content images using the Visual editor (An error occurred in the upload. Please try again later.)

    Also, the featured image uploader won’t successfully upload – the upload ticks to 100% but no thumbnail appears.

    I wonder if this is all to do with roles/capabilities but as an admin, I would assume this shouldn’t happen.

    Any help would be gratefully received.

    https://www.ads-software.com/extend/plugins/wp-user-frontend/

Viewing 4 replies - 16 through 19 (of 19 total)
  • The ‘cheating’ message comes from wpuf-add-post.php:submit_post() and is the result of it not recognising the nonce _wpnonce sent as part of the post. Since nonce’s are connected to both the user_id and the login session maybe a http session and a https are deemed to be different.

    The initial page get is http.However the last POSTs to admin.ajax.php are using https and I suspect this and added with the XFrame problem may be causing your problem.

    Why is your server generating a mix of http and https calls? Any idea?

    Ahhh. I check of the initial page load reveals this.

    var wpuf = {"ajaxurl":"https:\/\/www.culture.info\/wp-admin\/admin-ajax.php","submit_msg":"Submit Post

    That would do it. Where does this come from? Well it comes from enqueue_scripts() in wpuf.php.

    function enqueue_scripts() {
    ...
            wp_localize_script( 'wpuf', 'wpuf', array(
                'ajaxurl' => admin_url( 'admin-ajax.php' ),
                'submit_msg' => $submit_msg,
                'update_msg' => $update_msg,
                'postingMsg' => $posting_msg,
                'deleteMsg' => $delete_msg,
                'confirmMsg' => __( 'Are you sure?', 'wpuf' ),
    			'delete_confirm_msg' => __('Are you sure to delete this post?', 'wpuf' ),
                'nonce' => wp_create_nonce( 'wpuf_nonce' ),
            ) );
    ....
    }

    So the WordPress function admin_url() is the den of our culprit. And who lives behind these doors….Your Site Address as provided by the option ‘Site Address (URL)’ in the WordPress General Settings page.

    This wont work properly especially with the media library. However Ve haf vays of making you tock https

    Thread Starter jonga1306

    (@jonga1306)

    This probably has to do with the fact I don’t use https on every page. I HAD enabled https on transactional / submission pages but not on every page. Therefore I had used admin_url() for forcing admin pages to use SSL. I can make the whole site SSL (is that the solution you are suggesting?) but I have found that by making the page with the add-post shortcode https, this resolves the issue.

    What do you advise?

    Is it works for you that is fine but be wary of problems you haven’t encountered yet, updates to come, and other plugins that may throw spanners into your works. admin_url() and related functions are used everywhere.

    Given this I think you have three options.

    1. Stay with your present scheme and workarounds but be aware of problems to come.

    2. Make everything https by either of the two options given in the link I gave you in the last post. This is the easist, most problem free, secure, and future proof method

    3. Use a partial implementation of the rewrite scheme given in the previous link for the parts you want secure.

    Thread Starter jonga1306

    (@jonga1306)

    I am happy to take your advice and revert to making the whole site SSL. I will use the htaccess option.

    Thanks again.

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘Cheating message even when posting as Admin’ is closed to new replies.