Exemple #1
0
 public function __construct(&$plugin)
 {
     $this->p =& $plugin;
     if (is_object($this->p->debug) && method_exists($this->p->debug, 'mark')) {
         $this->p->debug->mark();
     }
     $this->active_plugins = WpssoUtil::active_plugins();
     if (!is_admin()) {
         // disable jetPack open graph meta tags
         if (class_exists('JetPack') || isset($this->active_plugins['jetpack/jetpack.php'])) {
             add_filter('jetpack_enable_opengraph', '__return_false', 99);
             add_filter('jetpack_enable_open_graph', '__return_false', 99);
             add_filter('jetpack_disable_twitter_cards', '__return_true', 99);
         }
         // disable Yoast SEO social meta tags
         if (function_exists('wpseo_init') || isset($this->active_plugins['wordpress-seo/wp-seo.php'])) {
             add_action('template_redirect', array($this, 'cleanup_wpseo_filters'), 9999);
         }
         if (class_exists('Ngfb') || isset($this->active_plugins['nextgen-facebook/nextgen-facebook.php'])) {
             if (!defined('NGFB_META_TAGS_DISABLE')) {
                 define('NGFB_META_TAGS_DISABLE', true);
             }
         }
     }
     do_action($this->p->cf['lca'] . '_init_check', $this->active_plugins);
 }
Exemple #2
0
 public function add_header()
 {
     $lca = $this->p->cf['lca'];
     if ($this->p->debug->enabled) {
         $this->p->util->log_is_functions();
     }
     if ($this->p->is_avail['mt']) {
         echo $this->get_header_html(apply_filters($lca . '_header_use_post', false));
     } else {
         echo "\n<!-- " . $lca . " meta tags disabled -->\n";
     }
     // include additional information when debug mode is on
     if ($this->p->debug->enabled) {
         // show debug log
         $this->p->debug->show_html(null, 'debug log');
         // show constants
         $defined_constants = get_defined_constants(true);
         $defined_constants['user']['WPSSO_NONCE'] = '********';
         if (is_multisite()) {
             $this->p->debug->show_html(SucomUtil::preg_grep_keys('/^(MULTISITE|^SUBDOMAIN_INSTALL|.*_SITE)$/', $defined_constants['user']), 'multisite constants');
         }
         $this->p->debug->show_html(SucomUtil::preg_grep_keys('/^WPSSO_/', $defined_constants['user']), 'wpsso constants');
         // show active plugins
         $this->p->debug->show_html(print_r(WpssoUtil::active_plugins(), true), 'active plugins');
         // show available modules
         $this->p->debug->show_html(print_r($this->p->is_avail, true), 'available features');
         // show all plugin options
         $opts = $this->p->options;
         foreach ($opts as $key => $val) {
             switch (true) {
                 case strpos($key, '_js_') !== false:
                 case strpos($key, '_css_') !== false:
                 case preg_match('/_(html|key|tid)$/', $key):
                     $opts[$key] = '********';
                     break;
             }
         }
         $this->p->debug->show_html($opts, 'wpsso settings');
     }
     // end of debug information
 }
Exemple #3
0
        public function show_setting_page()
        {
            if (!$this->is_setting($this->menu_id)) {
                // the "setting" pages display their own error messages
                settings_errors(WPSSO_OPTIONS_NAME);
            }
            // display "error" and "updated" messages
            $this->set_form_property();
            // define form for side boxes and show_form_content()
            if ($this->p->debug->enabled) {
                $this->p->debug->show_html(print_r($this->p->is_avail, true), 'available features');
                $this->p->debug->show_html(print_r(WpssoUtil::active_plugins(), true), 'active plugins');
                $this->p->debug->show_html(null, 'debug log');
            }
            ?>

			<div class="wrap" id="<?php 
            echo $this->pagehook;
            ?>
">
				<h1><?php 
            echo $this->p->cf['plugin'][$this->p->cf['lca']]['short'] . self::$is_suffix . ' &ndash; ' . $this->menu_name;
            ?>
</h1>
				<div id="poststuff" class="metabox-holder has-right-sidebar">
					<div id="side-info-column" class="inner-sidebar">
						<?php 
            do_meta_boxes($this->pagehook, 'side', null);
            ?>
					</div><!-- .inner-sidebar -->
					<div id="post-body" class="has-sidebar">
						<div id="post-body-content" class="has-sidebar-content">
							<?php 
            $this->show_form_content();
            ?>
						</div><!-- .post-body-content -->
					</div><!-- .post-body -->
				</div><!-- .metabox-holder -->
			</div><!-- .wrap -->
			<script type="text/javascript">
				//<![CDATA[
				jQuery(document).ready( 
					function($) {
						// close postboxes that should be closed
						$('.if-js-closed').removeClass('if-js-closed').addClass('closed');
						// postboxes setup
						postboxes.add_postbox_toggles('<?php 
            echo $this->pagehook;
            ?>
');
					}
				);
				//]]>
			</script>
			<?php 
        }