Skip to content

Commit

Permalink
Added a review nag if the user has used mesh for more than 30 days.
Browse files Browse the repository at this point in the history
Code cleanup based on codeclimate
updated release notes.
  • Loading branch information
aaronware committed May 30, 2018
1 parent 69b570a commit d8d663e
Show file tree
Hide file tree
Showing 20 changed files with 535 additions and 470 deletions.
11 changes: 6 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log For Mesh

## [1.2.5] - Unreleased
## [1.2.5] - 2018-05-30

### Fixes

Expand All @@ -18,9 +18,10 @@
- Developers will find section and block controls have even more flexibility (documentation to come soon)
- Better css when hovering a draggable columns.
- Moved and Refactored a ton of methods to be more organized (utilities.php)
- Added utility methods for outputing CSS Classes and other attributes for sections, rows and columns
- Added more descriptions to optoins within Mesh Settings
- Added utility methods for outputting CSS Classes and other attributes for sections, rows and columns
- Added more descriptions to options within Mesh Settings
- Added Mesh_Input class to handle building all input markup (dramatically cutting down code duplications between blocks and sections)
- Added a nag message for reviews. Please help!
- Added a ton of new filters
- You can now define your own max columns using the `mesh_max_columns` filter
- Filter html attributes for sections, rows and columns, `mesh_element_attributes`
Expand All @@ -40,12 +41,12 @@
- TinyMCE default settings are now shared between blocks built with php and javascript.
- Dramatically cut down the code needed within mesh php templates (Developers may want to review any custom templates on a staging environment)
- Admin area now utilizes Mesh_Responsive grid class more extensively
- Minor code formatting for codeclimate / WPCS
- Minor code formatting for code climate / WPCS
- Minor security enhancements to escape admin related content on output
- Minor JavaScript optimizations
- Column resizing is now more responsive. Sections no longer redraw on every "slide", instead only redraw after a change occurs.

## [1.2.4] - 2017-05-01
## [1.2.4] - 2018-05-01

### Fixes

Expand Down
39 changes: 39 additions & 0 deletions admin/review-notice.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* Rating/Review Notification Template
* Display how long the user has been using mesh for and ask them
* if they would like to give it a review. We could really use it!
*
* class.mesh-upgrades.php
*
* @package Mesh
* @since 1.2.5
*/

$mesh_settings = get_option( 'mesh_settings' );

if ( isset( $mesh_settings['first_activated_on'] ) ) :
$install_date = $mesh_settings['first_activated_on'];
?>
<div class="mesh-notice mesh-review-notice notice notice-info is-dismissible" data-type="review-notice">
<div class="table">
<div class="table-cell">
<img src="<?php echo esc_attr( LINCHPIN_MESH___PLUGIN_URL . 'assets/images/mesh-full-logo-full-color@2x.png' ); ?>" >
</div>
<div class="table-cell">
<p class="no-margin">
<?php
// translators: %1$s: human readable time %2$s: Link to review tab on wordpress.org.
printf( wp_kses_post( __( 'Thanks for using Mesh for the past %1$s. <strong>This is a huge compliment</strong> and we could really use your help with a <a href="%2$s">review on wordpress.org</a>', 'mesh' ) ),
esc_html( human_time_diff( $install_date, time() ) ),
esc_url( 'https://wordpress.org/support/plugin/mesh/reviews/?rate=5#new-post' )
);
?>
</p>
<p class="no-margin">
<?php echo wp_kses_post( __( 'If you like Mesh and want us to continue development (including gutenberg integration) we could use the support! <a href="#" class="review-dismiss">No Thanks</a>', 'mesh' ) ); ?>
</p>
</div>
</div>
</div>
<?php endif;
4 changes: 2 additions & 2 deletions admin/section-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
$block_classes[] = 'mesh-block-centered';
}

