Skip to content

Commit 477456b

Browse files
committed
v1.2.4.1 - fix php notice
#9
1 parent d4ebef1 commit 477456b

File tree

3 files changed

+47
-29
lines changed

3 files changed

+47
-29
lines changed

genesis-widget-column-classes.php

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
* @author Jory Hogeveen <[email protected]>
44
* @package Genesis_Widget_Column_Classes
55
* @since 0.1.0
6-
* @version 1.2.4
6+
* @version 1.2.4.1
77
* @licence GPL-2.0+
88
* @link https://github.com/JoryHogeveen/genesis-widget-column-classes
99
*
1010
* @wordpress-plugin
1111
* Plugin Name: Genesis Widget Column Classes
1212
* Plugin URI: https://wordpress.org/plugins/genesis-widget-column-classes/
1313
* Description: Add Genesis (old Bootstrap) column classes to widgets
14-
* Version: 1.2.4
14+
* Version: 1.2.4.1
1515
* Author: Jory Hogeveen
1616
* Author URI: http://www.keraweb.nl
1717
* Text Domain: genesis-widget-column-classes
@@ -50,7 +50,7 @@
5050
* @author Jory Hogeveen <[email protected]>
5151
* @package Genesis_Widget_Column_Classes
5252
* @since 0.1.0
53-
* @version 1.2.4
53+
* @version 1.2.4.1
5454
*/
5555
final class WCC_Genesis_Widget_Column_Classes
5656
{
@@ -70,13 +70,21 @@ final class WCC_Genesis_Widget_Column_Classes
7070
*/
7171
public static $_basename = '';
7272

73+
/**
74+
* The plugin i18n domain.
75+
*
76+
* @since 1.2.4.1
77+
* @var string
78+
*/
79+
public static $_domain = 'genesis-widget-column-classes';
80+
7381
/**
7482
* Plugin version.
7583
*
7684
* @since 1.1.0
7785
* @var string
7886
*/
79-
private $version = '1.2.4';
87+
private $version = '1.2.4.1';
8088

8189
/**
8290
* User ignore nag key.
@@ -258,10 +266,10 @@ public function filter_widget_form_extend( $instance, $widget ) {
258266
}
259267

260268
$row = '<p style="border: 1px solid #eee; padding: 5px 10px; background: #f5f5f5;">';
261-
$row .= '<label for="' . $widget->get_field_id( 'column-classes' ) . '">' . __( 'Width', 'genesis-widget-column-classes' ) . ': &nbsp;</label>';
269+
$row .= '<label for="' . $widget->get_field_id( 'column-classes' ) . '">' . __( 'Width', self::$_domain ) . ': &nbsp;</label>';
262270
$row .= '<select name="' . $widget->get_field_name( 'column-classes' ) . '" id="' . $widget->get_field_id( 'column-classes' ) . '">';
263271

264-
$row .= '<option value="">- ' . __( 'none', 'genesis-widget-column-classes' ) . ' -</option>';
272+
$row .= '<option value="">- ' . __( 'none', self::$_domain ) . ' -</option>';
265273

266274
foreach ( $this->get_column_classes() as $class_name ) {
267275
if ( ! empty( $class_name ) ) {
@@ -271,7 +279,7 @@ public function filter_widget_form_extend( $instance, $widget ) {
271279
}
272280

273281
$row .= '</select> &nbsp; ';
274-
$row .= '<label for="' . $widget->get_field_id( 'column-classes-first' ) . '">' . __( 'First', 'genesis-widget-column-classes' ) . ': &nbsp;</label>';
282+
$row .= '<label for="' . $widget->get_field_id( 'column-classes-first' ) . '">' . __( 'First', self::$_domain ) . ': &nbsp;</label>';
275283
$row .= '<input type="checkbox" value="1" name="' . $widget->get_field_name( 'column-classes-first' ) . '" id="' . $widget->get_field_id( 'column-classes-first' ) . '" ' . checked( $instance['column-classes-first'], 1, false ) . '>';
276284
$row .= '</p>';
277285

@@ -557,56 +565,56 @@ public function get_links() {
557565

558566
$links = array(
559567
'support' => array(
560-
'title' => __( 'Support', OCS_DOMAIN ),
561-
'description' => __( 'Need support?', OCS_DOMAIN ),
568+
'title' => __( 'Support', self::$_domain ),
569+
'description' => __( 'Need support?', self::$_domain ),
562570
'icon' => 'dashicons-sos',
563571
'url' => 'https://wordpress.org/support/plugin/genesis-widget-column-classes/',
564572
),
565573
'slack' => array(
566-
'title' => __( 'Slack', OCS_DOMAIN ),
567-
'description' => __( 'Quick help via Slack', OCS_DOMAIN ),
574+
'title' => __( 'Slack', self::$_domain ),
575+
'description' => __( 'Quick help via Slack', self::$_domain ),
568576
'icon' => 'dashicons-format-chat',
569577
'url' => 'https://keraweb.slack.com/messages/plugin-gwcc/',
570578
),
571579
'review' => array(
572-
'title' => __( 'Review', OCS_DOMAIN ),
573-
'description' => __( 'Give 5 stars on WordPress.org!', OCS_DOMAIN ),
580+
'title' => __( 'Review', self::$_domain ),
581+
'description' => __( 'Give 5 stars on WordPress.org!', self::$_domain ),
574582
'icon' => 'dashicons-star-filled',
575583
'url' => 'https://wordpress.org/support/plugin/genesis-widget-column-classes/reviews/',
576584
),
577585
'translate' => array(
578-
'title' => __( 'Translate', OCS_DOMAIN ),
579-
'description' => __( 'Help translating this plugin!', OCS_DOMAIN ),
586+
'title' => __( 'Translate', self::$_domain ),
587+
'description' => __( 'Help translating this plugin!', self::$_domain ),
580588
'icon' => 'dashicons-translation',
581589
'url' => 'https://translate.wordpress.org/projects/wp-plugins/genesis-widget-column-classes',
582590
),
583591
'issue' => array(
584-
'title' => __( 'Report issue', OCS_DOMAIN ),
585-
'description' => __( 'Have ideas or a bug report?', OCS_DOMAIN ),
592+
'title' => __( 'Report issue', self::$_domain ),
593+
'description' => __( 'Have ideas or a bug report?', self::$_domain ),
586594
'icon' => 'dashicons-lightbulb',
587595
'url' => 'https://github.com/JoryHogeveen/genesis-widget-column-classes/issues',
588596
),
589597
'docs' => array(
590-
'title' => __( 'Documentation', OCS_DOMAIN ),
591-
'description' => __( 'Documentation', OCS_DOMAIN ),
598+
'title' => __( 'Documentation', self::$_domain ),
599+
'description' => __( 'Documentation', self::$_domain ),
592600
'icon' => 'dashicons-book-alt',
593601
'url' => 'https://github.com/JoryHogeveen/genesis-widget-column-classes/', //wiki
594602
),
595603
'github' => array(
596-
'title' => __( 'GitHub', OCS_DOMAIN ),
597-
'description' => __( 'Follow and/or contribute on GitHub', OCS_DOMAIN ),
604+
'title' => __( 'GitHub', self::$_domain ),
605+
'description' => __( 'Follow and/or contribute on GitHub', self::$_domain ),
598606
'icon' => 'dashicons-editor-code',
599607
'url' => 'https://github.com/JoryHogeveen/genesis-widget-column-classes/tree/dev',
600608
),
601609
'donate' => array(
602-
'title' => __( 'Donate', OCS_DOMAIN ),
603-
'description' => __( 'Buy me a coffee!', OCS_DOMAIN ),
610+
'title' => __( 'Donate', self::$_domain ),
611+
'description' => __( 'Buy me a coffee!', self::$_domain ),
604612
'icon' => 'dashicons-smiley',
605613
'url' => 'https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=YGPLMLU7XQ9E8&lc=NL&item_name=Genesis%20Widget%20Column%20Classes&item_number=JWPP%2dGWCC&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted',
606614
),
607615
'plugins' => array(
608-
'title' => __( 'Plugins', OCS_DOMAIN ),
609-
'description' => __( 'Check out my other WordPress plugins', OCS_DOMAIN ),
616+
'title' => __( 'Plugins', self::$_domain ),
617+
'description' => __( 'Check out my other WordPress plugins', self::$_domain ),
610618
'icon' => 'dashicons-admin-plugins',
611619
'url' => 'https://profiles.wordpress.org/keraweb/#content-plugins',
612620
),
@@ -623,7 +631,7 @@ public function get_links() {
623631
* @return void
624632
*/
625633
public function action_load_textdomain() {
626-
load_plugin_textdomain( 'genesis-widget-column-classes', false, basename( dirname( __FILE__ ) ) . '/languages/' );
634+
load_plugin_textdomain( self::$_domain, false, basename( dirname( __FILE__ ) ) . '/languages/' );
627635
}
628636

629637
/**
@@ -647,7 +655,7 @@ public function __toString() {
647655
public function __clone() {
648656
_doing_it_wrong(
649657
__FUNCTION__,
650-
esc_html( get_class( $this ) . ': ' . __( 'This class does not want to be cloned', 'genesis-widget-column-classes' ) ),
658+
esc_html( get_class( $this ) . ': ' . __( 'This class does not want to be cloned', self::$_domain ) ),
651659
null
652660
);
653661
}
@@ -662,7 +670,7 @@ public function __clone() {
662670
public function __wakeup() {
663671
_doing_it_wrong(
664672
__FUNCTION__,
665-
esc_html( get_class( $this ) . ': ' . __( 'This class does not want to wake up', 'genesis-widget-column-classes' ) ),
673+
esc_html( get_class( $this ) . ': ' . __( 'This class does not want to wake up', self::$_domain ) ),
666674
null
667675
);
668676
}
@@ -679,7 +687,7 @@ public function __wakeup() {
679687
public function __call( $method = '', $args = array() ) {
680688
_doing_it_wrong(
681689
esc_html( get_class( $this ) . "::{$method}" ),
682-
esc_html__( 'Method does not exist.', 'genesis-widget-column-classes' ),
690+
esc_html__( 'Method does not exist.', self::$_domain ),
683691
null
684692
);
685693
unset( $method, $args );

readme.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ Or search for "Genesis Widget Column Classes" via your plugins menu.
4747

4848
== Changelog ==
4949

50+
= 1.2.4.1 =
51+
52+
* **Fix:** PHP notice. [#9](https://github.com/JoryHogeveen/genesis-widget-column-classes/issues/9)
53+
5054
= 1.2.4 =
5155

5256
* **Enhancement:** UI improvement.

tests/test-plugin.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ function test_plugin_activated() {
1313
$this->assertTrue( is_plugin_active( TEST_GWCC_PLUGIN_PATH ) );
1414
}
1515

16+
// Check for PHP errors
17+
function test_general() {
18+
$gwcc = genesis_widget_column_classes();
19+
$gwcc->get_links();
20+
}
21+
1622
// Check append_to_attribute() method
1723
function test_append_to_attribute() {
1824
$gwcc = genesis_widget_column_classes();

0 commit comments

Comments
 (0)