@@ -137,6 +137,7 @@ function duplicate_post_plugin_upgrade() {
137137 ]
138138 );
139139 add_option ( 'duplicate_post_show_link_in ' , $ show_links_in_defaults );
140+ add_option ( 'duplicate_post_show_notice ' , 1 );
140141
141142 $ taxonomies_blacklist = get_option ( 'duplicate_post_taxonomies_blacklist ' );
142143 if ( $ taxonomies_blacklist === '' ) {
@@ -163,11 +164,6 @@ function duplicate_post_plugin_upgrade() {
163164 }
164165 update_option ( 'duplicate_post_blacklist ' , implode ( ', ' , $ meta_blacklist ) );
165166
166- delete_option ( 'duplicate_post_show_notice ' );
167- if ( version_compare ( $ installed_version , '4.2.0 ' ) < 0 ) {
168- update_site_option ( 'duplicate_post_show_notice ' , 1 );
169- }
170-
171167 if ( version_compare ( $ installed_version , '4.0.0 ' ) < 0 ) {
172168 // Migrate the 'Show links in' options to the new array-based structure.
173169 duplicate_post_migrate_show_links_in_options ( $ show_links_in_defaults );
@@ -220,43 +216,21 @@ function duplicate_post_show_update_notice() {
220216 return ;
221217 }
222218
223- $ class = 'notice is-dismissible ' ;
224- $ message = '<p><strong> ' . sprintf (
225- /* translators: %s: Yoast Duplicate Post version. */
226- __ ( "What's new in Yoast Duplicate Post version %s: " , 'duplicate-post ' ),
227- DUPLICATE_POST_CURRENT_VERSION
228- ) . '</strong> ' ;
229- $ message .= __ ( 'improved compatibility with PHP 8.0 and fixes for some bugs regarding translations and the Rewrite & Republish feature. ' , 'duplicate-post ' )
230- . ' ' ;
231-
232- $ message .= '<a href="https://wordpress.org/plugins/duplicate-post/#developers"> '
233- . sprintf (
234- /* translators: %s: Yoast Duplicate Post version. */
235- __ ( 'Read the changelog ' , 'duplicate-post ' ),
236- DUPLICATE_POST_CURRENT_VERSION
237- )
238- . '</a></p> ' ;
239-
240- $ message .= '<p>%%SIGNUP_FORM%%</p> ' ;
241-
242- $ allowed_tags = [
243- 'a ' => [
244- 'href ' => [],
245- ],
246- 'br ' => [],
247- 'p ' => [],
248- 'strong ' => [],
249- ];
250-
251- $ sanitized_message = wp_kses ( $ message , $ allowed_tags );
252- $ sanitized_message = str_replace ( '%%SIGNUP_FORM%% ' , Newsletter::newsletter_signup_form (), $ sanitized_message );
219+ $ title = sprintf (
220+ /* translators: %s: Yoast Duplicate Post. */
221+ esc_html__ ( 'You \'ve successfully installed %s! ' , 'duplicate-post ' ),
222+ 'Yoast Duplicate Post '
223+ );
253224
254225 $ img_path = plugins_url ( '/duplicate_post_yoast_icon-125x125.png ' , __FILE__ );
255226
256- echo '<div id="duplicate-post-notice" class=" ' . esc_attr ( $ class ) . '" style="display: flex; align-items: flex-start;">
257- <img src=" ' . esc_url ( $ img_path ) . '" alt="" style="margin: 1.5em 0.5em 1.5em 0;"/>
258- <div style="margin: 0.5em"> ' . $ sanitized_message // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: escaped properly above.
259- . '</div></div> ' ;
227+ echo '<div id="duplicate-post-notice" class="notice is-dismissible" style="display: flex; align-items: flex-start;">
228+ <img src=" ' . esc_url ( $ img_path ) . '" alt="" style="margin: 1em 1em 1em 0; width: 130px; align-self: center;"/>
229+ <div stle="margin: 0.5em">
230+ <h1 style="font-size: 14px; color: #a4286a; font-weight: 600; margin-top: 8px;"> ' . $ title . '</h1> ' // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: escaped properly above.
231+ . Newsletter::newsletter_signup_form () // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: escaped in newsletter.php.
232+ . '</div>
233+ </div> ' ;
260234
261235 echo "<script>
262236 function duplicate_post_dismiss_notice(){
0 commit comments