Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

Commit 599f1f5

Browse files
committed
#158 - Redux theme checks no longer prevent theme check plugin from functioning.
Signed-off-by: Kevin Provance <kevin.provance@gmail.com>
1 parent a4a86d4 commit 599f1f5

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

redux-core/inc/themecheck/checks/class-redux-embedded.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,32 @@ class Redux_Embedded implements themecheck {
1919
*
2020
* @var array
2121
*/
22-
protected $error = array();
22+
protected array $error = array();
2323

2424
/**
2525
* Run checker.
2626
*
27-
* @param array $php_files Files to check.
28-
* @param array $css_files Files to check.
29-
* @param array $other_files Files to check.
27+
* @param array $php_files - Files to check.
28+
* @param array $css_files - Files to check.
29+
* @param array $other_files - Files to check.
3030
*
3131
* @return bool
3232
*/
33-
public function check( $php_files, $css_files, $other_files ) {
33+
public function check( $php_files, $css_files, $other_files ): bool {
3434

3535
$ret = true;
3636
$check = Redux_ThemeCheck::get_instance();
3737
$redux = $check::get_redux_details( $php_files );
3838

3939
if ( $redux ) {
40+
checkcount();
41+
4042
if ( ! isset( $_POST['redux_wporg'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
41-
checkcount();
4243
$this->error[] = '<div class="redux-error">' . sprintf( '<span class="tc-lead tc-recommended">' . esc_html__( 'RECOMMENDED', 'redux-framework' ) . '</span>: ' . esc_html__( 'If you are submitting to WordPress.org Theme Repository, it is', 'redux-framework' ) . ' <strong>' . esc_html__( 'strongly', 'redux-framework' ) . '</strong> ' . esc_html__( 'suggested that you read', 'redux-framework' ) . ' <a href="%s" target="_blank">' . esc_html__( 'this document', 'redux-framework' ) . '</a>, ' . esc_html__( 'or your theme will be rejected because of Redux.', 'redux-framework' ), 'https://docsv3.redux.io/core/wordpress-org-submissions/' ) . '</div>';
4344
$ret = false;
4445
} else {
4546
// TODO Granular WP.org tests!!!
4647
// Check for Tracking.
47-
checkcount();
4848
$tracking = $redux['dir'] . 'inc/tracking.php';
4949
if ( file_exists( $tracking ) ) {
5050
$this->error[] = '<div class="redux-error">' . sprintf( '<span class="tc-lead tc-required">' . esc_html__( 'REQUIRED', 'redux-framework' ) . '</span>: ' . esc_html__( 'You MUST delete', 'redux-framework' ) . ' <strong> %s </strong>, ' . esc_html__( 'or your theme will be rejected by WP.org theme submission because of Redux.', 'redux-framework' ), $tracking ) . '</div>';
@@ -54,7 +54,6 @@ public function check( $php_files, $css_files, $other_files ) {
5454
// Embedded CDN package
5555
// use_cdn
5656
// Arguments.
57-
checkcount();
5857
$args = '<ol>';
5958
$args .= "<li><code>'save_defaults' => false</code></li>";
6059
$args .= "<li><code>'use_cdn' => false</code></li>";
@@ -73,7 +72,7 @@ public function check( $php_files, $css_files, $other_files ) {
7372
*
7473
* @return array
7574
*/
76-
public function getError() {
75+
public function getError(): array {
7776
return $this->error;
7877
}
7978

redux-core/inc/themecheck/checks/class-redux-full-package.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class Redux_Full_Package implements themecheck {
3131
* @return bool
3232
*/
3333
public function check( $php_files, $css_files, $other_files ) {
34+
3435
$ret = true;
3536

3637
$check = Redux_ThemeCheck::get_instance();
@@ -85,6 +86,4 @@ public function getError() {
8586
}
8687
}
8788

88-
$themechecks = array();
89-
9089
$themechecks[] = new Redux_Full_Package();

redux-core/inc/themecheck/class-redux-themecheck.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Redux_ThemeCheck {
2323
* @since 1.0.0
2424
* @var string
2525
*/
26-
protected $version = '1.0.0';
26+
protected string $version = '1.0.0';
2727

2828
/**
2929
* Instance of this class.
@@ -113,10 +113,10 @@ public static function get_redux_instance() {
113113
*
114114
* @param array $php_files Array of files to check.
115115
*
116-
* @since 1.0.0
117116
* @return object A single instance of this class.
117+
*@since 1.0.0
118118
*/
119-
public static function get_redux_details( $php_files = array() ) {
119+
public static function get_redux_details( array $php_files = array() ) {
120120
if ( null === self::$redux_details ) {
121121
foreach ( $php_files as $php_key => $phpfile ) {
122122

@@ -215,8 +215,7 @@ public function enqueue_admin_scripts() {
215215

216216
if ( ! isset( $_POST['themename'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
217217

218-
$intro = '';
219-
$intro .= '<h2>Redux Theme-Check</h2>';
218+
$intro = '<h2>Redux Theme-Check</h2>';
220219
$intro .= '<p>Extra checks for Redux to ensure you\'re ready for marketplace submission to marketplaces.</p>';
221220

222221
$redux_check_intro['text'] = $intro;

0 commit comments

Comments
 (0)