| 1 |
<?php |
| 2 |
|
| 3 |
class Redux_Embedded implements themecheck { |
| 4 |
protected $error = array(); |
| 5 |
|
| 6 |
function check( $php_files, $css_files, $other_files ) { |
| 7 |
|
| 8 |
$ret = true; |
| 9 |
$check = Redux_ThemeCheck::get_instance(); |
| 10 |
$redux = $check::get_redux_details( $php_files ); |
| 11 |
|
| 12 |
if ( $redux ) { |
| 13 |
if ( ! isset( $_POST['redux_wporg'] ) ) { |
| 14 |
checkcount(); |
| 15 |
$this->error[] = '<div class="redux-error">' . sprintf( __( '<span class="tc-lead tc-recommended">RECOMMENDED</span>: If you are submitting to WordPress.org Theme Repository, it is <strong>strongly</strong> suggested that you read <a href="%s" target="_blank">this document</a>, or your theme will be rejected because of Redux.', 'redux-framework' ), 'https://docs.reduxframework.com/core/wordpress-org-submissions/' ) . '</div>'; |
| 16 |
$ret = false; |
| 17 |
} else { |
| 18 |
// TODO Granular WP.org tests!!! |
| 19 |
|
| 20 |
// Check for Tracking |
| 21 |
checkcount(); |
| 22 |
$tracking = $redux['dir'] . 'inc/tracking.php'; |
| 23 |
if ( file_exists( $tracking ) ) { |
| 24 |
$this->error[] = '<div class="redux-error">' . sprintf( __('<span class="tc-lead tc-required">REQUIRED</span>: You MUST delete <strong> %s </strong>, or your theme will be rejected by WP.org theme submission because of Redux.', 'redux-framework'), $tracking ) . '</div>'; |
| 25 |
$ret = false; |
| 26 |
} |
| 27 |
|
| 28 |
|
| 29 |
// Embedded CDN package |
| 30 |
//use_cdn |
| 31 |
|
| 32 |
// Arguments |
| 33 |
checkcount(); |
| 34 |
$args = '<ol>'; |
| 35 |
$args .= "<li><code>'save_defaults' => false</code></li>"; |
| 36 |
$args .= "<li><code>'use_cdn' => false</code></li>"; |
| 37 |
$args .= "<li><code>'customizer_only' => true</code> Non-Customizer Based Panels are Prohibited within WP.org Themes</li>"; |
| 38 |
$args .= "<li><code>'database' => 'theme_mods'</code> (" . __( 'Optional', 'redux-framework' ) . ")</li>"; |
| 39 |
$args .= '</ol>'; |
| 40 |
$this->error[] = '<div class="redux-error">' . __( '<span class="tc-lead tc-recommended">RECOMMENDED</span>: The following arguments MUST be used for WP.org submissions, or you will be rejected because of your Redux configuration.', 'redux-framework' ) . $args . '</div>'; |
| 41 |
|
| 42 |
|
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
} |
| 47 |
|
| 48 |
|
| 49 |
return $ret; |
| 50 |
} |
| 51 |
|
| 52 |
|
| 53 |
function getError() { |
| 54 |
return $this->error; |
| 55 |
} |
| 56 |
} |
| 57 |
|
| 58 |
$themechecks = array(); |
| 59 |
|
| 60 |
$themechecks[] = new Redux_Embedded; |