Server IP : 162.0.217.223 / Your IP : 216.73.216.150 Web Server : LiteSpeed System : Linux premium269.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : mypckeys ( 1539) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mypckeys/www/wp-content/plugins/wc-serial-numbers/includes/updates/ |
Upload File : |
<?php function wcsn_update_1_0_1() { WCSN_Install::activate(); $serial_numbers = get_posts( array( 'post_type' => 'wsn_serial_number', 'nopaging' => true, ) ); foreach ( $serial_numbers as $post ) { $validity = get_post_meta( $post->ID, 'validity', true ); $order = get_post_meta( $post->ID, 'order', true ); $data = array( 'serial_key' => $post->post_title, 'license_image' => ! empty( $_POST['license_image'] ) ? sanitize_text_field( $_POST['license_image'] ) : '', 'product_id' => get_post_meta( $post->ID, 'product', true ), 'activation_limit' => get_post_meta( $post->ID, 'max_instance', true ), 'validity' => is_numeric( $validity ) ? $validity : 0, 'expire_date' => is_string( $validity ) && ( strtotime( $validity ) > strtotime( '2019-01-01' ) ) ? date( 'Y-m-d', strtotime( $validity ) ) : 0, 'status' => empty( intval( $order ) ) ? 'new' : 'active', 'order_id' => intval( $order ), ); wcsn()->serial_number->insert( $data ); } } wcsn_update_1_0_1();