if ( intval( $block_columns ) < 4 ) {
if ( intval( $block_columns ) <= 4 ) {
$block_classes[] = 'mesh-small-block';
}

Expand Down Expand Up @@ -166,7 +166,7 @@

$tiny_mce_options = mesh_get_tinymce_defaults();

if ( intval( $block_columns ) < 4 ) {
if ( intval( $block_columns ) <= 4 ) {
$tiny_mce_options['toolbar1'] = $tiny_mce_options['small_toolbar1'];
$tiny_mce_options['toolbar2'] = $tiny_mce_options['small_toolbar2'];
}
Expand Down
2 changes: 1 addition & 1 deletion admin/settings-whats-new.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<div class="gray-bg negative-bg versioninfo">
<div class="wrapper">
<h2 class="light-weight">
<?php printf( 'Mesh Version %s <span class="green-pipe">|</span> Released %s', esc_html( get_option( 'mesh_version' ) ), esc_html__( 'May 25th, 2018', 'mesh' ) ); ?></h2>
<?php printf( 'Mesh Version %s <span class="green-pipe">|</span> Released %s', esc_html( get_option( 'mesh_version' ) ), esc_html__( 'May 30th, 2018', 'mesh' ) ); ?></h2>
</div>
</div>
<div class="wrapper">
Expand Down
12 changes: 5 additions & 7 deletions admin/upgrade-notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
* Upgrade Notification Template
* Display useful upgrade information within an admin notification
*
* @usedby class.mesh-upgrades.php
*
* @package Mesh
* @since 1.2.5
*/

$mesh_version = get_option( 'mesh_version' );
$mesh_version = get_option( 'mesh_version' );

?>
<div class="mesh-update-notice notice notice-info is-dismissible" data-type="update-notice">
<div class="mesh-notice mesh-update-notice notice notice-info is-dismissible" data-type="update-notice">
<div class="table">
<div class="table-cell">
<img src="<?php echo esc_attr( LINCHPIN_MESH___PLUGIN_URL . 'assets/images/mesh-full-logo-full-color@2x.png' ); ?>" >
Expand All @@ -21,15 +19,15 @@
<p class="no-margin">
<?php
// translators: %1$s: Version Number %2$s: Link to what's new tab.
printf( wp_kses_post( __( 'Thanks for updating Mesh to v. (%1$s). <strong>This is a huge update</strong>. We suggest checking out <a href="%2$s">what\'s new</a>', 'mesh' ) ),
printf( wp_kses_post( __( 'Thanks for updating Mesh to v. (%1$s). <strong>This is another huge update</strong>. We suggest checking out <a href="%2$s">what\'s new</a>', 'mesh' ) ),
esc_html( $mesh_version ),
esc_url( admin_url( 'options-general.php?page=mesh&tab=new' ) )
);
?>
</p>
<p class="no-margin">
<?php echo wp_kses_post( __( "<strong>Better Quality of Life!</strong> Centered Single Column, Support for Foundation 6.4.X, Flex Grid, XY Grid, CSS Grid, bug fixes, even more developer flexibility, and lots more!", 'mesh' ) ); ?>
<?php echo wp_kses_post( __( '<strong>Better Quality of Life!</strong> Centered Single Column, Support for Foundation 6.4.X, Flex Grid, XY Grid, CSS Grid, bug fixes, even more developer flexibility, and lots more!', 'mesh' ) ); ?>
</p>
</div>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion assets/css/admin-mesh.css

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion assets/js/admin-mesh-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ mesh.blocks = function ($) {
$(this).closest('.block').addClass('ui-hover-state');
}).on('mouseleave', '.the-mover', function() {
$(this).closest('.block').removeClass('ui-hover-state');
})
.on('change', '.mesh-block-columns.column-width', function( event ) {
self.change_block_widths( event );
});

self.setup_resize_slider();
Expand Down Expand Up @@ -255,7 +258,6 @@ mesh.blocks = function ($) {
change: function( event, ui ) {
var $tgt = $(event.target),
$columns = $tgt.parents('.mesh-section').find('.mesh-editor-blocks').find('.mesh-row:first .columns');

self.rerender_blocks($columns.find('.wp-editor-area'));
}
};
Expand Down
18 changes: 14 additions & 4 deletions assets/js/admin-mesh-notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,31 @@ mesh.notifications = function ( $ ) {
self = mesh.notifications;

$body
.on('click', '.mesh-update-notice .notice-dismiss', self.dismissNotification );
.on('click', '.mesh-update-notice .notice-dismiss', self.dismissNotification )
.on('click', '.mesh-review-notice .review-dismiss, .mesh-review-notice .notice-dismiss', self.dismissNotification );
},

/**
* Ajax call to dismiss notifications.
*
* @since 1.2
*/
dismissNotification : function() {
dismissNotification : function( event ) {

event.preventDefault();

var $notice = $(this).parents('.mesh-notice');

$.post( ajaxurl, {
action : 'mesh_dismiss_notification',
mesh_notification_type : $(this).parents('.mesh-update-notice').attr('data-type'),
mesh_notification_type : $notice.attr('data-type'),
_wpnonce : mesh_notifications.dismiss_nonce
}, function( response ) {

$notice.fadeTo(100, 0,function() {
$notice.slideUp( 100, function(){
$notice.remove();
});
});
});
}
};
Expand Down
4 changes: 3 additions & 1 deletion assets/js/admin-mesh.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/admin-mesh.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/admin-mesh.min.js

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions assets/scss/mesh/_admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,6 @@
}
}
// About Mesh
.about.hero {
background-image: url('../images/meshbackground@2x.png');
Expand Down Expand Up @@ -473,7 +469,7 @@
}
// UPDATE Notification
.mesh-update-notice {
.mesh-notice {
padding: 10px 38px;
border-left-color: $cerise;
margin: 25px 20px 0 2px ;
Expand All @@ -488,7 +484,6 @@
.table-cell {
display: table-cell;
vertical-align: middle;
}
}
Expand All @@ -501,7 +496,6 @@
&:hover, &:focus, &:active {
color: $lochinvar;
}
}
}
Expand Down
Loading

0 comments on commit d8d663e

Please sign in to comment.