applications – How to use an old version of an app that wants to get updated

I was using an old version of the eBay app and everything worked fine but now as soon as I open the app, it shows a pop-up telling me to update the app which will not let me use it. Changing the system time will remove the pop-up but the app doesn’t have internet connection then. Is there any possibility to remove the pop-up and use the old version again?## Heading ##

c# – Why is my bool value, set within a ScriptableObject, not being updated in another script?

I have a problem with my bool value that I dont understand. I have an Actions script, which derives from MonoBehavior. In that script I have a bool variable “IsCompleted”, which shall indicate whether an Attack is finished or not. In Awake there I set this bool to true, to indicate that no attack is running. In another Script – ScriptableAttack – which derives from ScriptableObject, I have a function that is the main part of an attack. There I edit this value and set it to false. Then, if conditions are good, I want to run a timer after that the bool is set to false again. Now, since I can’t use the typical Update method on a ScriptableObject, I want to check if this value is false in a third script I have – CharacterSettings – which derives from MonoBehavior. The problem now is that when I check that value on Update in the CharacterSettings script, it always returns true, while I see that it is indeed false within ScriptableAttack. I also checked if I overwrite this value somewhere but couldn’t find anyhing. The usages I wrote down here are the only ones I have in my application. Maybe somebody can help or at least explain this behavior to me.

At this point I don’t post code since I don’t know if that’s relevant and if, what part is relevant. If anybody has an idea what part of my code might cause this, I’ll add some code to this post.

plugins – save metabox value in another post when current post published or updated

I create 2 custom posts (CPT) – series and episodes, and add metabox using CMB2 cmb2-attached-posts. In series, the metabox name is episodes_id and in episodes, series_id.

In series, I can add and display episodes without problem.

The problem is, I want to update Series episodes_id with current edited Episodes when published/updated button submitted.

This is my code in functions.php:

//Save series episodes_id field when current episode published or updated
add_action( 'save_post', 'save_episode_to_series', 10, 2 );

function save_episode_to_series( $post_id ) {

   if ( get_post_type($post_id) == 'episodes' ) {

        // If this is just a revision, don't send the email.
        if ( wp_is_post_revision( $post_id ) )
        return;

        $series_id = get_post_meta($post_id, 'series_id', true);

        $episode_id = $post_id; //just to make it obvius

        update_post_meta($series_id, 'episodes_id', $episode_id);

    }

}

Help me to make it wok, thanks.

woocommerce offtopic – woocommerce_order_after_calculate_totals isn’t getting updated shipping costs

We have a special case where we invoice our customers for payment after the order has been received instead of having them pay during checkout. Shipping charges are manually calculated and added to the order and then we add a 3% credit card fee on the grand total.

To automate this process, I created a script that calculates the 3% charge once the shipping charge has been set through the backend and adds this fee item into the order automatically. This works when we add the shipping charge and click save/recalculate the first time.

add_action( 'woocommerce_order_after_calculate_totals', "custom_order_after_calculate_totals", 10, 2);
function custom_order_after_calculate_totals($and_taxes, $order) {

    if ( did_action( 'woocommerce_order_after_calculate_totals' ) >= 2 )
    return;

    if ( is_admin() && ! defined( 'DOING_AJAX' ) )
        return;

    $percentage = 0.03;
    $total = $order->get_total();
    $surcharge = $total * $percentage;
    $feeArray = array(
        'name' => '3% CC Fee',
        'amount' =>  wc_format_decimal($surcharge),
        'taxable' => false,
        'tax_class' => ''
    );

    //Get fees
    $fees = $order->get_fees();
    if(empty($fees)){
        //Add fee
        $fee_object = (object) wp_parse_args( $feeArray );
        $order->add_fee($fee_object);
    } else {
        //Update fee
        foreach($fees as $item_id => $item_fee){
            if($item_fee->get_name() == "3% CC Fee"){
                $order->update_fee($item_id,$feeArray);
            }
        }
    }
}

If we decide to update the shipping cost, this code does get triggered again and attempts to update the fee however $total does not get the new order total from the updated shipping cost and so the fee does not change. Strangely enough, if I try to delete the fee item, a new fee is calculated and is added back with the correct fee amount.

Anybody know how I can solve this?

admin – WordPress has been updated! Before we send you on your way, we have to update your database to the newest version

whenever I attempt to access our production admin panel I get the message below.

“Database Update Required
WordPress has been updated! Before we send you on your way, we have to update your database to the newest version.
The database update process may take a little while, so please be patient.
Update WordPress Database”

I have not seen this before, does anyone know why this appeared? Our site was down previously and my concern is, if this update will bring the site down again. I want to make sure that this update will not bring our site down again and have seen post of other people facing the same issue.

