Forum Replies Created

Viewing 15 replies - 1 through 15 (of 34 total)
  • Thread Starter andyexeter

    (@andyexeter)

    Hi @wfpeter,

    Thank you for the quick response.

    We use https://github.com/vinkla/wordplate for our WordPress installs which comes with this directory structure by default.

    I could change the WP_CONTENT_DIR constant to a subdirectory of the document root which would probably fix this but it would be nice if Wordfence could account for WP_CONTENT_DIR being set to the document root.

    Plugin Author andyexeter

    (@andyexeter)

    Hi @tatof,

    This has been fixed in the latest version of the plugin (v4.0).

    Thank you for letting me know about it.

    Andy

    Plugin Author andyexeter

    (@andyexeter)

    Hi @absoonoo,

    You’d need to modify the capabilities of this role so that it doesn’t have the manage_options capability.

    Failing that, you could change the capability that PostLockdown uses to determine whether a user can bypass protections with the postlockdown_admin_capability filter, e.g:

    add_filter('postlockdown_admin_capability', function() {
        return 'some_new_capability';
    });

    I have used the User Role Editor plugin for managing user roles and capabilities in the past and it seemed to work pretty well.

    • This reply was modified 3 years, 4 months ago by andyexeter.
    Plugin Author andyexeter

    (@andyexeter)

    Hi @khaliel,

    I’ve just released version 3.0.5 of the plugin with support for bulk actions 🙂

    This is an opt-in feature, so you must first enable it at the bottom of the Post Lockdown settings page. Once you’ve done this, bulk actions for the plugin will appear on all post lists screens.

    Plugin Author andyexeter

    (@andyexeter)

    Hi @khaliel,

    Thanks for the feature request!

    I like this idea and will look to implement it when I get some spare time. I’ll update this thread once a new version with this feature is released.

    Plugin Author andyexeter

    (@andyexeter)

    Hi @kumar314,

    Thank you for making me aware of this.

    I have just released a new version of the plugin (3.0.4) which contains a fix for this bug.

    Thanks, Andy

    Thread Starter andyexeter

    (@andyexeter)

    The fix works for me! Thanks for the quick turnaround on this.

    Thread Starter andyexeter

    (@andyexeter)

    I did try swapping the two str_replace lines around before posting here but this also then replaces the image URL within the data-bg attribute with the placeholder.

    This is a project we have inherited from another team so I’m not entirely sure of the goal of both the data-url attribute and the inline style on the element, and it’s of course possible that the data-url attribute isn’t required in this case (I’d need to look into the theme code further) but I still thought it best to post here 🙂

    Plugin Author andyexeter

    (@andyexeter)

    How odd! I wonder if your original 3.0.3 files had been corrupted somehow, which was causing the JavaScript to not load correctly.

    I’m glad you got it working 🙂

    Plugin Author andyexeter

    (@andyexeter)

    Hey @vyxer,

    I’ve just installed that plugin on a clean install of WordPress and am unable to replicate your issue.

    My install is using the Twenty Twenty-One theme and contains only two plugins: Enable jQuery Migrate Helper and Post Lockdown.

    On the jQuery Migrate helper plugin settings page, I have tried with both the “Default from WordPress” and “Legacy-1.12.4-wp” versions of jQuery and the Post Lockdown settings page works as expected.

    Within the developer console, what does jQuery.fn.jquery show for you? It should be 3.5.1 on WordPress 5.6.

    I’d be happy to login and take a look if you wanted to set me up with a user account. You can send the details to my email: andy@andypalmer.me

    Plugin Author andyexeter

    (@andyexeter)

    Hey @vyxer,

    Whenever a new version of WordPress is released I test the latest version of the plugin on a clean install before updating the “Tested up to” tag. I noticed no issues during this testing.

    I just tested again on a clean install and everything is working as expected. This means there is either another plugin, some theme code, or a browser extension causing this.

    Can you think of any of the above that you have recently added? It may be worth trying to disable these one by one and seeing if you can find out which one is the culprit.

    As a guess, it sounds like something is stopping the PostLockdown JavaScript from loading. Do you see any errors in the developer console?

    • This reply was modified 5 years, 2 months ago by andyexeter.
    Plugin Author andyexeter

    (@andyexeter)

    Glad you got it working! 🙂

    Plugin Author andyexeter

    (@andyexeter)

    Hi @fgelio,

    If you know how to edit a theme’s code, you just need to place the two code snippets I provided into that theme’s functions.php file

    I have also just found https://en-gb.wordpress.org/plugins/my-custom-functions/ – if you are able to install plugins you could install this one and add the code there instead 🙂

    Plugin Author andyexeter

    (@andyexeter)

    Hey @fgelio,

    For post lists, you could use the post_class filter to conditionally add classes to the table rows:

    
    add_filter('post_class', function ($classes, $class, $postId) {
        global $postlockdown;
    
        if ($postlockdown->is_post_locked($postId)) {
            $classes[] = 'postlockdown-post-locked';
        }
        if ($postlockdown->is_post_protected($postId)) {
            $classes[] = 'postlockdown-post-protected';
        }
    
        return $classes;
    }, 10, 3);
    

    For the post edit page, you could use the admin_body_class filter to conditionally add classes to the body:

    
    add_filter('admin_body_class', function ($classes) {
        if (get_current_screen()->base === 'post') {
            $post = get_post();
    
            global $postlockdown;
    
            if ($postlockdown->is_post_locked($post->ID)) {
                $classes .= ' postlockdown-post-locked';
            }
            if ($postlockdown->is_post_protected($post->ID)) {
                $classes .= ' postlockdown-post-protected';
            }
        }
    
        return $classes;
    });
    

    Hope this helps!

    Plugin Author andyexeter

    (@andyexeter)

    Hey conradish,

    I just had a thought on this that should get the plugin working the way you want it without the need for an update.

    By default, the plugin checks if the user has the manage_options capability to decide whether that user can edit a locked post or delete a protected post. You can filter that capability and use pretty much anything so no users have it.

    Something like this should work:

    
    add_filter('postlockdown_admin_capability', function() {
        return 'conradish_super_fake_capability';
    });
    

    Obviously you could change the capability to anything you wanted, it just needs to be something that admin users don’t have.

    Let me know how you get on!

    Thanks, Andy

Viewing 15 replies - 1 through 15 (of 34 total)