Custom Login Page Customizer - Version 1.1.0

Version Description

Download this release

Release Info

Developer codeinwp
Plugin Icon 128x128 Custom Login Page Customizer
Version 1.1.0
Comparing to
See all releases

Code changes from version 1.0.8 to 1.1.0

CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
 
 
 
 
2
- Added dashboard widget
3
 
4
 
5
 
6
- Removed notification script
1
 
2
+
3
+
4
+
5
+
6
 
7
 
8
 
 
dashboard/dashboard.php ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+ if ( ! class_exists( 'THEMEISLE_DASHBOARD' ) ) {
6
+ /**
7
+ * Dashboard Widget
8
+ */
9
+ final class THEMEISLE_DASHBOARD {
10
+
11
+ /**
12
+ * The script version
13
+ *
14
+ * @var string Script version
15
+ */
16
+ public $script_version = '1.0.0';
17
+ /**
18
+ * The script url
19
+ *
20
+ * @var string The URL of the script
21
+ */
22
+ public $script_url;
23
+
24
+ /**
25
+ * The class instance
26
+ *
27
+ * @var THEMEISLE_DASHBOARD The singleton instance of the class
28
+ */
29
+ public static $instance;
30
+
31
+ /**
32
+ * The title of the widget
33
+ *
34
+ * @var string The dashboard widget title
35
+ */
36
+ public $dashboard_name;
37
+ /**
38
+ * Array that holds the urls of the blog feeds
39
+ *
40
+ * @var array Feeds to fetch news from
41
+ */
42
+ public $feeds;
43
+ /**
44
+ * The feed items array
45
+ *
46
+ * @var array The feeds items
47
+ */
48
+ public $items;
49
+
50
+ /**
51
+ * The instance of the class
52
+ *
53
+ * @var THEMEISLE_DASHBOARD The singleton instance
54
+ */
55
+ public static function instance() {
56
+ if ( ! isset( self::$instance ) && ! ( self::$instance instanceof THEMEISLE_DASHBOARD ) ) {
57
+ self::$instance = new THEMEISLE_DASHBOARD;
58
+ self::$instance->setup_vars();
59
+ self::$instance->load_hooks();
60
+ }
61
+
62
+ return self::$instance;
63
+ }
64
+
65
+ /**
66
+ * Load hooks to show the widget
67
+ */
68
+ public function load_hooks() {
69
+ add_action( 'wp_dashboard_setup', array( &$this, 'add_widget' ) );
70
+ add_action( 'wp_network_dashboard_setup', array( &$this, 'add_widget' ) );
71
+ }
72
+
73
+ /**
74
+ * Setup class variables
75
+ */
76
+ public function setup_vars() {
77
+ $this->dashboard_name = apply_filters( 'themeisle_sdk_dashboard_widget_name', 'WordPress Guides/Tutorials' );
78
+ $this->feeds = apply_filters( 'themeisle_sdk_dashboard_widget_feeds', array(
79
+ 'https://themeisle.com/blog/feed'
80
+ ) );
81
+ $abs = untrailingslashit( ( dirname( __FILE__ ) ) );
82
+ $parts = str_replace( untrailingslashit( ABSPATH ), '', $abs );
83
+ $parts = explode( DIRECTORY_SEPARATOR, $parts );
84
+ $parts = array_filter( $parts );
85
+ $this->script_url = site_url() . '/' . implode( '/', $parts );
86
+ }
87
+
88
+ /**
89
+ * Add widget to the dashboard
90
+ *
91
+ * @return string|void
92
+ */
93
+ function add_widget() {
94
+ global $wp_meta_boxes;
95
+ if ( isset( $wp_meta_boxes['dashboard']['normal']['core']['themeisle'] ) ) {
96
+ return;
97
+ }
98
+ // Load SimplePie Instance
99
+ $feed = fetch_feed( $this->feeds );
100
+ // TODO report error when is an error loading the feed
101
+ if ( is_wp_error( $feed ) ) {
102
+ return '';
103
+ }
104
+ $feed->enable_cache( true );
105
+ $feed->enable_order_by_date( true );
106
+ $feed->set_cache_class( 'WP_Feed_Cache' );
107
+ $feed->set_file_class( 'WP_SimplePie_File' );
108
+ $feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 7200, $this->feeds ) );
109
+ do_action_ref_array( 'wp_feed_options', array( $feed, $this->feeds ) );
110
+ $feed->strip_comments( true );
111
+ $feed->strip_htmltags( array(
112
+ 'base',
113
+ 'blink',
114
+ 'body',
115
+ 'doctype',
116
+ 'embed',
117
+ 'font',
118
+ 'form',
119
+ 'frame',
120
+ 'frameset',
121
+ 'html',
122
+ 'iframe',
123
+ 'input',
124
+ 'marquee',
125
+ 'meta',
126
+ 'noscript',
127
+ 'object',
128
+ 'param',
129
+ 'script',
130
+ 'style',
131
+ ) );
132
+ $feed->init();
133
+ $feed->handle_content_type();
134
+ $items = $feed->get_items( 0, 5 );
135
+ foreach ( (array) $items as $item ) {
136
+ $this->items[] = array(
137
+ 'title' => $item->get_title(),
138
+ 'date' => $item->get_date( 'U' ),
139
+ 'link' => $item->get_permalink(),
140
+ );
141
+ }
142
+ wp_add_dashboard_widget( 'themeisle', $this->dashboard_name, array(
143
+ &$this,
144
+ 'render_dashboard_widget',
145
+ ) );
146
+ }
147
+
148
+ /**
149
+ * Render widget content
150
+ */
151
+ function render_dashboard_widget() {
152
+ ?>
153
+ <style type="text/css">
154
+ #themeisle h2.hndle {
155
+ background-image: url(<?php echo $this->script_url; ?>/logo.png);
156
+ background-repeat: no-repeat;
157
+ background-position: 90% 50%;
158
+ background-size: 29px;
159
+ }
160
+
161
+ .ti-dw-feed-item {
162
+ display: flex;
163
+ align-items: center;
164
+ }
165
+
166
+ .ti-dw-feed-item a {
167
+ float: left;
168
+ width: 89.9%;
169
+ }
170
+
171
+ .ti-dw-feed-item .ti-dw-day-container {
172
+ width: 100%;
173
+ letter-spacing: 3px;
174
+ display: block;
175
+ }
176
+
177
+ .ti-dw-feed-item .ti-dw-month-container {
178
+
179
+ width: 100%;
180
+ display: block;
181
+ font-weight: 600;
182
+ padding: 0px;
183
+ margin-top: -6px;
184
+ text-transform: uppercase;
185
+ font-size: 10px;
186
+ letter-spacing: 1px;
187
+ }
188
+
189
+ .ti-dw-feed-item .ti-dw-date-container {
190
+ float: left;
191
+ min-height: 30px;
192
+ margin-right: 0.1%;
193
+ width: 10%;
194
+ text-align: center;
195
+ }
196
+
197
+ </style>
198
+ <ul>
199
+ <?php
200
+ foreach ( $this->items as $item ) {
201
+ ?>
202
+ <li class="ti-dw-feed-item"><span class="ti-dw-date-container"><span
203
+ class="ti-dw-day-container"><?php echo date( 'd', $item['date'] ); ?></span> <span
204
+ class="ti-dw-month-container"><?php echo substr( date( 'M', $item['date'] ), 0, 3 ); ?></span></span><a
205
+ href="<?php echo add_query_arg(
206
+ array(
207
+ 'utm_campaign' => 'feed',
208
+ 'utm_medium' => 'dashboard_widget',
209
+ ), $item['link'] ); ?>" target="_blank"><?php echo $item['title']; ?></a>
210
+ <div class="clear"></div>
211
+ </li>
212
+ <?php
213
+ }
214
+ ?>
215
+ </ul>
216
+
217
+ <?php
218
+
219
+ }
220
+ }
221
+
222
+ }
223
+
224
+ if (!function_exists('themeisle_dashboard_widget')) {
225
+ /**
226
+ * The helper method to run the class
227
+ *
228
+ * @return THEMEISLE_DASHBOARD
229
+ */
230
+ function themeisle_dashboard_widget() {
231
+ return THEMEISLE_DASHBOARD::instance();
232
+ }
233
+ }
234
+
235
+ themeisle_dashboard_widget();
dashboard/logo.png ADDED
Binary file
login-customizer.php CHANGED
@@ -13,10 +13,10 @@
13
  * Description: Custom Login Customizer plugin allows you to easily customize your login page straight from your WordPress Customizer! Awesome, right?
