Skip to content

Commit 95510e9

Browse files
author
Cosmin
committed
#83 - don't register widgets if jetpack is not installed/activated (testimonials and portfolio)
#82 - changed loading files method #69 - changed pagination various bug fixes
1 parent ec85454 commit 95510e9

File tree

14 files changed

+2263
-2221
lines changed

14 files changed

+2263
-2221
lines changed

changelog.txt

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
### 1.0.6
2+
<a href="https://github.com/puikinsh/shapely/issues">Issues</a>
3+
4+
#83 - don't register widgets if jetpack is not installed/activated (testimonials and portfolio)
5+
#82 - changed loading files method
6+
#69 - changed pagination
7+
8+
### 1.0.5
9+
<a href="https://github.com/puikinsh/shapely/issues">Issues</a>
10+
11+
#62 - done
12+
#89 - in plugin
13+
#87 - removed from theme - ADDED TO COMPANION
14+
#86 - widgets are in the plugin
15+
#85 - sanitized the dropdown instead of escaping it
16+
#84 - found in the plugin
17+
#82 - widget files are found in the plugin, this is no longer an issue
18+
#81 - removed if condition in the social menu
19+
#80 - followed guide
20+
#79 - already fixed
21+
#78 - removed REM font size declaration, fixed
22+
#77 - figure had a margin left/right that was messing up the columns, changed it to padding . works
23+
#76 - added tags in single post
24+
#75 - seems to be fixed
25+
#74 - redone title section ( if yoast seo is not installed/breadcrumbs not used, title will have a 12 column size )
26+
#72 - removed custom css
27+
#71 - remooved from extras.php
28+
#67 - no longer relevant - widgets are in the companion plugin now
29+
#65 - moved to style.css
30+
#61 - prefixed
31+
#60 - made them translation ready
32+
#59 - removed sanitization
33+
#58 - added custom logo functionality
34+
#57 - moved them in the after theme setup hook
35+
#55 - removed one of the enqueues
36+
#54 - changed handler names
37+
#53 - license changed to gpl v3
38+
#52 - this should definitely be esc_html
39+
#51 - changed get_template_directory to get_stylesheet_directory (allowed to be overridden in child themes) - but i don`t think this is quite OK
40+
#50 - echo esc_html(). esc_attr is used inside html tags (value=<?php echo esc_attr() ?>, etc)
41+
#47 - design? or just throw it in there?
42+
#44 - no longer relevant
43+
#43 - no longer relevant ?
44+
#37 - fixed problems during activation
45+
#35 - no longer relevant, widgets moved to plugin
46+
#21 - added custom header image
47+
#25 - fixed

