is__premium_only() && ! ausm_fs()->can_use_premium_code() ) { // Unlock morefeature section coupon code $discount_coupon = 'BONUS20'; // Dotstore Marketing Free Plugins $dsmrkt_free_plugins = get_transient( '_dotstore_marketing_free_plugins' ); require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); if ( ! $dsmrkt_free_plugins ) { $info = plugins_api('query_plugins', array( 'per_page' => 30, 'author' => 'dots', 'fields' => array( 'short_description' => true, 'description' => false, 'sections' => false, 'tested' => false, 'requires' => true, 'ratings' => false, 'downloaded' => false, 'downloadlink' => true, 'last_updated' => false, 'added' => false, 'tags' => false, 'compatibility' => false, 'homepage' => false, 'versions' => false, 'donate_link' => false, 'reviews' => false, 'banners' => false, 'active_installs' => true, 'group' => false, 'contributors' => false, 'author' => false, 'requires_plugins' => false, ) ) ); if ( is_wp_error( $info ) ) { $dsmrkt_free_plugins = array(); } else { $dsmrkt_free_plugins = $info->plugins; } set_transient( '_dotstore_marketing_free_plugins', $dsmrkt_free_plugins, 7 * DAY_IN_SECONDS ); } // Create a slug → plugin data map $lookup = []; foreach ( $dsmrkt_free_plugins as $free_plugin ) { $lookup[$free_plugin['slug']] = $free_plugin; } // Rebuild the array in the custom order $dsmrkt_sorted_plugins = $dsmrkt_free_plugins; if( !empty( AUSM_OTHER_PLUGIN_IDS ) ) { $dsmrkt_sorted_plugins = []; foreach ( AUSM_OTHER_PLUGIN_IDS as $slug ) { if ( isset( $lookup[$slug] ) ) { $dsmrkt_sorted_plugins[] = $lookup[$slug]; } } } } ?>

' . esc_html__('YouTube channel', 'advanced-usps-shipping-method') . '', ); ?>

is__premium_only() && ! ausm_fs()->can_use_premium_code() ) { ?>

<?php esc_attr_e( 'Premium title icon', 'advanced-usps-shipping-method' ); ?>

', '', '' ); ?>
<?php esc_attr_e( 'Personal Plan', 'advanced-usps-shipping-method' ); ?>

array( 'href' => array(), 'title' => array(), 'target' => array(), ), 'abbr' => array( 'title' => array() ), 'acronym' => array( 'title' => array() ), 'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(), 'ul' => array(), 'ol' => array(), 'li' => array(), 'p' => array(), 'br' => array(), ); $plugin_title = wp_kses( $dsmrkt_free_plugin['name'], $plugins_allowedtags ); $version = wp_kses( $dsmrkt_free_plugin['version'], $plugins_allowedtags ); $name = wp_strip_all_tags( $plugin_title . ' ' . $version ); $requires_php = isset( $dsmrkt_free_plugin['requires_php'] ) ? $dsmrkt_free_plugin['requires_php'] : null; $requires_wp = isset( $dsmrkt_free_plugin['requires'] ) ? $dsmrkt_free_plugin['requires'] : null; $compatible_php = is_php_version_compatible( $requires_php ); $compatible_wp = is_wp_version_compatible( $requires_wp ); /** Action Button Start ( get whole 'wp_get_plugin_action_button' method here from WP core )*/ $action_button = ''; $data = (object) $dsmrkt_free_plugin; $plugin_status = install_plugin_install_status( $data ); $requires_plugins = $data->requires_plugins ?? array(); // Determine the status of plugin dependencies. $installed_plugins = get_plugins(); $active_plugins = get_option( 'active_plugins', array() ); $plugin_dependencies_count = count( $requires_plugins ); $installed_plugin_dependencies_count = 0; $active_plugin_dependencies_count = 0; foreach ( $requires_plugins as $dependency ) { foreach ( array_keys( $installed_plugins ) as $installed_plugin_file ) { if ( str_contains( $installed_plugin_file, '/' ) && explode( '/', $installed_plugin_file )[0] === $dependency ) { ++$installed_plugin_dependencies_count; } } foreach ( $active_plugins as $active_plugin_file ) { if ( str_contains( $active_plugin_file, '/' ) && explode( '/', $active_plugin_file )[0] === $dependency ) { ++$active_plugin_dependencies_count; } } } $all_plugin_dependencies_installed = $installed_plugin_dependencies_count === $plugin_dependencies_count; $all_plugin_dependencies_active = $active_plugin_dependencies_count === $plugin_dependencies_count; if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) { switch ( $plugin_status['status'] ) { case 'install': if ( $plugin_status['url'] ) { if ( $compatible_php && $compatible_wp && $all_plugin_dependencies_installed && ! empty( $data->download_link ) ) { $action_button = sprintf( '%s', esc_attr( $data->slug ), esc_url( $plugin_status['url'] ), /* translators: %s: Plugin name and version. */ esc_attr( sprintf( _x( 'Install %s now', 'plugin', 'advanced-usps-shipping-method' ), $name ) ), esc_attr( $name ), _x( 'Install Free Plugin', 'plugin', 'advanced-usps-shipping-method' ) ); } else { $action_button = sprintf( '', _x( 'Install Free Plugin', 'plugin', 'advanced-usps-shipping-method' ) ); } } break; case 'update_available': if ( $plugin_status['url'] ) { if ( $compatible_php && $compatible_wp ) { $action_button = sprintf( '%s', esc_attr( $plugin_status['file'] ), esc_attr( $data->slug ), esc_url( $plugin_status['url'] ), /* translators: %s: Plugin name and version. */ esc_attr( sprintf( _x( 'Update %s now', 'plugin', 'advanced-usps-shipping-method' ), $name ) ), esc_attr( $name ), _x( 'Update Free Plugin', 'plugin', 'advanced-usps-shipping-method' ) ); } else { $action_button = sprintf( '', _x( 'Update Free Plugin', 'plugin', 'advanced-usps-shipping-method' ) ); } } break; case 'latest_installed': case 'newer_installed': if ( is_plugin_active( $plugin_status['file'] ) ) { $action_button = sprintf( '', _x( 'Active', 'plugin', 'advanced-usps-shipping-method' ) ); } elseif ( current_user_can( 'activate_plugin', $plugin_status['file'] ) ) { if ( $compatible_php && $compatible_wp && $all_plugin_dependencies_active ) { $button_text = _x( 'Activate', 'plugin', 'advanced-usps-shipping-method' ); /* translators: %s: Plugin name. */ $button_label = _x( 'Activate %s', 'plugin', 'advanced-usps-shipping-method' ); $activate_url = add_query_arg( array( '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $plugin_status['file'] ), 'action' => 'activate', 'plugin' => $plugin_status['file'], ), network_admin_url( 'plugins.php' ) ); if ( is_network_admin() ) { $button_text = _x( 'Network Activate', 'plugin', 'advanced-usps-shipping-method' ); /* translators: %s: Plugin name. */ $button_label = _x( 'Network Activate %s', 'plugin', 'advanced-usps-shipping-method' ); $activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url ); } $action_button = sprintf( '%6$s', esc_url( $activate_url ), esc_attr( $name ), esc_attr( $data->slug ), esc_attr( $plugin_status['file'] ), esc_attr( sprintf( $button_label, $name ) ), $button_text ); } else { $action_button = sprintf( '', is_network_admin() ? _x( 'Network Activate', 'plugin', 'advanced-usps-shipping-method' ) : _x( 'Activate', 'plugin', 'advanced-usps-shipping-method' ) ); } } else { $action_button = sprintf( '', _x( 'Installed', 'plugin', 'advanced-usps-shipping-method' ) ); } break; } } /** Action Button End */ // This will only works for WordPress Org plugins not for Freemius plugins if( is_plugin_active($plugin_status['file']) ) { $actions = apply_filters( "plugin_action_links_{$plugin_status['file']}", array(), '', array(), '' ); if( !empty( $actions ) && isset( $actions['configure'] ) && !empty( $actions['configure'] ) ) { $dom = new DOMDocument(); libxml_use_internal_errors(true); // Suppress warnings for malformed HTML $dom->loadHTML($actions['configure']); $manage_link = $dom->getElementsByTagName('a')->item(0); $manage_url = $manage_link->getAttribute('href'); /* translators: %1$s: configure link, %2$s: button label with plugin name, %3$s: Button lable */ $action_button = sprintf( '%3$s', esc_url( $manage_url ), /* translators: %s: Plugin name. */ esc_attr( sprintf( esc_html__( 'Manage %s', 'advanced-usps-shipping-method' ), $name ) ), esc_html__( 'Manage', 'advanced-usps-shipping-method' ) ); } } ?>
<?php echo esc_attr( $dsmrkt_free_plugin['name'] ); ?>