php – Cron events are disappearing, or cannot be updated in WordPress

I have Advanced Custom Field “expired_date” of DATE type. I want to change the post category after the date is passed. I’m using this code:

function set_expiry_date( $post_id ) {

  // See if an expired_date has been entered and if not then end the function
  if( get_post_meta( $post_id, $key = 'expire_date', $single = true ) ) {

    // Get the end date of the event in unix grenwich mean time
    $acf_end_date = get_post_meta( $post_id, $key = 'expire_date', $single = true );

  } else {

    // If expired_date not set. Lets delete any CRON jobs related to this post and end the function.
    wp_clear_scheduled_hook( 'closed', array( $post_id ) );
    return;

  }

  // Convert our date to the correct format
  $unix_acf_end_date = strtotime( $acf_end_date );
  $gmt_end_date = gmdate( 'Ymd', $unix_acf_end_date );
  $unix_gmt_end_date = strtotime( $gmt_end_date );

  // Get the number of seconds in a day
  $delay = 24 * 60 * 60; //24 hours * 60 minutes * 60 seconds

  // Add 1 day to the end date to get the day after the event
  $day_after_event = $unix_gmt_end_date + $delay;

  // If a CRON job exists with this post_id them remove it
  wp_clear_scheduled_hook( 'closed', array( $post_id ) );
  // Add the new CRON job to run the day after the event with the post_id as an argument
  wp_schedule_single_event( $day_after_event , 'closed', array( $post_id ) );

}

// Hook into the save_post_{post-type} function to create/update the cron job everytime an event is saved.
add_action( 'acf/save_post', 'set_expiry_date', 20 );

// Create a function that adds the post to the Closed category
function set_past_event_category( $post_id ){

  // Set the post category to 'Past Event'
    wp_set_post_categories( $post_id, array( 5 ), true );
    wp_remove_object_terms( $post_id, 'active', 'category' );

}

// Hook into the closed CRON job so that the set_past_event_category function runs when the CRON job is fired.
add_action( 'closed', 'set_past_event_category' );

Everything was working perfectly until the past couple of days. I’m assuming it is related to the WordPress upgrade. I’m testing cron events with WP Crontrol plugin. When the post is updated, sometimes the cron event disappears. Sometimes it cannot be updated. It is very weird.

Does anybody see what is wrong?

Thanks.

mysql – Binlog is not being updated in Master

I am using mysql 5.6.19-log MySQL Community Server (GPL). I have done the necessary changes in my.cnf to start Master<->Slave Replication. But binary files are created and but they are empty.

log-bin                        = /data/mysqllog/mysql_logs/binary_logs/mysql-bin
expire-logs-days               = 7
sync-binlog                    = 1
binlog_format                  = ROW
binlog_row_image               = full
binlog_checksum                = CRC32
# REPLICATION #
read_only                      = 0
skip-slave-start               = 1
relay-log                      = /data/mysqllog/mysql_logs/mysql_relay_logs/relay-bin
slave-net-timeout              = 60
relay_log_recovery             = ON
master_info_repository         = TABLE
relay_log_info_repository      = TABLE
master_verify_checksum         = ON
#log_slave_updates             = ON

Any help will be appreciated. Please comment if I need to add some more details. Thank you

What is the proper way to prevent an Ansible playbook from updating a config file after it has been updated

I’m working on a playbook to manage a webserver I host multiple domains on. I have one config that sets up my nginx server and then another that manages my certificates. As of now the work flow is as follows:

  1. Copy template for virtual host to server, NGINX is restarted
  2. Certificates are generated
  3. Remote NGINX config files are updated (using lineinfile), NGINX is restarted

This works great unless I run the playbook because my template file would overwrite the remote file. I’d still like to be able to run the same playbook to run down the road if I need to make any updates to my host configs but I’m at a loss how to handle this.

Since I updated to 20.10, when I start rhythmbox it loads musics for quite some time and takes 50% of my CPU and after a few minutes it works normally

I took a video to show it I have no idea where this commes from, it worked fine on ubuntu 20.04, 19.10 and 19.04.

mod security – Can modsecurity 2.x read data from a text file that has been updated?

I’m writing a rule for modsecurity 2.x to match an IP address to those in a file.

 SecRule REMOTE_ADDR "@ipMatchFromFile /etc/modsecurity/address_list.txt"

I understand how this works, I’m just wondering if anyone knows when modsecurity loads that .txt file.
Is it only loaded when the rules first load or can it be dynamically updated?

For instance, if you have a running instance of modsecurity on apache and you modify the address_list.txt file, will the rules pick that up or will you have to reload the apache config?