14
  * Author: Hardeep Asrani
15
  * Author URI: https://themeisle.com/
16
- * Version: 1.0.8
17
  */
18
 
19
- define( 'LOGINCUST_VERSION','1.0.7' );
20
  define( 'LOGINCUST_FREE_PATH', plugin_dir_path( __FILE__ ) );
21
  define( 'LOGINCUST_FREE_URL', plugin_dir_url( __FILE__ ) );
22
  if ( ! defined( 'LOGINCUST_TEXTDOMAIN' ) ) {
@@ -38,3 +38,5 @@ function logincust_check_security() {
38
 
39
  include( LOGINCUST_FREE_PATH . 'customizer.php' );
40
  include( LOGINCUST_FREE_PATH . 'option-panel.php' );
 
 
13
  * Description: Custom Login Customizer plugin allows you to easily customize your login page straight from your WordPress Customizer! Awesome, right?
14
  * Author: Hardeep Asrani
15
  * Author URI: https://themeisle.com/
16
+ * Version: 1.1.0
17
  */
18
 
19
+ define( 'LOGINCUST_VERSION','1.1.0' );
20
  define( 'LOGINCUST_FREE_PATH', plugin_dir_path( __FILE__ ) );
21
  define( 'LOGINCUST_FREE_URL', plugin_dir_url( __FILE__ ) );
22
  if ( ! defined( 'LOGINCUST_TEXTDOMAIN' ) ) {
38
 
39
  include( LOGINCUST_FREE_PATH . 'customizer.php' );
40
  include( LOGINCUST_FREE_PATH . 'option-panel.php' );
41
+
42
+ require dirname( __FILE__ ) . '/dashboard/dashboard.php';
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === Custom Login Page Customizer ===
2
- Version: 1.0.8
3
  Requires at least: 4.0
4
- Tested up to: 4.6.1
5
  Contributors: codeinwp, hardeepasrani,marius_codeinwp
6
  Author URI: https://themeisle.com
7
  Tags: login, customizer, logo, login logo, login customizer, login page,admin, branding, customization, custom login, error, login error, custom login pro
1
  === Custom Login Page Customizer ===
2
+ Version: 1.1.0
3
  Requires at least: 4.0
4
+ Tested up to: 4.7.1
5
  Contributors: codeinwp, hardeepasrani,marius_codeinwp
6
  Author URI: https://themeisle.com
7
  Tags: login, customizer, logo, login logo, login customizer, login page,admin, branding, customization, custom login, error, login error, custom login pro