Forum Replies Created

Viewing 15 replies - 1 through 15 (of 46 total)
  • Yes, it’s possible.

    In the settings, select “Whitelist” as “Matching rule” (“A request from which the country code or IP address is NOT in the whitelist will be blocked.”).

    In “Whitelist of country code or pattern”, put something non-existent (like “XX”)

    In “Whitelist of extra IP-addresses prior to country code/pattern”, put the allowed IP-addresses.

    Thread Starter peoy

    (@peoy)

    Images does not seem to stick to the post..

    First image displayed the working ‘edit’ link to “post.php?post=ID&action=edit&lang=sv” (because that test post was initially created in Swedish)

    The second image displayed the non-working ‘edit’ link, it is blank (a href=””), so it just goes back to the current page (listing page for posts):
    “edit.php?post_type=post&lang=sv” (the second test post was created in English first, so the edit link for additional languages are broken)

    I have verified that both links worked (with a Editor role user) on version 2.0.4.1 of WPML (in combination with the latest supported WordPress version (3.0.5) for that WPML version).

    Thread Starter peoy

    (@peoy)

    I solved it.

    For some reason, I had to put the code in drop-in.php as described in My custom functions in “functions.php” doesn’t work.

    My server is not using a multisite setup, but the hooks weren’t triggered at all when I had the code in functions.php (and everything else there works).
    I used the ‘ip-location-block-login-status’ hook to trigger only on /wp-admin access:

    <?php
    function log_blocked_ips($code) {
      if ( ! class_exists( 'IP_Location_Block' ) ) {
        error_log( 'IP Location Block is not active' );
        return;
      }
      $log_path = get_stylesheet_directory() . '/wp_blocked_ip_log.txt';
      $now = date("Y-m-d H:i:s");
      $ip_address = IP_Location_Block::get_ip_address();
      file_put_contents( $log_path, "$now $ip_address\n", FILE_APPEND );
      return 404;
    }
    add_filter( 'ip-location-block-login-status',  'log_blocked_ips');
    ?>
    

    The rest of my code is not public, but what I do is that besides logging is:
    First I block the address range(s) in inetnum (from Whois) for the IP doing the unauthorized access to /wp-admin (blocking is done using Wordfence),
    I create a partial shell script with firewalld commands to block the same range in the firewall (protecting all sites and services on the web server for further abuse).
    This partial script is executed by a cron job every 10th minute and logs the firewalld commands to reverse the blocking action.

    Thread Starter peoy

    (@peoy)

    Thanks Darko,

    The code seems to (somewhat) work, but it also logs access to anything else than just unwanted access to /wp-admin (what I’m looking for an easy way to log and then block in the machine’s firewall).

    Any way to just log the unwanted (non-whitelisted) access to /wp-admin ?

    /PeO

    I also recommend you to take a look at the developers’ forum for topics not covered hree:
    https://colorlibsupport.com/

    There is [no longer] a specific child theme for Sparkling, but just as with any other theme, it’s easy to do you own.
    This is all there is, from the latest released basic child theme (I downloaded it 3 years ago):

    == style.css ==

    /*
    Theme Name: Sparkling Child
    Theme URI: https://colorlib.com/wp/themes/sparkling
    Author: Colorlib
    Author URI: http://colorlib.com/
    Description: Sparkling is a clean minimal and responsive WordPress theme well suited for travel, health, business, finance, design, art, personal and any other creative websites and blogs. Developed using Bootstrap 3 that makes it mobile and tablets friendly. Theme comes with full-screen slider, social icon integration, author bio, popular posts widget and improved category widget. Sparkling incorporates latest web standards such as HTML5 and CSS3 and is SEO friendly thanks to its clean structure and codebase. It has dozens of Theme Options to change theme layout, colors, fonts, slider settings and much more. Theme is also translation and multilingual ready and is available in Spanish. Sparkling is a free WordPress theme with premium functionality and design.
    Version: 2.5.0
    Template: sparkling
    License: GNU General Public License v2 or later
    License URI: http://www.gnu.org/licenses/gpl-2.0.html
    Text Domain: sparkling
    Domain Path: /languages/
    Tags: green, light, white, gray, black, one-column, two-columns, right-sidebar, fluid-layout, responsive-layout, photoblogging, left-sidebar, translation-ready, custom-background, custom-colors, custom-menu, featured-images, full-width-template, post-formats, theme-options, threaded-comments
    
    This theme, like WordPress, is licensed under the GPL.
    
    sparkling is based on Underscores http://underscores.me/, (C) 2012-2015 Automattic, Inc.
    
    */

    == functions.php ==

    <?php
    // Add your custom functions here
    
    // Queue parent style followed by child/customized style
    add_action( 'wp_enqueue_scripts', 'sparkling_enqueue_child_styles', 99);
    
    function sparkling_enqueue_child_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_dequeue_style('sparkling-style');
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array('parent-style')
        );
    }
    
    ?>

    and for completeness == readme.txt ==

    Install it like any other theme and active it via WordPress dashboard. You should have Sparkling theme side by side with Sparkling Child theme when attempting to enable this one.
    
    Thank you for using our themes!
    
    For more awesome themes please visit: http://colorlib.com/wp/themes/
    peoy

    (@peoy)

    Then, after getting back the good version (6.5.4), go to Plugins/Plugin Editor (select plugin to edit: “Anti-Spam”) and change the version number from “6.5.4” to “16.5.4” to avoid updating to the bloatversion for a while.

    <?php
    /*
    Plugin Name: Anti-Spam
    Plugin URI: http://ww.wp.xz.cn/plugins/anti-spam/
    Description: No spam in comments. No captcha.
    Version: 16.5.4
    Author: CreativeMotion
    Text Domain: anti-spam
    Author URI: https://cm-wp.com/
    License: GPLv3
    */

    2.4.6 is counting (and not changing hours after the minute turns over for the first time) but still broken..

    At 15:03 local time, it says it is 10 hours and 57 minutes until midmight using the following code in a widget:

    [tminus t="2020-04-15 00:00" style="carbonlite"/]

    Even worse now when we turned over to summer time.. Now the time is two hours off until the minute turns over for the first time.

    Could you give a link to 2.4.6 or a fixed 2.4.7 ?

    You did not follow rule #1: Never update WooCommerce on a live site before checking if it works on your staging/development site, and rule #2: Never update WooCommerce the first two weeks after a new major version.

    It’s broken .. could this be fixed ?

    Same problem but the othwe way around. I get one hour more than the correct value until the first minute turns over:

    http://test.hogkammen.se/sparkling/countdown-page/

    (This is Sweden, with the correct time zone on both the local development server, and the public given above).

    When I reload the page, I get that extra hour again.

    • This reply was modified 6 years, 3 months ago by peoy.

    @clavaque Got that same problem with one of my protected user accounts yesterday (or actually a few days ago).

    First, reasonable or not, the block for monthly limit of different IP-addresses was triggered. I cleared the log (+ ran my own script to remove all entries in wp_options containing “%_transient_%_s2m_ipr_%”).
    Then the above error appeared, “Maximum simultaneous logins for username”. I cleared the IP log for that user (in the s2Member section of the user’s info), and he still got the same message.

    This user was using the tor browser and a VPN connection, so just a “user error”, but probably easy to reconstruct. I haven’t heard anything new from him since I told him to wait the 30 minutes before the next attempt to log in.

    It looks like “Reset IP restrictions” doesn’t do its job completely.

    • This reply was modified 6 years, 4 months ago by peoy.
    • This reply was modified 6 years, 4 months ago by peoy.

    @darrenchu to prevent bot-signups and brute force login attempts by bots, I use “Security Protection” by webvitaly:
    https://ww.wp.xz.cn/plugins/security-protection/

    It’s a bit old, but works pretty well. As the login widget in s2Member is not fully compatible with this plugin (request to fix this for some future version of s2Member ?), on every update of s2Member, I have to add one lines of code to the login widget php file:

    https://ww.wp.xz.cn/support/topic/nag-advertising-for-mailoptin/#post-11054558

    Since s2Member is almost abandoned, this will need to be redone at maximum one time a year, and since “Security Protection” has not been updated in 4 years, the update to that file should be considered a one-time task.

    [if not modifying the files, login will not work from the widget, and you will be redirected to wp-login.php]

    • This reply was modified 6 years, 4 months ago by peoy.
    Thread Starter peoy

    (@peoy)

    In your reply 11 months ago, you state the opposite:

    https://ww.wp.xz.cn/support/topic/nag-advertising-for-mailoptin/
    :
    These is the list of hooks I use to add custom form inputs to the forms:

    
    add_action('login_form', 'secprot_form_inputs');
    add_action('register_form', 'secprot_form_inputs');
    add_action('lostpassword_form', 'secprot_form_inputs');
    add_action('woocommerce_login_form', 'secprot_form_inputs');

    :

    Also:
    https://ww.wp.xz.cn/plugins/security-protection/#compatible%20with%3A

    • This reply was modified 6 years, 5 months ago by peoy.

    @webvitaly Since the s2Member plugin is abandoned (with recent promises to bring it to life again), this was an easy fix that I just did myself.

    For others, as a reference, I added a hook just after the password field was displayed in the s2Member Pro Login Widget:
    plugins/s2member-pro/src/includes/classes/login-widget.inc.php (search for “password”, add just below the input field):
    do_action('s2member_pro_login_widget', get_defined_vars());

    then in your file, security-protection.php, below the other ‘add_action’ lines:
    add_action('s2member_pro_login_widget', 'secprot_form_inputs');

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