functions.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function shapely_setup() {
100100
global $shapely_required_actions, $shapely_recommended_plugins;
101101

102102
$shapely_recommended_plugins = array(
103-
'force-regenerate-thumbnails' => array( 'recommended' => true )
103+
'fancybox-for-wordpress' => array( 'recommended' => false )
104104
);
105105

106106
/*
@@ -113,14 +113,21 @@ function shapely_setup() {
113113
*/
114114
$shapely_required_actions = array(
115115
array(
116-
"id" => 'shapely-req-ac-install-wp-import-plugin',
116+
"id" => 'shapely-req-ac-install-companion-plugin',
117+
"title" => Shapely_Notify_System::shapely_companion_title(),
118+
"description" => Shapely_Notify_System::shapely_companion_description(),
119+
"check" => Shapely_Notify_System::shapely_has_plugin( 'shapely-companion' ),
120+
"plugin_slug" => 'shapely-companion'
121+
),
122+
array(
123+
"id" => 'shapely-req-ac-install-wp-jetpack-plugin',
117124
"title" => Shapely_Notify_System::shapely_jetpack_title(),
118125
"description" => Shapely_Notify_System::shapely_jetpack_description(),
119126
"check" => Shapely_Notify_System::shapely_has_plugin( 'jetpack' ),
120127
"plugin_slug" => 'jetpack'
121128
),
122129
array(
123-
"id" => 'shapely-req-ac-install-wp-import-widget-plugin',
130+
"id" => 'shapely-req-ac-install-wp-yoast-plugin',
124131
"title" => Shapely_Notify_System::shapely_yoast_title(),
125132
'description' => Shapely_Notify_System::shapely_yoast_description(),
126133
"check" => Shapely_Notify_System::shapely_has_plugin( 'wordpress-seo' ),
@@ -129,7 +136,7 @@ function shapely_setup() {
129136
array(
130137
"id" => 'shapely-req-import-content',
131138
"title" => esc_html__( 'Import content', 'shapely' ),
132-
"description" => esc_html__( 'Head over to the Demo Content tab and import sample content data.', 'shapely' ),
139+
"description" => esc_html__( 'Head over to the Demo Content tab (available only if you installed Shapely Companion plugin) and import sample content data.', 'shapely' ),
133140
"help" => '<a href="' . self_admin_url( 'themes.php?page=shapely-welcome&tab=demo_content' ) . '">' . __( 'Demo Content', 'shapely' ) . '</a>',
134141
"check" => Shapely_Notify_System::shapely_has_content(),
135142
),

inc/admin/welcome-screen/css/welcome.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* New Logo */
66
.wp-badge.epsilon-welcome-logo {
77
color: #fff;
8-
background-image: url(../img/macho-themes-logo.svg);
8+
background-image: url(../img/colorlib-logo-white2.png);
99
background-position: center center;
1010
background-size: 70%;
1111
background-repeat: no-repeat;

inc/admin/welcome-screen/css/welcome_customizer.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,3 @@
1212
border-radius: 10px;
1313
z-index: 26;
1414
}
15-
16-
.button.change-theme {
17-
display: none;
18-
}
5.48 KB
Loading

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

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ public static function shapely_is_not_static_page() {
2828
* @return bool
2929
*/
3030
public static function shapely_has_content() {
31-
return get_option( 'shapely-req-import-content', false );
31+
$option = get_option( "shapely_show_required_actions" );
32+
if ( $option['shapely-req-import-content'] ) {
33+
return true;
34+
};
35+
36+
return false;
3237
}
3338

3439
/**
@@ -88,6 +93,20 @@ public static function shapely_has_plugin( $slug = NULL ) {
8893
return true;
8994
}
9095

96+
public static function shapely_companion_title() {
97+
$installed = self::shapely_check_plugin_is_installed( 'shapely-companion' );
98+
if ( ! $installed ) {
99+
return __( 'Install: Shapely Companion Plugin', 'shapely' );
100+
}
101+
102+
$active = self::shapely_check_plugin_is_active( 'shapely-companion' );
103+
if ( $installed && ! $active ) {
104+
return __( 'Activate: Shapely Companion Plugin', 'shapely' );
105+
}
106+
107+
return __( 'Install: Shapely Companion Plugin', 'shapely' );
108+
}
109+
91110
public static function shapely_yoast_title() {
92111
$installed = self::shapely_check_plugin_is_installed( 'wordpress-seo' );
93112
if ( ! $installed ) {
@@ -116,22 +135,40 @@ public static function shapely_jetpack_title() {
116135
return __( 'Install: Jetpack by WordPress', 'shapely' );
117136
}
118137

138+
/**
139+
* @return string
140+
*/
141+
public static function shapely_companion_description() {
142+
$installed = self::shapely_check_plugin_is_installed( 'shapely-companion' );
143+
144+
if ( ! $installed ) {
145+
return __( 'Please install Shapely Companion plugin.', 'shapely' );
146+
}
147+
148+
$active = self::shapely_check_plugin_is_active( 'shapely-companion' );
149+
if ( $installed && ! $active ) {
150+
return __( 'Please activate Shapely Companion plugin.', 'shapely' );
151+
}
152+
153+
return __( 'Please install Shapely Companion plugin.', 'shapely' );
154+
}
155+
119156
/**
120157
* @return string
121158
*/
122159
public static function shapely_jetpack_description() {
123160
$installed = self::shapely_check_plugin_is_installed( 'jetpack' );
124161

125162
if ( ! $installed ) {
126-
return __( 'Please install Jetpack by WordPress.', 'shapely' );
163+
return __( 'Please install Jetpack by WordPress. Note that you won\'t be able to use the Testimonials and Portfolio widgets without it.', 'shapely' );
127164
}
128165

129166
$active = self::shapely_check_plugin_is_active( 'jetpack' );
130167
if ( $installed && ! $active ) {
131-
return __( 'Please activate Jetpack by WordPress.', 'shapely' );
168+
return __( 'Please activate Jetpack by WordPress. Note that you won\'t be able to use the Testimonials and Portfolio widgets without it.', 'shapely' );
132169
}
133170

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

137174
public static function shapely_yoast_description() {

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212

1313
<?php
1414
global $shapely_required_actions;
15-
1615
if ( ! empty( $shapely_required_actions ) ):
17-
18-
/* shapely_show_required_actions is an array of true/false for each required action that was dismissed */
1916
$shapely_show_required_actions = get_option( "shapely_show_required_actions" );
2017
$hooray = true;
2118

inc/admin/welcome-screen/sections/getting-started.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<p><?php esc_html_e( 'Even if you\'re a long-time WordPress user, we still believe you should give our documentation a very quick Read.', 'shapely' ) ?></p>
2626
<p>
2727
<a target="_blank"
28-
href="<?php echo esc_url( 'http://docs.machothemes.com/' ); ?>"><?php esc_html_e( 'Full documentation', 'shapely' ); ?></a>
28+
href="<?php echo esc_url( 'https://colorlib.com/wp/support/shapely/' ); ?>"><?php esc_html_e( 'Full documentation', 'shapely' ); ?></a>
2929
</p>
3030
</div><!--/.col-->
3131

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<i><?php esc_html_e( 'We offer excellent support through our advanced ticketing system. Make sure to register your purchase before contacting support!', 'shapely' ) ?></i>
77
</p>
88
<p><a target="_blank" class="button button-primary"
9-
href="<?php echo esc_url( 'https://www.machothemes.com/support/' ); ?>"><?php esc_html_e( 'Contact Support', 'shapely' ); ?></a>
9+
href="<?php echo esc_url( 'https://colorlib.com/wp/forums/' ); ?>"><?php esc_html_e( 'Contact Support', 'shapely' ); ?></a>
1010
</p>
1111
</div><!--/.col-->
1212

@@ -16,7 +16,7 @@
1616
<i><?php esc_html_e( 'This is the place to go to reference different aspects of the theme. Our online documentation is an incredible resource for learning the ins and outs of using shapely.', 'shapely' ) ?></i>
1717
</p>
1818
<p>
19-
<a target="_blank" href="<?php echo esc_url( 'http://docs.machothemes.com/' ); ?>"><?php esc_html_e( 'See our full documentation', 'shapely' ); ?></a>
19+
<a target="_blank" href="<?php echo esc_url( 'https://colorlib.com/wp/support/shapely/' ); ?>"><?php esc_html_e( 'See our full documentation', 'shapely' ); ?></a>
2020
</p>
2121
</div><!--/.col-->
2222

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

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -30,62 +30,6 @@ public function __construct() {
3030
$this,
3131
'shapely_dismiss_required_action_callback'
3232
) );
33-
34-
add_action( 'admin_init', array( $this, 'shapely_activate_plugin' ) );
35-
add_action( 'admin_init', array( $this, 'shapely_deactivate_plugin' ) );
36-
add_action( 'admin_init', array( $this, 'shapely_set_pages' ) );
37-
}
38-
39-
public function shapely_set_pages() {
40-
if ( ! empty( $_GET ) ) {
41-
/**
42-
* Check action
43-
*/
44-
if ( ! empty( $_GET['action'] ) && $_GET['action'] === 'set_page_automatic' ) {
45-
$active_tab = $_GET['tab'];
46-
$about = get_page_by_title( 'Homepage' );
47-
update_option( 'page_on_front', $about->ID );
48-
update_option( 'show_on_front', 'page' );
49-
50-
// Set the blog page
51-
$blog = get_page_by_title( 'Blog' );
52-
update_option( 'page_for_posts', $blog->ID );
53-
54-
wp_redirect( self_admin_url( 'themes.php?page=shapely-welcome&tab=' . $active_tab ) );
55-
}
56-
}
57-
}
58-
59-
60-
public function shapely_activate_plugin() {
61-
if ( ! empty( $_GET ) ) {
62-
/**
63-
* Check action
64-
*/
65-
if ( ! empty( $_GET['action'] ) && ! empty( $_GET['plugin'] ) && $_GET['action'] === 'activate_plugin' ) {
66-
$active_tab = $_GET['tab'];
67-
$url = self_admin_url( 'themes.php?page=shapely-welcome&tab=' . $active_tab );
68-
activate_plugin( $_GET['plugin'], $url );
69-
}
70-
}
71-
}
72-
73-
public function shapely_deactivate_plugin() {
74-
if ( ! empty( $_GET ) ) {
75-
/**
76-
* Check action
77-
*/
78-
if ( ! empty( $_GET['action'] ) && ! empty( $_GET['plugin'] ) && $_GET['action'] === 'deactivate_plugin' ) {
79-
$active_tab = $_GET['tab'];
80-
$url = self_admin_url( 'themes.php?page=shapely-welcome&tab=' . $active_tab );
81-
$current = get_option( 'active_plugins', array() );
82-
$search = array_search( $_GET['plugin'], $current );
83-
if ( array_key_exists( $search, $current ) ) {
84-
unset( $current[ $search ] );
85-
}
86-
update_option( 'active_plugins', $current );
87-
}
88-
}
8933
}
9034

9135
/**
@@ -374,10 +318,10 @@ public function shapely_welcome_screen() {
374318

375319
<div class="wrap about-wrap epsilon-wrap">
376320

377-
<h1><?php echo __( 'Welcome to shapely! - Version ', 'shapely' ) . $shapely['Version']; ?></h1>
321+
<h1><?php echo __( 'Welcome to Shapely! - Version ', 'shapely' ) . $shapely['Version']; ?></h1>
378322

379323
<div
380-
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>
324+
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>
381325

382326
<div class="wp-badge epsilon-welcome-logo"></div>
383327

@@ -390,7 +334,8 @@ class="nav-tab <?php echo $active_tab == 'recommended_actions' ? 'nav-tab-active
390334
<?php echo $action_count > 0 ? '<span class="badge-action-count">' . esc_html( $action_count ) . '</span>' : '' ?></a>
391335
<a href="<?php echo admin_url( 'themes.php?page=shapely-welcome&tab=recommended_plugins' ); ?>"
392336
class="nav-tab <?php echo $active_tab == 'recommended_plugins' ? 'nav-tab-active' : ''; ?> "><?php echo esc_html__( 'Recommended Plugins', 'shapely' ); ?></a>
393-
<?php if ( $this->check_active( 'shapely-companion' ) ): ?>
337+
<?php $shapely_companion = $this->check_active( 'shapely-companion' ); ?>
338+
<?php if ( $shapely_companion['needs'] === 'deactivate' ): ?>
394339
<a href="<?php echo admin_url( 'themes.php?page=shapely-welcome&tab=demo_content' ); ?>"
395340
class="nav-tab <?php echo $active_tab == 'demo_content' ? 'nav-tab-active' : ''; ?> "><?php echo esc_html__( 'Demo Content', 'shapely' ); ?></a>
396341
<?php endif; ?>
@@ -418,8 +363,9 @@ class="nav-tab <?php echo $active_tab == 'changelog' ? 'nav-tab-active' : ''; ?>
418363
require_once get_template_directory() . '/inc/admin/welcome-screen/sections/changelog.php';
419364
break;
420365
case 'demo_content':
421-
if ( $this->check_active( 'shapely-companion' ) ) {
422-
require_once ABSPATH . 'wp-content/plugins/shapely-companion/shapely-demo-content.php';
366+
$shapely_companion = $this->check_active( 'shapely-companion' );
367+
if ( $shapely_companion['needs'] === 'deactivate' ) {
368+
require_once ABSPATH . 'wp-content/plugins/shapely-companion/inc/views/shapely-demo-content.php';
423369
}
424370
break;
425371
default:

0 commit comments

Comments
 (0)