logoUrl = thrive_ab()->url( 'assets/images/tab-logo.png' ); $this->logoUrlWhite = thrive_ab()->url( 'assets/images/tab-logo-white.png' ); $this->productIds = array(); $this->description = __( 'Boost Conversion Rates by testing two or more variations of a page.', 'thrive-ab-page-testing' ); $this->button = array( 'active' => true, 'url' => admin_url( 'admin.php?page=tab_admin_dashboard' ), 'label' => __( 'Thrive Optimize', 'thrive-ab-page-testing' ), ); $this->moreLinks = array( 'tutorials' => array( 'class' => '', 'icon_class' => 'tvd-icon-graduation-cap', 'href' => 'https://thrivethemes.com/thrive-optimize-tutorials/', 'target' => '_blank', 'text' => __( 'Tutorials', 'thrive-ab-page-testing' ), ), 'support' => array( 'class' => '', 'icon_class' => 'tvd-icon-life-bouy', 'href' => 'https://thrivethemes.com/support/', 'target' => '_blank', 'text' => __( 'Support', 'thrive-ab-page-testing' ), ), ); } /** * In optimize we need to override the dash product functions just in case the dash is not loaded yet */ /** * Check if the current has access to the product * * @return bool */ public static function has_access() { return current_user_can( 'tve-use-tab' ); } public static function cap() { return 'tve-use-tab'; } /** * Reset plugin to default data */ public static function reset_plugin() { $query = new WP_Query( array( 'post_type' => array( Thrive_AB_Post_Types::VARIATION, ), 'fields' => 'ids', 'posts_per_page' => '-1', ) ); $post_ids = $query->posts; foreach ( $post_ids as $id ) { wp_delete_post( $id, true ); } global $wpdb; $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE `meta_key` LIKE '%thrive_ab%';" ); $tables = array( 'event_log', 'tests', 'test_items', ); foreach ( $tables as $table ) { $table_name = thrive_ab()->table_name( $table ); $sql = "TRUNCATE TABLE $table_name"; $wpdb->query( $sql ); } $wpdb->query( "DELETE FROM $wpdb->options WHERE `option_name` LIKE '%thrive_ab%' OR '%is_control%';" ); } }