| @@ -21,12 +21,44 @@ | ||
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * UtilityPackages class constructor. |
| 24 | 24 | * |
| 25 | + * Wires up the same Wpmet shared widgets GutenKit uses | |
| 26 | + * (see gutenkit-blocks-addon/includes/Libs/UtilityPackages.php): | |
| 27 | + * cross-promotion menu, dismissible Notice AJAX handler, the | |
| 28 | + * Stories dashboard widget, the Banner ("jhanda") admin notice, | |
| 29 | + * and the "ask for rating" prompt. | |
| 30 | + * | |
| 25 | 31 | * @return void |
| 26 | 32 | */ |
| 27 | 33 | public function __construct() { |
| 28 | 34 | add_action( 'init', array( $this, 'register_cross_promotion_menu' ) ); |
| 35 | + | |
| 36 | + // Powers the dismiss button on Banner/Notice widgets below. | |
| 37 | + UtilityPackage\Notice\Notice::init(); | |
| 38 | + | |
| 39 | + // Show Wpmet stories widget in the Dashboard. | |
| 40 | + UtilityPackage\Stories\Stories::instance( 'table-builder-block' ) | |
| 41 | + ->set_plugin( 'TableKit', 'https://wpmet.com/plugin/table-builder-block/' ) | |
| 42 | + ->set_api_url( 'https://api.wpmet.com/public/stories/' ) | |
| 43 | + ->call(); | |
| 44 | + | |
| 45 | + // Show Wpmet banner (codename: jhanda) on TableKit's own admin screens. | |
| 46 | + UtilityPackage\Banner\Banner::instance( 'table-builder-block' ) | |
| 47 | + ->set_api_url( 'https://api.wpmet.com/public/jhanda' ) | |
| 48 | + ->set_plugin_screens( 'toplevel_page_tablebuilder' ) | |
| 49 | + ->call(); | |
| 50 | + | |
| 51 | + // Ask for a WordPress.org rating after the plugin has been in use for a while. | |
| 52 | + UtilityPackage\Rating\Rating::instance( 'table-builder-block' ) | |
| 53 | + ->set_plugin_logo( 'https://ps.w.org/table-builder-block/assets/icon-128x128.png' ) | |
| 54 | + ->set_plugin( 'TableKit', 'https://wordpress.org/support/plugin/table-builder-block/reviews/#new-post' ) | |
| 55 | + ->set_allowed_screens( 'toplevel_page_tablebuilder' ) | |
| 56 | + ->set_priority( 30 ) | |
| 57 | + ->set_first_appear_day( 7 ) | |
| 58 | + ->set_condition( true ) | |
| 59 | + ->set_support_url( 'https://wpmet.com/support-ticket-form/' ) | |
| 60 | + ->call(); | |
| 29 | 61 | } |
| 30 | 62 | |
| 31 | 63 | /** |
| 32 | 64 | * Registers the "Our Plugins" cross-promotion submenu, listing Wpmet's |