Skip to content

Commit ff03a5b

Browse files
author
Cosmin
authored
Merge pull request #17 from c0sm1n87/master
see changelog
2 parents 08ac8bf + 969d98e commit ff03a5b

31 files changed

+350
-324
lines changed

archive-jetpack-portfolio.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
id="post-<?php the_ID(); ?>" <?php post_class( 'post-snippet col-md-3 col-sm-6 masonry-item project' ); ?>>
3737
<div class="image-tile inner-title hover-reveal text-center"><?php
3838
if ( has_post_thumbnail() ) { ?>
39-
<a href="<?php the_permalink(); ?>" title="<?php esc_attr( the_title_attribute() ); ?>">
39+
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(array( 'echo' => false )); ?>">
4040
<?php the_post_thumbnail( 'medium' ); ?>
4141
<div class="title"><?php
4242
the_title( '<h5 class="mb0">', '</h5>' );

archive.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @package Shapely
88
*/
99
get_header(); ?>
10-
<?php $layout_class = ( function_exists( 'shapely_get_layout_class' ) ) ? shapely_get_layout_class() : ''; ?>
10+
<?php $layout_class = shapely_get_layout_class();?>
1111
<div class="row">
1212
<?php
1313
if ( $layout_class == 'sidebar-left' ):
@@ -29,10 +29,7 @@
2929

3030
get_template_part( 'template-parts/layouts/blog', $layout_type );
3131

32-
if ( function_exists( "shapely_pagination" ) ):
33-
shapely_pagination();
34-
endif;
35-
32+
shapely_pagination();
3633
else :
3734
get_template_part( 'template-parts/content', 'none' );
3835

changelog.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
### 1.7.2
2+
<a href="https://github.com/puikinsh/shapely/issues">Issues</a>
3+
#119 - changed prefixed
4+
#120 - fixed
5+
#121 - fixed
6+
#122 - fixed
7+
#123 - fixed
8+
#124 - fixed
9+
#125 - fixed
10+
#126 - added a notice in readme file about this limitation
11+
#128 - fixed
12+
#129 - fixed
13+
#130 - fixed
14+
#131 - fixed
15+
116
### 1.7.1
217
<a href="https://github.com/puikinsh/shapely/issues">Issues</a>
318
#112 - #1 - there's nothing wrong in using abspath, it's a WordPress core define, nothing added by the theme/plugin. Changed it to incorporate MU

comments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
endif;
8484

8585
/* comment form */
86-
$comments_args = ( function_exists( 'shapely_custom_comment_form' ) ) ? shapely_custom_comment_form() : '';
86+
$comments_args = shapely_custom_comment_form();
8787
comment_form($comments_args);
8888
?>
8989

functions.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ function shapely_content_width() {
170170
function shapely_widgets_init() {
171171
register_sidebar( array(
172172
'id' => 'sidebar-1',
173-
'name' => __( 'Sidebar', 'shapely' ),
173+
'name' => esc_html__( 'Sidebar', 'shapely' ),
174174
'before_widget' => '<div id="%1$s" class="widget %2$s">',
175175
'after_widget' => '</div>',
176176
'before_title' => '<h2 class="widget-title">',
@@ -179,7 +179,7 @@ function shapely_widgets_init() {
179179

180180
register_sidebar( array(
181181
'id' => 'sidebar-home',
182-
'name' => __( 'Homepage', 'shapely' ),
182+
'name' => esc_html__( 'Homepage', 'shapely' ),
183183
'before_widget' => '<div id="%1$s" class="widget %2$s">',
184184
'after_widget' => '</div>',
185185
'before_title' => '<h2 class="widget-title">',
@@ -189,8 +189,8 @@ function shapely_widgets_init() {
189189
for ( $i = 1; $i < 5; $i ++ ) {
190190
register_sidebar( array(
191191
'id' => 'footer-widget-' . $i,
192-
'name' => sprintf( __( 'Footer Widget %s', 'shapely' ), $i ),
193-
'description' => __( 'Used for footer widget area', 'shapely' ),
192+
'name' => sprintf( esc_html__( 'Footer Widget %s', 'shapely' ), $i ),
193+
'description' => esc_html__( 'Used for footer widget area', 'shapely' ),
194194
'before_widget' => '<div id="%1$s" class="widget %2$s">',
195195
'after_widget' => '</div>',
196196
'before_title' => '<h2 class="widget-title">',
@@ -259,17 +259,19 @@ function shapely_scripts() {
259259
// Add slider JS
260260
wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/js/flexslider.min.js', array( 'jquery' ), '20160222', true );
261261

262-
if ( is_page_template( 'template-home.php' ) ) {
262+
if ( is_page_template( 'page-templates/template-home.php' ) ) {
263263
wp_enqueue_script( 'shapely-parallax', get_template_directory_uri() . '/js/parallax.min.js', array( 'jquery' ), '20160115', true );
264264
}
265265
/**
266266
* OwlCarousel Library
267267
*/
268268
wp_enqueue_script( 'owl.carousel', get_template_directory_uri() . '/js/owl-carousel/owl.carousel.min.js', array( 'jquery' ), '20160115', true );
269269
wp_enqueue_style( 'owl.carousel', get_template_directory_uri() . '/js/owl-carousel/owl.carousel.min.css' );
270-
wp_enqueue_style( 'owl.carousel', get_template_directory_uri() . '/js/owl-carousel/owl.theme.default.css' );
270+
wp_enqueue_style( 'owl.carousel.theme', get_template_directory_uri() . '/js/owl-carousel/owl.theme.default.css' );
271271

272272
wp_enqueue_script( 'shapely-scripts', get_template_directory_uri() . '/js/shapely-scripts.js', array( 'jquery' ), '20160115', true );
273+
274+
wp_enqueue_style( 'shapely-scss', get_template_directory_uri() . '/assets/css/style.css' );
273275
}
274276

275277
add_action( 'wp_enqueue_scripts', 'shapely_scripts' );

header.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<div class="module widget-handle search-widget-handle left hidden-xs hidden-sm">
4444
<div class="search">
4545
<i class="fa fa-search"></i>
46-
<span class="title"><?php _e( "Site Search", 'shapely' ); ?></span>
46+
<span class="title"><?php esc_html_e( "Site Search", 'shapely' ); ?></span>
4747
</div>
4848
<div class="function"><?php
4949
get_search_form(); ?>
@@ -57,12 +57,12 @@
5757
</div>
5858
</header><!-- #masthead -->
5959
<div id="content" class="main-container">
60-
<?php if ( ! is_page_template( 'template-home.php' ) ): ?>
60+
<?php if ( ! is_page_template( 'page-templates/template-home.php' ) ): ?>
6161
<div class="header-callout">
6262
<?php shapely_top_callout(); ?>
6363
</div>
6464
<?php endif; ?>
6565

6666
<section class="content-area <?php echo ( get_theme_mod( 'top_callout', true ) ) ? '' : ' pt0 ' ?>">
67-
<div id="main" class="<?php echo ( ! is_page_template( 'template-home.php' ) ) ? 'container' : ''; ?>"
67+
<div id="main" class="<?php echo ( ! is_page_template( 'page-templates/template-home.php' ) ) ? 'container' : ''; ?>"
6868
role="main">

inc/admin/welcome-screen/notify-system-checks.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -122,43 +122,43 @@ public static function shapely_has_plugin( $slug = NULL ) {
122122
public static function shapely_companion_title() {
123123
$installed = self::shapely_check_plugin_is_installed( 'shapely-companion' );
124124
if ( ! $installed ) {
125-
return __( 'Install: Shapely Companion Plugin', 'shapely' );
125+
return esc_html__( 'Install: Shapely Companion Plugin', 'shapely' );
126126
}
127127

128128
$active = self::shapely_check_plugin_is_active( 'shapely-companion' );
129129
if ( $installed && ! $active ) {
130-
return __( 'Activate: Shapely Companion Plugin', 'shapely' );
130+
return esc_html__( 'Activate: Shapely Companion Plugin', 'shapely' );
131131
}
132132

133-
return __( 'Install: Shapely Companion Plugin', 'shapely' );
133+
return esc_html__( 'Install: Shapely Companion Plugin', 'shapely' );
134134
}
135135

136136
public static function shapely_yoast_title() {
137137
$installed = self::shapely_check_plugin_is_installed( 'wordpress-seo' );
138138
if ( ! $installed ) {
139-
return __( 'Install: Yoast SEO Plugin', 'shapely' );
139+
return esc_html__( 'Install: Yoast SEO Plugin', 'shapely' );
140140
}
141141

142142
$active = self::shapely_check_plugin_is_active( 'wordpress-seo' );
143143
if ( $installed && ! $active ) {
144-
return __( 'Activate: Yoast SEO Plugin', 'shapely' );
144+
return esc_html__( 'Activate: Yoast SEO Plugin', 'shapely' );
145145
}
146146

147-
return __( 'Install: Yoast SEO Plugin', 'shapely' );
147+
return esc_html__( 'Install: Yoast SEO Plugin', 'shapely' );
148148
}
149149

150150
public static function shapely_jetpack_title() {
151151
$installed = self::shapely_check_plugin_is_installed( 'jetpack' );
152152
if ( ! $installed ) {
153-
return __( 'Install: Jetpack by WordPress', 'shapely' );
153+
return esc_html__( 'Install: Jetpack by WordPress', 'shapely' );
154154
}
155155

156156
$active = self::shapely_check_plugin_is_active( 'jetpack' );
157157
if ( $installed && ! $active ) {
158-
return __( 'Activate: Jetpack by WordPress', 'shapely' );
158+
return esc_html__( 'Activate: Jetpack by WordPress', 'shapely' );
159159
}
160160

161-
return __( 'Install: Jetpack by WordPress', 'shapely' );
161+
return esc_html__( 'Install: Jetpack by WordPress', 'shapely' );
162162
}
163163

164164
/**
@@ -168,15 +168,15 @@ public static function shapely_companion_description() {
168168
$installed = self::shapely_check_plugin_is_installed( 'shapely-companion' );
169169

170170
if ( ! $installed ) {
171-
return __( 'Please install Shapely Companion plugin.', 'shapely' );
171+
return esc_html__( 'Please install Shapely Companion plugin.', 'shapely' );
172172
}
173173

174174
$active = self::shapely_check_plugin_is_active( 'shapely-companion' );
175175
if ( $installed && ! $active ) {
176-
return __( 'Please activate Shapely Companion plugin.', 'shapely' );
176+
return esc_html__( 'Please activate Shapely Companion plugin.', 'shapely' );
177177
}
178178

179-
return __( 'Please install Shapely Companion plugin.', 'shapely' );
179+
return esc_html__( 'Please install Shapely Companion plugin.', 'shapely' );
180180
}
181181

182182
/**
@@ -186,29 +186,29 @@ public static function shapely_jetpack_description() {
186186
$installed = self::shapely_check_plugin_is_installed( 'jetpack' );
187187

188188
if ( ! $installed ) {
189-
return __( 'Please install Jetpack by WordPress. Note that you won\'t be able to use the Testimonials and Portfolio widgets without it.', 'shapely' );
189+
return esc_html__( 'Please install Jetpack by WordPress. Note that you won\'t be able to use the Testimonials and Portfolio widgets without it.', 'shapely' );
190190
}
191191

192192
$active = self::shapely_check_plugin_is_active( 'jetpack' );
193193
if ( $installed && ! $active ) {
194-
return __( 'Please activate Jetpack by WordPress. Note that you won\'t be able to use the Testimonials and Portfolio widgets without it.', 'shapely' );
194+
return esc_html__( 'Please activate Jetpack by WordPress. Note that you won\'t be able to use the Testimonials and Portfolio widgets without it.', 'shapely' );
195195
}
196196

197-
return __( 'Please install Jetpack by WordPress. Note that you won\'t be able to use the Testimonials and Portfolio widgets without it.', 'shapely' );
197+
return esc_html__( 'Please install Jetpack by WordPress. Note that you won\'t be able to use the Testimonials and Portfolio widgets without it.', 'shapely' );
198198
}
199199

200200
public static function shapely_yoast_description() {
201201
$installed = self::shapely_check_plugin_is_installed( 'wordpress-seo' );
202202
if ( ! $installed ) {
203-
return __( 'Please install Yoast SEO plugin.', 'shapely' );
203+
return esc_html__( 'Please install Yoast SEO plugin.', 'shapely' );
204204
}
205205

206206
$active = self::shapely_check_plugin_is_active( 'wordpress-seo' );
207207
if ( $installed && ! $active ) {
208-
return __( 'Please activate Yoast SEO plugin.', 'shapely' );
208+
return esc_html__( 'Please activate Yoast SEO plugin.', 'shapely' );
209209
}
210210

211-
return __( 'Please install Yoast SEO plugin.', 'shapely' );
211+
return esc_html__( 'Please install Yoast SEO plugin.', 'shapely' );
212212

213213
}
214214

inc/admin/welcome-screen/sections/actions-required.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@
5252
switch ( $active['needs'] ) {
5353
case 'install':
5454
$class = 'install-now button';
55-
$label = __( 'Install', 'shapely' );
55+
$label = esc_html__( 'Install', 'shapely' );
5656
break;
5757
case 'activate':
5858
$class = 'activate-now button button-primary';
59-
$label = __( 'Activate', 'shapely' );
59+
$label = esc_html__( 'Activate', 'shapely' );
6060
break;
6161
case 'deactivate':
6262
$class = 'deactivate-now button';
63-
$label = __( 'Deactivate', 'shapely' );
63+
$label = esc_html__( 'Deactivate', 'shapely' );
6464
break;
6565
}
6666

@@ -81,7 +81,7 @@ class="<?php echo esc_attr( $class ); ?>"
8181

8282

8383
if ( $hooray ):
84-
echo '<span class="hooray">' . __( 'Hooray! There are no required actions for you right now.', 'shapely' ) . '</span>';
84+
echo '<span class="hooray">' . esc_html__( 'Hooray! There are no required actions for you right now.', 'shapely' ) . '</span>';
8585
endif;
8686
?>
8787

inc/admin/welcome-screen/sections/recommended-plugins.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@
2121
switch ( $active['needs'] ) {
2222
case 'install':
2323
$class = 'install-now button';
24-
$label = __( 'Install', 'shapely' );
24+
$label = esc_html__( 'Install', 'shapely' );
2525
break;
2626
case 'activate':
2727
$class = 'activate-now button button-primary';
28-
$label = __( 'Activate', 'shapely' );
28+
$label = esc_html__( 'Activate', 'shapely' );
2929
break;
3030
case 'deactivate':
3131
$class = 'deactivate-now button';
32-
$label = __( 'Deactivate', 'shapely' );
32+
$label = esc_html__( 'Deactivate', 'shapely' );
3333
break;
3434
}
3535

3636
?>
3737
<div class="col plugin_box">
3838
<img src="<?php echo esc_attr( $icon ) ?>" alt="plugin box image">
3939
<span
40-
class="version"><?php echo __( 'Version:', 'shapely' ); ?><?php echo esc_html( $info->version ) ?></span>
40+
class="version"><?php echo esc_html__( 'Version:', 'shapely' ); ?><?php echo esc_html( $info->version ) ?></span>
4141
<span
4242
class="separator">|</span> <?php echo wp_kses_post( $info->author ) ?>
4343
<div

inc/admin/welcome-screen/welcome-screen.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct() {
4040
*/
4141
public function shapely_welcome_register_menu() {
4242
$action_count = $this->count_actions();
43-
$title = $action_count > 0 ? __( 'About Shapely', 'shapely' ) . '<span class="badge-action-count">' . esc_html( $action_count ) . '</span>' : __( 'About Shapely', 'shapely' );
43+
$title = $action_count > 0 ? esc_html__( 'About Shapely', 'shapely' ) . '<span class="badge-action-count">' . esc_html( $action_count ) . '</span>' : esc_html__( 'About Shapely', 'shapely' );
4444

4545
add_theme_page( 'About shapely', $title, 'edit_theme_options', 'shapely-welcome', array(
4646
$this,
@@ -71,7 +71,8 @@ public function shapely_welcome_admin_notice() {
7171
<div class="updated notice is-dismissible">
7272
<p><?php echo sprintf( esc_html__( 'Welcome! Thank you for choosing shapely! To fully take advantage of the best our theme can offer please make sure you visit our %swelcome page%s.', 'shapely' ), '<a href="' . esc_url( admin_url( 'themes.php?page=shapely-welcome' ) ) . '">', '</a>' ); ?></p>
7373
<p><a href="<?php echo esc_url( admin_url( 'themes.php?page=shapely-welcome' ) ); ?>" class="button"
74-
style="text-decoration: none;"><?php _e( 'Get started with shapely', 'shapely' ); ?></a></p>
74+
style="text-decoration: none;"><?php echo esc_html__( 'Get started with shapely', 'shapely' ); ?></a>
75+
</p>
7576
</div>
7677
<?php
7778
}
@@ -90,7 +91,7 @@ public function shapely_welcome_style_and_scripts( $hook_suffix ) {
9091
'nr_actions_required' => absint( $this->count_actions() ),
9192
'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ),
9293
'template_directory' => esc_url( get_template_directory_uri() ),
93-
'no_required_actions_text' => __( 'Hooray! There are no required actions for you right now.', 'shapely' )
94+
'no_required_actions_text' => esc_html__( 'Hooray! There are no required actions for you right now.', 'shapely' )
9495
) );
9596

9697
}
@@ -109,7 +110,7 @@ public function shapely_welcome_scripts_for_customizer() {
109110
'nr_actions_required' => absint( $this->count_actions() ),
110111
'aboutpage' => esc_url( admin_url( 'themes.php?page=shapely-welcome&tab=recommended_actions' ) ),
111112
'customizerpage' => esc_url( admin_url( 'customize.php#recommended_actions' ) ),
112-
'themeinfo' => __( 'View Theme Info', 'shapely' ),
113+
'themeinfo' => esc_html__( 'View Theme Info', 'shapely' ),
113114
) );
114115
}
115116

@@ -124,7 +125,7 @@ public function shapely_dismiss_required_action_callback() {
124125

125126
$action_id = ( isset( $_GET['id'] ) ) ? $_GET['id'] : 0;
126127

127-
echo esc_html( $action_id ); /* this is needed and it's the id of the dismissable required action */
128+
echo esc_html( wp_unslash( $action_id ) ); /* this is needed and it's the id of the dismissable required action */
128129

129130
if ( ! empty( $action_id ) ):
130131

@@ -133,12 +134,15 @@ public function shapely_dismiss_required_action_callback() {
133134

134135
$shapely_show_required_actions = get_option( 'shapely_show_required_actions' );
135136

136-
switch ( $_GET['todo'] ) {
137+
switch ( esc_html( $_GET['todo'] ) ) {
137138
case 'add';
138-
$shapely_show_required_actions[ $action_id ] = true;
139+
$shapely_show_required_actions[ absint( $action_id ) ] = true;
139140
break;
140141
case 'dismiss';
141-
$shapely_show_required_actions[ $action_id ] = false;
142+
$shapely_show_required_actions[ absint( $action_id ) ] = false;
143+
break;
144+
default:
145+
return new WP_Error( 'Action denied!', __( 'I\'ve fallen and can\'t get up', 'shapely' ) );
142146
break;
143147
}
144148

@@ -324,14 +328,14 @@ public function shapely_welcome_screen() {
324328
require_once( ABSPATH . 'wp-admin/admin-header.php' );
325329

326330
$shapely = wp_get_theme();
327-
$active_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'getting_started';
331+
$active_tab = isset( $_GET['tab'] ) ? wp_unslash( $_GET['tab'] ) : 'getting_started';
328332
$action_count = $this->count_actions();
329333

330334
?>
331335

332336
<div class="wrap about-wrap epsilon-wrap">
333337

334-
<h1><?php echo esc_html__( 'Welcome to Shapely! - Version ', 'shapely' ) . $shapely['Version']; ?></h1>
338+
<h1><?php echo esc_html__( 'Welcome to Shapely! - Version ', 'shapely' ) . esc_html( $shapely['Version'] ); ?></h1>
335339

336340
<div
337341
class="about-text"><?php echo esc_html__( 'Shapely is now installed and ready to use! Get ready to build something beautiful. We hope you enjoy it! We want to make sure you have the best experience using shapely and that is why we gathered here all the necessary information for you. We hope you will enjoy using shapely, as much as we enjoy creating great products.', 'shapely' ); ?></div>

0 commit comments

Comments
 (0)