Passed
Push — 189-fix/delete-posts-by-post-s... ( 468a0e...78e3f0 )
by Sudar
53:13 queued 41:17
created

UpsellModule::get_success_message()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace BulkWP\BulkDelete\Core\Addon;
4
5
use BulkWP\BulkDelete\Core\Base\BaseModule;
6
7
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
8
9
/**
10
 * A Module that upsells an add-on.
11
 *
12
 * Upseller Module is displayed for add-ons with a description and a link to buy them.
13
 * If an add-on is installed, then the Upseller Module is automatically deactivated.
14
 *
15
 * Methods that are not needed are left empty.
16
 *
17
 * @since 6.0.0
18
 */
19
class UpsellModule extends BaseModule {
20
	/**
21
	 * Details about the add-on.
22
	 *
23
	 * @var \BulkWP\BulkDelete\Core\Addon\AddonInfo
24
	 */
25
	protected $addon_info;
26
27
	/**
28
	 * Create the UpsellModule using add-on info.
29
	 *
30
	 * @param \BulkWP\BulkDelete\Core\Addon\AddonInfo $addon_info Addon Info.
31
	 */
32
	public function __construct( $addon_info ) {
33
		$this->addon_info = $addon_info;
34
35
		$this->meta_box_slug = $this->addon_info->get_slug();
36
		$this->messages      = array(
37
			'box_label' => $addon_info->get_upsell_title(),
38
		);
39
	}
40
41
	public function render() {
42
		?>
43
44
		<p>
45
			<?php echo $this->addon_info->get_upsell_message(); ?>
46
			<a href="<?php echo esc_url( $this->addon_info->get_buy_url() ); ?>"><?php _e( 'Buy Now', 'bulk-delete' ); ?></a>
47
		</p>
48
49
		<?php
50
	}
51
52
	protected function initialize() {
53
		// Empty by design.
54
	}
55
56
	protected function parse_common_filters( $request ) {
57
		// Empty by design.
58
	}
59
60
	protected function convert_user_input_to_options( $request, $options ) {
61
		// Empty by design.
62
	}
63
64
	protected function get_success_message( $items_deleted ) {
65
		// Empty by design.
66
	}
67
68
	protected function do_delete( $options ) {
69
		// Empty by design.
70
	}
71
}
72