Skip to content

Commit 5fbe274

Browse files
committed
Remove unused admin download modal
1 parent f85823c commit 5fbe274

File tree

6 files changed

+3
-119
lines changed

6 files changed

+3
-119
lines changed

admin/options-tab.php

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -179,47 +179,6 @@ protected function upgrade_link() {
179179
);
180180
}
181181

182-
/**
183-
* @since 2.0.0
184-
* @return string
185-
*/
186-
protected function download_labs_link() {
187-
return sprintf(
188-
'<a href="%s" class="download-modal labs">%s</a>',
189-
Prompt_Enum_Urls::DOWNLOAD_PREMIUM,
190-
__( 'Labs', 'Postmatic' )
191-
);
192-
}
193-
194-
/**
195-
* @since 2.0.0
196-
* @return string
197-
*/
198-
protected function download_premium_link() {
199-
return sprintf(
200-
'<a href="%s" class="install_link download-modal premium">%s</a>',
201-
Prompt_Enum_Urls::DOWNLOAD_PREMIUM,
202-
__( 'Install', 'Postmatic' )
203-
);
204-
}
205-
206-
/**
207-
* @since 2.0.0
208-
* @return string
209-
*/
210-
protected function contextual_download_link() {
211-
212-
if ( $this->is_premium_active() ) {
213-
return '';
214-
}
215-
216-
if ( $this->options->is_api_transport() ) {
217-
return $this->download_premium_link();
218-
}
219-
220-
return $this->download_labs_link();
221-
}
222-
223182
/**
224183
* @since 2.0.0
225184
* @return bool

core/ajax-handling.php

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,6 @@ public static function action_wp_ajax_prompt_is_connected() {
4242
wp_send_json_success( $is_connected );
4343
}
4444

45-
/**
46-
* Dismiss a notice.
47-
* @since 2.0.0
48-
*/
49-
public static function action_wp_ajax_prompt_dismiss_notice() {
50-
51-
if ( empty( $_GET['class'] ) or ! class_exists( $_GET['class'] ) ) {
52-
wp_send_json_error();
53-
}
54-
55-
$notice = new $_GET['class'];
56-
57-
$notice->dismiss();
58-
59-
wp_send_json_success();
60-
}
61-
6245
/**
6346
* @param $post_id
6447
* @return array|bool
@@ -79,4 +62,4 @@ protected static function featured_image_src( $post_id ) {
7962
return array( $featured_image['url'], $featured_image['width'], $featured_image['height'] );
8063
}
8164

82-
}
65+
}

core/core.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ protected static function add_hooks() {
152152
add_action( 'wp_ajax_prompt_comment_unsubscribe', array( 'Prompt_Ajax_Handling', 'action_wp_ajax_prompt_comment_unsubscribe' ) );
153153
add_action( 'wp_ajax_nopriv_prompt_comment_unsubscribe', array( 'Prompt_Ajax_Handling', 'action_wp_ajax_prompt_comment_unsubscribe' ) );
154154
add_action( 'wp_ajax_prompt_is_connected', array( 'Prompt_Ajax_Handling', 'action_wp_ajax_prompt_is_connected' ) );
155-
add_action( 'wp_ajax_prompt_dismiss_notice', array( 'Prompt_Ajax_Handling', 'action_wp_ajax_prompt_dismiss_notice' ) );
156155

157156
add_action( 'delete_user', array( 'Prompt_User_Handling', 'delete_subscriptions' ) );
158157
add_action( 'edit_user_profile', array( 'Prompt_User_Handling', 'render_profile_options' ) );

css/admin.css

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -965,21 +965,6 @@ a.button.download:hover, a.button.install:hover {
965965
padding-top: 200px !important;
966966
}
967967

968-
#dismiss-download-modal {
969-
top: 7px;
970-
position: relative;
971-
color: gray;
972-
margin: 0 auto;
973-
width: 200px;
974-
text-align: center;
975-
font-size: 10px;
976-
display: block;
977-
}
978-
979-
#dismiss-download-modal:hover {
980-
cursor: pointer;
981-
}
982-
983968
div#core-options-promo, #core-options-promo-paid {
984969
text-align: center;
985970
background: white;
@@ -1324,4 +1309,4 @@ body .wrap h2.nav-tab-wrapper {
13241309
animation: repliable-tab-show 2s; /* IE 10+, Fx 29+ */
13251310
visibility: visible;
13261311
opacity: 1;
1327-
}
1312+
}

docker-dev/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ services:
3030
- ./auth.json:/tmp/auth.json
3131

3232
phpunit:
33-
image: wordpress:php7.4
33+
image: wordpress:php7.3
3434
entrypoint: vendor/bin/phpunit
3535
command: --version
3636
environment:

js/options-page.js

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ var prompt_options_page_env;
6767

6868
$( 'form' ).submit( disable_next_submit );
6969

70-
init_download_prompt();
7170
init_helpscout_beacon();
7271

7372
} );
@@ -119,47 +118,6 @@ var prompt_options_page_env;
119118
}
120119
}
121120

122-
function init_download_prompt() {
123-
124-
if ( $( '#download-modal' ).length === 0 ) {
125-
return;
126-
}
127-
128-
$( '#prompt-tabs' ).find( 'a.download-modal' ).click( function( e ) {
129-
e.preventDefault();
130-
show();
131-
} );
132-
133-
if ( !prompt_options_page_env.skip_download_intro ) {
134-
show();
135-
}
136-
137-
function show() {
138-
139-
tb_show( prompt_options_page_env.download_title, '#TB_inline?inlineId=download-modal' );
140-
setTimeout( function() { $(window).trigger( 'resize' ); }, 1 );
141-
142-
var $download_prompt = $( '#download-premium-prompt, #download-labs-prompt' );
143-
144-
$download_prompt.find( 'a.download' ).click( function() {
145-
$download_prompt.hide();
146-
$( '#install-labs-prompt, #install-premium-prompt' ).show();
147-
} );
148-
149-
$( '#dismiss-download-modal' ).click( function( e ) {
150-
151-
e.preventDefault();
152-
153-
$.ajax( {
154-
url: ajaxurl,
155-
data: { action: 'prompt_dismiss_notice', 'class': 'Prompt_Admin_Download_Modal_Notice' },
156-
success: tb_remove
157-
} );
158-
} );
159-
160-
}
161-
}
162-
163121
function init_helpscout_beacon() {
164122
HS.beacon.config({
165123
modal: false,

0 commit comments

Comments
 (0)