Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter Jeff C

    (@12steprecovery)

    Thanks for the reply.

    Unfortunately other plugins write to the w2 folder .htaccess file – see https://gist.github.com/12steprecovery/57aa912d2d126f5d9779ab87c44b46ec

    And the root folder .htaccess is as follows https://gist.github.com/12steprecovery/1d0d96d70931a452a5db9f8ae08cbf17

    What would you suggest here?

    Thread Starter Jeff C

    (@12steprecovery)

    Sorry I missed your reply.

    Yes WordPress is deployed in /w2/ folder.

    I’m not sure which method was deployed to create the website in w2, however:

    .htaccess in the root folder contains

    # BEGIN WP Hide & Security Enhancer
     
    <IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase / 
    RewriteRule .* - [E=WPH_REWRITE_1:73cdaf1e]
    
    RewriteCond %{ENV:REDIRECT_STATUS} 200
    RewriteRule ^ - [L]
    
    RewriteRule ^login.php(.*) /w2/wp-login.php$1 [END,QSA]
    </IfModule> 
    
    # END WP Hide & Security Enhancer

    and in the w2 folder contains

    #<IfModule mod_rewrite.c>
    #RewriteEngine on
    #RewriteCond %{HTTP_HOST} ^(www.)?example.com$
    #RewriteCond %{REQUEST_URI} !^/w2/
    #RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteRule ^(.*)$ /w2/$1
    #RewriteCond %{HTTP_HOST} ^(www.)?example.com$
    #RewriteRule ^(/)?$ w2/index.php [L] 
    #</IfModule>
    Jeff C

    (@12steprecovery)

    Thanks very much for providing a security update for the plugin. Let’s hope that Ashley Rich will accept your pull requests. Or let you take on maintaining the plugin.

    I’d like to submit an Issue on your GitHub page but it’s not available.

    If I enable the Folder Protection in the Advanced Settings (and this was happening before installing your update – but only started fairly recently) the files in the folder are inaccessible to anyone and produce a 403 error when trying to download them – they are also listed as inaccessible when editing the Download itself. The problem is solved if I disable the Folder Protection.

    Jeff C

    (@12steprecovery)

    I get the following error when I go to “You are just one step away – Complete “Woocommerce Payment Gateway Per Product” Activation Now”

    Uncaught Error: Call to a member function get_base_country() on null in /home/slaauk10/public_html/w2/wp-content/plugins/woocommerce-gateway-paypal-express-checkout/includes/class-wc-gateway-ppec-ips-handler.php on line 102
    is_supported()
    wp-content/plugins/woocommerce-gateway-paypal-express-checkout/includes/settings/settings-ppec.php:12
    include()
    wp-content/plugins/woocommerce-gateway-paypal-express-checkout/includes/abstracts/abstract-wc-gateway-ppec.php:105
    init_form_fields()
    wp-content/plugins/woocommerce-gateway-paypal-express-checkout/includes/abstracts/abstract-wc-gateway-ppec.php:27
    __construct()
    wp-content/plugins/woocommerce-gateway-paypal-express-checkout/includes/class-wc-gateway-ppec-with-paypal.php:12
    __construct()
    wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php:94
    init()
    wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php:70
    __construct()
    wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php:43
    instance()
    wp-content/plugins/woocommerce/includes/class-woocommerce.php:818
    payment_gateways()
    wp-content/plugins/woocommerce/includes/class-woocommerce.php:146
    __get()
    wp-content/plugins/woocommerce-product-payments/woocommerce-payment-gateway-per-product.php:259
    wpgpp_redux()
    wp-includes/class-wp-hook.php:286
    apply_filters()
    wp-includes/class-wp-hook.php:310
    do_action()
    wp-includes/plugin.php:465
    do_action()
    wp-settings.php:394
    require_once()
    wp-config.php:94
    require_once()
    wp-load.php:37
    require_once()
    wp-admin/admin.php:34
    The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.

    Using 3.0.3

    Thread Starter Jeff C

    (@12steprecovery)

    Sure

    Thread Starter Jeff C

    (@12steprecovery)

    Thanks for getting back – see https://www.slaauk.org/useful-resources/

    Checking the css I can see that the li element in the theme contains padding-left of 20px so when I reduce the width in

    @media screen and (min-width: 761px) {
    .twocol ul.ccchildpages_list li {
        width: 45%;
        float: left;
    }
    }

    it solves the problem if I add the above code into the custom css

    Thread Starter Jeff C

    (@12steprecovery)

    That’s great. Thanks! ??

    Jeff C

    (@12steprecovery)

    Hi @benjober

    I investigated how the Sydney theme https://en-gb.www.ads-software.com/themes/sydney/ got its parallax effect (see https://demo.athemes.com/sydney/) to see if it could be added to another theme using Elementor.

    I discovered that Sydney is using jQuery-Parallax https://github.com/IanLunn/jQuery-Parallax.

    So I borrowed some code from Sydney and added it to the functions.php of my child theme as follows:

    function jquery_parallax() {
    
       ?>
        <script language="JavaScript" type="text/javascript">
    		
    
    ;(function($) {
    
       'use strict'
    
        var testMobile;
        var isMobile = {
            Android: function() {
                return navigator.userAgent.match(/Android/i);
            },
            BlackBerry: function() {
                return navigator.userAgent.match(/BlackBerry/i);
            },
            iOS: function() {
                return navigator.userAgent.match(/iPhone|iPad|iPod/i);
            },
            Opera: function() {
                return navigator.userAgent.match(/Opera Mini/i);
            },
            Windows: function() {
                return navigator.userAgent.match(/IEMobile/i);
            },
            any: function() {
                return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
            }
        };
    
    	var parallax = function() {
    		testMobile = isMobile.any();
    		if (testMobile == null) {
    			$(".parallax").parallax("50%", 0.3);
    		}
    	};
    
    	// Dom Ready
    	$(function() {
    		parallax();
       	});
    })(jQuery);
    
    /*
    jQuery Parallax 1.1.3
    Author: Ian Lunn
    Plugin URL: https://www.ianlunn.co.uk/plugins/jquery-parallax/
    
    Dual licensed under the MIT and GPL licenses:
    https://www.opensource.org/licenses/mit-license.php
    https://www.gnu.org/licenses/gpl.html
    */
    !function(n){var t=n(window),e=t.height();t.resize(function(){e=t.height()}),n.fn.parallax=function(o,r,i){function u(){var i=t.scrollTop();l.each(function(t,u){var l=n(u),f=l.offset().top,s=a(l);i>f+s||f>i+e||l.css("backgroundPosition",o+" "+Math.round((l.data("firstTop")-i)*r)+"px")})}var a,l=n(this);l.each(function(t,e){$element=n(e),$element.data("firstTop",$element.offset().top)}),a=i?function(n){return n.outerHeight(!0)}:function(n){return n.height()},(arguments.length<1||null===o)&&(o="50%"),(arguments.length<2||null===r)&&(r=.1),(arguments.length<3||null===i)&&(i=!0),t.bind("scroll",u).resize(u),u()}}(jQuery);
    
        </script>
        <?php
      
    }
    
    if (!(is_admin())) {
    wp_enqueue_script('jquery');
    add_action('wp_head', 'jquery_parallax');
    }

    By adding the css selector ‘parallax’ in the Advanced tab after following @boaz instructions

    Just create a section, under Style set a background image for it and under Attachment choose Fixed.

    you’ll have the parallax effect you are looking for.

    Thread Starter Jeff C

    (@12steprecovery)

    Well that’s very strange. I deactivated all the plugins (apart from Elementor) and so it appeared to be the child theme of TwentyTwelve I was using. So I renamed the functions.php file (to deactivate it) even though there didn’t appear to be anything in it that could be conflicting. Then Elementor started working again. But when I duplicated the functionsX.php to functions.php Elementor continued to work.

    A mystery, but hey it’s working now!

    • This reply was modified 8 years, 1 month ago by Jeff C.
    Thread Starter Jeff C

    (@12steprecovery)

    In the console in Chrome on Mac when I’m on the Elementor page that isn’t loading:

    https://fonts.googleapis.com/css Failed to load resource: the server responded with a status of 400 ()
    jquery-migrate.min.js:2 JQMIGRATE: Migrate is installed, version 1.4.1
    ?elementor:4642 Uncaught TypeError: $(...).footableFilter(...).footable is not a function
    https://fonts.googleapis.com/css Failed to load resource: the server responded with a status of 400 (Bad Request)
    https://fonts.googleapis.com/css Failed to load resource: the server responded with a status of 400 ()
    jquery-migrate.min.js:2 JQMIGRATE: Migrate is installed, version 1.4.1
    https://fonts.googleapis.com/css Failed to load resource: the server responded with a status of 400 (Bad Request)
    https://fonts.googleapis.com/css Failed to load resource: the server responded with a status of 400 ()
    Thread Starter Jeff C

    (@12steprecovery)

    Any news on this?

    Thread Starter Jeff C

    (@12steprecovery)

    Thanks for getting back.

    This is under Events > Recurring Events ??

    • This reply was modified 8 years, 1 month ago by Jeff C.
    Thread Starter Jeff C

    (@12steprecovery)

    Finally I gave up on EM_Events::delete() and used a foreach loop and moved the posts to trash rather than deleting them (a bit safer in case I made a mistake somewhere). I also made the schedule hourly as it’s deleting events over 2 days old – and there are a lot stored up in our database – and I’m assuming it’s timing out.

    function set_up_scheduled_event() {
        if ( !wp_next_scheduled( 'Delete_Past_Events' ) ) {
            wp_schedule_event( time(), 'hourly', 'Delete_Past_Events');
        }
    }
    add_action('wp', 'set_up_scheduled_event');
    
    add_action('Delete_Past_Events', 'actually_delete_past_events');
    
    function actually_delete_past_events() {
    global $EM_Event;
    $past_events = EM_Events::get(array('scope'=>'before-yesterday'));
    //file_put_contents(get_stylesheet_directory().'/print_array.txt', print_r($past_events, true)); // a way of checking the events that are going to be deleted
    foreach ($past_events as $event) {
    if ($event->recurrence_id) wp_trash_post($event->post_id); // only delete if it's been produced by a recurrent event
    }
    }
    Thread Starter Jeff C

    (@12steprecovery)

    Thanks for the input. It’s taken me a while to get to do further work on this.

    There were some errors in the code above and so the code I’ve just tried is as follows:

    function set_up_scheduled_event() {
        if ( !wp_next_scheduled( 'Delete_Past_Events' ) ) {
            wp_schedule_event( time(), 'daily', 'Delete_Past_Events');
        }
    }
    add_action('wp', 'set_up_scheduled_event');
    
    add_action('Delete_Past_Events', 'actually_delete_past_events');
    
    function actually_delete_past_events() {
    global $EM_Event;
    $past_events = EM_Events::get(array('scope'=>'before-yesterday'));
    file_put_contents(get_stylesheet_directory().'/print_array.txt', print_r($past_events, true));
    EM_Events::delete($past_events);
    }

    with the scope provided by the following code:

    add_filter( 'em_events_build_sql_conditions', 'my_em_scope_conditions',1,2);
    function my_em_scope_conditions($conditions, $args){
        if( !empty($args['scope']) && $args['scope']=='this-week' ){
    		$start_date = date('Y-m-d', strtotime('Today', time()));
    		$end_date = date('Y-m-d', strtotime('Today +6 day', time()));
            $conditions['scope'] = " (event_start_date BETWEEN CAST('$start_date' AS DATE) AND CAST('$end_date' AS DATE)) OR (event_end_date BETWEEN CAST('$end_date' AS DATE) AND CAST('$start_date' AS DATE))";
        }
        if( !empty($args['scope']) && $args['scope']=='next-week' ){
            $start_date = date('Y-m-d',strtotime("Today +7 day", time()));
            $end_date = date('Y-m-d',strtotime("Today +13 day", time()));
            $conditions['scope'] = " (event_start_date BETWEEN CAST('$start_date' AS DATE) AND CAST('$end_date' AS DATE)) OR (event_end_date BETWEEN CAST('$end_date' AS DATE) AND CAST('$start_date' AS DATE))";
        }
        if( !empty($args['scope']) && $args['scope']=='before-yesterday' ){
            $start_date = date('Y-m-d',strtotime("5 years ago", time()));
            $end_date = date('Y-m-d',strtotime("2 days ago", time()));
            $conditions['scope'] = " (event_start_date BETWEEN CAST('$start_date' AS DATE) AND CAST('$end_date' AS DATE)) OR (event_end_date BETWEEN CAST('$end_date' AS DATE) AND CAST('$start_date' AS DATE))";
        }
        return $conditions;
    }
    
    add_filter( 'em_get_scopes','my_em_scopes',1,1);
    function my_em_scopes($scopes){
        $my_scopes = array(
            'this-week' => 'This Week',
            'next-week' => 'Next Week',
            'before-yesterday' => 'Before Yesterday'
        );
        array_splice($scopes, 5, 0, $my_scopes);
        return $scopes;
    }

    However it didn’t delete any events when I tested it – the array is correctly created and printed to a file, so I can see what should be deleted, but EM_Events::delete($past_events) doesn’t seem to work.

    Any ideas?

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