Exemple #1
0
 public function __construct()
 {
     // Add additional action after saving (must be above parent constructor!)
     add_action('buzz-seo-settings-page-save-SettingsAdmin', array($this, 'rewritePermalinks'), 10, 2);
     // Allow seeing the results of our save immidiately
     add_action('buzz-seo-settings-page-save-SettingsAdmin', array($this, 'redirectAfterSave'), 99, 2);
     parent::__construct('SettingsAdmin');
     if (isset($_GET['saved'])) {
         $this->setTalData('message', __("Settings saved.", "buzz-seo"));
     }
     // grab app
     $seo = \NextBuzz\SEO\App::getInstance();
     // grapping every feature
     $features = $seo->getFeatures();
     // check if its an array
     if (is_array($features) == false) {
         throw new \Exception(__("No Features available", "buzz-seo"), 401);
     }
     $optionList = array();
     /* @var $class \NextBuzz\SEO\Features\BaseFeature */
     foreach ($features as $key => $class) {
         if ($class->allowDisable()) {
             array_push($optionList, array('key' => $key, 'name' => ucfirst($class->name()), 'desc' => ucfirst($class->desc()), 'check' => isset($this->options['features'][$key]) && $this->options['features'][$key] === "1"));
         }
     }
     $this->setTalData(array('options' => $optionList, 'hasOptions' => count($optionList) > 0));
 }
Exemple #2
0
 Author: Next Buzz BV
 Author URI: https://www.nextbuzz.nl
 License: MIT
 Text Domain: buzz-seo
*/
// Set the folder of this plugin
if (!defined('BUZZSEO_DIR')) {
    define('BUZZSEO_VERSION', '0.10.2');
    define('BUZZSEO_FILE', __FILE__);
    define('BUZZSEO_DIR', plugin_dir_path(__FILE__));
    define('BUZZSEO_DIR_REL', dirname(plugin_basename(__FILE__)));
}
// Make sure we don't expose any info if called directly
if (!function_exists('add_action')) {
    echo 'Silence is golden.';
    exit;
}
// Check wordpress version
if (isset($wp_version) && version_compare($wp_version, '4.4.0', '>=') && version_compare(PHP_VERSION, '5.3.0', '>=')) {
    // Load the autoloader
    require_once 'vendor/autoload.php';
    // Load our application
    if (class_exists('\\NextBuzz\\SEO\\App')) {
        \NextBuzz\SEO\App::getInstance();
    }
} else {
    // Output a nag error on admin interface
    add_action('admin_notices', function () {
        echo '<div class="error"><p>Plugin Buzz SEO is enabled but doesn\'t work since WP or PHP version requirements are not met. Buzz SEO <strong>requires</strong> at least <strong>WP 4.4.0</strong> and <strong>PHP 5.3.0</strong>.</p></div>';
    });
}