| 1 |
<?php |
| 2 |
|
| 3 |
class Redux_Full_Package implements themecheck { |
| 4 |
protected $error = array(); |
| 5 |
|
| 6 |
function check( $php_files, $css_files, $other_files ) { |
| 7 |
|
| 8 |
$ret = true; |
| 9 |
|
| 10 |
$check = Redux_ThemeCheck::get_instance(); |
| 11 |
$redux = $check::get_redux_details( $php_files ); |
| 12 |
|
| 13 |
if ( $redux ) { |
| 14 |
|
| 15 |
$blacklist = array( |
| 16 |
'.tx' => __( 'Redux localization utilities', 'themecheck' ), |
| 17 |
'bin' => __( 'Redux Resting Diles', 'themecheck' ), |
| 18 |
'codestyles' => __( 'Redux Code Styles', 'themecheck' ), |
| 19 |
'tests' => __( 'Redux Unit Testing', 'themecheck' ), |
| 20 |
'class.redux-plugin.php' => __( 'Redux Plugin File', 'themecheck' ), |
| 21 |
'bootstrap_tests.php' => __( 'Redux Boostrap Tests', 'themecheck' ), |
| 22 |
'.travis.yml' => __( 'CI Testing FIle', 'themecheck' ), |
| 23 |
'phpunit.xml' => __( 'PHP Unit Testing', 'themecheck' ), |
| 24 |
); |
| 25 |
|
| 26 |
$errors = array(); |
| 27 |
|
| 28 |
foreach ( $blacklist as $file => $reason ) { |
| 29 |
checkcount(); |
| 30 |
if ( file_exists( $redux['parent_dir'] . $file ) ) { |
| 31 |
$errors[ $redux['parent_dir'] . $file ] = $reason; |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
if ( ! empty( $errors ) ) { |
| 36 |
$error = '<span class="tc-lead tc-required">REQUIRED</span> ' . __( 'It appears that you have embedded the full Redux package inside your theme. You need only embed the <strong>ReduxCore</strong> folder. Embedding anything else will get your rejected from theme submission. Suspected Redux package file(s):', 'redux-framework' ); |
| 37 |
$error .= '<ol>'; |
| 38 |
foreach ( $errors as $key => $e ) { |
| 39 |
$error .= '<li><strong>' . $e . '</strong>: ' . $key . '</li>'; |
| 40 |
} |
| 41 |
$error .= '</ol>'; |
| 42 |
$this->error[] = '<div class="redux-error">' . $error . '</div>'; |
| 43 |
$ret = false; |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
return $ret; |
| 48 |
} |
| 49 |
|
| 50 |
function getError() { |
| 51 |
return $this->error; |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
$themechecks = array(); |
| 56 |
|
| 57 |
$themechecks[] = new Redux_Full_Package(); |