Skip to content

Commit 9ca3374

Browse files
authored
refresh admin notices. (#56)
* refresh admin notices. * update readme and version numbers * Build for release * make premium cta not dismissible * Build for release * removed fortressDB notice, and update version * update dependancies * update axiom dependancy
1 parent 2717109 commit 9ca3374

File tree

14 files changed

+373
-373
lines changed

14 files changed

+373
-373
lines changed

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# weForms - Easy Drag & Drop Contact Form Builder For WordPress #
2-
**Contributors:** [tareq1988](https://profiles.wordpress.org/tareq1988), [nizamuddinbabu](https://profiles.wordpress.org/nizamuddinbabu), [boldgrid](https://profiles.wordpress.org/boldgrid), [joemoto](https://profiles.wordpress.org/joemoto), [jamesros161](https://profiles.wordpress.org/jamesros161)
3-
**Tags:** forms, contact form, contact form plugin, custom form, form builder, form, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation
4-
**Requires at least:** 4.4
5-
**Requires PHP:** 5.6.20
6-
**Tested up to:** 5.6
7-
**Stable tag:** 1.6.4
8-
**License:** GPLv2 or later
9-
**License URI:** https://www.gnu.org/licenses/gpl-2.0.html
2+
**Contributors:** [tareq1988](https://profiles.wordpress.org/tareq1988), [nizamuddinbabu](https://profiles.wordpress.org/nizamuddinbabu), [boldgrid](https://profiles.wordpress.org/boldgrid), [joemoto](https://profiles.wordpress.org/joemoto), [jamesros161](https://profiles.wordpress.org/jamesros161)
3+
**Tags:** forms, contact form, contact form plugin, custom form, form builder, form, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation
4+
**Requires at least:** 4.4
5+
**Requires PHP:** 5.6.20
6+
**Tested up to:** 5.6
7+
**Stable tag:** 1.6.5
8+
**License:** GPLv2 or later
9+
**License URI:** https://www.gnu.org/licenses/gpl-2.0.html
1010

1111
The easiest & fastest Contact Form on WordPress. Multiple templates, drag-&-drop live builder, submission listing, reCaptcha & more!
1212

@@ -249,6 +249,11 @@ weForms is the most beginner friendly and fastest WordPress contact form plugin
249249

250250
## Changelog ##
251251

252+
### Version 1.6.5 (18 February, 2021) ###
253+
* **Fix:** Updated admin notices to better conform to WordPress design standards, and configured them to only show on WeForms pages.
254+
* **Update:** Removed FortressDB admin notice.
255+
* **Update:** Updated axios dependancy
256+
252257
### Version 1.6.4 (23 December, 2020) ###
253258
* **Fix:** Added spreadsheet functione escaping to prevent CSV exploits. [#50] (https://github.com/BoldGrid/weforms/pull/50)
254259
* **Update:** Update Node Packages

assets/js-templates/spa-components.php

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,11 @@
173173
<span style="color: #999;" class="form-name">
174174
{{ form_title }}
175175
</span>
176-
176+
177177
<select v-if="Object.keys(forms).length" v-model="selected" @change="status='publish'">
178178
<option :value="form.id" v-for="form in forms">{{ form.name }}</option>
179179
</select>
180180
</h1>
181-
<?php if ( ! class_exists( 'WeForms_Pro' ) ) {?>
182-
<div class="wpuf-premium-cta">
183-
<img src="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . 'images/weforms-logo.png'?>">
184-
<p><?php _e( 'You&#39;re using weForms Free. For more features, modules and more consider upgrading to Pro.' , 'weforms' ); ?></p>
185-
<a href="https://weformspro.com/get-premium/?utm_source=Entries&utm_medium=Button&utm_campaign=Upgrade%20Now" target="_blank" class="button"><?php _e( 'UPGRADE NOW!' , 'weforms' ); ?></a>
186-
</div>
187-
<?php } ?>
188181
</div>
189182

190183
<div>
@@ -786,13 +779,6 @@
786779
<div class="contact-form-list">
787780
<h1 class="wp-heading-inline"><?php _e( 'All Forms', 'weforms' ); ?></h1>
788781
<a class="page-title-action add-form" herf="#" v-on:click.prevent="displayModal()"><?php _e( 'Add Form', 'weforms' ); ?></a>
789-
<?php if ( ! class_exists( 'WeForms_Pro' ) ) {?>
790-
<div class="wpuf-premium-cta">
791-
<img src="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . 'images/weforms-logo.png'?>">
792-
<p><?php _e( 'You&#39;re using weForms Free. For more features, modules and more consider upgrading to Pro.' , 'weforms' ); ?></p>
793-
<a href="https://weformspro.com/upgrade-now/?utm_source=All%20Forms&utm_medium=Button&utm_campaign=Upgrade%20Now" target="_blank" class="button"><?php _e( 'UPGRADE NOW!' , 'weforms' ); ?></a>
794-
</div>
795-
<?php } ?>
796782
<wpuf-template-modal :show.sync="showTemplateModal" :onClose="closeModal"></wpuf-template-modal>
797783

798784
<form-list-table></form-list-table>
@@ -801,13 +787,6 @@
801787
<script type="text/x-template" id="tmpl-wpuf-tools">
802788
<div class="export-import-wrap">
803789
<h1><?php _e( 'Tools', 'weforms' ); ?></h1>
804-
<?php if ( ! class_exists( 'WeForms_Pro' ) ) {?>
805-
<div class="wpuf-premium-cta">
806-
<img src="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . 'images/weforms-logo.png'?>">
807-
<p><?php _e( 'You&#39;re using weForms Free. For more features, modules and more consider upgrading to Pro.' , 'weforms' ); ?></p>
808-
<a href="https://weformspro.com/get-premium-weforms/?utm_source=Tools&utm_medium=Button&utm_campaign=Upgrade%20Now" target="_blank" class="button"><?php _e( 'UPGRADE NOW!' , 'weforms' ); ?></a>
809-
</div>
810-
<?php } ?>
811790
<h2 class="nav-tab-wrapper">
812791
<a :class="['nav-tab', isActiveTab( 'export' ) ? 'nav-tab-active' : '']" href="#" v-on:click.prevent="makeActive('export')"><?php _e( 'Export', 'wpuf' ); ?></a>
813792
<a :class="['nav-tab', isActiveTab( 'import' ) ? 'nav-tab-active' : '']" href="#" v-on:click.prevent="makeActive('import')"><?php _e( 'Import', 'wpuf' ); ?></a>
@@ -1008,7 +987,7 @@
1008987
</h1>
1009988

1010989
<p v-if="no_transactions">
1011-
<?php printf(
990+
<?php printf(
1012991
__( 'You don\'t have any transactions yet. Learn how to %sset up payment integration%s and take payments with weFroms.' ),
1013992
'<a target="_blank" href="https://wedevs.com/docs/weforms/integrations/payment/">',
1014993
'</a>'
@@ -1380,13 +1359,6 @@
13801359
<div class="weforms-settings clearfix" id="weforms-settings">
13811360

13821361
<h1><?php _e( 'Settings', 'weforms' ); ?></h1>
1383-
<?php if ( ! class_exists( 'WeForms_Pro' ) ) {?>
1384-
<div class="wpuf-premium-cta">
1385-
<img src="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . 'images/weforms-logo.png'?>">
1386-
<p><?php _e( 'You&#39;re using weForms Free. For more features, modules and more consider upgrading to Pro.' , 'weforms' ); ?></p>
1387-
<a href="https://weformspro.com/premium-weforms/?utm_source=Settings&utm_medium=Button&utm_campaign=Upgrade%20Now" target="_blank" class="button"><?php _e( 'UPGRADE NOW!' , 'weforms' ); ?></a>
1388-
</div>
1389-
<?php } ?>
13901362
<div id="weforms-settings-tabs-warp" class="<?php echo !function_exists( 'weforms_pro' ) ? 'weforms-pro-deactivate' : ''; ?>">
13911363
<div id="weforms-settings-tabs">
13921364
<ul>

assets/js/spa-app.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
11
'use strict';
22

3-
var _typeof3 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
3+
var _typeof8 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
4+
5+
var _typeof7 = typeof Symbol === "function" && _typeof8(Symbol.iterator) === "symbol" ? function (obj) {
6+
return typeof obj === "undefined" ? "undefined" : _typeof8(obj);
7+
} : function (obj) {
8+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof8(obj);
9+
};
10+
11+
var _typeof6 = typeof Symbol === "function" && _typeof7(Symbol.iterator) === "symbol" ? function (obj) {
12+
return typeof obj === "undefined" ? "undefined" : _typeof7(obj);
13+
} : function (obj) {
14+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof7(obj);
15+
};
16+
17+
var _typeof5 = typeof Symbol === "function" && _typeof6(Symbol.iterator) === "symbol" ? function (obj) {
18+
return typeof obj === "undefined" ? "undefined" : _typeof6(obj);
19+
} : function (obj) {
20+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof6(obj);
21+
};
22+
23+
var _typeof4 = typeof Symbol === "function" && _typeof5(Symbol.iterator) === "symbol" ? function (obj) {
24+
return typeof obj === "undefined" ? "undefined" : _typeof5(obj);
25+
} : function (obj) {
26+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof5(obj);
27+
};
28+
29+
var _typeof3 = typeof Symbol === "function" && _typeof4(Symbol.iterator) === "symbol" ? function (obj) {
30+
return typeof obj === "undefined" ? "undefined" : _typeof4(obj);
31+
} : function (obj) {
32+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof4(obj);
33+
};
434

535
var _typeof2 = typeof Symbol === "function" && _typeof3(Symbol.iterator) === "symbol" ? function (obj) {
636
return typeof obj === "undefined" ? "undefined" : _typeof3(obj);

assets/js/spa-app.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/admin/class-admin.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ public function __construct() {
1010
add_action( 'admin_menu', [ $this, 'register_admin_menu' ] );
1111
add_action( 'pre_update_option_wpuf_general', [ $this, 'watch_wpuf_settings' ] );
1212

13+
add_action( 'admin_notices', array( $this, 'wpuf_premium_cta' ) );
14+
1315
add_filter( 'admin_footer_text', [ $this, 'admin_footer_text' ] );
1416
add_filter( 'admin_post_weforms_export_forms', [ $this, 'export_forms' ] );
1517
add_filter( 'admin_post_weforms_export_form_entries', [ $this, 'export_form_entries' ] );
@@ -387,4 +389,30 @@ public function settings_tab_secure_database( $tab ) {
387389
public function settings_tab_privacy( $tab ) {
388390
include __DIR__ . '/views/weforms-settings-privacy.php';
389391
}
392+
393+
/**
394+
* WeForms Pro CTA notice
395+
*
396+
* @since 1.6.5
397+
*/
398+
public function wpuf_premium_cta() {
399+
$screen = get_current_screen();
400+
if ( $screen && $screen->base && 'toplevel_page_weforms' !== $screen->base ) {
401+
return;
402+
}
403+
404+
if ( ! class_exists( 'WeForms_Pro' ) ) {
405+
?>
406+
<div class="notice updated premium-cta">
407+
<p style="display: flex;align-items: center;">
408+
<img style="padding-right:15px;" src="<?php echo WEFORMS_ASSET_URI . '/images/weforms-logo.png'; ?>">
409+
<?php _e( 'You&#39;re using weForms Free. For more features, modules and more consider upgrading to Pro.' , 'weforms' ); ?>
410+
</p>
411+
<p class="submit">
412+
<a href="https://weformspro.com/get-premium/?utm_source=Entries&utm_medium=Button&utm_campaign=Upgrade%20Now" target="_blank" class="button-primary"><?php _e( 'UPGRADE NOW!' , 'weforms' ); ?></a>
413+
</p>
414+
</div>
415+
<?php
416+
}
417+
}
390418
}

includes/admin/class-form-builder-assets.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public function __construct() {
1010
}
1111

1212
public function init_actions() {
13-
add_action( 'in_admin_header', [ $this, 'remove_admin_notices' ] );
1413
add_action( 'admin_enqueue_scripts', [ $this, 'builder_enqueue_scripts' ], 2000 );
1514
add_action( 'admin_print_scripts', [ $this, 'builder_mixins_script' ] );
1615
add_action( 'admin_footer', [ $this, 'admin_footer_js_templates' ] );
@@ -26,23 +25,6 @@ public function init_actions() {
2625
do_action( 'weforms_form_builder_init' );
2726
}
2827

29-
/**
30-
* Remove all kinds of admin notices
31-
*
32-
* Since we don't have much space left on top of the page,
33-
* we have to remove all kinds of admin notices
34-
*
35-
* @since 1.2.6
36-
*
37-
* @return void
38-
*/
39-
public function remove_admin_notices() {
40-
remove_all_actions( 'network_admin_notices' );
41-
remove_all_actions( 'user_admin_notices' );
42-
remove_all_actions( 'admin_notices' );
43-
remove_all_actions( 'all_admin_notices' );
44-
}
45-
4628
public function builder_enqueue_scripts() {
4729
$prefix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
4830

includes/admin/class-promotion.php

Lines changed: 72 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ public function weforms_review_notice_message() {
163163
return;
164164
}
165165

166+
$screen = get_current_screen();
167+
if ( $screen && $screen->base && 'toplevel_page_weforms' !== $screen->base ) {
168+
return;
169+
}
170+
166171
$dismiss_notice = get_option( 'weforms_review_notice_dismiss', 'no' );
167172
$activation_time = get_option( 'weforms_installed' );
168173
$total_entries = weforms_count_entries();
@@ -188,50 +193,77 @@ public function weforms_review_notice_message() {
188193
) {
189194
return;
190195
} ?>
191-
<div id="weforms-review-notice" class="weforms-review-notice">
192-
<div class="weforms-review-thumbnail">
193-
<img src="<?php echo esc_attr( WEFORMS_ASSET_URI ) . '/images/icon-weforms.png' ?>" alt="">
194-
</div>
195-
<div class="weforms-review-text">
196-
<?php if ( $total_entries >= 25 ) : ?>
197-
<h3><?php wp_kses_post( __( 'Enjoying <strong>weForms</strong>?', 'weforms' ) ) ?></h3>
198-
<p><?php wp_kses_post( __('Seems like you are getting a good response using <strong>weForms</strong>. Would you please show us a little love by rating us in the <a href="https://wordpress.org/support/plugin/weforms/reviews/#postform" target="_blank"><strong>WordPress.org</strong></a>?', 'weforms') ) ?></p>
199-
<?php else: ?>
200-
<h3><?php wp_kses_post( __( 'Enjoying <strong>weForms</strong>?', 'weforms' ) ) ?></h3>
201-
<p><?php wp_kses_post( __( 'Hope that you had a neat and snappy experience with the tool. Would you please show us a little love by rating us in the <a href="https://wordpress.org/support/plugin/weforms/reviews/#postform" target="_blank"><strong>WordPress.org</strong></a>?', 'weforms' ) ) ?></p>
202-
<?php endif; ?>
203-
204-
<ul class="weforms-review-ul">
205-
<li><a href="https://wordpress.org/support/plugin/weforms/reviews/#postform" target="_blank"><span
206-
class="dashicons dashicons-external"></span><?php esc_html_e( 'Sure! I\'d love to!', 'weforms' ) ?>
207-
</a></li>
208-
<li><a href="#" class="notice-dismiss"><span
209-
class="dashicons dashicons-smiley"></span><?php esc_html_e( 'I\'ve already left a review', 'weforms' ) ?>
210-
</a></li>
211-
<li><a href="#" class="notice-dismiss"><span
212-
class="dashicons dashicons-dismiss"></span><?php esc_html_e( 'Never show again', 'weforms' ) ?>
213-
</a>
214-
</li>
215-
</ul>
216-
</div>
196+
<div id="weforms-review-notice" class="weforms-review-notice updated notice">
197+
<div class="weforms-review-top">
198+
<p><img src="<?php echo esc_attr( WEFORMS_ASSET_URI ) . '/images/weforms-logo.png'; ?>" alt=""></p>
199+
<div class="weforms-review-text">
200+
<?php if ( $total_entries >= 25 ) : ?>
201+
<h3><?php printf( __( 'Enjoying %sweForms%s?', 'weforms' ), '<strong>', '</strong>' ); ?></h3>
202+
<p><?php
203+
printf(
204+
// translators: opening <a>tag, closing </a> tag.
205+
__(
206+
'Seems like you are getting a good response using weForms. Would you please show us a little love by rating us in the %sWordPress.org%s?',
207+
'weforms'
208+
),
209+
'<a href="https://wordpress.org/support/plugin/weforms/reviews/#postform" target="_blank"><strong>',
210+
'</strong></a>'
211+
); ?></p>
212+
<?php else: ?>
213+
<h3><?php printf(
214+
// translators: opening <strong> tag, closing </strong> tag.
215+
__( 'Enjoying %sweForms%s?', 'weforms' ),
216+
'<strong>',
217+
'</strong>' ); ?></h3>
218+
<p><?php
219+
printf(
220+
// translators: opening <a> tag, closing </a> tag
221+
__(
222+
'Hope that you had a neat and snappy experience with the tool. Would you please show us a little love by rating us in the %sWordPress.org%s?',
223+
'weforms'
224+
),
225+
'<a href="https://wordpress.org/support/plugin/weforms/reviews/#postform" target="_blank"><strong>',
226+
'</strong></a>'
227+
); ?></p>
228+
<?php endif; ?>
229+
</div>
230+
</div>
231+
<div class="weforms-review-links">
232+
<ul class="weforms-review-ul">
233+
<li><a class="button-primary button" href="https://wordpress.org/support/plugin/weforms/reviews/#postform" target="_blank"><span
234+
class="dashicons dashicons-external"></span><?php esc_html_e( 'Sure! I\'d love to!', 'weforms' ) ?>
235+
</a></li>
236+
<li><a href="#" class="button notice-dismiss"><span
237+
class="dashicons dashicons-smiley"></span><?php esc_html_e( 'I\'ve already left a review', 'weforms' ) ?>
238+
</a></li>
239+
<li><a href="#" class="button notice-dismiss"><span
240+
class="dashicons dashicons-dismiss"></span><?php esc_html_e( 'Never show again', 'weforms' ) ?>
241+
</a>
242+
</li>
243+
</ul>
244+
</div>
217245
</div>
218246
<style type="text/css">
219-
#weforms-review-notice .notice-dismiss {
220-
padding: 0 0 0 26px;
221-
}
222247

223248
#weforms-review-notice .notice-dismiss:before {
224249
display: none;
225250
}
226251

227252
#weforms-review-notice.weforms-review-notice {
228-
padding: 15px 15px 15px 0;
229253
background-color: #fff;
230254
border-radius: 3px;
231-
margin: 20px 20px 0 0;
232-
border-left: 4px solid transparent;
255+
margin: 5px 0 15px;
233256
}
234257

258+
#weforms-review-notice .weforms-review-top {
259+
display: flex;
260+
margin: 0.5em 0;
261+
}
262+
263+
#weforms-review-notice .weforms-review-top > p {
264+
padding-right: 15px;
265+
}
266+
235267
#weforms-review-notice .weforms-review-thumbnail {
236268
width: 114px;
237269
float: left;
@@ -256,6 +288,10 @@ class="dashicons dashicons-dismiss"></span><?php esc_html_e( 'Never show again',
256288
line-height: 1.3;
257289
}
258290

291+
#weforms-review-notice .weforms-review-links {
292+
margin: 0.5em 0;
293+
}
294+
259295
#weforms-review-notice .weforms-review-text p {
260296
font-size: 13px;
261297
margin: 0 0 5px;
@@ -272,17 +308,15 @@ class="dashicons dashicons-dismiss"></span><?php esc_html_e( 'Never show again',
272308
}
273309

274310
#weforms-review-notice .weforms-review-ul li a {
275-
display: inline-block;
276-
color: #82C776;
311+
display: flex;
312+
align-items: center;
313+
justify-content: space-between;
277314
text-decoration: none;
278-
padding-left: 26px;
279315
position: relative;
280316
}
281317

282318
#weforms-review-notice .weforms-review-ul li a span {
283-
position: absolute;
284-
left: 0;
285-
top: -2px;
319+
margin-right: 10px;
286320
}
287321
</style>
288322
<script type='text/javascript'>

includes/admin/views/vue-index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<div class="wrap">
2+
<h1></h1>
23
<div id="wpuf-contact-form-app">
34
<router-view></router-view>
45
</div>

0 commit comments

Comments
 (0)