Example #1
0
 function check($php_files, $css_files, $other_files)
 {
     $ret = true;
     $check = AvadaRedux_ThemeCheck::get_instance();
     $avadaredux = $check::get_avadaredux_details($php_files);
     if ($avadaredux) {
         if (!isset($_POST['avadaredux_wporg'])) {
             checkcount();
             $this->error[] = '<div class="avadaredux-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 AvadaRedux.', 'avadaredux-framework'), 'https://docs.avadareduxframework.com/core/wordpress-org-submissions/') . '</div>';
             $ret = false;
         } else {
             // TODO Granular WP.org tests!!!
             // Check for Tracking
             checkcount();
             $tracking = $avadaredux['dir'] . 'inc/tracking.php';
             if (file_exists($tracking)) {
                 $this->error[] = '<div class="avadaredux-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 AvadaRedux.', 'avadaredux-framework'), $tracking) . '</div>';
                 $ret = false;
             }
             // Embedded CDN package
             //use_cdn
             // Arguments
             checkcount();
             $args = '<ol>';
             $args .= "<li><code>'save_defaults' => false</code></li>";
             $args .= "<li><code>'use_cdn' => false</code></li>";
             $args .= "<li><code>'customizer_only' => true</code> Non-Customizer Based Panels are Prohibited within WP.org Themes</li>";
             $args .= "<li><code>'database' => 'theme_mods'</code> (" . __('Optional', 'avadaredux-framework') . ")</li>";
             $args .= '</ol>';
             $this->error[] = '<div class="avadaredux-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 AvadaRedux configuration.', 'avadaredux-framework') . $args . '</div>';
         }
     }
     return $ret;
 }
Example #2
0
 function check($php_files, $css_files, $other_files)
 {
     $ret = true;
     $check = AvadaRedux_ThemeCheck::get_instance();
     $avadaredux = $check::get_avadaredux_details($php_files);
     if ($avadaredux) {
         $blacklist = array('.tx' => __('AvadaRedux localization utilities', 'themecheck'), 'bin' => __('AvadaRedux Resting Diles', 'themecheck'), 'codestyles' => __('AvadaRedux Code Styles', 'themecheck'), 'tests' => __('AvadaRedux Unit Testing', 'themecheck'), 'class.avadaredux-plugin.php' => __('AvadaRedux Plugin File', 'themecheck'), 'bootstrap_tests.php' => __('AvadaRedux Boostrap Tests', 'themecheck'), '.travis.yml' => __('CI Testing FIle', 'themecheck'), 'phpunit.xml' => __('PHP Unit Testing', 'themecheck'));
         $errors = array();
         foreach ($blacklist as $file => $reason) {
             checkcount();
             if (file_exists($avadaredux['parent_dir'] . $file)) {
                 $errors[$avadaredux['parent_dir'] . $file] = $reason;
             }
         }
         if (!empty($errors)) {
             $error = '<span class="tc-lead tc-required">REQUIRED</span> ' . __('It appears that you have embedded the full AvadaRedux package inside your theme. You need only embed the <strong>AvadaReduxCore</strong> folder. Embedding anything else will get your rejected from theme submission. Suspected AvadaRedux package file(s):', 'avadaredux-framework');
             $error .= '<ol>';
             foreach ($errors as $key => $e) {
                 $error .= '<li><strong>' . $e . '</strong>: ' . $key . '</li>';
             }
             $error .= '</ol>';
             $this->error[] = '<div class="avadaredux-error">' . $error . '</div>';
             $ret = false;
         }
     }
     return $ret;
 }
         * @since     1.0.1
         */
        public function enqueue_admin_styles()
        {
            $screen = get_current_screen();
            if ('appearance_page_themecheck' == $screen->id) {
                wp_enqueue_style($this->slug . '-admin-styles', AvadaReduxFramework::$_url . 'inc/themecheck/css/admin.css', array(), $this->version);
            }
        }
        /**
         * Register and enqueue admin-specific JavaScript.
         *
         * @since     1.0.1
         */
        public function enqueue_admin_scripts()
        {
            $screen = get_current_screen();
            if ('appearance_page_themecheck' == $screen->id) {
                wp_enqueue_script($this->slug . '-admin-script', AvadaReduxFramework::$_url . 'inc/themecheck/js/admin.js', array('jquery'), $this->version);
                if (!isset($_POST['themename'])) {
                    $intro = '';
                    $intro .= '<h2>AvadaRedux Theme-Check</h2>';
                    $intro .= '<p>Extra checks for AvadaRedux to ensure you\'re ready for marketplace submission to marketplaces.</p>';
                    $avadaredux_check_intro['text'] = $intro;
                    wp_localize_script($this->slug . '-admin-script', 'avadaredux_check_intro', $avadaredux_check_intro);
                }
            }
        }
    }
    AvadaRedux_ThemeCheck::get_instance();
}