• Resolved 11whyohwhy15

    (@11whyohwhy15)


    Hey,

    Have IP Geo Block installed, so far love it, but I cannot get Instagram Authorization to work, so I can post instagram pics to my slider carousel, as it keeps blocking access ? Only works if deactivated.

    What do I need to change ?

    Also is the a way to show the complete IP addresses of all blocked IP’s rather than have the last 3 numbers starred out ?

    Thanks

    Ian

    https://ww.wp.xz.cn/plugins/ip-geo-block/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author tokkonopapa

    (@tokkonopapa)

    Hi Ian,

    Unfortunately, I don’t know about “Instagram Authorization” at all. But it seems that the Instagram server is not in your country. If you know the IP addresses (or the range of IP address) of Instagram server, please put them into “Whitelist of extra IP addresses prior to country code” at “Validation rule settings“.

    Also is the a way to show the complete IP addresses of all blocked IP’s rather than have the last 3 numbers starred out ?

    Please uncheck “Anonymize IP address” at “Record settings” if the law in your country permits you to record the IP address combined with some other information (e.g. country code).

    cf. http://www.ipgeoblock.com/changelog/release-2.2.0.html#privacy-considerations-about-ip-address

    Thread Starter 11whyohwhy15

    (@11whyohwhy15)

    HI,

    For the ‘Instagram Authorization’ I get this response in logs:

    2016-05-28 08:21:10 78.150.119.143 GB wp-zep GET[80]:/wp-admin/admin.php?page=handle_canon_options_advanced&code

    The wp-admin part is the ‘Redirect URI’ of ‘Instagram Authorization’ and it keeps getting wp-zep ? whatever that means ?

    Everything else was Passed…

    If I look at my stats. page it says that IPv4 was blocked x times and I have x calls to API cache ?

    I have everything in ‘Validate Target Settings’ set to ‘block by country’, ‘Prevent Zero-day Exploit’ and ‘Force to load WP core’

    Is that any help?

    Thanks

    Ian

    Thread Starter 11whyohwhy15

    (@11whyohwhy15)

    HI,

    After much experimentation it seems the problem is when I set ‘Prevent Zero-day Exploit’ in Admin Area it stops ‘Instagram Authorization’. Will it matter if I leave that unchecked or is there another workaround somewhere ?

    I added 78.150.119.143 to ‘whitelist area’ but that didn’t do anything for this problem.

    Thanks

    Ian

    Plugin Author tokkonopapa

    (@tokkonopapa)

    Hi Ian,

    Roughly speaking, each selection plays a following role.

    • Block by country … malicious access from outside your country.
    • Prevent Zero-day Exploit … malicious access from your country.
    • Force to load WP core … malicious access not covered by the above two.
    • Important files … malicious access not covered by the above three.

    You can refer to this article.

    I added 78.150.119.143 to ‘whitelist area’ but that didn’t do anything for this problem.

    OK, that’s true. But I’m sorry I don’t see your situation.

    The wp-admin part is the ‘Redirect URI’ of ‘Instagram Authorization’

    Do you have any plugins to do this redirection? Who would access to /wp-admin/admin.php?page=...? Usually, this kind of access needs admin authentication and leads to a plugin page.

    For example, attackers can potentially download your wp-config.php by simply hitting “/wp-admin/admin.php?page=xxx&file=../../../wp-config.php” in their browser via a vulnerable plugin. WP-ZEP can protect the site against such attacks. But if you are quite sure that it’s safe, you can bypass WP-ZEP.

    Could you try to put the following snippet into your theme’s functions.php?

    function my_bypass_admins( $queries ) {
        $whitelist = array(
            'handle_canon_options_advanced',
        );
        return $queries + $whitelist;
    }
    add_filter( 'ip-geo-block-bypass-admins', 'my_bypass_admins' );

    This can prevent blocking. Please refer to http://www.ipgeoblock.com/codex/ip-geo-block-bypass-admins.html

    I hope this will help you.

    Thread Starter 11whyohwhy15

    (@11whyohwhy15)

    Hi,

    Thanks for taking the time to explain this for me.

    The ‘instagram authorization’ is at the very bottom of the advanced settings in my theme settings and allows my site to interact with instagram, so I can link to posts etc. on my instagram page and have them show up in slider revolution carousel for example.

    One last thing. Below is my functions file, have I correctly pasted the snippet in ? I left the 2 brackets at the very bottom rather than paste in after them ?

    <?php

    /**************************************
    CHILD THEME ENQUEUE STYLES
    ***************************************/

    add_action( ‘wp_enqueue_scripts’, ‘child_theme_enqueue_styles’ );

    if (!function_exists(“child_theme_enqueue_styles”)) { function child_theme_enqueue_styles() {
    wp_enqueue_style( ‘canon-parent-style’, get_template_directory_uri() . ‘/style.css’, array(‘canon-normalize’) );

    /**************************************
    IP Geo Block Snippet
    ***************************************/

    function my_bypass_admins( $queries ) {
    $whitelist = array(
    ‘handle_canon_options_advanced’,
    );
    return $queries + $whitelist;
    }
    add_filter( ‘ip-geo-block-bypass-admins’, ‘my_bypass_admins’ );
    }}

    Thanks

    Ian

    Plugin Author tokkonopapa

    (@tokkonopapa)

    Hi Ian,

    Now I have an interest in the interaction between the wordpress site and instagram πŸ™‚

    Speaking about your snippet, the timing ‘wp_enqueue_scripts‘ is not appropriate to apply filter hook ‘ip-geo-block-bypass-admins‘.

    Please try as follows:
    (Sorry but I made a mistake about handling arrays in the previous post.)

    <?php
    
    /**************************************
    CHILD THEME ENQUEUE STYLES
    ***************************************/
    
    add_action( 'wp_enqueue_scripts', 'child_theme_enqueue_styles' );
    
    if (!function_exists("child_theme_enqueue_styles")) {
        function child_theme_enqueue_styles() {
            wp_enqueue_style( 'canon-parent-style', get_template_directory_uri() . '/style.css', array('canon-normalize') );
        }
    }
    
    /**************************************
    IP Geo Block Snippet
    ***************************************/
    if (class_exists('IP_Geo_Block')) {
    
        function my_bypass_admins( $queries ) {
            $whitelist = array(
                'handle_canon_options_advanced',
            );
            return array_merge( $queries, $whitelist );
        }
        add_filter( 'ip-geo-block-bypass-admins', 'my_bypass_admins' );
    }

    You’ll be success if both servers are in your country.

    Good luck!

    Thread Starter 11whyohwhy15

    (@11whyohwhy15)

    Hi,

    I’m having an error when I try to save function.php in the child theme:

    Parse error: syntax error, unexpected ‘}’ in /home/theweb/public_html/wp-content/themes/belle-child/functions.php on line 28

    <?php

    /**************************************
    CHILD THEME ENQUEUE STYLES
    ***************************************/

    add_action( ‘wp_enqueue_scripts’, ‘child_theme_enqueue_styles’ );

    if (!function_exists(“child_theme_enqueue_styles”)) { function child_theme_enqueue_styles() {
    wp_enqueue_style( ‘canon-parent-style’, get_template_directory_uri() . ‘/style.css’, array(‘canon-normalize’) );

    }
    }

    /**************************************
    IP Geo Block Snippet
    ***************************************/
    if (class_exists(‘IP_Geo_Block’)) {

    function my_bypass_admins( $queries ) {
    $whitelist = array(
    ‘handle_canon_options_advanced’,
    );
    return array_merge( $queries, $whitelist );
    }
    add_filter( ‘ip-geo-block-bypass-admins’, ‘my_bypass_admins’ );
    }

    Thanks

    Ian

    Thread Starter 11whyohwhy15

    (@11whyohwhy15)

    Hey,

    Deleted changed functions.php and uploaded old one as couldn’t access site πŸ™‚

    Ian

    Plugin Author tokkonopapa

    (@tokkonopapa)

    Hi Ian,

    Both the total number of lines of my snippet and yours are 27 (if you start “<?php” at line number 1).

    And I tested exactly the same snippet of mine into my twenty-twelve child theme and found no error (except the style sheet). So it seemed that an extra “}” was in your functions.php at the end of it.

    Could you send it that caused an error to tokkonopapa at yahoo.com ?
    I’ll check it.

    Thread Starter 11whyohwhy15

    (@11whyohwhy15)

    HI,

    I added the snippet again minus the extra “}” so it reads:

    <?php

    /**************************************
    CHILD THEME ENQUEUE STYLES
    ***************************************/

    add_action( ‘wp_enqueue_scripts’, ‘child_theme_enqueue_styles’ );

    if (!function_exists(“child_theme_enqueue_styles”)) { function child_theme_enqueue_styles() {
    wp_enqueue_style( ‘canon-parent-style’, get_template_directory_uri() . ‘/style.css’, array(‘canon-normalize’) );
    }
    }

    /**************************************
    IP Geo Block Snippet
    ***************************************/
    if (class_exists(‘IP_Geo_Block’)) {

    function my_bypass_admins( $queries ) {
    $whitelist = array(
    ‘handle_canon_options_advanced’,
    );
    return array_merge( $queries, $whitelist );
    }
    add_filter( ‘ip-geo-block-bypass-admins’, ‘my_bypass_admins’ );
    }

    Exactly 26 lines and it works perfectly!

    Brilliant!

    Thank you so much !

    Ian

    Thread Starter 11whyohwhy15

    (@11whyohwhy15)

    Hi again,

    Just a quick question, I also have installed in my plugins Akismet, loginizer and Better WordPress reCAPTCHA, is that OK or a little bit ‘overkill’ do you feel ?

    Thanks again πŸ˜‰

    Ian

    Plugin Author tokkonopapa

    (@tokkonopapa)

    Hi Ian,

    Exactly 26 lines and it works perfectly!

    Brilliant!

    I’m happy to hear that!

    I activate Akismet and it’s OK. And I think you had better to set “XML-RPC” and “Login form” disable in IP Geo Block when you activate Loginizer and reCAPTCHA for the performace reason.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Instagram Authorization’ is closed to new replies.